pub struct EspOtaUpdate<'a> { /* private fields */ }
Implementations§
Source§impl<'a> EspOtaUpdate<'a>
impl<'a> EspOtaUpdate<'a>
Sourcepub fn write(&mut self, buf: &[u8]) -> Result<(), EspError>
pub fn write(&mut self, buf: &[u8]) -> Result<(), EspError>
Writes OTA update data to partition. This function can be called multiple times as data is received during the OTA operation. Data is written sequentially to the partition.
§Errors
Returns an error if data could not be written to flash.
Sourcepub fn flush(&mut self) -> Result<(), EspError>
pub fn flush(&mut self) -> Result<(), EspError>
This function does not perform any flash operations, as flash writes are not cached and, therefore, do not need to be flushed.
§Errors
Returns an error update partition is not valid.
Sourcepub fn finish(self) -> Result<EspOtaUpdateFinished<'a>, EspError>
pub fn finish(self) -> Result<EspOtaUpdateFinished<'a>, EspError>
Finishes the OTA update and validates the new app image. Returns an instance of EspOtaUpdateFinished
.
This function does not update the boot partition. The user must call activate()
on the returned instance of EspOtaUpdateFinished.
See also: complete
Trait Implementations§
Source§impl<'a> Debug for EspOtaUpdate<'a>
impl<'a> Debug for EspOtaUpdate<'a>
Source§impl Drop for EspOtaUpdate<'_>
impl Drop for EspOtaUpdate<'_>
Source§impl ErrorType for EspOtaUpdate<'_>
impl ErrorType for EspOtaUpdate<'_>
Source§type Error = EspIOError
type Error = EspIOError
Error type of all the IO operations on this type.
Source§impl<'a> OtaUpdate for EspOtaUpdate<'a>
impl<'a> OtaUpdate for EspOtaUpdate<'a>
type OtaUpdateFinished = EspOtaUpdateFinished<'a>
fn finish(self) -> Result<Self::OtaUpdateFinished, Self::Error>
fn complete(self) -> Result<(), Self::Error>
fn abort(self) -> Result<(), Self::Error>
fn update<R>(
self,
read: R,
progress: impl Fn(u64, u64),
) -> Result<(), CopyError<<R as ErrorType>::Error, Self::Error>>where
R: Read,
Self: Sized,
Source§impl Write for EspOtaUpdate<'_>
impl Write for EspOtaUpdate<'_>
Source§fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
Write a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<(), Self::Error>
fn flush(&mut self) -> Result<(), Self::Error>
Flush this output stream, blocking until all intermediately buffered contents reach their destination.