rust_ocpp/v1_6/messages/change_configuration.rs
1use crate::v1_6::types::ConfigurationStatus;
2use validator::Validate;
3
4pub const CHANGE_CONFIGURATION_ACTION: &str = "ChangeConfiguration";
5
6/// # From OCPP Specification
7/// If this key exists, the Charge Point supports Unknown Offline Authorization. If this key
8/// reports a value of true, Unknown Offline Authorization is enabled.
9pub const ALLOW_OFFLINE_TX_FOR_UNKNOWN_ID: &str = "AllowOfflineTxForUnknownId";
10
11/// # From OCPP Specification
12/// If this key exists, the Charge Point supports an Authorization Cache. If this key reports a
13/// value of true, the Authorization Cache is enabled.
14pub const AUTHORIZATION_CACHE_ENABLED: &str = "AuthorizationCacheEnabled";
15
16/// # From OCPP Specification
17/// Whether a remote request to start a transaction in the form of a RemoteStartTransaction.req
18/// message should be authorized beforehand like a local action to start a transaction.
19pub const AUTHORIZE_REMOTE_TX_REQUESTS: &str = "AuthorizeRemoteTxRequests";
20
21/// # From OCPP Specification
22/// Number of times to blink Charge Point lighting when signalling
23pub const BLINK_REPEAT: &str = "BlinkRepeat";
24
25/// # From OCPP Specification
26/// Size (in seconds) of the clock-aligned data interval. This is the size (in seconds) of the set
27/// of evenly spaced aggregation intervals per day, starting at 00:00:00 (midnight). For example, a
28/// value of 900 (15 minutes) indicates that every day should be broken into 96 15-minute intervals.
29///
30/// When clock aligned data is being transmitted, the interval in question is identified by the
31/// start time and (optional) duration interval value, represented according to the ISO8601
32/// standard. All "per-period" data (e.g. energy readings) should be accumulated (for "flow" type
33/// measurands such as energy), or averaged (for other values) across the entire interval (or
34/// partial interval, at the beginning or end of a Transaction), and transmitted (if so enabled) at
35/// the end of each interval, bearing the interval start time timestamp.
36/// A value of "0" (numeric zero), by convention, is to be interpreted to mean that no
37/// clock-aligned data should be transmitted.
38pub const CLOCK_ALIGNED_DATA_INTERVAL: &str = "ClockAlignedDataInterval";
39
40/// # From OCPP Specification
41/// Interval *from beginning of status: 'Preparing' until incipient Transaction is automatically
42/// canceled, due to failure of EV driver to (correctly) insert the charging cable connector(s)
43/// into the appropriate socket(s). The Charge Point SHALL go back to the original state, probably:
44/// 'Available'.
45pub const CONNECTION_TIME_OUT: &str = "ConnectionTimeOut";
46
47/// # From OCPP Specification
48/// The phase rotation per connector in respect to the connector’s electrical meter (or if absent,
49/// the grid connection). Possible values per connector are:
50///
51/// NotApplicable (for Single phase or DC Charge Points)
52/// Unknown (not (yet) known)
53/// RST (Standard Reference Phasing) RTS (Reversed Reference Phasing) SRT (Reversed 240 degree
54/// rotation) STR (Standard 120 degree rotation) TRS (Standard 240 degree rotation) TSR (Reversed
55/// 120 degree rotation)
56/// R can be identified as phase 1 (L1), S as phase 2 (L2), T as phase 3 (L3).
57/// If known, the Charge Point MAY also report the phase rotation between the grid connection and
58/// the main energymeter by using index number Zero (0).
59/// Values are reported in CSL, formatted: 0.RST, 1.RST, 2.RTS
60pub const CONNECTOR_PHASE_ROTATION: &str = "ConnectorPhaseRotation";
61
62/// # From OCPP Specification
63/// Maximum number of items in a ConnectorPhaseRotation Configuration Key.
64pub const CONNECTOR_PHASE_ROTATION_MAX_LENGTH: &str = "ConnectorPhaseRotationMaxLength";
65
66/// # From OCPP Specification
67/// Maximum number of requested configuration keys in a GetConfiguration.req PDU.
68pub const GET_CONFIGURATION_MAX_KEYS: &str = "GetConfigurationMaxKeys";
69
70/// # From OCPP Specification
71/// Interval of inactivity (no OCPP exchanges) with central system after which the Charge Point
72/// should send a Heartbeat.req PDU
73pub const HEARTBEAT_INTERVAL: &str = "HeartbeatInterval";
74
75/// # From OCPP Specification
76/// Percentage of maximum intensity at which to illuminate Charge Point lighting
77pub const LIGHT_INTENSITY: &str = "LightIntensity";
78
79/// # From OCPP Specification
80/// whether the Charge Point, when offline, will start a transaction for locally-authorized
81/// identifiers.
82pub const LOCAL_AUTHORIZE_OFFLINE: &str = "LocalAuthorizeOffline";
83
84/// # From OCPP Specification
85/// whether the Charge Point, when online, will start a transaction for locally-authorized
86/// identifiers without waiting for or requesting an Authorize.conf from the Central System
87pub const LOCAL_PRE_AUTHORIZE: &str = "LocalPreAuthorize";
88
89/// # From OCPP Specification
90/// Maximum energy in Wh delivered when an identifier is invalidated by the Central System after
91/// start of a transaction.
92pub const MAX_ENERGY_ON_INVALID_ID: &str = "MaxEnergyOnInvalidId";
93
94/// # From OCPP Specification
95/// Clock-aligned measurand(s) to be included in a MeterValues.req PDU, every
96/// ClockAlignedDataInterval seconds
97pub const METER_VALUES_ALIGNED_DATA: &str = "MeterValuesAlignedData";
98
99/// # From OCPP Specification
100/// Maximum number of items in a MeterValuesAlignedData Configuration Key.
101pub const METER_VALUES_ALIGNED_DATA_MAX_LENGTH: &str = "MeterValuesAlignedDataMaxLength";
102
103/// # From OCPP Specification
104/// Sampled measurands to be included in a MeterValues.req PDU, every METER_VALUE_SAMPLE_INTERVAL
105/// seconds. Where applicable, the Measurand is combined with the optional phase; for instance:
106/// Voltage.L1
107///
108/// Default: "Energy.Active.Import.Register"
109pub const METER_VALUES_SAMPLED_DATA: &str = "MeterValuesSampledData";
110
111/// # From OCPP Specification
112/// Maximum number of items in a MeterValuesSampledData Configuration Key.
113pub const METER_VALUES_SAMPLED_DATA_MAX_LENGTH: &str = "MeterValuesSampledDataMaxLength";
114
115/// # From OCPP Specification
116/// Interval between sampling of metering (or other) data, intended to be transmitted by
117/// "MeterValues" PDUs. For charging session data (ConnectorId>0), samples are acquired and
118/// transmitted periodically at this interval from the start of the charging transaction.
119///
120/// A value of "0" (numeric zero), by convention, is to be interpreted to mean that no sampled data
121/// should be transmitted.
122pub const METER_VALUE_SAMPLE_INTERVAL: &str = "MeterValueSampleInterval";
123
124/// # From OCPP Specification
125/// The minimum duration that a Charge Point or Connector status is stable before a
126/// StatusNotification.req PDU is sent to the Central System.
127pub const MINIMUM_STATUS_DURATION: &str = "MinimumStatusDuration";
128
129/// # From OCPP Specification
130/// The number of physical charging connectors of this Charge Point.
131pub const NUMBER_OF_CONNECTORS: &str = "NumberOfConnectors";
132
133/// # From OCPP Specification
134/// Number of times to retry an unsuccessful reset of the Charge Point.
135pub const RESET_RETRIES: &str = "ResetRetries";
136
137/// # From OCPP Specification
138/// When set to true, the Charge Point SHALL administratively stop the transaction when the cable
139/// is unplugged from the EV.
140pub const STOP_TRANSACTION_ON_EV_SIDE_DISCONNECT: &str = "StopTransactionOnEVSideDisconnect";
141
142/// # From OCPP Specification
143/// whether the Charge Point will stop an ongoing transaction when it receives a non- Accepted
144/// authorization status in a StartTransaction.conf for this transaction
145pub const STOP_TRANSACTION_ON_INVALID_ID: &str = "StopTransactionOnInvalidId";
146
147/// # From OCPP Specification
148/// Clock-aligned periodic measurand(s) to be included in the TransactionData element of
149/// StopTransaction.req MeterValues.req PDU for every ClockAlignedDataInterval of the Transaction
150pub const STOP_TXN_ALIGNED_DATA: &str = "StopTxnAlignedData";
151
152/// # From OCPP Specification
153/// Maximum number of items in a StopTxnAlignedData Configuration Key.
154pub const STOP_TXN_ALIGNED_DATA_MAX_LENGTH: &str = "StopTxnAlignedDataMaxLength";
155
156/// # From OCPP Specification
157/// Sampled measurands to be included in the TransactionData element of StopTransaction.req PDU,
158///every MeterValueSampleInterval seconds from the start of the charging session
159pub const STOP_TXN_SAMPLED_DATA: &str = "StopTxnSampledData";
160
161/// # From OCPP Specification
162/// Maximum number of items in a StopTxnSampledData Configuration Key.
163pub const STOP_TXN_SAMPLED_DATA_MAX_LENGTH: &str = "StopTxnSampledDataMaxLength";
164
165/// # From OCPP Specification
166/// A list of supported Feature Profiles. Possible profile identifiers: Core, FirmwareManagement,
167/// LocalAuthListManagement, Reservation, SmartCharging and RemoteTrigger.
168pub const SUPPORTED_FEATURE_PROFILES: &str = "SupportedFeatureProfiles";
169
170/// # From OCPP Specification
171/// Maximum number of items in a SupportedFeatureProfiles Configuration Key.
172pub const SUPPORTED_FEATURE_PROFILES_MAX_LENGTH: &str = "SupportedFeatureProfilesMaxLength";
173
174/// # From OCPP Specification
175/// How often the Charge Point should try to submit a transaction-related message when the Central
176/// System fails to process it.
177pub const TRANSACTION_MESSAGE_ATTEMPTS: &str = "TransactionMessageAttempts";
178
179/// # From OCPP Specification
180/// How long the Charge Point should wait before resubmitting a transaction-related message that
181/// the Central System failed to process.
182pub const TRANSACTION_MESSAGE_RETRY_INTERVAL: &str = "TransactionMessageRetryInterval";
183
184/// # From OCPP Specification
185/// When set to true, the Charge Point SHALL unlock the cable on Charge Point side when the cable
186/// is unplugged at the EV.
187pub const UNLOCK_CONNECTOR_ON_EV_SIDE_DISCONNECT: &str = "UnlockConnectorOnEVSideDisconnect";
188
189/// # From OCPP Specification
190/// Only relevant for websocket implementations. 0 disables client side websocket Ping/Pong. In
191/// this case there is either no ping/pong or the server initiates the ping and client responds
192/// with Pong. Positive values are interpreted as number of seconds between pings. Negative values
193/// are not allowed. ChangeConfiguration is expected to return a REJECTED result.
194pub const WEB_SOCKET_PING_INTERVAL: &str = "WebSocketPingInterval";
195
196/// # From OCPP Specification
197/// whether the Local Authorization List is enabled
198pub const LOCAL_AUTH_LIST_ENABLED: &str = "LocalAuthListEnabled";
199
200/// # From OCPP Specification
201/// Maximum number of identifications that can be stored in the Local Authorization List
202pub const LOCAL_AUTH_LIST_MAX_LENGTH: &str = "LocalAuthListMaxLength";
203
204/// # From OCPP Specification
205/// Maximum number of identifications that can be send in a single SendLocalList.req
206pub const SEND_LOCAL_LIST_MAX_LENGTH: &str = "SendLocalListMaxLength";
207
208/// # From OCPP Specification
209/// If this configuration key is present and set to true: Charge Point support reservations on
210/// connector 0.
211pub const RESERVE_CONNECTOR_ZERO_SUPPORTED: &str = "ReserveConnectorZeroSupported";
212
213/// # From OCPP Specification
214/// Max StackLevel of a ChargingProfile. The number defined also indicates the max allowed number
215/// of installed charging schedules per Charging Profile Purposes.
216pub const CHARGE_PROFILE_MAX_STACK_LEVEL: &str = "ChargeProfileMaxStackLevel";
217
218/// # From OCPP Specification
219/// A list of supported quantities for use in a ChargingSchedule. Allowed values: 'Current' and
220/// 'Power'
221pub const CHARGING_SCHEDULE_ALLOWED_CHARGING_RATE_UNIT: &str =
222 "ChargingScheduleAllowedChargingRateUnit";
223
224/// # From OCPP Specification
225/// Maximum number of periods that may be defined per ChargingSchedule.
226pub const CHARGING_SCHEDULE_MAX_PERIODS: &str = "ChargingScheduleMaxPeriods";
227
228/// # From OCPP Specification
229/// If defined and true, this Charge Point support switching from 3 to 1 phase during a Transaction.
230pub const CONNECTOR_SWITCH_3_TO_1_PHASE_SUPPORTED: &str = "ConnectorSwitch3to1PhaseSupported";
231
232/// # From OCPP Specification
233/// Maximum number of Charging profiles installed at a time
234pub const MAX_CHARGING_PROFILES_INSTALLED: &str = "MaxChargingProfilesInstalled";
235
236#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
237pub struct ChangeConfigurationRequest {
238 #[validate(length(min = 1, max = 50))]
239 pub key: String,
240 #[validate(length(min = 1, max = 500))]
241 pub value: String,
242}
243
244#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
245pub struct ChangeConfigurationResponse {
246 pub status: ConfigurationStatus,
247}