|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
One vtable per radio. More...
#include <ra8_wifi_backend.h>
Data Fields | |
| ra8_err_t(* | open )(void *ctx) |
| Bring the radio's link up and prove it answers. | |
| ra8_err_t(* | close )(void *ctx) |
| Release the link the backend opened. | |
| ra8_err_t(* | radio_up )(void *ctx) |
| Start the radio in station mode. | |
| ra8_err_t(* | radio_down )(void *ctx) |
| Stop the radio and release its resources. | |
| ra8_err_t(* | join )(void *ctx, const char *ssid, const char *psk) |
| Ask the station to associate with a network. | |
| ra8_err_t(* | leave )(void *ctx) |
| Disassociate the station from its network. | |
| ra8_err_t(* | service )(void *ctx, ra8_wifi_link_t *out_link) |
| Service the link once and report the association state. | |
| ra8_err_t(* | get_mac )(void *ctx, ra8_wifi_mac_t *out) |
| Read the station's own MAC address. | |
| ra8_err_t(* | get_ap )(void *ctx, ra8_wifi_ap_t *out) |
| Read what the radio knows about the associated AP. | |
| void(* | idle )(void *ctx, uint16_t ms) |
Idle for ms milliseconds, pacing a bounded wait. | |
One vtable per radio.
Each callback takes the backend's opaque ctx.
A backend author fills a static const ra8_wifi_backend_t in one translation unit and publishes its address through a header of their own. The facade in ra8_wifi.c is the only runtime consumer; it never stores state here, so a single const instance serves every handle that selects the backend.
Definition at line 71 of file ra8_wifi_backend.h.
| ra8_err_t(* ra8_wifi_backend::close) (void *ctx) |
Release the link the backend opened.
Mirror of open; the facade calls it from ra8_wifi_deinit.
| [in,out] | ctx | Backend context. |
Definition at line 87 of file ra8_wifi_backend.h.
Referenced by ra8_wifi_deinit().
| ra8_err_t(* ra8_wifi_backend::get_ap) (void *ctx, ra8_wifi_ap_t *out) |
Read what the radio knows about the associated AP.
| [in,out] | ctx | Backend context. |
| [out] | out | Record to fill; never null. |
out describes the association. Definition at line 145 of file ra8_wifi_backend.h.
Referenced by ra8_wifi_get_ap().
| ra8_err_t(* ra8_wifi_backend::get_mac) (void *ctx, ra8_wifi_mac_t *out) |
Read the station's own MAC address.
| [in,out] | ctx | Backend context. |
| [out] | out | Address to fill; never null. |
out holds the station address. Definition at line 137 of file ra8_wifi_backend.h.
Referenced by ra8_wifi_connect(), and ra8_wifi_get_mac().
| void(* ra8_wifi_backend::idle) (void *ctx, uint16_t ms) |
Idle for ms milliseconds, pacing a bounded wait.
The facade counts poll attempts, not milliseconds, so without this row its association wait would run as fast as the backend could answer – and a link that answers in tens of milliseconds spends a two-hundred-attempt budget in a couple of seconds, far less than an 802.11 association takes. This is the only seam through which the facade reaches a clock; a backend implements it with whatever delay its transport already owns, and a host test makes it instantaneous. It cannot fail, so it returns nothing.
| [in,out] | ctx | Backend context. |
| [in] | ms | Milliseconds to idle for. |
Definition at line 161 of file ra8_wifi_backend.h.
| ra8_err_t(* ra8_wifi_backend::join) (void *ctx, const char *ssid, const char *psk) |
Ask the station to associate with a network.
Returns once the request is accepted; association completes later and is observed through service.
| [in,out] | ctx | Backend context. |
| [in] | ssid | Target SSID, NUL-terminated; never null. |
| [in] | psk | Passphrase, NUL-terminated, or null for an open network. |
Definition at line 112 of file ra8_wifi_backend.h.
Referenced by ra8_wifi_connect().
| ra8_err_t(* ra8_wifi_backend::leave) (void *ctx) |
Disassociate the station from its network.
| [in,out] | ctx | Backend context. |
Definition at line 119 of file ra8_wifi_backend.h.
Referenced by ra8_wifi_disconnect().
| ra8_err_t(* ra8_wifi_backend::open) (void *ctx) |
Bring the radio's link up and prove it answers.
Binds the transport, opens the link, and establishes liveness. The facade calls it once from ra8_wifi_init.
| [in,out] | ctx | Backend context from ra8_wifi_cfg::backend_ctx. |
Definition at line 79 of file ra8_wifi_backend.h.
Referenced by ra8_wifi_init().
| ra8_err_t(* ra8_wifi_backend::radio_down) (void *ctx) |
Stop the radio and release its resources.
| [in,out] | ctx | Backend context. |
Definition at line 101 of file ra8_wifi_backend.h.
Referenced by ra8_wifi_disconnect().
| ra8_err_t(* ra8_wifi_backend::radio_up) (void *ctx) |
Start the radio in station mode.
| [in,out] | ctx | Backend context. |
Definition at line 94 of file ra8_wifi_backend.h.
Referenced by internal_ensure_radio_up().
| ra8_err_t(* ra8_wifi_backend::service) (void *ctx, ra8_wifi_link_t *out_link) |
Service the link once and report the association state.
Drains whatever the radio has to say and reports whether the station is associated right now.
| [in,out] | ctx | Backend context. |
| [out] | out_link | Association state after the cycle; never null. |
Definition at line 129 of file ra8_wifi_backend.h.
Referenced by ra8_wifi_poll().