pub fn current_ota_state(&mut self) -> Result<OtaImageState, crate::partitions::Error> {
        match self.current_slot()? {
            Slot::None => Err(crate::partitions::Error::InvalidState),
            _ => {
                let offset = self.current_slot()?.offset();
                let mut buffer = OtaSelectEntry::default();
                self.flash.read(offset, buffer.as_bytes_mut())?;
                Ok(buffer.ota_state)
            }
        }
    }
Get the [OtaImageState] of the currently selected slot.

# Errors
A [crate::partitions::Error::InvalidState] if the currently selected
slot is [Slot::None]
esp-bootloader-esp-idf/src/ota.rs