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

Callbacks

Callbacks

void ocpp::v16::ChargePoint::register_data_transfer_callback (const CiString< 255 > &vendorId, const CiString< 50 > &messageId, const std::function< DataTransferResponse(const std::optional< std::string > &msg)> &callback)
 
void ocpp::v16::ChargePoint::register_data_transfer_callback (const std::function< DataTransferResponse(const DataTransferRequest &request)> &callback)
 
void ocpp::v16::ChargePoint::register_enable_evse_callback (const std::function< bool(int32_t connector)> &callback)
 registers a callback function that can be used to enable the evse. The enable_evse_callback is called when a ChangeAvailaibility.req is received. More...
 
void ocpp::v16::ChargePoint::register_disable_evse_callback (const std::function< bool(int32_t connector)> &callback)
 registers a callback function that can be used to disable the evse. The disable_evse_callback is called when a ChangeAvailaibility.req is received. More...
 
void ocpp::v16::ChargePoint::register_pause_charging_callback (const std::function< bool(int32_t connector)> &callback)
 registers a callback function that can be used to pause charging. The pause_charging_callback is called when the idTagInfo.status of a StartTransaction.conf is not Accepted More...
 
void ocpp::v16::ChargePoint::register_resume_charging_callback (const std::function< bool(int32_t connector)> &callback)
 registers a callback function that can be used to resume charging More...
 
void ocpp::v16::ChargePoint::register_provide_token_callback (const std::function< void(const std::string &id_token, std::vector< int32_t > referenced_connectors, bool prevalidated)> &callback)
 registers a callback function that can be used to provide an id_token for the given referenced_connectors to an authorization handler. prevalidated signals to the authorization handler that no further authorization is necessary. The provide_token_callback is called when a RemoteStartTransaction.req is received. More...
 
void ocpp::v16::ChargePoint::register_stop_transaction_callback (const std::function< bool(int32_t connector, Reason reason)> &callback)
 registers a callback function that can be used to stop a transaction. Ths stop_transaction_callback is called More...
 
void ocpp::v16::ChargePoint::register_reserve_now_callback (const std::function< ReservationStatus(int32_t reservation_id, int32_t connector, ocpp::DateTime expiryDate, CiString< 20 > idTag, std::optional< CiString< 20 > > parent_id)> &callback)
 registers a callback function that can be used to reserve a connector for a idTag until a timeout is reached. The reserve_now_callback is called when a ReserveNow.req is received. More...
 
void ocpp::v16::ChargePoint::register_cancel_reservation_callback (const std::function< bool(int32_t reservation_id)> &callback)
 registers a callback function that can be used to cancel a reservation on a connector. Callback function should return false if the reservation could not be cancelled, else true . The cancel_reservation_callback is called when a CancelReservation.req is received More...
 
void ocpp::v16::ChargePoint::register_unlock_connector_callback (const std::function< UnlockStatus(int32_t connector)> &callback)
 registers a callback function that can be used to unlock the connector. In case a transaction is More...
 
void ocpp::v16::ChargePoint::register_upload_diagnostics_callback (const std::function< GetLogResponse(const GetDiagnosticsRequest &request)> &callback)
 registers a callback function that can be used to trigger an upload of diagnostics. This callback should trigger a process of a diagnostics upload using the given parameters of the request. This process should call the on_log_status_notification handler in order to update the status of the file upload. The upload_diagnostics_callback is called when a GetDiagnostics.req is received More...
 
void ocpp::v16::ChargePoint::register_update_firmware_callback (const std::function< void(const UpdateFirmwareRequest msg)> &callback)
 registers a callback function that can be used to trigger a firmware update. This callback should trigger a process of a firmware update using the given parameters of the request. This process should call the on_firmware_update_status_notification handler in order to update the status of the update. The update_firmware_callback is called when a FirmwareUpdate.req is received More...
 
void ocpp::v16::ChargePoint::register_signed_update_firmware_callback (const std::function< UpdateFirmwareStatusEnumType(const SignedUpdateFirmwareRequest msg)> &callback)
 registers a callback function that can be used to trigger a signed firmware update. This callback should trigger a process of a signed firmware update using the given parameters of the request. This process should call the on_firmware_update_status_notification handler in order to update the status of the signed firmware update. The signed_update_firmware_callback is called when a SignedUpdateFirmware.req is received. More...
 
void ocpp::v16::ChargePoint::register_all_connectors_unavailable_callback (const std::function< void()> &callback)
 registers a callback function that is called when all connectors are set to unavailable. This can be used to then trigger the installation of the firmware update
 
void ocpp::v16::ChargePoint::register_upload_logs_callback (const std::function< GetLogResponse(GetLogRequest req)> &callback)
 registers a callback function that can be used to upload logfiles. This callback should trigger a process of a log upload using the given parameters of the request. This process should call the on_log_status_notification handler in order to update the status of the file upload. The upload_logs_callback is called when a GetLog.req is received More...
 
void ocpp::v16::ChargePoint::register_set_connection_timeout_callback (const std::function< void(int32_t connection_timeout)> &callback)
 registers a callback function that can be used to set the authorization or plug in connection timeout. The set_connection_timeout_callback is called when the configuration key ConnectionTimeout has been changed by the CSMS. More...
 
void ocpp::v16::ChargePoint::register_is_reset_allowed_callback (const std::function< bool(const ResetType &reset_type)> &callback)
 registers a callback function that can be used to check if a reset is allowed . The is_reset_allowed_callback is called when a Reset.req is received. More...
 
void ocpp::v16::ChargePoint::register_reset_callback (const std::function< void(const ResetType &reset_type)> &callback)
 registers a callback function that can be used to trigger a reset of the chargepoint. The reset_callback is called when a Reset.req is received and a previous execution of the is_reset_allowed_callback returned true More...
 
void ocpp::v16::ChargePoint::register_set_system_time_callback (const std::function< void(const std::string &system_time)> &callback)
 registers a callback function that can be used to set the system time. More...
 
void ocpp::v16::ChargePoint::register_boot_notification_response_callback (const std::function< void(const BootNotificationResponse &boot_notification_response)> &callback)
 registers a callback function that can be used receive the BootNotificationResponse More...
 
void ocpp::v16::ChargePoint::register_signal_set_charging_profiles_callback (const std::function< void()> &callback)
 registers a callback function that can be used to signal that the chargepoint received a SetChargingProfile.req . The set_charging_profiles_callback is called when a SetChargingProfile.req is received and was accepted. The registered callback could make use of the get_all_composite_charging_schedules in order to retrieve the ChargingProfiles that have been set by the CSMS. More...
 
void ocpp::v16::ChargePoint::register_connection_state_changed_callback (const std::function< void(bool is_connected)> &callback)
 registers a callback function that can be used when the connection state to CSMS changes. The connection_state_changed_callback is called when chargepoint has connected to or disconnected from the CSMS. More...
 
void ocpp::v16::ChargePoint::register_get_15118_ev_certificate_response_callback (const std::function< void(const int32_t connector, const ocpp::v2::Get15118EVCertificateResponse &certificate_response, const ocpp::v2::CertificateActionEnum &certificate_action)> &callback)
 registers a callback function that can be used to publish the response to a Get15118Certificate.req wrapped in a DataTransfer.req . The get_15118_ev_certificate_response_callback is called after the response to a DataTransfer.req(Get15118EVCertificate) has been accepted. More...
 
void ocpp::v16::ChargePoint::register_transaction_started_callback (const std::function< void(const int32_t connector, const std::string &session_id)> &callback)
 registers a callback function that is called when a StartTransaction.req message is sent by the chargepoint More...
 
void ocpp::v16::ChargePoint::register_transaction_stopped_callback (const std::function< void(const int32_t connector, const std::string &session_id, const int32_t transaction_id)> &callback)
 registers a callback function that is called when a StopTransaction.req message is sent by the chargepoint More...
 
void ocpp::v16::ChargePoint::register_transaction_updated_callback (const std::function< void(const int32_t connector, const std::string &session_id, const int32_t transaction_id, const IdTagInfo &id_tag_info)> &callback)
 registers a callback function that is called when a StartTransaction.conf message is received by the CSMS. This includes the transactionId. More...
 
void ocpp::v16::ChargePoint::register_configuration_key_changed_callback (const CiString< 50 > &key, const std::function< void(const KeyValue &key_value)> &callback)
 registers a callback function that can be used to react on changed configuration keys. This callback is called when a configuration key has been successfully changed by the CSMS or internally using the set_custom_configuration_key function More...
 
void ocpp::v16::ChargePoint::register_generic_configuration_key_changed_callback (const std::function< void(const KeyValue &key_value)> &callback)
 registers a callback function that can be used to react on changed configuration key and value. This callback is called when a configuration key has been changed by the CSMS, where no key based callback is assigned More...
 
void ocpp::v16::ChargePoint::register_security_event_callback (const std::function< void(const std::string &type, const std::string &tech_info)> &callback)
 registers a 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
 
void ocpp::v16::ChargePoint::register_is_token_reserved_for_connector_callback (const std::function< ReservationCheckStatus(const int32_t connector, const std::string &id_token)> &callback)
 registers a callback function that can be used to check, if the connector is reserved for the given id_token. The is_token_reserved_for_connector_callback is called when a RemoteStartTransaction.req is received. More...
 
void ocpp::v16::ChargePoint::register_session_cost_callback (const std::function< DataTransferResponse(const RunningCost &session_cost, const uint32_t number_of_decimals)> &session_cost_callback)
 Registers a callback function for the session cost datatransfer message (California Pricing Requirements) More...
 
void ocpp::v16::ChargePoint::register_set_display_message_callback (const std::function< DataTransferResponse(const std::vector< DisplayMessage > &)> set_display_message_callback)
 Register a callback function for display messages (used in California Pricing Requirements) More...
 

Detailed Description

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

Function Documentation

◆ register_boot_notification_response_callback()

void ocpp::v16::ChargePoint::register_boot_notification_response_callback ( const std::function< void(const BootNotificationResponse &boot_notification_response)> &  callback)

registers a callback function that can be used receive the BootNotificationResponse

Parameters
callback

◆ register_cancel_reservation_callback()

void ocpp::v16::ChargePoint::register_cancel_reservation_callback ( const std::function< bool(int32_t reservation_id)> &  callback)

registers a callback function that can be used to cancel a reservation on a connector. Callback function should return false if the reservation could not be cancelled, else true . The cancel_reservation_callback is called when a CancelReservation.req is received

Parameters
callback

◆ register_configuration_key_changed_callback()

void ocpp::v16::ChargePoint::register_configuration_key_changed_callback ( const CiString< 50 > &  key,
const std::function< void(const KeyValue &key_value)> &  callback 
)

registers a callback function that can be used to react on changed configuration keys. This callback is called when a configuration key has been successfully changed by the CSMS or internally using the set_custom_configuration_key function

Parameters
keythe configuration key for which the callback is registered
callbackexecuted when this configuration key changed

◆ register_connection_state_changed_callback()

void ocpp::v16::ChargePoint::register_connection_state_changed_callback ( const std::function< void(bool is_connected)> &  callback)

registers a callback function that can be used when the connection state to CSMS changes. The connection_state_changed_callback is called when chargepoint has connected to or disconnected from the CSMS.

Parameters
callback

◆ register_data_transfer_callback() [1/2]

void ocpp::v16::ChargePoint::register_data_transfer_callback ( const CiString< 255 > &  vendorId,
const CiString< 50 > &  messageId,
const std::function< DataTransferResponse(const std::optional< std::string > &msg)> &  callback 
)

registers a callback function that can be used to receive a arbitrary data transfer for the given vendorId and messageId

Parameters
vendorId
messageId
callback

◆ register_data_transfer_callback() [2/2]

void ocpp::v16::ChargePoint::register_data_transfer_callback ( const std::function< DataTransferResponse(const DataTransferRequest &request)> &  callback)

registers a callback function that can be used to handle arbitrary data transfers for all vendorId an messageId

Parameters
callback

◆ register_disable_evse_callback()

void ocpp::v16::ChargePoint::register_disable_evse_callback ( const std::function< bool(int32_t connector)> &  callback)

registers a callback function that can be used to disable the evse. The disable_evse_callback is called when a ChangeAvailaibility.req is received.

Parameters
callback

◆ register_enable_evse_callback()

void ocpp::v16::ChargePoint::register_enable_evse_callback ( const std::function< bool(int32_t connector)> &  callback)

registers a callback function that can be used to enable the evse. The enable_evse_callback is called when a ChangeAvailaibility.req is received.

Parameters
callback

◆ register_generic_configuration_key_changed_callback()

void ocpp::v16::ChargePoint::register_generic_configuration_key_changed_callback ( const std::function< void(const KeyValue &key_value)> &  callback)

registers a callback function that can be used to react on changed configuration key and value. This callback is called when a configuration key has been changed by the CSMS, where no key based callback is assigned

Parameters
callbackexecuted when this configuration key and its value changed

◆ register_get_15118_ev_certificate_response_callback()

void ocpp::v16::ChargePoint::register_get_15118_ev_certificate_response_callback ( const std::function< void(const int32_t connector, const ocpp::v2::Get15118EVCertificateResponse &certificate_response, const ocpp::v2::CertificateActionEnum &certificate_action)> &  callback)

registers a callback function that can be used to publish the response to a Get15118Certificate.req wrapped in a DataTransfer.req . The get_15118_ev_certificate_response_callback is called after the response to a DataTransfer.req(Get15118EVCertificate) has been accepted.

Parameters
callback

◆ register_is_reset_allowed_callback()

void ocpp::v16::ChargePoint::register_is_reset_allowed_callback ( const std::function< bool(const ResetType &reset_type)> &  callback)

registers a callback function that can be used to check if a reset is allowed . The is_reset_allowed_callback is called when a Reset.req is received.

Parameters
callback

◆ register_is_token_reserved_for_connector_callback()

void ocpp::v16::ChargePoint::register_is_token_reserved_for_connector_callback ( const std::function< ReservationCheckStatus(const int32_t connector, const std::string &id_token)> &  callback)

registers a callback function that can be used to check, if the connector is reserved for the given id_token. The is_token_reserved_for_connector_callback is called when a RemoteStartTransaction.req is received.

Parameters
callback

◆ register_pause_charging_callback()

void ocpp::v16::ChargePoint::register_pause_charging_callback ( const std::function< bool(int32_t connector)> &  callback)

registers a callback function that can be used to pause charging. The pause_charging_callback is called when the idTagInfo.status of a StartTransaction.conf is not Accepted

Parameters
callback

◆ register_provide_token_callback()

void ocpp::v16::ChargePoint::register_provide_token_callback ( const std::function< void(const std::string &id_token, std::vector< int32_t > referenced_connectors, bool prevalidated)> &  callback)

registers a callback function that can be used to provide an id_token for the given referenced_connectors to an authorization handler. prevalidated signals to the authorization handler that no further authorization is necessary. The provide_token_callback is called when a RemoteStartTransaction.req is received.

Parameters
callback

◆ register_reserve_now_callback()

void ocpp::v16::ChargePoint::register_reserve_now_callback ( const std::function< ReservationStatus(int32_t reservation_id, int32_t connector, ocpp::DateTime expiryDate, CiString< 20 > idTag, std::optional< CiString< 20 > > parent_id)> &  callback)

registers a callback function that can be used to reserve a connector for a idTag until a timeout is reached. The reserve_now_callback is called when a ReserveNow.req is received.

Parameters
callback

◆ register_reset_callback()

void ocpp::v16::ChargePoint::register_reset_callback ( const std::function< void(const ResetType &reset_type)> &  callback)

registers a callback function that can be used to trigger a reset of the chargepoint. The reset_callback is called when a Reset.req is received and a previous execution of the is_reset_allowed_callback returned true

Parameters
callback

◆ register_resume_charging_callback()

void ocpp::v16::ChargePoint::register_resume_charging_callback ( const std::function< bool(int32_t connector)> &  callback)

registers a callback function that can be used to resume charging

Parameters
callback

◆ register_session_cost_callback()

void ocpp::v16::ChargePoint::register_session_cost_callback ( const std::function< DataTransferResponse(const RunningCost &session_cost, const uint32_t number_of_decimals)> &  session_cost_callback)

Registers a callback function for the session cost datatransfer message (California Pricing Requirements)

Parameters
session_cost_callbackThe callback.

◆ register_set_connection_timeout_callback()

void ocpp::v16::ChargePoint::register_set_connection_timeout_callback ( const std::function< void(int32_t connection_timeout)> &  callback)

registers a callback function that can be used to set the authorization or plug in connection timeout. The set_connection_timeout_callback is called when the configuration key ConnectionTimeout has been changed by the CSMS.

Parameters
callback

◆ register_set_display_message_callback()

void ocpp::v16::ChargePoint::register_set_display_message_callback ( const std::function< DataTransferResponse(const std::vector< DisplayMessage > &)>  set_display_message_callback)

Register a callback function for display messages (used in California Pricing Requirements)

Parameters
set_display_message_callbackThe callback.

◆ register_set_system_time_callback()

void ocpp::v16::ChargePoint::register_set_system_time_callback ( const std::function< void(const std::string &system_time)> &  callback)

registers a callback function that can be used to set the system time.

Parameters
callback

◆ register_signal_set_charging_profiles_callback()

void ocpp::v16::ChargePoint::register_signal_set_charging_profiles_callback ( const std::function< void()> &  callback)

registers a callback function that can be used to signal that the chargepoint received a SetChargingProfile.req . The set_charging_profiles_callback is called when a SetChargingProfile.req is received and was accepted. The registered callback could make use of the get_all_composite_charging_schedules in order to retrieve the ChargingProfiles that have been set by the CSMS.

Parameters
callback

◆ register_signed_update_firmware_callback()

void ocpp::v16::ChargePoint::register_signed_update_firmware_callback ( const std::function< UpdateFirmwareStatusEnumType(const SignedUpdateFirmwareRequest msg)> &  callback)

registers a callback function that can be used to trigger a signed firmware update. This callback should trigger a process of a signed firmware update using the given parameters of the request. This process should call the on_firmware_update_status_notification handler in order to update the status of the signed firmware update. The signed_update_firmware_callback is called when a SignedUpdateFirmware.req is received.

Parameters
callback

◆ register_stop_transaction_callback()

void ocpp::v16::ChargePoint::register_stop_transaction_callback ( const std::function< bool(int32_t connector, Reason reason)> &  callback)

registers a callback function that can be used to stop a transaction. Ths stop_transaction_callback is called

  • when the idTagInfo.status of a StartTransaction.conf is not Accepted
  • when a RemoteStopTransaction.req is received
  • when a UnlockConnector.req is received
    Parameters
    callback

◆ register_transaction_started_callback()

void ocpp::v16::ChargePoint::register_transaction_started_callback ( const std::function< void(const int32_t connector, const std::string &session_id)> &  callback)

registers a callback function that is called when a StartTransaction.req message is sent by the chargepoint

Parameters
callback

◆ register_transaction_stopped_callback()

void ocpp::v16::ChargePoint::register_transaction_stopped_callback ( const std::function< void(const int32_t connector, const std::string &session_id, const int32_t transaction_id)> &  callback)

registers a callback function that is called when a StopTransaction.req message is sent by the chargepoint

Parameters
callback

◆ register_transaction_updated_callback()

void ocpp::v16::ChargePoint::register_transaction_updated_callback ( const std::function< void(const int32_t connector, const std::string &session_id, const int32_t transaction_id, const IdTagInfo &id_tag_info)> &  callback)

registers a callback function that is called when a StartTransaction.conf message is received by the CSMS. This includes the transactionId.

Parameters
callback

◆ register_unlock_connector_callback()

void ocpp::v16::ChargePoint::register_unlock_connector_callback ( const std::function< UnlockStatus(int32_t connector)> &  callback)

registers a callback function that can be used to unlock the connector. In case a transaction is

  • when receiving a UnlockConnector.req and
  • when a transaction has on_transaction_stopped is called and the configuration key UnlockConnectorOnEVSideDisconnect is true
    Parameters
    callback

◆ register_update_firmware_callback()

void ocpp::v16::ChargePoint::register_update_firmware_callback ( const std::function< void(const UpdateFirmwareRequest msg)> &  callback)

registers a callback function that can be used to trigger a firmware update. This callback should trigger a process of a firmware update using the given parameters of the request. This process should call the on_firmware_update_status_notification handler in order to update the status of the update. The update_firmware_callback is called when a FirmwareUpdate.req is received

Parameters
callback

◆ register_upload_diagnostics_callback()

void ocpp::v16::ChargePoint::register_upload_diagnostics_callback ( const std::function< GetLogResponse(const GetDiagnosticsRequest &request)> &  callback)

registers a callback function that can be used to trigger an upload of diagnostics. This callback should trigger a process of a diagnostics upload using the given parameters of the request. This process should call the on_log_status_notification handler in order to update the status of the file upload. The upload_diagnostics_callback is called when a GetDiagnostics.req is received

Parameters
callback

◆ register_upload_logs_callback()

void ocpp::v16::ChargePoint::register_upload_logs_callback ( const std::function< GetLogResponse(GetLogRequest req)> &  callback)

registers a callback function that can be used to upload logfiles. This callback should trigger a process of a log upload using the given parameters of the request. This process should call the on_log_status_notification handler in order to update the status of the file upload. The upload_logs_callback is called when a GetLog.req is received

Parameters
callback