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

Injected HTTPS-download interface (Dependency Inversion). More...

#include <ra8_ota.h>

Data Fields

ra8_err_t(* open )(void *ctx, const char *url, uint32_t *out_content_len)
 Begin a streaming GET against url.
ra8_err_t(* read )(void *ctx, uint8_t *dst, uint32_t cap, uint32_t *out_len)
 Read up to cap bytes from the open session.
ra8_err_t(* close )(void *ctx)
 Tear the streaming GET down.
void * ctx
 Opaque context passed back to every callback.

Detailed Description

Injected HTTPS-download interface (Dependency Inversion).

The OTA module never links directly against ra8_tls / mbedtls. The caller registers a vtable with open, read, close. The default wiring – when ra8_tls eventually lands – will be a thin shim in ra8_tls that adapts ra8_tls handles to this struct.

Invariant
All three function pointers are non-NULL when this struct is passed to ra8_ota_init.

Definition at line 162 of file ra8_ota.h.

Field Documentation

◆ close

ra8_err_t(* ra8_ota_net_iface_t::close) (void *ctx)

Tear the streaming GET down.

Definition at line 179 of file ra8_ota.h.

Referenced by app_make_cfg(), and internal_validate_cfg_net().

◆ ctx

void* ra8_ota_net_iface_t::ctx

Opaque context passed back to every callback.

Definition at line 182 of file ra8_ota.h.

Referenced by app_make_cfg().

◆ open

ra8_err_t(* ra8_ota_net_iface_t::open) (void *ctx, const char *url, uint32_t *out_content_len)

Begin a streaming GET against url.

Returns
k_ra8_ok if a download session has been opened and subsequent read calls are valid.

Definition at line 168 of file ra8_ota.h.

Referenced by app_make_cfg(), and internal_validate_cfg_net().

◆ read

ra8_err_t(* ra8_ota_net_iface_t::read) (void *ctx, uint8_t *dst, uint32_t cap, uint32_t *out_len)

Read up to cap bytes from the open session.

Parameters
[out]out_lenBytes actually read (0 == EOF).

Definition at line 174 of file ra8_ota.h.

Referenced by app_make_cfg(), and internal_validate_cfg_net().


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