ocpp/protocol/v1_6
OCPP 1.6 bindings for the protocol machines.
Thin config constructors that bind the version-generic machines —
ocpp/protocol/endpoint, ocpp/protocol/station and
ocpp/protocol/csms — to the OCPP 1.6 message unions and codecs in
ocpp/v1_6/dispatch. The machines themselves know nothing about any
OCPP version; everything version-specific enters through the values
built here:
endpoint_configwires the dispatch module’s encoders/decoders into the generic RPC endpoint, soreq/resaredispatch.Request/dispatch.Response.station_configadds the charge-point lifecycle bindings: theBootNotificationrequest to (re)send, how to read the central system’s registration decision out of a response, and how to build aHeartbeatrequest.csms_configadds the central-system-side bindings: recognising an inboundBootNotificationand reading the registration decision out of the application’s reply to one.
The wire carries the boot response’s interval in seconds (per the
1.6 spec); the machines measure time in milliseconds, so the readers
here multiply by 1000.
1.6-specific semantics
OCPP 1.6 predates the SEND and CALLRESULTERROR frames — its OCPP-J RPC
framework has only CALL, CALLRESULT and CALLERROR. The generic machines
still accept SendRequested (they are version-agnostic and cannot
forbid it), so not using it is caller policy: an application bound to
1.6 through this module MUST NOT issue SendRequested, and a compliant
1.6 peer will never put a SEND or CALLRESULTERROR frame on the wire.
Payload-wise, 1.6 messages carry no CustomData extension point either;
the request/response records in ocpp/v1_6 are exactly the spec fields.
Values
pub fn csms_config(
call_timeout_ms call_timeout_ms: Int,
enforcement enforcement: csms.RegistrationEnforcement,
) -> csms.CsmsConfig(dispatch.Request, dispatch.Response)
A csms.CsmsConfig speaking OCPP
1.6: inbound BootNotification CALLs are the boot requests, and the
registration decision is the status of the application’s
BootNotification response. With enforcement: csms.RejectUnregistered,
non-boot CALLs from a charge point whose boot has not been accepted are
answered with a CALLERROR SecurityError instead of being delivered.
pub fn endpoint_config(
call_timeout_ms call_timeout_ms: Int,
) -> endpoint.Config(dispatch.Request, dispatch.Response)
An endpoint.Config speaking OCPP
1.6: requests and responses are the ocpp/v1_6/dispatch unions, with
that module’s codecs doing the action mapping. call_timeout_ms is how
long an outgoing CALL may remain unanswered before it fails with
TimedOut.
pub fn station_config(
call_timeout_ms call_timeout_ms: Int,
boot_request boot_request: boot_notification.Request,
boot_retry_ms boot_retry_ms: Int,
) -> station.StationConfig(dispatch.Request, dispatch.Response)
A station.StationConfig
speaking OCPP 1.6. boot_request is the BootNotification payload the
charge point introduces itself with (resent verbatim on every retry);
heartbeats are bare Heartbeat requests. boot_retry_ms is the fallback
wait before re-booting when the central system supplies no usable
interval — see the station module for the full rules.