10#include <ocpp/common/message_dispatcher.hpp>
12#include <ocpp/common/charging_station_base.hpp>
14#include <ocpp/v2/average_meter_values.hpp>
15#include <ocpp/v2/charge_point_callbacks.hpp>
16#include <ocpp/v2/ocpp_enums.hpp>
17#include <ocpp/v2/ocpp_types.hpp>
18#include <ocpp/v2/ocsp_updater.hpp>
19#include <ocpp/v2/types.hpp>
20#include <ocpp/v2/utils.hpp>
22#include <ocpp/v2/messages/Authorize.hpp>
23#include <ocpp/v2/messages/DataTransfer.hpp>
24#include <ocpp/v2/messages/Get15118EVCertificate.hpp>
25#include <ocpp/v2/messages/GetCompositeSchedule.hpp>
27#include "component_state_manager.hpp"
32class AuthorizationInterface;
33class AvailabilityInterface;
34class DataTransferInterface;
35class DiagnosticsInterface;
36class DisplayMessageInterface;
37class FirmwareUpdateInterface;
38class MeterValuesInterface;
39class ProvisioningInterface;
40class RemoteTransactionControlInterface;
41class ReservationInterface;
42class SecurityInterface;
43class SmartChargingInterface;
44class TariffAndCostInterface;
45class TransactionInterface;
49class DeviceModelStorageInterface;
52struct FunctionalBlockContext;
55 using std::runtime_error::runtime_error;
67 virtual void start(BootReasonEnum bootreason = BootReasonEnum::PowerUp,
bool start_connecting =
true) = 0;
77 virtual void connect_websocket(std::optional<int32_t> network_profile_slot = std::nullopt) = 0;
105 const FirmwareStatusEnum& firmware_update_status) = 0;
131 const DateTime& timestamp,
const TriggerReasonEnum trigger_reason,
132 const MeterValue& meter_start,
const std::optional<IdToken>& id_token,
133 const std::optional<IdToken>& group_id_token,
const std::optional<int32_t>& reservation_id,
134 const std::optional<int32_t>& remote_start_id,
const ChargingStateEnum charging_state) = 0;
145 const ReasonEnum reason,
const TriggerReasonEnum trigger_reason,
146 const std::optional<IdToken>& id_token,
147 const std::optional<std::string>& signed_meter_value,
148 const ChargingStateEnum charging_state) = 0;
165 virtual void on_unavailable(
const int32_t evse_id,
const int32_t connector_id) = 0;
169 virtual void on_enabled(
const int32_t evse_id,
const int32_t connector_id) = 0;
174 virtual void on_faulted(
const int32_t evse_id,
const int32_t connector_id) = 0;
184 virtual void on_reserved(
const int32_t evse_id,
const int32_t connector_id) = 0;
198 const TriggerReasonEnum trigger_reason = TriggerReasonEnum::ChargingStateChanged) = 0;
207 virtual void on_event(
const std::vector<EventData>& events) = 0;
229 const std::optional<bool>& critical = std::nullopt,
230 const std::optional<DateTime>& timestamp = std::nullopt) = 0;
252 const std::optional<std::vector<OCSPRequestData>>& ocsp_request_data) = 0;
261 const std::optional<json>& data) = 0;
278 virtual std::vector<GetVariableResult>
279 get_variables(
const std::vector<GetVariableData>& get_variable_data_vector) = 0;
285 virtual std::map<SetVariableData, SetVariableResult>
286 set_variables(
const std::vector<SetVariableData>& set_variable_data_vector,
const std::string& source) = 0;
301 ChargingRateUnitEnum unit) = 0;
310 const ChargingRateUnitEnum& unit) = 0;
316 virtual std::optional<NetworkConnectionProfile>
337 std::shared_ptr<DeviceModel> device_model;
338 std::unique_ptr<EvseManager> evse_manager;
339 std::unique_ptr<ConnectivityManager> connectivity_manager;
341 std::unique_ptr<MessageDispatcherInterface<MessageType>> message_dispatcher;
344 std::unique_ptr<FunctionalBlockContext> functional_block_context;
345 std::unique_ptr<DataTransferInterface> data_transfer;
346 std::unique_ptr<ReservationInterface> reservation;
347 std::unique_ptr<AvailabilityInterface> availability;
348 std::unique_ptr<AuthorizationInterface> authorization;
349 std::unique_ptr<DiagnosticsInterface> diagnostics;
350 std::unique_ptr<SecurityInterface> security;
351 std::unique_ptr<DisplayMessageInterface> display_message;
352 std::unique_ptr<FirmwareUpdateInterface> firmware_update;
353 std::unique_ptr<MeterValuesInterface> meter_values;
354 std::unique_ptr<SmartChargingInterface> smart_charging;
355 std::unique_ptr<TariffAndCostInterface> tariff_and_cost;
356 std::unique_ptr<TransactionInterface> transaction;
357 std::unique_ptr<ProvisioningInterface> provisioning;
358 std::unique_ptr<RemoteTransactionControlInterface> remote_transaction_control;
361 std::shared_ptr<MessageQueue<v2::MessageType>> message_queue;
362 std::shared_ptr<DatabaseHandler> database_handler;
365 std::atomic<RegistrationStatusEnum> registration_status;
366 std::atomic<UploadLogStatusEnum> upload_log_status;
367 std::atomic<int32_t> upload_log_status_id;
368 BootReasonEnum bootreason;
369 bool skip_invalid_csms_certificate_notifications;
372 std::shared_ptr<ComponentStateManagerInterface> component_state_manager;
375 struct EvseConnectorPair {
377 int32_t connector_id;
380 bool operator<(
const EvseConnectorPair& other)
const {
382 if (evse_id != other.evse_id) {
383 return evse_id < other.evse_id;
385 return connector_id < other.connector_id;
389 std::chrono::time_point<std::chrono::steady_clock> time_disconnected;
398 std::chrono::seconds message_queue_resume_delay = std::chrono::seconds(0);
401 void initialize(
const std::map<int32_t, int32_t>& evse_connector_structure,
const std::string& message_log_path);
402 void websocket_connected_callback(
const int configuration_slot,
404 void websocket_disconnected_callback(
const int configuration_slot,
406 void websocket_connection_failed(ConnectionFailedReason reason);
407 void update_dm_availability_state(
const int32_t evse_id,
const int32_t connector_id,
408 const ConnectorStatusEnum status);
410 void message_callback(
const std::string& message);
418 void configure_message_logging_format(
const std::string& message_log_path);
425 template <
class RequestType,
class ResponseType>
426 std::function<ResponseType(RequestType)> send_callback(MessageType expected_response_message_type) {
427 return [
this, expected_response_message_type](
auto request) {
428 const auto enhanced_response =
430 if (enhanced_response.messageType != expected_response_message_type) {
432 std::string(
"Got unexpected message type from CSMS, expected: ") +
433 conversions::messagetype_to_string(expected_response_message_type) +
434 ", got: " + conversions::messagetype_to_string(enhanced_response.messageType));
437 return call_result.msg;
443 void clear_invalid_charging_profiles();
462 ChargePoint(
const std::map<int32_t, int32_t>& evse_connector_structure, std::shared_ptr<DeviceModel> device_model,
463 std::shared_ptr<DatabaseHandler> database_handler,
465 const std::shared_ptr<EvseSecurity> evse_security,
const Callbacks& callbacks);
477 ChargePoint(
const std::map<int32_t, int32_t>& evse_connector_structure,
478 std::unique_ptr<DeviceModelStorageInterface> device_model_storage_interface,
479 const std::string& ocpp_main_path,
const std::string& core_database_path,
480 const std::string& sql_init_path,
const std::string& message_log_path,
481 const std::shared_ptr<EvseSecurity> evse_security,
const Callbacks& callbacks);
497 ChargePoint(
const std::map<int32_t, int32_t>& evse_connector_structure,
498 const std::string& device_model_storage_address,
const bool initialize_device_model,
499 const std::string& device_model_migration_path,
const std::string& device_model_config_path,
500 const std::string& ocpp_main_path,
const std::string& core_database_path,
501 const std::string& sql_init_path,
const std::string& message_log_path,
502 const std::shared_ptr<EvseSecurity> evse_security,
const Callbacks& callbacks);
510 void start(BootReasonEnum bootreason = BootReasonEnum::PowerUp,
bool start_connecting =
true)
override;
512 void stop()
override;
514 void connect_websocket(std::optional<int32_t> network_profile_slot = std::nullopt)
override;
520 const FirmwareStatusEnum& firmware_update_status)
override;
527 void on_transaction_started(
const int32_t evse_id,
const int32_t connector_id,
const std::string& session_id,
528 const DateTime& timestamp,
const TriggerReasonEnum trigger_reason,
529 const MeterValue& meter_start,
const std::optional<IdToken>& id_token,
530 const std::optional<IdToken>& group_id_token,
531 const std::optional<int32_t>& reservation_id,
532 const std::optional<int32_t>& remote_start_id,
533 const ChargingStateEnum charging_state)
override;
536 const ReasonEnum reason,
const TriggerReasonEnum trigger_reason,
537 const std::optional<IdToken>& id_token,
538 const std::optional<std::string>& signed_meter_value,
539 const ChargingStateEnum charging_state)
override;
543 void on_authorized(
const int32_t evse_id,
const int32_t connector_id,
const IdToken& id_token)
override;
547 void on_unavailable(
const int32_t evse_id,
const int32_t connector_id)
override;
549 void on_enabled(
const int32_t evse_id,
const int32_t connector_id)
override;
551 void on_faulted(
const int32_t evse_id,
const int32_t connector_id)
override;
553 void on_fault_cleared(
const int32_t evse_id,
const int32_t connector_id)
override;
555 void on_reserved(
const int32_t evse_id,
const int32_t connector_id)
override;
560 const uint32_t evse_id,
const ChargingStateEnum charging_state,
561 const TriggerReasonEnum trigger_reason = TriggerReasonEnum::ChargingStateChanged)
override;
566 const std::optional<std::vector<OCSPRequestData>>& ocsp_request_data)
override;
568 void on_event(
const std::vector<EventData>& events)
override;
573 const std::optional<bool>& critical = std::nullopt,
574 const std::optional<DateTime>& timestamp = std::nullopt)
override;
578 void on_reservation_status(
const int32_t reservation_id,
const ReservationUpdateStatusEnum status)
override;
582 const std::optional<json>& data)
override;
587 this->message_queue_resume_delay = delay;
590 std::vector<GetVariableResult>
get_variables(
const std::vector<GetVariableData>& get_variable_data_vector)
override;
592 std::map<SetVariableData, SetVariableResult>
593 set_variables(
const std::vector<SetVariableData>& set_variable_data_vector,
const std::string& source)
override;
596 ChargingRateUnitEnum unit)
override;
598 const ChargingRateUnitEnum& unit)
override;
600 std::optional<NetworkConnectionProfile>
607 void send_not_implemented_error(
const MessageId unique_message_id,
const MessageTypeId message_type_id);
617 template <
typename T>
619 const AttributeEnum& attribute_enum) {
620 return this->device_model->request_value<T>(component_id, variable_id, attribute_enum);
Common base class for OCPP1.6 and OCPP2.0.1 charging stations.
Definition: charging_station_base.hpp:16
Contains a DateTime implementation that can parse and create RFC 3339 compatible strings.
Definition: types.hpp:109
Contains a MessageId implementation based on a case insensitive string with a maximum length of 36 pr...
Definition: call_types.hpp:34
Interface class for OCPP2.0.1 Charging Station.
Definition: charge_point.hpp:59
virtual void connect_websocket(std::optional< int32_t > network_profile_slot=std::nullopt)=0
Initializes the websocket and connects to a CSMS. Provide a network_profile_slot to connect to that s...
virtual std::optional< DataTransferResponse > data_transfer_req(const DataTransferRequest &request)=0
Data transfer mechanism initiated by charger.
virtual void start(BootReasonEnum bootreason=BootReasonEnum::PowerUp, bool start_connecting=true)=0
Starts the ChargePoint, initializes and connects to the Websocket endpoint.
virtual void disconnect_websocket()=0
Disconnects the the websocket connection to the CSMS if it is connected.
virtual void stop()=0
Stops the ChargePoint. Disconnects the websocket connection and stops MessageQueue and all timers.
virtual std::vector< GetVariableResult > get_variables(const std::vector< GetVariableData > &get_variable_data_vector)=0
Gets variables specified within get_variable_data_vector from the device model and returns the result...
virtual std::optional< NetworkConnectionProfile > get_network_connection_profile(const int32_t configuration_slot) const =0
Gets the configured NetworkConnectionProfile based on the given configuration_slot ....
virtual GetCompositeScheduleResponse get_composite_schedule(const GetCompositeScheduleRequest &request)=0
Gets a composite schedule based on the given request.
virtual void set_message_queue_resume_delay(std::chrono::seconds delay)=0
Delay draining the message queue after reconnecting, so the CSMS can perform post-reconnect checks fi...
virtual std::map< SetVariableData, SetVariableResult > set_variables(const std::vector< SetVariableData > &set_variable_data_vector, const std::string &source)=0
Sets variables specified within set_variable_data_vector in the device model and returns the result.
virtual const std::vector< int > & get_network_connection_slots() const =0
Get the network connection slots sorted by priority. Each item in the vector contains the configured ...
virtual std::optional< int > get_priority_from_configuration_slot(const int configuration_slot) const =0
Get the priority of the given configuration slot.
virtual AuthorizeResponse validate_token(const IdToken id_token, const std::optional< CiString< 5500 > > &certificate, const std::optional< std::vector< OCSPRequestData > > &ocsp_request_data)=0
Validates provided id_token certificate and ocsp_request_data using CSMS, AuthCache or AuthList.
virtual std::vector< CompositeSchedule > get_all_composite_schedules(const int32_t duration, const ChargingRateUnitEnum &unit)=0
Gets composite schedules for all evse_ids (including 0) for the given duration and unit ....
virtual std::optional< DataTransferResponse > data_transfer_req(const CiString< 255 > &vendorId, const std::optional< CiString< 50 > > &messageId, const std::optional< json > &data)=0
Data transfer mechanism initiated by charger.
virtual std::optional< CompositeSchedule > get_composite_schedule(int32_t evse_id, std::chrono::seconds duration, ChargingRateUnitEnum unit)=0
Gets a composite schedule based on the given parameters.
Class implements OCPP2.0.1 Charging Station.
Definition: charge_point.hpp:334
void on_log_status_notification(UploadLogStatusEnum status, int32_t requestId) override
Event handler that can be called to notify about the log status.
Definition: charge_point.cpp:356
void on_reservation_cleared(const int32_t evse_id, const int32_t connector_id) override
Event handler that should be called when the reservation of the connector is cleared.
Definition: charge_point.cpp:309
std::optional< int > get_priority_from_configuration_slot(const int configuration_slot) const override
Get the priority of the given configuration slot.
Definition: charge_point.cpp:1067
void on_unavailable(const int32_t evse_id, const int32_t connector_id) override
Event handler that should be called when the connector on the given evse_id and connector_id becomes ...
Definition: charge_point.cpp:287
void stop() override
Stops the ChargePoint. Disconnects the websocket connection and stops MessageQueue and all timers.
Definition: charge_point.cpp:153
void set_message_queue_resume_delay(std::chrono::seconds delay) override
Delay draining the message queue after reconnecting, so the CSMS can perform post-reconnect checks fi...
Definition: charge_point.hpp:586
std::vector< GetVariableResult > get_variables(const std::vector< GetVariableData > &get_variable_data_vector) override
Gets variables specified within get_variable_data_vector from the device model and returns the result...
Definition: charge_point.cpp:1038
void on_session_started(const int32_t evse_id, const int32_t connector_id) override
Event handler that should be called when a session has started.
Definition: charge_point.cpp:180
virtual void disconnect_websocket() override
Disconnects the the websocket connection to the CSMS if it is connected.
Definition: charge_point.cpp:164
void start(BootReasonEnum bootreason=BootReasonEnum::PowerUp, bool start_connecting=true) override
Starts the ChargePoint, initializes and connects to the Websocket endpoint.
Definition: charge_point.cpp:110
void on_meter_value(const int32_t evse_id, const MeterValue &meter_value) override
Event handler that should be called when a new meter value is present.
Definition: charge_point.cpp:235
void on_transaction_finished(const int32_t evse_id, const DateTime ×tamp, const MeterValue &meter_stop, const ReasonEnum reason, const TriggerReasonEnum trigger_reason, const std::optional< IdToken > &id_token, const std::optional< std::string > &signed_meter_value, const ChargingStateEnum charging_state) override
Event handler that should be called when a transaction has finished.
Definition: charge_point.cpp:200
void on_enabled(const int32_t evse_id, const int32_t connector_id) override
Event handler that should be called when the connector returns from unavailable on the given evse_id ...
Definition: charge_point.cpp:291
void on_firmware_update_status_notification(int32_t request_id, const FirmwareStatusEnum &firmware_update_status) override
Chargepoint notifies about new firmware update status firmware_update_status. This function should be...
Definition: charge_point.cpp:172
void on_fault_cleared(const int32_t evse_id, const int32_t connector_id) override
Event handler that should be called when the fault on the connector on the given evse_id is cleared.
Definition: charge_point.cpp:299
void on_event(const std::vector< EventData > &events) override
Event handler that can be called to trigger a NotifyEvent.req with the given events.
Definition: charge_point.cpp:352
void on_variable_changed(const SetVariableData &set_variable_data) override
Event handler that will update the variable internally when it has been changed on the fly.
Definition: charge_point.cpp:380
Get15118EVCertificateResponse on_get_15118_ev_certificate_request(const Get15118EVCertificateRequest &request) override
Event handler that should be called when the EV sends a certificate request (for update or installati...
Definition: charge_point.cpp:185
void on_faulted(const int32_t evse_id, const int32_t connector_id) override
Event handler that should be called when the connector on the given evse_id and connector_id is fault...
Definition: charge_point.cpp:295
void on_authorized(const int32_t evse_id, const int32_t connector_id, const IdToken &id_token) override
Event handler that should be called when the given id_token is authorized.
Definition: charge_point.cpp:214
std::optional< std::string > get_evse_transaction_id(int32_t evse_id) override
Gets the transaction id for a certain evse_id if there is an active transaction.
Definition: charge_point.cpp:337
std::optional< NetworkConnectionProfile > get_network_connection_profile(const int32_t configuration_slot) const override
Gets the configured NetworkConnectionProfile based on the given configuration_slot ....
Definition: charge_point.cpp:1063
void on_network_disconnected(OCPPInterfaceEnum ocpp_interface) override
Can be called when a network is disconnected, for example when an ethernet cable is removed.
Definition: charge_point.cpp:168
void on_session_finished(const int32_t evse_id, const int32_t connector_id) override
Event handler that should be called when a session has finished.
Definition: charge_point.cpp:210
std::map< SetVariableData, SetVariableResult > set_variables(const std::vector< SetVariableData > &set_variable_data_vector, const std::string &source) override
Sets variables specified within set_variable_data_vector in the device model and returns the result.
Definition: charge_point.cpp:1043
void connect_websocket(std::optional< int32_t > network_profile_slot=std::nullopt) override
Initializes the websocket and connects to a CSMS. Provide a network_profile_slot to connect to that s...
Definition: charge_point.cpp:177
RequestDeviceModelResponse< T > request_value(const Component &component_id, const Variable &variable_id, const AttributeEnum &attribute_enum)
Requests a value of a VariableAttribute specified by combination of component_id and variable_id from...
Definition: charge_point.hpp:618
GetCompositeScheduleResponse get_composite_schedule(const GetCompositeScheduleRequest &request) override
Gets a composite schedule based on the given request.
Definition: charge_point.cpp:1048
void on_reservation_status(const int32_t reservation_id, const ReservationUpdateStatusEnum status) override
Event handler that will send a ReservationStatusUpdate request.
Definition: charge_point.cpp:384
const std::vector< int > & get_network_connection_slots() const override
Get the network connection slots sorted by priority. Each item in the vector contains the configured ...
Definition: charge_point.cpp:1071
void on_transaction_started(const int32_t evse_id, const int32_t connector_id, const std::string &session_id, const DateTime ×tamp, const TriggerReasonEnum trigger_reason, const MeterValue &meter_start, const std::optional< IdToken > &id_token, const std::optional< IdToken > &group_id_token, const std::optional< int32_t > &reservation_id, const std::optional< int32_t > &remote_start_id, const ChargingStateEnum charging_state) override
Event handler that should be called when a transaction has started.
Definition: charge_point.cpp:190
AuthorizeResponse validate_token(const IdToken id_token, const std::optional< CiString< 5500 > > &certificate, const std::optional< std::vector< OCSPRequestData > > &ocsp_request_data) override
Validates provided id_token certificate and ocsp_request_data using CSMS, AuthCache or AuthList.
Definition: charge_point.cpp:347
void on_reserved(const int32_t evse_id, const int32_t connector_id) override
Event handler that should be called when the connector on the given evse_id and connector_id is reser...
Definition: charge_point.cpp:303
std::optional< DataTransferResponse > data_transfer_req(const CiString< 255 > &vendorId, const std::optional< CiString< 50 > > &messageId, const std::optional< json > &data) override
Data transfer mechanism initiated by charger.
Definition: charge_point.cpp:907
std::vector< CompositeSchedule > get_all_composite_schedules(const int32_t duration, const ChargingRateUnitEnum &unit) override
Gets composite schedules for all evse_ids (including 0) for the given duration and unit ....
Definition: charge_point.cpp:1057
bool on_charging_state_changed(const uint32_t evse_id, const ChargingStateEnum charging_state, const TriggerReasonEnum trigger_reason=TriggerReasonEnum::ChargingStateChanged) override
Event handler that will update the charging state internally when it has been changed.
Definition: charge_point.cpp:315
void on_security_event(const CiString< 50 > &event_type, const std::optional< CiString< 255 > > &tech_info, const std::optional< bool > &critical=std::nullopt, const std::optional< DateTime > ×tamp=std::nullopt) override
Definition: charge_point.cpp:369
Definition: ocsp_updater.hpp:55
Definition: charge_point.hpp:54
ChargePoint(const std::map< int32_t, int32_t > &evse_connector_structure, std::shared_ptr< DeviceModel > device_model, std::shared_ptr< DatabaseHandler > database_handler, std::shared_ptr< MessageQueue< v2::MessageType > > message_queue, const std::string &message_log_path, const std::shared_ptr< EvseSecurity > evse_security, const Callbacks &callbacks)
Construct a new ChargePoint object.
Definition: charge_point.cpp:50
virtual void on_network_disconnected(OCPPInterfaceEnum ocpp_interface)=0
Can be called when a network is disconnected, for example when an ethernet cable is removed.
virtual Get15118EVCertificateResponse on_get_15118_ev_certificate_request(const Get15118EVCertificateRequest &request)=0
Event handler that should be called when the EV sends a certificate request (for update or installati...
virtual void on_security_event(const CiString< 50 > &event_type, const std::optional< CiString< 255 > > &tech_info, const std::optional< bool > &critical=std::nullopt, const std::optional< DateTime > ×tamp=std::nullopt)=0
virtual std::optional< std::string > get_evse_transaction_id(int32_t evse_id)=0
Gets the transaction id for a certain evse_id if there is an active transaction.
virtual void on_session_finished(const int32_t evse_id, const int32_t connector_id)=0
Event handler that should be called when a session has finished.
virtual bool on_charging_state_changed(const uint32_t evse_id, const ChargingStateEnum charging_state, const TriggerReasonEnum trigger_reason=TriggerReasonEnum::ChargingStateChanged)=0
Event handler that will update the charging state internally when it has been changed.
virtual void on_transaction_finished(const int32_t evse_id, const DateTime ×tamp, const MeterValue &meter_stop, const ReasonEnum reason, const TriggerReasonEnum trigger_reason, const std::optional< IdToken > &id_token, const std::optional< std::string > &signed_meter_value, const ChargingStateEnum charging_state)=0
Event handler that should be called when a transaction has finished.
virtual void on_firmware_update_status_notification(int32_t request_id, const FirmwareStatusEnum &firmware_update_status)=0
Chargepoint notifies about new firmware update status firmware_update_status. This function should be...
virtual void on_session_started(const int32_t evse_id, const int32_t connector_id)=0
Event handler that should be called when a session has started.
virtual void on_reserved(const int32_t evse_id, const int32_t connector_id)=0
Event handler that should be called when the connector on the given evse_id and connector_id is reser...
virtual void on_reservation_cleared(const int32_t evse_id, const int32_t connector_id)=0
Event handler that should be called when the reservation of the connector is cleared.
virtual void on_reservation_status(const int32_t reservation_id, const ReservationUpdateStatusEnum status)=0
Event handler that will send a ReservationStatusUpdate request.
virtual void on_log_status_notification(UploadLogStatusEnum status, int32_t requestId)=0
Event handler that can be called to notify about the log status.
virtual void on_faulted(const int32_t evse_id, const int32_t connector_id)=0
Event handler that should be called when the connector on the given evse_id and connector_id is fault...
virtual void on_enabled(const int32_t evse_id, const int32_t connector_id)=0
Event handler that should be called when the connector returns from unavailable on the given evse_id ...
virtual void on_transaction_started(const int32_t evse_id, const int32_t connector_id, const std::string &session_id, const DateTime ×tamp, const TriggerReasonEnum trigger_reason, const MeterValue &meter_start, const std::optional< IdToken > &id_token, const std::optional< IdToken > &group_id_token, const std::optional< int32_t > &reservation_id, const std::optional< int32_t > &remote_start_id, const ChargingStateEnum charging_state)=0
Event handler that should be called when a transaction has started.
virtual void on_meter_value(const int32_t evse_id, const MeterValue &meter_value)=0
Event handler that should be called when a new meter value is present.
virtual void on_variable_changed(const SetVariableData &set_variable_data)=0
Event handler that will update the variable internally when it has been changed on the fly.
virtual void on_event(const std::vector< EventData > &events)=0
Event handler that can be called to trigger a NotifyEvent.req with the given events.
virtual void on_fault_cleared(const int32_t evse_id, const int32_t connector_id)=0
Event handler that should be called when the fault on the connector on the given evse_id is cleared.
virtual void on_unavailable(const int32_t evse_id, const int32_t connector_id)=0
Event handler that should be called when the connector on the given evse_id and connector_id becomes ...
virtual void on_authorized(const int32_t evse_id, const int32_t connector_id, const IdToken &id_token)=0
Event handler that should be called when the given id_token is authorized.
Contains a OCPP CallResult message.
Definition: call_types.hpp:105
Contains a OCPP Call message.
Definition: call_types.hpp:60
Contains a OCPP message in json form with additional information.
Definition: message_queue.hpp:54
Contains a OCPP AuthorizeResponse message.
Definition: Authorize.hpp:41
Definition: charge_point_callbacks.hpp:22
Definition: ocpp_types.hpp:303
Contains a OCPP DataTransfer message.
Definition: DataTransfer.hpp:19
Contains a OCPP Get15118EVCertificate message.
Definition: Get15118EVCertificate.hpp:20
Contains a OCPP Get15118EVCertificateResponse message.
Definition: Get15118EVCertificate.hpp:42
Contains a OCPP GetCompositeSchedule message.
Definition: GetCompositeSchedule.hpp:19
Contains a OCPP GetCompositeScheduleResponse message.
Definition: GetCompositeSchedule.hpp:41
Definition: ocpp_types.hpp:36
Definition: ocpp_types.hpp:436
Definition: ocpp_types.hpp:831
Response to requesting a value from the device model.
Definition: device_model.hpp:18
Definition: ocpp_types.hpp:898
Definition: ocpp_types.hpp:319