Skip to content

Commit d042629

Browse files
authored
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)
Signed-off-by: Piet Gömpel <pietgoempel@gmail.com>
1 parent 49e0596 commit d042629

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/ocpp/v16/charge_point_impl.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -4084,11 +4084,8 @@ void ChargePointImpl::on_session_started(int32_t connector, const std::string& s
40844084
}
40854085

40864086
void ChargePointImpl::on_session_stopped(const int32_t connector, const std::string& session_id) {
4087-
// TODO(piet) fix this when evse manager signals clearance of an error
4088-
if (this->status->get_state(connector) == ChargePointStatus::Faulted) {
4089-
this->status->submit_event(connector, FSMEvent::I1_ReturnToAvailable, ocpp::DateTime());
4090-
} else if (this->status->get_state(connector) != ChargePointStatus::Reserved &&
4091-
this->status->get_state(connector) != ChargePointStatus::Unavailable) {
4087+
if (this->status->get_state(connector) != ChargePointStatus::Reserved &&
4088+
this->status->get_state(connector) != ChargePointStatus::Unavailable) {
40924089
this->status->submit_event(connector, FSMEvent::BecomeAvailable, ocpp::DateTime());
40934090
}
40944091

0 commit comments

Comments
 (0)