Module frame

Module frame 

Source
Expand description

ULCP frame grammar.

A frame is a one-byte header, a one-byte command identifier, and a command-defined payload. Frame length is provided by the framing layer (see crate::hdlc for asynchronous serial links).

Structs§

Frame
A parsed frame borrowing its payload from the input.
FrameWriter
Incremental frame builder over a caller-provided buffer.
Header
Validated frame header byte.
PropPayload
Payload of CMD_PROP_GET, CMD_PROP_SET, and CMD_PROP_IS.
StreamPayload
Payload of CMD_STR_SEND and CMD_STR_RECV.

Enums§

Cmd
Command identifiers defined by the minimal and full specs.
ParseError
WriteError

Constants§

HEADER_FLG_MASK
Mask of the two most significant header bits (the FLG field).
HEADER_FLG_PATTERN
Required value of the FLG field (0b10 in the top two bits).
HEADER_RESERVED_MASK
Mask of the three reserved header bits, which must be zero.
HEADER_TID_MASK
Mask of the three-bit transaction identifier.
TID_MAX
Largest usable transaction identifier.
TID_UNSOLICITED
TID reserved for unsolicited commands and stream traffic.

Functions§

clear
Encode a CMD_CLEAR frame (no payload).
factory_reset
Encode a CMD_FACTORY_RESET frame (no payload). The device erases all mutable state and reboots without replying.
last_status
Encode a CMD_PROP_IS frame carrying PROP_LAST_STATUS.
nop
Encode a CMD_NOP frame.
prop_get
Encode a CMD_PROP_GET frame.
prop_insert
Encode a CMD_PROP_INSERT frame. item is one item in the property’s item form, with no length prefix.
prop_inserted
Encode a CMD_PROP_INSERTED frame. digest is the inserted item in the property’s digest form — never in a form containing key material.
prop_is
Encode a CMD_PROP_IS frame.
prop_remove
Encode a CMD_PROP_REMOVE frame. selector is the property’s documented item selector, with no length prefix.
prop_removed
Encode a CMD_PROP_REMOVED frame. digest is the removed item in the property’s digest form.
prop_set
Encode a CMD_PROP_SET frame.
queue_drain
Encode a CMD_QUEUE_DRAIN frame (no payload).
reset
Encode a CMD_RST frame.
restore
Encode a CMD_RESTORE frame (no payload).
save
Encode a CMD_SAVE frame (no payload).
str_recv
Encode a CMD_STR_RECV frame. Always uses TID zero.
str_send
Encode a CMD_STR_SEND frame.