From d042629d7f8f3177e1cae6519f243c9c59864054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piet=20G=C3=B6mpel?= <37657534+Pietfried@users.noreply.github.com> Date: Thu, 14 Nov 2024 08:29:42 +0100 Subject: [PATCH] Use transaction BecomeAvailable when stopping transactions also when this->status->get_state(connector) == ChargePointStatus::Faulted since the internal state of the state machine could be other then Faulted, which would lead to an unspecified transaction not moving back to Available (#865) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Piet Gömpel --- lib/ocpp/v16/charge_point_impl.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/ocpp/v16/charge_point_impl.cpp b/lib/ocpp/v16/charge_point_impl.cpp index 05ab20ab5..639d3c33a 100644 --- a/lib/ocpp/v16/charge_point_impl.cpp +++ b/lib/ocpp/v16/charge_point_impl.cpp @@ -4084,11 +4084,8 @@ void ChargePointImpl::on_session_started(int32_t connector, const std::string& s } void ChargePointImpl::on_session_stopped(const int32_t connector, const std::string& session_id) { - // TODO(piet) fix this when evse manager signals clearance of an error - if (this->status->get_state(connector) == ChargePointStatus::Faulted) { - this->status->submit_event(connector, FSMEvent::I1_ReturnToAvailable, ocpp::DateTime()); - } else if (this->status->get_state(connector) != ChargePointStatus::Reserved && - this->status->get_state(connector) != ChargePointStatus::Unavailable) { + if (this->status->get_state(connector) != ChargePointStatus::Reserved && + this->status->get_state(connector) != ChargePointStatus::Unavailable) { this->status->submit_event(connector, FSMEvent::BecomeAvailable, ocpp::DateTime()); }