|
@@ -83,13 +83,13 @@ uint8_t bd0_2_status = 0;
|
|
|
uint8_t bd1_1_status = 0;
|
|
|
uint8_t bd1_2_status = 0;
|
|
|
|
|
|
-char *fwVersion = "V1.21.00.0000.00"; // "V0.16.00.0000.00";
|
|
|
-char* DebugVersion = "v1.21.5";
|
|
|
+char *fwVersion = "T1.21.00.0000.00"; // "V0.16.00.0000.00";
|
|
|
+char* DebugVersion = "T1.21.7";
|
|
|
//sqlite3 *localDb;
|
|
|
bool isDb_ready;
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
-void ClearDetectPluginFlag();
|
|
|
+void ClearDetectPluginFlag(int gunIndex);
|
|
|
|
|
|
long long DiffTimebWithNow(struct timeb ST);
|
|
|
uint8_t DetectBitValue(uint8_t _byte, uint8_t _bit);
|
|
@@ -1273,11 +1273,12 @@ int Initialization(void)
|
|
|
// 初始化卡號驗證的 Flag
|
|
|
ClearAuthorizedFlag();
|
|
|
|
|
|
- // 初始化插槍驗證的 Flag
|
|
|
- ClearDetectPluginFlag();
|
|
|
+
|
|
|
|
|
|
for (count = 0; count < pSysConfig->TotalConnectorCount; count++) {
|
|
|
pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(count);
|
|
|
+ // 初始化插槍驗證的 Flag
|
|
|
+ ClearDetectPluginFlag(count);
|
|
|
|
|
|
pDcChargingInfo->RemoteStartFlag = NO;
|
|
|
|
|
@@ -1483,36 +1484,41 @@ bool isEvBoardNormalStopChargeFlag(uint8_t gunIndex)
|
|
|
//===============================================
|
|
|
// 掃描插槍狀況
|
|
|
//===============================================
|
|
|
-void ClearDetectPluginFlag(void)
|
|
|
+void ClearDetectPluginFlag(int gunIndex)
|
|
|
{
|
|
|
- uint8_t gunIndex = 0;
|
|
|
- pSysInfo->WaitForPlugit = NO;
|
|
|
|
|
|
+ ShmDcCommonData->pGunInfo[gunIndex].WaitForPlugit = NO;
|
|
|
//DS60-120 add
|
|
|
- for (gunIndex = 0; gunIndex < pSysConfig->TotalConnectorCount; gunIndex++) {
|
|
|
- pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(gunIndex);
|
|
|
|
|
|
- if (pDcChargingInfo->RemoteStartFlag == YES) {
|
|
|
- pDcChargingInfo->RemoteStartFlag = NO;
|
|
|
- }
|
|
|
+ pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(gunIndex);
|
|
|
+
|
|
|
+ if (pDcChargingInfo->RemoteStartFlag == YES) {
|
|
|
+ pDcChargingInfo->RemoteStartFlag = NO;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
if (pSysInfo->OrderCharging != NO_DEFINE) {
|
|
|
pSysInfo->OrderCharging = NO_DEFINE;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void DetectPluginStart()
|
|
|
+void DetectPluginStart(int gunIndex)
|
|
|
{
|
|
|
- pSysInfo->WaitForPlugit = YES;
|
|
|
+ //pSysInfo->WaitForPlugit = YES;
|
|
|
+ ShmDcCommonData->pGunInfo[gunIndex].WaitForPlugit = YES;
|
|
|
+ log_info("Gun%d start detect plug in",gunIndex);
|
|
|
}
|
|
|
|
|
|
-bool isDetectPlugin()
|
|
|
+bool isDetectPlugin(int gunIndex)
|
|
|
{
|
|
|
+ if (ShmDcCommonData->pGunInfo[gunIndex].WaitForPlugit == YES) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ /*
|
|
|
if (pSysInfo->WaitForPlugit == YES) {
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
+ */
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -1544,7 +1550,7 @@ bool isEvStopCharging_chademo(uint8_t gunIndex)
|
|
|
{
|
|
|
if (isEvGunLocked_chademo(gunIndex) == NO) {
|
|
|
// 無鎖槍 = 停止
|
|
|
- log_info("gun locked none (%d) ", gunIndex);
|
|
|
+ //log_info("gun locked none (%d) ", gunIndex);
|
|
|
return YES;
|
|
|
}
|
|
|
|
|
@@ -1575,7 +1581,7 @@ bool isEvStopCharging_gb(uint8_t gunIndex)
|
|
|
{
|
|
|
if (isEvGunLocked_gb(gunIndex) == NO) {
|
|
|
// 無鎖槍 = 停止
|
|
|
- log_info("gun locked none. ");
|
|
|
+ //log_info("gun locked none. ");
|
|
|
return YES;
|
|
|
}
|
|
|
|
|
@@ -1614,7 +1620,7 @@ bool isEvStopCharging_ccs(uint8_t gunIndex)
|
|
|
{
|
|
|
if (isEvGunLocked_ccs(gunIndex) == NO) {
|
|
|
// 無鎖槍 = 停止
|
|
|
- log_info("gun locked none. ");
|
|
|
+ //log_info("gun locked none. ");
|
|
|
return YES;
|
|
|
}
|
|
|
|
|
@@ -1656,13 +1662,29 @@ void DisplayChargingInfo()
|
|
|
systemPageRestoreInit();
|
|
|
}
|
|
|
|
|
|
-void _AutoReturnTimeout(void)
|
|
|
+void _AutoReturnTimeout(int gunIndex)
|
|
|
{
|
|
|
log_info("*********** _AutoReturnTimeout(%d) *********** ", pSysInfo->PageIndex);
|
|
|
+ pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
|
|
|
if (pSysInfo->PageIndex == _LCM_WAIT_FOR_PLUG) {
|
|
|
- ClearDetectPluginFlag();
|
|
|
+
|
|
|
+ if (pDcChargingInfo->RemoteStartFlag) {
|
|
|
+ ClearDetectPluginFlag(gunIndex);
|
|
|
+ } else {
|
|
|
+ ClearDetectPluginFlag(0);
|
|
|
+ ClearDetectPluginFlag(1);
|
|
|
+ }
|
|
|
} else if (pSysInfo->PageIndex == _LCM_AUTHORIZ_COMP) {
|
|
|
- DetectPluginStart();
|
|
|
+ if (pDcChargingInfo->RemoteStartFlag) {
|
|
|
+ DetectPluginStart(gunIndex);
|
|
|
+ } else {
|
|
|
+ pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(LEFT_GUN_NUM);
|
|
|
+ if (pDcChargingInfo->SystemStatus == S_IDLE || pDcChargingInfo->SystemStatus == S_RESERVATION)
|
|
|
+ DetectPluginStart(LEFT_GUN_NUM);
|
|
|
+ pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(RIGHT_GUN_NUM);
|
|
|
+ if (pDcChargingInfo->SystemStatus == S_IDLE || pDcChargingInfo->SystemStatus == S_RESERVATION)
|
|
|
+ DetectPluginStart(RIGHT_GUN_NUM);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
usleep(50000);
|
|
@@ -1696,18 +1718,39 @@ void _AuthorizedTimeout(void)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void _DetectPlugInTimeout(void)
|
|
|
+void _DetectPlugInTimeout(int gunIndex)
|
|
|
{
|
|
|
- log_info("*********** _DetectPlugInTimeout *********** ");
|
|
|
strcpy((char *)pSysConfig->UserId, "");
|
|
|
- ClearDetectPluginFlag();
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ uint8_t is_remote = NO;
|
|
|
+ for (int i = 0; i < pSysConfig->TotalConnectorCount; i++) {
|
|
|
+ pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(i);
|
|
|
+ if (pDcChargingInfo->RemoteStartFlag) {
|
|
|
+ //此停止為remote start停止
|
|
|
+ is_remote = YES;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (is_remote) {
|
|
|
+ // Remote start進入充電
|
|
|
+ log_info("Clear Gun%d Remote start detect plugin flag",gunIndex);
|
|
|
+ StopGunInfoTimeoutDet(gunIndex);
|
|
|
+ ClearDetectPluginFlag(gunIndex);
|
|
|
+ } else {
|
|
|
+ log_info("Clear Gun%d RFID detect plugin flag", gunIndex);
|
|
|
+ // 刷卡進入充電
|
|
|
+ ClearDetectPluginFlag(LEFT_GUN_NUM);
|
|
|
+ ClearDetectPluginFlag(RIGHT_GUN_NUM);
|
|
|
+ StopGunInfoTimeoutDet(LEFT_GUN_NUM);
|
|
|
+ StopGunInfoTimeoutDet(RIGHT_GUN_NUM);
|
|
|
+ }
|
|
|
sleep(1); //等待DoComm回報插槍訊號給主櫃
|
|
|
#if defined DD360Audi
|
|
|
//pSysInfo->SystemPage = _LCM_COMPLETE;
|
|
|
- setChargerMode(pSysInfo->CurGunSelected, S_TERMINATING);
|
|
|
+ setChargerMode(gunIndex, S_TERMINATING);
|
|
|
#elif DD360 || DD360Combox
|
|
|
- setChargerMode(pSysInfo->CurGunSelected, S_IDLE);
|
|
|
+ setChargerMode(gunIndex, S_IDLE);
|
|
|
#endif
|
|
|
systemPageRestoreInit();
|
|
|
}
|
|
@@ -1730,7 +1773,7 @@ void _DetectEvChargingEnableTimeout(uint8_t gunIndex)
|
|
|
}
|
|
|
}
|
|
|
ChargingTerminalProcess(gunIndex);
|
|
|
- _AutoReturnTimeout();
|
|
|
+ _AutoReturnTimeout(gunIndex);
|
|
|
}
|
|
|
|
|
|
void _DetectEvseChargingEnableTimeout(uint8_t gunIndex)
|
|
@@ -1744,7 +1787,7 @@ void _DetectEvseChargingEnableTimeout(uint8_t gunIndex)
|
|
|
#elif DD360 || DD360Combox
|
|
|
setChargerMode(pSysInfo->CurGunSelected, S_COMPLETE);
|
|
|
#endif
|
|
|
- _AutoReturnTimeout();
|
|
|
+ _AutoReturnTimeout(gunIndex);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1758,7 +1801,7 @@ void _PrepareTimeout(uint8_t gunIndex)
|
|
|
setChargerMode(pSysInfo->CurGunSelected, S_COMPLETE);
|
|
|
#endif
|
|
|
pAlarmCode->AlarmEvents.bits.PsuNoResource = YES;
|
|
|
- _AutoReturnTimeout();
|
|
|
+ _AutoReturnTimeout(gunIndex);
|
|
|
}
|
|
|
|
|
|
void _CcsPrechargeTimeout(uint8_t gunIndex)
|
|
@@ -2769,6 +2812,7 @@ void StartSystemTimeoutDet(uint8_t flag)
|
|
|
{
|
|
|
if (pSysInfo->SystemTimeoutFlag != flag) {
|
|
|
GetClockTime(&pSysInfo->SystemTimeoutTimer, NULL);
|
|
|
+ //log_info("Start System Timeout: %d",flag);
|
|
|
}
|
|
|
pSysInfo->SystemTimeoutFlag = flag;
|
|
|
}
|
|
@@ -2786,6 +2830,7 @@ void StartGunInfoTimeoutDet(uint8_t gunIndex, uint8_t flag)
|
|
|
if (gunIndex < pSysConfig->TotalConnectorCount) {
|
|
|
if (pDcChargingInfo->TimeoutFlag != flag) {
|
|
|
gettimeofday(&pDcChargingInfo->TimeoutTimer, NULL);
|
|
|
+ //log_info("Start Gun%d Info timeout: %d",gunIndex,flag);
|
|
|
}
|
|
|
pDcChargingInfo->TimeoutFlag = flag;
|
|
|
}
|
|
@@ -2894,7 +2939,7 @@ void CreateTimeoutFork(void)
|
|
|
break;
|
|
|
case Timeout_VerifyFail:
|
|
|
if (GetClockTimeoutValue(pSysInfo->SystemTimeoutTimer) / uSEC_VAL >= AUTHORIZE_FAIL_TIMEOUT) {
|
|
|
- _AutoReturnTimeout();
|
|
|
+ _AutoReturnTimeout(pSysInfo->CurGunSelected);
|
|
|
StopSystemTimeoutDet();
|
|
|
destroySelGun(pSysInfo->CurGunSelected);
|
|
|
if (ShmSelectGunInfo->AuthorStateFromCabinet[pSysInfo->CurGunSelected] == YES) { //DoComm no ask cabinet balance
|
|
@@ -2910,19 +2955,11 @@ void CreateTimeoutFork(void)
|
|
|
|
|
|
case Timeout_VerifyComp:
|
|
|
if (GetClockTimeoutValue(pSysInfo->SystemTimeoutTimer) / uSEC_VAL >= AUTHORIZE_COMP_TIMEOUT) {
|
|
|
- _AutoReturnTimeout();
|
|
|
+ _AutoReturnTimeout(pSysInfo->CurGunSelected);
|
|
|
StopSystemTimeoutDet();
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
- case Timeout_WaitPlug:
|
|
|
- if (GetClockTimeoutValue(pSysInfo->SystemTimeoutTimer) / uSEC_VAL >= _connectionTimeout) {
|
|
|
- _DetectPlugInTimeout();
|
|
|
- StopSystemTimeoutDet();
|
|
|
- destroySelGun(pSysInfo->CurGunSelected);
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
case Timeout_ReturnToChargingGunDet:
|
|
|
if (GetClockTimeoutValue(pSysInfo->SystemTimeoutTimer) / uSEC_VAL >= RETURN_TO_CHARGING_PAGE) {
|
|
|
#if defined DD360Audi
|
|
@@ -2962,6 +2999,14 @@ void CreateTimeoutFork(void)
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
+ case Timeout_WaitPlug:
|
|
|
+ if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= _connectionTimeout) {
|
|
|
+ log_info("*********** Gun%d _DetectPlugInTimeout *********** ", gunIndex);
|
|
|
+ _DetectPlugInTimeout(gunIndex);
|
|
|
+ StopGunInfoTimeoutDet(gunIndex);
|
|
|
+ destroySelGun(gunIndex);
|
|
|
+ }
|
|
|
+ break;
|
|
|
case Timeout_Preparing:
|
|
|
if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= GUN_PREPARE_TIMEOUT) {
|
|
|
_PrepareTimeout(gunIndex);
|
|
@@ -3192,35 +3237,36 @@ void OcppRemoteStartChk()
|
|
|
{
|
|
|
if (pSysConfig->OfflinePolicy == _OFFLINE_POLICY_NO_CHARGING) {
|
|
|
|
|
|
- } else if (!isDetectPlugin()) {
|
|
|
+ } else{
|
|
|
// 如果有 AC 槍,則固定是第 2 把槍,所以索引固定為 1
|
|
|
uint8_t acDirIndex = pSysConfig->AcConnectorCount;
|
|
|
|
|
|
for (uint8_t ac_index = 0; ac_index < pSysConfig->AcConnectorCount; ac_index++) {
|
|
|
pAcChargingInfo = (struct ChargingInfoData *)GetAcChargingInfoData(ac_index);
|
|
|
-
|
|
|
- if (ShmOCPP16Data->CsMsg.bits[acDirIndex].RemoteStartTransactionReq == YES) {
|
|
|
- if (pAcChargingInfo->SystemStatus == S_IDLE ||
|
|
|
+ if (!isDetectPlugin(acDirIndex)) {
|
|
|
+ if (ShmOCPP16Data->CsMsg.bits[acDirIndex].RemoteStartTransactionReq == YES) {
|
|
|
+ if (pAcChargingInfo->SystemStatus == S_IDLE ||
|
|
|
pAcChargingInfo->SystemStatus == S_RESERVATION) {
|
|
|
+ ShmOCPP16Data->CsMsg.bits[acDirIndex].RemoteStartTransactionReq = NO;
|
|
|
+ pAcChargingInfo->RemoteStartFlag = YES;
|
|
|
+ pSysInfo->OrderCharging = YES;
|
|
|
+ //pSysInfo->OrderCharging = DEFAULT_AC_INDEX;
|
|
|
+ ShmOCPP16Data->CsMsg.bits[pSysConfig->TotalConnectorCount + ac_index].RemoteStartTransactionReq = NO;
|
|
|
+ DetectPluginStart(acDirIndex);
|
|
|
+ return;
|
|
|
+ }
|
|
|
ShmOCPP16Data->CsMsg.bits[acDirIndex].RemoteStartTransactionReq = NO;
|
|
|
- pAcChargingInfo->RemoteStartFlag = YES;
|
|
|
- pSysInfo->OrderCharging = YES;
|
|
|
- //pSysInfo->OrderCharging = DEFAULT_AC_INDEX;
|
|
|
- ShmOCPP16Data->CsMsg.bits[pSysConfig->TotalConnectorCount + ac_index].RemoteStartTransactionReq = NO;
|
|
|
- DetectPluginStart();
|
|
|
- return;
|
|
|
}
|
|
|
- ShmOCPP16Data->CsMsg.bits[acDirIndex].RemoteStartTransactionReq = NO;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
uint8_t threeGunIndex = 0;
|
|
|
uint8_t dcIndex = 0;
|
|
|
bool isGunUsingStatus = false;
|
|
|
|
|
|
for (uint8_t _index = 0; _index < pSysConfig->TotalConnectorCount; _index++) {
|
|
|
- pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(_index);
|
|
|
-
|
|
|
+ pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(_index);
|
|
|
+ /*
|
|
|
// 如果有 AC 槍,且 DC 槍也有兩把
|
|
|
if (acDirIndex == 1 && _index == 1) {
|
|
|
threeGunIndex = 1;
|
|
@@ -3248,22 +3294,23 @@ void OcppRemoteStartChk()
|
|
|
if (dcIndex == 0) {
|
|
|
threeGunIndex = 0;
|
|
|
}
|
|
|
+ */
|
|
|
+ pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(_index);
|
|
|
|
|
|
- pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(dcIndex);
|
|
|
-
|
|
|
- if (ShmOCPP16Data->CsMsg.bits[dcIndex + threeGunIndex].RemoteStartTransactionReq == YES) {
|
|
|
- if (pDcChargingInfo->SystemStatus == S_IDLE ||
|
|
|
+ if (ShmOCPP16Data->CsMsg.bits[_index].RemoteStartTransactionReq == YES) {
|
|
|
+ if (pDcChargingInfo->SystemStatus == S_IDLE ||
|
|
|
pDcChargingInfo->SystemStatus == S_RESERVATION) {
|
|
|
- pDcChargingInfo->RemoteStartFlag = YES;
|
|
|
- pSysInfo->OrderCharging = YES;
|
|
|
- //pSysInfo->OrderCharging = gunIndex;
|
|
|
- ShmOCPP16Data->CsMsg.bits[dcIndex + threeGunIndex].RemoteStartTransactionReq = NO;
|
|
|
- DetectPluginStart();
|
|
|
+ pDcChargingInfo->RemoteStartFlag = YES;
|
|
|
+ pSysInfo->OrderCharging = YES;
|
|
|
+ //pSysInfo->OrderCharging = gunIndex;
|
|
|
+ ShmOCPP16Data->CsMsg.bits[_index].RemoteStartTransactionReq = NO;
|
|
|
+ DetectPluginStart(_index);
|
|
|
#if defined DD360Audi
|
|
|
- setSelGunWaitToAuthor(dcIndex); //Jerry add
|
|
|
+ setSelGunWaitToAuthor(_index); //Jerry add
|
|
|
#endif //defined DD360Audi
|
|
|
+ }
|
|
|
+ ShmOCPP16Data->CsMsg.bits[_index].RemoteStartTransactionReq = NO;
|
|
|
}
|
|
|
- ShmOCPP16Data->CsMsg.bits[dcIndex + threeGunIndex].RemoteStartTransactionReq = NO;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -4584,11 +4631,6 @@ int main(void)
|
|
|
//確認Power cabinet PSU Status
|
|
|
//powerCabinetPsuAlarmStatus();
|
|
|
|
|
|
- if (pGunIndexInfo->AcGunIndex > 0 && isDetectPlugin() && !GetIsCardScan()) {
|
|
|
- // AUDI_LCM_CHANGE
|
|
|
- pSysInfo->SystemPage = _LCM_WAIT_FOR_PLUG;
|
|
|
- }
|
|
|
-
|
|
|
if ((GetTimeoutValue(_cmdMainPriority_time) / 1000) > 5000) {
|
|
|
//CheckTask();
|
|
|
|
|
@@ -4645,6 +4687,14 @@ int main(void)
|
|
|
|
|
|
ChkOcppStatus(gunIndex);
|
|
|
|
|
|
+ if (pGunIndexInfo->AcGunIndex > 0 &&
|
|
|
+ isDetectPlugin(gunIndex) &&
|
|
|
+ !GetIsCardScan() &&
|
|
|
+ gunIndex == pSysInfo->CurGunSelected) {
|
|
|
+ // AUDI_LCM_CHANGE
|
|
|
+ pSysInfo->SystemPage = _LCM_WAIT_FOR_PLUG;
|
|
|
+ }
|
|
|
+
|
|
|
if ((pDcChargingInfo->SystemStatus >= S_PREPARING_FOR_EVSE &&
|
|
|
pDcChargingInfo->SystemStatus <= S_CHARGING) ||
|
|
|
(pDcChargingInfo->SystemStatus >= S_CCS_PRECHARGE_ST0 &&
|
|
@@ -4736,7 +4786,7 @@ int main(void)
|
|
|
systemPageRestoreInit();
|
|
|
}
|
|
|
}
|
|
|
- ClearDetectPluginFlag();
|
|
|
+ ClearDetectPluginFlag(gunIndex);
|
|
|
|
|
|
if (pDcChargingInfo->SystemStatus != S_FAULT)
|
|
|
{
|
|
@@ -4776,13 +4826,8 @@ int main(void)
|
|
|
|
|
|
// Idle 正常程序起點
|
|
|
// 判斷是否有啟用檢查插槍
|
|
|
- if (isDetectPlugin()) {
|
|
|
- /*
|
|
|
- if(pDcChargingInfo->Type == _Type_CCS_2 &&
|
|
|
- pSysConfig->isAuthrizeByEVCCID &&
|
|
|
- strcmp((char *)pDcChargingInfo->EVCCID,(char *)pSysConfig->UserId) != EQUAL )
|
|
|
- continue;
|
|
|
- */
|
|
|
+ if (isDetectPlugin(gunIndex)) {
|
|
|
+ StartGunInfoTimeoutDet(gunIndex, Timeout_WaitPlug);
|
|
|
// 卡號驗證成功後,等待充電槍插入充電車
|
|
|
if (pDcChargingInfo->RemoteStartFlag == YES) {
|
|
|
if (pDcChargingInfo->ConnectorPlugIn == YES &&
|
|
@@ -4794,7 +4839,8 @@ int main(void)
|
|
|
AddPlugInTimes(gunIndex);
|
|
|
setChargerMode(gunIndex, MODE_REASSIGN_CHECK);
|
|
|
strcpy((char *)pDcChargingInfo->StartUserId, "");
|
|
|
- ClearDetectPluginFlag();
|
|
|
+ ClearDetectPluginFlag(gunIndex);
|
|
|
+ StopGunInfoTimeoutDet(gunIndex);
|
|
|
continue;
|
|
|
}
|
|
|
} else if (pSysInfo->OrderCharging == NO_DEFINE) {
|
|
@@ -4819,11 +4865,13 @@ int main(void)
|
|
|
gunIndex,
|
|
|
pDcChargingInfo->StartUserId);
|
|
|
strcpy((char *)pSysConfig->UserId, "");
|
|
|
- ShmDcCommonData->AuthroizeType = IdTokenType_ISO14443;
|
|
|
+ ShmDcCommonData->AuthroizeType = IdTokenType_Central;
|
|
|
// 當前操作的槍號,進入 Preparing
|
|
|
setChargerMode(gunIndex, MODE_REASSIGN_CHECK);
|
|
|
- ClearDetectPluginFlag();
|
|
|
-
|
|
|
+ ClearDetectPluginFlag(LEFT_GUN_NUM);
|
|
|
+ ClearDetectPluginFlag(RIGHT_GUN_NUM);
|
|
|
+ StopGunInfoTimeoutDet(LEFT_GUN_NUM);
|
|
|
+ StopGunInfoTimeoutDet(RIGHT_GUN_NUM);
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
@@ -4833,21 +4881,7 @@ int main(void)
|
|
|
// AUDI_LCM_CHANGE
|
|
|
pSysInfo->SystemPage = _LCM_WAIT_FOR_PLUG;
|
|
|
}
|
|
|
- } /*else if (pSysConfig->AuthorisationMode == AUTH_MODE_DISABLE &&
|
|
|
- (pDcChargingInfo->ConnectorPlugIn == YES &&
|
|
|
- pDcChargingInfo->IsAvailable)
|
|
|
- ) {
|
|
|
- log_info("-----------------3-----------------");
|
|
|
-
|
|
|
- if (GetStartChargingByAlterMode(gunIndex) == true) {
|
|
|
- ChangeGunSelectByIndex(gunIndex);
|
|
|
- AddPlugInTimes(gunIndex);
|
|
|
- setChargerMode(gunIndex, MODE_REASSIGN_CHECK);
|
|
|
- ClearDetectPluginFlag();
|
|
|
- continue;
|
|
|
- }
|
|
|
- } */
|
|
|
- else if (pSysConfig->isAuthrizeByEVCCID && pDcChargingInfo->ConnectorPlugIn &&
|
|
|
+ } else if (pSysConfig->isAuthrizeByEVCCID && pDcChargingInfo->ConnectorPlugIn &&
|
|
|
pSysInfo->CurGunSelected == gunIndex && !pDcChargingInfo->isEVCCIDVerify) {
|
|
|
systemPageRestoreInit();
|
|
|
pSysInfo->ConnectorPage = _LCM_PRE_CHARGE;
|
|
@@ -4872,17 +4906,7 @@ int main(void)
|
|
|
gettimeofday(&pDcChargingInfo->PreChargeTimer, NULL);
|
|
|
}
|
|
|
|
|
|
- isRessign = NO;
|
|
|
-
|
|
|
- if (distributionPsuModule(&isRessign, gunIndex) == YES) {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- if (isRessign == YES) {
|
|
|
- setChargerMode(gunIndex, MODE_REASSIGN);
|
|
|
- } else {
|
|
|
- setChargerMode(gunIndex, MODE_PRECHARGE);
|
|
|
- }
|
|
|
+ setChargerMode(gunIndex, S_PREPARNING);
|
|
|
|
|
|
if (pSysInfo->CurGunSelected == gunIndex) {
|
|
|
pSysInfo->ConnectorPage = _LCM_PRE_CHARGE;
|
|
@@ -4893,36 +4917,6 @@ int main(void)
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
- case S_REASSIGN:
|
|
|
- if (isModeChange(gunIndex)) {
|
|
|
- log_info("============================= S_REASSIGN(%x) ============================= ", gunIndex);
|
|
|
- gettimeofday(&_toAverage_time, NULL);
|
|
|
- }
|
|
|
-
|
|
|
- // 重新分配,此階段主要是讓已經在充電或者準備進入充電前的緩衝
|
|
|
- // 此狀態下~ 控制權在於 PSU 及 EV小板 Process
|
|
|
- if (pSysInfo->ReAssignedFlag == _REASSIGNED_NONE ||
|
|
|
- pSysInfo->MainChargingMode == _MAIN_CHARGING_MODE_AVER) {
|
|
|
- if (pSysInfo->CanAverageCharging) {
|
|
|
- pSysInfo->MainChargingMode = _MAIN_CHARGING_MODE_AVER;//DS60-120 add
|
|
|
- setChargerMode(gunIndex, MODE_PRECHARGE);
|
|
|
- } else {
|
|
|
- setChargerMode(gunIndex, MODE_IDLE);
|
|
|
- }
|
|
|
- pSysInfo->ReAssignedFlag = _REASSIGNED_NONE; //DS60-120 add
|
|
|
- } else if (pSysInfo->ReAssignedFlag == _REASSIGNED_RELAY_M_TO_A &&
|
|
|
- pSysInfo->BridgeRelayStatus == NO) {
|
|
|
- log_info("=============Smart Charging : _REASSIGNED_COMP============= Step 6 ");
|
|
|
- pSysInfo->MainChargingMode = _MAIN_CHARGING_MODE_AVER;
|
|
|
- //pSysInfo->ReAssignedFlag = _REASSIGNED_NONE; //DS60-120 remove
|
|
|
- pSysInfo->CanAverageCharging = true; //DS60-120 add
|
|
|
- }
|
|
|
-
|
|
|
- if (pSysInfo->CurGunSelected == gunIndex) {
|
|
|
- pSysInfo->ConnectorPage = _LCM_PRE_CHARGE;
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
case S_PREPARNING:
|
|
|
if (isModeChange(gunIndex)) {
|
|
|
log_info("============================= S_PREPARNING(%x) ============================= ", gunIndex);
|
|
@@ -4936,25 +4930,6 @@ int main(void)
|
|
|
setChargerMode(gunIndex, MODE_PREPARE_FOR_EV);
|
|
|
}
|
|
|
|
|
|
- //DS60-120 add
|
|
|
- if (pSysConfig->TotalConnectorCount >= 2) {
|
|
|
- bool oughtAver = true;
|
|
|
- for (uint8_t index = 0; index < pSysConfig->TotalConnectorCount; index++) {
|
|
|
- pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(index);
|
|
|
- // 共同進入充電邏輯
|
|
|
- if (pDcChargingInfo->SystemStatus != S_PREPARNING) {
|
|
|
- oughtAver = false;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (oughtAver) {
|
|
|
- log_info("********* Automatically change to aver mode ********** ");
|
|
|
- pSysInfo->MainChargingMode = _MAIN_CHARGING_MODE_AVER;
|
|
|
- pSysInfo->ReAssignedFlag = _REASSIGNED_NONE;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
checkEvBoardReqStop(pDcChargingInfo->SystemStatus, gunIndex);
|
|
|
|
|
|
if (pSysInfo->CurGunSelected == gunIndex) {
|