|
@@ -155,7 +155,7 @@ bool isModelNameMatch = true;
|
|
|
|
|
|
int rfidFd = -1;
|
|
|
char *rfidPortName = "/dev/ttyS2";
|
|
|
-char *fwVersion = "V1.04.00.0000.00"; // "V0.16.00.0000.00";
|
|
|
+char *fwVersion = "V1.05.00.0000.00"; // "V0.16.00.0000.00";
|
|
|
|
|
|
sqlite3 *localDb;
|
|
|
bool isDb_ready;
|
|
@@ -1765,6 +1765,11 @@ bool isEvBoardStopChargeFlag(byte gunIndex)
|
|
|
return chargingInfo[gunIndex]->StopChargeFlag;
|
|
|
}
|
|
|
|
|
|
+bool isEvBoardNormalStopChargeFlag(byte gunIndex)
|
|
|
+{
|
|
|
+ return chargingInfo[gunIndex]->UnKnowStopChargeFlag;
|
|
|
+}
|
|
|
+
|
|
|
//===============================================
|
|
|
// 掃描插槍狀況
|
|
|
//===============================================
|
|
@@ -2177,6 +2182,11 @@ void ChargingTerminalProcess(byte gunIndex)
|
|
|
setChargerMode(gunIndex, MODE_TERMINATING);
|
|
|
}
|
|
|
|
|
|
+void ChargingAlarmProcess(byte gunIndex)
|
|
|
+{
|
|
|
+ setChargerMode(gunIndex, MODE_ALARM);
|
|
|
+}
|
|
|
+
|
|
|
void AcChargingTerminalProcess()
|
|
|
{
|
|
|
ac_chargingInfo[0]->SystemStatus = MODE_TERMINATING;
|
|
@@ -2217,13 +2227,21 @@ void EmcOccureByString(char *code)
|
|
|
byte level = 2;
|
|
|
// 嚴重的急停有以下幾種 : EMC 按鈕、Mainbreak、Dooropen
|
|
|
// 其錯誤等級為 2
|
|
|
- if (strncmp(code, "012251", 6) == EQUAL || strncmp(code, "012252", 6) == EQUAL || strncmp(code, "012238", 6) == EQUAL ||
|
|
|
- strncmp(code, "042251", 6) == EQUAL || strncmp(code, "042252", 6) == EQUAL || strncmp(code, "012304", 6) == EQUAL ||
|
|
|
- strncmp(code, "042200", 6) == EQUAL || strncmp(code, "042201", 6) == EQUAL || strncmp(code, "042202", 6) == EQUAL) {
|
|
|
+ if (strncmp(code, "012251", 6) == EQUAL ||
|
|
|
+ strncmp(code, "012252", 6) == EQUAL ||
|
|
|
+ strncmp(code, "012238", 6) == EQUAL ||
|
|
|
+ strncmp(code, "042251", 6) == EQUAL ||
|
|
|
+ strncmp(code, "042252", 6) == EQUAL ||
|
|
|
+ strncmp(code, "012304", 6) == EQUAL ||
|
|
|
+ strncmp(code, "042200", 6) == EQUAL ||
|
|
|
+ strncmp(code, "042201", 6) == EQUAL ||
|
|
|
+ strncmp(code, "042202", 6) == EQUAL ||
|
|
|
+ strncmp(code, "042267", 6) == EQUAL) {
|
|
|
for (byte gun = 0; gun < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; gun++) {
|
|
|
if ((chargingInfo[gun]->SystemStatus > S_IDLE && chargingInfo[gun]->SystemStatus < S_TERMINATING) ||
|
|
|
(chargingInfo[gun]->SystemStatus >= S_CCS_PRECHARGE_ST0 && chargingInfo[gun]->SystemStatus <= S_CCS_PRECHARGE_ST1)) {
|
|
|
- ChargingTerminalProcess(gun);
|
|
|
+ //ChargingTerminalProcess(gun);
|
|
|
+ ChargingAlarmProcess(gun);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -3891,6 +3909,16 @@ bool OcppRemoteStop(byte gunIndex)
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+bool WifiScheduleStop(byte gunIndex)
|
|
|
+{
|
|
|
+ bool result = false;
|
|
|
+
|
|
|
+ result = chargingInfo[gunIndex]->schedule.isTriggerStop;
|
|
|
+ chargingInfo[gunIndex]->schedule.isTriggerStop = NO;
|
|
|
+
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
void OcppRemoteStartChk()
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == _OFFLINE_POLICY_NO_CHARGING)
|
|
@@ -4598,6 +4626,21 @@ bool GetStartChargingByAlterMode(byte _gun)
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+void TheEndCharging(byte gun_index)
|
|
|
+{
|
|
|
+ ftime(&endChargingTime[gun_index]);
|
|
|
+ if (chargingInfo[gun_index]->PresentChargedDuration != 0) {
|
|
|
+ chargingInfo[gun_index]->PresentChargedDuration = DiffTimeb(startChargingTime[gun_index], endChargingTime[gun_index]);
|
|
|
+ }
|
|
|
+
|
|
|
+ chargingInfo[gun_index]->isRemoteStart = NO;
|
|
|
+
|
|
|
+ StopGunInfoTimeoutDet(gun_index);
|
|
|
+ StartGunInfoTimeoutDet(gun_index, Timeout_EvseCompleteDet);
|
|
|
+ ChangeStartOrStopDateTime(NO, gun_index);
|
|
|
+ DB_Insert_Record(localDb, gun_index);
|
|
|
+}
|
|
|
+
|
|
|
void ResetDetAlarmStatus(byte gun)
|
|
|
{
|
|
|
if (chargingInfo[gun]->Type == _Type_Chademo) {
|
|
@@ -4615,6 +4658,17 @@ void ResetDetAlarmStatus(byte gun)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+static void powerCabinetPsuAlarmStatus(void)
|
|
|
+{
|
|
|
+ uint8_t i = 0;
|
|
|
+
|
|
|
+ for (i = 0; i < ShmSysConfigAndInfo->SysWarningInfo.WarningCount; i++) {
|
|
|
+ if (memcmp(&ShmSysConfigAndInfo->SysWarningInfo.WarningCode[i][0], "042267", 6) == 0) {
|
|
|
+ EmcOccureByString("042267");
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
int main(void)
|
|
|
{
|
|
|
if (CreateShareMemory() == 0) {
|
|
@@ -4718,6 +4772,8 @@ int main(void)
|
|
|
ClearAlarmCodeWhenAcOff();
|
|
|
// 確認是否要回到充電中的槍畫面邏輯判斷
|
|
|
CheckReturnToChargingConn();
|
|
|
+ //確認Power cabinet PSU Status
|
|
|
+ powerCabinetPsuAlarmStatus();
|
|
|
|
|
|
if (_acgunIndex > 0 && isDetectPlugin() && !isCardScan) {
|
|
|
ShmSysConfigAndInfo->SysInfo.SystemPage = _LCM_WAIT_FOR_PLUG;
|
|
@@ -4744,7 +4800,7 @@ int main(void)
|
|
|
case S_IDLE:
|
|
|
case S_RESERVATION:
|
|
|
case S_MAINTAIN:
|
|
|
- case S_ALARM: {
|
|
|
+ case S_FAULT: {
|
|
|
if (chargingInfo[gun_index]->SystemStatus == S_IDLE &&
|
|
|
isModeChange(gun_index)) {
|
|
|
DEBUG_INFO_MSG("S_IDLE================================== %x \n", gun_index);
|
|
@@ -4758,7 +4814,7 @@ int main(void)
|
|
|
//Jerry add
|
|
|
memset(&gAudiCustInfo->PricesInfo[gun_index], 0, sizeof(PricesInfo));
|
|
|
gAudiCustInfo->PricesInfo[gun_index].Balance = FAIL_BALANCE_PRICES;
|
|
|
- ResetDetAlarmStatus(gun_index);
|
|
|
+ ResetDetAlarmStatus(gun_index); //recovery OVP status code
|
|
|
} else if (chargingInfo[gun_index]->SystemStatus == S_RESERVATION &&
|
|
|
isModeChange(gun_index)) {
|
|
|
DEBUG_INFO_MSG("S_RESERVATION....................%x \n", gun_index);
|
|
@@ -4770,22 +4826,33 @@ int main(void)
|
|
|
}
|
|
|
|
|
|
if (ShmSysConfigAndInfo->SysWarningInfo.Level == 2) {
|
|
|
- //if (gun_index == ShmSysConfigAndInfo->SysInfo.CurGunSelected)
|
|
|
- {
|
|
|
+ if (gun_index == ShmSysConfigAndInfo->SysInfo.CurGunSelected) {
|
|
|
ShmSysConfigAndInfo->SysInfo.SystemPage = _LCM_FIX;
|
|
|
+ } else if (chargingInfo[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus != S_IDLE &&
|
|
|
+ chargingInfo[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus != S_RESERVATION &&
|
|
|
+ chargingInfo[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus != S_MAINTAIN &&
|
|
|
+ chargingInfo[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus != S_FAULT) {
|
|
|
+ if (chargingInfo[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus == S_CHARGING) {
|
|
|
+ ShmSysConfigAndInfo->SysInfo.SystemPage = _LCM_COMPLETE;
|
|
|
+ } else {
|
|
|
+ ShmSysConfigAndInfo->SysInfo.SystemPage = _LCM_SELECT_GUN;//_LCM_NONE;
|
|
|
+ }
|
|
|
}
|
|
|
- ClearDetectPluginFlag();
|
|
|
- setChargerMode(gun_index, MODE_ALARM);
|
|
|
- } else if (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == _OFFLINE_POLICY_NO_CHARGING) {
|
|
|
- /* 不給充電 */
|
|
|
|
|
|
+ ClearDetectPluginFlag();
|
|
|
+ //UpdateErrorCodeToOcpp(gun_index);
|
|
|
+ setChargerMode(gun_index, MODE_FAULT);
|
|
|
} else {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.SystemPage == _LCM_FIX) {
|
|
|
- ShmSysConfigAndInfo->SysInfo.SystemPage = _LCM_SELECT_GUN;//_LCM_NONE; //Jerry add
|
|
|
- for (byte g_index = 0; g_index < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; g_index++) {
|
|
|
- setChargerMode(g_index, MODE_IDLE);
|
|
|
- }
|
|
|
+ if (chargingInfo[gun_index]->SystemStatus == S_FAULT) {
|
|
|
+ ShmSysConfigAndInfo->SysInfo.SystemPage = _LCM_SELECT_GUN;
|
|
|
+ setChargerMode(gun_index, MODE_IDLE);
|
|
|
}
|
|
|
+ //if (ShmSysConfigAndInfo->SysInfo.SystemPage == _LCM_FIX) {
|
|
|
+ // ShmSysConfigAndInfo->SysInfo.SystemPage = _LCM_SELECT_GUN;//_LCM_NONE; //Jerry add
|
|
|
+ // //for (byte g_index = 0; g_index < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; g_index++) {
|
|
|
+ // setChargerMode(gun_index, MODE_IDLE);
|
|
|
+ // //}
|
|
|
+ //}
|
|
|
|
|
|
if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_AVER) {
|
|
|
#if !defined DD360 && !defined DD360Audi
|
|
@@ -4816,7 +4883,11 @@ int main(void)
|
|
|
ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_NONE;
|
|
|
}
|
|
|
|
|
|
- {
|
|
|
+ if (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == _OFFLINE_POLICY_NO_CHARGING) {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == gun_index) {
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorPage = _LCM_SELECT_GUN;//_LCM_IDLE;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
// Idle 正常程序起點
|
|
|
// 判斷是否有啟用檢查插槍
|
|
|
if (isDetectPlugin()) {
|
|
@@ -4833,11 +4904,7 @@ int main(void)
|
|
|
chargingInfo[gun_index]->RemoteStartFlag = NO;
|
|
|
ChangeGunSelectByIndex(gun_index);
|
|
|
AddPlugInTimes(gun_index);
|
|
|
-//#if defined DD360 || defined DD360Audi
|
|
|
-// setChargerMode(gun_index, MODE_PRECHARGE);
|
|
|
-//#else
|
|
|
setChargerMode(gun_index, MODE_REASSIGN_CHECK);
|
|
|
-//#endif //defined DD360 || defined DD360Audi
|
|
|
strcpy((char *)chargingInfo[gun_index]->StartUserId, "");
|
|
|
ClearDetectPluginFlag();
|
|
|
continue;
|
|
@@ -4857,11 +4924,7 @@ int main(void)
|
|
|
PRINTF_FUNC("index = %d, CardNumber = %s \n", gun_index, chargingInfo[gun_index]->StartUserId);
|
|
|
strcpy((char *)ShmSysConfigAndInfo->SysConfig.UserId, "");
|
|
|
// 當前操作的槍號,進入 Preparing
|
|
|
- //#ifdef DD360
|
|
|
- //setChargerMode(gun_index, MODE_PRECHARGE);
|
|
|
- //#else
|
|
|
setChargerMode(gun_index, MODE_REASSIGN_CHECK);
|
|
|
- //#endif
|
|
|
ClearDetectPluginFlag();
|
|
|
continue;
|
|
|
}
|
|
@@ -4883,11 +4946,7 @@ int main(void)
|
|
|
if (isCanStartChargingFlag) {
|
|
|
ChangeGunSelectByIndex(gun_index);
|
|
|
AddPlugInTimes(gun_index);
|
|
|
- //#ifdef DD360
|
|
|
- //setChargerMode(gun_index, MODE_PRECHARGE);
|
|
|
- //#else
|
|
|
setChargerMode(gun_index, MODE_REASSIGN_CHECK);
|
|
|
- //#endif
|
|
|
ClearDetectPluginFlag();
|
|
|
continue;
|
|
|
}
|
|
@@ -4897,9 +4956,8 @@ int main(void)
|
|
|
}
|
|
|
}
|
|
|
} // Idle 正常程序終點
|
|
|
+ ReleaseAlarmCode(gun_index);
|
|
|
}
|
|
|
-
|
|
|
- ReleaseAlarmCode(gun_index);
|
|
|
}
|
|
|
break;
|
|
|
case S_REASSIGN_CHECK: {
|
|
@@ -4947,14 +5005,15 @@ int main(void)
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
-#endif
|
|
|
- if (0)
|
|
|
+#endif // 0
|
|
|
+
|
|
|
+ if (0) { // if (isRessign)
|
|
|
#if defined DD360 || defined DD360Audi
|
|
|
setChargerMode(gun_index, MODE_PRECHARGE);
|
|
|
#else
|
|
|
setChargerMode(gun_index, MODE_REASSIGN);
|
|
|
#endif //defined DD360 || defined DD360Audi
|
|
|
- else {
|
|
|
+ } else {
|
|
|
setChargerMode(gun_index, MODE_PRECHARGE);
|
|
|
}
|
|
|
|
|
@@ -5007,11 +5066,29 @@ int main(void)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (isEvBoardStopChargeFlag(gun_index) == YES || OcppRemoteStop(gun_index) == YES) {
|
|
|
- // 板端或後臺要求停止
|
|
|
+ if (isEvBoardStopChargeFlag(gun_index) == YES) {
|
|
|
+ // 板端要求停止 (錯誤)
|
|
|
+ if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL) {
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "EVDisconnected");
|
|
|
+ }
|
|
|
+ ChargingAlarmProcess(gun_index);
|
|
|
+ } else if (isEvBoardNormalStopChargeFlag(gun_index) == YES) {
|
|
|
+ // 板端要求停止 (正常)
|
|
|
+ if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL) {
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "EVDisconnected");
|
|
|
+ }
|
|
|
+ ChargingTerminalProcess(gun_index);
|
|
|
+ } else if (OcppRemoteStop(gun_index) == YES ||
|
|
|
+ WifiScheduleStop(gun_index)) {
|
|
|
+ // 後臺要求停止
|
|
|
ChargingTerminalProcess(gun_index);
|
|
|
}
|
|
|
|
|
|
+ //if (isEvBoardStopChargeFlag(gun_index) == YES || OcppRemoteStop(gun_index) == YES) {
|
|
|
+ // // 板端或後臺要求停止
|
|
|
+ // ChargingTerminalProcess(gun_index);
|
|
|
+ //}
|
|
|
+
|
|
|
if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == gun_index) {
|
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorPage = _LCM_PRE_CHARGE;
|
|
|
}
|
|
@@ -5042,12 +5119,30 @@ int main(void)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (isEvBoardStopChargeFlag(gun_index) == YES ||
|
|
|
- OcppRemoteStop(gun_index) == YES) {
|
|
|
- // 板端或後臺要求停止
|
|
|
+ if (isEvBoardStopChargeFlag(gun_index) == YES) {
|
|
|
+ // 板端要求停止 (錯誤)
|
|
|
+ if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL) {
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "EVDisconnected");
|
|
|
+ }
|
|
|
+ ChargingAlarmProcess(gun_index);
|
|
|
+ } else if (isEvBoardNormalStopChargeFlag(gun_index) == YES) {
|
|
|
+ // 板端要求停止 (正常)
|
|
|
+ if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL) {
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "EVDisconnected");
|
|
|
+ }
|
|
|
+ ChargingTerminalProcess(gun_index);
|
|
|
+ } else if (OcppRemoteStop(gun_index) == YES ||
|
|
|
+ WifiScheduleStop(gun_index)) {
|
|
|
+ // 後臺要求停止
|
|
|
ChargingTerminalProcess(gun_index);
|
|
|
}
|
|
|
|
|
|
+ //if (isEvBoardStopChargeFlag(gun_index) == YES ||
|
|
|
+ // OcppRemoteStop(gun_index) == YES) {
|
|
|
+ // // 板端或後臺要求停止
|
|
|
+ // ChargingTerminalProcess(gun_index);
|
|
|
+ //}
|
|
|
+
|
|
|
// LCM => Pre-charging
|
|
|
if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == gun_index) {
|
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorPage = _LCM_PRE_CHARGE;
|
|
@@ -5092,12 +5187,7 @@ int main(void)
|
|
|
// 檢查樁端的 GFD 結果
|
|
|
if ((chargingInfo[gun_index]->GroundFaultStatus == GFD_PASS ||
|
|
|
chargingInfo[gun_index]->GroundFaultStatus == GFD_WARNING)) {
|
|
|
-#if defined DD360 || defined DD360Audi
|
|
|
- //setChargerMode(gun_index, MODE_CHARGING);
|
|
|
setChargerMode(gun_index, MODE_CCS_PRECHARGE_STEP0);
|
|
|
-#else
|
|
|
- setChargerMode(gun_index, MODE_CCS_PRECHARGE_STEP0);
|
|
|
-#endif //defined DD360 || defined DD360Audi
|
|
|
}
|
|
|
|
|
|
if (chargingInfo[gun_index]->GroundFaultStatus == GFD_FAIL) {
|
|
@@ -5109,12 +5199,30 @@ int main(void)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (isEvBoardStopChargeFlag(gun_index) == YES ||
|
|
|
- OcppRemoteStop(gun_index) == YES) {
|
|
|
- // 板端或後臺要求停止
|
|
|
+ if (isEvBoardStopChargeFlag(gun_index) == YES) {
|
|
|
+ // 板端要求停止 (錯誤)
|
|
|
+ if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL) {
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "EVDisconnected");
|
|
|
+ }
|
|
|
+ ChargingAlarmProcess(gun_index);
|
|
|
+ } else if (isEvBoardNormalStopChargeFlag(gun_index) == YES) {
|
|
|
+ // 板端要求停止 (正常)
|
|
|
+ if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL) {
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "EVDisconnected");
|
|
|
+ }
|
|
|
+ ChargingTerminalProcess(gun_index);
|
|
|
+ } else if (OcppRemoteStop(gun_index) == YES ||
|
|
|
+ WifiScheduleStop(gun_index)) {
|
|
|
+ // 後臺要求停止
|
|
|
ChargingTerminalProcess(gun_index);
|
|
|
}
|
|
|
|
|
|
+ //if (isEvBoardStopChargeFlag(gun_index) == YES ||
|
|
|
+ // OcppRemoteStop(gun_index) == YES) {
|
|
|
+ // // 板端或後臺要求停止
|
|
|
+ // ChargingTerminalProcess(gun_index);
|
|
|
+ //}
|
|
|
+
|
|
|
// LCM => Pre-charging
|
|
|
if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == gun_index) {
|
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorPage = _LCM_PRE_CHARGE;
|
|
@@ -5140,12 +5248,14 @@ int main(void)
|
|
|
if (chargingInfo[gun_index]->GroundFaultStatus == GFD_FAIL) {
|
|
|
// GFD 錯誤停止
|
|
|
RecordAlarmCode(gun_index, "012234");
|
|
|
- } else if (((chargingInfo[gun_index]->EvBatterytargetVoltage * 10) > 0 && chargingInfo[gun_index]->EvBatterytargetVoltage < SYSTEM_MIN_VOL)/* ||
|
|
|
-(chargingInfo[gun_index]->PresentChargedDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL)*/) {
|
|
|
- // UVP
|
|
|
- RecordAlarmCode(gun_index, "012289");
|
|
|
- ChargingTerminalProcess(gun_index);
|
|
|
- } else if (chargingInfo[gun_index]->GroundFaultStatus == GFD_WARNING) {
|
|
|
+ }
|
|
|
+ //else if (((chargingInfo[gun_index]->EvBatterytargetVoltage * 10) > 0 && chargingInfo[gun_index]->EvBatterytargetVoltage < SYSTEM_MIN_VOL) ||
|
|
|
+ // (chargingInfo[gun_index]->PresentChargedDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL)) {
|
|
|
+ // // UVP
|
|
|
+ // RecordAlarmCode(gun_index, "012289");
|
|
|
+ // ChargingTerminalProcess(gun_index);
|
|
|
+ //}
|
|
|
+ else if (chargingInfo[gun_index]->GroundFaultStatus == GFD_WARNING) {
|
|
|
// GFD 警告
|
|
|
RecordWarningCode(gun_index, "012296");
|
|
|
}
|
|
@@ -5153,13 +5263,15 @@ int main(void)
|
|
|
if (chargingInfo[gun_index]->GroundFaultStatus == GFD_FAIL) {
|
|
|
// GFD 錯誤停止
|
|
|
RecordAlarmCode(gun_index, "012236");
|
|
|
- } else if (isPrechargeStatus_gb(gun_index) == 10 &&
|
|
|
- (((chargingInfo[gun_index]->EvBatterytargetVoltage * 10) > 0 && chargingInfo[gun_index]->EvBatterytargetVoltage < SYSTEM_MIN_VOL)/* ||
|
|
|
-(chargingInfo[gun_index]->PresentChargedDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL)*/)) {
|
|
|
- // UVP
|
|
|
- RecordAlarmCode(gun_index, "012290");
|
|
|
- ChargingTerminalProcess(gun_index);
|
|
|
- } else if (chargingInfo[gun_index]->GroundFaultStatus == GFD_WARNING) {
|
|
|
+ }
|
|
|
+ //else if (isPrechargeStatus_gb(gun_index) == 10 &&
|
|
|
+ // (((chargingInfo[gun_index]->EvBatterytargetVoltage * 10) > 0 && chargingInfo[gun_index]->EvBatterytargetVoltage < SYSTEM_MIN_VOL) ||
|
|
|
+ // (chargingInfo[gun_index]->PresentChargedDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL))) {
|
|
|
+ // // UVP
|
|
|
+ // RecordAlarmCode(gun_index, "012290");
|
|
|
+ // ChargingTerminalProcess(gun_index);
|
|
|
+ //}
|
|
|
+ else if (chargingInfo[gun_index]->GroundFaultStatus == GFD_WARNING) {
|
|
|
// GFD 警告
|
|
|
RecordWarningCode(gun_index, "012298");
|
|
|
}
|
|
@@ -5167,47 +5279,89 @@ int main(void)
|
|
|
if (chargingInfo[gun_index]->GroundFaultStatus == GFD_FAIL) {
|
|
|
// GFD 錯誤停止
|
|
|
RecordAlarmCode(gun_index, "012235");
|
|
|
- } else if (((chargingInfo[gun_index]->EvBatterytargetVoltage * 10) > 0 && chargingInfo[gun_index]->EvBatterytargetVoltage < SYSTEM_MIN_VOL)/* ||
|
|
|
-(chargingInfo[gun_index]->PresentChargedDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL)*/) {
|
|
|
- // UVP
|
|
|
- RecordAlarmCode(gun_index, "012288");
|
|
|
- ChargingTerminalProcess(gun_index);
|
|
|
- } else if (chargingInfo[gun_index]->GroundFaultStatus == GFD_WARNING) {
|
|
|
+ }
|
|
|
+ //else if (((chargingInfo[gun_index]->EvBatterytargetVoltage * 10) > 0 && chargingInfo[gun_index]->EvBatterytargetVoltage < SYSTEM_MIN_VOL) ||
|
|
|
+ // (chargingInfo[gun_index]->PresentChargedDuration >= 10 && chargingInfo[gun_index]->PresentChargingVoltage < SYSTEM_MIN_VOL)) {
|
|
|
+ // // UVP
|
|
|
+ // RecordAlarmCode(gun_index, "012288");
|
|
|
+ // ChargingTerminalProcess(gun_index);
|
|
|
+ //}
|
|
|
+ else if (chargingInfo[gun_index]->GroundFaultStatus == GFD_WARNING) {
|
|
|
// GFD 警告
|
|
|
RecordWarningCode(gun_index, "012297");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (isEvBoardStopChargeFlag(gun_index) ||
|
|
|
- OcppRemoteStop(gun_index) ||
|
|
|
- CheckBackendChargingTimeout(gun_index) ||
|
|
|
- CheckBackendChargingEnergy(gun_index) ||
|
|
|
- strcmp((char *)ShmOCPP16Data->StartTransaction[gun_index].ResponseIdTagInfo.Status, "Invalid") == EQUAL) {
|
|
|
- DEBUG_INFO_MSG("S_CHARGING=======Stop=========================== %f \n", (chargingInfo[gun_index]->EvBatterytargetVoltage * 10));
|
|
|
- // 板端或後臺要求停止
|
|
|
+ if (isEvBoardStopChargeFlag(gun_index) == YES) {
|
|
|
+ // 板端要求停止 (錯誤)
|
|
|
+ if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL) {
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "EVDisconnected");
|
|
|
+ }
|
|
|
+ ChargingAlarmProcess(gun_index);
|
|
|
+ } else if (isEvBoardNormalStopChargeFlag(gun_index) == YES) {
|
|
|
+ // 板端要求停止 (正常)
|
|
|
+ if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL) {
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "EVDisconnected");
|
|
|
+ }
|
|
|
+ ChargingTerminalProcess(gun_index);
|
|
|
+ } else if (OcppRemoteStop(gun_index) == YES ||
|
|
|
+ WifiScheduleStop(gun_index) ||
|
|
|
+ CheckBackendChargingTimeout(gun_index) ||
|
|
|
+ CheckBackendChargingEnergy(gun_index) ||
|
|
|
+ strcmp((char *)ShmOCPP16Data->StartTransaction[gun_index].ResponseIdTagInfo.Status, "Invalid") == EQUAL) {
|
|
|
+
|
|
|
+ // 後臺要求停止
|
|
|
ChargingTerminalProcess(gun_index);
|
|
|
}
|
|
|
|
|
|
+ //if (isEvBoardStopChargeFlag(gun_index) ||
|
|
|
+ // OcppRemoteStop(gun_index) ||
|
|
|
+ // CheckBackendChargingTimeout(gun_index) ||
|
|
|
+ // CheckBackendChargingEnergy(gun_index) ||
|
|
|
+ // strcmp((char *)ShmOCPP16Data->StartTransaction[gun_index].ResponseIdTagInfo.Status, "Invalid") == EQUAL) {
|
|
|
+ // DEBUG_INFO_MSG("S_CHARGING=======Stop=========================== %f \n", (chargingInfo[gun_index]->EvBatterytargetVoltage * 10));
|
|
|
+ // // 板端或後臺要求停止
|
|
|
+ // ChargingTerminalProcess(gun_index);
|
|
|
+ //}
|
|
|
+
|
|
|
// LCM => Charging
|
|
|
if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == gun_index) {
|
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorPage = _LCM_CHARGING;
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
+ case S_ALARM:
|
|
|
case S_TERMINATING: {
|
|
|
if (isModeChange(gun_index)) {
|
|
|
- DEBUG_INFO_MSG ("terminating......................... %x \n", gun_index);
|
|
|
+ if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL) {
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "Local");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (chargingInfo[gun_index]->SystemStatus == S_ALARM) {
|
|
|
+ PRINTF_FUNC("================== S_ALARM (%x) ================ \n", gun_index);
|
|
|
+ //UpdateErrorCodeToOcpp(gun_index);
|
|
|
+
|
|
|
+ if (strcmp((char *)chargingInfo[gun_index]->StartDateTime, "") != EQUAL) {
|
|
|
+ OcppStopTransation(gun_index);
|
|
|
+ }
|
|
|
+
|
|
|
+ TheEndCharging(gun_index);
|
|
|
+ } else {
|
|
|
+ PRINTF_FUNC("================== S_TERMINATING (%x) ================ \n", gun_index);
|
|
|
+ }
|
|
|
+
|
|
|
+ //DEBUG_INFO_MSG ("terminating......................... %x \n", gun_index);
|
|
|
StopGunInfoTimeoutDet(gun_index);
|
|
|
}
|
|
|
|
|
|
if (chargingInfo[gun_index]->Type == _Type_Chademo) {
|
|
|
// 非車端的停止 : 需等待小板送出停止指令,讓車端解除槍
|
|
|
- if (isEvStopCharging_chademo(gun_index) == YES) {
|
|
|
- /*+++ 20200908, vern, disable it for DD360 +++*/
|
|
|
- /*if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL)
|
|
|
- strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "Local");*/
|
|
|
- /*--- 20200908, vern, disable it for DD360 ---*/
|
|
|
- }
|
|
|
+ //if (isEvStopCharging_chademo(gun_index) == YES) {
|
|
|
+ // /*+++ 20200908, vern, disable it for DD360 +++*/
|
|
|
+ // /*if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL)
|
|
|
+ // strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "Local");*/
|
|
|
+ // /*--- 20200908, vern, disable it for DD360 ---*/
|
|
|
+ //}
|
|
|
|
|
|
if (chargingInfo[gun_index]->GroundFaultStatus == GFD_FAIL) {
|
|
|
// GFD 錯誤停止
|
|
@@ -5217,19 +5371,19 @@ int main(void)
|
|
|
RecordWarningCode(gun_index, "012296");
|
|
|
}
|
|
|
|
|
|
- if (isEvStopCharging_chademo(gun_index) == YES ||
|
|
|
- isPrechargeStatus_chademo(gun_index) <= 0) {
|
|
|
- setChargerMode(gun_index, MODE_COMPLETE);
|
|
|
- }
|
|
|
+ //if (isEvStopCharging_chademo(gun_index) == YES ||
|
|
|
+ // isPrechargeStatus_chademo(gun_index) <= 0) {
|
|
|
+ // setChargerMode(gun_index, MODE_COMPLETE);
|
|
|
+ //}
|
|
|
} else if (chargingInfo[gun_index]->Type == _Type_GB) {
|
|
|
DEBUG_INFO_MSG("************ GB lock Status = %d, status = %d \n", isEvStopCharging_gb(gun_index), isPrechargeStatus_gb(gun_index));
|
|
|
// 非車端的停止 : 需等待小板送出停止指令,讓車端解除槍
|
|
|
- if (isEvStopCharging_chademo(gun_index) == YES) {
|
|
|
- /*+++ 20200908, vern, disable it for DD360 +++*/
|
|
|
- /*if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL)
|
|
|
- strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "Local");*/
|
|
|
- /*--- 20200908, vern, disable it for DD360 ---*/
|
|
|
- }
|
|
|
+ //if (isEvStopCharging_chademo(gun_index) == YES) {
|
|
|
+ // /*+++ 20200908, vern, disable it for DD360 +++*/
|
|
|
+ // /*if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL)
|
|
|
+ // strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "Local");*/
|
|
|
+ // /*--- 20200908, vern, disable it for DD360 ---*/
|
|
|
+ //}
|
|
|
|
|
|
if (chargingInfo[gun_index]->GroundFaultStatus == GFD_FAIL) {
|
|
|
// GFD 錯誤停止
|
|
@@ -5239,18 +5393,18 @@ int main(void)
|
|
|
RecordWarningCode(gun_index, "012298");
|
|
|
}
|
|
|
|
|
|
- if (isEvStopCharging_gb(gun_index) == YES ||
|
|
|
- isPrechargeStatus_gb(gun_index) <= 0) {
|
|
|
- setChargerMode(gun_index, MODE_COMPLETE);
|
|
|
- }
|
|
|
+ //if (isEvStopCharging_gb(gun_index) == YES ||
|
|
|
+ // isPrechargeStatus_gb(gun_index) <= 0) {
|
|
|
+ // setChargerMode(gun_index, MODE_COMPLETE);
|
|
|
+ //}
|
|
|
} else if (chargingInfo[gun_index]->Type == _Type_CCS_2) {
|
|
|
// 非車端的停止 : 需等待小板送出停止指令,讓車端解除槍
|
|
|
- if (isEvStopCharging_chademo(gun_index) == YES) {
|
|
|
- /*+++ 20200908, vern, disable it for DD360 +++*/
|
|
|
- /*if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL)
|
|
|
- strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "Local");*/
|
|
|
- /*--- 20200908, vern, disable it for DD360 ---*/
|
|
|
- }
|
|
|
+ //if (isEvStopCharging_chademo(gun_index) == YES) {
|
|
|
+ // /*+++ 20200908, vern, disable it for DD360 +++*/
|
|
|
+ // /*if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL)
|
|
|
+ // strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "Local");*/
|
|
|
+ // /*--- 20200908, vern, disable it for DD360 ---*/
|
|
|
+ //}
|
|
|
|
|
|
if (chargingInfo[gun_index]->GroundFaultStatus == GFD_FAIL) {
|
|
|
// GFD 錯誤停止
|
|
@@ -5260,17 +5414,42 @@ int main(void)
|
|
|
RecordWarningCode(gun_index, "012297");
|
|
|
}
|
|
|
|
|
|
- if (isEvStopCharging_ccs(gun_index) == YES &&
|
|
|
- (isPrechargeStatus_ccs(gun_index) >= 53 || isPrechargeStatus_ccs(gun_index) == 0 ||
|
|
|
- isPrechargeStatus_ccs(gun_index) == 13 || isPrechargeStatus_ccs(gun_index) == 14)) {
|
|
|
- setChargerMode(gun_index, MODE_COMPLETE);
|
|
|
+ //if (isEvStopCharging_ccs(gun_index) == YES &&
|
|
|
+ // (isPrechargeStatus_ccs(gun_index) >= 53 || isPrechargeStatus_ccs(gun_index) == 0 ||
|
|
|
+ // isPrechargeStatus_ccs(gun_index) == 13 || isPrechargeStatus_ccs(gun_index) == 14)) {
|
|
|
+ // setChargerMode(gun_index, MODE_COMPLETE);
|
|
|
+ //}
|
|
|
+ }
|
|
|
+
|
|
|
+ if (chargingInfo[gun_index]->SystemStatus == S_ALARM) {
|
|
|
+ if (chargingInfo[gun_index]->ConnectorPlugIn == NO &&
|
|
|
+ GetTimeoutValue(chargingInfo[gun_index]->TimeoutTimer) >= 10000000) {
|
|
|
+ setChargerMode(gun_index, MODE_IDLE);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (chargingInfo[gun_index]->Type == _Type_Chademo) {
|
|
|
+ if (isEvStopCharging_chademo(gun_index) == YES ||
|
|
|
+ isPrechargeStatus_chademo(gun_index) <= 0) {
|
|
|
+ setChargerMode(gun_index, MODE_COMPLETE);
|
|
|
+ }
|
|
|
+ } else if (chargingInfo[gun_index]->Type == _Type_GB) {
|
|
|
+ if (isEvStopCharging_gb(gun_index) == YES ||
|
|
|
+ isPrechargeStatus_gb(gun_index) <= 0) {
|
|
|
+ setChargerMode(gun_index, MODE_COMPLETE);
|
|
|
+ }
|
|
|
+ } else if (chargingInfo[gun_index]->Type == _Type_CCS_2) {
|
|
|
+ if (isEvStopCharging_ccs(gun_index) == YES &&
|
|
|
+ (isPrechargeStatus_ccs(gun_index) >= 53 || isPrechargeStatus_ccs(gun_index) == 0 ||
|
|
|
+ isPrechargeStatus_ccs(gun_index) == 13 || isPrechargeStatus_ccs(gun_index) == 14)) {
|
|
|
+ setChargerMode(gun_index, MODE_COMPLETE);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 車端的停止
|
|
|
- if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL) {
|
|
|
- strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "EVDisconnected");
|
|
|
- }
|
|
|
+ //if (strcmp((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "") == EQUAL) {
|
|
|
+ // strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "EVDisconnected");
|
|
|
+ //}
|
|
|
|
|
|
if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == gun_index) {
|
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorPage = _LCM_COMPLETE;
|
|
@@ -5283,19 +5462,27 @@ int main(void)
|
|
|
if (strcmp((char *)chargingInfo[gun_index]->StartDateTime, "") != EQUAL) {
|
|
|
OcppStopTransation(gun_index);
|
|
|
}
|
|
|
- ftime(&endChargingTime[gun_index]);
|
|
|
- if (chargingInfo[gun_index]->PresentChargedDuration != 0) {
|
|
|
- chargingInfo[gun_index]->PresentChargedDuration = DiffTimeb(startChargingTime[gun_index], endChargingTime[gun_index]);
|
|
|
- }
|
|
|
|
|
|
- StopGunInfoTimeoutDet(gun_index);
|
|
|
- StartGunInfoTimeoutDet(gun_index, Timeout_EvseCompleteDet);
|
|
|
- ChangeStartOrStopDateTime(NO, gun_index);
|
|
|
+ TheEndCharging(gun_index);
|
|
|
+ //ftime(&endChargingTime[gun_index]);
|
|
|
+ //if (chargingInfo[gun_index]->PresentChargedDuration != 0) {
|
|
|
+ // chargingInfo[gun_index]->PresentChargedDuration = DiffTimeb(startChargingTime[gun_index], endChargingTime[gun_index]);
|
|
|
+ //}
|
|
|
+
|
|
|
+ //StopGunInfoTimeoutDet(gun_index);
|
|
|
+ //StartGunInfoTimeoutDet(gun_index, Timeout_EvseCompleteDet);
|
|
|
+ //ChangeStartOrStopDateTime(NO, gun_index);
|
|
|
}
|
|
|
|
|
|
- if (((chargingInfo[gun_index]->ConnectorPlugIn == NO) ||
|
|
|
- (restartFlag == 1)) &&
|
|
|
- (GetTimeoutValue(chargingInfo[gun_index]->TimeoutTimer) >= 10000000)) {
|
|
|
+ //if (((chargingInfo[gun_index]->ConnectorPlugIn == NO) ||
|
|
|
+ // (restartFlag == 1)) &&
|
|
|
+ // (GetTimeoutValue(chargingInfo[gun_index]->TimeoutTimer) >= 10000000)) {
|
|
|
+ // setChargerMode(gun_index, MODE_IDLE);
|
|
|
+ // destroySelGun(gun_index); //Jerry add
|
|
|
+ //}
|
|
|
+
|
|
|
+ if (chargingInfo[gun_index]->ConnectorPlugIn == NO &&
|
|
|
+ GetTimeoutValue(chargingInfo[gun_index]->TimeoutTimer) >= 10000000) {
|
|
|
setChargerMode(gun_index, MODE_IDLE);
|
|
|
destroySelGun(gun_index); //Jerry add
|
|
|
}
|
|
@@ -5318,17 +5505,35 @@ int main(void)
|
|
|
}
|
|
|
|
|
|
if (isEvBoardStopChargeFlag(gun_index) == YES) {
|
|
|
- // 板端要求停止
|
|
|
+ // 板端要求停止 (錯誤)
|
|
|
+ ChargingAlarmProcess(gun_index);
|
|
|
+ } else if (isEvBoardNormalStopChargeFlag(gun_index) == YES) {
|
|
|
+ // 板端要求停止 (正常)
|
|
|
+ ChargingTerminalProcess(gun_index);
|
|
|
+ } else if (OcppRemoteStop(gun_index) == YES ||
|
|
|
+ WifiScheduleStop(gun_index)) {
|
|
|
+ // 後臺要求停止
|
|
|
ChargingTerminalProcess(gun_index);
|
|
|
}
|
|
|
|
|
|
+ //if (isEvBoardStopChargeFlag(gun_index) == YES) {
|
|
|
+ // // 板端要求停止
|
|
|
+ // ChargingTerminalProcess(gun_index);
|
|
|
+ //}
|
|
|
+
|
|
|
// 等待 EV 小板 (CCS) 通知可以開始 Precharge
|
|
|
// 切換 D+ Relay to Precharge Relay
|
|
|
if (isPrechargeStatus_ccs(gun_index) == 39 || isPrechargeStatus_ccs(gun_index) == 40) {
|
|
|
if (chargingInfo[gun_index]->RelayKPK2Status == YES && chargingInfo[gun_index]->PrechargeStatus != PRECHARGE_READY)
|
|
|
//if (chargingInfo[gun_index]->PrechargeStatus != PRECHARGE_PRERELAY_PASS)
|
|
|
{
|
|
|
- PRINTF_FUNC("Send precharge ready 1..........%x, status = %d \n", gun_index, isPrechargeStatus_ccs(gun_index));
|
|
|
+ //PRINTF_FUNC("Send precharge ready 1..........%x, status = %d \n", gun_index, isPrechargeStatus_ccs(gun_index));
|
|
|
+ if (isPrechargeStatus_ccs(gun_index) == 39) {
|
|
|
+ PRINTF_FUNC("Conn %x, Precharge ready, CCS status = PreChargeResponse (%d) \n", gun_index, isPrechargeStatus_ccs(gun_index));
|
|
|
+ } else if (isPrechargeStatus_ccs(gun_index) == 40) {
|
|
|
+ PRINTF_FUNC("Conn %x, Precharge ready, CCS status = PowerDeliveryRequest start (%d) \n", gun_index, isPrechargeStatus_ccs(gun_index));
|
|
|
+ }
|
|
|
+
|
|
|
chargingInfo[gun_index]->PrechargeStatus = PRECHARGE_READY;
|
|
|
}
|
|
|
} else if (isPrechargeStatus_ccs(gun_index) == 45 || isPrechargeStatus_ccs(gun_index) == 46) {
|
|
@@ -5351,10 +5556,22 @@ int main(void)
|
|
|
}
|
|
|
|
|
|
if (isEvBoardStopChargeFlag(gun_index) == YES) {
|
|
|
- // 板端要求停止
|
|
|
+ // 板端要求停止 (錯誤)
|
|
|
+ ChargingAlarmProcess(gun_index);
|
|
|
+ } else if (isEvBoardNormalStopChargeFlag(gun_index) == YES) {
|
|
|
+ // 板端要求停止 (正常)
|
|
|
+ ChargingTerminalProcess(gun_index);
|
|
|
+ } else if (OcppRemoteStop(gun_index) == YES ||
|
|
|
+ WifiScheduleStop(gun_index)) {
|
|
|
+ // 後臺要求停止
|
|
|
ChargingTerminalProcess(gun_index);
|
|
|
}
|
|
|
|
|
|
+ //if (isEvBoardStopChargeFlag(gun_index) == YES) {
|
|
|
+ // // 板端要求停止
|
|
|
+ // ChargingTerminalProcess(gun_index);
|
|
|
+ //}
|
|
|
+
|
|
|
// 等待小板通知進入充電
|
|
|
// 切換 D+ Relay to Precharge Relay
|
|
|
if (chargingInfo[gun_index]->RelayK1K2Status == YES) {
|