瀏覽代碼

2023-02-24/Jerry Wang
[OCPP 1.6PH]
Action:
1. Fix some logic which mapped to wrong sharememory data.

File:
1. EVSE/Modularization/ocppph/MessageHandler.c
--> Action 1

Jerry Wang 2 年之前
父節點
當前提交
4abf7ceb2e
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      EVSE/Modularization/ocppph/MessageHandler.c

+ 4 - 4
EVSE/Modularization/ocppph/MessageHandler.c

@@ -917,7 +917,7 @@ void reportReaderStatus(int gun_index)
 			buf,
 			ShmOCPP16DataPH->TcciCustomData.SerialNo[gun_index],
 			ShmOCPP16DataPH->TcciCustomData.ReaderStatus[gun_index].creditNo,
-			ShmOCPP16Data->TcciCustomData.VEMData[gun_index]);
+			ShmOCPP16DataPH->TcciCustomData.VEMData[gun_index]);
 
 	ShmOCPP16DataPH->CsMsg.bits[0].DataTransferReq = 1;
 }
@@ -4418,7 +4418,7 @@ void CheckSystemValue(void)
 	for(int gun_index=0;gun_index < gunTotalNumber;gun_index++)
 	{
 		// ClockAlign MeterValue
-		if((server_sign == TRUE) && ((atoi((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData) > 0)?((getTimePassSinceToday(gun_index)%(atoi((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData)))==0):FALSE))
+		if((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)
 			{
@@ -10742,7 +10742,7 @@ int handleDataTransferRequest(char *uuid, char *payload)
 								if(json_object_object_get(json_object_object_get(data, "triggerMeterValue"), "atCPStatus") != NULL)
 								{
 									DEBUG_INFO("triggerMeterValue-atCPStatus: %s\n", json_object_get_string(json_object_object_get(json_object_object_get(data, "triggerMeterValue"), "atCPStatus")));
-									sprintf((char*)ShmOCPP16Data->Cost.RunningCost[idx].triggerMeterValue.atCPStatus, "%s", json_object_get_string(json_object_object_get(json_object_object_get(data, "triggerMeterValue"), "atCPStatus")));
+									sprintf((char*)ShmOCPP16DataPH->Cost.RunningCost[idx].triggerMeterValue.atCPStatus, "%s", json_object_get_string(json_object_object_get(json_object_object_get(data, "triggerMeterValue"), "atCPStatus")));
 								}
 							}
 						}
@@ -11150,7 +11150,7 @@ int handleDataTransferRequest(char *uuid, char *payload)
 								json_object_object_add(responsedata, "ConnectorId", json_object_new_int(gun_index+1));
 								json_object_object_add(responsedata, "SerialNo", json_object_new_string((char*)ShmOCPP16DataPH->TcciCustomData.SerialNo[gun_index]));
 								json_object_object_add(responsedata, "StartTime", json_object_new_string((char*)ShmOCPP16DataPH->StartTransaction[gun_index].Timestamp));
-								json_object_object_add(responsedata, "VEMData", json_object_new_string((char*)ShmOCPP16Data->TcciCustomData.VEMData[gun_index]));
+								json_object_object_add(responsedata, "VEMData", json_object_new_string((char*)ShmOCPP16DataPH->TcciCustomData.VEMData[gun_index]));
 								json_object_object_add(response, "data", json_object_new_string(json_object_to_json_string_ext(responsedata, JSON_C_TO_STRING_PLAIN)));
 							}
 							else