Struct FotaInfo
#[repr(C)]pub struct FotaInfo {Show 18 fields
magic: ByteStr<8>,
activerootfs: ByteStr<32>,
activebootimg: ByteStr<32>,
activemodem: ByteStr<32>,
backrootfs: ByteStr<32>,
backbootimg: ByteStr<32>,
backmodem: ByteStr<32>,
padding1: Padding<32>,
type_: EnumRepr<u32, FotaType>,
eventstat: EnumRepr<u32, FotaState>,
eventstat_: [u32; 3],
upcount: u32,
pub(crate) ecount: u32,
fcount: u32,
padding2: Padding<52>,
package: ByteStr<128>,
padding3: Padding<64>,
pub(crate) info_crc: u32,
}Expand description
Represents FOTA (Firmware Over-The-Air) update information.
Fields§
§magic: ByteStr<8>FOTA info magic number.
activerootfs: ByteStr<32>Currently activated rootfs (A/B FOTA).
activebootimg: ByteStr<32>Currently activated bootimg (A/B FOTA).
activemodem: ByteStr<32>Currently activated modem (A/B FOTA).
backrootfs: ByteStr<32>Backup rootfs.
backbootimg: ByteStr<32>Backup bootimg.
backmodem: ByteStr<32>Backup modem.
padding1: Padding<32>Reserved for expansion, filled with zeros.
type_: EnumRepr<u32, FotaType>FOTA update type (e.g., A/B FOTA, full FOTA, diff FOTA).
eventstat: EnumRepr<u32, FotaState>Status of update (e.g., update, backup, expand status).
eventstat_: [u32; 3]No idea what this is. In the original struct eventstat is [u32; 4].
upcount: u32Count of successful FOTA updates.
ecount: u32Count of FOTA info updates.
fcount: u32Count of FOTA failures (cleared on successful update).
padding2: Padding<52>Reserved for expansion, filled with zeros.
package: ByteStr<128>Package information.
padding3: Padding<64>Reserved for expansion, filled with zeros.
info_crc: u32CRC code for FOTA info.
Implementations§
§impl FotaInfo
impl FotaInfo
pub const fn new(active: FotaActive) -> Self
pub const fn new(active: FotaActive) -> Self
Creates a new FOTA info with the given active partition.
const fn new_invalid() -> Self
const fn new_invalid() -> Self
Creates a new FOTA info with the correct magic value and zeroed fields (including the CRC).
pub const fn get_active(&self) -> Option<FotaActive>
pub const fn get_active(&self) -> Option<FotaActive>
Returns the currently active partition (A or B) for FOTA updates.
If the system is running a mix of A and B partitions, this function
will return None.
pub const fn set_active(&mut self, active: FotaActive)
pub const fn set_active(&mut self, active: FotaActive)
Sets the active partition (A or B) for FOTA updates.