embedded-trainings-2020/embedded-workshop-book/src/inspecting-descriptors.md

55 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2020-07-13 11:48:24 +00:00
# Inspecting the Descriptors
2020-07-16 10:56:20 +00:00
There's a tool in the `advanced/host/` folder called `print-descs`, it prints all the descriptors reported by your application.
✅ Run this tool.
Your output should look like this:
2020-07-13 11:48:24 +00:00
``` console
2020-07-16 10:56:20 +00:00
$ cargo run
2020-07-13 11:48:24 +00:00
DeviceDescriptor {
bLength: 18,
bDescriptorType: 1,
bcdUSB: 512,
bDeviceClass: 0,
bDeviceSubClass: 0,
bDeviceProtocol: 0,
bMaxPacketSize: 64,
idVendor: 8224,
idProduct: 1815,
bcdDevice: 256,
iManufacturer: 0,
iProduct: 0,
iSerialNumber: 0,
bNumConfigurations: 1,
}
address: 22
config0: ConfigDescriptor {
bLength: 9,
bDescriptorType: 2,
wTotalLength: 18,
bNumInterfaces: 1,
bConfigurationValue: 42,
iConfiguration: 0,
bmAttributes: 192,
bMaxPower: 250,
extra: None,
}
iface0: [
InterfaceDescriptor {
bLength: 9,
bDescriptorType: 4,
bInterfaceNumber: 0,
bAlternateSetting: 0,
bNumEndpoints: 0,
bInterfaceClass: 0,
bInterfaceSubClass: 0,
bInterfaceProtocol: 0,
iInterface: 0,
},
]
```
The output above corresponds to the descriptor values we suggested. If you used different values, e.g. for `bMaxPower`, you'll a slightly different output.