瀏覽代碼

2020-01-22 /Kathy Yeh
1. modify idtag for startTransaction / StopTransacion

Kathy_Yeh 5 年之前
父節點
當前提交
fd731692b0
共有 1 個文件被更改,包括 10 次插入5 次删除
  1. 10 5
      EVSE/Modularization/ocppfiles/MessageHandler.c

+ 10 - 5
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -45,6 +45,7 @@
 
 
 
+
 #define PASS				1
 #define FAIL				-1
 
@@ -1026,8 +1027,7 @@ int InitShareMemory()
 	{}
 
 
-    /****************************** For TEST ************************************************/
-	//inital settings
+    /****************************** For Initial Settings************************************************/
 
    	gunTotalNumber = (ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D') ? (CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY): AC_QUANTITY;
 
@@ -2075,13 +2075,13 @@ int sendStartTransactionRequest(int gun_index)
     // set value
 	if(ShmOCPP16Data->OcppConnStatus == 1 )
 	{
-		memset(&ShmOCPP16Data->StartTransaction[gun_index], 0, sizeof(ShmOCPP16Data->StartTransaction[gun_index])); // Clear StartTransaction Value
+		//memset(&ShmOCPP16Data->StartTransaction[gun_index], 0, sizeof(ShmOCPP16Data->StartTransaction[gun_index])); // Clear StartTransaction Value
 
 	}
 
 	ShmOCPP16Data->StartTransaction[gun_index].ConnectorId = gun_index +1 ; // gun start from 1~
 	strcpy((char *)ShmOCPP16Data->StartTransaction[gun_index].Timestamp, buf);
-	strcpy((char *)ShmOCPP16Data->StartTransaction[gun_index].IdTag, (const char *)ShmSysConfigAndInfo->SysConfig.UserId);
+	//strcpy((char *)ShmOCPP16Data->StartTransaction[gun_index].IdTag, (const char *)ShmSysConfigAndInfo->SysConfig.UserId);
 
 	if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
 	{
@@ -2456,7 +2456,7 @@ int sendStopTransactionRequest(int gun_index)
 	DEBUG_ERROR("sendStopTransactionRequest \n");
 
 	//memset(&(ShmOCPP16Data->StopTransaction[gun_index].TransactionData), 0, sizeof(struct StructMeterValue));
-	strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].IdTag, (const char *)ShmSysConfigAndInfo->SysConfig.UserId/*ShmOCPP16Data->Authorize.IdTag*/);
+	//strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].IdTag, (const char *)ShmSysConfigAndInfo->SysConfig.UserId/*ShmOCPP16Data->Authorize.IdTag*/);
 
 	//ENERGY_ACTIVE_IMPORT_REGISTER
 	if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
@@ -9248,6 +9248,11 @@ int handleTriggerMessageRequest(char *uuid, char *payload)
 
 	if( strcmp(requestedMessagestr, MessageTriggerStr[FirmwareStatusNotification]) == 0)
 	{
+		if((FirmwareStatusNotificationStatus != 2) && (FirmwareStatusNotificationStatus != 3) && (FirmwareStatusNotificationStatus != 5) )
+		{
+			FirmwareStatusNotificationStatus = 3;
+		}
+
 		sendFirmwareStatusNotificationRequest(FirmwareStatusStr[FirmwareStatusNotificationStatus]);
 		//sprintf(comfirmstr, "%s",TriggerMessageStatusStr[TriggerMessageStatus_Accepted] );