90typedef enum : uint8_t {
121typedef enum : uint16_t {
153typedef enum : uint8_t {
182typedef enum : uint8_t {
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_err_t ra8_wifi_deinit(ra8_wifi_t *wifi)
Release a handle and power its radio down.
ra8_wifi_state_t
Where a handle is on the path from powered-off to holding an IP.
@ k_ra8_wifi_state_ip_bound
A DHCP lease is held.
@ k_ra8_wifi_state_associating
A join has been asked for.
@ k_ra8_wifi_state_associated
Station is joined; no IP yet.
@ k_ra8_wifi_state_down
Not associated; radio may be off.
ra8_err_t ra8_wifi_init(ra8_wifi_t *wifi, const ra8_wifi_cfg_t *cfg)
Bring the radio and its link up and make a handle usable.
ra8_wifi_limits_t
Fixed field capacities this facade works to.
@ k_ra8_wifi_mac_bytes
Octets in an IEEE 802 address.
@ k_ra8_wifi_ssid_max
Octets in the longest 802.11 SSID.
struct ra8_wifi_backend ra8_wifi_backend_t
One radio's implementation of the operations this facade dispatches.
struct ra8_wifi_ap ra8_wifi_ap_t
ra8_err_t ra8_wifi_get_mac(ra8_wifi_t *wifi, ra8_wifi_mac_t *out)
Read the station's own MAC address.
struct ra8_wifi_mac ra8_wifi_mac_t
struct ra8_wifi_lease ra8_wifi_lease_t
ra8_err_t ra8_wifi_get_ap(ra8_wifi_t *wifi, ra8_wifi_ap_t *out)
Read what the backend knows about the associated AP.
struct ra8_wifi ra8_wifi_t
ra8_err_t ra8_wifi_get_ip(const ra8_wifi_t *wifi, ra8_wifi_lease_t *out)
Read the cached DHCP lease without touching the wire.
ra8_err_t(* ra8_wifi_ip_bind_fn)(void *ip_ctx, const ra8_wifi_mac_t *mac, ra8_wifi_lease_t *out)
Caller-supplied hook that turns an associated station into a lease.
ra8_err_t ra8_wifi_wait_ip(ra8_wifi_t *wifi, ra8_wifi_lease_t *out)
Obtain an IP address for the associated station, blocking until bound.
ra8_wifi_link_t
The instantaneous association state a backend reports.
@ k_ra8_wifi_link_up
Station is associated with an AP.
@ k_ra8_wifi_link_down
Station is not associated.
ra8_err_t ra8_wifi_status(const ra8_wifi_t *wifi, ra8_wifi_status_t *out)
Read a handle's cached status without touching the wire.
ra8_err_t ra8_wifi_disconnect(ra8_wifi_t *wifi)
Disassociate the station and power the radio down.
struct ra8_wifi_status ra8_wifi_status_t
struct ra8_wifi_cfg ra8_wifi_cfg_t
ra8_wifi_budget_t
Bounds that turn "never associated" into a returned timeout.
@ k_ra8_wifi_join_polls
Times ra8_wifi_connect services the link while waiting for the join to complete.
@ k_ra8_wifi_poll_gap_ms
Milliseconds the facade idles between two association attempts.
ra8_err_t ra8_wifi_connect(ra8_wifi_t *wifi, const char *ssid, const char *psk)
Join a network by SSID and passphrase, blocking until associated.
ra8_err_t ra8_wifi_poll(ra8_wifi_t *wifi, ra8_wifi_link_t *out)
Service the link once and refresh the cached association state.
What the backend knows about the AP the station is on.
int32_t authmode
Backend authentication-mode code.
char ssid[k_ra8_wifi_ssid_max+1U]
Its SSID, NUL-terminated.
ra8_wifi_mac_t bssid
Address of the associated AP.
int8_t rssi
Signal level in dBm.
uint8_t ssid_len
Octets of ssid.
uint8_t channel
Primary channel in use.
Everything ra8_wifi_init needs that the facade cannot discover.
const ra8_wifi_backend_t * backend
Radio operations; every row set.
void * backend_ctx
Opaque state handed to the backend.
ra8_wifi_ip_bind_fn ip_bind
IP-stack hook for ra8_wifi_wait_ip.
void * ip_ctx
Opaque context handed to ip_bind.
The IPv4 configuration an ra8_wifi_ip_bind_fn obtained.
uint32_t dhcp_server
Address of the DHCP server that answered.
uint32_t gateway
Default gateway from the lease.
uint32_t mask
Subnet mask from the lease.
bool bound
A usable lease is held.
uint32_t ip
Leased station address, or zero if unbound.
One IEEE 802 address, by value.
uint8_t octet[k_ra8_wifi_mac_bytes]
Address octets, first on the wire first.
A single snapshot of where a handle is, without touching the wire.
ra8_wifi_state_t state
Lifecycle position.
bool associated
The station is joined.
bool ip_bound
A DHCP lease is held.
int8_t rssi
Last known signal level in dBm, or zero.
ra8_wifi_lease_t ip
The current lease, valid when ip_bound.
Caller-allocated Wi-Fi handle.
ra8_wifi_ip_bind_fn ip_bind
Bound IP-stack hook.
const ra8_wifi_backend_t * backend
Bound radio operations.
void * backend_ctx
Backend's opaque state.
void * ip_ctx
Context for ip_bind.
ra8_wifi_mac_t mac
Cached station address.
bool mac_valid
mac has been read.
bool radio_on
The radio has been started.
ra8_wifi_state_t state
Lifecycle position.
bool open
The handle is initialised.
ra8_wifi_lease_t lease
Cached DHCP lease.
int8_t rssi
Last signal reading, dBm.