Struct embedded_update::FirmwareUpdater
source · [−]pub struct FirmwareUpdater<T> where
T: UpdateService, { /* private fields */ }
Expand description
The updater process that uses the update service to perform a firmware update check for a device. If the device needs to be updated, the updater will follow the update protocol
Implementations
sourceimpl<T> FirmwareUpdater<T> where
T: UpdateService,
impl<T> FirmwareUpdater<T> where
T: UpdateService,
sourcepub fn new(service: T, config: UpdaterConfig) -> Self
pub fn new(service: T, config: UpdaterConfig) -> Self
Create a new instance of the updater with the provided service instance.
sourcepub async fn run<F: FirmwareDevice, D: DelayUs>(
&mut self,
device: &mut F,
delay: &mut D
) -> Result<DeviceStatus, Error<F::Error, T::Error>>
pub async fn run<F: FirmwareDevice, D: DelayUs>(
&mut self,
device: &mut F,
delay: &mut D
) -> Result<DeviceStatus, Error<F::Error, T::Error>>
Run the firmware update protocol. The update is finished with two outcomes:
- The device is in sync, in which case
DeviceStatus::Synced
is returned. - The device is updated, in which case
DeviceStatus::Updated
is returned. It is the responsibility of called to reset the device in order to run the new firmware.
Auto Trait Implementations
impl<T> RefUnwindSafe for FirmwareUpdater<T> where
T: RefUnwindSafe,
impl<T> Send for FirmwareUpdater<T> where
T: Send,
impl<T> Sync for FirmwareUpdater<T> where
T: Sync,
impl<T> Unpin for FirmwareUpdater<T> where
T: Unpin,
impl<T> UnwindSafe for FirmwareUpdater<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more