|
@@ -178,7 +178,7 @@ void destroySelGun(uint8_t curGun)
|
|
|
if ((curGun == LEFT_GUN_NUM) && (ShmSelectGunInfo->SelGunInfo.LeftGun != SEL_GUN_RELEASE)) {
|
|
|
if (ShmSelectGunInfo->SelGunInfo.LeftGun == SEL_GUN_CONFIRM ||
|
|
|
ShmSelectGunInfo->SelGunInfo.LeftGun == SEL_GUN_ATHOR) {
|
|
|
- changeLcmPage(_PAGE_SELECT_GUN);
|
|
|
+ //changeLcmPage(_PAGE_SELECT_GUN);
|
|
|
}
|
|
|
ShmSelectGunInfo->SelGunInfo.LeftGun = SEL_GUN_RELEASE;
|
|
|
StopGunInfoTimeoutDet(LEFT_GUN_NUM);
|
|
@@ -197,7 +197,7 @@ void destroySelGun(uint8_t curGun)
|
|
|
if ((curGun == RIGHT_GUN_NUM) && (ShmSelectGunInfo->SelGunInfo.RightGun != SEL_GUN_RELEASE)) {
|
|
|
if (ShmSelectGunInfo->SelGunInfo.RightGun == SEL_GUN_CONFIRM ||
|
|
|
ShmSelectGunInfo->SelGunInfo.RightGun == SEL_GUN_ATHOR) {
|
|
|
- changeLcmPage(_PAGE_SELECT_GUN);
|
|
|
+ //changeLcmPage(_PAGE_SELECT_GUN);
|
|
|
}
|
|
|
ShmSelectGunInfo->SelGunInfo.RightGun = SEL_GUN_RELEASE;
|
|
|
StopGunInfoTimeoutDet(RIGHT_GUN_NUM);
|
|
@@ -2554,27 +2554,11 @@ void CreateTimeoutFork(void)
|
|
|
}
|
|
|
break;
|
|
|
case Timeout_VerifyFail:
|
|
|
-
|
|
|
if (GetClockTimeoutValue(pSysInfo->SystemTimeoutTimer) / uSEC_VAL >= AUTHORIZE_FAIL_TIMEOUT) {
|
|
|
log_info("Timeout_VerifyFail");
|
|
|
- /*if (pSysInfo->SystemPage ==_LCM_START_AUTHORIZE_FAIL ) {
|
|
|
- StopSystemTimeoutDet();
|
|
|
- _AutoReturnTimeout();
|
|
|
- //destroySelGun(pSysInfo->CurGunSelected);
|
|
|
-
|
|
|
- if (ShmSelectGunInfo->AuthorStateFromCabinet[pSysInfo->CurGunSelected] == YES) { //DoComm no ask cabinet balance
|
|
|
- ShmSelectGunInfo->AuthorStateFromCabinet[pSysInfo->CurGunSelected] = NO;
|
|
|
- pAlarmCode->AlarmEvents.bits.DisconnectedFromDo = ABNORMAL;
|
|
|
- log_error("Author timeout restart DoComm");
|
|
|
- system("killall Module_DoComm");
|
|
|
- //sleep(1);
|
|
|
- //system("/root/Module_DoComm &");
|
|
|
- }
|
|
|
- } else*/ if (pSysInfo->SystemPage ==_PAGE_AUTHORIZE_FAIL ) {
|
|
|
- StopSystemTimeoutDet();
|
|
|
- pSysInfo->SystemPage = _PAGE_SELECT_GUN;
|
|
|
- setChargerMode(pSysInfo->CurGunSelected, S_IDLE);
|
|
|
- }
|
|
|
+ StopSystemTimeoutDet();
|
|
|
+ pSysInfo->SystemPage = _PAGE_SELECT_GUN;
|
|
|
+ setChargerMode(pSysInfo->CurGunSelected, S_IDLE);
|
|
|
}
|
|
|
break;
|
|
|
/*
|
|
@@ -2739,7 +2723,8 @@ void CreateTimeoutFork(void)
|
|
|
setChargerMode(gunIndex, MODE_IDLE);
|
|
|
destroySelGun(gunIndex); //Jerry add
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
- systemPageRestoreInit();
|
|
|
+ if (pSysInfo->CurGunSelected == gunIndex)
|
|
|
+ systemPageRestoreInit();
|
|
|
}
|
|
|
break;
|
|
|
case Timeout_FinalCost:
|
|
@@ -2771,22 +2756,6 @@ void CreateTimeoutFork(void)
|
|
|
StartGunInfoTimeoutDet(gunIndex, Timeout_PlugOutGun);
|
|
|
}
|
|
|
break;
|
|
|
- /*
|
|
|
- case Timeout_SelectGun: //Jerry add
|
|
|
- if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= SEL_GUN_TIMEOUT) {
|
|
|
- log_info("Timeout_SelectGun");
|
|
|
- StopGunInfoTimeoutDet(gunIndex);
|
|
|
- destroySelGun(gunIndex); //jerry add
|
|
|
- }
|
|
|
- break;
|
|
|
- */
|
|
|
- /*
|
|
|
- case Timeout_DetailView:
|
|
|
- if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= DETAILVIEW_TIMEOUT) {
|
|
|
- StopGunInfoTimeoutDet(gunIndex);
|
|
|
- pSysInfo->SystemPage = _LCM_VIEW;
|
|
|
- }
|
|
|
- break;*/
|
|
|
}
|
|
|
}
|
|
|
sleep(1);
|
|
@@ -3937,6 +3906,7 @@ void ResetIdleData(uint8_t gunIndex)
|
|
|
ShmDcCommonData->is_AutoStart[gunIndex] = FALSE;
|
|
|
ShmDcCommonData->is_exit[gunIndex] = FALSE;
|
|
|
ShmDcCommonData->StopCharge[gunIndex] = FALSE;
|
|
|
+ ShmDcCommonData->is_plugout[gunIndex] = FALSE;
|
|
|
|
|
|
ShmSelectGunInfo->PricesInfo[gunIndex].Balance = FAIL_BALANCE_PRICES;
|
|
|
destroySelGun(gunIndex);
|
|
@@ -3946,7 +3916,8 @@ void ResetIdleData(uint8_t gunIndex)
|
|
|
}
|
|
|
//strcpy((char *)ShmOCPP16Data->StatusNotification[gunIndex].VendorErrorCode, "");
|
|
|
ReleaseAlarmCode(gunIndex);
|
|
|
- if (pSysInfo->SystemPage != _PAGE_SELECT_GUN && pSysInfo->SystemPage != _PAGE_SELECT_PAY)
|
|
|
+ if (pSysInfo->SystemPage != _PAGE_SELECT_GUN && pSysInfo->SystemPage != _PAGE_SELECT_PAY &&
|
|
|
+ pSysInfo->CurGunSelected == gunIndex)
|
|
|
pSysInfo->SystemPage = _PAGE_IDLE;
|
|
|
}
|
|
|
void CheckErrorCode(uint8_t gunIndex)
|
|
@@ -4021,7 +3992,6 @@ int main(void)
|
|
|
bool isModelNameMatch = true;
|
|
|
uint8_t _ocppProfileChkFlag;
|
|
|
uint8_t gunIndex = 0;
|
|
|
- uint8_t cancelcount = 0;
|
|
|
|
|
|
if (CreateAllCsuShareMemory() == FAIL) {
|
|
|
log_error("create share memory error");
|
|
@@ -4235,12 +4205,11 @@ int main(void)
|
|
|
|
|
|
if (pDcChargingInfo->RemoteStartFlag == YES && pDcChargingInfo->IsAvailable) {
|
|
|
log_info("-------- IDLE Remote Start(%d) --------", gunIndex);
|
|
|
- ChangeGunSelectByIndex(gunIndex);
|
|
|
+ //ChangeGunSelectByIndex(gunIndex);
|
|
|
setChargerMode(gunIndex, MODE_AUTHORIZING);
|
|
|
break;
|
|
|
}
|
|
|
autoStartCharging(gunIndex);
|
|
|
- cancelcount = 0;
|
|
|
// 讀卡邏輯
|
|
|
if (!ShmDcCommonData->TradeCancel)
|
|
|
ScannerCardProcess();
|
|
@@ -4334,7 +4303,7 @@ CheckStatus:
|
|
|
StartGunInfoTimeoutDet(gunIndex,Timeout_WaitPlug);
|
|
|
}
|
|
|
if (pSysInfo->SystemPage == _PAGE_PLUGOUT) {
|
|
|
- StartSystemTimeoutDet(Timeout_VerifyFail);
|
|
|
+ StartSystemTimeoutDet(Timeout_PlugOutGun);
|
|
|
}
|
|
|
if (isDetectPlugin()) {
|
|
|
// 卡號驗證成功後,等待充電槍插入充電車
|
|
@@ -4345,7 +4314,7 @@ CheckStatus:
|
|
|
pDcChargingInfo->RemoteStartFlag = NO;
|
|
|
pDcChargingInfo->isRemoteStart = YES; //DS60-120
|
|
|
|
|
|
- ChangeGunSelectByIndex(gunIndex);
|
|
|
+ //ChangeGunSelectByIndex(gunIndex);
|
|
|
//AddPlugInTimes(gunIndex);
|
|
|
setChargerMode(gunIndex, MODE_REASSIGN_CHECK);
|
|
|
strcpy((char *)pDcChargingInfo->StartUserId, "");
|
|
@@ -4381,7 +4350,13 @@ CheckStatus:
|
|
|
pSysInfo->SystemPage != _PAGE_AUTHORIZE_FAIL &&
|
|
|
pSysInfo->SystemPage != _PAGE_SENSING) {
|
|
|
pSysInfo->SystemPage = _PAGE_PLUGIN;
|
|
|
+ } else if (!GetIsCardScan() && pSysInfo->SystemPage == _PAGE_IDLE &&
|
|
|
+ pDcChargingInfo->RemoteStartFlag == YES) {
|
|
|
+ pSysInfo->CurGunSelected = gunIndex;
|
|
|
}
|
|
|
+ } else if (ShmDcCommonData->AuthPass_flag[gunIndex] && pSysInfo->CurGunSelected == gunIndex &&
|
|
|
+ pSysInfo->SystemPage != _PAGE_AUTHORIZE_FAIL) {
|
|
|
+ pSysInfo->SystemPage = _PAGE_SENSING;
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -4657,7 +4632,6 @@ CheckStatus:
|
|
|
StopSystemTimeoutDet();
|
|
|
if (ShmDcCommonData->is_AutoStart[gunIndex] == TRUE && pSysInfo->CurGunSelected == gunIndex)
|
|
|
pSysInfo->SystemPage = _PAGE_COMPLETE;
|
|
|
- ShmDcCommonData->StopCharge[gunIndex] = TRUE;
|
|
|
}
|
|
|
|
|
|
//if (pSysInfo->SystemPage == _LCM_ERROR) {
|
|
@@ -4668,9 +4642,14 @@ CheckStatus:
|
|
|
pSysInfo->SystemPage = _PAGE_EXIT;
|
|
|
break;
|
|
|
}
|
|
|
- if (pSysInfo->CurGunSelected == gunIndex && pDcChargingInfo->ConnectorPlugIn == NO &&
|
|
|
- (pSysInfo->SystemPage != _PAGE_PAYING && pSysInfo->SystemPage != _PAGE_SENSING)) {
|
|
|
- StartGunInfoTimeoutDet(gunIndex, Timeout_ExitPage);
|
|
|
+
|
|
|
+ if (pDcChargingInfo->ConnectorPlugIn == NO &&
|
|
|
+ pSysInfo->SystemPage != _PAGE_PAYING && pSysInfo->SystemPage != _PAGE_SENSING) {
|
|
|
+ if (pSysInfo->CurGunSelected == gunIndex) {
|
|
|
+ StartGunInfoTimeoutDet(gunIndex, Timeout_ExitPage);
|
|
|
+ } else {
|
|
|
+ StartGunInfoTimeoutDet(gunIndex, Timeout_PlugOutGun);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (pSysInfo->CurGunSelected == gunIndex &&
|
|
@@ -4716,28 +4695,25 @@ CheckStatus:
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- /*
|
|
|
- if (ShmDcCommonData->PreAuth_Config == _CREDITCARD_CANCEL &&
|
|
|
- ShmDcCommonData->PreAuth_Result != 0 && cancelcount < 30) {
|
|
|
- sleep(1);
|
|
|
- cancelcount++;
|
|
|
- //log_info("Cancel Not Complete yet");
|
|
|
- break;
|
|
|
- }
|
|
|
- */
|
|
|
+
|
|
|
if (pSysWarning->Level == WARN_LV_ER) {
|
|
|
pSysInfo->SystemPage = _PAGE_MAINTAIN;
|
|
|
-
|
|
|
continue;
|
|
|
}
|
|
|
+
|
|
|
if (pSysInfo->CurGunSelected == gunIndex && ShmDcCommonData->is_exit[gunIndex]) {
|
|
|
pSysInfo->SystemPage = _PAGE_EXIT;
|
|
|
break;
|
|
|
}
|
|
|
+
|
|
|
|
|
|
- if (pSysInfo->CurGunSelected == gunIndex && pDcChargingInfo->ConnectorPlugIn == NO &&
|
|
|
- (pSysInfo->SystemPage != _PAGE_PAYING && pSysInfo->SystemPage != _PAGE_SENSING)) {
|
|
|
- StartGunInfoTimeoutDet(gunIndex, Timeout_ExitPage);
|
|
|
+ if (pDcChargingInfo->ConnectorPlugIn == NO &&
|
|
|
+ pSysInfo->SystemPage != _PAGE_PAYING && pSysInfo->SystemPage != _PAGE_SENSING) {
|
|
|
+ if (pSysInfo->CurGunSelected == gunIndex) {
|
|
|
+ StartGunInfoTimeoutDet(gunIndex, Timeout_ExitPage);
|
|
|
+ } else {
|
|
|
+ StartGunInfoTimeoutDet(gunIndex, Timeout_PlugOutGun);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (pSysInfo->CurGunSelected == gunIndex && pSysInfo->SystemPage != _PAGE_PAYING ) {
|
|
@@ -4750,6 +4726,7 @@ CheckStatus:
|
|
|
pSysInfo->SystemPage = _PAGE_PAYFAIL;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
break;
|
|
|
case S_MAINTAIN:
|
|
|
if (isModeChange(gunIndex)) {
|