QCC3040----GAIA protocol协议解析
This is the protocol used for all vendor specific commands. Fields longer than 1 octet is sent in big endian order. A packet consists of: ``` 0 bytes 1 2 3 4 5 6 7 8 len+8 len+9 +--------+--------+--------+--------+--------+--------+--------+--------+ +--------+--/ /---+ +--------+ | SOF |VERSION | FLAGS | LENGTH | VENDOR ID | COMMAND ID | | PAYLOAD ... | | CHECK | +--------+--------+--------+--------+--------+--------+--------+--------+ +--------+--/ /---+ +--------+ ``` | Field | Length (bytes) | Description | |---------------|----------------| -------------| | SOF | 1 | Start of frame, one octet with the fixed value 0xff. | | Version | 1 | This field indicates the protocol version in use. | | Flags | 1 | Bits within this field control protocol options: Bit[0]: If set, a single octet check is present. Bit[1:7]: Reserved, must be 0. | | Length | 1 | Number of payload bytes. | | Vendor ID | 2 | Vendor ID. | | Command ID | 2 | Command ID. In command responses, the highest bit (0x8000) is set. | | Payload | Length | The payload contains any information that a specific command must pass. It consists of zero or more octets depending on the command. | | Check | 1 | If present, this field is determined by XORing together the other octets in the packet. |