|
@@ -16210,9 +16210,7 @@ void storeTempStopTransaction(int gun_index)
|
|
|
json_object_object_add(StopTransaction, "meterStop", json_object_new_int(ShmOCPP16Data->StopTransaction[gun_index].MeterStop));
|
|
|
json_object_object_add(StopTransaction, "transactionId", json_object_new_int(ShmOCPP16Data->StopTransaction[gun_index].TransactionId));
|
|
|
json_object_object_add(StopTransaction, "timestamp", json_object_new_string((char*)ShmOCPP16Data->StopTransaction[gun_index].Timestamp));
|
|
|
-
|
|
|
- if(strlen((char*)ShmOCPP16Data->StopTransaction[gun_index].StopReason) > 0)
|
|
|
- json_object_object_add(StopTransaction, "reason", json_object_new_string((char*)ShmOCPP16Data->StopTransaction[gun_index].StopReason));
|
|
|
+ json_object_object_add(StopTransaction, "reason", json_object_new_string("PowerLoss"));
|
|
|
|
|
|
for(int idxTrans = 0;idxTrans<ARRAY_SIZE(ShmOCPP16Data->StopTransaction[gun_index].TransactionData);idxTrans++)
|
|
|
{
|
|
@@ -16389,6 +16387,22 @@ void GetOcppSecurityPassword(uint8_t *data)
|
|
|
sprintf((char*)data, "%s", ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizationKey].ItemData);
|
|
|
}
|
|
|
|
|
|
+void SetOcppVersion(uint8_t *version)
|
|
|
+{
|
|
|
+ for (uint8_t idx=0; idx<strlen((char*)version); idx++) version[idx] = tolower(version[idx]);
|
|
|
+
|
|
|
+ DEBUG_INFO("ocpp version: %s\n", version);
|
|
|
+ if(strstr((char*)version, "ocpp1.6") != NULL)
|
|
|
+ {
|
|
|
+ ShmSysConfigAndInfo->SysConfig.OcppRunningVer = OCPP_RUNNING_VERSION_16;
|
|
|
+ }
|
|
|
+ else if(strstr((char*)version, "ocpp2.0") != NULL)
|
|
|
+ {
|
|
|
+ ShmSysConfigAndInfo->SysConfig.OcppRunningVer = OCPP_RUNNING_VERSION_20;
|
|
|
+ system("pkill OcppBackend");
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void SetServerSign(int value)
|
|
|
{
|
|
|
server_sign = value;
|