Skip to content

Commit

Permalink
added plug in timeout within evse manager and OCPP1.6
Browse files Browse the repository at this point in the history
Signed-off-by: pietfried <[email protected]>
  • Loading branch information
Pietfried committed Sep 18, 2023
1 parent 6dbc144 commit 460c2ff
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RISE-V2G:
# OCPP
libocpp:
git: https://github.com/EVerest/libocpp.git
git_tag: v0.8.7
git_tag: 0278eeb
# Josev
Josev:
git: https://github.com/EVerest/ext-switchev-iso15118.git
Expand Down
1 change: 1 addition & 0 deletions modules/Auth/lib/AuthHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ void AuthHandler::handle_session_event(const int connector_id, const SessionEven
->timeout_timer.timeout(
[this, connector_id]() {
EVLOG_info << "Plug In timeout for connector#" << connector_id;
this->withdraw_authorization_callback(this->connectors.at(connector_id)->evse_index);
{
std::lock_guard<std::mutex> lk(this->plug_in_queue_mutex);
this->plug_in_queue.remove_if([connector_id](int value) { return value == connector_id; });
Expand Down
4 changes: 3 additions & 1 deletion modules/EvseManager/Charger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,8 +1161,10 @@ bool Charger::DeAuthorize() {

// We can safely remove auth as it is not in use right now
std::lock_guard<std::recursive_mutex> lock(configMutex);
if (!authorized)
if (!authorized) {
signalEvent(types::evse_manager::SessionEventEnum::PluginTimeout);
return false;
}
authorized = false;
stopSession();
return true;
Expand Down
2 changes: 2 additions & 0 deletions modules/OCPP/OCPP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ void OCPP::init() {
} else if (event == "ReservationEnd") {
this->charge_point->on_reservation_end(connector);
} else if (event == "ReservationAuthtokenMismatch") {
} else if (event == "PluginTimeout") {
this->charge_point->on_plugin_timeout(connector);
}
});

Expand Down
2 changes: 2 additions & 0 deletions types/evse_manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ types:
ReservationEnd: Signaled when a reservation ends
ReplugStarted: Signaled when the EVSE Manager virtually replugs without interrupting the session or transaction
ReplugFinished: Signaled when the virtual replug process has finished
PluginTimeout: Signaled when an EV has been Plugged in but no authorization is present within specified ConnectionTimeout
type: string
enum:
- Enabled
Expand All @@ -132,6 +133,7 @@ types:
- ReservationEnd
- ReplugStarted
- ReplugFinished
- PluginTimeout
SessionStarted:
description: Data for the SessionStarted event
type: object
Expand Down

0 comments on commit 460c2ff

Please sign in to comment.