ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_c6link_mdl_transfer.h
Go to the documentation of this file.
1
21#pragma once
22
23#include <stdint.h>
24
25#include "ra8_c6link_mdl.h"
26#include "ra8_err.h"
27
30typedef enum : uint64_t {
31 k_ra8_mdl_transfer_bytes_max = UINT64_C(67108864),
33
60typedef struct ra8_mdl_storage_iface {
62 ra8_err_t (*begin)(void* ctx, const char* destination);
64 ra8_err_t (*write)(void* ctx, const uint8_t* data, uint16_t len, uint16_t* written);
74 uint64_t total_bytes,
75 const uint8_t sha256[k_ra8_mdl_sha256_bytes]);
77 ra8_err_t (*commit)(void* ctx);
79 ra8_err_t (*abort)(void* ctx);
80 void* ctx;
82
103typedef struct ra8_mdl_sha256_iface {
105 ra8_err_t (*init)(void* ctx);
107 ra8_err_t (*update)(void* ctx, const uint8_t* data, uint16_t len);
109 ra8_err_t (*final)(void* ctx, uint8_t out[k_ra8_mdl_sha256_bytes]);
110 void* ctx;
112
130typedef bool (*ra8_mdl_cancel_requested_fn)(void* ctx);
131
171
197
198#ifdef __cplusplus
199extern "C" {
200#endif
201
246 const char* url,
247 const char* destination,
248 const ra8_mdl_transfer_config_t* config,
250
251#ifdef __cplusplus
252}
253#endif
mdl_format_t
Artifact format selected by a media-download composition root.
Definition mdl_format.h:35
-proof
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
@ k_ra8_mdl_sha256_bytes
SHA-256 digest size in bytes.
Bounded request policy forwarded to the C6 HTTP client.
HTTP status and selected response headers proven by the C6 backend.
Streaming SHA-256 seam with caller-owned fixed storage.
ra8_err_t(* update)(void *ctx, const uint8_t *data, uint16_t len)
Feed one ordered byte span to the running hash.
ra8_err_t(* init)(void *ctx)
Reset the caller-owned context for a SHA-256 operation.
void * ctx
Hash context passed to every function.
Transactional destination seam for one downloaded object.
ra8_err_t(* commit)(void *ctx)
Atomically publish the complete temporary object.
void * ctx
Backend context passed to every function.
ra8_err_t(* begin)(void *ctx, const char *destination)
Create private temporary state for destination.
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(* abort)(void *ctx)
Destroy temporary state; valid after every successful begin.
Fixed policy and injected mechanisms for one transfer.
ra8_mdl_sha256_iface_t sha256
Independent running digest.
void * cancel_ctx
Context for cancel_requested.
mdl_format_t format
Requested and validated artifact.
ra8_mdl_cancel_requested_fn cancel_requested
Optional cooperative cancel query.
ra8_mdl_http_policy_t http
Forwarded downloader request policy.
uint16_t chunk_bytes
Maximum bytes requested per pull.
uint32_t max_chunks
Absolute number of permitted pulls.
ra8_mdl_storage_iface_t storage
Transactional RA8-local destination.
Verified result published by a completed transfer.
mdl_format_t format
Validated committed format.
uint32_t chunks_received
Remote responses consumed.
ra8_mdl_http_response_t response
Proven terminal HTTP metadata.
uint64_t bytes_stored
Bytes atomically committed.
uint8_t sha256[k_ra8_mdl_sha256_bytes]
Independently verified digest.