3#ifndef OCPP_V16_CHARGE_POINT_IMPL_HPP
4#define OCPP_V16_CHARGE_POINT_IMPL_HPP
12#include <ocpp/common/support_older_cpp_versions.hpp>
15#include <everest/timer.hpp>
17#include <ocpp/common/aligned_timer.hpp>
18#include <ocpp/common/charging_station_base.hpp>
19#include <ocpp/common/message_dispatcher.hpp>
20#include <ocpp/common/message_queue.hpp>
21#include <ocpp/common/schemas.hpp>
22#include <ocpp/common/types.hpp>
23#include <ocpp/common/websocket/websocket.hpp>
24#include <ocpp/v16/charge_point_configuration.hpp>
25#include <ocpp/v16/connector.hpp>
26#include <ocpp/v16/database_handler.hpp>
27#include <ocpp/v16/message_dispatcher.hpp>
28#include <ocpp/v16/messages/Authorize.hpp>
29#include <ocpp/v16/messages/BootNotification.hpp>
30#include <ocpp/v16/messages/CancelReservation.hpp>
31#include <ocpp/v16/messages/CertificateSigned.hpp>
32#include <ocpp/v16/messages/ChangeAvailability.hpp>
33#include <ocpp/v16/messages/ChangeConfiguration.hpp>
34#include <ocpp/v16/messages/ClearCache.hpp>
35#include <ocpp/v16/messages/ClearChargingProfile.hpp>
36#include <ocpp/v16/messages/DataTransfer.hpp>
37#include <ocpp/v16/messages/DeleteCertificate.hpp>
38#include <ocpp/v16/messages/DiagnosticsStatusNotification.hpp>
39#include <ocpp/v16/messages/ExtendedTriggerMessage.hpp>
40#include <ocpp/v16/messages/FirmwareStatusNotification.hpp>
41#include <ocpp/v16/messages/GetCompositeSchedule.hpp>
42#include <ocpp/v16/messages/GetConfiguration.hpp>
43#include <ocpp/v16/messages/GetDiagnostics.hpp>
44#include <ocpp/v16/messages/GetInstalledCertificateIds.hpp>
45#include <ocpp/v16/messages/GetLocalListVersion.hpp>
46#include <ocpp/v16/messages/GetLog.hpp>
47#include <ocpp/v16/messages/Heartbeat.hpp>
48#include <ocpp/v16/messages/InstallCertificate.hpp>
49#include <ocpp/v16/messages/LogStatusNotification.hpp>
50#include <ocpp/v16/messages/MeterValues.hpp>
51#include <ocpp/v16/messages/RemoteStartTransaction.hpp>
52#include <ocpp/v16/messages/RemoteStopTransaction.hpp>
53#include <ocpp/v16/messages/ReserveNow.hpp>
54#include <ocpp/v16/messages/Reset.hpp>
55#include <ocpp/v16/messages/SecurityEventNotification.hpp>
56#include <ocpp/v16/messages/SendLocalList.hpp>
57#include <ocpp/v16/messages/SetChargingProfile.hpp>
58#include <ocpp/v16/messages/SignCertificate.hpp>
59#include <ocpp/v16/messages/SignedFirmwareStatusNotification.hpp>
60#include <ocpp/v16/messages/SignedUpdateFirmware.hpp>
61#include <ocpp/v16/messages/StartTransaction.hpp>
62#include <ocpp/v16/messages/StatusNotification.hpp>
63#include <ocpp/v16/messages/StopTransaction.hpp>
64#include <ocpp/v16/messages/TriggerMessage.hpp>
65#include <ocpp/v16/messages/UnlockConnector.hpp>
66#include <ocpp/v16/messages/UpdateFirmware.hpp>
67#include <ocpp/v16/ocpp_types.hpp>
68#include <ocpp/v16/smart_charging.hpp>
69#include <ocpp/v16/transaction.hpp>
70#include <ocpp/v16/types.hpp>
73#include <ocpp/v2/messages/Authorize.hpp>
74#include <ocpp/v2/messages/CertificateSigned.hpp>
75#include <ocpp/v2/messages/DeleteCertificate.hpp>
76#include <ocpp/v2/messages/Get15118EVCertificate.hpp>
77#include <ocpp/v2/messages/GetCertificateStatus.hpp>
78#include <ocpp/v2/messages/GetInstalledCertificateIds.hpp>
79#include <ocpp/v2/messages/InstallCertificate.hpp>
80#include <ocpp/v2/messages/SignCertificate.hpp>
81#include <ocpp/v2/messages/TriggerMessage.hpp>
89 BootReasonEnum bootreason;
90 ChargePointConnectionState connection_state;
91 bool boot_notification_callerror;
92 std::atomic<RegistrationStatus> registration_status;
93 DiagnosticsStatus diagnostics_status;
94 FirmwareStatus firmware_status;
95 bool firmware_update_is_pending =
false;
96 UploadLogStatusEnumType log_status;
97 std::string message_log_path;
99 std::unique_ptr<Websocket> websocket;
100 std::unique_ptr<ocpp::MessageDispatcherInterface<MessageType>> message_dispatcher;
101 Everest::SteadyTimer websocket_timer;
102 std::unique_ptr<MessageQueue<v16::MessageType>> message_queue;
103 std::map<int32_t, std::shared_ptr<Connector>> connectors;
104 std::unique_ptr<SmartChargingHandler> smart_charging_handler;
105 int32_t heartbeat_interval;
107 std::chrono::time_point<date::utc_clock> boot_time;
108 std::set<MessageType> allowed_message_types;
109 std::mutex allowed_message_types_mutex;
110 std::unique_ptr<ChargePointStates> status;
111 std::shared_ptr<ChargePointConfiguration> configuration;
112 std::shared_ptr<ocpp::v16::DatabaseHandler> database_handler;
113 std::unique_ptr<Everest::SteadyTimer> boot_notification_timer;
114 std::unique_ptr<Everest::SteadyTimer> heartbeat_timer;
115 std::unique_ptr<ClockAlignedTimer> clock_aligned_meter_values_timer;
116 std::vector<std::unique_ptr<Everest::SteadyTimer>> status_notification_timers;
117 std::unique_ptr<Everest::SteadyTimer> ocsp_request_timer;
118 std::unique_ptr<Everest::SteadyTimer> client_certificate_timer;
119 std::unique_ptr<Everest::SteadyTimer> v2g_certificate_timer;
120 std::unique_ptr<Everest::SystemTimer> change_time_offset_timer;
121 std::chrono::time_point<date::utc_clock> clock_aligned_meter_values_time_point;
122 std::mutex meter_values_mutex;
123 std::mutex measurement_mutex;
124 std::map<int32_t, AvailabilityChange> change_availability_queue;
125 std::mutex change_availability_mutex;
126 std::unique_ptr<TransactionHandler> transaction_handler;
127 std::vector<v16::MessageType> external_notify;
129 std::map<std::string,
130 std::map<std::string, std::function<
DataTransferResponse(
const std::optional<std::string>& msg)>>>
131 data_transfer_callbacks;
134 std::mutex data_transfer_callbacks_mutex;
135 std::map<CiString<50>, std::function<void(
const KeyValue& key_value)>> configuration_key_changed_callbacks;
136 std::function<void(
const KeyValue& key_value)> generic_configuration_key_changed_callback;
138 std::mutex stop_transaction_mutex;
139 std::condition_variable stop_transaction_cv;
141 std::thread reset_thread;
143 int log_status_request_id;
145 FirmwareStatusEnumType signed_firmware_status;
146 int signed_firmware_status_request_id;
149 std::chrono::seconds message_queue_resume_delay = std::chrono::seconds(0);
152 std::function<bool(int32_t connector)> enable_evse_callback;
153 std::function<bool(int32_t connector)> disable_evse_callback;
154 std::function<bool(int32_t connector)> pause_charging_callback;
155 std::function<bool(int32_t connector)> resume_charging_callback;
156 std::function<void(
const std::string& id_token, std::vector<int32_t> referenced_connectors,
bool prevalidated)>
157 provide_token_callback;
158 std::function<bool(int32_t connector, Reason reason)> stop_transaction_callback;
159 std::function<UnlockStatus(int32_t connector)> unlock_connector_callback;
160 std::function<bool(int32_t connector, int32_t max_current)> set_max_current_callback;
161 std::function<bool(
const ResetType& reset_type)> is_reset_allowed_callback;
162 std::function<void(
const ResetType& reset_type)> reset_callback;
163 std::function<void(
const std::string& system_time)> set_system_time_callback;
164 std::function<void(
const BootNotificationResponse& boot_notification_response)> boot_notification_response_callback;
165 std::function<void()> signal_set_charging_profiles_callback;
166 std::function<void(
bool is_connected)> connection_state_changed_callback;
172 std::function<void(
const std::string& type,
const std::string& tech_info)> security_event_callback;
174 std::function<void()> all_connectors_unavailable_callback;
176 std::function<ReservationStatus(int32_t reservation_id, int32_t connector,
ocpp::DateTime expiryDate,
178 reserve_now_callback;
179 std::function<bool(int32_t reservation_id)> cancel_reservation_callback;
180 std::function<void()> switch_security_profile_callback;
182 std::function<void(int32_t connection_timeout)> set_connection_timeout_callback;
184 std::function<void(
const int32_t connector,
const std::string& session_id)> transaction_started_callback;
185 std::function<void(
const int32_t connector,
const std::string& session_id,
const int32_t transaction_id,
187 transaction_updated_callback;
188 std::function<void(
const int32_t connector,
const std::string& session_id,
const int32_t transaction_id)>
189 transaction_stopped_callback;
190 std::function<ocpp::ReservationCheckStatus(
const int32_t connector,
const std::string& id_token)>
191 is_token_reserved_for_connector_callback;
195 const ocpp::v2::CertificateActionEnum& certificate_action)>
196 get_15118_ev_certificate_response_callback;
200 session_cost_callback;
202 set_display_message_callback;
205 void connected_callback();
206 void init_websocket();
207 void init_state_machine(
const std::map<int, ChargePointStatus>& connector_status_map);
209 std::unique_ptr<ocpp::MessageQueue<v16::MessageType>> create_message_queue();
210 void message_callback(
const std::string& message);
212 void heartbeat(
bool initiated_by_trigger_message =
false);
213 void boot_notification(
bool initiated_by_trigger_message =
false);
214 void clock_aligned_meter_values_sample();
215 void update_heartbeat_interval();
216 void update_meter_values_sample_interval();
217 void update_clock_aligned_meter_values_interval();
218 std::optional<MeterValue> get_latest_meter_value(int32_t connector,
219 std::vector<MeasurandWithPhase> values_of_interest,
220 ReadingContext context);
221 MeterValue get_signed_meter_value(
const std::string& signed_value,
const ReadingContext& context,
223 void send_meter_value(int32_t connector,
MeterValue meter_value,
bool initiated_by_trigger_message =
false);
224 void send_meter_value_on_pricing_trigger(
const int32_t connector_number, std::shared_ptr<Connector> connector,
226 void reset_pricing_triggers(
const int32_t connector_number);
227 void status_notification(
const int32_t connector,
const ChargePointErrorCode errorCode,
230 const std::optional<
CiString<255>>& vendor_id = std::nullopt,
231 const std::optional<
CiString<50>>& vendor_error_code = std::nullopt,
232 bool initiated_by_trigger_message =
false);
233 void diagnostic_status_notification(DiagnosticsStatus status,
bool initiated_by_trigger_message =
false);
234 void firmware_status_notification(FirmwareStatus status,
bool initiated_by_trigger_message =
false);
235 void log_status_notification(UploadLogStatusEnumType status,
int requestId,
236 bool initiated_by_trigger_message =
false);
237 void signed_firmware_update_status_notification(FirmwareStatusEnumType status,
int requestId,
238 bool initiated_by_trigger_message =
false);
243 void change_all_connectors_to_unavailable_for_firmware_update();
250 void try_resume_transactions(
const std::set<std::string>& resuming_session_ids);
251 void stop_all_transactions();
252 void stop_all_transactions(Reason reason);
253 bool validate_against_cache_entries(
CiString<20> id_tag);
256 void start_transaction(std::shared_ptr<Transaction> transaction);
258 void stop_transaction(int32_t connector, Reason reason, std::optional<
CiString<20>> id_tag_end);
263 std::vector<Measurand> get_measurands_vec(
const std::string& measurands_csv);
268 std::vector<TransactionData> get_filtered_transaction_data(
const std::shared_ptr<Transaction>& transaction);
271 void load_charging_profiles();
276 void sign_certificate(
const ocpp::CertificateSigningUseEnum& certificate_signing_use,
277 bool initiated_by_trigger_message =
false);
281 void update_ocsp_cache();
284 void handleBootNotificationResponse(
305 bool is_pnc_enabled();
306 void data_transfer_pnc_sign_certificate();
340 const bool triggered_internally,
const std::optional<bool>& critical = std::nullopt,
341 const std::optional<DateTime>& timestamp = std::nullopt);
342 void switchSecurityProfile(int32_t new_security_profile, int32_t max_connection_attempts);
350 const std::optional<std::string>& message);
356 void set_connector_trigger_metervalue_timer(
const DateTime& date_time, std::shared_ptr<Connector> connector);
362 void set_time_offset_timer(
const std::string& date_time);
370 std::vector<int32_t>& accepted_connector_availability_changes);
380 void execute_connectors_availability_change(
const std::vector<int32_t>& changed_connectors,
381 const ocpp::v16::AvailabilityType availability,
bool persist);
403 explicit ChargePointImpl(
const std::string& config,
const fs::path& share_path,
const fs::path& user_config_path,
404 const fs::path& database_path,
const fs::path& sql_init_path,
405 const fs::path& message_log_path,
const std::shared_ptr<EvseSecurity> evse_security,
406 const std::optional<SecurityConfiguration> security_configuration);
422 bool start(
const std::map<int, ChargePointStatus>& connector_status_map, BootReasonEnum bootreason,
423 const std::set<std::string>& resuming_session_ids);
431 bool restart(
const std::map<int, ChargePointStatus>& connector_status_map, BootReasonEnum bootreason);
471 const std::string& emaid,
const std::optional<std::string>& certificate,
472 const std::optional<std::vector<ocpp::v2::OCSPRequestData>>& iso15118_certificate_hash_data);
482 const std::string& iso15118_schema_version,
483 const ocpp::v2::CertificateActionEnum& certificate_action);
494 const std::optional<std::string>& data);
501 std::map<int32_t, ChargingSchedule>
510 std::map<int32_t, EnhancedChargingSchedule>
512 const ChargingRateUnit unit = ChargingRateUnit::A);
542 void on_session_started(int32_t connector,
const std::string& session_id,
const SessionStartedReason reason,
543 const std::optional<std::string>& session_logging_path);
561 void on_transaction_started(
const int32_t& connector,
const std::string& session_id,
const std::string& id_token,
562 const double meter_start, std::optional<int32_t> reservation_id,
563 const ocpp::DateTime& timestamp, std::optional<std::string> signed_meter_value);
578 std::optional<
CiString<20>> id_tag_end, std::optional<std::string> signed_meter_value);
631 const ocpp::FirmwareStatusNotification firmware_update_status);
664 const std::optional<bool>& critical = std::nullopt,
665 const std::optional<DateTime>& timestamp = std::nullopt);
711 const std::function<
void(
const std::string& id_token, std::vector<int32_t> referenced_connectors,
712 bool prevalidated)>& callback);
726 const std::function<ReservationStatus(int32_t reservation_id, int32_t connector,
ocpp::DateTime expiryDate,
821 const std::function<
void(
const int32_t connector,
823 const ocpp::v2::CertificateActionEnum& certificate_action)>& callback);
829 const std::function<
void(
const int32_t connector,
const std::string& session_id)>& callback);
835 const std::function<
void(
const int32_t connector,
const std::string& session_id,
const int32_t transaction_id)>&
842 const std::function<
void(
const int32_t connector,
const std::string& session_id,
const int32_t transaction_id,
851 const std::function<
void(
const KeyValue& key_value)>& callback);
863 const std::function<
void(
const std::string& type,
const std::string& tech_info)>& callback);
870 const std::function<ReservationCheckStatus(
const int32_t connector,
const std::string& id_token)>& callback);
872 void register_session_cost_callback(
874 session_cost_callback);
875 void register_set_display_message_callback(
876 const std::function<
DataTransferResponse(
const std::vector<DisplayMessage>&)> set_display_message_callback);
892 this->message_queue_resume_delay = delay;
Common base class for OCPP1.6 and OCPP2.0.1 charging stations.
Definition: charging_station_base.hpp:16
Contains a DateTime implementation that can parse and create RFC 3339 compatible strings.
Definition: types.hpp:109
Contains a ChargePoint implementation compatible with OCPP-J 1.6.
Definition: charge_point_impl.hpp:87
ChargePointImpl(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)
The main entrypoint for libOCPP for OCPP 1.6.
Definition: charge_point_impl.cpp:38
void 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...
Definition: charge_point_impl.cpp:4539
std::map< int32_t, EnhancedChargingSchedule > get_all_enhanced_composite_charging_schedules(const int32_t duration_s, const ChargingRateUnit unit=ChargingRateUnit::A)
Calculates EnhancedChargingSchedule(s) configured by the CSMS of all connectors from now until now + ...
Definition: charge_point_impl.cpp:3436
void 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.
Definition: charge_point_impl.cpp:4502
ConfigurationStatus set_custom_configuration_key(CiString< 50 > key, CiString< 500 > value)
Sets a custom configuration key.
Definition: charge_point_impl.cpp:4684
void connect_websocket()
Initializes the websocket and connects to CSMS if it is not yet connected.
Definition: charge_point_impl.cpp:398
void 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 sta...
Definition: charge_point_impl.cpp:4142
void on_all_errors_cleared(int32_t connector)
Clears all previously reported errors at the same time for the given connector . This will clear a pr...
Definition: charge_point_impl.cpp:4377
void register_data_transfer_callback(const CiString< 255 > &vendorId, const CiString< 50 > &messageId, const std::function< DataTransferResponse(const std::optional< std::string > &msg)> &callback)
Definition: charge_point_impl.cpp:4036
void 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_connec...
Definition: charge_point_impl.cpp:4467
void on_plugin_timeout(int32_t connector)
Notifies chargepoint that a ConnectionTimeout occured for the given connector . This function should ...
Definition: charge_point_impl.cpp:4622
GetConfigurationResponse get_configuration_key(const GetConfigurationRequest &request)
Gets the configured configuration key requested in the given request.
Definition: charge_point_impl.cpp:4648
void 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 charge...
Definition: charge_point_impl.cpp:4561
ocpp::v2::AuthorizeResponse data_transfer_pnc_authorize(const std::string &emaid, const std::optional< std::string > &certificate, const std::optional< std::vector< ocpp::v2::OCSPRequestData > > &iso15118_certificate_hash_data)
Uses data_transfer mechanism to authorize given emaid , certificate and iso15118_certificate_hash_dat...
Definition: charge_point_impl.cpp:3466
void 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 t...
Definition: charge_point_impl.cpp:4369
void 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 whe...
Definition: charge_point_impl.cpp:4068
void set_message_queue_resume_delay(std::chrono::seconds delay)
Delay draining the message queue after reconnecting, so the CSMS can perform post-reconnect checks fi...
Definition: charge_point_impl.hpp:891
void 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
Definition: charge_point_impl.cpp:4507
void register_all_connectors_unavailable_callback(const std::function< void()> &callback)
registers a callback function that is called when all connectors are set to unavailable....
Definition: charge_point_impl.cpp:4531
void on_disabled(int32_t connector)
Notifies chargepoint that the connector is disabled . This function should be called when the connect...
Definition: charge_point_impl.cpp:4618
void on_reservation_start(int32_t connector)
This function must be called when a reservation is started at the given connector .
Definition: charge_point_impl.cpp:4606
void 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 b...
Definition: charge_point_impl.cpp:4395
void 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 w...
Definition: charge_point_impl.cpp:4061
void 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 m...
Definition: charge_point_impl.cpp:4048
void 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 pro...
Definition: charge_point_impl.cpp:4535
void disconnect_websocket()
Disconnects the the websocket connection to the CSMS if it is connected.
Definition: charge_point_impl.cpp:404
bool start(const std::map< int, ChargePointStatus > &connector_status_map, BootReasonEnum bootreason, const std::set< std::string > &resuming_session_ids)
Starts the ChargePoint, initializes and connects to the Websocket endpoint and initializes a BootNoti...
Definition: charge_point_impl.cpp:1086
IdTagInfo authorize_id_token(CiString< 20 > id_token, const bool authorize_only_locally=false)
Authorizes the provided id_token against the central system, LocalAuthorizationList or AuthorizationC...
Definition: charge_point_impl.cpp:3334
ChangeAvailabilityResponse on_change_availability(const ChangeAvailabilityRequest &request)
Handles an internal ChangeAvailabilityRequest (in the same way as if it was emitted by the CSMS).
Definition: charge_point_impl.cpp:4632
void call_set_connection_timeout()
Calls the set_connection_timeout_callback that can be registered. This function is used to notify an ...
Definition: charge_point_impl.cpp:410
void 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....
Definition: charge_point_impl.cpp:4549
void 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.
Definition: charge_point_impl.cpp:4361
bool restart(const std::map< int, ChargePointStatus > &connector_status_map, BootReasonEnum bootreason)
Restarts the ChargePoint if it has been stopped before. The ChargePoint is reinitialized,...
Definition: charge_point_impl.cpp:1130
std::map< int32_t, ChargingSchedule > get_all_composite_charging_schedules(const int32_t duration_s, const ChargingRateUnit unit=ChargingRateUnit::A)
Calculates ChargingProfiles configured by the CSMS of all connectors from now until now + given durat...
Definition: charge_point_impl.cpp:3409
void 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 tri...
Definition: charge_point_impl.cpp:4521
void 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....
Definition: charge_point_impl.cpp:4498
void on_reservation_end(int32_t connector)
This function must be called when a reservation ends at the given connector.
Definition: charge_point_impl.cpp:4610
void 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 Diagno...
Definition: charge_point_impl.cpp:4381
void 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 call...
Definition: charge_point_impl.cpp:4455
void 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...
Definition: charge_point_impl.cpp:4451
void data_transfer_pnc_get_15118_ev_certificate(const int32_t connector_id, const std::string &exi_request, const std::string &iso15118_schema_version, const ocpp::v2::CertificateActionEnum &certificate_action)
Uses data transfer mechanism to get 15118 ev certificate from CSMS. This function can be called when ...
Definition: charge_point_impl.cpp:3677
void 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 charg...
Definition: charge_point_impl.cpp:4556
void 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 i...
Definition: charge_point_impl.cpp:4473
void 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_...
Definition: charge_point_impl.cpp:4493
void 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 call...
Definition: charge_point_impl.cpp:4459
void 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 conne...
Definition: charge_point_impl.cpp:4112
void on_resume_charging(int32_t connector)
This function should be called when charging resumes on the given connector.
Definition: charge_point_impl.cpp:4365
void 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....
Definition: charge_point_impl.cpp:4574
void 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 SetChargingP...
Definition: charge_point_impl.cpp:4512
void 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....
Definition: charge_point_impl.cpp:4584
void 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...
Definition: charge_point_impl.cpp:4373
bool stop()
Stops the ChargePoint, stops timers, transactions and the message queue and disconnects from the webs...
Definition: charge_point_impl.cpp:1196
void 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.
Definition: charge_point_impl.cpp:4357
void 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 stopp...
Definition: charge_point_impl.cpp:4196
void 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....
Definition: charge_point_impl.cpp:4579
void 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....
Definition: charge_point_impl.cpp:4627
void register_resume_charging_callback(const std::function< bool(int32_t connector)> &callback)
registers a callback function that can be used to resume charging
Definition: charge_point_impl.cpp:4463
void 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 ca...
Definition: charge_point_impl.cpp:4131
void 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 i...
Definition: charge_point_impl.cpp:4589
void reset_state_machine(const std::map< int, ChargePointStatus > &connector_status_map)
Resets the internal state machine for the connectors using the given connector_status_map.
Definition: charge_point_impl.cpp:1145
void 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....
Definition: charge_point_impl.cpp:4526
std::optional< DataTransferResponse > data_transfer(const CiString< 255 > &vendorId, const std::optional< CiString< 50 > > &messageId, const std::optional< std::string > &data)
Allows the exchange of arbitrary data identified by a vendorId and messageId with a central system.
Definition: charge_point_impl.cpp:3992
void 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 ...
Definition: charge_point_impl.cpp:4567
void 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
Definition: charge_point_impl.cpp:4488
void 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....
Definition: charge_point_impl.cpp:4544
void 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 ...
Definition: charge_point_impl.cpp:4478
void 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....
Definition: charge_point_impl.cpp:4516
void 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....
Definition: charge_point_impl.cpp:4484
void on_enabled(int32_t connector)
Notifies chargepoint that the connector is enabled . This function should be called when the connecto...
Definition: charge_point_impl.cpp:4614
Contains a OCPP CallResult message.
Definition: call_types.hpp:105
Contains a OCPP Call message.
Definition: call_types.hpp:60
Contains a OCPP message in json form with additional information.
Definition: message_queue.hpp:54
Definition: types.hpp:339
Definition: types.hpp:414
Definition: websocket_base.hpp:18
Contains a OCPP BootNotificationResponse message.
Definition: BootNotification.hpp:46
Contains a OCPP ChangeAvailability message.
Definition: ChangeAvailability.hpp:17
Contains a OCPP ChangeAvailabilityResponse message.
Definition: ChangeAvailability.hpp:37
Contains a OCPP DataTransfer message.
Definition: DataTransfer.hpp:19
Contains a OCPP DataTransferResponse message.
Definition: DataTransfer.hpp:40
Contains all relevant information to handle errros in OCPP1.6.
Definition: charge_point_state_machine.hpp:41
Contains a OCPP GetConfiguration message.
Definition: GetConfiguration.hpp:18
Contains a OCPP GetConfigurationResponse message.
Definition: GetConfiguration.hpp:37
Contains a OCPP GetDiagnostics message.
Definition: GetDiagnostics.hpp:18
Contains a OCPP GetLog message.
Definition: GetLog.hpp:19
Contains a OCPP GetLogResponse message.
Definition: GetLog.hpp:42
Definition: ocpp_types.hpp:20
Definition: ocpp_types.hpp:83
Definition: ocpp_types.hpp:132
Contains a OCPP SignedUpdateFirmware message.
Definition: SignedUpdateFirmware.hpp:18
Contains a OCPP UpdateFirmware message.
Definition: UpdateFirmware.hpp:17
Contains a OCPP AuthorizeResponse message.
Definition: Authorize.hpp:41
Contains a OCPP Get15118EVCertificateResponse message.
Definition: Get15118EVCertificate.hpp:42
Definition: ocpp_types.hpp:52