|
ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
|
Handlers | |
The handlers | |
| void | ocpp::v16::ChargePoint::on_meter_values (int32_t connector, const Measurement &measurement) |
Stores the given powermeter values for the given connector . This function can be called when a new meter value is present. More... | |
| void | ocpp::v16::ChargePoint::on_max_current_offered (int32_t connector, int32_t max_current) |
Stores the given max_current for the given connector offered to the EV. This function can be called when the value for the maximum current for the connector changes. It will be used to report the Measurand Current_Offered if it is configured. More... | |
| void | ocpp::v16::ChargePoint::on_max_power_offered (int32_t connector, int32_t max_power) |
Stores the given max_power for the given connector offered to the EV. This function can be called when the value for the maximum power for the connector changes. It will be used to report the Measurand Power_Offered if it is configured. More... | |
| void | ocpp::v16::ChargePoint::on_session_started (int32_t connector, const std::string &session_id, const SessionStartedReason reason, const std::optional< std::string > &session_logging_path) |
Notifies chargepoint that a new session with the given session_id has been started at the given connector with the given reason . The logs of the session will be written into session_logging_path if present. This function must be called when first interaction with user or EV occurs. This can be a valid authorization or the connection of cable and/or EV to the given connector. More... | |
| void | ocpp::v16::ChargePoint::on_session_stopped (int32_t connector, const std::string &session_id) |
Notifies chargepoint that a session has been stopped at the given connector. This function must be called when the EV disconnects from the given connector . More... | |
| void | ocpp::v16::ChargePoint::on_transaction_started (const int32_t &connector, const std::string &session_id, const std::string &id_token, const double meter_start, std::optional< int32_t > reservation_id, const ocpp::DateTime ×tamp, std::optional< std::string > signed_meter_value) |
Notifies chargepoint that a transaction at the given connector with the given parameters has been started. This function must be called at the point that all conditions for charging are met, for instance, EV is connected to Charge Point and user has been authorized. More... | |
| void | ocpp::v16::ChargePoint::on_transaction_stopped (const int32_t connector, const std::string &session_id, const Reason &reason, ocpp::DateTime timestamp, float energy_wh_import, std::optional< CiString< 20 > > id_tag_end, std::optional< std::string > signed_meter_value) |
Notifies chargepoint that the transaction on the given connector with the given reason has been stopped. This function must be called at the point where one of the preconditions for charging irrevocably becomes false, for instance when a user swipes to stop the transaction and the stop is authorized or if the EV disconnects. More... | |
| void | ocpp::v16::ChargePoint::on_suspend_charging_ev (int32_t connector, const std::optional< CiString< 50 > > info=std::nullopt) |
This function should be called when EV indicates that it suspends charging on the given connector. More... | |
| void | ocpp::v16::ChargePoint::on_suspend_charging_evse (int32_t connector, const std::optional< CiString< 50 > > info=std::nullopt) |
This function should be called when EVSE indicates that it suspends charging on the given connector. More... | |
| void | ocpp::v16::ChargePoint::on_resume_charging (int32_t connector) |
This function should be called when charging resumes on the given connector. More... | |
| void | ocpp::v16::ChargePoint::on_error (int32_t connector, const ErrorInfo &error_info) |
This function should be called if an error with the given error_info is present. This function will trigger a StatusNotification.req containing the given error_info . It will change the present state of the state machine to faulted, in case the corresponding flag is set in the given error_info. This function can be called multiple times for different errors. Errors reported using this function stay active as long as they are cleared by on_error_cleared(). More... | |
| void | ocpp::v16::ChargePoint::on_error_cleared (int32_t connector, const std::string uuid) |
This function should be called if an error with the given uuid has been cleared. If this leads to the fact that no other error is active anymore, this function will initiate a StatusNotification.req that reports the current state and no error. More... | |
| void | ocpp::v16::ChargePoint::on_all_errors_cleared (int32_t connector) |
Clears all previously reported errors at the same time for the given connector . This will clear a previously reported "Faulted" state if present. More... | |
| void | ocpp::v16::ChargePoint::on_log_status_notification (int32_t request_id, std::string log_status) |
Chargepoint notifies about new log status log_status . This function should be called during a Diagnostics / Log upload to indicate the current log_status . More... | |
| void | ocpp::v16::ChargePoint::on_firmware_update_status_notification (int32_t request_id, const ocpp::FirmwareStatusNotification firmware_update_status) |
Chargepoint notifies about new firmware update status firmware_update_status . This function should be called during a Firmware Update to indicate the current firmware_update_status . More... | |
| void | ocpp::v16::ChargePoint::on_reservation_start (int32_t connector) |
This function must be called when a reservation is started at the given connector . More... | |
| void | ocpp::v16::ChargePoint::on_reservation_end (int32_t connector) |
This function must be called when a reservation ends at the given connector. More... | |
| void | ocpp::v16::ChargePoint::on_enabled (int32_t connector) |
Notifies chargepoint that the connector is enabled . This function should be called when the connector becomes functional and operational. More... | |
| void | ocpp::v16::ChargePoint::on_disabled (int32_t connector) |
Notifies chargepoint that the connector is disabled . This function should be called when the connector becomes inoperative. More... | |
| void | ocpp::v16::ChargePoint::on_plugin_timeout (int32_t connector) |
Notifies chargepoint that a ConnectionTimeout occured for the given connector . This function should be called when an EV is plugged in but the authorization is present within the specified ConnectionTimeout. | |
| void | ocpp::v16::ChargePoint::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) |
| Notifies chargepoint that a SecurityEvent occurs. This will send a SecurityEventNotification.req to the CSMS. More... | |
| ChangeAvailabilityResponse | ocpp::v16::ChargePoint::on_change_availability (const ChangeAvailabilityRequest &request) |
| Handles an internal ChangeAvailabilityRequest (in the same way as if it was emitted by the CSMS). More... | |
Handlers that can be called from the implementing class.
| void ocpp::v16::ChargePoint::on_all_errors_cleared | ( | int32_t | connector | ) |
Clears all previously reported errors at the same time for the given connector . This will clear a previously reported "Faulted" state if present.
| connector |
| ChangeAvailabilityResponse ocpp::v16::ChargePoint::on_change_availability | ( | const ChangeAvailabilityRequest & | request | ) |
Handles an internal ChangeAvailabilityRequest (in the same way as if it was emitted by the CSMS).
| request |
| void ocpp::v16::ChargePoint::on_disabled | ( | int32_t | connector | ) |
Notifies chargepoint that the connector is disabled . This function should be called when the connector becomes inoperative.
| connector |
| void ocpp::v16::ChargePoint::on_enabled | ( | int32_t | connector | ) |
Notifies chargepoint that the connector is enabled . This function should be called when the connector becomes functional and operational.
| connector |
| void ocpp::v16::ChargePoint::on_error | ( | int32_t | connector, |
| const ErrorInfo & | error_info | ||
| ) |
This function should be called if an error with the given error_info is present. This function will trigger a StatusNotification.req containing the given error_info . It will change the present state of the state machine to faulted, in case the corresponding flag is set in the given error_info. This function can be called multiple times for different errors. Errors reported using this function stay active as long as they are cleared by on_error_cleared().
| connector | |
| error_info | Additional information related to the error |
| void ocpp::v16::ChargePoint::on_error_cleared | ( | int32_t | connector, |
| const std::string | uuid | ||
| ) |
This function should be called if an error with the given uuid has been cleared. If this leads to the fact that no other error is active anymore, this function will initiate a StatusNotification.req that reports the current state and no error.
| connector | |
| uuid | of a previously reported error. If uuid is not known, the event will be ignored |
| void ocpp::v16::ChargePoint::on_firmware_update_status_notification | ( | int32_t | request_id, |
| const ocpp::FirmwareStatusNotification | firmware_update_status | ||
| ) |
Chargepoint notifies about new firmware update status firmware_update_status . This function should be called during a Firmware Update to indicate the current firmware_update_status .
| request_id | A request_id of -1 indicates a FirmwareStatusNotification.req, else a SignedFirmwareUpdateStatusNotification.req . |
| firmware_update_status | The firmware_update_status |
| void ocpp::v16::ChargePoint::on_log_status_notification | ( | int32_t | request_id, |
| std::string | log_status | ||
| ) |
Chargepoint notifies about new log status log_status . This function should be called during a Diagnostics / Log upload to indicate the current log_status .
| request_id | A request_id of -1 indicates a DiagnosticsStatusNotification.req, else a LogStatusNotification.req. |
| log_status | The log_status should be either be convertable to the ocpp::v16::UploadLogStatusEnumType enum or ocpp::v16::DiagnosticsStatus enum depending on the previous request, which could have been a DiagnosticsUpload.req or a GetLog.req (Security Whitepaper) |
| void ocpp::v16::ChargePoint::on_max_current_offered | ( | int32_t | connector, |
| int32_t | max_current | ||
| ) |
Stores the given max_current for the given connector offered to the EV. This function can be called when the value for the maximum current for the connector changes. It will be used to report the Measurand Current_Offered if it is configured.
| connector | |
| max_current | in Amps |
| void ocpp::v16::ChargePoint::on_max_power_offered | ( | int32_t | connector, |
| int32_t | max_power | ||
| ) |
Stores the given max_power for the given connector offered to the EV. This function can be called when the value for the maximum power for the connector changes. It will be used to report the Measurand Power_Offered if it is configured.
| connector | |
| max_power | in Watts |
| void ocpp::v16::ChargePoint::on_meter_values | ( | int32_t | connector, |
| const Measurement & | measurement | ||
| ) |
Stores the given powermeter values for the given connector . This function can be called when a new meter value is present.
| connector | |
| measurement | structure that can contain all kinds of measurands |
| void ocpp::v16::ChargePoint::on_reservation_end | ( | int32_t | connector | ) |
This function must be called when a reservation ends at the given connector.
| connector |
| void ocpp::v16::ChargePoint::on_reservation_start | ( | int32_t | connector | ) |
This function must be called when a reservation is started at the given connector .
| connector |
| void ocpp::v16::ChargePoint::on_resume_charging | ( | int32_t | connector | ) |
This function should be called when charging resumes on the given connector.
| connector |
| void ocpp::v16::ChargePoint::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 > & | timestamp = std::nullopt |
||
| ) |
Notifies chargepoint that a SecurityEvent occurs. This will send a SecurityEventNotification.req to the CSMS.
| event_type | type of the security event |
| tech_info | additional info of the security event |
| critical | if set this overwrites the default criticality recommended in the OCPP 1.6 security whitepaper. A critical security event is transmitted as a message to the CSMS, a non-critical one is just written to the security log |
| timestamp | when this security event occured, if absent the current datetime is assumed |
| void ocpp::v16::ChargePoint::on_session_started | ( | int32_t | connector, |
| const std::string & | session_id, | ||
| const SessionStartedReason | reason, | ||
| const std::optional< std::string > & | session_logging_path | ||
| ) |
Notifies chargepoint that a new session with the given session_id has been started at the given connector with the given reason . The logs of the session will be written into session_logging_path if present. This function must be called when first interaction with user or EV occurs. This can be a valid authorization or the connection of cable and/or EV to the given connector.
| connector | |
| session_id | unique id of the session |
| reason | for the initiation of the session |
| session_logging_path | optional filesystem path to where the session log should be written |
| void ocpp::v16::ChargePoint::on_session_stopped | ( | int32_t | connector, |
| const std::string & | session_id | ||
| ) |
Notifies chargepoint that a session has been stopped at the given connector. This function must be called when the EV disconnects from the given connector .
| connector | |
| session_id |
| void ocpp::v16::ChargePoint::on_suspend_charging_ev | ( | int32_t | connector, |
| const std::optional< CiString< 50 > > | info = std::nullopt |
||
| ) |
This function should be called when EV indicates that it suspends charging on the given connector.
| connector | |
| reason |
| void ocpp::v16::ChargePoint::on_suspend_charging_evse | ( | int32_t | connector, |
| const std::optional< CiString< 50 > > | info = std::nullopt |
||
| ) |
This function should be called when EVSE indicates that it suspends charging on the given connector.
| connector | |
| reason |
| void ocpp::v16::ChargePoint::on_transaction_started | ( | const int32_t & | connector, |
| const std::string & | session_id, | ||
| const std::string & | id_token, | ||
| const double | meter_start, | ||
| std::optional< int32_t > | reservation_id, | ||
| const ocpp::DateTime & | timestamp, | ||
| std::optional< std::string > | signed_meter_value | ||
| ) |
Notifies chargepoint that a transaction at the given connector with the given parameters has been started. This function must be called at the point that all conditions for charging are met, for instance, EV is connected to Charge Point and user has been authorized.
| connector | |
| session_id | |
| id_token | that has been used to authorize the transaction |
| meter_start | start meter value in Wh |
| reservation_id | |
| timestamp | of the start of transaction |
| signed_meter_value | e.g. in OCMF format |
| void ocpp::v16::ChargePoint::on_transaction_stopped | ( | const int32_t | connector, |
| const std::string & | session_id, | ||
| const Reason & | reason, | ||
| ocpp::DateTime | timestamp, | ||
| float | energy_wh_import, | ||
| std::optional< CiString< 20 > > | id_tag_end, | ||
| std::optional< std::string > | signed_meter_value | ||
| ) |
Notifies chargepoint that the transaction on the given connector with the given reason has been stopped. This function must be called at the point where one of the preconditions for charging irrevocably becomes false, for instance when a user swipes to stop the transaction and the stop is authorized or if the EV disconnects.
| connector | |
| session_id | |
| reason | |
| timestamp | of the end of transaction |
| energy_wh_import | stop meter value in Wh |
| id_tag_end | |
| signed_meter_value | e.g. in OCMF format |