|
@@ -91,6 +91,12 @@ static struct OCPPAuthLocalElemet
|
|
|
char idTagstatus[16];
|
|
|
}idTagQuery;
|
|
|
|
|
|
+//============================================
|
|
|
+// OCPP MeterValue request flag
|
|
|
+//============================================
|
|
|
+uint8_t reqSampleMeter[CONNECTOR_QUANTITY]={0};
|
|
|
+uint8_t reqClockAlignMeter[CONNECTOR_QUANTITY]={0};
|
|
|
+
|
|
|
//=============================================
|
|
|
// OCPP HeartBeat Response Not Receive Counts
|
|
|
//============================================
|
|
@@ -3922,9 +3928,6 @@ end:
|
|
|
|
|
|
void CheckSystemValue(void)
|
|
|
{
|
|
|
- uint8_t reqSampleMeter[CONNECTOR_QUANTITY]={0};
|
|
|
- uint8_t reqClockAlignMeter[CONNECTOR_QUANTITY]={0};
|
|
|
-
|
|
|
char filenmae[100]={0};
|
|
|
char str[100]={0};
|
|
|
int tempIndex = 0;
|
|
@@ -3942,6 +3945,107 @@ void CheckSystemValue(void)
|
|
|
HeartBeatWithNOResponse += 2;
|
|
|
}
|
|
|
|
|
|
+ for(int gun_index=0;gun_index < gunTotalNumber;gun_index++)
|
|
|
+ {
|
|
|
+ // ClockAlign MeterValue
|
|
|
+ if(isWebsocketSendable && (server_sign == TRUE) && ((atoi((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData) > 0)?((getTimePassSinceToday(gun_index)%(atoi((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData)))==0):FALSE))
|
|
|
+ {
|
|
|
+ if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
|
|
|
+ {
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ // 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ reqClockAlignMeter[gun_index] = 1;
|
|
|
+ }
|
|
|
+ }// End for CHAdeMO
|
|
|
+ }
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_CCS)
|
|
|
+ {
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int index = 0; index < CCS_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ // 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ reqClockAlignMeter[gun_index] = 1;
|
|
|
+ }
|
|
|
+ } // End for CCS
|
|
|
+ }
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_GBT)
|
|
|
+ {
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int index = 0; index < GB_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ // 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ reqClockAlignMeter[gun_index] = 1;
|
|
|
+ }
|
|
|
+ }// End for GB
|
|
|
+ }
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_DO)
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+
|
|
|
+ for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ // 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
+ {
|
|
|
+ reqClockAlignMeter[gun_index] = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ {
|
|
|
+ tempIndex = 2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ // 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ reqClockAlignMeter[gun_index] = 1;
|
|
|
+ }
|
|
|
+ }//End for AC
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
for(int gun_index=0;gun_index < gunTotalNumber ;gun_index++)
|
|
|
{
|
|
|
//==========================================
|
|
@@ -4347,104 +4451,7 @@ void CheckSystemValue(void)
|
|
|
cpinitateMsg.bits[gun_index].TriggerMeterValue = 0;
|
|
|
}
|
|
|
|
|
|
- // ClockAlign MeterValue
|
|
|
- if(isWebsocketSendable && (server_sign == TRUE) && ((atoi((char*)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData) > 0)?((getTimePassSinceToday(gun_index)%(atoi((char*)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData)))==0):FALSE))
|
|
|
- {
|
|
|
- if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
- {
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
-
|
|
|
- for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
- {
|
|
|
- // 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
|
|
|
- if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
- {
|
|
|
- reqClockAlignMeter[gun_index] = 1;
|
|
|
- }
|
|
|
- }// End for CHAdeMO
|
|
|
- }
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_CCS)
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
- {
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
-
|
|
|
- for (int index = 0; index < CCS_QUANTITY; index++)
|
|
|
- {
|
|
|
- // 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
|
|
|
- if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
- {
|
|
|
- reqClockAlignMeter[gun_index] = 1;
|
|
|
- }
|
|
|
- } // End for CCS
|
|
|
- }
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_GBT)
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
- {
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
-
|
|
|
- for (int index = 0; index < GB_QUANTITY; index++)
|
|
|
- {
|
|
|
- // 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
|
|
|
- if(ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
- {
|
|
|
- reqClockAlignMeter[gun_index] = 1;
|
|
|
- }
|
|
|
- }// End for GB
|
|
|
- }
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_DO)
|
|
|
- {
|
|
|
- tempIndex = gun_index;
|
|
|
-
|
|
|
- for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
- {
|
|
|
- // 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
|
|
|
- if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
- {
|
|
|
- reqClockAlignMeter[gun_index] = 1;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
- {
|
|
|
- tempIndex = 2;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
-
|
|
|
- for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
- {
|
|
|
- // 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
|
|
|
- if(ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
- {
|
|
|
- reqClockAlignMeter[gun_index] = 1;
|
|
|
- }
|
|
|
- }//End for AC
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ // Clock-aligned Meter value
|
|
|
if(isWebsocketSendable && (reqClockAlignMeter[gun_index] == 1))
|
|
|
{
|
|
|
sendMeterValuesRequest(gun_index, ReadingContext_Sample_Clock);
|
|
@@ -4570,6 +4577,7 @@ void CheckSystemValue(void)
|
|
|
sendMeterValuesRequest(gun_index, ReadingContext_Sample_Periodic);
|
|
|
|
|
|
//storeTempStopTransaction(gun_index);
|
|
|
+ reqSampleMeter[gun_index] = 0;
|
|
|
}
|
|
|
|
|
|
refreshStartTimer(&clientTime.MeterValues[gun_index]);
|
|
@@ -11742,6 +11750,12 @@ int handleRemoteStartRequest(char *uuid, char *payload)
|
|
|
strcpy(comfirmstr, RemoteStartStopStatusStr[RemoteStartStopStatus_Rejected]);
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ refreshStartTimer(&clientTime.RemoteStartWait);
|
|
|
+ ShmOCPP16DataPH->MsMsg.bits.isRemoteStartWaitReq = 1;
|
|
|
+ strcpy(comfirmstr, RemoteStartStopStatusStr[RemoteStartStopStatus_Accepted]);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|