Skip to main content

Crate codetics_ocpp_core

Crate codetics_ocpp_core 

Source
Expand description

Version-independent building blocks shared by every OCPP-J version.

Each OCPP version lives in its own crate (ocpp16, ocpp201, ocpp21); this crate only holds what the OCPP-J transport specifications define identically (or near-identically) for all of them.

Re-exports§

pub use datetime::DateTime;
pub use error::ErrorCode;
pub use error::ErrorDialect;
pub use error::RpcError;
pub use msgid::MessageIdGenerator;
pub use rpc::Frame;
pub use rpc::MessageTypeId;
pub use validate::Path;
pub use validate::Validate;
pub use validate::Violation;
pub use validate::ViolationKind;
pub use version::OcppVersion;

Modules§

datetime
Minimal RFC 3339 date-time type, sufficient for OCPP dateTime fields.
error
RPC framework error codes (CALLERROR / CALLRESULTERROR).
msgid
Message id generation.
rpc
OCPP-J RPC framing (OCPP-J 1.6 §4, OCPP 2.0.1/2.1 Part 4 §4).
validate
Schema constraint validation for generated message types.
version
OCPP version negotiation through the WebSocket subprotocol.

Traits§

Request
Ties a request payload type to its action name and response type.

Functions§

decode_payload
Deserializes and validates an OCPP payload, mapping failures to the OCPP-J RPC error code that best describes them.
decode_value
Same as decode_payload but starting from an already parsed JSON value.