ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
Public Member Functions | List of all members
ocpp::v2::ConnectivityManager Class Reference
Inheritance diagram for ocpp::v2::ConnectivityManager:
ocpp::v2::ConnectivityManagerInterface

Public Member Functions

 ConnectivityManager (DeviceModel &device_model, std::shared_ptr< EvseSecurity > evse_security, std::shared_ptr< MessageLogging > logging, const std::function< void(const std::string &message)> &message_callback)
 
void set_websocket_authorization_key (const std::string &authorization_key) override
 Set the websocket authorization_key. More...
 
void set_websocket_connection_options (const WebsocketConnectionOptions &connection_options) override
 Set the websocket connection_options. More...
 
void set_websocket_connection_options_without_reconnect () override
 Set the websocket connection options without triggering a reconnect. More...
 
void set_websocket_connected_callback (WebsocketConnectionCallback callback) override
 Set the callback that is called when the websocket is connected. More...
 
void set_websocket_disconnected_callback (WebsocketConnectionCallback callback) override
 Set the callback that is called when the websocket is disconnected. More...
 
void set_websocket_connection_failed_callback (WebsocketConnectionFailedCallback callback) override
 Set the callback that is called when the websocket could not connect with a specific reason. More...
 
void set_configure_network_connection_profile_callback (ConfigureNetworkConnectionProfileCallback callback) override
 Set the callback that is called to configure a network connection profile when none is configured. More...
 
std::optional< NetworkConnectionProfileget_network_connection_profile (const int32_t configuration_slot) const override
 Gets the cached NetworkConnectionProfile based on the given configuration_slot. This returns the value from the cached network connection profiles. More...
 
std::optional< int32_t > get_priority_from_configuration_slot (const int configuration_slot) const override
 Get the priority of the given configuration slot. More...
 
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 configuration slots, where the slot with index 0 has the highest priority. More...
 
bool is_websocket_connected () override
 Check if the websocket is connected. More...
 
void connect (std::optional< int32_t > network_profile_slot=std::nullopt) override
 Connect to the websocket. More...
 
void disconnect () override
 Disconnect the websocket. More...
 
bool send_to_websocket (const std::string &message) override
 send a message over the websocket More...
 
void on_network_disconnected (OCPPInterfaceEnum ocpp_interface) override
 Can be called when a network is disconnected, for example when an ethernet cable is removed. More...
 
void on_charging_station_certificate_changed () override
 Called when the charging station certificate is changed. More...
 
void confirm_successful_connection () override
 Confirms the connection is successful so the security profile requirements can be handled. More...
 
virtual void set_websocket_authorization_key (const std::string &authorization_key)=0
 Set the websocket authorization_key. More...
 
virtual void set_websocket_connection_options (const WebsocketConnectionOptions &connection_options)=0
 Set the websocket connection_options. More...
 
virtual void set_websocket_connection_options_without_reconnect ()=0
 Set the websocket connection options without triggering a reconnect. More...
 
virtual void set_websocket_connected_callback (WebsocketConnectionCallback callback)=0
 Set the callback that is called when the websocket is connected. More...
 
virtual void set_websocket_disconnected_callback (WebsocketConnectionCallback callback)=0
 Set the callback that is called when the websocket is disconnected. More...
 
virtual void set_websocket_connection_failed_callback (WebsocketConnectionFailedCallback callback)=0
 Set the callback that is called when the websocket could not connect with a specific reason. More...
 
virtual void set_configure_network_connection_profile_callback (ConfigureNetworkConnectionProfileCallback callback)=0
 Set the callback that is called to configure a network connection profile when none is configured. More...
 
virtual std::optional< NetworkConnectionProfileget_network_connection_profile (const int32_t configuration_slot) const =0
 Gets the cached NetworkConnectionProfile based on the given configuration_slot. This returns the value from the cached network connection profiles. More...
 
virtual std::optional< int32_t > get_priority_from_configuration_slot (const int configuration_slot) const =0
 Get the priority of the given configuration slot. More...
 
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 configuration slots, where the slot with index 0 has the highest priority. More...
 
virtual bool is_websocket_connected ()=0
 Check if the websocket is connected. More...
 
virtual void connect (std::optional< int32_t > network_profile_slot=std::nullopt)=0
 Connect to the websocket. More...
 
virtual void disconnect ()=0
 Disconnect the websocket. More...
 
virtual bool send_to_websocket (const std::string &message)=0
 send a message over the websocket More...
 
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. More...
 
virtual void on_charging_station_certificate_changed ()=0
 Called when the charging station certificate is changed. More...
 
virtual void confirm_successful_connection ()=0
 Confirms the connection is successful so the security profile requirements can be handled. More...
 

Member Function Documentation

◆ confirm_successful_connection()

void ocpp::v2::ConnectivityManager::confirm_successful_connection ( )
overridevirtual

Confirms the connection is successful so the security profile requirements can be handled.

Implements ocpp::v2::ConnectivityManagerInterface.

◆ connect()

void ocpp::v2::ConnectivityManager::connect ( std::optional< int32_t >  network_profile_slot = std::nullopt)
overridevirtual

Connect to the websocket.

Parameters
configuration_slotOptional the network_profile_slot to connect to. std::nullopt will select the slot internally.

Implements ocpp::v2::ConnectivityManagerInterface.

◆ disconnect()

void ocpp::v2::ConnectivityManager::disconnect ( )
overridevirtual

Disconnect the websocket.

Implements ocpp::v2::ConnectivityManagerInterface.

◆ get_network_connection_profile()

std::optional< NetworkConnectionProfile > ocpp::v2::ConnectivityManager::get_network_connection_profile ( const int32_t  configuration_slot) const
overridevirtual

Gets the cached NetworkConnectionProfile based on the given configuration_slot. This returns the value from the cached network connection profiles.

Returns
Returns a profile if the slot is found

Implements ocpp::v2::ConnectivityManagerInterface.

◆ get_network_connection_slots()

const std::vector< int > & ocpp::v2::ConnectivityManager::get_network_connection_slots ( ) const
overridevirtual

Get the network connection slots sorted by priority. Each item in the vector contains the configured configuration slots, where the slot with index 0 has the highest priority.

Returns
The network connection slots

Implements ocpp::v2::ConnectivityManagerInterface.

◆ get_priority_from_configuration_slot()

std::optional< int32_t > ocpp::v2::ConnectivityManager::get_priority_from_configuration_slot ( const int  configuration_slot) const
overridevirtual

Get the priority of the given configuration slot.

Parameters
configuration_slotThe configuration slot to get the priority from.
Returns
The priority if the configuration slot exists.

Implements ocpp::v2::ConnectivityManagerInterface.

◆ is_websocket_connected()

bool ocpp::v2::ConnectivityManager::is_websocket_connected ( )
overridevirtual

Check if the websocket is connected.

Returns
True is the websocket is connected, else false

Implements ocpp::v2::ConnectivityManagerInterface.

◆ on_charging_station_certificate_changed()

void ocpp::v2::ConnectivityManager::on_charging_station_certificate_changed ( )
overridevirtual

Called when the charging station certificate is changed.

Implements ocpp::v2::ConnectivityManagerInterface.

◆ on_network_disconnected()

void ocpp::v2::ConnectivityManager::on_network_disconnected ( OCPPInterfaceEnum  ocpp_interface)
overridevirtual

Can be called when a network is disconnected, for example when an ethernet cable is removed.

This is introduced because the websocket can take several minutes to timeout when a network interface becomes unavailable, whereas the system can detect this sooner.

Parameters
ocpp_interfaceThe interface that is disconnected.

Implements ocpp::v2::ConnectivityManagerInterface.

◆ send_to_websocket()

bool ocpp::v2::ConnectivityManager::send_to_websocket ( const std::string &  message)
overridevirtual

send a message over the websocket

Returns
true if the message was sent successfully

Implements ocpp::v2::ConnectivityManagerInterface.

◆ set_configure_network_connection_profile_callback()

void ocpp::v2::ConnectivityManager::set_configure_network_connection_profile_callback ( ConfigureNetworkConnectionProfileCallback  callback)
overridevirtual

Set the callback that is called to configure a network connection profile when none is configured.

Implements ocpp::v2::ConnectivityManagerInterface.

◆ set_websocket_authorization_key()

void ocpp::v2::ConnectivityManager::set_websocket_authorization_key ( const std::string &  authorization_key)
overridevirtual

Set the websocket authorization_key.

Implements ocpp::v2::ConnectivityManagerInterface.

◆ set_websocket_connected_callback()

void ocpp::v2::ConnectivityManager::set_websocket_connected_callback ( WebsocketConnectionCallback  callback)
overridevirtual

Set the callback that is called when the websocket is connected.

Implements ocpp::v2::ConnectivityManagerInterface.

◆ set_websocket_connection_failed_callback()

void ocpp::v2::ConnectivityManager::set_websocket_connection_failed_callback ( WebsocketConnectionFailedCallback  callback)
overridevirtual

Set the callback that is called when the websocket could not connect with a specific reason.

Implements ocpp::v2::ConnectivityManagerInterface.

◆ set_websocket_connection_options()

void ocpp::v2::ConnectivityManager::set_websocket_connection_options ( const WebsocketConnectionOptions connection_options)
overridevirtual

Set the websocket connection_options.

Implements ocpp::v2::ConnectivityManagerInterface.

◆ set_websocket_connection_options_without_reconnect()

void ocpp::v2::ConnectivityManager::set_websocket_connection_options_without_reconnect ( )
overridevirtual

Set the websocket connection options without triggering a reconnect.

Implements ocpp::v2::ConnectivityManagerInterface.

◆ set_websocket_disconnected_callback()

void ocpp::v2::ConnectivityManager::set_websocket_disconnected_callback ( WebsocketConnectionCallback  callback)
overridevirtual

Set the callback that is called when the websocket is disconnected.

Implements ocpp::v2::ConnectivityManagerInterface.


The documentation for this class was generated from the following files: