pub struct DeviceDescriptor {
pub bcd_usb: u16,
pub device_class: u8,
pub device_subclass: u8,
pub device_protocol: u8,
pub max_packet_size0: u8,
pub vendor_id: u16,
pub product_id: u16,
pub bcd_device: u16,
pub manufacturer: StringIndex,
pub product: StringIndex,
pub serial_number: StringIndex,
pub num_configurations: u8,
}Expand description
Standard USB Device Descriptor.
Each USB device has exactly one device descriptor, which contains information that applies globally to the device and all of it’s configurations (USB 2.0 §9.6.1).
Fields§
§bcd_usb: u16USB specification version that the device and it’s descriptors comply to.
device_class: u8Class code.
If the class is 0, then each configuration interface has an independent class code.
If the class is 0xff, then the device class is vendor-specific.
device_subclass: u8Subclass code.
If the class is 0, then the subclass must be 0.
If the subclass is 0xff, then the device subclass is vendor-specific.
device_protocol: u8Protocol code.
If the protocol is 0, then there is no class-specific device protocol. However, individual interfaces may still use a class-specific protocol.
If the protocol is 0xff, then the device protocol is vendor-specific.
max_packet_size0: u8Maximum packet size for endpoint 0.
For USB 2.0, the only valid sizes are 8, 16, 32, 64. For USB 3.2, this value is a 2-based exponent.
vendor_id: u16Vendor ID.
product_id: u16Product ID.
bcd_device: u16Device version.
manufacturer: StringIndexManufacturer string.
product: StringIndexProduct string.
serial_number: StringIndexSerial number string.
num_configurations: u8Number of possible configurations.
Trait Implementations§
Source§impl Clone for DeviceDescriptor
impl Clone for DeviceDescriptor
Source§fn clone(&self) -> DeviceDescriptor
fn clone(&self) -> DeviceDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeviceDescriptor
impl Debug for DeviceDescriptor
Source§impl ExtendableDescriptor for DeviceDescriptor
impl ExtendableDescriptor for DeviceDescriptor
Source§fn match_bytes(bytes: &[u8]) -> Result<(), DescriptorError>
fn match_bytes(bytes: &[u8]) -> Result<(), DescriptorError>
bytes with this descriptor. Read moreSource§fn prepare_bytes(bytes: &mut [u8], len: u8) -> Result<(), DescriptorError>where
Self: WritableDescriptor,
fn prepare_bytes(bytes: &mut [u8], len: u8) -> Result<(), DescriptorError>where
Self: WritableDescriptor,
bytes to receive descriptor data. Read more