ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
OCPP 2.0.1 callbacks

Callbacks

Callbacks

std::function< bool(const std::optional< const int32_t > evse_id, const ResetEnum &reset_type)> ocpp::v2::Callbacks::is_reset_allowed_callback
 Callback if reset is allowed. If evse_id has a value, reset only applies to the given evse id. If it has no value, applies to complete charging station.
 
std::function< void(const std::optional< const int32_t > evse_id, const ResetEnum &reset_type)> ocpp::v2::Callbacks::reset_callback
 
std::function< RequestStartStopStatusEnum(const int32_t evse_id, const ReasonEnum &stop_reason)> ocpp::v2::Callbacks::stop_transaction_callback
 
std::function< void(const int32_t evse_id)> ocpp::v2::Callbacks::pause_charging_callback
 
std::optional< std::function< void(const OperationalStatusEnum new_status)> > ocpp::v2::Callbacks::cs_effective_operative_status_changed_callback
 Used to notify the user of libocpp that the Operative/Inoperative state of the charging station changed If as a result the state of EVSEs or connectors changed as well, libocpp will additionally call the evse_effective_operative_status_changed_callback once for each EVSE whose status changed, and connector_effective_operative_status_changed_callback once for each connector whose status changed. If left empty, the callback is ignored. More...
 
std::optional< std::function< void(const int32_t evse_id, const OperationalStatusEnum new_status)> > ocpp::v2::Callbacks::evse_effective_operative_status_changed_callback
 Used to notify the user of libocpp that the Operative/Inoperative state of an EVSE changed If as a result the state of connectors changed as well, libocpp will additionally call the connector_effective_operative_status_changed_callback once for each connector whose status changed. If left empty, the callback is ignored. More...
 
std::function< void(const int32_t evse_id, const int32_t connector_id, const OperationalStatusEnum new_status)> ocpp::v2::Callbacks::connector_effective_operative_status_changed_callback
 Used to notify the user of libocpp that the Operative/Inoperative state of a connector changed. More...
 
std::function< GetLogResponse(const GetLogRequest &request)> ocpp::v2::Callbacks::get_log_request_callback
 
std::function< UnlockConnectorResponse(const int32_t evse_id, const int32_t connecor_id)> ocpp::v2::Callbacks::unlock_connector_callback
 
std::function< RequestStartStopStatusEnum(const RequestStartTransactionRequest &request, const bool authorize_remote_start)> ocpp::v2::Callbacks::remote_start_transaction_callback
 
std::function< ocpp::ReservationCheckStatus(const int32_t evse_id, const CiString< 36 > idToken, const std::optional< CiString< 36 > > groupIdToken)> ocpp::v2::Callbacks::is_reservation_for_token_callback
 Check if the current reservation for the given evse id is made for the id token / group id token. More...
 
std::function< UpdateFirmwareResponse(const UpdateFirmwareRequest &request)> ocpp::v2::Callbacks::update_firmware_request_callback
 
std::optional< std::function< void(const SetVariableData &set_variable_data)> > ocpp::v2::Callbacks::variable_changed_callback
 
std::optional< std::function< SetNetworkProfileStatusEnum(const int32_t configuration_slot, const NetworkConnectionProfile &network_connection_profile)> > ocpp::v2::Callbacks::validate_network_profile_callback
 
std::optional< ConfigureNetworkConnectionProfileCallback > ocpp::v2::Callbacks::configure_network_connection_profile_callback
 
std::optional< std::function< void(const ocpp::DateTime &currentTime)> > ocpp::v2::Callbacks::time_sync_callback
 
std::optional< std::function< void(const std::string &message, MessageDirection direction)> > ocpp::v2::Callbacks::ocpp_messages_callback
 callback to be called to configure ocpp message logging
 
std::function< void(const CiString< 50 > &event_type, const std::optional< CiString< 255 > > &tech_info)> ocpp::v2::Callbacks::security_event_callback
 callback function that can be used to react to a security event callback. This callback is called only if the SecurityEvent occured internally within libocpp Typically this callback is used to log security events in the security log
 
std::function< void()> ocpp::v2::Callbacks::set_charging_profiles_callback
 Callback for indicating when a charging profile is received and was accepted.
 
std::optional< std::function< void(const ocpp::v2::BootNotificationResponse &boot_notification_response)> > ocpp::v2::Callbacks::boot_notification_callback
 Callback for when a bootnotification response is received.
 
std::optional< std::function< std::string(const std::optional< CertificateHashDataType > customer_certificate, const std::optional< IdToken > id_token, const std::optional< CiString< 64 > > customer_identifier)> > ocpp::v2::Callbacks::get_customer_information_callback
 Callback function that can be used to get (human readable) customer information based on the given arguments.
 
std::optional< std::function< void(const std::optional< CertificateHashDataType > customer_certificate, const std::optional< IdToken > id_token, const std::optional< CiString< 64 > > customer_identifier)> > ocpp::v2::Callbacks::clear_customer_information_callback
 Callback function that can be called to clear customer information based on the given arguments.
 
std::optional< std::function< void()> > ocpp::v2::Callbacks::all_connectors_unavailable_callback
 Callback function that can be called when all connectors are unavailable.
 
std::optional< std::function< DataTransferResponse(const DataTransferRequest &request)> > ocpp::v2::Callbacks::data_transfer_callback
 Callback function that can be used to handle arbitrary data transfers for all vendorId and messageId.
 
std::optional< std::function< void(const TransactionEventRequest &transaction_event)> > ocpp::v2::Callbacks::transaction_event_callback
 Callback function that is called when a transaction_event was sent to the CSMS.
 
std::optional< std::function< void(const TransactionEventRequest &transaction_event, const TransactionEventResponse &transaction_event_response)> > ocpp::v2::Callbacks::transaction_event_response_callback
 Callback function that is called when a transaction_event_response was received from the CSMS.
 
std::optional< std::function< void(const bool is_connected, const int configuration_slot, const NetworkConnectionProfile &network_connection_profile)> > ocpp::v2::Callbacks::connection_state_changed_callback
 Callback function is called when the websocket connection status changes.
 
std::optional< std::function< std::vector< DisplayMessage >(const GetDisplayMessagesRequest &request)> > ocpp::v2::Callbacks::get_display_message_callback
 Callback functions called for get / set / clear display messages.
 
std::optional< std::function< SetDisplayMessageResponse(const std::vector< DisplayMessage > &display_messages)> > ocpp::v2::Callbacks::set_display_message_callback
 
std::optional< std::function< ClearDisplayMessageResponse(const ClearDisplayMessageRequest &request)> > ocpp::v2::Callbacks::clear_display_message_callback
 
std::optional< std::function< void(const RunningCost &running_cost, const uint32_t number_of_decimals, std::optional< std::string > currency_code)> > ocpp::v2::Callbacks::set_running_cost_callback
 Callback function is called when running cost is set.
 
std::optional< std::function< ReserveNowStatusEnum(const ReserveNowRequest &request)> > ocpp::v2::Callbacks::reserve_now_callback
 Callback function is called when a reservation request is received from the CSMS.
 
std::optional< std::function< bool(const int32_t reservationId)> > ocpp::v2::Callbacks::cancel_reservation_callback
 Callback function is called when a cancel reservation request is received from the CSMS.
 
bool ocpp::v2::Callbacks::all_callbacks_valid (std::shared_ptr< DeviceModel > device_model) const
 Function to check if the callback struct is completely filled. All std::functions should hold a function, all std::optional<std::functions> should either be empty or hold a function. More...
 

Detailed Description

Callbacks will call be called when necessary and must be implemented by the calling class.

Function Documentation

◆ all_callbacks_valid()

bool ocpp::v2::Callbacks::all_callbacks_valid ( std::shared_ptr< DeviceModel device_model) const

Function to check if the callback struct is completely filled. All std::functions should hold a function, all std::optional<std::functions> should either be empty or hold a function.

Parameters
device_modelThe device model, to check if certain modules are enabled / available.
Return values
falseif any of the normal callbacks are nullptr or any of the optional ones are filled with a nullptr true otherwise

Variable Documentation

◆ connector_effective_operative_status_changed_callback

std::function<void(const int32_t evse_id, const int32_t connector_id, const OperationalStatusEnum new_status)> ocpp::v2::Callbacks::connector_effective_operative_status_changed_callback

Used to notify the user of libocpp that the Operative/Inoperative state of a connector changed.

Parameters
evse_idThe id of the EVSE
connector_idThe ID of the connector within the EVSE
new_statusThe operational status the connector switched to

◆ cs_effective_operative_status_changed_callback

std::optional<std::function<void(const OperationalStatusEnum new_status)> > ocpp::v2::Callbacks::cs_effective_operative_status_changed_callback

Used to notify the user of libocpp that the Operative/Inoperative state of the charging station changed If as a result the state of EVSEs or connectors changed as well, libocpp will additionally call the evse_effective_operative_status_changed_callback once for each EVSE whose status changed, and connector_effective_operative_status_changed_callback once for each connector whose status changed. If left empty, the callback is ignored.

Parameters
new_statusThe operational status the CS switched to

◆ evse_effective_operative_status_changed_callback

std::optional<std::function<void(const int32_t evse_id, const OperationalStatusEnum new_status)> > ocpp::v2::Callbacks::evse_effective_operative_status_changed_callback

Used to notify the user of libocpp that the Operative/Inoperative state of an EVSE changed If as a result the state of connectors changed as well, libocpp will additionally call the connector_effective_operative_status_changed_callback once for each connector whose status changed. If left empty, the callback is ignored.

Parameters
evse_idThe id of the EVSE
new_statusThe operational status the EVSE switched to

◆ is_reservation_for_token_callback

std::function<ocpp::ReservationCheckStatus(const int32_t evse_id, const CiString<36> idToken, const std::optional<CiString<36>> groupIdToken)> ocpp::v2::Callbacks::is_reservation_for_token_callback

Check if the current reservation for the given evse id is made for the id token / group id token.

Returns
The reservation check status of this evse / id token.