@@ -366,7 +372,7 @@ int DB_Event_Insert_Record(sqlite3 *db, uint8_t *statusCode)
DEBUG_INFO( "Insert local event record error message: %s\n", errMsg);
}
- sprintf(sqlStr, "delete from event_record where idx < (select idx from event_record order by idx desc limit 1)-2000;");
+ sprintf(sqlStr, "delete from event_record where (idx < (select idx from event_record order by idx desc limit 1)-2000) and (occurDatetime < '%04d-01-01 00:00:00');", (getCurrentYear()-3));
if (sqlite3_exec(db, sqlStr, 0, 0, &errMsg) != SQLITE_OK)
+ if (sqlite3_exec(db, sqlStr, 0, 0, &errMsg) != SQLITE_OK)
+ {
+ result = FAIL;
+ DEBUG_INFO( "Insert local transaction record error message: %s\n", errMsg);
+ }
+
+ sprintf(sqlStr, "delete from ocpp20_transaction_record where (idx < (select idx from ocpp_transaction_record order by idx desc limit 1)-2000) and (occurDatetime < '%04d-01-01 00:00:00');", (getCurrentYear()-3));
+ if (sqlite3_exec(db, sqlStr, 0, 0, &errMsg) != SQLITE_OK)
+ {
+ result = FAIL;
+ DEBUG_INFO( "delete local transaction record error message: %s\n", errMsg);
+ }
+
+ return result;
+}
//==========================================
// Check time passed since today
//==========================================
@@ -3002,6 +3053,115 @@ int getTimePassSinceToday()
- SysConfig.DefaultLanguage = 0; // 0:English 1:Big5 2: GB 3: JN 4: Français 5: Italiano 6: Español 7: Deutsch 8: Nederland 9: Norsk 10: Suomalainen 11: Svenska 12: Pусский 13: ไทย
- SysConfig.RfidCardNumEndian = 0; // 0: Little endian 1: Big endian
+ SysConfig.DefaultLanguage = 0; // 0: English 1: Big5 2: GB 3: JN 4: Français 5: Italiano 6: Español 7: Deutsch 8: Nederland 9: Norsk 10: Suomalainen 11: Svenska 12: Pусский 13: ไทย
+ SysConfig.RfidCardNumEndian = 0; // 0: Little endian 1: Big endian
+ SysConfig.BillingData.isBilling = 0; // 0: not for business 1: for business
@@ -1235,7 +1253,7 @@ int DB_Insert_Record(sqlite3 *db, int gun_index)
DEBUG_INFO( "Insert local charging record successfully\n");
}
- sprintf(sqlStr, "delete from charging_record where idx < (select idx from charging_record order by idx desc limit 1)-2000;");
+ sprintf(sqlStr, "delete from charging_record where (idx < (select idx from charging_record order by idx desc limit 1)-2000) and (dateTimeStop < '%04d.01.01 00:00:00');", (getCurrentYear()-3));
if (sqlite3_exec(db, sqlStr, 0, 0, &errMsg) != SQLITE_OK)
{
result = FAIL;
@@ -1599,6 +1617,8 @@ int LoadSysConfigAndInfo(struct SysConfigData *ptr)
+ SysConfig.DefaultLanguage = 0; // 0:English 1:Big5 2: GB 3: JN 4: Français 5: Italiano 6: Español 7: Deutsch 8: Nederland 9: Norsk 10: Suomalainen 11: Svenska 12: Pусский 13: ไทย
+ SysConfig.RfidCardNumEndian = 1; // 0: Little endian 1: Big endian
+ DEBUG_INFO("MCU-%d set breathe led timing : Authed Fade in [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_In);
+ DEBUG_INFO("MCU-%d set breathe led timing : Authed Fade out [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_Out);
+ DEBUG_INFO("MCU-%d set breathe led timing : Charging Fade in [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.Set_Led_Action_Chaging_Fade_In);
+ DEBUG_INFO("MCU-%d set breathe led timing : Charging Fade out [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Chaging_Fade_Out);
+ DEBUG_INFO("MCU-%d set breathe led timing : Connected Fade in [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_In);
+ DEBUG_INFO("MCU-%d set breathe led timing : Connected Fade out [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_Out);
+ DEBUG_INFO("Connector-%d charging duration(%d) already over max duration(%d) in second.\n", gun_index, ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration, (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration*60));
+ DEBUG_INFO("Connector-%d charging energy(%.2f) already over max energy(%.2f) in KWH.\n", gun_index, ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy, ((float)ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy));
+ DEBUG_INFO("Connector-%d charging duration(%d) already over off-line max duration(%d) in second.\n", gun_index, ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration, (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration*60));
+ DEBUG_INFO("Connector-%d charging energy(%.2f) already over off-line max energy(%.2f) in KWH.\n", gun_index, ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy, ((float)ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy));
+ unsigned char hashAlgorithm[8]; // Required. Used algorithms for the hashes provided.
+ unsigned char issuerNameHash[129]; // Required. hashed value of the IssuerName.
+ unsigned char issuerKeyHash[129]; // Required. Hashed value of the issuers public key
+ unsigned char serialNumber[41]; // Required. The serial number of the certificate.
+};
+
+struct LogParametersType
+{
+ unsigned char remoteLocation[513]; // Required. The URL of the location at the remote system where the log should be stored.
+ unsigned char oldestTimestamp[28]; // Optional. This contains the date and time of the oldest logging information to include in the diagnostics.
+ unsigned char latestTimestamp[28]; // Optional. This contains the date and time of the latest logging information to include in the diagnostics.
+};
+
+struct FirmwareType
+{
+ unsigned char location[513]; // Required. URI defining the origin of the firmware.
+ unsigned char retrieveDateTime[28]; // Required. Date and time at which the firmware shall be retrieved.
+ unsigned char installDateTime[28]; // Optional. Date and time at which the firmware shall be installed.
+ unsigned char signingCertificate[5501]; // Optional. Certificate with which the firmware was signed. X.509 certificate, first DER encoded into binary, and then Base64 encoded.
- unsigned char additionalIdToken[36]; // Required. This field specifies the additional IdToken.
+ unsigned char additionalIdToken[37]; // Required. This field specifies the additional IdToken.
unsigned char type[50]; // Required. This defines the type of the additionalIdToken. This is a custom type, so the implementation needs to be agreed upon by all involved parties.
};
@@ -4556,7 +4704,7 @@ struct VPNType
struct GroupIdTokenType
{
- unsigned char idToken[36]; // Required. IdToken is case insensitive. Might hold the hidden id of an RFID tag, but can for example also contain a UUID.
+ unsigned char idToken[37]; // Required. IdToken is case insensitive. Might hold the hidden id of an RFID tag, but can for example also contain a UUID.
unsigned char type[16]; // Required. Enumeration of possible idToken types.
};
@@ -4581,7 +4729,7 @@ struct IdTokenInfoType
struct IdTokenType
{
- unsigned char idToken[36]; // Required. IdToken is case insensitive. Might hold the hidden id of an RFID tag, but can for example also contain a UUID.
+ unsigned char idToken[37]; // Required. IdToken is case insensitive. Might hold the hidden id of an RFID tag, but can for example also contain a UUID.
unsigned char type[16]; // Required. Enumeration of possible idToken types.
struct AdditionalInfoType additionalInfo[10]; // Optional. AdditionalInfo can be used to send extra information which can be validated by the CSMS in addition to the regular authorization with IdToken.
};
@@ -4592,14 +4740,6 @@ struct AuthorizationData
struct IdTokenType idToken; // Required. This contains the identifier which needs to be stored for authorization.
};
-struct CertificateHashDataType
-{
- unsigned char hashAlgorithm[8]; // Required. Used algorithms for the hashes provided.
- unsigned char issuerNameHash[128]; // Required. hashed value of the IssuerName.
- unsigned char issuerKeyHash[128]; // Required. Hashed value of the issuers public key
- unsigned char serialNumber[40]; // Required. The serial number of the certificate.
-};
-
struct CertificateHashDataChainType
{
unsigned char certificateType[32]; // Required. Indicates the type of the requested certificate(s).
@@ -4790,15 +4930,6 @@ struct EventDataType
struct VariableType variable; // Required. Variable for which event is notified.
};
-struct FirmwareType
-{
- unsigned char location[512]; // Required. URI defining the origin of the firmware.
- unsigned char retrieveDateTime[28]; // Required. Date and time at which the firmware shall be retrieved.
- unsigned char installDateTime[28]; // Optional. Date and time at which the firmware shall be installed.
- unsigned char signingCertificate[5500]; // Optional. Certificate with which the firmware was signed. X.509 certificate, first DER encoded into binary, and then Base64 encoded.
struct VariableType variable; // Required. Variable for which the attribute value is requested.
};
-struct LogParametersType
-{
- unsigned char remoteLocation[512]; // Required. The URL of the location at the remote system where the log should be stored.
- unsigned char oldestTimestamp[28]; // Optional. This contains the date and time of the oldest logging information to include in the diagnostics.
- unsigned char latestTimestamp[28]; // Optional. This contains the date and time of the latest logging information to include in the diagnostics.
-};
-
struct MessageInfoType
{
unsigned int id; // Required. Master resource identifier, unique within an exchange context. It is defined within the OCPP context as a positive Integer value (greater or equal to zero).