From 9aa57659a38f644dce7d986f1319cbe24fa0526f Mon Sep 17 00:00:00 2001 From: "Maaike Zijderveld, Alfen" Date: Tue, 11 Jul 2023 15:07:58 +0200 Subject: [PATCH] Remote unlock connector: Implement Signed-off-by: Maaike Zijderveld, Alfen --- include/ocpp/v201/charge_point.hpp | 5 +++++ lib/ocpp/v201/charge_point.cpp | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/include/ocpp/v201/charge_point.hpp b/include/ocpp/v201/charge_point.hpp index 835ec2aac3..6ad6d363d3 100644 --- a/include/ocpp/v201/charge_point.hpp +++ b/include/ocpp/v201/charge_point.hpp @@ -31,6 +31,7 @@ #include #include #include +#include namespace ocpp { namespace v201 { @@ -42,6 +43,7 @@ struct Callbacks { std::function pause_charging_callback; std::function change_availability_callback; std::function get_log_request_callback; + std::function unlock_connector_callback; }; /// \brief Class implements OCPP2.0.1 Charging Station @@ -136,6 +138,9 @@ class ChargePoint : ocpp::ChargingStationBase { void handle_start_transaction_event_response(CallResult call_result, const int32_t evse_id); + // Function Block F: Remote transaction control + void handle_unlock_connector(Call call); + // Functional Block G: Availability void handle_change_availability_req(Call call); diff --git a/lib/ocpp/v201/charge_point.cpp b/lib/ocpp/v201/charge_point.cpp index 3492df4f06..de0b020a2f 100644 --- a/lib/ocpp/v201/charge_point.cpp +++ b/lib/ocpp/v201/charge_point.cpp @@ -776,6 +776,13 @@ void ChargePoint::handle_start_transaction_event_response(CallResult call) { + const UnlockConnectorRequest& msg = call.msg; + const UnlockConnectorResponse unlock_response = callbacks.unlock_connector_callback(msg.evseId, msg.connectorId); + ocpp::CallResult call_result(unlock_response, call.uniqueId); + this->send(call_result); +} + void ChargePoint::handle_change_availability_req(Call call) { const auto msg = call.msg; ChangeAvailabilityResponse response;