Browse Source

[Improve][Modularization][Module_OcppBackend / Module_OcppBackend20]

2021.05.20 / Folus Wen

Actions:
1. Reset response sent out by OCPP module.

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 3 years ago
parent
commit
af8615f59e

+ 3 - 13
EVSE/Modularization/ocpp20/MessageHandler.c

@@ -5178,14 +5178,6 @@ void CheckSystemValue(void)
 		HeartBeatWithNOResponse = HeartBeatWithNOResponse + 1;
 	}
 
-	//===============================
-	// CSU Trigger Reset Conf
-	//===============================
-	if(isWebsocketSendable && (ShmOCPP20Data->MsMsg.bits.ResetConf == ON))
-	{
-		sendResetConfirmation((char *)ShmOCPP20Data->Reset.guid);
-	}
-
 	//===============================
 	// CSU Trigger Authorize Request
 	//===============================
@@ -14026,13 +14018,11 @@ int handleResetRequest(char *uuid, char *payload)
 
 	if((strcmp((char*)ShmOCPP20Data->Reset.type, ResetEnumTypeStr[ResetEnumType_Immediate])==0) || (strcmp((char*)ShmOCPP20Data->Reset.type, ResetEnumTypeStr[ResetEnumType_OnIdle])==0))
 	{
-	  	ShmOCPP20Data->MsMsg.bits.ResetReq = ON;
 	    strcpy((char *)ShmOCPP20Data->Reset.guid, uuid);
+	    strcpy((char*)ShmOCPP20Data->Reset.Response_status, ResetStatusEnumTypeStr[ResetStatusEnumType_Accepted]);
+	    ShmOCPP20Data->MsMsg.bits.ResetReq = ON;
 
-	    if(!GetServerSign())
-	    	strcpy((char*)ShmOCPP20Data->Reset.Response_status, ResetStatusEnumTypeStr[ResetStatusEnumType_Accepted]);
-
-	    result = TRUE;
+	    result = PASS;
 	}
 	else
 	{

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

@@ -2793,14 +2793,6 @@ void CheckSystemValue(void)
 			ShmOCPP16Data->CsMsg.bits[gun_index].DataTransferReq = 0;
 		}
 
-		//===============================
-		// CSU Trigger Reset Conf
-		//===============================
-		if(isWebsocketSendable && (server_sign == TRUE) && (ShmOCPP16Data->MsMsg.bits.ResetConf == 1))
-		{
-			sendResetConfirmation((char *)ShmOCPP16Data->Reset.guid, (char *)ShmOCPP16Data->Reset.ResponseStatus);
-		}
-
 		//===============================
 		// CSU Trigger Authorize Request
 		//===============================
@@ -10253,19 +10245,18 @@ int handleResetRequest(char *uuid, char *payload)
 	sprintf((char *)ShmOCPP16Data->Reset.Type, "%s" ,typestr);
 	if((strcmp(typestr, ResetTypeStr[Hard])==0) || (strcmp(typestr, ResetTypeStr[Soft])==0))
 	{
-	  	ShmOCPP16Data->MsMsg.bits.ResetReq = 1;
+		ShmOCPP16Data->MsMsg.bits.ResetReq = 1;
 	    strcpy((char *)ShmOCPP16Data->Reset.guid, uuid);
-	    result = TRUE;
-	    return result;
-	 }
-	 else
-	 {
-		 strcpy(comfirmstr, ResetStatusStr[ResetStatus_Rejected]);
-		 sprintf((char *)ShmOCPP16Data->Reset.ResponseStatus, "%s" ,comfirmstr);
-		 goto errorend;
-	 }
+	    strcpy(comfirmstr, ResetStatusStr[ResetStatus_Accepted]);
+	    sprintf((char *)ShmOCPP16Data->Reset.ResponseStatus, "%s" ,comfirmstr);
+	}
+	else
+	{
+		strcpy(comfirmstr, ResetStatusStr[ResetStatus_Rejected]);
+		sprintf((char *)ShmOCPP16Data->Reset.ResponseStatus, "%s" ,comfirmstr);
+		result = PASS;
+	}
 
-errorend:
 	sendResetConfirmation(uuid, comfirmstr);
 	return result;
 }