Skip to content

Commit

Permalink
Use transaction BecomeAvailable when stopping transactions also when …
Browse files Browse the repository at this point in the history
…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)

Signed-off-by: Piet Gömpel <[email protected]>
  • Loading branch information
Pietfried authored Nov 14, 2024
1 parent 49e0596 commit d042629
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/ocpp/v16/charge_point_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down

0 comments on commit d042629

Please sign in to comment.