108typedef enum : uint16_t {
155typedef enum : uint16_t {
255typedef enum : uint8_t {
void(* ra8_c6link_rx_cb_t)(void *ctx, const uint8_t *frame, uint16_t len)
Receiver for one 802.3 frame the co-processor forwarded.
void(* ra8_c6link_event_cb_t)(void *ctx, const ra8_c6link_event_t *ev)
Receiver for one decoded co-processor announcement.
struct ra8_c6link_fault ra8_c6link_fault_t
ra8_err_t ra8_c6link_fw_version(ra8_c6link_t *link, ra8_c6link_fw_version_t *out)
Ask the co-processor to identify itself.
ra8_c6link_budget_t
Default pacing and bounds the link works to.
@ k_ra8_c6link_gap_ms
Settling gap between consecutive transactions.
@ k_ra8_c6link_hs_poll_ms
Sampling period while waiting for HANDSHAKE.
@ k_ra8_c6link_announce_transfers
Transactions ra8_c6link_await_ready spends on the announcement before it probes.
@ k_ra8_c6link_hs_wait_ms
Milliseconds to wait for HANDSHAKE before abandoning a transaction.
@ k_ra8_c6link_hs_giveup
Consecutive HANDSHAKE timeouts after which a pump stops early.
@ k_ra8_c6link_rpc_transfers
Transactions one RPC call may clock while waiting for its response.
ra8_err_t ra8_c6link_eth_send(ra8_c6link_t *link, const uint8_t *frame, uint16_t len)
Hand one 802.3 frame to the co-processor for transmission.
ra8_err_t ra8_c6link_close(ra8_c6link_t *link)
Release a link handle.
struct ra8_c6link_mac ra8_c6link_mac_t
ra8_err_t ra8_c6link_last_fault(const ra8_c6link_t *link, ra8_c6link_fault_t *out)
Report the last request that failed on this link.
ra8_err_t(* ra8_c6link_take_fn_t)(void *ctx, const void *msg)
Extractor that copies an answer's fields out.
ra8_c6link_event_kind_t
The co-processor announcements this link surfaces to its owner.
@ k_ra8_c6link_event_sta_connected
Event_StaConnected: the station has associated with an AP.
@ k_ra8_c6link_event_wifi
Event_WifiEventNoArgs: a Wi-Fi event carrying only its own id, reported verbatim in ra8_c6link_event:...
@ k_ra8_c6link_event_sta_disconnected
Event_StaDisconnected: the station has lost or left its AP.
@ k_ra8_c6link_event_boot
Event_ESPInit: the co-processor has booted and is accepting RPC.
ra8_err_t ra8_c6link_open(ra8_c6link_t *link, const ra8_c6link_cfg_t *cfg)
Bind a transport to a link handle and make it usable.
struct ra8_c6link_wait ra8_c6link_wait_t
ra8_err_t ra8_c6link_await_ready(ra8_c6link_t *link, uint16_t max_transactions, ra8_c6link_fw_version_t *out)
Announce this host and prove the co-processor is answering.
struct ra8_c6link_cfg ra8_c6link_cfg_t
ra8_c6link_geometry_t
Fixed sizes of the esp-hosted wire this link speaks.
@ k_ra8_c6link_dma_align
Alignment the transport expects of a transaction buffer.
@ k_ra8_c6link_header_bytes
sizeof(struct esp_payload_header) on this ABI.
@ k_ra8_c6link_mac_bytes
Octets in an IEEE 802 address.
@ k_ra8_c6link_ssid_max
Octets in the longest SSID 802.11 allows.
@ k_ra8_c6link_max_payload
Largest payload one frame can carry.
@ k_ra8_c6link_arena_min
Smallest decode arena ra8_c6link_open accepts.
@ k_ra8_c6link_frame_bytes
Bytes in one transaction; ESP_TRANSPORT_SPI_MAX_BUF_SIZE upstream.
ra8_err_t ra8_c6link_poll(ra8_c6link_t *link, uint16_t max_transactions, ra8_c6link_stats_t *stats)
Clock transactions, delivering whatever the co-processor sends.
struct ra8_c6link_stats ra8_c6link_stats_t
struct ra8_c6link_event ra8_c6link_event_t
struct ra8_c6link_fw_version ra8_c6link_fw_version_t
struct ra8_c6link ra8_c6link_t
bool ra8_c6link_is_open(const ra8_c6link_t *link)
Report whether a handle is currently open.
The one seam between ra8_c6link and the wire that reaches the C6.
struct ra8_c6link_transport ra8_c6link_transport_t
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Allocation-free constants shared by the RA8 and C6 media endpoints.
@ k_ra8_mdl_request_bytes_max
Maximum packed request bytes.
Everything ra8_c6link_open needs that the link cannot discover.
ra8_c6link_transport_t transport
The hardware seam; every row required.
uint32_t arena_bytes
Bytes available at arena.
uint8_t * arena
Protobuf decode arena.
void * cb_ctx
Context handed to both callbacks.
ra8_c6link_rx_cb_t rx_cb
802.3 receive sink, or null to count.
ra8_c6link_event_cb_t event_cb
Announcement sink, or null to count.
One decoded co-processor announcement.
uint8_t channel
Primary channel, sta_connected.
uint16_t reason
802.11 reason code, sta_disconnected.
ra8_c6link_mac_t bssid
AP address for the two station events.
ra8_c6link_event_kind_t kind
Which announcement this is.
char ssid[k_ra8_c6link_ssid_max+1U]
AP SSID, NUL-terminated.
uint32_t reset_reason
Co-processor reset cause, boot.
int8_t rssi
Signal level, sta_disconnected.
int32_t wifi_event_id
Raw id, wifi.
uint8_t ssid_len
Octets of ssid the C6 supplied.
What the co-processor said when a request did not succeed.
uint32_t rpc_id
RPC_ID__Req_* of the request that failed, or zero.
int32_t resp
The co-processor's result code, or zero if none.
Identity the co-processor reports about itself.
uint32_t major
Firmware major version.
char target[16]
CONFIG_IDF_TARGET, NUL-terminated.
uint32_t patch
Firmware patch version.
uint32_t chip_id
Co-processor chip identifier.
uint32_t minor
Firmware minor version.
uint8_t target_len
Characters in target, excluding the NUL.
One IEEE 802 address, by value.
uint8_t octet[k_ra8_c6link_mac_bytes]
Address octets, first on the wire first.
What one pump did on the wire, counted rather than inferred.
uint16_t transfers
Full-duplex transactions clocked.
uint16_t rpc_in
Control-plane frames decoded as Rpc.
uint16_t malformed
Frames whose offset or length was not credible.
uint16_t idle
Filler frames the co-processor returned.
uint16_t hs_timeouts
Transactions abandoned waiting for HANDSHAKE.
uint16_t eth_in
802.3 frames delivered to the receive callback.
uint16_t data
Well-formed frames carrying a payload.
uint16_t bad_checksum
Frames whose recomputed checksum disagreed.
uint16_t unrouted
Frames on an interface this link does not use.
uint16_t events
Announcements delivered to the event callback.
uint16_t undecodable
Control-plane frames the codec would not parse.
The one outstanding request a link is waiting on.
ra8_err_t result
What the extractor decided.
uint32_t uid
UID stamped on the request; echoed back.
void * take_ctx
Context handed to the extractor.
bool armed
A request is outstanding.
ra8_c6link_take_fn_t take
Extractor for the answer's fields.
uint32_t resp_id
RPC_ID__Resp_* that answers it.
bool satisfied
Its answer arrived and was extracted.
Caller-allocated link handle.
uint8_t tx_if
Interface the staged payload uses.
uint32_t arena_used
Bump offset into arena.
uint8_t rx[k_ra8_c6link_frame_bytes]
Receive transaction.
uint32_t next_uid
UID for the next request issued.
void * cb_ctx
Context for both callbacks.
uint32_t arena_bytes
Bytes available at arena.
bool boot_seen
An Event_ESPInit has arrived.
ra8_c6link_rx_cb_t rx_cb
802.3 receive sink, or null.
uint32_t arena_last
Newest live block's offset plus one, or zero when there is none.
bool open
The handle is initialised.
uint8_t * arena
Protobuf decode arena.
ra8_c6link_fault_t fault
The last failing request.
ra8_c6link_stats_t * stats
Counters for the running pump.
uint8_t mdl_request[k_ra8_mdl_request_bytes_max]
Packed inner media request awaiting transmission.
uint16_t tx_len
Staged payload length, or zero.
ra8_c6link_wait_t wait
The outstanding request, if any.
uint8_t tx[k_ra8_c6link_frame_bytes]
Transmit transaction.
ra8_c6link_event_cb_t event_cb
Announcement sink, or null.
ra8_c6link_transport_t transport
Bound hardware seam.