Expand description
Value sets the specification defines for fields its JSON schemas type as bare strings.
A field like Variable.name or SecurityEventNotification.type is
just {"type": "string", "maxLength": N} in the schema, with the
permitted values listed in a specification appendix instead. Those
appendix tables are vendored under csv/ and generated into this
module.
Nothing here changes a wire type. OCPP permits vendor-specific
values for these fields, so the message structs keep their
heapless::String fields and these enums sit alongside:
§Open and closed value sets
The sets a deployment realistically extends – components,
variables, configuration keys – are open: they carry an
Other variant, so a third-party value survives a
deserialize/serialize round trip. Use from_wire_or_other to
accept any value, from_wire to ask whether a value is one the
specification defines, and is_standardized to tell them apart
afterwards. Their equality and hashing compare the wire string,
so Other("X") and the X variant are one value.
The rest are closed: one byte, Copy, and from_wire
returning None is the only outcome for an unrecognized value.
An open set is neither Copy nor one byte – it is as wide as
the field’s maxLength – which is why it is opt-in per set.
use ocpp_types::v21::common::Variable;
use ocpp_types::v21::standard::VariableName;
let variable = Variable {
name: heapless::String::try_from(VariableName::HeartbeatInterval.as_str()).unwrap(),
custom_data: None,
instance: None,
};Structs§
- Device
Model Entry - One
(component, variable)pair of the standardized device model. - Unknown
Value - Returned by
FromStrfor a value the specification doesn’t define. - Value
TooLong - Returned when a value is longer than the specification’s
maxLengthfor its field.
Enums§
- Additional
Info Type - Standardized
AdditionalInfo.typevalues. - Charging
Limit Source - Standardized
chargingLimitSourcevalues. - Component
Name - Standardized
Component.namevalues. - Connector
Type - Standardized
ConnectorcomponentConnectorTypevalues. - IdToken
Type - Standardized
IdToken.typevalues. - Payment
Brand - Standardized
paymentBrandvalues, for the ad hoc payment flow. - Payment
Recognition - Standardized
paymentRecognitionvalues, for the ad hoc payment flow. - Reason
Code - Standardized
StatusInfo.reasonCodevalues. - Security
Event - Standardized
SecurityEventNotificationRequest.typevalues. - Signing
Method - Standardized
signingMethodvalues, for ISO 15118 price schedule signatures. - Unit
- Standardized
UnitOfMeasure.unitvalues. - Variable
Name - Standardized
Variable.namevalues.
Constants§
- DEVICE_
MODEL - Every
(component, variable)pair the standardized device model defines (438).