Skip to content

Commit

Permalink
OCPP2.0.1: Initiate TransactionEvent(Updated) when Deauthorized and T…
Browse files Browse the repository at this point in the history
…xStopPoint==[EVConnected] (#704)

* initiate TransactionEvent(Updated) when Transaction is deauthorized but not yet stopped - e.g. when TxStopPoint is EVConnected.
---------

Signed-off-by: pietfried <[email protected]>
  • Loading branch information
Pietfried authored Jun 3, 2024
1 parent fd34de7 commit 498478a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modules/OCPP201/OCPP201.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ void OCPP201::process_session_finished(const int32_t evse_id, const int32_t conn
auto transaction_data = this->transaction_handler->get_transaction_data(evse_id);
if (transaction_data != nullptr) {
transaction_data->charging_state = ocpp::v201::ChargingStateEnum::Idle;
transaction_data->stop_reason = ocpp::v201::ReasonEnum::EVDisconnected;
}
const auto tx_event_effect = this->transaction_handler->submit_event(evse_id, TxEvent::EV_DISCONNECTED);
this->process_tx_event_effect(evse_id, tx_event_effect, session_event);
Expand Down Expand Up @@ -789,6 +790,16 @@ void OCPP201::process_transaction_finished(const int32_t evse_id, const int32_t
}
const auto tx_event_effect = this->transaction_handler->submit_event(evse_id, tx_event);
this->process_tx_event_effect(evse_id, tx_event_effect, session_event);

if (tx_event == TxEvent::DEAUTHORIZED) {
if (reason == ocpp::v201::ReasonEnum::Remote) {
this->charge_point->on_charging_state_changed(evse_id, ocpp::v201::ChargingStateEnum::EVConnected,
ocpp::v201::TriggerReasonEnum::RemoteStop);
} else {
this->charge_point->on_charging_state_changed(evse_id, ocpp::v201::ChargingStateEnum::EVConnected,
ocpp::v201::TriggerReasonEnum::StopAuthorized);
}
}
}

void OCPP201::process_charging_started(const int32_t evse_id, const int32_t connector_id,
Expand Down

0 comments on commit 498478a

Please sign in to comment.