瀏覽代碼

[Improve][AW-CCS][main.c]
2022-10-25 / EASON YANG
Action:
1. Improve: ocpp_get_auth_result() function. If reservation Idtag is same don't compare with parentIdTag again.

File:
1. main.c
Action 1

FIRMWARE VERSION: B0.63.XX.XXXX.PX

8009 2 年之前
父節點
當前提交
6503872705
共有 1 個文件被更改,包括 11 次插入6 次删除
  1. 11 6
      EVSE/Projects/AW-CCS/Apps/main.c

+ 11 - 6
EVSE/Projects/AW-CCS/Apps/main.c

@@ -854,16 +854,21 @@ uint8_t ocpp_get_auth_result(uint8_t isValidParent, ...)
 			case SYS_MODE_AUTHORIZING:
 				if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
 				{
-					if(ocpp_compare_reserve_id_with_user(gun_index) || ocpp_compare_reserve_id_with_remote_user(gun_index))
+					if(((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].ReservationId == -1) && (strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Accepted")==0)))
 					{
-						if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].ReservationId != -1) && (strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Accepted")==0))
-							result = PASS;
+						result = PASS;
 					}
-					else
+					else if(((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].ReservationId != -1) && (strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Accepted")==0)))
 					{
-						if(((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].ReservationId == -1) && (strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Accepted")==0)) ||
-							((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].ReservationId != -1) && ((strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Accepted")==0) && (strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.ParentIdTag, (char*)ShmOCPP16Data->ReserveNow[gun_index].ParentIdTag)==0))))
+						if(ocpp_compare_reserve_id_with_user(gun_index) || ocpp_compare_reserve_id_with_remote_user(gun_index))
+						{
+							result = PASS;
+						}
+						else
+						{
+							if((strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.ParentIdTag, (char*)ShmOCPP16Data->ReserveNow[gun_index].ParentIdTag)==0))
 								result = PASS;
+						}
 					}
 				}
 				else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)