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.
- Frame
Writer - Incremental frame builder over a caller-provided buffer.
- Header
- Validated frame header byte.
- Multi
Entries - Iterator over the entries of a
CMD_PROP_MULTI_SETorCMD_PROP_AREpayload. - Multi
Entry - One entry of a
CMD_PROP_MULTI_SETorCMD_PROP_AREpayload. - Multi
GetKeys - Iterator over the property identifiers of a
CMD_PROP_MULTI_GETpayload. - Prop
Payload - Payload of
CMD_PROP_GET,CMD_PROP_SET, andCMD_PROP_IS. - Stream
Payload - Payload of
CMD_STR_SENDandCMD_STR_RECV.
Enums§
- Cmd
- Command identifiers defined by the minimal and full specs.
- Parse
Error - Write
Error
Constants§
- HEADER_
FLG_ MASK - Mask of the two most significant header bits (the
FLGfield). - HEADER_
FLG_ PATTERN - Required value of the
FLGfield (0b10in 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§
- ble_
clear_ bonds - Encode a
CMD_BLE_CLEAR_BONDSframe (no payload). The device answers once the bonds are gone, which over Bluetooth is the last thing the sender hears before it is dropped. - clear
- Encode a
CMD_CLEARframe (no payload). - entry_
len - Space a multi-property entry occupies, its length prefix included.
- factory_
reset - Encode a
CMD_FACTORY_RESETframe (no payload). The device erases all mutable state and reboots without replying. - last_
status - Encode a
CMD_PROP_ISframe carryingPROP_LAST_STATUS. - nop
- Encode a
CMD_NOPframe. - prop_
are - Begin a
CMD_PROP_AREframe, to which the caller appends entries withFrameWriter::write_entryandFrameWriter::write_status_entry. - prop_
get - Encode a
CMD_PROP_GETframe. - prop_
insert - Encode a
CMD_PROP_INSERTframe.itemis one item in the property’s item form, with no length prefix. - prop_
inserted - Encode a
CMD_PROP_INSERTEDframe.digestis the inserted item in the property’s digest form — never in a form containing key material. - prop_is
- Encode a
CMD_PROP_ISframe. - prop_
multi_ get - Encode a
CMD_PROP_MULTI_GETframe: the property identifiers one after another, with no delimiters. - prop_
multi_ set - Encode a
CMD_PROP_MULTI_SETframe from key and value pairs. - prop_
remove - Encode a
CMD_PROP_REMOVEframe.selectoris the property’s documented item selector, with no length prefix. - prop_
removed - Encode a
CMD_PROP_REMOVEDframe.digestis the removed item in the property’s digest form. - prop_
set - Encode a
CMD_PROP_SETframe. - queue_
drain - Encode a
CMD_QUEUE_DRAINframe (no payload). - reboot
- Encode a
CMD_REBOOTframe (no payload). The device restarts without replying, keeping everything it has persisted. - reset
- Encode a
CMD_RSTframe. - restore
- Encode a
CMD_RESTOREframe (no payload). - save
- Encode a
CMD_SAVEframe (no payload). - str_
recv - Encode a
CMD_STR_RECVframe. Always uses TID zero. - str_
send - Encode a
CMD_STR_SENDframe.