Expand description
BLE security snapshot journal: shared machinery from
umsh-journal-store, plus this firmware’s flash placement.
The record engine, snapshot codec, and their power-cut tests live in
the crate; only the page addresses — a memory.x fact — are decided
here.
Structs§
Enums§
- Bond
Upsert - Outcome of
upsert_bond. - Commit
Error
Constants§
- COMMIT_
OFFSET - MAX_
BONDS - PAGE0
- Flash pages owned by this journal, inside the NV storage region
(0x000E_4000..0x000F_4000; see
memory.x). - PAGE1
- PAGE_
SIZE - Flash page size shared by every backend the journals run on (nRF52840 NVMC and ESP32-S3 SPI flash are both 4 KiB-erase parts).
- SLOT_
SIZE
Traits§
- Page
Eraser - Record
Reader - Flash reader used by a journal mount and by the boot path’s walk-back scan.
- Record
Writer - Flash writer used by the journal’s two-stage record commit.
Functions§
- consider_
snapshot - Consider one journal slot while mounting without retaining its flash buffer.
- crc32
- CRC32 (reflected, polynomial 0xEDB88320) over a record body; the journals store it immediately before the commit word.
- erase_
journal_ page - generation_
is_ newer - Wraparound-safe generation comparison: a record numbered 0 supersedes
one numbered
u32::MAX. - touch_
bond - Move the bond matching
address_kind+addressto the MRU end, if present and not already there. Returnstruewhen the order changed (and the caller should persist),falsewhen the bond was already MRU or is not stored at all. - upsert_
bond - Insert or refresh
bondinbonds, which is kept ordered least-recently-used-first / most-recently-used-last (index 0 is the eviction candidate). A bond matching byaddress_kind+addressis refreshed in place and moved to the MRU end; a new bond is appended at the MRU end, evicting the current LRU entry first if the list is full. - write_
committed_ record - Write a record body first and its visibility marker last. The record’s last four bytes are the commit word (shared convention across every journal in this crate).