Trait embedded_update::FirmwareDevice
source · [−]pub trait FirmwareDevice {
type Version: FirmwareVersion;
type Error;
type StatusFuture<'m>: Future<Output = Result<FirmwareStatus<Self::Version>, Self::Error>> + 'm
where
Self: 'm;
type StartFuture<'m>: Future<Output = Result<(), Self::Error>> + 'm
where
Self: 'm;
type WriteFuture<'m>: Future<Output = Result<(), Self::Error>> + 'm
where
Self: 'm;
type UpdateFuture<'m>: Future<Output = Result<(), Self::Error>> + 'm
where
Self: 'm;
type SyncedFuture<'m>: Future<Output = Result<(), Self::Error>> + 'm
where
Self: 'm;
const MTU: usize;
fn status(&mut self) -> Self::StatusFuture<'_>;
fn start<'m>(&'m mut self, version: &'m [u8]) -> Self::StartFuture<'m>;
fn write<'m>(
&'m mut self,
offset: u32,
data: &'m [u8]
) -> Self::WriteFuture<'m>;
fn update<'m>(
&'m mut self,
version: &'m [u8],
checksum: &'m [u8]
) -> Self::UpdateFuture<'m>;
fn synced(&mut self) -> Self::SyncedFuture<'_>;
}Required Associated Types
type Version: FirmwareVersion
type StatusFuture<'m>: Future<Output = Result<FirmwareStatus<Self::Version>, Self::Error>> + 'm
where
Self: 'm
Future returned by write
Future returned by update
Required Associated Constants
Required Methods
fn status(&mut self) -> Self::StatusFuture<'_>
fn status(&mut self) -> Self::StatusFuture<'_>
Return the status of the currently running firmware.
Prepare for starting the firmware update process.
Write a block of firmware at the expected offset.
Finish the firmware write and mark device to be updated
fn synced(&mut self) -> Self::SyncedFuture<'_>
fn synced(&mut self) -> Self::SyncedFuture<'_>
Mark firmware as being in sync with the expected