Parcourir la source

2022-02-11 / Simon Xue

Action
1. Add Sense Creedit Card Page timeout.

Files
As the commit history file

Version:v2.01.XX.XXXX.XX
Simon Xue il y a 3 ans
Parent
commit
82e3017980

+ 8 - 9
EVSE/Projects/DD360Tcci/Apps/CSU/RFID.c

@@ -19,7 +19,7 @@ static struct SysInfoData *pSysInfo 			= NULL;
 bool isDeductDb_ready;
 //------------------------------------------------------------------------------
 static char *rfidPortName = "/dev/ttyS2";
-
+int fd = -1;
 static bool isCardScan = false;
 
 //------------------------------------------------------------------------------
@@ -282,20 +282,19 @@ void AuthorizeToCharge()
         if (ShmSelectGunInfo->PricesInfo[pSysInfo->CurGunSelected].Balance != FAIL_BALANCE_PRICES) {
             StopSystemTimeoutDet();
             // 判斷後台回覆狀態
-            if (canStartCharging()) {
+            if (canStartCharging() && ShmDcCommonData->AuthPass_flag[pSysInfo->CurGunSelected] == TRUE) {
             // LCM => Authorize complete
             	//pDcChargingInfo->SystemStatus = S_AUTHORIZING;
                 //pSysInfo->SystemPage = _PAGE_PLUGIN;
                 //log_info("Wait Gun(%d) plugin",pSysInfo->CurGunSelected);
                 DetectPluginStart();
-                if (ShmDcCommonData->AuthPass_flag[pSysInfo->CurGunSelected] == TRUE)
-                	pSysInfo->SystemPage = _PAGE_PLUGIN;
+				pSysInfo->SystemPage = _PAGE_PLUGIN;
                 //log_info("Gun(%d) Balance: %f",pSysInfo->CurGunSelected,
                 //        ShmSelectGunInfo->PricesInfo[pSysInfo->CurGunSelected].Balance);
             } else {
-                log_info("LCM => Authorize fail");
+                //log_info("LCM => Authorize fail");
                 //pSysInfo->SystemPage = _PAGE_AUTHORIZE_FAIL;
-                strcpy((char *)pSysConfig->UserId, "");
+                //strcpy((char *)pSysConfig->UserId, "");
             }
         }
         ClearAuthorizedFlag();
@@ -403,7 +402,7 @@ void CreateRfidFork(void)
         struct timeb SeqEndTime;
         struct tm *tm;
         pSysInfo = (struct SysInfoData *)GetShmSysInfoData();
-        int fd = -1;
+
         int isContinue = 1;
         RFID rfid = {0};
         RecordTransactionInfo deduct;
@@ -522,10 +521,10 @@ void CreateRfidFork(void)
 
 				if (ShmDcCommonData->PreAuth_Result > 0 ) {
 					strcpy((char *)pSysConfig->UserId,"");
-					log_info("Card Reader Stop");
+					log_info("Credit Card Cancel Stop");
 					memset(&ShmDcCommonData->pCreditCard[pSysInfo->CurGunSelected], 0, sizeof(TransInfo));
 				} else if (ShmDcCommonData->PreAuth_Result < 0) {
-					log_info("Car Reader Stop Fail");
+					log_info("Credit Card Cancel Fail");
 
 				}
 				ShmDcCommonData->PreAuth_Config = _CREDITCARD_IDLE;

+ 9 - 0
EVSE/Projects/DD360Tcci/Apps/CSU/main.c

@@ -2609,8 +2609,17 @@ void CreateTimeoutFork(void)
             		pSysInfo->SystemPage = _PAGE_SELECT_GUN;
             	}
             	break;
+			case Timeout_Sensing:
+				if (GetClockTimeoutValue(pSysInfo->SystemTimeoutTimer) / uSEC_VAL >= TCC_SENSING_TIMEOUT) {
+					StopSystemTimeoutDet();
+					log_info("Sensing timeout");
+					pSysInfo->SystemPage = _PAGE_AUTHORIZE_FAIL;
+					ShmDcCommonData->PreAuth_Config = _CREDITCARD_CANCEL;
+				}
+				break;
             }
 
+
             // 各槍
             for (uint8_t gunIndex = 0; gunIndex < pSysConfig->TotalConnectorCount; gunIndex++) {
                 pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(gunIndex);

+ 1 - 0
EVSE/Projects/DD360Tcci/Apps/CSU/main.h

@@ -52,6 +52,7 @@
 #define TCC_SELECTPAY_TIMEOUT					(180)
 #define TCC_FINALCOST_TIMEOUT					(30)
 #define TCC_SCANCARD_TIMEOUT					(60)
+#define TCC_SENSING_TIMEOUT						(60)
 
 //#define log_info(format, args...) StoreLogMsg_1("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 //#define log_warn(format, args...) StoreLogMsg_1("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)

+ 13 - 0
EVSE/Projects/DD360Tcci/Apps/ModuleLcmCtrl/Module_LcmControl.c

@@ -909,7 +909,17 @@ void ChangeChargingPowerValue(float pow)
     string2ByteArray(value, cmd);
     DisplayValueToLcm(_String_ChargePower, cmd, sizeof(cmd));
 }
+void ChangeChargingRateValue(int rate)
+{
+    uint8_t cmd[10];
+    uint8_t value[10];
+
+    memset(cmd, 0x00, sizeof(cmd));
 
+    sprintf((char *) value, "%d",rate);
+    string2ByteArray(value, cmd);
+    DisplayValueToLcm(_String_ChargeRate, cmd, sizeof(cmd));
+}
 
 void ChangeChargingFeeValue(float fee)
 {
@@ -1154,7 +1164,10 @@ void ProcessPageInfo()
             		pSysInfo->SystemPage = _PAGE_SENSING;
             	}
             	_Text_Running_Count = 1;
+            	ChangeChargingRateValue(ShmDcCommonData->ChargingRate);
                 break;
+            case _PAGE_SENSING:
+            	break;
             case _PAGE_PLUGIN:
             	_everyPageRollChange = 0;
 

+ 0 - 229
EVSE/Projects/DD360Tcci/Apps/ModuleLcmCtrl/Module_LcmControl.h

@@ -49,91 +49,6 @@
 #define _CHANGE_PAYMENT_OK      0x06
 #define _CHANGE_PAYMENT_FAIL    0x07
 
-
-//#define NOODOE_QR_CODE_URL                    "https://ev-alpha-test.noodoe.com/station?id=" ////For Audi
-/*
-#define _StatuIcon				0x1000
-#define _ConfirmStopIcon		0x1002
-#define	_TccareIcon				0x1004
-#define _StartTouchIcon			0x1006
-#define _FurthureIcon			0x1010
-#define _WeatherIcon			0x1012
-#define	_WelcomeIcon			0x1014
-#define _QRCodeIcon				0x1016
-#define _ExclamIcon				0x1018
-#define _PluginIcon				0x101A
-#define _PlugoutIcon			0x101C
-#define _ReturnIcon				0x101E
-#define _PrechargeIcon			0x1020
-#define _MinuteIcon				0x1026
-#define _Rate13Icon				0x1028
-#define _CompleteIcon			0x102A
-#define _KgIcon					0x102C
-#define _Rate14Icon				0x102E
-#define _ExitIcon				0x1030
-#define _FarewellIcon			0x1032
-#define _ChargingIcon			0x1034
-// Circle Battery Setting Icon
-#define _Battery_Circle			0x1036
-// Energy Bar
-#define _EnergyBar				0x1038
-// Prepare Bar
-#define _PrepareBar				0x103A
-
-// QRCode
-#define _QRCode_Authorize		0x1040
-#define _QRCode_Replug			0x1050
-#define _QRCode_Complete		0x1060
-
-#define _LeftGun_status			0x1070
-#define _RightGun_status		0x1072
-// Warm
-#define _Icon_Warming_0			0x1074
-#define _Icon_Warming_1			0x1076
-#define _Icon_Warming_2			0x1078
-#define _Icon_Warming_3			0x107A
-#define _Icon_Warming_4			0x107C
-
-// Touch
-#define _Touch_LeftGun			0x1080
-#define _Touch_RightGun			0x1082
-#define _Touch_Return			0x1084
-#define _Touch_IDLE				0x1086
-#define _Touch_Stop				0x1088
-#define _Touch_Stop_Confirm		0x108A
-#define _Touch_Stop_Cancel		0x108C
-#define _Touch_ConfirmLeft		0x1208
-#define _Touch_ConfirmRight		0x120A
-
-// Text String
-#define _Text_Power				0x1090
-#define _Text_Time				0x10A0
-#define _Text_Energy			0x10B0
-#define _Text_Money				0x10C0
-#define _Text_BatterySoc		0x10D0
-#define _Text_Carbon			0x10E0
-// Warming Code
-#define _Text_Warming_0			0x10F0
-#define _Text_Warming_1			0x1100
-#define _Text_Warming_2			0x1110
-#define _Text_Warming_3			0x1120
-#define _Text_Warming_4			0x1130
-#define _Text_Date				0x1140
-#define _Text_Tempture			0x1150
-
-#define _WeekIcon				0x1200
-#define _WeatherIcon			0x1202
-#define _LocationIcon			0x1204
-#define _StopChargeBtn			0x1206
-
-#define _ErrorIcon				0x120C
-#define _PayIcon				0x120E
-#define _ProgreePayIcon			0x1210
-#define _ConfirmLeftIcon		0x1212
-#define _ConfirmRightIcon		0x1214
-#define _PayFailLeftIcon		0x1216
-#define _PayFailRightIcon		0x1218
-*/
 #define _Animation				0x1000
 #define _Icon_TouchStart		0x1002
 #define _Icon_Location			0x1004
@@ -217,151 +132,7 @@
 #define _Touch_Pay_LinePay		0x151C
 
 enum _TCC_ICON_LIST_ {
-	/*
-    _ICON_Empty 			= 0,
-	_ICON_StatusInit,
-	_ICON_StatusAuthorize,
-	_ICON_StatusCharge,
-	_ICON_StatusComplete,
-	_ICON_AllIdle,
-	_ICON_LeftGunSelect,
-	_ICON_RightGunSelect,
-	_ICON_AllSelect,
-	_ICON_TCCare,
-	_ICON_StartTouch,
-
-	_ICON_Furthure 			= 15,
-	_ICON_Weather,
-	_ICON_Welcome,
-	_ICON_QRCode,
-	_ICON_exclamation,
-	_ICON_plugin,
-	_ICON_Plugout,
-	_ICON_Return,
-	_ICON_PrepareCharge,
-
-	_ICON_min 				= 26,
-	_ICON_Rate_13,
-	_ICON_Complete,
-	_ICON_kg,
-	_ICON_Rate_14,
-	_ICON_Exit,
-	_ICON_HaveANiceDay,
-	_ICON_HaveANiceTrip,
-	_ICON_SaftDrive,
-	_ICON_Charging,
-
-	_ICON_Battery_0 		= 40,
-	_ICON_Battery_1,
-	_ICON_Battery_2,
-	_ICON_Battery_3,
-	_ICON_Battery_4,
-	_ICON_Battery_5,
-	_ICON_Battery_6,
-	_ICON_Battery_7,
-	_ICON_Battery_8,
-	_ICON_Battery_9,
-	_ICON_Battery_10,
-	_ICON_Battery_11,
-	_ICON_Battery_12,
-	_ICON_Battery_13,
-	_ICON_Battery_14,
-	_ICON_Battery_15,
-	_ICON_Battery_16,
-	_ICON_Battery_17,
-	_ICON_Battery_18,
-	_ICON_Battery_19,
-	_ICON_Battery_20,
-	_ICON_Battery_21,
-	_ICON_Battery_22,
-	_ICON_Battery_23,
-	_ICON_Battery_24,
-	_ICON_Battery_25,
-	_ICON_Battery_26,
-	_ICON_Battery_27,
-	_ICON_Battery_28,
-	_ICON_Battery_29,
-	_ICON_Battery_30,
-	_ICON_Battery_31,
-	_ICON_Battery_32,
-	_ICON_Battery_33,
-	_ICON_Battery_34,
-	_ICON_Battery_35,
-	_ICON_Battery_36,
-	_ICON_Weather_Sun,
-	_ICON_Weather_Cloudy,
-	_ICON_Weather_Rain,
-	_ICON_Weather_Thunder,
-	_ICON_Weather_Snow,
-	_ICON_Weather_Fog,
-
-	_ICON_PrePare_1   = 86,
-	_ICON_PrePare_2,
-	_ICON_PrePare_3,
-	_ICON_PrePare_4,
-	_ICON_PrePare_5,
-	_ICON_PrePare_6,
-	_ICON_PrePare_7,
-	_ICON_PrePare_8,
-	_ICON_PrePare_9,
-	_ICON_PrePare_10,
-	_ICON_PrePare_11,
-	_ICON_PrePare_12,
-	_ICON_PrePare_13,
-	_ICON_PrePare_14,
-	_ICON_Left_CCS1_Off,
-	_ICON_Left_CCS2_Off,
-	_ICON_Left_CHAdeMO_Off,
-	_ICON_Left_CCS1_ON,
-	_ICON_Left_CCS2_ON,
-	_ICON_Left_CHAdeMO_ON,
-	_ICON_Right_CCS1_Off,
-	_ICON_Right_CCS2_Off,
-	_ICON_Right_CHAdeMo_Off,
-	_ICON_Right_CCS1_ON,
-	_ICON_Right_CCS2_ON,
-	_ICON_Right_CHAdeMO_ON,
-	_ICON_WARMING,
-	_ICON_SELECT_TEXT,
-	_ICON_MONDAY,
-	_ICON_TUESDAY,
-	_ICON_WENSDAY,
-	_ICON_THRUDAY,
-	_ICON_FRIDAY,
-	_ICON_SATURDAY,
-	_ICON_SUNDAY,
-	_ICON_LOCATION_TAIPEI,
 
-	_ICON_PAYFAIL = 126,
-	_ICON_PROGREEPAY_1,
-	_ICON_PROGREEPAY_2,
-	_ICON_PROGREEPAY_3,
-	_ICON_PROGREEPAY_4,
-	_ICON_PROGREEPAY_5,
-	_ICON_PROGREEPAY_6,
-	_ICON_PROGREEPAY_7,
-	_ICON_PROGREEPAY_8,
-	_ICON_PROGREEPAY_9,
-	_ICON_PROGREEPAY_10,
-	_ICON_PROGREEPAY_11,
-	_ICON_PROGREEPAY_12,
-	_ICON_PROGREEPAY_13,
-	_ICON_PROGREEPAY_14,
-	_ICON_PROGREEPAY_15,
-	_ICON_STOPSERVICE,
-	_ICON_WELCOMELEFTCCS1,
-	_ICON_WELCOMELEFTCCS2,
-	_ICON_WELCOMELEFTCHADEMO,
-	_ICON_WELCOMERIGHTCCS1,
-	_ICON_WELCOMERIGHTCCS2,
-	_ICON_WELCOMERIGHTCHADEMO,
-	_ICON_PAYFAILLEFTCCS1,
-	_ICON_PAYFAILLEFTCCS2,
-	_ICON_PAYFAILLETCHADEMO,
-	_ICON_PAYFAILRIGHTCCS1,
-	_ICON_PAYFAILRIGHTCCS2,
-	_ICON_PAYFAILRIGHTCHADEMO,
-	*/
 	_ICON_Empty 			= 0,
 	_TCC_Week_Monday,
 	_TCC_Week_Tuesday,

+ 1 - 0
EVSE/Projects/DD360Tcci/Apps/timeout.h

@@ -60,6 +60,7 @@ enum Timeout_flag {
 	Timeout_SelectPayMode		   = 23,
 	Timeout_FinalCost			   = 24,
 	Timeout_ScanCard			   = 25,
+	Timeout_Sensing				   = 26,
 };
 
 //------------------------------------------------------------------------------

BIN
EVSE/Projects/DD360Tcci/Images/ramdisk.gz


BIN
EVSE/Projects/DD360Tcci/output/Module_DoComm


BIN
EVSE/Projects/DD360Tcci/output/Module_EvComm


BIN
EVSE/Projects/DD360Tcci/output/Module_LcmControl


BIN
EVSE/Projects/DD360Tcci/output/Module_UpdateFW


BIN
EVSE/Projects/DD360Tcci/output/ReadCmdline


BIN
EVSE/Projects/DD360Tcci/output/main