Struct FunctionalDescriptor

Source
pub struct FunctionalDescriptor {
    pub can_download: bool,
    pub can_upload: bool,
    pub manifestation_tolerant: bool,
    pub will_detach: bool,
    pub detach_timeout: u16,
    pub transfer_size: u16,
    pub dfu_version: (u8, u8),
}
Expand description

Functional descriptor.

Fields§

§can_download: bool

bitCanDnload.

Bit 0: download capable.

§can_upload: bool

bitCanUpload.

Bit 1: upload capable.

§manifestation_tolerant: bool

bitManifestationTolerant.

Bit 2: device is able to communicate via USB after Manifestation phase.

§will_detach: bool

bitWillDetach.

Bit 3: device will perform a bus detach-attach sequence when it receives a DFU_DETACH request. The host must not issue a USB Reset.

§detach_timeout: u16

wDetachTimeOut.

Time, in milliseconds, that the device will wait after receipt of the DFU_DETACH request. If this time elapses without a USB reset, then the device will terminate the Reconfiguration phase and revert back to normal operation. This represents the maximum time that the device can wait (depending on its timers, etc.). The host may specify a shorter timeout in the DFU_DETACH request.

§transfer_size: u16

wTransferSize.

Maximum number of bytes that the device can accept per control-write transaction.

§dfu_version: (u8, u8)

bcdDFUVersion.

Numeric expression identifying the version of the DFU Specification release.

Implementations§

Source§

impl FunctionalDescriptor

Source

pub fn from_bytes(bytes: &[u8]) -> Option<Result<Self, Error>>

Read functional descriptor from a slice of bytes.

Trait Implementations§

Source§

impl Clone for FunctionalDescriptor

Source§

fn clone(&self) -> FunctionalDescriptor

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for FunctionalDescriptor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for FunctionalDescriptor

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.