openusb_parse_data
format
A character string indicating the format that application
requires. Character 'b' represents one byte, 'w' for word and
'd' for dword(4 bytes). Specially, character '.' indicates
skipping one byte of source data.
data
Little endian raw data that will be parsed.
datalen
Length of data.
structure
Address of the returned structure where the unpacked data will
be stored
structlen
Length of structure.
count
Number of bytes parsed.
openusb_parse_data()
can parse little endian raw data and convert it to
structured data. It's basically used to parse USB descriptors.
For exampe, to parse a descriptor such as:
struct test_descr { uint8_t a; uint16_t b; uint8_t c; uint32_t d; }; |
The application would call: