pub struct DfuAsync<IO, E>where
IO: DfuAsyncIo<Read = usize, Write = usize, Reset = (), Error = E>,
E: From<Error> + From<Error>,{ /* private fields */ }async and std only.Expand description
Generic asynchronous implementation of DFU.
Implementations§
Source§impl<IO, E> DfuAsync<IO, E>
impl<IO, E> DfuAsync<IO, E>
Sourcepub fn new(io: IO) -> Self
pub fn new(io: IO) -> Self
Create a new instance of a generic synchronous implementation of DFU.
Sourcepub fn override_address(&mut self, address: u32) -> &mut Self
pub fn override_address(&mut self, address: u32) -> &mut Self
Override the address onto which the firmware is downloaded.
This address is only used if the device uses the DfuSe protocol.
Sourcepub fn into_inner(self) -> IO
pub fn into_inner(self) -> IO
Consume the object and return its DfuIo
Source§impl<IO, E> DfuAsync<IO, E>
impl<IO, E> DfuAsync<IO, E>
Sourcepub async fn download_from_slice(
self,
slice: &[u8],
) -> Result<Option<Self>, IO::Error>
pub async fn download_from_slice( self, slice: &[u8], ) -> Result<Option<Self>, IO::Error>
Download a firmware into the device from a slice.
Returns Some(Self) if the device stayed on the bus (manifestation tolerant, no USB reset
occurred) or None if a USB reset was performed.
Sourcepub async fn download<R: AsyncReadExt + Unpin>(
self,
reader: R,
length: u32,
) -> Result<Option<Self>, IO::Error>
pub async fn download<R: AsyncReadExt + Unpin>( self, reader: R, length: u32, ) -> Result<Option<Self>, IO::Error>
Download a firmware into the device from a reader.
Returns Some(Self) if the device stayed on the bus (manifestation tolerant, no USB reset
occurred) or None if a USB reset was performed.
Sourcepub async fn download_all<R: AsyncReadExt + Unpin + AsyncSeek>(
self,
reader: R,
) -> Result<Option<Self>, IO::Error>
pub async fn download_all<R: AsyncReadExt + Unpin + AsyncSeek>( self, reader: R, ) -> Result<Option<Self>, IO::Error>
Download a firmware into the device.
The length is inferred from the reader. Returns Some(Self) if the device stayed on the
bus (manifestation tolerant, no USB reset occurred) or None if a USB reset was performed.
Sourcepub fn will_detach(&self) -> bool
pub fn will_detach(&self) -> bool
Returns whether the device will detach if requested
Sourcepub fn manifestation_tolerant(&self) -> bool
pub fn manifestation_tolerant(&self) -> bool
Returns whether the device is manifestation tolerant