# hid-decode crate
This crate contains tools for decoding USB HID report descriptors.
At this time it's only able to decode to text-- in the future it may permit decoding to
types from the `hid-types` crate.
### Example
```rust
// This was generated by an example in the `hid-descriptor` crate sources.
static GAMEPAD_DESCRIPTOR: &[u8] = include_bytes!("gamepad.bin");
let mut output = Vec::new();
hid_decode::decode(&mut output, GAMEPAD_DESCRIPTOR.iter().copied()).expect("write error");
let output = String::try_from(output).expect("non-UTF8 output");
assert_eq!(
output.lines().collect::<Vec<_>>(),
[
"Usage Page: GenericDesktop",
"Usage: Gamepad",
"Collection: Application",
"Usage Page: Button",
"Usage Minimum: 1",
"Usage Maximum: 8",
"Logical Minimum: 0",
"Logical Maximum: 1",
"Report Size: 1",
"Report Count: 8",
"Input: Data Variable Absolute No-Wrap Linear Preferred-State No-Null-Position Bit-Field",
"EndCollection",
]
);
```