ULCP: Minimum Requirements
This chapter is the conformance statement for ULCP. A device that meets
the requirements below is a ULCP device; everything past them is optional
and is discovered through PROP_CAPS or a command’s defined refusal.
There are no protocol levels, tiers, or profiles. A host that wants a plain frame pipe and a host that wants a fully provisioned companion radio speak the same protocol to the same devices and differ only in which capabilities they look for. A device implements the subsystems its hardware and purpose call for and advertises exactly those.
Framing
A device MUST implement the frame format
in full: the header with its FLG, RESERVED, and TID fields, the
packed unsigned integer encoding
for command, property, and stream identifiers, and the transport’s
framing (HDLC-Lite on serial links, with the rules in
HDLC-Lite on a ULCP Link; the
GATT frame transport over BLE). A
frame the transport loses ends the link’s session, at either end (see
Lost Frames and
Sessions).
The TID discipline is normative in both directions: a device MUST NOT send a frame with a non-zero TID that is not a response to a frame it recently received with that TID, and all unsolicited commands MUST use TID zero.
Commands
| Id | Mnemonic | Required |
|---|---|---|
| 0 | CMD_NOP | Always |
| 1 | CMD_RST | Always |
| 2 | CMD_PROP_GET | Always |
| 3 | CMD_PROP_SET | Always |
| 6 | CMD_PROP_IS | Always |
| 9 | CMD_STR_SEND | Always |
| 10 | CMD_STR_RECV | Always |
| 17 | CMD_DFU | Always; unsupported methods return STATUS_UNIMPLEMENTED |
| 24 | CMD_SESSION_DID_END | Always |
| 28 | CMD_SESSION_START | Always |
| 29 | CMD_SESSION_DID_START | Always |
CMD_PROP_INSERT, CMD_PROP_REMOVE, and their notifications belong to
the base grammar rather than to any capability. A device that defines no
mutable multi-value property has
nothing to apply them to and rejects them under the ordinary property
rules. CMD_QUEUE_DRAIN, CMD_SAVE, and CMD_RESTORE belong to their
subsystems’ capabilities and MUST fail with STATUS_UNIMPLEMENTED
when the capability is not advertised, as MUST
CMD_REBOOT,
CMD_DFU, and
CMD_FACTORY_RESET without
CAP_REBOOT and
CMD_ANNOUNCE without CAP_ADVERT;
CMD_CLEAR is available regardless of capabilities (see
Saved State).
DFU implementations MUST validate the optional mode, require a nonzero
direct TID, finish fallible preparation before success, and wait for the
matching response’s transmission before handing off to the bootloader.
Transmission failure or timeout MUST cancel the handoff and invalidate
retained success. Tests must cover stale completions, administrative
retries, and replay-counter persistence failures; a build alone does not
qualify a bootloader’s supported DFU methods. See
CMD_DFU.
Properties
| Id | Mnemonic | Required |
|---|---|---|
| 0 | PROP_LAST_STATUS | Always |
| 1 | PROP_PROTOCOL_VERSION | Always |
| 2 | PROP_DEV_VERSION | Always |
| 3 | PROP_INTERFACE_TYPE | Always |
| 5 | PROP_CAPS | Always |
| 32 | PROP_PHY_ENABLED | Always, Get and Set |
| 35 | PROP_PHY_FREQ | Always |
| 37 | PROP_PHY_TX_POWER | Always |
| 38 | PROP_PHY_RSSI | Always |
| 42 | PROP_PHY_MTU | Always |
| 44 | PROP_PHY_T_FRAME | Always (new implementations) |
| 113 | STR_PHY_RAW | Always |
Some properties are neither always required nor capability-gated:
PROP_DEV_MODEL(4). Firmware built for a specific board SHOULD implement it.PROP_UPTIME(6). A device with a monotonic clock SHOULD implement it.PROP_RESET_REASON(7). A device that knows why it last started SHOULD implement it.PROP_PANIC_MESSAGE(8). A device whose firmware records a crash message that survives the restart SHOULD implement it.- The settings of the device’s own interface: its screen
(
PROP_DISPLAY_BRIGHTNESS,PROP_DISPLAY_TIMEOUT), its keyboard (PROP_KEYBOARD_LIGHT,PROP_KEYBOARD_AIDS,PROP_SETUP_COMPLETE) and key repeat (PROP_KEYBOARD_REPEAT_DELAY,PROP_KEYBOARD_REPEAT_INTERVAL), its sounder (PROP_SOUND_ENABLED,PROP_SOUND_VOLUME), and its directional control (PROP_DIRECTIONS_ENABLED). A device implements those for the parts it has.
A device that does not implement one of these answers
STATUS_PROP_NOT_FOUND, and a host discovers each by asking.
Every other property is gated by a capability. A device that does not
advertise the capability does not implement the property, and rejects it
with STATUS_PROP_NOT_FOUND or STATUS_UNIMPLEMENTED.
Status and Reset Reporting
A device MUST implement PROP_LAST_STATUS as the failure channel for
every command, using the most specific applicable
status code, and MUST emit a
reset code asynchronously after every reset.
A device that cannot determine the cause reports
STATUS_RESET_UNKNOWN rather than omitting the notification.
Optional Subsystems
Everything else in this specification is a capability. Each grants the commands and properties defined in its chapter, and a device MUST NOT advertise a capability without also advertising the capabilities it requires.
| Subsystem | Capabilities |
|---|---|
| Radio Control beyond the required properties | CAP_PHY_LORA, CAP_PHY_DUTY_LIMIT, CAP_STATS |
| Device Domain | CAP_DEV_IDENTITY, CAP_DEV_NAME, CAP_BATTERY, CAP_REPEATER, CAP_IDENT, CAP_ALERT, CAP_TIME, CAP_GNSS, CAP_ADVERT, CAP_ILLUMINANCE, CAP_DISPLAY_MOTION_WAKE |
| Saved State | CAP_SAVE |
| Tethered Host Services | CAP_HOST_FILTER, CAP_HOST_KEYS, CAP_HOST_RX_QUEUE, CAP_HOST_AUTO_ACK, CAP_MAC_BACKHAUL |
| Wi-Fi | CAP_WIFI_SCAN, CAP_WIFI, CAP_WIFI_AP |
| IP Connectivity | CAP_IPV4, CAP_IPV6 |
| Bridge Client | CAP_BRIDGE_CLIENT |
| IP Multicast | CAP_LAN_BEARER |
| I2C Bus Access | CAP_I2C |
A device advertising none of them is a transparent radio: it configures its PHY, transmits what it is given, and delivers everything it hears.
Requirements on Hosts
A conforming host:
- MUST tolerate unsolicited
CMD_PROP_IS,CMD_PROP_INSERTED, andCMD_PROP_REMOVEDnotifications at any time while attached, and update its view of the affected property accordingly. Device state changes for reasons the host did not initiate, and publication of the new authoritative value is how the protocol reports it. - MUST take the value in a
CMD_PROP_ISas the property’s value, and MUST NOT treat one that differs from what it wrote as an error. A write is refused by aPROP_LAST_STATUScarrying the failure and by nothing else; anything a device reports as a property value is what that property is, whether or not it is what was asked for—seePROP_PHY_TX_POWER, which a device clamps to what its radio can reach. A host that shows the value to a user shows the reported one. - MUST take
STATUS_PROP_NOT_FOUNDfor a property that is neither always required nor capability-gated as the device not having it, not as a failed attach. - MUST NOT treat a failed capability-gated property read as a failed attach. A device advertising a capability implements its properties, so a refusal is a device fault—but what is unknown is the setting, not the device. A host finishes the rest of the read, presents the affected setting as unavailable rather than as a default, and omits it from what it writes.
- MUST NOT assume that a reset implies documented factory defaults. On a device holding a saved snapshot the post-reset value of every saved property is its saved value; a host fetches or explicitly sets what it depends on.
- MUST establish its complete host domain on every tethered attach, if it uses host services at all, rather than reasoning about what the device already holds.
- MUST NOT write host-domain properties when it is merely administering a device rather than being that device’s host—see Two Kinds of Attach.
- SHOULD follow the post-attach procedure in Attach, Detach, and Synchronization.
- MUST end its session when a frame sent to it is
lost: on a connection link by detaching,
and on a serial link by starting a new session with
CMD_SESSION_START, as it also does afterCMD_SESSION_DID_ENDand for any other session-level error it cannot otherwise recover from. It ignores every frame that arrives before the reply.
Deployment Shapes
The capability sets that correspond to the familiar deployments, as a reader’s aid rather than a normative classification:
| Deployment | Typical capabilities |
|---|---|
| Transparent radio | CAP_WRITABLE_RAW_STREAM, CAP_PHY_LORA, CAP_PHY_DUTY_LIMIT |
| Companion radio | The above, plus CAP_HOST_FILTER, CAP_HOST_KEYS, CAP_HOST_RX_QUEUE, CAP_HOST_AUTO_ACK |
| Commissioned repeater | The above, plus CAP_DEV_IDENTITY, CAP_SAVE, CAP_REPEATER, CAP_IDENT |
| Radio for a wired application | CAP_DEV_IDENTITY, CAP_SAVE, CAP_NODE_MSG, with the application on the device’s own interface over a UART with flow control |
The same firmware ordinarily advertises all of them: which deployment a device is doing is a matter of what its operator provisioned, not of what it can do.