Expand description
Full-protocol snapshot journal records (spec §Saved State).
Persists the opaque snapshot payload produced by
Session::encode_snapshot — the journal knows nothing about its
contents. Deliberately separate from the BLE bond/PIN journal
(ble): the two have different lifecycles (CMD_CLEAR
erases this journal but never touches bonds or the pairing PIN) and
different record sizes. The record machinery — two-page rotation,
CRC over the body, a trailing commit word written last, newest
generation wins — is the shared record engine.
The same record format also carries the device identity and the
device node’s frame-counter map (counter), each
in a journal of its own; which pages each journal owns is the
firmware’s memory-map decision.
Structs§
- Stored
- One journal record with its monotonically increasing generation; the newest valid record is authoritative.
Enums§
- Record
- What a journal record asserts about the saved protocol state.
- Record
Ref - Borrowed form of
Recordfor the write path: persist callers pass their payload by reference so the record machinery never buffers a second copy (the write path’s task futures hold these across awaits, so every avoidedMAX_PAYLOADcopy is RAM off a task pool).
Constants§
- COMMIT_
OFFSET - IDENTITY_
PAYLOAD_ LEN - A device-identity record payload: the Ed25519 private key followed by its public key (stored so boot does not repeat the derivation).
- MAX_
PAYLOAD - Largest payload a record can carry.
- SLOT_
SIZE - Two records per page; the snapshot payload is bounded by
umsh_ulcp_device::SNAPSHOT_MAX(1792) with headroom.
Functions§
- consider_
older_ record - Consider one journal slot while looking for the newest committed
record strictly older than
newer_than. - consider_
record - Consider one journal slot while mounting.
- decode_
identity - Split a persisted identity payload into (secret, public); anything but the exact expected length is treated as no identity.
- encode_
identity - encode_
record - Encode one record body into a slot image. The payload must fit
MAX_PAYLOAD; the commit word stays erased (0xFF) —write_committed_recordwrites zeros there only after the body lands. - write_
record - Write one committed record. Failure leaves any previously committed record untouched: the body lands first and the commit word last, so a mount never selects a partial write.