DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
thread.h File Reference

Thread spinel / HDLC-lite framing codec (DETWS_ENABLE_THREAD) - OpenThread RCP. More...

#include "ServerConfig.h"

Go to the source code of this file.

Detailed Description

Thread spinel / HDLC-lite framing codec (DETWS_ENABLE_THREAD) - OpenThread RCP.

The HDLC-lite framing that carries spinel frames to an OpenThread radio co-processor (an nRF52840 / EFR32 RCP) over UART - an 802.15.4 / Thread mesh bridged to IP and the web. HDLC-lite wraps each spinel frame by appending an FCS, byte-stuffing the reserved bytes, and terminating with a Flag:

[spinel payload | FCS(lo,hi)] –byte-stuffed--> ... | 0x7E

The FCS is the HDLC frame check sequence, CRC-16/X-25 (poly 0x1021 reflected, init 0xFFFF, reflected in/out, final XOR 0xFFFF), transmitted low byte first. The reserved bytes stuffed (as 0x7D, byte XOR 0x20) are the Flag 0x7E, the Escape 0x7D, XON 0x11, and XOFF 0x13.

spinel_frame_encode() wraps a payload; spinel_frame_decode() finds the flag, removes the stuffing, and verifies the FCS. spinel_fcs() is the shared checksum. The spinel command inside (a property get/set/insert, an 802.15.4 stream) is the application's. Pure - you carry the bytes over your UART - so it is fully host-testable.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file thread.h.