pub struct DeviceSynchronousProxy { /* private fields */ }
Implementations§
Source§impl DeviceSynchronousProxy
impl DeviceSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<DeviceEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<DeviceEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn get_device_speed(
&self,
___deadline: MonotonicInstant,
) -> Result<u32, Error>
pub fn get_device_speed( &self, ___deadline: MonotonicInstant, ) -> Result<u32, Error>
Returns the speed of the USB device as a usb_speed_t value.
Sourcepub fn get_device_descriptor(
&self,
___deadline: MonotonicInstant,
) -> Result<[u8; 18], Error>
pub fn get_device_descriptor( &self, ___deadline: MonotonicInstant, ) -> Result<[u8; 18], Error>
Returns the device’s USB device descriptor.
Sourcepub fn get_configuration_descriptor_size(
&self,
config: u8,
___deadline: MonotonicInstant,
) -> Result<(i32, u16), Error>
pub fn get_configuration_descriptor_size( &self, config: u8, ___deadline: MonotonicInstant, ) -> Result<(i32, u16), Error>
Returns the total size of the USB configuration descriptor for the given configuration.
Sourcepub fn get_configuration_descriptor(
&self,
config: u8,
___deadline: MonotonicInstant,
) -> Result<(i32, Vec<u8>), Error>
pub fn get_configuration_descriptor( &self, config: u8, ___deadline: MonotonicInstant, ) -> Result<(i32, Vec<u8>), Error>
Returns the device’s USB configuration descriptor for the given configuration.
Sourcepub fn get_string_descriptor(
&self,
desc_id: u8,
lang_id: u16,
___deadline: MonotonicInstant,
) -> Result<(i32, String, u16), Error>
pub fn get_string_descriptor( &self, desc_id: u8, lang_id: u16, ___deadline: MonotonicInstant, ) -> Result<(i32, String, u16), Error>
Fetches a string descriptor from the USB device.
desc_id : The ID of the string descriptor to fetch, or 0 to fetch the language table instead.
lang_id : The language ID of the string descriptor to fetch. If no matching language ID is present in the device’s language ID table, the first entry of the language ID table will be substituted. actual_lang_id : The actual language ID of the string fetched, or 0 for the language ID table.
The worst case size for the payload of a language ID table should be 252 bytes, meaning that a 256 byte buffer should always be enough to hold any language ID table.
The worst case size for a UTF-8 encoded string descriptor payload should be 378 bytes (126 UTF-16 code units with a worst case expansion factor of 3)
Sourcepub fn set_interface(
&self,
interface_number: u8,
alt_setting: u8,
___deadline: MonotonicInstant,
) -> Result<i32, Error>
pub fn set_interface( &self, interface_number: u8, alt_setting: u8, ___deadline: MonotonicInstant, ) -> Result<i32, Error>
Selects an alternate setting for an interface on a USB device.
Sourcepub fn get_device_id(&self, ___deadline: MonotonicInstant) -> Result<u32, Error>
pub fn get_device_id(&self, ___deadline: MonotonicInstant) -> Result<u32, Error>
Returns an implementation specific device ID for a USB device. For informational purposes only.
Sourcepub fn get_hub_device_id(
&self,
___deadline: MonotonicInstant,
) -> Result<u32, Error>
pub fn get_hub_device_id( &self, ___deadline: MonotonicInstant, ) -> Result<u32, Error>
Returns the implementation specific device ID for the hub that a USB device is connected to. For informational purposes only.
Sourcepub fn get_configuration(
&self,
___deadline: MonotonicInstant,
) -> Result<u8, Error>
pub fn get_configuration( &self, ___deadline: MonotonicInstant, ) -> Result<u8, Error>
Returns the device’s current configuration.
Sourcepub fn set_configuration(
&self,
configuration: u8,
___deadline: MonotonicInstant,
) -> Result<i32, Error>
pub fn set_configuration( &self, configuration: u8, ___deadline: MonotonicInstant, ) -> Result<i32, Error>
Sets the device’s current configuration.
Trait Implementations§
Source§impl Debug for DeviceSynchronousProxy
impl Debug for DeviceSynchronousProxy
Source§impl SynchronousProxy for DeviceSynchronousProxy
impl SynchronousProxy for DeviceSynchronousProxy
Source§type Proxy = DeviceProxy
type Proxy = DeviceProxy
Source§type Protocol = DeviceMarker
type Protocol = DeviceMarker
Proxy
controls.