pub struct DeviceProxy { /* private fields */ }
Implementations§
source§impl DeviceProxy
impl DeviceProxy
sourcepub fn take_event_stream(&self) -> DeviceEventStream
pub fn take_event_stream(&self) -> DeviceEventStream
Get a Stream of events from the remote end of the Device protocol
Panics
Panics if the event stream was already taken.
sourcepub fn get_device_speed(&self) -> QueryResponseFut<u32>
pub fn get_device_speed(&self) -> QueryResponseFut<u32>
Returns the speed of the USB device as a usb_speed_t value.
sourcepub fn get_device_descriptor(&self) -> QueryResponseFut<[u8; 18]>
pub fn get_device_descriptor(&self) -> QueryResponseFut<[u8; 18]>
Returns the device’s USB device descriptor.
sourcepub fn get_configuration_descriptor_size(
&self,
config: u8
) -> QueryResponseFut<(i32, u16)>
pub fn get_configuration_descriptor_size( &self, config: u8 ) -> QueryResponseFut<(i32, u16)>
Returns the total size of the USB configuration descriptor for the given configuration.
sourcepub fn get_configuration_descriptor(
&self,
config: u8
) -> QueryResponseFut<(i32, Vec<u8>)>
pub fn get_configuration_descriptor( &self, config: u8 ) -> QueryResponseFut<(i32, Vec<u8>)>
Returns the device’s USB configuration descriptor for the given configuration.
sourcepub fn get_string_descriptor(
&self,
desc_id: u8,
lang_id: u16
) -> QueryResponseFut<(i32, String, u16)>
pub fn get_string_descriptor( &self, desc_id: u8, lang_id: u16 ) -> QueryResponseFut<(i32, String, u16)>
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
) -> QueryResponseFut<i32>
pub fn set_interface( &self, interface_number: u8, alt_setting: u8 ) -> QueryResponseFut<i32>
Selects an alternate setting for an interface on a USB device.
sourcepub fn get_device_id(&self) -> QueryResponseFut<u32>
pub fn get_device_id(&self) -> QueryResponseFut<u32>
Returns an implementation specific device ID for a USB device. For informational purposes only.
sourcepub fn get_hub_device_id(&self) -> QueryResponseFut<u32>
pub fn get_hub_device_id(&self) -> QueryResponseFut<u32>
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) -> QueryResponseFut<u8>
pub fn get_configuration(&self) -> QueryResponseFut<u8>
Returns the device’s current configuration.
sourcepub fn set_configuration(&self, configuration: u8) -> QueryResponseFut<i32>
pub fn set_configuration(&self, configuration: u8) -> QueryResponseFut<i32>
Sets the device’s current configuration.
Trait Implementations§
source§impl Clone for DeviceProxy
impl Clone for DeviceProxy
source§fn clone(&self) -> DeviceProxy
fn clone(&self) -> DeviceProxy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DeviceProxy
impl Debug for DeviceProxy
source§impl DeviceProxyInterface for DeviceProxy
impl DeviceProxyInterface for DeviceProxy
type GetDeviceSpeedResponseFut = QueryResponseFut<u32>
fn get_device_speed(&self) -> Self::GetDeviceSpeedResponseFut
type GetDeviceDescriptorResponseFut = QueryResponseFut<[u8; 18]>
fn get_device_descriptor(&self) -> Self::GetDeviceDescriptorResponseFut
type GetConfigurationDescriptorSizeResponseFut = QueryResponseFut<(i32, u16)>
fn get_configuration_descriptor_size( &self, config: u8 ) -> Self::GetConfigurationDescriptorSizeResponseFut
type GetConfigurationDescriptorResponseFut = QueryResponseFut<(i32, Vec<u8, Global>)>
fn get_configuration_descriptor( &self, config: u8 ) -> Self::GetConfigurationDescriptorResponseFut
type GetStringDescriptorResponseFut = QueryResponseFut<(i32, String, u16)>
fn get_string_descriptor( &self, desc_id: u8, lang_id: u16 ) -> Self::GetStringDescriptorResponseFut
type SetInterfaceResponseFut = QueryResponseFut<i32>
fn set_interface( &self, interface_number: u8, alt_setting: u8 ) -> Self::SetInterfaceResponseFut
type GetDeviceIdResponseFut = QueryResponseFut<u32>
fn get_device_id(&self) -> Self::GetDeviceIdResponseFut
type GetHubDeviceIdResponseFut = QueryResponseFut<u32>
fn get_hub_device_id(&self) -> Self::GetHubDeviceIdResponseFut
type GetConfigurationResponseFut = QueryResponseFut<u8>
fn get_configuration(&self) -> Self::GetConfigurationResponseFut
type SetConfigurationResponseFut = QueryResponseFut<i32>
fn set_configuration( &self, configuration: u8 ) -> Self::SetConfigurationResponseFut
source§impl Proxy for DeviceProxy
impl Proxy for DeviceProxy
§type Protocol = DeviceMarker
type Protocol = DeviceMarker
Proxy
controls.