|
@@ -5556,6 +5556,20 @@ int main(void)
|
|
|
//==========================================
|
|
|
checkUnlocker(gun_index);
|
|
|
|
|
|
+ //==========================================
|
|
|
+ // Clean EVCCID timeout flag
|
|
|
+ //==========================================
|
|
|
+ if((ShmSysConfigAndInfo->SysConfig.isAuthrizeByEVCCID && (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_ENABLE)) &&
|
|
|
+ (ShmCharger->isCcsEnable) &&
|
|
|
+ (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A))
|
|
|
+ {
|
|
|
+ for(int gun_index = 0;gun_index<AC_QUANTITY;gun_index++)
|
|
|
+ {
|
|
|
+ ShmCharger->gun_info[gun_index].isGetEvCCIDTimeout = OFF;
|
|
|
+ ShmCharger->gun_info[gun_index].isEvCCIDAuthorizeFail = NO;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//==========================================
|
|
|
// Check Local Power Sharing Communication
|
|
|
//==========================================
|
|
@@ -5573,6 +5587,36 @@ int main(void)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //==========================================
|
|
|
+ // Clean isRemoteStartWait flag
|
|
|
+ //==========================================
|
|
|
+ if(ocpp_get_isRemoteStartWait())
|
|
|
+ {
|
|
|
+ if(ShmCharger->gun_info[gun_index].isRemoteStartWait == OFF)
|
|
|
+ {
|
|
|
+ ShmCharger->gun_info[gun_index].isRemoteStartWait = ON;
|
|
|
+ DEBUG_INFO("Remote start without connector id... \n");
|
|
|
+ }
|
|
|
+
|
|
|
+ refreshStartTimer(&startTime[gun_index][TMR_IDX_CLEAN_REMOTE_START_WAIT]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if((getDiffSecNow(startTime[gun_index][TMR_IDX_CLEAN_REMOTE_START_WAIT]) > 5))
|
|
|
+ {
|
|
|
+ if(ShmCharger->gun_info[gun_index].isRemoteStartWait == ON)
|
|
|
+ {
|
|
|
+ ShmCharger->gun_info[gun_index].isRemoteStartWait = OFF;
|
|
|
+ DEBUG_INFO("Clean isRemoteStartWait flag... \n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if((getDiffSecNow(startTime[gun_index][TMR_IDX_CLEAN_REMOTE_START_WAIT]) > 10))
|
|
|
+ {
|
|
|
+ refreshStartTimer(&startTime[gun_index][TMR_IDX_CLEAN_REMOTE_START_WAIT]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//==========================================
|
|
|
// Connector process
|
|
|
//==========================================
|
|
@@ -5760,7 +5804,9 @@ int main(void)
|
|
|
ShmSysConfigAndInfo->SysConfig.isAuthrizeByEVCCID &&
|
|
|
ShmCharger->isCcsEnable &&
|
|
|
(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_B) &&
|
|
|
- !ShmCharger->gun_info[gun_index].isGetEvCCIDTimeout)
|
|
|
+ !ShmCharger->gun_info[gun_index].isGetEvCCIDTimeout &&
|
|
|
+ !ShmCharger->gun_info[gun_index].isRemoteStartWait &&
|
|
|
+ !ShmCharger->gun_info[gun_index].isEvCCIDAuthorizeFail)
|
|
|
{
|
|
|
if(!getRequest(gun_index))
|
|
|
{
|
|
@@ -5957,19 +6003,24 @@ int main(void)
|
|
|
(!ocpp_get_connection_status() && (isValidLocalWhiteCard() == PASS) && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_LOCALLIST)))
|
|
|
{
|
|
|
memcpy((char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId, ShmSysConfigAndInfo->SysConfig.UserId, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.UserId));
|
|
|
-
|
|
|
+ ShmCharger->gun_info[gun_index].resultAuthorization = VALIDATED_RFID;
|
|
|
DEBUG_INFO("Authorize pass.\n");
|
|
|
setSpeaker(ON, SPEAKER_SHORT);
|
|
|
setLedMotion(gun_index, LED_ACTION_RFID_PASS);
|
|
|
setChargerMode(gun_index, SYS_MODE_PREPARING);
|
|
|
+ ShmCharger->gun_info[gun_index].isEvCCIDAuthorizeFail = NO;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ ShmCharger->gun_info[gun_index].resultAuthorization = UNVALIDATED_RFID;
|
|
|
DEBUG_INFO("Authorize fail.\n");
|
|
|
setSpeaker(ON, SPEAKER_INTERVAL_3COUNT);
|
|
|
setLedMotion(gun_index, LED_ACTION_RFID_FAIL);
|
|
|
sleep(3);
|
|
|
setChargerMode(gun_index, SYS_MODE_IDLE);
|
|
|
+ ShmCharger->gun_info[gun_index].isEvCCIDAuthorizeFail = YES;
|
|
|
+ ShmCharger->gun_info[gun_index].acCcsInfo.ChargingPermission = OFF;
|
|
|
+ ShmCharger->gun_info[gun_index].acCcsInfo.EVSENotification = NOTIFICATION_STOP;
|
|
|
}
|
|
|
|
|
|
ocpp_set_auth_conf(OFF);
|