3#ifndef OCPP_V16_CHARGE_POINT_CONFIGURATION_HPP
4#define OCPP_V16_CHARGE_POINT_CONFIGURATION_HPP
9#include <ocpp/common/support_older_cpp_versions.hpp>
10#include <ocpp/v16/ocpp_types.hpp>
11#include <ocpp/v16/types.hpp>
22 fs::path user_config_path;
24 std::set<SupportedFeatureProfiles> supported_feature_profiles;
25 std::map<Measurand, std::vector<Phase>> supported_measurands;
26 std::map<SupportedFeatureProfiles, std::set<MessageType>> supported_message_types_from_charge_point;
27 std::map<SupportedFeatureProfiles, std::set<MessageType>> supported_message_types_from_central_system;
28 std::set<MessageType> supported_message_types_sending;
29 std::set<MessageType> supported_message_types_receiving;
30 std::recursive_mutex configuration_mutex;
32 std::vector<MeasurandWithPhase> csv_to_measurand_with_phase_vector(std::string csv);
33 bool validate_measurands(
const json& config);
34 bool measurands_supported(std::string csv);
35 json get_user_config();
36 void setInUserConfig(std::string profile, std::string key, json value);
37 void init_supported_measurands();
39 bool isConnectorPhaseRotationValid(std::string str);
41 bool checkTimeOffset(
const std::string& offset);
45 const fs::path& user_config_path);
48 std::string getChargePointId();
50 std::string getCentralSystemURI();
51 void setCentralSystemURI(std::string ocpp_uri);
52 KeyValue getCentralSystemURIKeyValue();
53 std::string getChargeBoxSerialNumber();
54 KeyValue getChargeBoxSerialNumberKeyValue();
56 KeyValue getChargePointModelKeyValue();
57 std::optional<CiString<25>> getChargePointSerialNumber();
58 std::optional<KeyValue> getChargePointSerialNumberKeyValue();
60 KeyValue getChargePointVendorKeyValue();
62 KeyValue getFirmwareVersionKeyValue();
63 std::optional<CiString<20>> getICCID();
64 std::optional<KeyValue> getICCIDKeyValue();
65 std::optional<CiString<20>> getIMSI();
66 std::optional<KeyValue> getIMSIKeyValue();
67 std::optional<CiString<25>> getMeterSerialNumber();
68 std::optional<KeyValue> getMeterSerialNumberKeyValue();
69 std::optional<CiString<25>> getMeterType();
70 std::optional<KeyValue> getMeterTypeKeyValue();
71 int32_t getWebsocketReconnectInterval();
72 KeyValue getWebsocketReconnectIntervalKeyValue();
73 bool getAuthorizeConnectorZeroOnConnectorOne();
74 KeyValue getAuthorizeConnectorZeroOnConnectorOneKeyValue();
75 bool getLogMessages();
77 std::vector<std::string> getLogMessagesFormat();
78 KeyValue getLogMessagesFormatKeyValue();
79 bool getLogRotation();
81 bool getLogRotationDateSuffix();
82 KeyValue getLogRotationDateSuffixKeyValue();
83 uint64_t getLogRotationMaximumFileSize();
84 KeyValue getLogRotationMaximumFileSizeKeyValue();
85 uint64_t getLogRotationMaximumFileCount();
86 KeyValue getLogRotationMaximumFileCountKeyValue();
87 std::vector<ChargingProfilePurposeType> getSupportedChargingProfilePurposeTypes();
88 KeyValue getSupportedChargingProfilePurposeTypesKeyValue();
89 std::vector<ChargingProfilePurposeType> getIgnoredProfilePurposesOffline();
90 std::optional<KeyValue> getIgnoredProfilePurposesOfflineKeyValue();
91 bool setIgnoredProfilePurposesOffline(
const std::string& ignored_profile_purposes_offline);
92 int32_t getMaxCompositeScheduleDuration();
93 KeyValue getMaxCompositeScheduleDurationKeyValue();
94 std::optional<int32_t> getCompositeScheduleDefaultLimitAmps();
95 std::optional<KeyValue> getCompositeScheduleDefaultLimitAmpsKeyValue();
96 void setCompositeScheduleDefaultLimitAmps(int32_t limit_amps);
97 std::optional<int32_t> getCompositeScheduleDefaultLimitWatts();
98 std::optional<KeyValue> getCompositeScheduleDefaultLimitWattsKeyValue();
99 void setCompositeScheduleDefaultLimitWatts(int32_t limit_watts);
100 std::optional<int32_t> getCompositeScheduleDefaultNumberPhases();
101 std::optional<KeyValue> getCompositeScheduleDefaultNumberPhasesKeyValue();
102 void setCompositeScheduleDefaultNumberPhases(int32_t number_phases);
103 std::optional<int32_t> getSupplyVoltage();
104 std::optional<KeyValue> getSupplyVoltageKeyValue();
105 void setSupplyVoltage(int32_t supply_voltage);
106 std::string getSupportedCiphers12();
107 KeyValue getSupportedCiphers12KeyValue();
108 std::string getSupportedCiphers13();
109 KeyValue getSupportedCiphers13KeyValue();
110 bool getUseSslDefaultVerifyPaths();
111 KeyValue getUseSslDefaultVerifyPathsKeyValue();
112 bool getVerifyCsmsCommonName();
113 KeyValue getVerifyCsmsCommonNameKeyValue();
114 bool getVerifyCsmsAllowWildcards();
115 void setVerifyCsmsAllowWildcards(
bool verify_csms_allow_wildcards);
116 KeyValue getVerifyCsmsAllowWildcardsKeyValue();
118 bool getUseTPMSeccLeafCertificate();
119 std::string getSupportedMeasurands();
120 KeyValue getSupportedMeasurandsKeyValue();
121 int getMaxMessageSize();
122 KeyValue getMaxMessageSizeKeyValue();
124 bool getEnableTLSKeylog();
125 std::string getTLSKeylogFile();
127 int32_t getRetryBackoffRandomRange();
128 void setRetryBackoffRandomRange(int32_t retry_backoff_random_range);
129 KeyValue getRetryBackoffRandomRangeKeyValue();
131 int32_t getRetryBackoffRepeatTimes();
132 void setRetryBackoffRepeatTimes(int32_t retry_backoff_repeat_times);
133 KeyValue getRetryBackoffRepeatTimesKeyValue();
135 int32_t getRetryBackoffWaitMinimum();
136 void setRetryBackoffWaitMinimum(int32_t retry_backoff_wait_minimum);
137 KeyValue getRetryBackoffWaitMinimumKeyValue();
139 std::set<MessageType> getSupportedMessageTypesSending();
140 std::set<MessageType> getSupportedMessageTypesReceiving();
142 std::string getWebsocketPingPayload();
143 KeyValue getWebsocketPingPayloadKeyValue();
145 int32_t getWebsocketPongTimeout();
146 KeyValue getWebsocketPongTimeoutKeyValue();
148 std::optional<std::string> getHostName();
149 std::optional<KeyValue> getHostNameKeyValue();
151 std::optional<std::string> getIFace();
152 std::optional<KeyValue> getIFaceKeyValue();
154 std::optional<bool> getQueueAllMessages();
155 std::optional<KeyValue> getQueueAllMessagesKeyValue();
157 std::optional<std::string> getMessageTypesDiscardForQueueing();
158 std::optional<KeyValue> getMessageTypesDiscardForQueueingKeyValue();
160 std::optional<int> getMessageQueueSizeThreshold();
161 std::optional<KeyValue> getMessageQueueSizeThresholdKeyValue();
164 std::optional<bool> getAllowOfflineTxForUnknownId();
165 void setAllowOfflineTxForUnknownId(
bool enabled);
166 std::optional<KeyValue> getAllowOfflineTxForUnknownIdKeyValue();
169 std::optional<bool> getAuthorizationCacheEnabled();
170 void setAuthorizationCacheEnabled(
bool enabled);
171 std::optional<KeyValue> getAuthorizationCacheEnabledKeyValue();
174 bool getAuthorizeRemoteTxRequests();
175 void setAuthorizeRemoteTxRequests(
bool enabled);
176 KeyValue getAuthorizeRemoteTxRequestsKeyValue();
179 std::optional<int32_t> getBlinkRepeat();
180 void setBlinkRepeat(int32_t blink_repeat);
181 std::optional<KeyValue> getBlinkRepeatKeyValue();
184 int32_t getClockAlignedDataInterval();
185 void setClockAlignedDataInterval(int32_t interval);
186 KeyValue getClockAlignedDataIntervalKeyValue();
189 int32_t getConnectionTimeOut();
190 void setConnectionTimeOut(int32_t timeout);
191 KeyValue getConnectionTimeOutKeyValue();
194 std::string getConnectorPhaseRotation();
195 void setConnectorPhaseRotation(std::string connector_phase_rotation);
196 KeyValue getConnectorPhaseRotationKeyValue();
199 std::optional<int32_t> getConnectorPhaseRotationMaxLength();
200 std::optional<KeyValue> getConnectorPhaseRotationMaxLengthKeyValue();
203 int32_t getGetConfigurationMaxKeys();
204 KeyValue getGetConfigurationMaxKeysKeyValue();
207 int32_t getHeartbeatInterval();
208 void setHeartbeatInterval(int32_t interval);
209 KeyValue getHeartbeatIntervalKeyValue();
212 std::optional<int32_t> getLightIntensity();
213 void setLightIntensity(int32_t light_intensity);
214 std::optional<KeyValue> getLightIntensityKeyValue();
217 bool getLocalAuthorizeOffline();
218 void setLocalAuthorizeOffline(
bool local_authorize_offline);
219 KeyValue getLocalAuthorizeOfflineKeyValue();
222 bool getLocalPreAuthorize();
223 void setLocalPreAuthorize(
bool local_pre_authorize);
224 KeyValue getLocalPreAuthorizeKeyValue();
227 std::optional<int32_t> getMaxEnergyOnInvalidId();
228 void setMaxEnergyOnInvalidId(int32_t max_energy);
229 std::optional<KeyValue> getMaxEnergyOnInvalidIdKeyValue();
232 std::string getMeterValuesAlignedData();
233 bool setMeterValuesAlignedData(std::string meter_values_aligned_data);
234 KeyValue getMeterValuesAlignedDataKeyValue();
235 std::vector<MeasurandWithPhase> getMeterValuesAlignedDataVector();
238 std::optional<int32_t> getMeterValuesAlignedDataMaxLength();
239 std::optional<KeyValue> getMeterValuesAlignedDataMaxLengthKeyValue();
242 std::string getMeterValuesSampledData();
243 bool setMeterValuesSampledData(std::string meter_values_sampled_data);
244 KeyValue getMeterValuesSampledDataKeyValue();
245 std::vector<MeasurandWithPhase> getMeterValuesSampledDataVector();
248 std::optional<int32_t> getMeterValuesSampledDataMaxLength();
249 std::optional<KeyValue> getMeterValuesSampledDataMaxLengthKeyValue();
252 int32_t getMeterValueSampleInterval();
253 void setMeterValueSampleInterval(int32_t interval);
254 KeyValue getMeterValueSampleIntervalKeyValue();
257 std::optional<int32_t> getMinimumStatusDuration();
258 void setMinimumStatusDuration(int32_t minimum_status_duration);
259 std::optional<KeyValue> getMinimumStatusDurationKeyValue();
262 int32_t getNumberOfConnectors();
263 KeyValue getNumberOfConnectorsKeyValue();
266 std::optional<bool> getReserveConnectorZeroSupported();
267 std::optional<KeyValue> getReserveConnectorZeroSupportedKeyValue();
270 int32_t getResetRetries();
271 void setResetRetries(int32_t retries);
275 bool getStopTransactionOnEVSideDisconnect();
276 void setStopTransactionOnEVSideDisconnect(
bool stop_transaction_on_ev_side_disconnect);
277 KeyValue getStopTransactionOnEVSideDisconnectKeyValue();
280 bool getStopTransactionOnInvalidId();
281 void setStopTransactionOnInvalidId(
bool stop_transaction_on_invalid_id);
282 KeyValue getStopTransactionOnInvalidIdKeyValue();
285 std::string getStopTxnAlignedData();
286 bool setStopTxnAlignedData(std::string stop_txn_aligned_data);
287 KeyValue getStopTxnAlignedDataKeyValue();
290 std::optional<int32_t> getStopTxnAlignedDataMaxLength();
291 std::optional<KeyValue> getStopTxnAlignedDataMaxLengthKeyValue();
294 std::string getStopTxnSampledData();
295 bool setStopTxnSampledData(std::string stop_txn_sampled_data);
296 KeyValue getStopTxnSampledDataKeyValue();
299 std::optional<int32_t> getStopTxnSampledDataMaxLength();
300 std::optional<KeyValue> getStopTxnSampledDataMaxLengthKeyValue();
303 std::string getSupportedFeatureProfiles();
304 KeyValue getSupportedFeatureProfilesKeyValue();
305 std::set<SupportedFeatureProfiles> getSupportedFeatureProfilesSet();
308 std::optional<int32_t> getSupportedFeatureProfilesMaxLength();
309 std::optional<KeyValue> getSupportedFeatureProfilesMaxLengthKeyValue();
312 int32_t getTransactionMessageAttempts();
313 void setTransactionMessageAttempts(int32_t attempts);
314 KeyValue getTransactionMessageAttemptsKeyValue();
317 int32_t getTransactionMessageRetryInterval();
318 void setTransactionMessageRetryInterval(int32_t retry_interval);
319 KeyValue getTransactionMessageRetryIntervalKeyValue();
322 bool getUnlockConnectorOnEVSideDisconnect();
323 void setUnlockConnectorOnEVSideDisconnect(
bool unlock_connector_on_ev_side_disconnect);
324 KeyValue getUnlockConnectorOnEVSideDisconnectKeyValue();
327 std::optional<int32_t> getWebsocketPingInterval();
328 void setWebsocketPingInterval(int32_t websocket_ping_interval);
329 std::optional<KeyValue> getWebsocketPingIntervalKeyValue();
334 int32_t getChargeProfileMaxStackLevel();
335 KeyValue getChargeProfileMaxStackLevelKeyValue();
338 std::string getChargingScheduleAllowedChargingRateUnit();
339 KeyValue getChargingScheduleAllowedChargingRateUnitKeyValue();
340 std::vector<ChargingRateUnit> getChargingScheduleAllowedChargingRateUnitVector();
343 int32_t getChargingScheduleMaxPeriods();
344 KeyValue getChargingScheduleMaxPeriodsKeyValue();
347 std::optional<bool> getConnectorSwitch3to1PhaseSupported();
348 std::optional<KeyValue> getConnectorSwitch3to1PhaseSupportedKeyValue();
351 int32_t getMaxChargingProfilesInstalled();
352 KeyValue getMaxChargingProfilesInstalledKeyValue();
357 std::optional<bool> getAdditionalRootCertificateCheck();
358 std::optional<KeyValue> getAdditionalRootCertificateCheckKeyValue();
361 std::optional<std::string> getAuthorizationKey();
362 void setAuthorizationKey(std::string authorization_key);
363 std::optional<KeyValue> getAuthorizationKeyKeyValue();
366 std::optional<int32_t> getCertificateSignedMaxChainSize();
367 std::optional<KeyValue> getCertificateSignedMaxChainSizeKeyValue();
370 std::optional<int32_t> getCertificateStoreMaxLength();
371 std::optional<KeyValue> getCertificateStoreMaxLengthKeyValue();
374 std::optional<std::string> getCpoName();
375 void setCpoName(std::string cpo_name);
376 std::optional<KeyValue> getCpoNameKeyValue();
379 int32_t getSecurityProfile();
380 void setSecurityProfile(int32_t security_profile);
381 KeyValue getSecurityProfileKeyValue();
384 bool getDisableSecurityEventNotifications();
385 void setDisableSecurityEventNotifications(
bool disable_security_event_notifications);
386 KeyValue getDisableSecurityEventNotificationsKeyValue();
389 bool getLocalAuthListEnabled();
390 void setLocalAuthListEnabled(
bool local_auth_list_enabled);
391 KeyValue getLocalAuthListEnabledKeyValue();
394 int32_t getLocalAuthListMaxLength();
395 KeyValue getLocalAuthListMaxLengthKeyValue();
398 int32_t getSendLocalListMaxLength();
399 KeyValue getSendLocalListMaxLengthKeyValue();
402 bool getISO15118PnCEnabled();
403 void setISO15118PnCEnabled(
const bool iso15118_pnc_enabled);
404 KeyValue getISO15118PnCEnabledKeyValue();
406 std::optional<bool> getCentralContractValidationAllowed();
407 void setCentralContractValidationAllowed(
const bool central_contract_validation_allowed);
408 std::optional<KeyValue> getCentralContractValidationAllowedKeyValue();
410 std::optional<int32_t> getCertSigningWaitMinimum();
411 void setCertSigningWaitMinimum(
const int32_t cert_signing_wait_minimum);
412 std::optional<KeyValue> getCertSigningWaitMinimumKeyValue();
414 std::optional<int32_t> getCertSigningRepeatTimes();
415 void setCertSigningRepeatTimes(
const int32_t cert_signing_repeat_times);
416 std::optional<KeyValue> getCertSigningRepeatTimesKeyValue();
418 bool getContractValidationOffline();
419 void setContractValidationOffline(
const bool contract_validation_offline);
420 KeyValue getContractValidationOfflineKeyValue();
422 int32_t getOcspRequestInterval();
423 void setOcspRequestInterval(
const int32_t ocsp_request_interval);
424 KeyValue getOcspRequestIntervalKeyValue();
426 std::optional<std::string> getSeccLeafSubjectCommonName();
427 void setSeccLeafSubjectCommonName(
const std::string& secc_leaf_subject_common_name);
428 std::optional<KeyValue> getSeccLeafSubjectCommonNameKeyValue();
430 std::optional<std::string> getSeccLeafSubjectCountry();
431 void setSeccLeafSubjectCountry(
const std::string& secc_leaf_subject_country);
432 std::optional<KeyValue> getSeccLeafSubjectCountryKeyValue();
434 std::optional<std::string> getSeccLeafSubjectOrganization();
435 void setSeccLeafSubjectOrganization(
const std::string& secc_leaf_subject_organization);
436 std::optional<KeyValue> getSeccLeafSubjectOrganizationKeyValue();
438 std::optional<std::string> getConnectorEvseIds();
439 void setConnectorEvseIds(
const std::string& connector_evse_ids);
440 std::optional<KeyValue> getConnectorEvseIdsKeyValue();
442 std::optional<bool> getAllowChargingProfileWithoutStartSchedule();
443 void setAllowChargingProfileWithoutStartSchedule(
const bool allow);
444 std::optional<KeyValue> getAllowChargingProfileWithoutStartScheduleKeyValue();
446 int32_t getWaitForStopTransactionsOnResetTimeout();
447 void setWaitForStopTransactionsOnResetTimeout(
const int32_t wait_for_stop_transactions_on_reset_timeout);
448 KeyValue getWaitForStopTransactionsOnResetTimeoutKeyValue();
451 bool getCustomDisplayCostAndPriceEnabled();
452 KeyValue getCustomDisplayCostAndPriceEnabledKeyValue();
454 std::optional<uint32_t> getPriceNumberOfDecimalsForCostValues();
455 std::optional<KeyValue> getPriceNumberOfDecimalsForCostValuesKeyValue();
457 std::optional<std::string> getDefaultPriceText(
const std::string& language);
459 KeyValue getDefaultPriceTextKeyValue(
const std::string& language);
460 std::optional<std::vector<KeyValue>> getAllDefaultPriceTextKeyValues();
462 std::optional<std::string> getDefaultPrice();
463 ConfigurationStatus setDefaultPrice(
const std::string& value);
464 std::optional<KeyValue> getDefaultPriceKeyValue();
466 std::optional<std::string> getDisplayTimeOffset();
467 ConfigurationStatus setDisplayTimeOffset(
const std::string& offset);
468 std::optional<KeyValue> getDisplayTimeOffsetKeyValue();
470 std::optional<std::string> getNextTimeOffsetTransitionDateTime();
471 ConfigurationStatus setNextTimeOffsetTransitionDateTime(
const std::string& date_time);
472 std::optional<KeyValue> getNextTimeOffsetTransitionDateTimeKeyValue();
474 std::optional<std::string> getTimeOffsetNextTransition();
475 ConfigurationStatus setTimeOffsetNextTransition(
const std::string& offset);
476 std::optional<KeyValue> getTimeOffsetNextTransitionKeyValue();
478 std::optional<bool> getCustomIdleFeeAfterStop();
479 void setCustomIdleFeeAfterStop(
const bool& value);
480 std::optional<KeyValue> getCustomIdleFeeAfterStopKeyValue();
482 std::optional<bool> getCustomMultiLanguageMessagesEnabled();
483 std::optional<KeyValue> getCustomMultiLanguageMessagesEnabledKeyValue();
485 std::optional<std::string> getMultiLanguageSupportedLanguages();
486 std::optional<KeyValue> getMultiLanguageSupportedLanguagesKeyValue();
488 std::optional<std::string> getLanguage();
489 void setLanguage(
const std::string& language);
490 std::optional<KeyValue> getLanguageKeyValue();
493 std::optional<KeyValue> getCustomKeyValue(
CiString<50> key);
498 std::vector<KeyValue> get_all_key_value();
contains the configuration of the charge point
Definition: charge_point_configuration.hpp:17
Definition: ocpp_types.hpp:83