|
@@ -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.13.00.0000.00"; // Phihong version
|
|
|
-char* DebugVersion = "V2.13.01"; // Software debug version
|
|
|
+char *fwVersion = "V2.16.00.0000.00"; // Phihong version
|
|
|
+char* DebugVersion = "V2.16.00"; // Software debug version
|
|
|
//sqlite3 *localDb;
|
|
|
bool isDb_ready;
|
|
|
|
|
@@ -94,8 +94,8 @@ long long DiffTimebWithNow(struct timeb ST);
|
|
|
uint8_t DetectBitValue(uint8_t _byte, uint8_t _bit);
|
|
|
void SetBitValue(uint8_t *_byte, uint8_t _bit, uint8_t value);
|
|
|
unsigned long GetTimeoutValue(struct timeval _sour_time);
|
|
|
-void GetClockTime(struct timespec *_now_time, void *null);
|
|
|
unsigned long GetClockTimeoutValue(struct timespec _start_time);
|
|
|
+void GetClockTime(struct timespec *_now_time, void *null);
|
|
|
void gpio_set_value(unsigned int gpio, unsigned int value);
|
|
|
void InformOcppErrOccur(uint8_t codeType);
|
|
|
|
|
@@ -1536,7 +1536,7 @@ void _AuthorizedTimeout(void)
|
|
|
void _DetectPlugInTimeout(uint8_t gunIndex)
|
|
|
{
|
|
|
int i;
|
|
|
- log_info("*********** _DetectPlugInTimeout *********** ");
|
|
|
+ log_info("*********** Gun%d _DetectPlugInTimeout *********** ",gunIndex);
|
|
|
pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
|
|
|
|
|
|
//StopSystemTimeoutDet();
|
|
@@ -2480,7 +2480,7 @@ void StartGunInfoTimeoutDet(uint8_t gunIndex, uint8_t flag)
|
|
|
|
|
|
if (gunIndex < pSysConfig->TotalConnectorCount) {
|
|
|
if (pDcChargingInfo->TimeoutFlag != flag) {
|
|
|
- gettimeofday(&pDcChargingInfo->TimeoutTimer, NULL);
|
|
|
+ GetClockTime(&pDcChargingInfo->ConnectorTimeout, NULL);
|
|
|
//log_info("Set Gun%d Timeout Flag %d", gunIndex, flag);
|
|
|
}
|
|
|
pDcChargingInfo->TimeoutFlag = flag;
|
|
@@ -2520,15 +2520,15 @@ void CreateTimeoutFork(void)
|
|
|
|
|
|
timeoutPid = fork();
|
|
|
if (timeoutPid == 0) {
|
|
|
- gettimeofday(&_cmdSubPriority_time, NULL);
|
|
|
+ GetClockTime(&_cmdSubPriority_time, NULL);
|
|
|
CheckConnectionTimeout();
|
|
|
|
|
|
//log_info("Timeout Fork Child's PID is %d", getpid());
|
|
|
|
|
|
while (1) {
|
|
|
- if ((GetTimeoutValue(_cmdSubPriority_time) / 1000) > 5000) {
|
|
|
+ if ((GetClockTimeoutValue(_cmdSubPriority_time) / 1000) > 5000) {
|
|
|
CheckConnectionTimeout();
|
|
|
- gettimeofday(&_cmdSubPriority_time, NULL);
|
|
|
+ GetClockTime(&_cmdSubPriority_time, NULL);
|
|
|
}
|
|
|
/*
|
|
|
if (pSysInfo->SystemTimeoutFlag != 0)
|
|
@@ -2676,12 +2676,12 @@ void CreateTimeoutFork(void)
|
|
|
/*
|
|
|
if (pDcChargingInfo->TimeoutFlag != 0)
|
|
|
log_info("Timeout ***********GunTimeoutFlag = %d(%d) ********",pDcChargingInfo->TimeoutFlag,
|
|
|
- GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL);
|
|
|
+ GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) / uSEC_VAL);
|
|
|
*/
|
|
|
switch (pDcChargingInfo->TimeoutFlag) {
|
|
|
|
|
|
case Timeout_AuthorizingForStop:
|
|
|
- if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= AUTHORIZE_STOP_TIMEOUT) {
|
|
|
+ if (GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) / uSEC_VAL >= AUTHORIZE_STOP_TIMEOUT) {
|
|
|
log_info("Gun %d Timeout_AuthorizingForStop", gunIndex);
|
|
|
strcpy((char*)pSysConfig->UserId, "");
|
|
|
pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
|
|
@@ -2693,25 +2693,25 @@ void CreateTimeoutFork(void)
|
|
|
}
|
|
|
break;
|
|
|
case Timeout_WaitPlug:
|
|
|
- if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= _connectionTimeout) {
|
|
|
+ if (GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) / uSEC_VAL >= _connectionTimeout) {
|
|
|
_DetectPlugInTimeout(gunIndex);
|
|
|
destroySelGun(gunIndex);
|
|
|
}
|
|
|
break;
|
|
|
case Timeout_EVCCID_Link:
|
|
|
- if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= EVCCID_LINK_TIMEOUT) {
|
|
|
+ if (GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) / uSEC_VAL >= EVCCID_LINK_TIMEOUT) {
|
|
|
_evccidlinktimeout(gunIndex);
|
|
|
}
|
|
|
break;
|
|
|
case Timeout_LinkError:
|
|
|
- if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= LINKERROR_TIMEOUT) {
|
|
|
+ if (GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) / uSEC_VAL >= LINKERROR_TIMEOUT) {
|
|
|
_LinkErrorTimeout(gunIndex);
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
destroySelGun(gunIndex);
|
|
|
}
|
|
|
break;
|
|
|
case Timeout_Preparing:
|
|
|
- if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= GUN_PREPARE_TIMEOUT) {
|
|
|
+ if (GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) / uSEC_VAL >= GUN_PREPARE_TIMEOUT) {
|
|
|
_PrepareTimeout(gunIndex);
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
destroySelGun(gunIndex); //jerry add
|
|
@@ -2719,7 +2719,7 @@ void CreateTimeoutFork(void)
|
|
|
break;
|
|
|
|
|
|
case Timeout_EvChargingDet:
|
|
|
- if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= GUN_EV_WAIT_TIMEOUT) {
|
|
|
+ if (GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) / uSEC_VAL >= GUN_EV_WAIT_TIMEOUT) {
|
|
|
_DetectEvChargingEnableTimeout(gunIndex);
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
destroySelGun(gunIndex); //jerry add
|
|
@@ -2727,7 +2727,7 @@ void CreateTimeoutFork(void)
|
|
|
break;
|
|
|
|
|
|
case Timeout_EvseChargingDet:
|
|
|
- if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= GUN_EVSE_WAIT_TIMEOUT) {
|
|
|
+ if (GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) / uSEC_VAL >= GUN_EVSE_WAIT_TIMEOUT) {
|
|
|
_DetectEvseChargingEnableTimeout(gunIndex);
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
destroySelGun(gunIndex); //jerry add
|
|
@@ -2735,21 +2735,21 @@ void CreateTimeoutFork(void)
|
|
|
break;
|
|
|
|
|
|
case Timeout_EvseCompleteDet:
|
|
|
- if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= GUN_COMP_WAIT_TIMEOUT) {
|
|
|
+ if (GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) / uSEC_VAL >= GUN_COMP_WAIT_TIMEOUT) {
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
destroySelGun(gunIndex); //jerry add
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
case Timeout_ForCcsPrechargeDet:
|
|
|
- if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= GUN_PRECHARGING_TIMEOUT) {
|
|
|
+ if (GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) / uSEC_VAL >= GUN_PRECHARGING_TIMEOUT) {
|
|
|
_CcsPrechargeTimeout(gunIndex);
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
destroySelGun(gunIndex); //jerry add
|
|
|
}
|
|
|
break;
|
|
|
case Timeout_PlugOutGun:
|
|
|
- if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= PLUGOUTGUN_TIMEOUT) {
|
|
|
+ if (GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) / uSEC_VAL >= PLUGOUTGUN_TIMEOUT) {
|
|
|
log_info("Gun[%d] Timeout_PlugOutGun",gunIndex);
|
|
|
setChargerMode(gunIndex, MODE_IDLE);
|
|
|
destroySelGun(gunIndex); //Jerry add
|
|
@@ -2760,23 +2760,19 @@ void CreateTimeoutFork(void)
|
|
|
}
|
|
|
break;
|
|
|
case Timeout_FinalCost:
|
|
|
- if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= TCC_FINALCOST_TIMEOUT) {
|
|
|
+ if (GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) / uSEC_VAL >= TCC_FINALCOST_TIMEOUT) {
|
|
|
log_info("Gun[%d] Timeout_FinalCost",gunIndex);
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
if (ShmDcCommonData->finalcost_flag[gunIndex] == FALSE) {
|
|
|
- if (ShmDcCommonData->is_AutoStart[gunIndex] || ShmDcCommonData->is_RemoteStart[gunIndex]) {
|
|
|
- ShmDcCommonData->PayPass_flag[gunIndex] = FALSE;
|
|
|
- ShmDcCommonData->finalcost_flag[gunIndex] = TRUE;
|
|
|
- } else {
|
|
|
- log_info("Not Get Final Cost");
|
|
|
- ShmDcCommonData->PayPass_flag[gunIndex] = FALSE;
|
|
|
+ log_info("Not Get Final Cost");
|
|
|
+ ShmDcCommonData->PayPass_flag[gunIndex] = FALSE;
|
|
|
+ if (pSysInfo->CurGunSelected == gunIndex)
|
|
|
pSysInfo->SystemPage = _PAGE_PAYFAIL;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
case Timeout_LineReigster:
|
|
|
- if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= TCC_LINEREGISTER_TIMEOUT) {
|
|
|
+ if (GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) / uSEC_VAL >= TCC_LINEREGISTER_TIMEOUT) {
|
|
|
log_info("Gun[%d] Timeout_LineReigster",gunIndex);
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
systemPageRestoreInit();
|
|
@@ -2785,7 +2781,7 @@ void CreateTimeoutFork(void)
|
|
|
}
|
|
|
break;
|
|
|
case Timeout_ExitPage:
|
|
|
- if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= TCC_EXITPAGE_TIMEOUT) {
|
|
|
+ if (GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) / uSEC_VAL >= TCC_EXITPAGE_TIMEOUT) {
|
|
|
log_info("Gun[%d] Timeout_ExitPage", gunIndex);
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
ShmDcCommonData->is_exit[gunIndex] = TRUE;
|
|
@@ -2794,6 +2790,14 @@ void CreateTimeoutFork(void)
|
|
|
StartGunInfoTimeoutDet(gunIndex, Timeout_PlugOutGun);
|
|
|
}
|
|
|
break;
|
|
|
+ case Timeout_CompletPlugout:
|
|
|
+ if (GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) / uSEC_VAL >= TCC_COMPLETE_PLUGOUT_TIMEOUT) {
|
|
|
+ log_info("Gun[%d] Timeout_CompletePlugout", gunIndex);
|
|
|
+ setChargerMode(gunIndex, MODE_IDLE);
|
|
|
+ destroySelGun(gunIndex); //Jerry add
|
|
|
+ StopGunInfoTimeoutDet(gunIndex);
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
sleep(1);
|
|
@@ -3965,8 +3969,9 @@ void ResetIdleData(uint8_t gunIndex)
|
|
|
}
|
|
|
void CheckErrorCode(uint8_t gunIndex)
|
|
|
{
|
|
|
+ /*
|
|
|
struct ChargingInfoData *pSelectedDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(gunIndex);
|
|
|
-
|
|
|
+
|
|
|
if (gunIndex == pSysInfo->CurGunSelected) {
|
|
|
pSysInfo->SystemPage = _PAGE_MAINTAIN;
|
|
|
} else if (pSelectedDcChargingInfo->SystemStatus != S_IDLE &&
|
|
@@ -3982,6 +3987,7 @@ void CheckErrorCode(uint8_t gunIndex)
|
|
|
systemPageRestoreInit();
|
|
|
}
|
|
|
}
|
|
|
+ */
|
|
|
ClearDetectPluginFlag(gunIndex);
|
|
|
if (pDcChargingInfo->SystemStatus != S_FAULT)
|
|
|
{
|
|
@@ -4075,7 +4081,6 @@ static void SetGunTypeOTPValue(void)
|
|
|
//struct ChargingInfoData* chargingData_2 = NULL;
|
|
|
uint8_t Gun1Type = 0;
|
|
|
uint8_t Gun2Type = 0;
|
|
|
- uint8_t Type;
|
|
|
int i;
|
|
|
if (pSysConfig->TotalConnectorCount == 1) {
|
|
|
pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(0);
|
|
@@ -4295,7 +4300,7 @@ int main(void)
|
|
|
|
|
|
CheckFwSlotStatusLog();
|
|
|
//AdjustChargerCurrent();
|
|
|
- gettimeofday(&_cmdMainPriority_time, NULL);
|
|
|
+ GetClockTime(&_cmdMainPriority_time, NULL);
|
|
|
|
|
|
// GunIndexInfo *pGunIndexInfo = (GunIndexInfo *)GetGunIndexInfo();
|
|
|
|
|
@@ -4329,7 +4334,7 @@ int main(void)
|
|
|
// 當 AC 沒有搭上時,清除一些錯誤碼
|
|
|
ClearAlarmCodeWhenAcOff();
|
|
|
|
|
|
- if ((GetTimeoutValue(_cmdMainPriority_time) / 1000) > 5000) {
|
|
|
+ if ((GetClockTimeoutValue(_cmdMainPriority_time) / 1000) > 5000) {
|
|
|
|
|
|
for (gunIndex = 0; gunIndex < pSysConfig->TotalConnectorCount; gunIndex++) {
|
|
|
pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(gunIndex);
|
|
@@ -4351,7 +4356,7 @@ int main(void)
|
|
|
}
|
|
|
checkGunOTPState(gunIndex); //check gun OTP
|
|
|
}
|
|
|
- gettimeofday(&_cmdMainPriority_time, NULL);
|
|
|
+ GetClockTime(&_cmdMainPriority_time, NULL);
|
|
|
}
|
|
|
|
|
|
gEvBoardErr.GunErrMessage = 0; //清除系統執行中的錯誤訊息
|
|
@@ -4465,7 +4470,7 @@ int main(void)
|
|
|
if (pDcChargingInfo->SystemStatus == S_FAULT) {
|
|
|
log_info("============================= S_FAULT(%x) ============================= ", gunIndex);
|
|
|
//pSysInfo->SystemPage = _LCM_ERROR;
|
|
|
- pSysInfo->SystemPage = _PAGE_MAINTAIN;
|
|
|
+ //pSysInfo->SystemPage = _PAGE_MAINTAIN;
|
|
|
}
|
|
|
}
|
|
|
CheckStatus:
|
|
@@ -4574,7 +4579,6 @@ int main(void)
|
|
|
pDcChargingInfo->Replug_flag = TRUE;
|
|
|
StopSystemTimeoutDet();
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
- gettimeofday(&pDcChargingInfo->PreChargeTimer, NULL);
|
|
|
}
|
|
|
|
|
|
setChargerMode(gunIndex, S_PREPARNING);
|
|
@@ -4593,7 +4597,7 @@ int main(void)
|
|
|
|
|
|
if (ShmPsuData->SystemPresentPsuQuantity > 0 &&
|
|
|
ShmPsuData->SystemAvailablePower > 10 &&
|
|
|
- GetTimeoutValue(pDcChargingInfo->TimeoutTimer) >= 1000000) {
|
|
|
+ GetClockTimeoutValue(pDcChargingInfo->ConnectorTimeout) >= 1000000) {
|
|
|
setChargerMode(gunIndex, MODE_PREPARE_FOR_EV);
|
|
|
}
|
|
|
|
|
@@ -4767,9 +4771,16 @@ int main(void)
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gunIndex].StopReason, "Local");
|
|
|
}
|
|
|
ShmDcCommonData->StopCharge[gunIndex] = TRUE;
|
|
|
- StopGunInfoTimeoutDet(gunIndex);
|
|
|
- StartGunInfoTimeoutDet(gunIndex, Timeout_FinalCost);
|
|
|
+ if (ShmDcCommonData->is_AutoStart[gunIndex]) {
|
|
|
+ ShmDcCommonData->finalcost_flag[gunIndex] = TRUE;
|
|
|
+ ShmDcCommonData->PayPass_flag[gunIndex] = TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ShmDcCommonData->finalcost_flag[gunIndex] == FALSE && pSysInfo->CurGunSelected == gunIndex) {
|
|
|
+ pSysInfo->SystemPage = _PAGE_PAYING;
|
|
|
+ }
|
|
|
StartSystemTimeoutDet(Timeout_Terminating);
|
|
|
+ StartGunInfoTimeoutDet(gunIndex, Timeout_FinalCost);
|
|
|
|
|
|
ShmDcCommonData->pGunInfo[gunIndex].RecordEnergyTime = time((time_t*)NULL);
|
|
|
if (ShmDcCommonData->pGunInfo[gunIndex].PowerConsumption != 0)
|
|
@@ -4796,33 +4807,17 @@ int main(void)
|
|
|
setChargerMode(gunIndex, MODE_COMPLETE);
|
|
|
}
|
|
|
}
|
|
|
- // 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]) {
|
|
|
- pSysInfo->SystemPage = _PAGE_COMPLETE;
|
|
|
- } else {
|
|
|
- pSysInfo->SystemPage = _PAGE_PAYING;
|
|
|
- }
|
|
|
- }
|
|
|
+ if (pDcChargingInfo->Replug_flag == TRUE && pSysInfo->CurGunSelected == gunIndex) {
|
|
|
+ pSysInfo->SystemPage = _PAGE_PLUGOUT;
|
|
|
break;
|
|
|
}
|
|
|
- //if (pSysInfo->SystemPage == _LCM_ERROR) {
|
|
|
- if (pSysInfo->SystemPage == _PAGE_MAINTAIN) {
|
|
|
- break;
|
|
|
- }
|
|
|
- if (pSysInfo->CurGunSelected == gunIndex &&
|
|
|
+
|
|
|
+ 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;
|
|
|
|
|
@@ -4833,6 +4828,7 @@ int main(void)
|
|
|
OcppStopTransation(gunIndex);
|
|
|
}
|
|
|
TheEndCharging(gunIndex);
|
|
|
+
|
|
|
if (pDcChargingInfo->Replug_flag != TRUE && pSysInfo->SystemPage != _PAGE_PLUGOUT)
|
|
|
StopSystemTimeoutDet();
|
|
|
if (ShmDcCommonData->is_AutoStart[gunIndex] == TRUE && pSysInfo->CurGunSelected == gunIndex)
|
|
@@ -4853,27 +4849,19 @@ int main(void)
|
|
|
if (pSysInfo->CurGunSelected == gunIndex) {
|
|
|
StartGunInfoTimeoutDet(gunIndex, Timeout_ExitPage);
|
|
|
}
|
|
|
+ if (pDcChargingInfo->TimeoutFlag != Timeout_ExitPage &&
|
|
|
+ pDcChargingInfo->TimeoutFlag != Timeout_FinalCost) {
|
|
|
+
|
|
|
+ StartGunInfoTimeoutDet(gunIndex, Timeout_CompletPlugout);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
if (pDcChargingInfo->Replug_flag == TRUE && pSysInfo->CurGunSelected == gunIndex) {
|
|
|
pSysInfo->SystemPage = _PAGE_PLUGOUT;
|
|
|
break;
|
|
|
}
|
|
|
- // Remote start
|
|
|
- if (ShmDcCommonData->is_RemoteStart[gunIndex] && pSysInfo->CurGunSelected == gunIndex) {
|
|
|
-
|
|
|
- if (ShmDcCommonData->finalcost_flag[gunIndex]) {
|
|
|
- if (ShmDcCommonData->PayPass_flag[gunIndex]) {
|
|
|
- pSysInfo->SystemPage = _PAGE_COMPLETE;
|
|
|
- //log_info("_PAGE_COMPLETE");
|
|
|
- } else {
|
|
|
- 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 (ShmDcCommonData->PayPass_flag[gunIndex] == TRUE)
|
|
@@ -4897,18 +4885,17 @@ int main(void)
|
|
|
TheEndCharging(gunIndex);
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
ShmDcCommonData->StopCharge[gunIndex] = TRUE;
|
|
|
-
|
|
|
+
|
|
|
+ if (ShmDcCommonData->is_AutoStart[gunIndex]) {
|
|
|
+ ShmDcCommonData->finalcost_flag[gunIndex] = TRUE;
|
|
|
+ ShmDcCommonData->PayPass_flag[gunIndex] = TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
if (pDcChargingInfo->Replug_flag == TRUE) {
|
|
|
- /*
|
|
|
- ShmDcCommonData->TradeCancel = TRUE;
|
|
|
- StartSystemTimeoutDet(Timeout_TradeCancel);
|
|
|
- ShmDcCommonData->PreAuth_Config = _CREDITCARD_CANCEL;
|
|
|
- ShmDcCommonData->PreAuth_Result = 0;
|
|
|
- pSysInfo->SystemPage = _PAGE_SENSING;
|
|
|
- */
|
|
|
+
|
|
|
} else {
|
|
|
StartGunInfoTimeoutDet(gunIndex, Timeout_FinalCost);
|
|
|
- if(ShmDcCommonData->finalcost_flag[gunIndex] == FALSE && !ShmDcCommonData->is_RemoteStart[gunIndex]) {
|
|
|
+ if(ShmDcCommonData->finalcost_flag[gunIndex] == FALSE && pSysInfo->CurGunSelected) {
|
|
|
pSysInfo->SystemPage = _PAGE_PAYING;
|
|
|
}
|
|
|
}
|
|
@@ -4932,23 +4919,16 @@ int main(void)
|
|
|
if (pSysInfo->CurGunSelected == gunIndex) {
|
|
|
StartGunInfoTimeoutDet(gunIndex, Timeout_ExitPage);
|
|
|
}
|
|
|
+ if (pDcChargingInfo->TimeoutFlag != Timeout_ExitPage &&
|
|
|
+ pDcChargingInfo->TimeoutFlag != Timeout_FinalCost) {
|
|
|
+ StartGunInfoTimeoutDet(gunIndex, Timeout_CompletPlugout);
|
|
|
+ }
|
|
|
}
|
|
|
if (pDcChargingInfo->Replug_flag == TRUE && pSysInfo->CurGunSelected == gunIndex) {
|
|
|
pSysInfo->SystemPage = _PAGE_PLUGOUT;
|
|
|
break;
|
|
|
}
|
|
|
- // Remote start
|
|
|
- if (ShmDcCommonData->is_RemoteStart[gunIndex] && pSysInfo->CurGunSelected == gunIndex) {
|
|
|
- if (ShmDcCommonData->finalcost_flag[gunIndex]) {
|
|
|
- if (ShmDcCommonData->PayPass_flag[gunIndex])
|
|
|
- pSysInfo->SystemPage = _PAGE_COMPLETE;
|
|
|
- else
|
|
|
- pSysInfo->SystemPage = _PAGE_PAYFAIL;
|
|
|
- } else {
|
|
|
- pSysInfo->SystemPage = _PAGE_PAYING;
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
+
|
|
|
if (pSysInfo->CurGunSelected == gunIndex && pSysInfo->SystemPage != _PAGE_PAYING ) {
|
|
|
if (ShmDcCommonData->PayPass_flag[gunIndex] == TRUE)
|
|
|
pSysInfo->SystemPage = _PAGE_COMPLETE;
|
|
@@ -4990,20 +4970,19 @@ int main(void)
|
|
|
StopProcessingLoop();
|
|
|
*/
|
|
|
}
|
|
|
- /*
|
|
|
- if (pDcChargingInfo->IsAvailable == TRUE) {
|
|
|
- log_info("Gun[%d] set Available",gunIndex);
|
|
|
- setChargerMode(gunIndex, MODE_IDLE);
|
|
|
+
|
|
|
+ if (pSysInfo->SelfTestSeq == _STEST_FAIL && pSysInfo->SystemTimeoutFlag != Timeout_SelftestChk) {
|
|
|
+ SelfTestRun();
|
|
|
+ StopSystemTimeoutDet();
|
|
|
+ sleep(3);
|
|
|
break;
|
|
|
}
|
|
|
- */
|
|
|
- //if (pSysInfo->CurGunSelected == gunIndex) {
|
|
|
- StopSystemTimeoutDet();
|
|
|
- StopGunInfoTimeoutDet(gunIndex);
|
|
|
- pSysInfo->SystemPage = _PAGE_MAINTAIN;
|
|
|
- sleep(1);
|
|
|
- //}
|
|
|
-
|
|
|
+ if (pDcChargingInfo->IsAvailable && pSysInfo->SelfTestSeq == _STEST_COMPLETE) {
|
|
|
+ setChargerMode(gunIndex, MODE_IDLE);
|
|
|
+ }
|
|
|
+ if (pSysInfo->CurGunSelected == gunIndex) {
|
|
|
+ pSysInfo->SystemPage = _PAGE_MAINTAIN;
|
|
|
+ }
|
|
|
break;
|
|
|
case S_UPDATE:
|
|
|
if (isModeChange(gunIndex)) {
|