|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Transactional RA8-side coordinator for C6 media byte streams. More...
Go to the source code of this file.
Data Structures | |
| struct | ra8_mdl_storage_iface |
| Transactional destination seam for one downloaded object. More... | |
| struct | ra8_mdl_sha256_iface |
| Streaming SHA-256 seam with caller-owned fixed storage. More... | |
| struct | ra8_mdl_transfer_config |
| Fixed policy and injected mechanisms for one transfer. More... | |
| struct | ra8_mdl_transfer_result |
| Verified result published by a completed transfer. More... | |
Typedefs | |
| typedef struct ra8_mdl_storage_iface | ra8_mdl_storage_iface_t |
| typedef struct ra8_mdl_sha256_iface | ra8_mdl_sha256_iface_t |
| typedef bool(* | ra8_mdl_cancel_requested_fn) (void *ctx) |
| Query whether the caller requests cooperative cancellation. | |
| typedef struct ra8_mdl_transfer_config | ra8_mdl_transfer_config_t |
| typedef struct ra8_mdl_transfer_result | ra8_mdl_transfer_result_t |
Enumerations | |
| enum | ra8_mdl_transfer_limit_t : uint64_t { k_ra8_mdl_transfer_bytes_max = UINT64_C(67108864) } |
| Absolute transfer policy limits independent of caller chunk geometry. More... | |
Functions | |
| ra8_err_t | ra8_c6link_mdl_transfer (ra8_c6link_t *link, const char *url, const char *destination, const ra8_mdl_transfer_config_t *config, ra8_mdl_transfer_result_t *result) |
| Fetch, verify, and atomically publish one remote byte stream. | |
Transactional RA8-side coordinator for C6 media byte streams.
This module composes an already-open ra8_c6link_t with caller-owned storage and SHA-256 implementations. The selected format is carried across the wire and correlated by the response; the RA8 owns the destination, verifies the digest and artifact independently, and publishes the temporary object atomically. Every buffer and context is caller-owned, and the transfer loop is bounded by max_chunks.
Definition in file ra8_c6link_mdl_transfer.h.
| typedef bool(* ra8_mdl_cancel_requested_fn) (void *ctx) |
Query whether the caller requests cooperative cancellation.
Called before each remote pull. Returning true causes remote cancellation followed by unconditional local transaction abort.
| [in] | ctx | Caller-owned cancellation context. |
| true | Stop before pulling another chunk. |
| false | Continue the transfer. |
ctx remains valid for the transfer duration. Definition at line 130 of file ra8_c6link_mdl_transfer.h.
| typedef struct ra8_mdl_sha256_iface ra8_mdl_sha256_iface_t |
| typedef struct ra8_mdl_storage_iface ra8_mdl_storage_iface_t |
| typedef struct ra8_mdl_transfer_config ra8_mdl_transfer_config_t |
| typedef struct ra8_mdl_transfer_result ra8_mdl_transfer_result_t |
| enum ra8_mdl_transfer_limit_t : uint64_t |
Absolute transfer policy limits independent of caller chunk geometry.
| Enumerator | |
|---|---|
| k_ra8_mdl_transfer_bytes_max | Maximum one-object byte budget. |
Definition at line 30 of file ra8_c6link_mdl_transfer.h.
|
nodiscard |
Fetch, verify, and atomically publish one remote byte stream.
Starts a typed artifact transfer on an already-open c6link, pulls ordered bounded chunks, hashes exactly the bytes accepted by storage, compares the local digest with the C6 terminal digest, invokes the optional artifact validator against the private object, then commits. SHA equality proves transport integrity but does not prove .rabook identity: callers claiming any non-loose format must supply storage.validate. After a successful storage begin, every non-success path calls abort; an active remote session is also cancelled on local failure or cancellation.
| [in,out] | link | Already-open, exclusively owned c6link handle. |
| [in] | url | NUL-terminated source URL accepted by the C6 HTTPS backend. |
| [in] | destination | RA8-local destination understood only by storage. |
| [in] | config | Complete fixed-size storage, hash, cancellation, and bound policy. |
| [out] | result | Verified committed byte count and digest. |
| k_ra8_ok | Object verified and atomically committed. |
| k_ra8_err_null_ptr | Required pointer or injected function is null. |
| k_ra8_err_invalid_arg | Configuration or URL is invalid. |
| k_ra8_err_invalid_size | Chunk bound, response length, or byte count is invalid. |
| k_ra8_err_protocol_error | Remote state or ordering is incoherent. |
| k_ra8_err_checksum_mismatch | Local and remote SHA-256 digests differ. |
| k_ra8_err_cancelled | Caller requested cancellation or remote cancelled. |
| k_ra8_err_timeout | max_chunks was exhausted before completion. |
| k_ra8_fail | Injected storage, hash, or transport mechanism failed. |
link. link or any injected context concurrently. Definition at line 286 of file ra8_c6link_mdl_transfer.c.
References ra8_mdl_session_t::active, ra8_mdl_transfer_config::cancel_ctx, ra8_mdl_transfer_config::cancel_requested, ra8_mdl_transfer_config::chunk_bytes, internal_mdl_transfer_abort(), internal_mdl_transfer_begin(), internal_mdl_transfer_commit(), internal_mdl_transfer_store(), k_ra8_err_cancelled, k_ra8_err_timeout, k_ra8_mdl_state_cancelled, k_ra8_mdl_state_complete, k_ra8_mdl_state_downloading, k_ra8_ok, ra8_mdl_transfer_config::max_chunks, ra8_c6link_mdl_next(), mdl_transfer_state_t::session, ra8_mdl_chunk_t::state, and mdl_transfer_state_t::storage_active.
Referenced by internal_c6_get(), internal_transfer_and_consume(), and priv_media_download_image_run().