瀏覽代碼

2021-04-22 / Eason Yang
Action:
1. Fixed : ocpp_get_auth_result() function.
- Online : A start B Stop if we are same parentIdTag
- Offline : A start only A stop.

File:
1. main.c
Action 1

Version :V0.68.XX.XXXX.XX

8009 3 年之前
父節點
當前提交
866e9f0125
共有 1 個文件被更改,包括 31 次插入10 次删除
  1. 31 10
      EVSE/Projects/AW-Regular/Apps/main.c

+ 31 - 10
EVSE/Projects/AW-Regular/Apps/main.c

@@ -555,17 +555,38 @@ uint8_t ocpp_get_auth_result(uint8_t gun_index)
 {
 	uint8_t result = OFF;
 
-	if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
-	{
-		if((strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Accepted")==0) && 
-		   (strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.ParentIdTag, (char*)ShmOCPP16Data->StartTransaction[gun_index].ResponseIdTagInfo.ParentIdTag)==0))
-			result = PASS;
-	}
-	else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
+	switch(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus)
 	{
-		if((strcmp((char*)ShmOCPP20Data->Authorize.Response_idTokenInfo.status, "Accepted")==0) && 
-		   (strcmp((char*)ShmOCPP20Data->Authorize.Response_idTokenInfo.groupIdToken.idToken, (char*)ShmOCPP20Data->TransactionEvent[gun_index].Response_idTokenInfo.groupIdToken.idToken)==0))
-			result = PASS;
+		case SYS_MODE_AUTHORIZING:
+			if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
+			{
+				if((strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Accepted")==0))
+					result = PASS;
+			}
+			else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
+			{
+				if((strcmp((char*)ShmOCPP20Data->Authorize.Response_idTokenInfo.status, "Accepted")==0))
+					result = PASS;
+			}
+
+			break;
+		case SYS_MODE_CHARGING:
+		case SYS_MODE_TERMINATING:
+			if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
+			{
+				if((strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Accepted")==0) &&
+				   (strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.ParentIdTag, (char*)ShmOCPP16Data->StartTransaction[gun_index].ResponseIdTagInfo.ParentIdTag)==0))
+					result = PASS;
+			}
+			else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
+			{
+				if((strcmp((char*)ShmOCPP20Data->Authorize.Response_idTokenInfo.status, "Accepted")==0) &&
+				   (strcmp((char*)ShmOCPP20Data->Authorize.Response_idTokenInfo.groupIdToken.idToken, (char*)ShmOCPP20Data->TransactionEvent[gun_index].Response_idTokenInfo.groupIdToken.idToken)==0))
+					result = PASS;
+			}
+
+			break;
+
 	}
 
 	return result;