Communication Protocol - microsoft/ExpressivePixels GitHub Wiki
The Expressive Pixels communication protocol whether it be over Bluetooth or USB, is based on the COBS (Consistent Overhead Byte Stuffing) protocol. This packet framing protocol ensures that a byte stream of logical packets can reliably re-sync should packets/data be lost. Expressive Pixels layers its application level protocol over the COBS layer, so logical frames are sent with one or more COBS packets.
Each Expressive Pixels frame starts with a framing header describing how the application data is structured within the frame, followed by successive simple headers for the remaining COBS packets.
Item | Description |
---|---|
frameType | 8-bit integer denoting whether a COBS packet is the first header (EPX_FRAMETYPE_HEADERPLUSDATA), or subsequent packet (EPX_FRAMETYPE_DATA) |
format | 8-bit integer containing the format of data in the COBS packet, binary data, JSON data, or binary ACK |
length | 16-bit integer containing the byte length of the application frame data |
flags | 8-bit integer containing transport configuration information, such as if the protocol is flow rate controlled |