#ifndef __OCPP16_OFFLINE_CHARGING_RECORDS_H__
#define __OCPP16_OFFLINE_CHARGING_RECORDS_H__
#include "msystem.h"
#include "ocpp16.h"
#include "ocpp16_configkey.h"

/****************************************************************************************************/

typedef struct MeterEnergy
{
    time_t timestamp;
    float energyKWh;
}MeterEnergy_t;

typedef struct ChargingRecord
{
    int connectorId;
    int transactionId;
    IdToken_t idTag;
    time_t startTime;
    time_t stopTime;
    float startKWh;
    float stopKWh;

    int   count;
    int   maxLength;
    MeterEnergy_t *items;

    time_t lastTime;
}ChargingRecord_t;


/****************************************************************************************************/
extern ChargingRecord_t gunArecord;
extern ChargingRecord_t gunBrecord;
void ocpp16_OfflineChargingRecords_startup(void *secc);
void ocpp16_OfflineChargingRecords_metervalues(void *secc);
void ocpp16_OfflineChargingRecords_shutdown(void *secc);

void ocpp16_OfflineChargingRecords_upload(void);
void ocpp16_OfflineChargingRecords_exit(void);

#endif//__OCPP16_OFFLINE_CHARGING_RECORDS_H__
