|
@@ -52,6 +52,8 @@ struct GBTData *ShmGBTData;
|
|
|
struct CcsData *ShmCcsData;
|
|
|
struct PsuData *ShmPsuData;
|
|
|
struct PrimaryMcuData *ShmPrimaryMcuData;
|
|
|
+struct OCPP16Data *ShmOCPP16Data;
|
|
|
+struct OCPP20Data *ShmOCPP20Data;
|
|
|
#ifdef DO360
|
|
|
ChargerInfoData *ShmChargerInfo;
|
|
|
struct ChargingInfoData *_chargingData[4];
|
|
@@ -304,6 +306,41 @@ int InitShareMemory() {
|
|
|
result = FAIL;
|
|
|
} else {
|
|
|
}
|
|
|
+
|
|
|
+ //creat ShmOCPP16Data
|
|
|
+ if ((MeterSMId = shmget(ShmOcppModuleKey, sizeof(struct OCPP16Data), 0777)) < 0)
|
|
|
+ {
|
|
|
+
|
|
|
+ DEBUG_ERROR("shmget ShmOCPP16Data NG\n");
|
|
|
+
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+ else if ((ShmOCPP16Data = shmat(MeterSMId, NULL, 0)) == (void *) -1)
|
|
|
+ {
|
|
|
+
|
|
|
+ DEBUG_ERROR("shmat ShmOCPP16Data NG\n");
|
|
|
+
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+ memset(ShmOCPP16Data,0,sizeof(struct OCPP16Data));
|
|
|
+
|
|
|
+ //creat ShmOCPP20Data
|
|
|
+ if ((MeterSMId = shmget(ShmOcpp20ModuleKey, sizeof(struct OCPP20Data), 0777)) < 0)
|
|
|
+ {
|
|
|
+
|
|
|
+ DEBUG_ERROR("shmget OCPP20Data NG\n");
|
|
|
+
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+ else if ((ShmOCPP20Data = shmat(MeterSMId, NULL, 0)) == (void *) -1)
|
|
|
+ {
|
|
|
+
|
|
|
+ DEBUG_ERROR("shmat OCPP20Data NG\n");
|
|
|
+
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+ memset(ShmOCPP20Data,0,sizeof(struct OCPP20Data));
|
|
|
+
|
|
|
#ifdef DO360
|
|
|
//creat ShmChargerInfo
|
|
|
if ((MeterSMId = shmget(SM_ChargerInfoKey, sizeof(ChargerInfoData), IPC_CREAT | 0777)) < 0)
|
|
@@ -1322,7 +1359,23 @@ int main(int argc, char *argv[]) {
|
|
|
|
|
|
if (strcmp(argv[1], "restart") == 0)
|
|
|
{
|
|
|
- system("exec /usr/bin/run_evse_restart.sh");
|
|
|
+ if((ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16) && (system("pidof -s OcppBackend > /dev/null") == 0))
|
|
|
+ {
|
|
|
+ sprintf((char*)ShmOCPP16Data->Reset.Type, "Soft");
|
|
|
+ ShmOCPP16Data->MsMsg.bits.ResetReq = 1;
|
|
|
+ DEBUG_INFO("Soft reset by OCPP1.6 form web page.\n");
|
|
|
+ }
|
|
|
+ else if((ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20) && (system("pidof -s OcppBackend20 > /dev/null") == 0))
|
|
|
+ {
|
|
|
+ sprintf((char*)ShmOCPP20Data->Reset.type, "OnIdle");
|
|
|
+ ShmOCPP20Data->MsMsg.bits.ResetReq = 1;
|
|
|
+ DEBUG_INFO("Soft reset by OCPP2.0.1 form web page.\n");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ system("exec /usr/bin/run_evse_restart.sh");
|
|
|
+ DEBUG_INFO("Soft reset directly form web page.\n");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|