pub struct DfuSync<IO, E>{ /* private fields */ }Available on crate feature
std only.Expand description
Generic synchronous implementation of DFU.
Implementations§
Source§impl<IO, E> DfuSync<IO, E>
impl<IO, E> DfuSync<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 with_progress(
&mut self,
progress: impl FnMut(usize) + 'static,
) -> &mut Self
pub fn with_progress( &mut self, progress: impl FnMut(usize) + 'static, ) -> &mut Self
Use this closure to show progress.
Sourcepub fn into_inner(self) -> IO
pub fn into_inner(self) -> IO
Consume the object and return its DfuIo
Source§impl<IO, E> DfuSync<IO, E>
impl<IO, E> DfuSync<IO, E>
Sourcepub fn download_from_slice(&mut self, slice: &[u8]) -> Result<(), IO::Error>
pub fn download_from_slice(&mut self, slice: &[u8]) -> Result<(), IO::Error>
Download a firmware into the device from a slice.
Sourcepub fn download<R: Read>(
&mut self,
reader: R,
length: u32,
) -> Result<(), IO::Error>
pub fn download<R: Read>( &mut self, reader: R, length: u32, ) -> Result<(), IO::Error>
Download a firmware into the device from a reader.
Sourcepub fn download_all<R: Read + Seek>(
&mut self,
reader: R,
) -> Result<(), IO::Error>
pub fn download_all<R: Read + Seek>( &mut self, reader: R, ) -> Result<(), IO::Error>
Download a firmware into the device.
The length is guest from the reader.
Sourcepub fn will_detach(&self) -> bool
pub fn will_detach(&self) -> bool
Returns whether the device is will detach if requested
Sourcepub fn manifestation_tolerant(&self) -> bool
pub fn manifestation_tolerant(&self) -> bool
Returns whether the device is manifestation tolerant
Auto Trait Implementations§
impl<IO, E> Freeze for DfuSync<IO, E>where
IO: Freeze,
impl<IO, E> !RefUnwindSafe for DfuSync<IO, E>
impl<IO, E> !Send for DfuSync<IO, E>
impl<IO, E> !Sync for DfuSync<IO, E>
impl<IO, E> Unpin for DfuSync<IO, E>where
IO: Unpin,
impl<IO, E> !UnwindSafe for DfuSync<IO, E>
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
Mutably borrows from an owned value. Read more