Merge pull request #74 from SwitchEV/fix/terminate_session_meter_receipt_res

Fix: Terminate session after Metering Receipt when requesting STOP Charging.
This commit is contained in:
Marc Mültin 2021-11-16 16:04:30 -08:00 committed by GitHub
commit 7d89c9a15c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -99,6 +99,13 @@ public class WaitForMeteringReceiptRes extends ClientState {
return getSendMessage(getCurrentDemandReq(), V2GMessages.CURRENT_DEMAND_RES);
}
} else {
/* Check if the EV controller triggered a pause of a charging session.
* If not, indicate a termination of the charging session. This will be
* evaluated in the state WaitForPowerDeliveryRes
*/
if (getCommSessionContext().getChargingSession() == null)
getCommSessionContext().setChargingSession(ChargingSessionType.TERMINATE);
return getSendMessage(getPowerDeliveryReq(ChargeProgressType.STOP),
V2GMessages.POWER_DELIVERY_RES,
" (ChargeProgress = STOP_CHARGING)");