pub struct DeviceProxy { /* private fields */ }
Implementations§
Source§impl DeviceProxy
impl DeviceProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.hardware.usb.device/Device.
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 protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn get_device_speed(
&self,
) -> QueryResponseFut<u32, DefaultFuchsiaResourceDialect>
pub fn get_device_speed( &self, ) -> QueryResponseFut<u32, DefaultFuchsiaResourceDialect>
Returns the speed of the USB device as a usb_speed_t value.
Sourcepub fn get_device_descriptor(
&self,
) -> QueryResponseFut<[u8; 18], DefaultFuchsiaResourceDialect>
pub fn get_device_descriptor( &self, ) -> QueryResponseFut<[u8; 18], DefaultFuchsiaResourceDialect>
Returns the device’s USB device descriptor.
Sourcepub fn get_configuration_descriptor_size(
&self,
config: u8,
) -> QueryResponseFut<(i32, u16), DefaultFuchsiaResourceDialect>
pub fn get_configuration_descriptor_size( &self, config: u8, ) -> QueryResponseFut<(i32, u16), DefaultFuchsiaResourceDialect>
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>), DefaultFuchsiaResourceDialect>
pub fn get_configuration_descriptor( &self, config: u8, ) -> QueryResponseFut<(i32, Vec<u8>), DefaultFuchsiaResourceDialect>
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), DefaultFuchsiaResourceDialect>
pub fn get_string_descriptor( &self, desc_id: u8, lang_id: u16, ) -> QueryResponseFut<(i32, String, u16), DefaultFuchsiaResourceDialect>
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, DefaultFuchsiaResourceDialect>
pub fn set_interface( &self, interface_number: u8, alt_setting: u8, ) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect>
Selects an alternate setting for an interface on a USB device.
Sourcepub fn get_device_id(
&self,
) -> QueryResponseFut<u32, DefaultFuchsiaResourceDialect>
pub fn get_device_id( &self, ) -> QueryResponseFut<u32, DefaultFuchsiaResourceDialect>
Returns an implementation specific device ID for a USB device. For informational purposes only.
Sourcepub fn get_hub_device_id(
&self,
) -> QueryResponseFut<u32, DefaultFuchsiaResourceDialect>
pub fn get_hub_device_id( &self, ) -> QueryResponseFut<u32, DefaultFuchsiaResourceDialect>
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, DefaultFuchsiaResourceDialect>
pub fn get_configuration( &self, ) -> QueryResponseFut<u8, DefaultFuchsiaResourceDialect>
Returns the device’s current configuration.
Sourcepub fn set_configuration(
&self,
configuration: u8,
) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect>
pub fn set_configuration( &self, configuration: u8, ) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect>
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>
type GetDeviceDescriptorResponseFut = QueryResponseFut<[u8; 18]>
type GetConfigurationDescriptorSizeResponseFut = QueryResponseFut<(i32, u16)>
type GetConfigurationDescriptorResponseFut = QueryResponseFut<(i32, Vec<u8>)>
type GetStringDescriptorResponseFut = QueryResponseFut<(i32, String, u16)>
type SetInterfaceResponseFut = QueryResponseFut<i32>
type GetDeviceIdResponseFut = QueryResponseFut<u32>
type GetHubDeviceIdResponseFut = QueryResponseFut<u32>
type GetConfigurationResponseFut = QueryResponseFut<u8>
type SetConfigurationResponseFut = QueryResponseFut<i32>
fn get_device_speed(&self) -> Self::GetDeviceSpeedResponseFut
fn get_device_descriptor(&self) -> Self::GetDeviceDescriptorResponseFut
fn get_configuration_descriptor_size( &self, config: u8, ) -> Self::GetConfigurationDescriptorSizeResponseFut
fn get_configuration_descriptor( &self, config: u8, ) -> Self::GetConfigurationDescriptorResponseFut
fn get_string_descriptor( &self, desc_id: u8, lang_id: u16, ) -> Self::GetStringDescriptorResponseFut
fn set_interface( &self, interface_number: u8, alt_setting: u8, ) -> Self::SetInterfaceResponseFut
fn get_device_id(&self) -> Self::GetDeviceIdResponseFut
fn get_hub_device_id(&self) -> Self::GetHubDeviceIdResponseFut
fn get_configuration(&self) -> Self::GetConfigurationResponseFut
fn set_configuration( &self, configuration: u8, ) -> Self::SetConfigurationResponseFut
Source§impl Proxy for DeviceProxy
impl Proxy for DeviceProxy
Source§type Protocol = DeviceMarker
type Protocol = DeviceMarker
Proxy
controls.Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Auto Trait Implementations§
impl Freeze for DeviceProxy
impl !RefUnwindSafe for DeviceProxy
impl Send for DeviceProxy
impl Sync for DeviceProxy
impl Unpin for DeviceProxy
impl !UnwindSafe for DeviceProxy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)