Просмотр исходного кода

2020-05-18 /Edward Lien

Actions:
1.Fixed DiffTimebWithNow() and DiffTimeb() return type change to long long to cover date differential too long issue.
2.Add Ccs_Info structure in main.h .

Files:
1. As follow commit history

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

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
Edward Lien 4 лет назад
Родитель
Сommit
7438e5132a

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

@@ -182,26 +182,26 @@ int StoreLogMsg(const char *fmt, ...)
 	return rc;
 }
 
-int DiffTimebWithNow(struct timeb ST)
+long long DiffTimebWithNow(struct timeb ST)
 {
 	//return milli-second
 	struct timeb ET;
-	unsigned int StartTime,StopTime;
+	long long StartTime,StopTime;
 
 	ftime(&ET);
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
+	StartTime=(long long)ST.time;
+	StopTime=(long long)ET.time;
+	return ((StopTime-StartTime)*1000) + (ET.millitm-ST.millitm);
 }
 
-int DiffTimeb(struct timeb ST, struct timeb ET)
+long long DiffTimeb(struct timeb ST, struct timeb ET)
 {
 	//return milli-second
-	unsigned int StartTime,StopTime;
+	long long StartTime,StopTime;
 
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
+	StartTime=(long long)ST.time;
+	StopTime=(long long)ET.time;
+	return ((StopTime-StartTime)*1000) + (ET.millitm-ST.millitm);
 }
 
 void getDateTimeString(char* result)
@@ -1181,7 +1181,7 @@ void get_firmware_version(unsigned char gun_index)
 	strcpy((char*)ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, ShmCharger->gun_info[gun_index].ver.Version_FW);
 
 	// Get CSU root file system version
-	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "B0.02.00.0000.00");
+	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "D0.03.00.0000.00");
 
 	// Get AC connector type from model name
 	for(uint8_t idx=0;idx<3;idx++)

+ 85 - 0
EVSE/Projects/AW-CCS/Apps/main.h

@@ -387,6 +387,90 @@ typedef struct SET_LED_BRIGHTNESS
 	uint8_t sector_12;	// 22~23 PM and 23~24 PM
 }Set_Led_Brightness;
 
+typedef struct CCS_INFO
+{
+	uint8_t PresentMsgFlowStatus;   
+												/*  ISO15118_2018
+												0: Idle(wait B2 state), 
+												1: CM_SLAC_PARM.REQ, 
+												2: CM_SLAC_PARM.CNF, 
+												3: CM_START_ATTEN_CHAR.IND
+												4: CM_MNBC_SOUND.IND, 
+												5: CM_ATTEN_CHAR.IND, 
+												6: CM_ATTEN_CHAR.RSP, 
+												7: CM_VALIDATE.REQ
+												8: CM_VALIDATE.CNF, 
+												9: CM_SLAC_MATCH.REQ, 
+												10: CM_SLAC_MATCH.CNF, 
+												11: CM_AMP_MAP.REQ
+												12: CM_AMP_MAP.CNF, 
+												13: SLACC/SDP/TCP connection,
+												16: SupportedAppProtocolRequest, 
+												17: SupportedAppProtocolResponse, 
+												18: SessionSetupRequest
+												19: SessionSetupResponse, 
+												20: ServiceDiscoveryRequest, 
+												21: ServiceDiscoveryResponse
+												22: ServiceDetailRequest, 
+												23: ServiceDetailResponse
+												24:ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 
+												25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
+												26: PaymentDetailsRequest/IdentificationDetailsRequest;, 
+												27: PaymentDetailsResponse/IdentificationDetailsResponse,
+												28: AuthorizationRequest, 
+												29: AuthorizationResponse,
+												30: CertificateUpdateRequest, 
+												31: CertificateUpdateResponse, 
+												32:CertificateInstallationRequest, 
+												33: CertificateInstallationResponse
+												34: ChargeParameterDiscoveryRequest, 
+												35: ChargeParameterDiscoveryResponse
+												36: CableCheckRequest, 
+												37: CableCheckResponse, 
+												38: PreChargeRequest, 
+												39: PreChargeResponse
+												40: PowerDeliveryRequest start, 
+												41: PowerDeliveryResponse start, 
+												42: ChargingStatusRequest, 
+												43: ChargingStatusResponse
+												44:CurrentDemandRequest, 
+												45:CurrentDemandResponse, 
+												46:MeteringReceiptRequest, 
+												47: MeteringReceiptResponse
+												48: PowerDeliveryRequest end, 
+												49: PowerDeliveryRequest end, 
+												50: WeldingDetectionRequest, 
+												51: WeldingDetectionResponse,
+												52: SessionStopRequest, 
+												53: SessionStopResponse
+												253: Performance Timeout, 
+												254: Sequence Timeout, 
+												255: Fault
+												*/
+	uint8_t 	ChargingPermission;				/*0x00: Not ready yet, stay in idle mode or go into terminating process.
+												  0x01: start charging process*/
+	uint8_t 	ConnectorLockerStatus;			/*0x00: released
+												  0x01: locked*/
+	uint8_t 	ConnectorTemperature1;			/*0x00: -60°C ~ 0xFE: 194°C, resolution: 1°C, 0xFF: invalid*/
+	uint8_t 	ConnectorTemperature2;			/*0x00: -60°C ~ 0xFE: 194°C, resolution: 1°C, 0xFF: invalid*/
+	uint8_t 	PresetBatterySoc;				/*0 ~ 100*/
+	uint16_t	TargetVoltage;					/*0x0000: 0 volt ~ 0xFFFF: 6553.5 volt, resolution: 0.1 volt*/
+	uint16_t	TargetCurrent;					/*0x0000: 0 amp ~ 0xFFFF: 6553.5 amp, resolution: 0.1 amp*/
+	uint16_t	ChargingRemainTime;				/*0x0000: 0 sec ~ 0xFFFF: 65535 sec, resolution: 1 second*/
+	uint8_t		BatteryChargeType;				/*0x00: AC charging, 0x01: DC charging*/
+	uint16_t	TotalBatteryCapacity;			/*0x0000: 0 kWh ~ 0xFFFF: 6553.5 kWh, resolution: 0.1 kWh*/
+	uint16_t	BatteryMaximumVoltage;			/*0x0000: 0 volt ~ 0xFFFF: 6553.5 volt, resolution: 0.1 volt*/
+	uint16_t	BatteryMaximumCurrent;			/*0x0000: 0 amp ~ 0xFFFF: 6553.5 amp, resolution: 0.1 amp*/
+	uint16_t	StopChargeEvent1:1;
+	uint16_t	StopChargeEvent2:1;
+	uint16_t	StopChargeEvent3:1;
+	uint16_t	StopChargeEvent4:1;
+	uint16_t	StopChargeEvent5:1;
+	uint16_t	StopChargeEvent6:1;
+	uint16_t	StopChargeEvent7:1;
+	uint16_t	StopChargeEvent8:1;
+}Ccs_Info;
+
 typedef struct GUN_INFO
 {
 	Ver 											ver;
@@ -410,6 +494,7 @@ typedef struct GUN_INFO
 	Mcu_Reset_Request								mcuResetRequest;
 	Set_Breathe_Led_Timing							setBreatheLedTiming;
 	Set_Led_Brightness								setLedBrightness;
+	Ccs_Info										ccsInfo;
 	uint16_t										targetCurrent;
 	uint16_t										isAuthPassEnd:1;
 	uint16_t										rfidReq:1;

BIN
EVSE/Projects/AW-CCS/Images/FactoryDefaultConfig.bin


BIN
EVSE/Projects/AW-CCS/Images/ramdisk.gz