Explorar o código

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 %!s(int64=2) %!d(string=hai) anos
pai
achega
472bb1fba1
Modificáronse 1 ficheiros con 6 adicións e 3 borrados
  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