Struct hackrf_rs::Device

source ·
pub struct Device { /* private fields */ }

Implementations§

source§

impl Device

source

pub fn pid(&self) -> u16

source

pub fn vid(&self) -> u16

source

pub async fn serial_number(&self) -> impl Future<Output = Result<String, Error>>

source

pub fn config_list(&self) -> Result<Vec<ConfigDescriptor, Global>, Error>

source

pub fn get_config(&self) -> Result<ConfigDescriptor, Error>

source

pub fn set_config(&self, config: ConfigDescriptor) -> Result<(), Error>

source

pub fn set_config_by_value(&self, config_value: u8) -> Result<(), Error>

source

pub fn claim_interface_by_num(&self, num: usize) -> Result<Interface, Error>

source

pub fn claim_interface( &self, interface: InterfaceDescriptor ) -> Result<Interface, Error>

source

pub async fn control_transfer_in( &self, recipient: UsbControlRecipient, transfer_type: UsbControlTransferType, request: u8, value: u16, index: u16, timeout: Duration, capacity: usize ) -> impl Future<Output = Result<Request, Error>>

source

pub async fn control_transfer_out( &self, recipient: UsbControlRecipient, transfer_type: UsbControlTransferType, request: u8, value: u16, index: u16, timeout: Duration, src: &mut [u8] ) -> impl Future<Output = Result<Request, Error>>

source

pub fn speed(&self) -> Result<Speed, Error>

source

pub fn bcd_usb(&self) -> u16

source

pub fn bcd_usb_version(&self) -> Vec<u16, Global>

source

pub fn device_class(&self) -> DeviceClass

source

pub fn device_subclass(&self) -> DeviceClass

source

pub fn device_protocol(&self) -> DeviceClass

source

pub fn max_packet_size_0(&self) -> usize

source

pub fn bcd_device(&self) -> u16

source

pub fn bcd_device_version(&self) -> Vec<u16, Global>

source

pub fn manufacturer(&self) -> Result<String, Error>

source

pub fn product(&self) -> Result<String, Error>

source

pub fn request_channel(&self, buffer: usize) -> (RequestSender, RequestReceiver)

Trait Implementations§

source§

impl Clone for Device

source§

fn clone(&self) -> Device

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.