Function hid_io_protocol::packet_id[][src]

pub fn packet_id(packet_data: &[u8]) -> Result<u32, HidIoParseError>

Determines packet id from a byte stream

Arguments

Remarks

Uses a packet byte stream to determine packet Id.

struct HidIo_Packet {
   ... (4 bits)
   uint8_t           id_width:1;  // 0 - 16bits, 1 - 32bits
   ... (11 bits)
   uint16_t/uint32_t id;          // Id field (check id_width to see which struct to use)
   ...
};