ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
Chargepoint constructors

Constructors for 1.6

 ocpp::v16::ChargePoint::ChargePoint (const std::string &config, const fs::path &share_path, const fs::path &user_config_path, const fs::path &database_path, const fs::path &sql_init_path, const fs::path &message_log_path, const std::shared_ptr< EvseSecurity > evse_security, const std::optional< SecurityConfiguration > security_configuration=std::nullopt)
 The main entrypoint for libOCPP for OCPP 1.6. More...
 
 ocpp::v16::ChargePoint::~ChargePoint ()
 

Constructors for 2.0.1

 ocpp::v2::ChargePoint::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. More...
 
 ocpp::v2::ChargePoint::ChargePoint (const std::map< int32_t, int32_t > &evse_connector_structure, std::unique_ptr< DeviceModelStorageInterface > device_model_storage_interface, const std::string &ocpp_main_path, const std::string &core_database_path, const std::string &sql_init_path, const std::string &message_log_path, const std::shared_ptr< EvseSecurity > evse_security, const Callbacks &callbacks)
 Construct a new ChargePoint object. More...
 
 ocpp::v2::ChargePoint::ChargePoint (const std::map< int32_t, int32_t > &evse_connector_structure, const std::string &device_model_storage_address, const bool initialize_device_model, const std::string &device_model_migration_path, const std::string &device_model_config_path, const std::string &ocpp_main_path, const std::string &core_database_path, const std::string &sql_init_path, const std::string &message_log_path, const std::shared_ptr< EvseSecurity > evse_security, const Callbacks &callbacks)
 Construct a new ChargePoint object. More...
 

Detailed Description

Constructors for chargepoint, 1.6 and 2.0.1

Function Documentation

◆ ChargePoint() [1/4]

ocpp::v2::ChargePoint::ChargePoint ( const std::map< int32_t, int32_t > &  evse_connector_structure,
const std::string &  device_model_storage_address,
const bool  initialize_device_model,
const std::string &  device_model_migration_path,
const std::string &  device_model_config_path,
const std::string &  ocpp_main_path,
const std::string &  core_database_path,
const std::string &  sql_init_path,
const std::string &  message_log_path,
const std::shared_ptr< EvseSecurity evse_security,
const Callbacks callbacks 
)

Construct a new ChargePoint object.

Parameters
evse_connector_structureMap that defines the structure of EVSE and connectors of the chargepoint. The key represents the id of the EVSE and the value represents the number of connectors for this EVSE. The ids of the EVSEs have to increment starting with 1.
device_model_storage_addressaddress to device model storage (e.g. location of SQLite database)
initialize_device_modelSet to true to initialize the device model database
device_model_migration_pathPath to the device model database migration files
device_model_config_pathPath to the device model config
ocpp_main_pathPath where utility files for OCPP are read and written to
core_database_pathPath to directory where core database is located
message_log_pathPath to where logfiles are written to
evse_securityPointer to evse_security that manages security related operations; if nullptr security_configuration must be set
callbacksCallbacks that will be registered for ChargePoint

◆ ChargePoint() [2/4]

ocpp::v2::ChargePoint::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.

Parameters
evse_connector_structureMap that defines the structure of EVSE and connectors of the chargepoint. The key represents the id of the EVSE and the value represents the number of connectors for this EVSE. The ids of the EVSEs have to increment starting with 1.
device_modeldevice model instance
database_handlerdatabase handler instance
message_queuemessage queue instance
message_log_pathPath to where logfiles are written to
evse_securityPointer to evse_security that manages security related operations
callbacksCallbacks that will be registered for ChargePoint

◆ ChargePoint() [3/4]

ocpp::v2::ChargePoint::ChargePoint ( const std::map< int32_t, int32_t > &  evse_connector_structure,
std::unique_ptr< DeviceModelStorageInterface device_model_storage_interface,
const std::string &  ocpp_main_path,
const std::string &  core_database_path,
const std::string &  sql_init_path,
const std::string &  message_log_path,
const std::shared_ptr< EvseSecurity evse_security,
const Callbacks callbacks 
)

Construct a new ChargePoint object.

Parameters
evse_connector_structureMap that defines the structure of EVSE and connectors of the chargepoint. The key represents the id of the EVSE and the value represents the number of connectors for this EVSE. The ids of the EVSEs have to increment starting with 1.
device_model_storage_interfacedevice model interface instance
ocpp_main_pathPath where utility files for OCPP are read and written to
core_database_pathPath to directory where core database is located
message_log_pathPath to where logfiles are written to
evse_securityPointer to evse_security that manages security related operations
callbacksCallbacks that will be registered for ChargePoint

◆ ChargePoint() [4/4]

ocpp::v16::ChargePoint::ChargePoint ( const std::string &  config,
const fs::path &  share_path,
const fs::path &  user_config_path,
const fs::path &  database_path,
const fs::path &  sql_init_path,
const fs::path &  message_log_path,
const std::shared_ptr< EvseSecurity evse_security,
const std::optional< SecurityConfiguration security_configuration = std::nullopt 
)
explicit

The main entrypoint for libOCPP for OCPP 1.6.

Parameters
configa nlohmann json config object that contains the libocpp 1.6 config. There are example configs that work with a SteVe installation running in Docker, for example: config/v16/config-docker.json
share_pathThis path contains the following files and directories and is installed by the libocpp install target
user_config_paththis points to a "user config", which we call a configuration file that's merged with the config that's provided in the "config" parameter. Here you can add, remove and overwrite settings without modifying the config passed in the first parameter directly. This is also used by libocpp to persistently modify config entries that are changed by the CSMS that should persist across restarts
database_paththis points to the location of the sqlite database that libocpp uses to keep track of connector availability, the authorization cache and auth list, charging profiles and transaction data
sql_init_paththis points to the init.sql file which contains the database schema used by libocpp for its sqlite database
message_log_paththis points to the directory in which libocpp can put OCPP communication logfiles for debugging purposes. This behavior can be controlled by the "LogMessages" (set to true by default) and "LogMessagesFormat" (set to ["log", "html", "session_logging"] by default, "console" and "console_detailed" are also available) configuration keys in the "Internal" section of the config file. Please note that this is intended for debugging purposes only as it logs all communication, including authentication messages.
evse_securityPointer to evse_security that manages security related operations; if nullptr security_configuration must be set
security_configurationspecifies the file paths that are required to set up the internal evse_security implementation