|
@@ -6633,6 +6633,108 @@ void CheckSystemValue(void)
|
|
|
ShmOCPP20Data->SpMsg.bits.Get15118EVCertificateReq = OFF;
|
|
|
}
|
|
|
|
|
|
+ for(int gun_index=0;gun_index < gunTotalNumber;gun_index++)
|
|
|
+ {
|
|
|
+ // ClockAlign MeterValue
|
|
|
+ if(isWebsocketSendable && (server_sign == TRUE) && ((atoi((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableAttribute[0].value) > 0)?((getTimePassSinceToday(gun_index)%(atoi((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableAttribute[0].value)))==0):FALSE))
|
|
|
+ {
|
|
|
+ //check Transaction active
|
|
|
+ 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)
|
|
|
+ {
|
|
|
+ cpinitateMsg.bits[gun_index].ClockAlignMeterReq = ON;
|
|
|
+ }
|
|
|
+ }// 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)
|
|
|
+ {
|
|
|
+ cpinitateMsg.bits[gun_index].ClockAlignMeterReq = ON;
|
|
|
+ }
|
|
|
+ } // 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)
|
|
|
+ {
|
|
|
+ cpinitateMsg.bits[gun_index].SampleMeterReq = ON;
|
|
|
+ }
|
|
|
+ }// 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)
|
|
|
+ {
|
|
|
+ cpinitateMsg.bits[gun_index].ClockAlignMeterReq = ON;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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)
|
|
|
+ {
|
|
|
+ cpinitateMsg.bits[gun_index].ClockAlignMeterReq = ON;
|
|
|
+ }
|
|
|
+ }//End for AC
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//===============================
|
|
|
// Each connector operation check
|
|
@@ -6979,106 +7081,6 @@ void CheckSystemValue(void)
|
|
|
cpinitateMsg.bits[gun_index].TriggerMeterValueReq = OFF;
|
|
|
}
|
|
|
|
|
|
- // ClockAlign MeterValue
|
|
|
- if(isWebsocketSendable && (server_sign == TRUE) && ((atoi((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableAttribute[0].value) > 0)?((getTimePassSinceToday(gun_index)%(atoi((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableAttribute[0].value)))==0):FALSE))
|
|
|
- {
|
|
|
- //check Transaction active
|
|
|
- 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)
|
|
|
- {
|
|
|
- cpinitateMsg.bits[gun_index].ClockAlignMeterReq = ON;
|
|
|
- }
|
|
|
- }// 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)
|
|
|
- {
|
|
|
- cpinitateMsg.bits[gun_index].ClockAlignMeterReq = ON;
|
|
|
- }
|
|
|
- } // 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)
|
|
|
- {
|
|
|
- cpinitateMsg.bits[gun_index].SampleMeterReq = ON;
|
|
|
- }
|
|
|
- }// 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)
|
|
|
- {
|
|
|
- cpinitateMsg.bits[gun_index].ClockAlignMeterReq = ON;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- 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)
|
|
|
- {
|
|
|
- cpinitateMsg.bits[gun_index].ClockAlignMeterReq = ON;
|
|
|
- }
|
|
|
- }//End for AC
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
if(isWebsocketSendable && (cpinitateMsg.bits[gun_index].ClockAlignMeterReq == ON))
|
|
|
{
|
|
|
sendMeterValuesRequest(gun_index, ReadingContextEnumType_Sample_Clock);
|