Переглянути джерело

2022-07-12 / Simon Xue

Action:
1. [Fix] Fix Remote start didn't get final cost show complete page.
2. [Mod] ReadCmdline show version.

Files
As the following commit history files

Image Version: V2.13.XX.XXXX.XX
Simon Xue 2 роки тому
батько
коміт
9b60ef0c8d

+ 2 - 5
EVSE/Projects/DD360Tcci/Apps/CSU/RFID.c

@@ -501,7 +501,6 @@ void CreateRfidFork(void)
                 if (checkRemoteStart(gunIndex) && ShmDcCommonData->AuthPass_flag[gunIndex] &&
                     !ShmDcCommonData->PayPass_flag[gunIndex]) {
                     RemoteStartCancelPreAuth(gunIndex);
-                    ShmDcCommonData->PayPass_flag[gunIndex] = TRUE;
                 }
 
                 if (ShmDcCommonData->StopCharge[gunIndex] == TRUE && pDcChargingInfo->Replug_flag == TRUE) {
@@ -517,6 +516,7 @@ void CreateRfidFork(void)
                     }
                     ShmDcCommonData->StopCharge[gunIndex] = FALSE;
                     log_info("Gun %d Not Into Charging cancel Trade",gunIndex);
+            
                     StopGunInfoTimeoutDet(gunIndex);
                     ShmDcCommonData->TradeCancel = TRUE;
                     pSysInfo->SystemPage = _PAGE_SENSING;
@@ -534,11 +534,8 @@ void CreateRfidFork(void)
                         StopGunInfoTimeoutDet(gunIndex); //Timeout_FinalCost
 
                         // Remote Start of AutoStart ByPass Credit Card Reader
-                        if (ShmDcCommonData->DebugFlag == TRUE ||
-                            checkRemoteStart(gunIndex) ||
+                        if (ShmDcCommonData->DebugFlag == TRUE || checkRemoteStart(gunIndex) ||
                             ShmDcCommonData->is_AutoStart[gunIndex]) {
-                            pSysInfo->SystemPage = _PAGE_COMPLETE;
-                            ShmDcCommonData->PayPass_flag[gunIndex] = TRUE;
                             continue;
                         }
                         // 實際扣款

+ 34 - 39
EVSE/Projects/DD360Tcci/Apps/CSU/main.c

@@ -82,8 +82,8 @@ uint8_t bd0_2_status = 0;
 uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
-char *fwVersion = "V2.12.00.0000.00"; // Phihong version
-char* DebugVersion = "V2.12.04";      // Software debug version
+char *fwVersion = "V2.13.00.0000.00"; // Phihong version
+char* DebugVersion = "V2.13.00";      // Software debug version
 //sqlite3 *localDb;
 bool isDb_ready;
 
@@ -292,7 +292,7 @@ static void GetFirmwareVersion(void)
 {
     // Get CSU root file system version
     sprintf((char *)pSysInfo->CsuRootFsFwRev, fwVersion);
-
+    sprintf((char*)ShmDcCommonData->DebugVersion, DebugVersion);
     uint8_t count = 0, chademo = 0, ccs = 0, gb = 0;
     for (uint8_t idx = 0; idx < 3; idx++) {
         if (pSysConfig->ModelName[7 + idx] == 'J') {
@@ -2766,18 +2766,11 @@ void CreateTimeoutFork(void)
                 		if (ShmDcCommonData->finalcost_flag[gunIndex] == FALSE) {
                             if (ShmDcCommonData->is_AutoStart[gunIndex] || ShmDcCommonData->is_RemoteStart[gunIndex]) {
                                 ShmDcCommonData->PayPass_flag[gunIndex] = FALSE;
-                                pSysInfo->SystemPage = _PAGE_PAYFAIL;
                                 ShmDcCommonData->finalcost_flag[gunIndex] = TRUE;
                             } else {
                                 log_info("Not Get Final Cost");
                                 ShmDcCommonData->PayPass_flag[gunIndex] = FALSE;
                                 pSysInfo->SystemPage = _PAGE_PAYFAIL;
-                                /*
-                                ShmDcCommonData->TransactionInfo[gunIndex].Amount = pDcChargingInfo->PresentChargedEnergy * ShmDcCommonData->ChargingRate;
-                                if (ShmDcCommonData->TransactionInfo[gunIndex].Amount < 1)
-                                    ShmDcCommonData->TransactionInfo[gunIndex].Amount = 1;
-                                ShmDcCommonData->finalcost_flag[gunIndex] = TRUE;
-                                */
                             }
                 		}
                 	}
@@ -4407,7 +4400,7 @@ int main(void)
                 // 讀卡邏輯
                 if (!ShmDcCommonData->TradeCancel && pSysInfo->CurGunSelected == gunIndex)
                     ScannerCardProcess(gunIndex);
-                if (pSysInfo->SystemPage == _PAGE_SELECT_GUN) {
+                if (pSysInfo->SystemPage == _PAGE_SELECT_GUN || pSysInfo->SystemPage == _PAGE_IDLE) {
                 	//ShmDcCommonData->LineStatus[gunIndex] = 0;
                 	StopGunInfoTimeoutDet(gunIndex);
 				}
@@ -4858,29 +4851,32 @@ int main(void)
                         StartGunInfoTimeoutDet(gunIndex, Timeout_ExitPage);
                     }
                 }
+                if (pDcChargingInfo->Replug_flag == TRUE && pSysInfo->CurGunSelected == gunIndex) {
+                    pSysInfo->SystemPage = _PAGE_PLUGOUT;
+                    break;
+                }
                 // Remote start
                 if (ShmDcCommonData->is_RemoteStart[gunIndex] && pSysInfo->CurGunSelected == gunIndex) {
-                    if (pDcChargingInfo->Replug_flag == TRUE)
-                        pSysInfo->SystemPage = _PAGE_PLUGOUT;
-                    else {
-                        if (ShmDcCommonData->finalcost_flag[gunIndex]) {
+
+                    if (ShmDcCommonData->finalcost_flag[gunIndex]) {
+                        if (ShmDcCommonData->PayPass_flag[gunIndex]) {
                             pSysInfo->SystemPage = _PAGE_COMPLETE;
+                            //log_info("_PAGE_COMPLETE");
                         } else {
-                            pSysInfo->SystemPage = _PAGE_PAYING;
+                            pSysInfo->SystemPage = _PAGE_PAYFAIL;
+                            //log_info("_PAGE_PAYFAIL");
                         }
+                    } else {
+                        pSysInfo->SystemPage = _PAGE_PAYING;
                     }
                     break;
                 }
                 if (pSysInfo->CurGunSelected == gunIndex && 
                     pSysInfo->SystemPage != _PAGE_PAYING && pSysInfo->SystemPage != _PAGE_SENSING) {
-                    if (pDcChargingInfo->Replug_flag == TRUE)
-                        pSysInfo->SystemPage = _PAGE_PLUGOUT;
-                    else {
-                        if (ShmDcCommonData->PayPass_flag[gunIndex] == TRUE)
-                            pSysInfo->SystemPage = _PAGE_COMPLETE;
-                        else
-                            pSysInfo->SystemPage = _PAGE_PAYFAIL;
-                    }
+                    if (ShmDcCommonData->PayPass_flag[gunIndex] == TRUE)
+                        pSysInfo->SystemPage = _PAGE_COMPLETE;
+                    else
+                        pSysInfo->SystemPage = _PAGE_PAYFAIL;
                 }
 
                 break;
@@ -4934,28 +4930,27 @@ int main(void)
                         StartGunInfoTimeoutDet(gunIndex, Timeout_ExitPage);
                     }
                 }
+                if (pDcChargingInfo->Replug_flag == TRUE && pSysInfo->CurGunSelected == gunIndex) {
+                    pSysInfo->SystemPage = _PAGE_PLUGOUT;
+                    break;
+                }
                 // Remote start
                 if (ShmDcCommonData->is_RemoteStart[gunIndex] && pSysInfo->CurGunSelected == gunIndex) {
-                    if (pDcChargingInfo->Replug_flag == TRUE)
-                        pSysInfo->SystemPage = _PAGE_PLUGOUT;
-                    else {
-                        if (ShmDcCommonData->finalcost_flag[gunIndex]) {
+                    if (ShmDcCommonData->finalcost_flag[gunIndex]) {
+                        if (ShmDcCommonData->PayPass_flag[gunIndex])
                             pSysInfo->SystemPage = _PAGE_COMPLETE;
-                        } else {
-                            pSysInfo->SystemPage = _PAGE_PAYING;
-                        }
+                        else
+                            pSysInfo->SystemPage = _PAGE_PAYFAIL;
+                    } else {
+                        pSysInfo->SystemPage = _PAGE_PAYING;
                     }
                     break;
                 }
                 if (pSysInfo->CurGunSelected == gunIndex && pSysInfo->SystemPage != _PAGE_PAYING ) {
-                	if (pDcChargingInfo->Replug_flag == TRUE)
-                		pSysInfo->SystemPage = _PAGE_PLUGOUT;
-                	else {
-                		if (ShmDcCommonData->PayPass_flag[gunIndex] == TRUE)
-							pSysInfo->SystemPage = _PAGE_COMPLETE;
-						else
-							pSysInfo->SystemPage = _PAGE_PAYFAIL;
-                	}
+                	if (ShmDcCommonData->PayPass_flag[gunIndex] == TRUE)
+						pSysInfo->SystemPage = _PAGE_COMPLETE;
+					else
+						pSysInfo->SystemPage = _PAGE_PAYFAIL;
 				}
 
                 break;

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

@@ -580,6 +580,7 @@ typedef struct StDcCommonInfo {
     uint8_t tccdev;
     uint8_t TaiwanEast;
     uint8_t lcmtest;
+    char DebugVersion[32];
 } DcCommonInfo;
 
 #endif /* CONFIG_H_ */

+ 3 - 0
EVSE/Projects/DD360Tcci/Apps/ModuleDoComm/DoComm.c

@@ -2262,6 +2262,9 @@ static int messageTrigger(int fd, uint8_t plugNum, uint8_t gunID, uint8_t curReg
 					ShmDcCommonData->TransactionInfo[plugNum].Amount = pDcChargingInfo->ChargingFee;
 					ShmDcCommonData->finalcost_flag[plugNum] = TRUE;
 					log_info("Gun %d get final cost %f", plugNum, ShmDcCommonData->TransactionInfo[plugNum].Amount);
+                    if (ShmDcCommonData->is_RemoteStart[plugNum] || ShmDcCommonData->is_AutoStart[plugNum]) {
+                        ShmDcCommonData->PayPass_flag[plugNum] = TRUE;
+                    }
                 }
             }
             curReg = REG_PLUG_IN_STATE;

+ 2 - 1
EVSE/Projects/DD360Tcci/Apps/ModuleLcmCtrl/Module_LcmControl.c

@@ -449,6 +449,7 @@ void CheckConfirmGun(uint8_t gunIndex)
         log_info("Reservation can't select");
         return;
     }
+    //log_info("Confirm Gun%d",gunIndex);
 	pSysInfo->CurGunSelected = gunIndex;
 	pSysInfo->SystemPage = _PAGE_BILL;
 }
@@ -617,7 +618,7 @@ void CheckLCMPressed()
     pid_t Pid = fork();
     if ( Pid == 0 ) {
         while (1) {
-        	if (pSysInfo->SystemPage != _PAGE_SELECT_GUN) {
+        	if (pSysInfo->SystemPage != _PAGE_SELECT_GUN && pSysInfo->SystemPage != _PAGE_IDLE) {
 				CheckTouchPress(_Touch_Show_Left);
 				CheckTouchPress(_Touch_Show_Right);
         	}

+ 15 - 1
EVSE/Projects/DD360Tcci/Apps/ReadCmdline.c

@@ -336,7 +336,20 @@ void GetFwVerProc(void)
                      "      ac\n"
                      "      exit | c | C\n"
                      "      help | ? | h\n";
-
+    printf("ModelName = %s\r\n", pSysConfig->ModelName);
+    printf("DC Main Version = %s \n", pSysInfo->CsuRootFsFwRev);
+    printf("DC Main Debug Version = %s \n", ShmDcCommonData->DebugVersion);
+    printf("407 FW Version = %s\n", ShmPrimaryMcuData->version);
+    printf("Gun 0 FW Version = %s \n", pSysInfo->Connector1FwRev);
+    printf("Gun 1 FW Version = %s \n", pSysInfo->Connector2FwRev);
+    printf("Relay Board Version = %s \n", pSysInfo->RelayModuleFwRev);
+    printf("FAN Version = %s \n", pSysInfo->FanModuleFwRev);
+    printf("LED Version = %s \n", pSysInfo->LedModuleFwRev);
+    printf("Dispenser Network Information checked: IP = % s Netmask = % s, Gateway = % s \n",
+        pSysConfig->Eth0Interface.EthIpAddress,
+        pSysConfig->Eth0Interface.EthSubmaskAddress,
+        pSysConfig->Eth0Interface.EthGatewayAddress);
+    /*
     while (isContinue) {
         if (readCmdKey(CMD_KEY_WAIT) == NO) {
             continue;
@@ -381,6 +394,7 @@ void GetFwVerProc(void)
         }
 
     }//while
+    */
 }
 
 void CreateOneError(char *v1)

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


BIN
EVSE/Projects/DD360Tcci/output/FactoryConfig


BIN
EVSE/Projects/DD360Tcci/output/Module_ChkSysTask


BIN
EVSE/Projects/DD360Tcci/output/Module_DoComm


BIN
EVSE/Projects/DD360Tcci/output/Module_EvComm


BIN
EVSE/Projects/DD360Tcci/output/Module_EventLogging


BIN
EVSE/Projects/DD360Tcci/output/Module_InternalComm


BIN
EVSE/Projects/DD360Tcci/output/Module_LcmControl


BIN
EVSE/Projects/DD360Tcci/output/Module_PrimaryComm


BIN
EVSE/Projects/DD360Tcci/output/Module_UpdateFW


BIN
EVSE/Projects/DD360Tcci/output/ReadCmdline


BIN
EVSE/Projects/DD360Tcci/output/main