ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_mdl_storage_iface Struct Reference

Transactional destination seam for one downloaded object. More...

#include <ra8_c6link_mdl_transfer.h>

Data Fields

ra8_err_t(* begin )(void *ctx, const char *destination)
 Create private temporary state for destination.
ra8_err_t(* write )(void *ctx, const uint8_t *data, uint16_t len, uint16_t *written)
 Append len bytes and report the exact number persisted.
ra8_err_t(* validate )(void *ctx, uint64_t total_bytes, const uint8_t sha256[k_ra8_mdl_sha256_bytes])
 Validate artifact identity and structure before publication.
ra8_err_t(* commit )(void *ctx)
 Atomically publish the complete temporary object.
ra8_err_t(* abort )(void *ctx)
 Destroy temporary state; valid after every successful begin.
void * ctx
 Backend context passed to every function.

Detailed Description

Transactional destination seam for one downloaded object.

begin creates private temporary state, write appends bytes, the optional validate inspects that private object after transport integrity succeeds, commit atomically publishes it, and abort destroys all temporary state. A backend may represent SD, XSPI, MRAM, or an e-reader content store without exposing its handles to the C6 protocol. A .rabook integration supplies validate to check its magic, header, and structure; leaving it null is valid only when the transfer format is loose.

Invariant
Every function pointer and ctx is non-null during a transfer.
A successful commit is atomic from the reader's perspective.
.begin = store_begin, .write = store_write,
.validate = rabook_validate_temp,
.commit = store_commit, .abort = store_abort, .ctx = &store,
};
See also
ra8_c6link_mdl_transfer
Since
0.1.0

Definition at line 60 of file ra8_c6link_mdl_transfer.h.

Field Documentation

◆ abort

ra8_err_t(* ra8_mdl_storage_iface::abort) (void *ctx)

Destroy temporary state; valid after every successful begin.

Definition at line 79 of file ra8_c6link_mdl_transfer.h.

Referenced by internal_check_transfer(), internal_mdl_transfer_abort(), internal_mdl_transfer_validate(), internal_publish(), and mdl_storage_vfs_init().

◆ begin

ra8_err_t(* ra8_mdl_storage_iface::begin) (void *ctx, const char *destination)

Create private temporary state for destination.

Definition at line 62 of file ra8_c6link_mdl_transfer.h.

Referenced by internal_check_transfer(), internal_mdl_transfer_begin(), internal_mdl_transfer_validate(), internal_publish(), and mdl_storage_vfs_init().

◆ commit

ra8_err_t(* ra8_mdl_storage_iface::commit) (void *ctx)

Atomically publish the complete temporary object.

Definition at line 77 of file ra8_c6link_mdl_transfer.h.

Referenced by internal_check_transfer(), internal_mdl_transfer_commit(), internal_mdl_transfer_validate(), internal_publish(), and mdl_storage_vfs_init().

◆ ctx

◆ validate

ra8_err_t(* ra8_mdl_storage_iface::validate) (void *ctx, uint64_t total_bytes, const uint8_t sha256[k_ra8_mdl_sha256_bytes])

Validate artifact identity and structure before publication.

Parameters
[in,out]ctxBackend context with one complete private object.
[in]total_bytesVerified object byte length.
[in]sha256Independently verified SHA-256 digest.
Returns
Validation status; non-success prevents commit and triggers abort.
Note
Optional only for loose; every named artifact requires validation.

Definition at line 73 of file ra8_c6link_mdl_transfer.h.

Referenced by internal_check_transfer(), internal_mdl_transfer_commit(), internal_mdl_transfer_validate(), internal_publish(), and mdl_storage_vfs_init().

◆ write

ra8_err_t(* ra8_mdl_storage_iface::write) (void *ctx, const uint8_t *data, uint16_t len, uint16_t *written)

Append len bytes and report the exact number persisted.

Definition at line 64 of file ra8_c6link_mdl_transfer.h.

Referenced by internal_check_transfer(), internal_mdl_transfer_store(), internal_mdl_transfer_validate(), internal_publish_fragment(), and mdl_storage_vfs_init().


The documentation for this struct was generated from the following file: