Z-Wave Serial API frame codec (PROTOCORE_ENABLE_ZWAVE) - Silicon Labs controller.
More...
|
| | EMBED_ENUM_BYTE (protocore_zwave_type, ZWAVE_REQ=0x00, ZWAVE_RES=0x01,) |
| | Data-frame type.
|
| | PROTOCORE_NS_LAYOUT (ZwaveNs, build_frame, parse_frame, is_ack, is_nak, is_can, build_ack) |
| uint16_t | protocore_zwave_build_frame (const uint8_t *work, protocore_zwave_type type, uint8_t cmd, const uint8_t *data, uint8_t data_len, uint8_t *out, uint16_t cap) |
| | Assemble a data frame carrying type + cmd + data into out.
|
| int | protocore_zwave_parse_frame (const uint8_t *work, const uint8_t *raw, uint16_t len, uint8_t *type, uint8_t *cmd, const uint8_t **pdata, uint8_t *pdata_len) |
| | Frame one data frame from the front of raw and verify the checksum.
|
| embed_bool | protocore_zwave_is_ack (const uint8_t *work, uint8_t b) |
| | True if b is the ACK control byte.
|
| embed_bool | protocore_zwave_is_nak (const uint8_t *work, uint8_t b) |
| | True if b is the NAK control byte.
|
| embed_bool | protocore_zwave_is_can (const uint8_t *work, uint8_t b) |
| | True if b is the CAN control byte.
|
| uint16_t | protocore_zwave_build_ack (const uint8_t *work, uint8_t *out, uint16_t cap) |
| | Write the single ACK byte into out. 1, or 0 if cap < 1.
|
Z-Wave Serial API frame codec (PROTOCORE_ENABLE_ZWAVE) - Silicon Labs controller.
The host-side Serial API of a Silicon Labs 500 / 700-series Z-Wave controller reached over UART: a Z-Wave mesh bridged to the web. The host and the controller exchange data frames:
SOF (0x01) | LEN | Type | Command | Data... | Checksum
where LEN counts Type + Command + Data + Checksum, Type is 0x00 (REQ) or 0x01 (RES), and the checksum is 0xFF XOR-folded over LEN through the last Data byte. Each data frame is acknowledged by a single-byte ACK (0x06), or rejected with NAK (0x15) / CAN (0x18).
protocore_zwave_build_frame() assembles a data frame carrying a function command, protocore_zwave_parse_frame() frames + verifies one, and protocore_zwave_is_ack() / protocore_zwave_is_nak() / protocore_zwave_is_can() / protocore_zwave_build_ack() handle the flow-control bytes. The per-command payload (GetVersion, SendData, AddNodeToNetwork, an ApplicationCommandHandler report, ...) is the application's. Pure - you carry the bytes over your UART - so it is fully host-testable.
work is bytes the CALLER holds. This module reads none of them: it carries nothing between calls, so there is no state to keep and nothing to wipe. The parameter is there so a caller drives every namespace the same way.
- Author
- Douglas Quigg (dstroy0)
- Date
- 2026
Definition in file zwave.h.