浏览代码

2022-12-07/Jerry Wang
[OCPP 1.6]
Action:
1. Fix the problem that charger cannot send out queues if HeartbeatInterval is 0.
2. Modify StopTxSampleData queuing meterValue quantity limit to 200.

File:
1. EVSE/Modularization/ocppfiles/MessageHandler.c
--> Action 1,2

Jerry Wang 2 年之前
父节点
当前提交
472bb1fba1
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      EVSE/Modularization/ocppfiles/MessageHandler.c

+ 6 - 3
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -8841,7 +8841,7 @@ int sendMeterValuesRequest(int gun_index, ReadingContext dataType)
 			{
 				json_object_object_add(MeterValueBuffer, "timestamp", json_object_new_string((char*)ShmOCPP16Data->MeterValues[gun_index].MeterValue[idxMeter].TimeStamp));
 				json_object_object_add(MeterValueBuffer, "sampledValue", sampledValuesBuffer);
-				if(meterValueBufferDataQuantity(gun_index, dataType) < 250) meterValueBufferInsert(gun_index, dataType, ShmOCPP16Data->MeterValues[gun_index].TransactionId, (char*)json_object_to_json_string_ext(MeterValueBuffer, JSON_C_TO_STRING_PLAIN));
+				if(meterValueBufferDataQuantity(gun_index, dataType) < 200) meterValueBufferInsert(gun_index, dataType, ShmOCPP16Data->MeterValues[gun_index].TransactionId, (char*)json_object_to_json_string_ext(MeterValueBuffer, JSON_C_TO_STRING_PLAIN));
 				json_object_put(MeterValueBuffer);
 			}
 			else
@@ -22955,10 +22955,13 @@ void InitialSystemValue(void)
 	TransactionMessageAttemptsValue = atoi((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[TransactionMessageAttempts].ItemData);
 	TransactionMessageRetryIntervalValue = atoi((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[TransactionMessageRetryInterval].ItemData);
 
-	//Hear Beat
+	//Heart Beat
 	HeartBeatWithNOResponse = 0;
 	HeartBeatWaitTime = atoi((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[HeartbeatInterval].ItemData);;
-	FirstHeartBeat = 0;
+	if(HeartBeatWaitTime == 0)
+		FirstHeartBeat = TRUE;
+	else
+		FirstHeartBeat = FALSE;
 
 	FirmwareStatusNotificationStatus = FIRMWARE_STATUS_IDLE;  // Idle
 	DiagnosticsStatusNotificationStatus = DIAGNOSTIC_STATUS_IDLE; // Idle