[−][src]Function hid_io::protocol::hidio::payload_len
pub fn payload_len(packet_data: &mut Vec<u8>) -> Result<u32, HIDIOParseError>
Determines payload of packet from a byte stream
Arguments
packet_data
- Vector of bytes
Remarks
Uses a packet byte stream to determine payload length. This length does not include the first 2 packet bytes in the overall packet length. The length does include the bytes used for the packet Id.
struct HIDIO_Packet {
... (6 bits)
uint8_t upper_len:2; // Upper 2 bits of length field (generally unused)
uint8_t len; // Lower 8 bits of length field
...
};