瀏覽代碼

[Improve][AW-CCS][Module_CCS]

2021.10.08 / Folus Wen

Actions:
1. 15118 communication for AC charging implement.

Files:
1. As follow commit history

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

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
FolusWen 3 年之前
父節點
當前提交
5460d07c7a
共有 2 個文件被更改,包括 293 次插入325 次删除
  1. 271 277
      EVSE/Projects/AW-CCS/Apps/CCS/Module_CCS.c
  2. 22 48
      EVSE/Projects/AW-CCS/Apps/CCS/v2g/api/api.c

文件差異過大導致無法顯示
+ 271 - 277
EVSE/Projects/AW-CCS/Apps/CCS/Module_CCS.c


+ 22 - 48
EVSE/Projects/AW-CCS/Apps/CCS/v2g/api/api.c

@@ -669,7 +669,6 @@ int Check_V2G_Rx_Msg_Name_iso2(struct iso2EXIDocument *exi_doc_ISO2)
 	return errn;
 }
 
-
 /*===========================================================================
 FUNCTION: SAVE_PhysicalValueType_DIN70121
 DESCRIPTION:
@@ -735,7 +734,6 @@ void SAVE_PhysicalValueType_ISO15118_2014(struct PhysicalValueType_ISO15118_2014
         case V_ISO15118_2014:
             out->Multiplier = -1;
             break;    //KW
-
         case W_ISO15118_2014:
         case Wh_ISO15118_2014:
 			out->Value = in_value * 10;
@@ -754,7 +752,6 @@ void SAVE_PhysicalValueType_ISO15118_2014(struct PhysicalValueType_ISO15118_2014
     //WH_DIN70121 = 9};
 }
 
-
 /*===========================================================================
 FUNCTION: DIN70121PhyValDecode
 DESCRIPTION:
@@ -855,7 +852,6 @@ float ISO151182014PhyValDecode(struct PhysicalValueType_ISO15118_2014 PhysicalDa
     return 0;
 }
 
-
 /*===========================================================================
 FUNCTION: SHM_Read_dinPhysicalValueType
 DESCRIPTION:
@@ -911,7 +907,6 @@ void SHM_Read_iso1PhysicalValueType(struct iso1PhysicalValueType *out, struct Ph
 	//iso1unitSymbolType_Wh = 6
 }
 
-
 /*===========================================================================
 FUNCTION: SHM_Read_dinDC_EVSEStatusType
 DESCRIPTION:
@@ -1040,7 +1035,7 @@ void SHM_Read_iso1MeterInfo(struct iso1MeterInfoType *out, struct MeterInfoType_
 	int i = 0;
 
 	//[1/5] MeterID
-	out->MeterID.charactersLen = 32;
+	out->MeterID.charactersLen = (strlen((char*)in->MeterID)<iso1MeterInfoType_MeterID_CHARACTERS_SIZE ? strlen((char*)in->MeterID) : iso1MeterInfoType_MeterID_CHARACTERS_SIZE);
 	for (i = 0; i < out->MeterID.charactersLen; i++)
 	{
 		out->MeterID.characters[i] = (unsigned char)in->MeterID[i];
@@ -1052,7 +1047,7 @@ void SHM_Read_iso1MeterInfo(struct iso1MeterInfoType *out, struct MeterInfoType_
 
 	//[3/5] SigMeterReading
 	out->SigMeterReading_isUsed = 1u;
-	out->SigMeterReading.bytesLen = 64;
+	out->SigMeterReading.bytesLen = (strlen((char*)in->SigMeterReading)<iso1MeterInfoType_SigMeterReading_BYTES_SIZE ? strlen((char*)in->SigMeterReading) : iso1MeterInfoType_SigMeterReading_BYTES_SIZE);
 	for (i = 0; i < out->SigMeterReading.bytesLen; i++)
 	{
 		out->SigMeterReading.bytes[i] = (unsigned char)in->SigMeterReading[i];
@@ -1360,7 +1355,6 @@ void SHM_Save_iso1_ServiceAndPaymentSelectionReq(struct CcsData *shm_ccs, struct
     }
 }
 
-
 /*===========================================================================
 FUNCTION: SHM_Save_din_ContractAuthenticationReq
 DESCRIPTION:
@@ -1605,7 +1599,6 @@ void SHM_Save_iso1_ChargeParameterDiscoveryReq(struct CcsData *shm_ccs, struct i
     shm_msg->DC_EVChargeParameter.BulkSOC = (unsigned char) exi->DC_EVChargeParameter.BulkSOC;
 }
 
-
 /*===========================================================================
 FUNCTION: SHM_Save_din_CableCheckReq
 DESCRIPTION:
@@ -1686,7 +1679,6 @@ void SHM_Save_iso1_CableCheckReq(struct CcsData *shm_ccs, struct iso1EXIDocument
 	//}
 }
 
-
 /*===========================================================================
 FUNCTION: SHM_Save_din_PreChargeReq
 DESCRIPTION:
@@ -1913,7 +1905,6 @@ void SHM_Save_iso1_PowerDeliveryReq(struct CcsData *shm_ccs, struct iso1EXIDocum
 	shm_msg->DC_EVPowerDeliveryParameter.ChargingComplete = (BOOL) exi->DC_EVPowerDeliveryParameter.ChargingComplete;
 }
 
-
 /*===========================================================================
 FUNCTION: SHM_Save_din_CurrentDemandReq
 DESCRIPTION:
@@ -2161,7 +2152,6 @@ void SHM_Save_iso1_CurrentDemandReq(struct CcsData *shm_ccs, struct iso1EXIDocum
 	#endif
 }
 
-
 /*===========================================================================
 FUNCTION: SHM_Save_iso1_ChargingStatusReq
 DESCRIPTION:
@@ -2245,7 +2235,6 @@ void SHM_Save_iso1_WeldingDetectionReq(struct CcsData *shm_ccs, struct iso1EXIDo
 	sys->EvBatterySoc = (int) shm_msg->DC_EVStatus.EVRESSSOC;
 }
 
-
 /*===========================================================================
 FUNCTION: SHM_Save_din_SessionStopReq
 DESCRIPTION:
@@ -2302,7 +2291,6 @@ void SHM_Save_iso1_SessionStopReq(struct CcsData *shm_ccs, struct iso1EXIDocumen
 	//null
 }
 
-
 /*===========================================================================
 FUNCTION: SHM_Read_din_SessionSetupRes
 DESCRIPTION:
@@ -2363,7 +2351,6 @@ void SHM_Read_din_ContractAuthenticationRes(struct dinEXIDocument *exi_doc_DIN,
 	out->EVSEProcessing = (BOOL)in->EVSEProcessing; //0(Finished) or 1(Ongoing)
 }
 
-
 /*===========================================================================
 FUNCTION: SHM_Read_din_ChargeParameterDiscoveryRes
 DESCRIPTION:
@@ -2586,7 +2573,6 @@ void SHM_Read_iso1_ChargeParameterDiscoveryRes(struct iso1EXIDocument *exi_doc_I
 	#endif
 }
 
-
 /*===========================================================================
 FUNCTION: SHM_Read_din_CableCheckRes
 DESCRIPTION:
@@ -2657,7 +2643,6 @@ void SHM_Read_iso1_CableCheckRes(struct iso1EXIDocument *exi_doc_ISO1, struct Cc
 	SHM_Read_iso1DC_EVSEStatusType(&out->DC_EVSEStatus, &in->DC_EVSEStatus);
 }
 
-
 /*===========================================================================
 FUNCTION: SHM_Read_din_PreChargeRes
 DESCRIPTION:
@@ -2745,7 +2730,6 @@ void SHM_Read_iso1_PreChargeRes(struct iso1EXIDocument *exi_doc_ISO1, struct Ccs
 	SHM_Read_iso1DC_EVSEStatusType(&out->DC_EVSEStatus, &in->DC_EVSEStatus);
 }
 
-
 /*===========================================================================
 FUNCTION: SHM_Read_din_PowerDeliveryRes
 DESCRIPTION:
@@ -2814,7 +2798,8 @@ void SHM_Read_iso1_PowerDeliveryRes(struct iso1EXIDocument *exi_doc_ISO1, struct
     //----- [BODY (2/3)] DC_EVSEStatus -----
 	#if ((CCS_ENERGY_TRANSFER_MODE == MODE_AC_SINGLE_PHASE_CORE) | (CCS_ENERGY_TRANSFER_MODE == MODE_AC_THREE_PHASE_CORE))
 	{
-		//out->DC_EVSEStatus_isUsed = 0u;
+    	out->AC_EVSEStatus_isUsed = 1u;
+    	SHM_Read_iso1AC_EVSEStatusType(&out->AC_EVSEStatus, &in->AC_EVSEStatus);
 	}
 	#else //CCS_ENERGY_TRANSFER_MODE == MODE_DC_EXTENDED
 	{
@@ -2824,7 +2809,6 @@ void SHM_Read_iso1_PowerDeliveryRes(struct iso1EXIDocument *exi_doc_ISO1, struct
 	#endif
 }
 
-
 /*===========================================================================
 FUNCTION: SHM_Read_din_CurrentDemandRes
 DESCRIPTION:
@@ -2968,7 +2952,6 @@ GLOBAL VARIABLES:
 =============================================================================*/
 void SHM_Read_iso1_ChargingStatusRes(struct iso1EXIDocument *exi_doc_ISO1, struct CcsData *shm_ccs)
 {
-	int i = 0;
 	struct iso1ChargingStatusResType *out;
 	struct ChargingStatusResponse_ISO15118_2014 *in;
 	init_iso1BodyType(&exi_doc_ISO1->V2G_Message.Body);
@@ -2978,7 +2961,6 @@ void SHM_Read_iso1_ChargingStatusRes(struct iso1EXIDocument *exi_doc_ISO1, struc
 	in = &shm_ccs->V2GMessage_ISO15118_2014.ChargingStatusResponse;
 	exi_doc_ISO1->V2G_Message.Body.ChargingStatusRes_isUsed = 1u;
 
-
 	//----- [BODY (1/10)] ResponseCode -----
     out->ResponseCode = (unsigned char)in->ResponseCode;
 
@@ -2993,8 +2975,8 @@ void SHM_Read_iso1_ChargingStatusRes(struct iso1EXIDocument *exi_doc_ISO1, struc
 	out->SAScheduleTupleID = (unsigned char)in->SAScheduleTupleID;	//[CAUTION] data type
 
     //----- [BODY (5/10)] EVSEID -----
-	out->EVSEID.charactersLen = 37;  //min length: 7, max length:37  bytes(ISO1, AC)
-	for (i = 0; i< out->EVSEID.charactersLen; i++)
+	out->EVSEID.charactersLen = (strlen((char*)in->EVSEID)<iso1ChargingStatusResType_EVSEID_CHARACTERS_SIZE) ? strlen((char*)in->EVSEID) : iso1ChargingStatusResType_EVSEID_CHARACTERS_SIZE;  //min length: 7, max length:37  bytes(ISO1, AC)
+	for (uint8_t i = 0; i< out->EVSEID.charactersLen; i++)
 	{
 		out->EVSEID.characters[i] = (unsigned char)in->EVSEID[i];
 	}
@@ -3080,7 +3062,6 @@ void SHM_Read_iso1_WeldingDetectionRes(struct iso1EXIDocument *exi_doc_ISO1, str
     SHM_Read_iso1DC_EVSEStatusType(&out->DC_EVSEStatus, &in->DC_EVSEStatus);
 }
 
-
 /*===========================================================================
 FUNCTION: SHM_Read_din_SessionStopRes
 DESCRIPTION:
@@ -3309,7 +3290,6 @@ void PRINT_XML_DOC_ISO2_SessionSetupReq(struct iso2EXIDocument *exi_doc_ISO2)
     DEBUG_PRINTF_EXI_ENGINE_DETAIL("[END] Parsing SessionSetupReq\n");
 }
 
-
 /*===========================================================================
 FUNCTION: PRINT_XML_DOC_DIN_ServiceDiscoveryReq
 DESCRIPTION:
@@ -3433,7 +3413,6 @@ void PRINT_XML_DOC_ISO1_ServiceDiscoveryReq(struct iso1EXIDocument *exi_doc_ISO1
     DEBUG_PRINTF_EXI_ENGINE_DETAIL("[END] Parsing ServiceDiscoveryReq\n");
 }
 
-
 /*===========================================================================
 FUNCTION: PRINT_XML_DOC_DIN_ServiceAndPaymentSelectionReq
 DESCRIPTION:
@@ -3543,7 +3522,6 @@ void PRINT_XML_DOC_ISO1_ServiceAndPaymentSelectionReq(struct iso1EXIDocument *ex
     DEBUG_PRINTF_EXI_ENGINE_DETAIL(" [END] Parsing PaymentServiceSelectionReq\n");
 }
 
-
 /*===========================================================================
 FUNCTION: PRINT_XML_DOC_DIN_ContractAuthenticationReq
 DESCRIPTION:
@@ -3785,7 +3763,7 @@ void PRINT_XML_DOC_ISO1_ChargeParameterDiscoveryReq(struct iso1EXIDocument *exi_
     //DC_EVStatus
     struct iso1DC_EVStatusType *status;
     status = &exi_doc_ISO1->V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.DC_EVStatus;
-    PRINT_iso1DC_EVStatusType(status);
+    if(exi_doc_ISO1->V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter_isUsed)PRINT_iso1DC_EVStatusType(status);
 
     //EVMaximumCurrentLimit
     obj = &exi_doc_ISO1->V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVMaximumCurrentLimit;
@@ -3821,7 +3799,6 @@ void PRINT_XML_DOC_ISO1_ChargeParameterDiscoveryReq(struct iso1EXIDocument *exi_
     DEBUG_PRINTF_EXI_ENGINE_DETAIL("[END] Parsing ChargeParameterDiscoveryReq (%d-th)\n", cnt);
 }
 
-
 /*===========================================================================
 FUNCTION: PRINT_XML_DOC_DIN_CableCheckReq
 DESCRIPTION:
@@ -3911,7 +3888,6 @@ void PRINT_XML_DOC_DIN_PreChargeReq(struct dinEXIDocument *exi_doc_DIN)
     DEBUG_PRINTF_EXI_ENGINE_DETAIL("[END] Parsing PreChargeReq (%d-th)\n", cnt);
 }
 
-
 /*===========================================================================
 FUNCTION: PRINT_XML_DOC_ISO1_PreChargeReq
 DESCRIPTION:
@@ -3949,7 +3925,6 @@ void PRINT_XML_DOC_ISO1_PreChargeReq(struct iso1EXIDocument *exi_doc_ISO1)
     DEBUG_PRINTF_EXI_ENGINE_DETAIL("[END] Parsing PreChargeReq (%d-th)\n", cnt);
 }
 
-
 /*===========================================================================
 FUNCTION: PRINT_XML_DOC_DIN_PowerDeliveryReq
 DESCRIPTION:
@@ -4023,7 +3998,7 @@ void PRINT_XML_DOC_ISO1_PowerDeliveryReq(struct iso1EXIDocument *exi_doc_ISO1)
 
 
     //===== [BODY (1/3)] ChargeProgress =====
-    DEBUG_PRINTF_EXI_ENGINE_DETAIL("ChargeProgress: %d (DEC, 0:start, 1:stop, 2:renegotiate)\n",
+    DEBUG_PRINTF_EXI_ENGINE_DETAIL("ChargeProgress: %d (DEC, 0:start, 1:stop, 2:re-negotiate)\n",
             exi_doc_ISO1->V2G_Message.Body.PowerDeliveryReq.ChargeProgress);
 	//iso1chargeProgressType_Start = 0,
 	//iso1chargeProgressType_Stop = 1,
@@ -4042,7 +4017,7 @@ void PRINT_XML_DOC_ISO1_PowerDeliveryReq(struct iso1EXIDocument *exi_doc_ISO1)
     //DC_EVStatus
     struct iso1DC_EVStatusType *status;
     status = &exi_doc_ISO1->V2G_Message.Body.PowerDeliveryReq.DC_EVPowerDeliveryParameter.DC_EVStatus;
-    PRINT_iso1DC_EVStatusType(status);
+    if(exi_doc_ISO1->V2G_Message.Body.PowerDeliveryReq.DC_EVPowerDeliveryParameter_isUsed)PRINT_iso1DC_EVStatusType(status);
 
     //BulkChargingComplete
     DEBUG_PRINTF_EXI_ENGINE_DETAIL("BulkChargingComplete = %d (DEC)\n",
@@ -4060,7 +4035,6 @@ void PRINT_XML_DOC_ISO1_PowerDeliveryReq(struct iso1EXIDocument *exi_doc_ISO1)
     DEBUG_PRINTF_EXI_ENGINE_DETAIL("[END] Parsing PowerDeliveryReq (%d-th)\n", cnt);
 }
 
-
 /*===========================================================================
 FUNCTION: PRINT_XML_DOC_DIN_CurrentDemandReq
 DESCRIPTION:
@@ -4942,67 +4916,67 @@ void PRINT_iso1DC_EVErrorCodeType(struct iso1DC_EVStatusType *status)
     {
         case iso1DC_EVErrorCodeType_NO_ERROR:                           // = 0,
         {
-            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(NO_ERROR)");
+            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(NO_ERROR)\n");
             break;
         }
     	case iso1DC_EVErrorCodeType_FAILED_RESSTemperatureInhibit:      // = 1,
         {
-            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(FAILED_RESSTemperatureInhibit)");
+            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(FAILED_RESSTemperatureInhibit)\n");
             break;
         }
     	case iso1DC_EVErrorCodeType_FAILED_EVShiftPosition:             // = 2,
         {
-            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(FAILED_EVShiftPosition)");
+            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(FAILED_EVShiftPosition)\n");
             break;
         }
     	case iso1DC_EVErrorCodeType_FAILED_ChargerConnectorLockFault:   // = 3,
         {
-            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(ChargerConnectorLockFault)");
+            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(ChargerConnectorLockFault)\n");
             break;
         }
     	case iso1DC_EVErrorCodeType_FAILED_EVRESSMalfunction:           // = 4,
         {
-            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(FAILED_EVRESSMalfunction)");
+            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(FAILED_EVRESSMalfunction)\n");
             break;
         }
     	case iso1DC_EVErrorCodeType_FAILED_ChargingCurrentdifferential: // = 5,
         {
-            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(FAILED_ChargingCurrentdifferential)");
+            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(FAILED_ChargingCurrentdifferential)\n");
             break;
         }
     	case iso1DC_EVErrorCodeType_FAILED_ChargingVoltageOutOfRange:   // = 6,
         {
-            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(FAILED_ChargingVoltageOutOfRange)");
+            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(FAILED_ChargingVoltageOutOfRange)\n");
             break;
         }
     	case iso1DC_EVErrorCodeType_Reserved_A:                         // = 7,
         {
-            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(Reserved_A)");
+            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(Reserved_A)\n");
             break;
         }
     	case iso1DC_EVErrorCodeType_Reserved_B:                         // = 8,
         {
-            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(Reserved_B)");
+            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(Reserved_B)\n");
             break;
         }
     	case iso1DC_EVErrorCodeType_Reserved_C:                         // = 9,
         {
-            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(Reserved_C)");
+            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(Reserved_C)\n");
             break;
         }
     	case iso1DC_EVErrorCodeType_FAILED_ChargingSystemIncompatibility:// = 10,
         {
-            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(FAILED_ChargingSystemIncompatibility)");
+            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(FAILED_ChargingSystemIncompatibility)\n");
             break;
         }
     	case iso1DC_EVErrorCodeType_NoData:                             // = 11
         {
-            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(NoData)");
+            DEBUG_PRINTF_EXI_ENGINE_DETAIL("(NoData)\n");
             break;
         }
         default:
         {
-            DEBUG_PRINTF_EXI_ENGINE_DETAIL("([WARNING] Unexpected iso1 EVErrorCode)");
+            DEBUG_PRINTF_EXI_ENGINE_DETAIL("([WARNING] Unexpected iso1 EVErrorCode)\n");
             break;
         }
     }

部分文件因文件數量過多而無法顯示