浏览代码

2022-04-06 / Simon Xue

Action:
1. [Modify] Credit card process timing.
2. [Modify] Show summary page will show other user.
3. [Modify] Autostartcharing mode.

Files
As the following commit history files.

Image Version: V2.10.XX.XXXX.XX
Simon Xue 3 年之前
父节点
当前提交
48bb9119be

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

@@ -356,7 +356,7 @@ void PreAuthCompleteToCardReader(int fd,uint8_t gunIndex)
 	result = CreditCardPreAuthComplete(fd,(int)ShmDcCommonData->TransactionInfo[gunIndex].Amount, &pSysConfig->ModelName[0],
 											&ShmDcCommonData->TransactionInfo[gunIndex].pCreditCard.VemData[0],
 											&ShmDcCommonData->TransactionInfo[gunIndex].pCreditCard);
-    sleep(10);
+    //sleep(10);
 	if (result > 0 ) {
 		log_info("Credit Card Spend Money:%.1f", LocalTransactionInfo.Amount);
 		pSysInfo->SystemPage = _PAGE_COMPLETE;
@@ -381,7 +381,7 @@ int CreditCardCancelPreAuth(int fd, uint8_t gunIndex)
         &ShmDcCommonData->TransactionInfo[gunIndex].pCreditCard.ApprovalNo[0],
         &ShmDcCommonData->TransactionInfo[gunIndex].pCreditCard.CardNo[0],
         &ShmDcCommonData->TransactionInfo[gunIndex].pCreditCard.VemData[0]);
-    sleep(10);
+    //sleep(10);
     if (ShmDcCommonData->PreAuth_Result >= 0) {
         strcpy((char*)pSysConfig->UserId, "");
         //ShmDcCommonData->PayFinish[gunIndex] = TRUE;
@@ -441,7 +441,7 @@ void ReDeductProcess(int fd)
                 result = CreditCardPreAuthComplete(fd, (int)deductInfo[j].Amount, &pSysConfig->ModelName[0],
                     &deductInfo[j].pCreditCard.VemData[0],
                     &ShmDcCommonData->TransactionInfo[0].pCreditCard);
-                sleep(10);
+                sleep(7);
                 if (result > 0) {
                     deductInfo[j].DeductResult = _DEDUCT_COMPLETE_PASS;
                     log_info("Backgroud PreAuthComplete OK");
@@ -546,14 +546,17 @@ void CreateRfidFork(void)
                     log_info("Not Into Charging cancel Trade");
                     StopGunInfoTimeoutDet(gunIndex);
                     ShmDcCommonData->TradeCancel = TRUE;
+                    pSysInfo->CurGunSelected = gunIndex;
                     pSysInfo->SystemPage = _PAGE_SENSING;
                     StartSystemTimeoutDet(Timeout_TradeCancel);
                     CreditCardCancelPreAuth(fd, gunIndex);
                     pSysInfo->SystemPage = _PAGE_PLUGOUT;
                     StopSystemTimeoutDet();
                 } else {
-                    if (ShmDcCommonData->StopCharge[gunIndex] == TRUE && ShmDcCommonData->finalcost_flag[gunIndex]) {
+                    if (ShmDcCommonData->StopCharge[gunIndex] == TRUE && ShmDcCommonData->finalcost_flag[gunIndex] &&
+                        (pSysInfo->SystemPage != _PAGE_AUTHORIZE && pSysInfo->SystemPage != _PAGE_SENSING)) {
                         ShmDcCommonData->StopCharge[gunIndex] = FALSE;
+                        pSysInfo->CurGunSelected = gunIndex;
                         if (pDcChargingInfo->Replug_flag == TRUE) {
                             log_info("Not Into Charging cancel Trade");
                             ShmDcCommonData->TradeCancel = TRUE;
@@ -601,7 +604,7 @@ void CreateRfidFork(void)
                 if (ShmDcCommonData->TradeCancel == FALSE && result > 0) {
                     pSysInfo->SystemPage = _PAGE_SENSING;
                 }
-                sleep(10);
+                sleep(3);
 
                 ShmDcCommonData->PreAuth_Result = result;
 				//result = 1;

+ 16 - 19
EVSE/Projects/DD360Tcci/Apps/CSU/main.c

@@ -81,8 +81,8 @@ uint8_t bd0_2_status = 0;
 uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
-char *fwVersion = "V2.09.00.0000.00"; // Phihong version
-char* DebugVersion = "v2.09.02";      // Software debug version
+char *fwVersion = "V2.10.00.0000.00"; // Phihong version
+char* DebugVersion = "v2.10.00";      // Software debug version
 //sqlite3 *localDb;
 bool isDb_ready;
 
@@ -1773,7 +1773,7 @@ void ChargingTerminalProcess(uint8_t gunIndex)
 {
     pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
     //if (pDcChargingInfo->SystemStatus == S_CHARGING)
-    ShmDcCommonData->StopCharge[gunIndex] = TRUE;
+    //ShmDcCommonData->StopCharge[gunIndex] = TRUE;
     setChargerMode(gunIndex, MODE_TERMINATING);
 }
 
@@ -1781,7 +1781,7 @@ void ChargingAlarmProcess(uint8_t gunIndex)
 {
     pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
     //if (pDcChargingInfo->SystemStatus == S_CHARGING)
-    ShmDcCommonData->StopCharge[gunIndex] = TRUE;
+    //ShmDcCommonData->StopCharge[gunIndex] = TRUE;
     UpdateErrorCodeToOcpp(gunIndex);
     setChargerMode(gunIndex, MODE_ALARM);
 }
@@ -2766,7 +2766,8 @@ void CreateTimeoutFork(void)
                         log_info("Gun[%d] Timeout_ExitPage", gunIndex);
                         StopGunInfoTimeoutDet(gunIndex);
                         ShmDcCommonData->is_exit[gunIndex] = TRUE;
-                        pSysInfo->SystemPage = _PAGE_EXIT;
+                        if (pSysInfo->CurGunSelected == gunIndex)
+                            pSysInfo->SystemPage = _PAGE_EXIT;
                         StartGunInfoTimeoutDet(gunIndex, Timeout_PlugOutGun);
                     }
                     break;
@@ -3590,9 +3591,10 @@ static void ReviewCriticalAlarm(void)
 			ShmSelectGunInfo->EthDevStatus.Backend == 0 ||
 			ShmSelectGunInfo->EthDevStatus.Backend == 2
        ) {
-        if ((ShmSelectGunInfo->EthDevStatus.Backend == 0 ||
+        if (((ShmSelectGunInfo->EthDevStatus.Backend == 0 ||
             ShmSelectGunInfo->EthDevStatus.Backend == 2) &&
-            ShmDcCommonData->DebugFlag == TRUE) {
+            ShmDcCommonData->DebugFlag == TRUE) || 
+            pSysConfig->AuthorisationMode) {
             pSysWarning->Level = WARN_LV_NL;
             return;
         }
@@ -4591,6 +4593,7 @@ CheckStatus:
                     if (strcmp((char *)ShmOCPP16Data->StopTransaction[gunIndex].StopReason, "") == EQUAL) {
                         strcpy((char *)ShmOCPP16Data->StopTransaction[gunIndex].StopReason, "Local");
                     }
+                    ShmDcCommonData->StopCharge[gunIndex] = TRUE;
                     StopGunInfoTimeoutDet(gunIndex);
                     StartGunInfoTimeoutDet(gunIndex, Timeout_FinalCost);
                     StartSystemTimeoutDet(Timeout_Terminating);
@@ -4654,16 +4657,9 @@ CheckStatus:
                         StopSystemTimeoutDet();
                     if (ShmDcCommonData->is_AutoStart[gunIndex] == TRUE && pSysInfo->CurGunSelected == gunIndex)
                         pSysInfo->SystemPage = _PAGE_COMPLETE;
+                    ShmDcCommonData->StopCharge[gunIndex] = TRUE;
                 }
-                /*
-                if (ShmDcCommonData->PreAuth_Config == _CREDITCARD_CANCEL &&
-                    ShmDcCommonData->PreAuth_Result != 0 && cancelcount < 30) {
-                    sleep(1);
-                    cancelcount++;
-                    log_info("Cancel Not Complete yet");
-                    break;
-                }
-                */
+
                 //if (pSysInfo->SystemPage == _LCM_ERROR) {
                 if (pSysInfo->SystemPage == _PAGE_MAINTAIN) {
                     break;
@@ -4672,8 +4668,8 @@ CheckStatus:
                 	pSysInfo->SystemPage = _PAGE_EXIT;
                 	break;
                 }
-                if (pSysInfo->CurGunSelected == gunIndex &&  pDcChargingInfo->ConnectorPlugIn == NO &&
-                    (pSysInfo->SystemPage != _PAGE_PAYING || pSysInfo->SystemPage != _PAGE_SENSING)) {
+                if (pSysInfo->CurGunSelected == gunIndex && pDcChargingInfo->ConnectorPlugIn == NO &&
+                    (pSysInfo->SystemPage != _PAGE_PAYING && pSysInfo->SystemPage != _PAGE_SENSING)) {
                     StartGunInfoTimeoutDet(gunIndex, Timeout_ExitPage);
                 }
 
@@ -4703,6 +4699,7 @@ CheckStatus:
                     }
                     TheEndCharging(gunIndex);
                     StopGunInfoTimeoutDet(gunIndex);
+                    ShmDcCommonData->StopCharge[gunIndex] = TRUE;
                     
                     if (pDcChargingInfo->Replug_flag == TRUE) {
                         /*
@@ -4739,7 +4736,7 @@ CheckStatus:
                 }
 
                 if (pSysInfo->CurGunSelected == gunIndex && pDcChargingInfo->ConnectorPlugIn == NO &&
-                    (pSysInfo->SystemPage != _PAGE_PAYING || pSysInfo->SystemPage != _PAGE_SENSING)) {
+                    (pSysInfo->SystemPage != _PAGE_PAYING && pSysInfo->SystemPage != _PAGE_SENSING)) {
                     StartGunInfoTimeoutDet(gunIndex, Timeout_ExitPage);
                 }
 

二进制
EVSE/Projects/DD360Tcci/Apps/UnsafetyOutputTask


二进制
EVSE/Projects/DD360Tcci/Images/ramdisk.gz


二进制
EVSE/Projects/DD360Tcci/output/Module_LcmControl


二进制
EVSE/Projects/DD360Tcci/output/main