Struct embedded_update::device::Serial
source · [−]Expand description
A FirmwareDevice based on a fixed-frame serial protocol, using postcard
as the serialization format.
Can be used with any transport implementing the embedded-io traits. (TCP, UDP, UART, USB).
Implementations
Trait Implementations
sourceimpl<T> FirmwareDevice for Serial<T> where
T: Read + Write,
impl<T> FirmwareDevice for Serial<T> where
T: Read + Write,
type Error = SerialError<<T as Io>::Error, Error>
type Error = SerialError<<T as Io>::Error, Error>
The error type.
type StatusFuture<'m>
where
Self: 'm = impl Future<Output = Result<FirmwareStatus<<Serial<T> as FirmwareDevice>::Version>, <Serial<T> as FirmwareDevice>::Error>> + 'm
type StatusFuture<'m>
where
Self: 'm = impl Future<Output = Result<FirmwareStatus<<Serial<T> as FirmwareDevice>::Version>, <Serial<T> as FirmwareDevice>::Error>> + 'm
Future returned by status
sourcefn status(&mut self) -> Self::StatusFuture<'_>
fn status(&mut self) -> Self::StatusFuture<'_>
Return the status of the currently running firmware.
type StartFuture<'m>
where
Self: 'm = impl Future<Output = Result<(), <Serial<T> as FirmwareDevice>::Error>> + 'm
type StartFuture<'m>
where
Self: 'm = impl Future<Output = Result<(), <Serial<T> as FirmwareDevice>::Error>> + 'm
Future returned by start
sourcefn start<'m>(&'m mut self, version: &'m [u8]) -> Self::StartFuture<'m>
fn start<'m>(&'m mut self, version: &'m [u8]) -> Self::StartFuture<'m>
Prepare for starting the firmware update process.
type WriteFuture<'m>
where
Self: 'm = impl Future<Output = Result<(), <Serial<T> as FirmwareDevice>::Error>> + 'm
type WriteFuture<'m>
where
Self: 'm = impl Future<Output = Result<(), <Serial<T> as FirmwareDevice>::Error>> + 'm
Future returned by write
sourcefn write<'m>(&'m mut self, offset: u32, data: &'m [u8]) -> Self::WriteFuture<'m>
fn write<'m>(&'m mut self, offset: u32, data: &'m [u8]) -> Self::WriteFuture<'m>
Write a block of firmware at the expected offset.
type UpdateFuture<'m>
where
Self: 'm = impl Future<Output = Result<(), <Serial<T> as FirmwareDevice>::Error>> + 'm
type UpdateFuture<'m>
where
Self: 'm = impl Future<Output = Result<(), <Serial<T> as FirmwareDevice>::Error>> + 'm
Future returned by update
sourcefn update<'m>(
&'m mut self,
version: &'m [u8],
checksum: &'m [u8]
) -> Self::UpdateFuture<'m>
fn update<'m>(
&'m mut self,
version: &'m [u8],
checksum: &'m [u8]
) -> Self::UpdateFuture<'m>
Finish the firmware write and mark device to be updated
type SyncedFuture<'m>
where
Self: 'm = impl Future<Output = Result<(), <Serial<T> as FirmwareDevice>::Error>> + 'm
type SyncedFuture<'m>
where
Self: 'm = impl Future<Output = Result<(), <Serial<T> as FirmwareDevice>::Error>> + 'm
Future returned by synced
sourcefn synced(&mut self) -> Self::SyncedFuture<'_>
fn synced(&mut self) -> Self::SyncedFuture<'_>
Mark firmware as being in sync with the expected
Auto Trait Implementations
impl<T> RefUnwindSafe for Serial<T> where
T: RefUnwindSafe,
impl<T> Send for Serial<T> where
T: Send,
impl<T> Sync for Serial<T> where
T: Sync,
impl<T> Unpin for Serial<T> where
T: Unpin,
impl<T> UnwindSafe for Serial<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