Procházet zdrojové kódy

[Improve][Modularization][Module_OcppBackend20]

2021.02.04 / Folus Wen

Actions:
1. define.h extend transactionId array size to 37 for OCPP20.
2. Module_OcppBackend20 TransactionEvent flow implement for basic charging process.

Files:
1. As follow commit history

Image version: D0.00.XX.XXXX.XX
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
FolusWen před 4 roky
rodič
revize
cc702c8763

+ 114 - 43
EVSE/Modularization/ocpp20/MessageHandler.c

@@ -1337,6 +1337,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variable.name, "Interval");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableCharacteristics.unit, "Seconds");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
+		ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableCharacteristics.minLimit = 10;
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableAttribute[0].value, "0");
@@ -2074,9 +2075,10 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedInterval].variable.name, "TxUpdatedInterval");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedInterval].variableCharacteristics.unit, "Seconds");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedInterval].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
+		ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedInterval].variableCharacteristics.minLimit = 10;
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedInterval].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedInterval].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedInterval].variableAttribute[0].value, "0");
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedInterval].variableAttribute[0].value, "30");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedInterval]);
 
 		/* SecurityCtrlr Required item */
@@ -5282,7 +5284,7 @@ void CheckSystemValue(void)
 
 		if(isWebsocketSendable &&
 		   (cpinitateMsg.bits[gun_index].StatusNotificationReq == ON) &&
-		   ((time((time_t*)NULL)-clientTime.StatusNotification[gun_index]) > 10) )
+		   ((time((time_t*)NULL)-clientTime.StatusNotification[gun_index]) > 5) )
 		{
 			if(SystemInitial > 0)
 				SystemInitial -= 1;
@@ -5714,7 +5716,6 @@ int sendAuthorizeRequest(int gun_index)
 	strcpy((char *)ShmOCPP20Data->Authorize.idToken.idToken, (const char *)ShmSysConfigAndInfo->SysConfig.UserId);
 	strcpy((char *)ShmOCPP20Data->Authorize.idToken.type, IdTokenEnumTypeStr[IdTokenEnumType_ISO14443]);
 
-
 	json_object_object_add(idToken, "idToken", json_object_new_string((char*)ShmOCPP20Data->Authorize.idToken.idToken));
 	json_object_object_add(idToken, "type", json_object_new_string((char*)ShmOCPP20Data->Authorize.idToken.type));
 	json_object_object_add(Authorize, "idToken", idToken);
@@ -5745,6 +5746,8 @@ int sendBootNotificationRequest()
     json_object *chargingStation = json_object_new_object();
     json_object *modem = json_object_new_object();
 
+    DEBUG_INFO("sendBootNotificationRequest...\n");
+
     // Fill BootNotification fields
     DB_getBooType();
 
@@ -5795,6 +5798,8 @@ int sendClearedChargingLimitRequest(int gun_index)
 	char tempdata[128]={0};
 	json_object *ClearedChargingLimit = json_object_new_object();
 
+	DEBUG_INFO("sendClearedChargingLimitRequest...\n");
+
 	json_object_object_add(ClearedChargingLimit, "chargingLimitSource", json_object_new_string((char*)ShmOCPP20Data->ClearedChargingLimit[gun_index].chargingLimitSource));
 	json_object_object_add(ClearedChargingLimit, "evseId", json_object_new_int(ShmOCPP20Data->ClearedChargingLimit[gun_index].evseId));
 
@@ -5820,6 +5825,8 @@ int sendDataTransferRequest(int gun_index)
 	char tempdata[65]={0};
 	int result = FAIL;
 
+	DEBUG_INFO("sendDataTransferRequest...\n");
+
 	random_uuid(guid);
 	sprintf(message,"[%d,\"%s\",\"DataTransfer\",{\"vendorId\":\"%s\",\"messageId\":\"%s\",\"data\":\"%s\"}]",
 			MESSAGE_TYPE_CALL,
@@ -5847,8 +5854,8 @@ int sendFirmwareStatusNotificationRequest(char *status)
 	char guid[37]={0};
 	char tempdata[65]={0};
 	json_object *FirmwareStatusNotification = json_object_new_object();
+	DEBUG_INFO("sendFirmwareStatusNotificationRequest...\n");
 
-	DEBUG_INFO("sendFirmwareStatusNotificationRequest \n");
 	sprintf((char *)ShmOCPP20Data->FirmwareStatusNotification.status, "%s", (const char *)status);
 	ShmOCPP20Data->FirmwareStatusNotification.requestId = ShmOCPP20Data->UpdateFirmware.requestId;
 
@@ -5943,6 +5950,8 @@ int sendGet15118EVCertificateRequest()
 	char tempdata[128]={0};
 	json_object *Get15118EVCertificate = json_object_new_object();
 
+	DEBUG_INFO("sendGet15118EVCertificateRequest...\n");
+
 	json_object_object_add(Get15118EVCertificate, "iso15118SchemaVersion", json_object_new_string((char*)ShmOCPP20Data->Get15118EVCertificate.iso15118SchemaVersion));
 	json_object_object_add(Get15118EVCertificate, "action", json_object_new_string((char*)ShmOCPP20Data->Get15118EVCertificate.action));
 	json_object_object_add(Get15118EVCertificate, "exiRequest", json_object_new_string((char*)ShmOCPP20Data->Get15118EVCertificate.exiRequest));
@@ -5970,6 +5979,7 @@ int sendGetCertificateStatusRequest()
 	char tempdata[128]={0};
 	json_object *GetCertificateStatus = json_object_new_object();
 	json_object *ocspRequestData = json_object_new_object();
+	DEBUG_INFO("sendGetCertificateStatusRequest...\n");
 
 	json_object_object_add(ocspRequestData, "hashAlgorithm", json_object_new_string((char*)ShmOCPP20Data->GetCertificateStatus.ocspRequestData.hashAlgorithm));
 	json_object_object_add(ocspRequestData, "issuerNameHash", json_object_new_string((char*)ShmOCPP20Data->GetCertificateStatus.ocspRequestData.issuerNameHash));
@@ -5999,6 +6009,7 @@ int sendHeartbeatRequest()
 	char message[40096]={0};
 	char guid[37]={0};
 	char tempdata[128]={0};
+	DEBUG_INFO("sendHeartbeatRequest...\n");
 
 	random_uuid(guid);
 
@@ -6027,7 +6038,7 @@ int sendLogStatusNotificationRequest(char *status)
 	char tempdata[128]={0};
 	json_object *LogStatusNotification = json_object_new_object();
 
-	DEBUG_INFO("sendLogStatusNotificationRequest \n");
+	DEBUG_INFO("sendLogStatusNotificationRequest...\n");
 	ShmOCPP20Data->LogStatusNotification.requestId = ShmOCPP20Data->GetLog.requestId;
 	sprintf((char *)ShmOCPP20Data->LogStatusNotification.status,"%s",(const char *)status);
 
@@ -6091,12 +6102,8 @@ int sendMeterValuesRequest(int gun_index, ReadingContextEnumType dataType)
 	int tempIndex = 0;
 	json_object *MeterValueReq = json_object_new_object();
 	json_object *meterValues = json_object_new_array();
-	json_object *meterValue = json_object_new_object();
 	json_object *sampledValues = json_object_new_array();
-	json_object *sampledValue = json_object_new_object();
-	json_object *unitOfMeasure = json_object_new_object();
-
-	DEBUG_INFO("sendMeterValuesRequest ...\n");
+	DEBUG_INFO("sendMeterValuesRequest...\n");
 
 	memset(queuedata, 0, ARRAY_SIZE(queuedata));
 	//set value
@@ -6855,13 +6862,16 @@ int sendMeterValuesRequest(int gun_index, ReadingContextEnumType dataType)
 	// Message create ====================================================================================================
 	random_uuid(guid);
 
-	uint8_t idxMeter = 0;
-	while(strlen((char*)ShmOCPP20Data->MeterValues[gun_index].meterValue[idxMeter].timestamp) > 0)
+	for(uint8_t idxMeter=0;idxMeter<ARRAY_SIZE(ShmOCPP20Data->MeterValues[gun_index].meterValue);idxMeter++)
 	{
+		json_object *meterValue = json_object_new_object();
+
 		for(int idxSample=0;idxSample<ARRAY_SIZE(ShmOCPP20Data->MeterValues[gun_index].meterValue[idxMeter].sampledValue);idxSample++)
 		{
 			if(ShmOCPP20Data->MeterValues[gun_index].meterValue[idxMeter].sampledValue[idxSample].value > 0)
 			{
+				json_object *sampledValue = json_object_new_object();
+
 				json_object_object_add(sampledValue, "value", json_object_new_double(ShmOCPP20Data->MeterValues[gun_index].meterValue[idxMeter].sampledValue[idxSample].value));
 
 				if(strlen((char*)ShmOCPP20Data->MeterValues[gun_index].meterValue[idxMeter].sampledValue[idxSample].context) > 0)
@@ -6878,6 +6888,7 @@ int sendMeterValuesRequest(int gun_index, ReadingContextEnumType dataType)
 
 				if(strlen((char*)ShmOCPP20Data->MeterValues[gun_index].meterValue[idxMeter].sampledValue[idxSample].unitOfMeasure.uint) > 0)
 				{
+					json_object *unitOfMeasure = json_object_new_object();
 					json_object_object_add(unitOfMeasure, "unit", json_object_new_string((char*)ShmOCPP20Data->MeterValues[gun_index].meterValue[idxMeter].sampledValue[idxSample].unitOfMeasure.uint));
 					json_object_object_add(unitOfMeasure, "multiplier", json_object_new_int(ShmOCPP20Data->MeterValues[gun_index].meterValue[idxMeter].sampledValue[idxSample].unitOfMeasure.multiplier));
 					json_object_object_add(sampledValue, "unitOfMeasure", unitOfMeasure);
@@ -6943,6 +6954,7 @@ int sendNotifyChargingLimitRequest(int gun_index)
 	char tempdata[128]={0};
 	json_object *NotifyChargingLimit = json_object_new_object();
 	json_object *chargingLimit = json_object_new_object();
+	DEBUG_INFO("sendNotifyChargingLimitRequest...\n");
 
 	json_object_object_add(NotifyChargingLimit, "evseId", json_object_new_int(ShmOCPP20Data->NotifyChargingLimit[gun_index].evseId));
 	json_object_object_add(chargingLimit, "chargingLimitSource", json_object_new_string((char*)ShmOCPP20Data->NotifyChargingLimit[gun_index].chargingLimit.chargingLimitSource));
@@ -6970,6 +6982,7 @@ int sendNotifyCustomerInformationRequest()
 	char guid[37]={0};
 	char tempdata[128]={0};
 	json_object *NotifyCustomerInformation = json_object_new_object();
+	DEBUG_INFO("sendNotifyCustomerInformationRequest...\n");
 
 	json_object_object_add(NotifyCustomerInformation, "data", json_object_new_string((char*)ShmOCPP20Data->NotifyCustomerInformation.data));
 	json_object_object_add(NotifyCustomerInformation, "tbc", json_object_new_boolean(ShmOCPP20Data->NotifyCustomerInformation.tbc));
@@ -6999,6 +7012,7 @@ int sendNotifyDisplayMessagesRequest()
 	char tempdata[128]={0};
 	json_object *NotifyDisplayMessages = json_object_new_object();
 	json_object *messageInfos = json_object_new_array();
+	DEBUG_INFO("sendNotifyDisplayMessagesRequest...\n");
 
 	json_object_object_add(NotifyDisplayMessages, "requestId", json_object_new_int(ShmOCPP20Data->NotifyDisplayMessages.requestId));
 	json_object_object_add(NotifyDisplayMessages, "tbc", json_object_new_boolean(ShmOCPP20Data->NotifyDisplayMessages.tbc));
@@ -7060,6 +7074,7 @@ int sendNotifyEVChargingNeedsRequest(int gun_index)
 	json_object *chargingNeeds = json_object_new_object();
 	json_object *acChargingParameters = json_object_new_object();
 	json_object *dcChargingParameters = json_object_new_object();
+	DEBUG_INFO("sendNotifyEVChargingNeedsRequest...\n");
 
 	json_object_object_add(NotifyEVChargingNeeds, "maxScheduleTuples", json_object_new_int(ShmOCPP20Data->NotifyEVChargingNeeds[gun_index].maxScheduleTuples));
 	json_object_object_add(NotifyEVChargingNeeds, "evseId", json_object_new_int(ShmOCPP20Data->NotifyEVChargingNeeds[gun_index].evseId));
@@ -7108,6 +7123,7 @@ int sendNotifyEVChargingScheduleRequest(int gun_index)
 	json_object *NotifyEVChargingSchedule = json_object_new_object();
 	json_object *chargingSchedule = json_object_new_object();
 	json_object *periods = json_object_new_array();
+	DEBUG_INFO("sendNotifyEVChargingScheduleRequest...\n");
 
 	json_object_object_add(NotifyEVChargingSchedule, "timeBase", json_object_new_string((char*)ShmOCPP20Data->NotifyEVChargingSchedule[gun_index].timeBase));
 	json_object_object_add(NotifyEVChargingSchedule, "evseId", json_object_new_int(ShmOCPP20Data->NotifyEVChargingSchedule[gun_index].evseId));
@@ -7161,6 +7177,7 @@ int sendNotifyEventRequest()
 	char tempdata[128]={0};
 	json_object *NotifyEvent = json_object_new_object();
 	json_object *eventDatas = json_object_new_array();
+	DEBUG_INFO("sendNotifyEventRequest...\n");
 
 	json_object_object_add(NotifyEvent, "generatedAt", json_object_new_string((char*)ShmOCPP20Data->NotifyEvent.generatedAt));
 	json_object_object_add(NotifyEvent, "tbc", json_object_new_boolean(ShmOCPP20Data->NotifyEvent.tbc));
@@ -7225,6 +7242,7 @@ int sendNotifyMonitoringReportRequest()
 	char tempdata[128]={0};
 	json_object *NotifyMonitoringReport = json_object_new_object();
 	json_object *monitors = json_object_new_array();
+	DEBUG_INFO("sendNotifyMonitoringReportRequest...\n");
 
 	json_object_object_add(NotifyMonitoringReport, "requestId", json_object_new_int(ShmOCPP20Data->NotifyMonitoringReport.requestId));
 	json_object_object_add(NotifyMonitoringReport, "tbc", json_object_new_int(ShmOCPP20Data->NotifyMonitoringReport.tbc));
@@ -7296,6 +7314,7 @@ int sendNotifyReportRequest()
 	char tempdata[128]={0};
 	json_object *NotifyReport = json_object_new_object();
 	json_object *reportDatas = json_object_new_array();
+	DEBUG_INFO("sendNotifyReportRequest...\n");
 
 	json_object_object_add(NotifyReport, "requestId", json_object_new_int(ShmOCPP20Data->NotifyReport.requestId));
 	json_object_object_add(NotifyReport, "generatedAt", json_object_new_string((char*)ShmOCPP20Data->NotifyReport.generatedAt));
@@ -7373,6 +7392,7 @@ int sendPublishFirmwareStatusNotificationRequest()
 	char tempdata[128]={0};
 	json_object *PublishFirmwareStatusNotification = json_object_new_object();
 	json_object *locations = json_object_new_array();
+	DEBUG_INFO("sendPublishFirmwareStatusNotificationRequest...\n");
 
 	json_object_object_add(PublishFirmwareStatusNotification, "status", json_object_new_string((char*)ShmOCPP20Data->PublishFirmwareStatusNotificatio.status));
 	json_object_object_add(PublishFirmwareStatusNotification, "requestId", json_object_new_int(ShmOCPP20Data->PublishFirmwareStatusNotificatio.requestId));
@@ -7405,6 +7425,7 @@ int sendReportChargingProfilesRequest(int gun_index)
 	char tempdata[128]={0};
 	json_object *ReportChargingProfiles = json_object_new_object();
 	json_object *chargingProfiles = json_object_new_array();
+	DEBUG_INFO("sendReportChargingProfilesRequest...\n");
 
 	json_object_object_add(ReportChargingProfiles, "requestId", json_object_new_int(ShmOCPP20Data->ReportChargingProfiles[gun_index].requestId));
 	json_object_object_add(ReportChargingProfiles, "chargingLimitSource", json_object_new_string((char*)ShmOCPP20Data->ReportChargingProfiles[gun_index].chargingLimitSource));
@@ -7478,6 +7499,7 @@ int sendReservationStatusUpdateRequest(int gun_index)
 	char guid[37]={0};
 	char tempdata[128]={0};
 	json_object *ReservationStatusUpdate = json_object_new_object();
+	DEBUG_INFO("sendReservationStatusUpdateRequest...\n");
 
 	json_object_object_add(ReservationStatusUpdate, "reservationId", json_object_new_int(ShmOCPP20Data->ReservationStatusUpdate[gun_index].reservationId));
 	json_object_object_add(ReservationStatusUpdate, "reservationUpdateStatus", json_object_new_string((char*)ShmOCPP20Data->ReservationStatusUpdate[gun_index].reservationUpdateStatus));
@@ -7503,6 +7525,7 @@ int sendSecurityEventNotificationRequest()
 	char guid[37]={0};
 	char tempdata[128]={0};
 	json_object *SecurityEventNotification = json_object_new_object();
+	DEBUG_INFO("sendSecurityEventNotificationRequest...\n");
 
 	json_object_object_add(SecurityEventNotification, "type", json_object_new_string((char*)ShmOCPP20Data->SecurityEventNotification.type));
 	json_object_object_add(SecurityEventNotification, "timestamp", json_object_new_string((char*)ShmOCPP20Data->SecurityEventNotification.timestamp));
@@ -7529,6 +7552,7 @@ int sendSignCertificateRequest()
 	char guid[37]={0};
 	char tempdata[128]={0};
 	json_object *SignCertificate = json_object_new_object();
+	DEBUG_INFO("sendSignCertificateRequest...\n");
 
 	json_object_object_add(SignCertificate, "csr", json_object_new_string((char*)ShmOCPP20Data->SignCertificate.csr));
 	json_object_object_add(SignCertificate, "certificateType", json_object_new_string((char*)ShmOCPP20Data->SignCertificate.certificateType));
@@ -7559,6 +7583,7 @@ int sendStatusNotificationRequest(int gun_index)
 	char buf[28];//, usec_buf[6];
 	char tempdata[65]={0};
 	int tempIndex = 0;
+	DEBUG_INFO("sendStatusNotificationRequest...\n");
 
 	gettimeofday(&tmnow, NULL);
 
@@ -7628,6 +7653,7 @@ S_FAULT                 =12
 						currentStatus = ConnectorStatusEnumType_Available; //OCPP Status: Available
 					}
 
+					memset(&ShmOCPP20Data->TransactionEvent[index].eventType[0], 0x00, ARRAY_SIZE(ShmOCPP20Data->TransactionEvent[index].eventType));
 					memset(&ShmOCPP20Data->TransactionEvent[index].transactionInfo, 0x00, sizeof(struct TransactionType));
 					memset(&ShmOCPP20Data->TransactionEvent[index].idToken, 0x00, sizeof(struct IdTokenType));
 					memset(&ShmOCPP20Data->TransactionEvent[index].meterValue, 0x00, sizeof(struct MeterValueType));
@@ -7694,6 +7720,7 @@ S_FAULT                 =12
 						currentStatus = ConnectorStatusEnumType_Available; //OCPP Status: Available
 					}
 
+					memset(&ShmOCPP20Data->TransactionEvent[index].eventType[0], 0x00, ARRAY_SIZE(ShmOCPP20Data->TransactionEvent[index].eventType));
 					memset(&ShmOCPP20Data->TransactionEvent[index].transactionInfo, 0x00, sizeof(struct TransactionType));
 					memset(&ShmOCPP20Data->TransactionEvent[index].idToken, 0x00, sizeof(struct IdTokenType));
 					memset(&ShmOCPP20Data->TransactionEvent[index].meterValue, 0x00, sizeof(struct MeterValueType));
@@ -7759,6 +7786,7 @@ S_FAULT                 =12
 						currentStatus = ConnectorStatusEnumType_Available; //OCPP Status: Available
 					}
 
+					memset(&ShmOCPP20Data->TransactionEvent[index].eventType[0], 0x00, ARRAY_SIZE(ShmOCPP20Data->TransactionEvent[index].eventType));
 					memset(&ShmOCPP20Data->TransactionEvent[index].transactionInfo, 0x00, sizeof(struct TransactionType));
 					memset(&ShmOCPP20Data->TransactionEvent[index].idToken, 0x00, sizeof(struct IdTokenType));
 					memset(&ShmOCPP20Data->TransactionEvent[index].meterValue, 0x00, sizeof(struct MeterValueType));
@@ -7816,6 +7844,7 @@ S_FAULT                 =12
 						currentStatus = ConnectorStatusEnumType_Available; //OCPP Status: Available
 					}
 
+					memset(&ShmOCPP20Data->TransactionEvent[index].eventType[0], 0x00, ARRAY_SIZE(ShmOCPP20Data->TransactionEvent[index].eventType));
 					memset(&ShmOCPP20Data->TransactionEvent[index].transactionInfo, 0x00, sizeof(struct TransactionType));
 					memset(&ShmOCPP20Data->TransactionEvent[index].idToken, 0x00, sizeof(struct IdTokenType));
 					memset(&ShmOCPP20Data->TransactionEvent[index].meterValue, 0x00, sizeof(struct MeterValueType));
@@ -7879,6 +7908,7 @@ S_FAULT                 =12
 						currentStatus = ConnectorStatusEnumType_Available; //OCPP Status: Available
 					}
 
+					memset(&ShmOCPP20Data->TransactionEvent[index].eventType[0], 0x00, ARRAY_SIZE(ShmOCPP20Data->TransactionEvent[index].eventType));
 					memset(&ShmOCPP20Data->TransactionEvent[index].transactionInfo, 0x00, sizeof(struct TransactionType));
 					memset(&ShmOCPP20Data->TransactionEvent[index].idToken, 0x00, sizeof(struct IdTokenType));
 					memset(&ShmOCPP20Data->TransactionEvent[index].meterValue, 0x00, sizeof(struct MeterValueType));
@@ -7959,6 +7989,7 @@ int sendTransactionEventRequest(int gun_index)
 	json_object *idToken = json_object_new_object();
 	json_object *evse = json_object_new_object();
 	json_object *meterValues = json_object_new_array();
+	DEBUG_INFO("sendTransactionEventRequest...\n");
 
 	if(gunType[gun_index] == 'J')
 	{
@@ -7984,7 +8015,7 @@ int sendTransactionEventRequest(int gun_index)
 
 				ShmOCPP20Data->TransactionEvent[index].offline = (!ShmOCPP20Data->OcppConnStatus?TRUE:FALSE);
 
-				ShmOCPP20Data->TransactionEvent[index].evse.id = 0;
+				ShmOCPP20Data->TransactionEvent[index].evse.id = (gun_index + 1);
 				ShmOCPP20Data->TransactionEvent[index].evse.connectorId = (gun_index + 1);
 
 				if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_IDLE)//S_IDLE
@@ -8016,16 +8047,21 @@ int sendTransactionEventRequest(int gun_index)
 						) //S_PRECHARGE
 				{
 					if(strlen((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.transactionId) == 0)
+					{
 						random_uuid((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.transactionId);
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].idToken.idToken, "%s", ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].StartUserId);
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].idToken.type, "%s", ShmOCPP20Data->Authorize.idToken.type);
+					}
 
-					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Started]);
+					if(ShmOCPP20Data->TransactionEvent[index].eventType[0] == '\0')
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Started]);
+					else
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Updated]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.chargingState, "%s", ChargingStateEnumTypeStr[ChargingStateEnumType_EVConnected]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].triggerReason, "%s", TriggerReasonEnumTypeStr[TriggerReasonEnumType_ChargingStateChanged]);
 				}
 				else if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_CHARGING) //S_CHARGING
 				{
-					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].idToken.idToken, "%s", ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].StartUserId);
-
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Updated]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.chargingState, "%s", ChargingStateEnumTypeStr[ChargingStateEnumType_Charging]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].triggerReason, "%s", TriggerReasonEnumTypeStr[TriggerReasonEnumType_ChargingStateChanged]);
@@ -8089,7 +8125,7 @@ int sendTransactionEventRequest(int gun_index)
 
 				ShmOCPP20Data->TransactionEvent[index].offline = (!ShmOCPP20Data->OcppConnStatus?TRUE:FALSE);
 
-				ShmOCPP20Data->TransactionEvent[index].evse.id = 0;
+				ShmOCPP20Data->TransactionEvent[index].evse.id = (gun_index + 1);
 				ShmOCPP20Data->TransactionEvent[index].evse.connectorId = (gun_index + 1);
 
 				if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_IDLE) //S_IDLE
@@ -8121,16 +8157,21 @@ int sendTransactionEventRequest(int gun_index)
 						) //S_PRECHARGE
 				{
 					if(strlen((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.transactionId) == 0)
+					{
 						random_uuid((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.transactionId);
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].idToken.idToken, "%s", ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].StartUserId);
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].idToken.type, "%s", ShmOCPP20Data->Authorize.idToken.type);
+					}
 
-					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Started]);
+					if(ShmOCPP20Data->TransactionEvent[index].eventType[0] == '\0')
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Started]);
+					else
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Updated]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.chargingState, "%s", ChargingStateEnumTypeStr[ChargingStateEnumType_EVConnected]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].triggerReason, "%s", TriggerReasonEnumTypeStr[TriggerReasonEnumType_ChargingStateChanged]);
 				}
 				else if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_CHARGING) //S_CHARGING
 				{
-					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].idToken.idToken, "%s", ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].StartUserId);
-
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Updated]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.chargingState, "%s", ChargingStateEnumTypeStr[ChargingStateEnumType_Charging]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].triggerReason, "%s", TriggerReasonEnumTypeStr[TriggerReasonEnumType_ChargingStateChanged]);
@@ -8193,7 +8234,7 @@ int sendTransactionEventRequest(int gun_index)
 
 				ShmOCPP20Data->TransactionEvent[index].offline = (!ShmOCPP20Data->OcppConnStatus?TRUE:FALSE);
 
-				ShmOCPP20Data->TransactionEvent[index].evse.id = 0;
+				ShmOCPP20Data->TransactionEvent[index].evse.id = (gun_index + 1);
 				ShmOCPP20Data->TransactionEvent[index].evse.connectorId = (gun_index + 1);
 
 				if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_IDLE) //S_IDLE
@@ -8225,16 +8266,21 @@ int sendTransactionEventRequest(int gun_index)
 						) //S_PRECHARGE
 				{
 					if(strlen((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.transactionId) == 0)
+					{
 						random_uuid((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.transactionId);
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].idToken.idToken, "%s", ShmSysConfigAndInfo->SysInfo.GbChargingData[index].StartUserId);
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].idToken.type, "%s", ShmOCPP20Data->Authorize.idToken.type);
+					}
 
-					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Started]);
+					if(ShmOCPP20Data->TransactionEvent[index].eventType[0] == '\0')
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Started]);
+					else
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Updated]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.chargingState, "%s", ChargingStateEnumTypeStr[ChargingStateEnumType_EVConnected]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].triggerReason, "%s", TriggerReasonEnumTypeStr[TriggerReasonEnumType_ChargingStateChanged]);
 				}
 				else if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_CHARGING) //S_CHARGING
 				{
-					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].idToken.idToken, "%s", ShmSysConfigAndInfo->SysInfo.GbChargingData[index].StartUserId);
-
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Updated]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.chargingState, "%s", ChargingStateEnumTypeStr[ChargingStateEnumType_Charging]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].triggerReason, "%s", TriggerReasonEnumTypeStr[TriggerReasonEnumType_ChargingStateChanged]);
@@ -8290,7 +8336,7 @@ int sendTransactionEventRequest(int gun_index)
 
 				ShmOCPP20Data->TransactionEvent[index].offline = (!ShmOCPP20Data->OcppConnStatus?TRUE:FALSE);
 
-				ShmOCPP20Data->TransactionEvent[index].evse.id = 0;
+				ShmOCPP20Data->TransactionEvent[index].evse.id = (gun_index + 1);
 				ShmOCPP20Data->TransactionEvent[index].evse.connectorId = (gun_index + 1);
 
 				if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_IDLE) //S_IDLE
@@ -8322,16 +8368,21 @@ int sendTransactionEventRequest(int gun_index)
 						) //S_PRECHARGE
 				{
 					if(strlen((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.transactionId) == 0)
+					{
 						random_uuid((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.transactionId);
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].idToken.idToken, "%s", ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.StartUserId);
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].idToken.type, "%s", ShmOCPP20Data->Authorize.idToken.type);
+					}
 
-					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Started]);
+					if(ShmOCPP20Data->TransactionEvent[index].eventType[0] == '\0')
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Started]);
+					else
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Updated]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.chargingState, "%s", ChargingStateEnumTypeStr[ChargingStateEnumType_EVConnected]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].triggerReason, "%s", TriggerReasonEnumTypeStr[TriggerReasonEnumType_ChargingStateChanged]);
 				}
 				else if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_CHARGING) //S_CHARGING
 				{
-					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].idToken.idToken, "%s", ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.StartUserId);
-
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Updated]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.chargingState, "%s", ChargingStateEnumTypeStr[ChargingStateEnumType_Charging]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].triggerReason, "%s", TriggerReasonEnumTypeStr[TriggerReasonEnumType_ChargingStateChanged]);
@@ -8393,7 +8444,7 @@ int sendTransactionEventRequest(int gun_index)
 
 				ShmOCPP20Data->TransactionEvent[index].offline = (!ShmOCPP20Data->OcppConnStatus?TRUE:FALSE);
 
-				ShmOCPP20Data->TransactionEvent[index].evse.id = 0;
+				ShmOCPP20Data->TransactionEvent[index].evse.id = (gun_index + 1);
 				ShmOCPP20Data->TransactionEvent[index].evse.connectorId = (gun_index + 1);
 
 				if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_IDLE) //SYS_MODE_IDLE
@@ -8425,16 +8476,21 @@ int sendTransactionEventRequest(int gun_index)
 						) //S_PRECHARGE
 				{
 					if(strlen((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.transactionId) == 0)
+					{
 						random_uuid((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.transactionId);
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].idToken.idToken, "%s", ShmSysConfigAndInfo->SysInfo.AcChargingData[index].StartUserId);
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].idToken.type, "%s", ShmOCPP20Data->Authorize.idToken.type);
+					}
 
-					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Started]);
+					if(ShmOCPP20Data->TransactionEvent[index].eventType[0] == '\0')
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Started]);
+					else
+						sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Updated]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.chargingState, "%s", ChargingStateEnumTypeStr[ChargingStateEnumType_EVConnected]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].triggerReason, "%s", TriggerReasonEnumTypeStr[TriggerReasonEnumType_ChargingStateChanged]);
 				}
 				else if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_CHARGING) //S_CHARGING
 				{
-					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].idToken.idToken, "%s", ShmSysConfigAndInfo->SysInfo.AcChargingData[index].StartUserId);
-
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].eventType, "%s", TransactionEventEnumTypeStr[TransactionEventEnumType_Updated]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].transactionInfo.chargingState, "%s", ChargingStateEnumTypeStr[ChargingStateEnumType_Charging]);
 					sprintf((char*)ShmOCPP20Data->TransactionEvent[index].triggerReason, "%s", TriggerReasonEnumTypeStr[TriggerReasonEnumType_ChargingStateChanged]);
@@ -8528,20 +8584,33 @@ int sendTransactionEventRequest(int gun_index)
 
 			for(int idxSample=0;idxSample<ARRAY_SIZE(ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue);idxSample++)
 			{
-				if(strlen((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].context) > 0)
+				if((strlen((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].context) > 0) &&
+				   ((strlen((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].phase) > 0) || (strcmp((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].measurand, MeasurandEnumTypeStr[MeasurandEnumType_SoC]) == 0)))
 				{
 					json_object *sampledValue = json_object_new_object();
-					json_object *unitOfMeasure = json_object_new_object();
 
 					json_object_object_add(sampledValue, "value", json_object_new_double(ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].value));
-					json_object_object_add(sampledValue, "context", json_object_new_string((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].context));
-					json_object_object_add(sampledValue, "measurand", json_object_new_string((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].measurand));
-					json_object_object_add(sampledValue, "phase", json_object_new_string((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].phase));
-					json_object_object_add(sampledValue, "location", json_object_new_string((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].location));
 
-					json_object_object_add(unitOfMeasure, "unit", json_object_new_string((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].unitOfMeasure.uint));
-					json_object_object_add(unitOfMeasure, "multiplier", json_object_new_int(ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].unitOfMeasure.multiplier));
-					json_object_object_add(sampledValue, "unitOfMeasure", unitOfMeasure);
+					if(strlen((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].context) > 0)
+						json_object_object_add(sampledValue, "context", json_object_new_string((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].context));
+
+					if(strlen((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].measurand) > 0)
+						json_object_object_add(sampledValue, "measurand", json_object_new_string((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].measurand));
+
+					if(strlen((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].phase) > 0)
+						json_object_object_add(sampledValue, "phase", json_object_new_string((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].phase));
+
+					if(strlen((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].location) > 0)
+						json_object_object_add(sampledValue, "location", json_object_new_string((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].location));
+
+					if(strlen((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].unitOfMeasure.uint) > 0)
+					{
+						json_object *unitOfMeasure = json_object_new_object();
+
+						json_object_object_add(unitOfMeasure, "unit", json_object_new_string((char*)ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].unitOfMeasure.uint));
+						json_object_object_add(unitOfMeasure, "multiplier", json_object_new_int(ShmOCPP20Data->TransactionEvent[gun_index].meterValue[idxMeter].sampledValue[idxSample].unitOfMeasure.multiplier));
+						json_object_object_add(sampledValue, "unitOfMeasure", unitOfMeasure);
+					}
 
 					json_object_array_add(sampledValues, sampledValue);
 				}
@@ -8556,13 +8625,15 @@ int sendTransactionEventRequest(int gun_index)
 	random_uuid(guid);
 	sprintf(message,"[%d,\"%s\",\"%s\",%s]",MESSAGE_TYPE_CALL, guid, "TransactionEvent", json_object_to_json_string_ext(TransactionEvent, JSON_C_TO_STRING_PLAIN));
 	json_object_put(TransactionEvent);
-	LWS_Send(message);
 
 	sprintf(tempdata, "TransactionEvent,%d", gun_index);
 	if(hashmap_operation(HASH_OP_ADD, guid, tempdata) == PASS)
 	{
 		result = PASS;
 	}
+
+	queue_operation(QUEUE_OPERATION_ADD, guid, message);
+
 	return result;
 }
 
@@ -9153,7 +9224,7 @@ int sendGetVariablesConfirmation(char *uuid, unsigned char variableQuantity)
 
 		json_object_array_add(getVariableResults, variableResult);
 	}
-	json_object_object_add(GetVariables , "setVariableResult", getVariableResults);
+	json_object_object_add(GetVariables , "getVariableResult", getVariableResults);
 
 	sprintf(message,"[%d,\"%s\",%s]"
 								,MESSAGE_TYPE_CALLRESULT

+ 3 - 3
EVSE/Modularization/ocpp20/Module_OcppBackend20.c

@@ -482,7 +482,7 @@ int isQueueOverSize()
 		fseek(fp, 0L, SEEK_END);
 		file_size = ftell(fp);
 
-		if(file_size > (500*1024*1024))
+		if(file_size > (100*1024*1024))
 		{
 			result = TRUE;
 
@@ -865,11 +865,11 @@ int sentqueue(){
 
 	if( fgets (str, QUEUE_MESSAGE_LENGTH, fp)!=NULL )
 	{
-		queueJson = json_tokener_parse(str+2);
+		queueJson = json_tokener_parse(str);
 
 		if(!is_error(queueJson))
 		{
-			LWS_Send(str+2);
+			LWS_Send(str);
 		}
 		json_object_put(queueJson);
 

+ 2 - 0
EVSE/Projects/AW-CCS/Apps/Module_InternalComm.c

@@ -2302,6 +2302,8 @@ int main(void)
 					DEBUG_INFO("MCU-%d get Relay State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.relay_state);
 					DEBUG_INFO("MCU-%d get Rating Current : %.2f\n", gun_index, (float)ShmCharger->gun_info[gun_index].primaryMcuState.rating_current);
 					DEBUG_INFO("MCU-%d get Rotary switch : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.rotatory_switch);
+					DEBUG_INFO("MCU-%d get is on Socket-E mode : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEMode);
+					DEBUG_INFO("MCU-%d get Socket-E detect pin : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn);
 
 					/*
 					DEBUG_INFO("MCU-%d get Locker State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.locker_state);

+ 1 - 0
EVSE/Projects/AW-CCS/Apps/main.c

@@ -3748,6 +3748,7 @@ int main(void)
 						ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop = OFF;
 						ocpp_set_remotestart(gun_index, OFF);
 						ocpp_set_remotestop(gun_index, OFF);
+						ocpp_set_auth_conf(OFF);
 
 						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode = 0x00;
 						ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration = 0;

+ 8 - 8
EVSE/Projects/define.h

@@ -4643,7 +4643,7 @@ struct ChargingProfileType
 	unsigned char recurrencyKind[8];								// Optional. Indicates the start point of a recurrence.
 	unsigned char validFrom[28];									// Optional. Point in time at which the profile starts to be valid. If absent, the profile is valid as soon as it is received by the Charging Station.
 	unsigned char validTo[28];										// Optional. Point in time at which the profile stops to be valid. If absent, the profile is valid until it is replaced by another profile.
-	unsigned char transactionId[36];								// Optional. SHALL only be included if ChargingProfilePurpose is set to TxProfile. The transactionId is used to match the profile to a specific transaction.
+	unsigned char transactionId[37];								// Optional. SHALL only be included if ChargingProfilePurpose is set to TxProfile. The transactionId is used to match the profile to a specific transaction.
 	struct ChargingScheduleType chargingSchedule[3];				// Required. Schedule that contains limits for the available power or current over time. In order to support ISO 15118 schedule negotiation, it supports at most three schedules with associated tariff to choose from.
 };
 
@@ -4735,7 +4735,7 @@ struct EventDataType
 	unsigned char techcode[50];										// Optional. Technical (error) code as reported by component.
 	unsigned char techInfo[500];									// Optional. Technical detail information as reported by component.
 	unsigned char cleared;											// Optional. Cleared is set to true to report the clearing of a monitored situation, i.e. a 'return to normal'.
-	unsigned char transactionId[36];								// Optional. If an event notification is linked to a specific transaction, this field can be used to specify its transactionId.
+	unsigned char transactionId[37];								// Optional. If an event notification is linked to a specific transaction, this field can be used to specify its transactionId.
 	unsigned int variableMonitoringId;								// Optional. Identifies the VariableMonitoring which triggered the event.
 	unsigned char eventNotificationType[32];						// Required. Specifies the event notification type of the message.
 	struct ComponentType component;									// Required. Component for which event is notified.
@@ -4781,7 +4781,7 @@ struct MessageInfoType
 	unsigned char state[16];										// Optional. During what state should this message be shown. When omitted this message should be shown in any state of the Charging Station.
 	unsigned char startDateTime[28];								// Optional. From what date-time should this message be shown. If omitted: directly.
 	unsigned char endDateTime[28];									// Optional. Until what date-time should this message be shown, after this date/time this message SHALL be removed.
-	unsigned char transactionId[36];								// Optional. During which transaction shall this message be shown. Message SHALL be removed by the Charging Station after transaction has ended.
+	unsigned char transactionId[37];								// Optional. During which transaction shall this message be shown. Message SHALL be removed by the Charging Station after transaction has ended.
 	struct MessageContentType message;								// Required. Contains message details for the message to be displayed on a Charging Station.
 	struct ComponentType display;									// Optional. When a Charging Station has multiple Displays, this field can be used to define to which Display this message belongs.
 };
@@ -4900,7 +4900,7 @@ struct SetVariableResultType
 
 struct TransactionType
 {
-	unsigned char transactionId[36];								// Required. This contains the Id of the transaction.
+	unsigned char transactionId[37];								// Required. This contains the Id of the transaction.
 	unsigned char chargingState[16];								// Optional. Current charging state, is required when state has changed. Omitted when there is no communication between EVSE and EV, because no cable is plugged in.
 	unsigned int timeSpentCharging;									// Optional. Contains the total time that energy flowed from EVSE to EV during the transaction (in seconds). Note that timeSpentCharging is smaller or equal to the duration of the transaction.
 	unsigned char stoppedReason[20];								// Optional. This contains the reason why the transaction was stopped. MAY only be omitted when Reason is "Local".
@@ -4987,7 +4987,7 @@ struct ClearVariableMonitoring_20
 struct CostUpdated_20
 {
 	float totalCost;												// Required. Current total cost, based on the information known by the CSMS, of the transaction including taxes. In the currency configured with the configuration Variable: [Currency]
-	unsigned char transactionId[36];								// Required. Transaction Id of the transaction the current cost are asked for.
+	unsigned char transactionId[37];								// Required. Transaction Id of the transaction the current cost are asked for.
 	unsigned char guid[37];											// Save guid from server request
 };
 
@@ -5125,7 +5125,7 @@ struct GetReport_20
 
 struct GetTransactionStatus_20
 {
-	unsigned char transactionId[36];								// Optional. The Id of the transaction for which the status is requested.
+	unsigned char transactionId[37];								// Optional. The Id of the transaction for which the status is requested.
 	unsigned char Response_ongoingIndicator;						// Optional. Whether the transaction is still ongoing.
 	unsigned char Response_messagesInQueue;							// Required. Whether there are still message to be delivered.
 	unsigned char guid[37];											// Save guid from server request
@@ -5263,13 +5263,13 @@ struct RequestStartTransaction_20
 	struct ChargingProfileType chargingProfile;						// Optional. Charging Profile to be used by the Charging Station for the requested transaction.
 	struct IdTokenType groupIdToken;								// Optional. The group identifier that the Charging Station must use to start a transaction.
 	unsigned char Response_status[16];								// Required. Status indicating whether the Charging Station accepts the request to start a transaction.
-	unsigned char Response_transactionId[36];						// Optional. When the transaction was already started by the Charging Station before the RequestStartTransactionRequest was received, for example: cable plugged in first. This contains the transactionId of the already started transaction.
+	unsigned char Response_transactionId[37];						// Optional. When the transaction was already started by the Charging Station before the RequestStartTransactionRequest was received, for example: cable plugged in first. This contains the transactionId of the already started transaction.
 	unsigned char guid[37];											// Save guid from server request
 };
 
 struct RequestStopTransaction_20
 {
-	unsigned char transactionId[36];								// Required. The identifier of the transaction which the Charging Station is requested to stop.
+	unsigned char transactionId[37];								// Required. The identifier of the transaction which the Charging Station is requested to stop.
 	unsigned char Response_status[16];								// Required. Status indicating whether Charging Station accepts the request to stop a transaction.
 	unsigned char guid[37];											// Save guid from server request
 };