59typedef enum : int32_t {
89typedef enum : int32_t {
129 const Rpc* msg = (
const Rpc*)msg_v;
132 switch ((int32_t)msg->msg_id) {
133 case (int32_t)RPC_ID__Resp_WifiInit:
134 resp = (msg->resp_wifi_init !=
nullptr) ? msg->resp_wifi_init->resp : -1;
136 case (int32_t)RPC_ID__Resp_SetWifiMode:
137 resp = (msg->resp_set_wifi_mode !=
nullptr) ? msg->resp_set_wifi_mode->resp : -1;
139 case (int32_t)RPC_ID__Resp_WifiSetConfig:
140 resp = (msg->resp_wifi_set_config !=
nullptr) ? msg->resp_wifi_set_config->resp : -1;
142 case (int32_t)RPC_ID__Resp_WifiStart:
143 resp = (msg->resp_wifi_start !=
nullptr) ? msg->resp_wifi_start->resp : -1;
145 case (int32_t)RPC_ID__Resp_WifiStop:
146 resp = (msg->resp_wifi_stop !=
nullptr) ? msg->resp_wifi_stop->resp : -1;
148 case (int32_t)RPC_ID__Resp_WifiDeinit:
149 resp = (msg->resp_wifi_deinit !=
nullptr) ? msg->resp_wifi_deinit->resp : -1;
151 case (int32_t)RPC_ID__Resp_WifiConnect:
152 resp = (msg->resp_wifi_connect !=
nullptr) ? msg->resp_wifi_connect->resp : -1;
154 case (int32_t)RPC_ID__Resp_WifiDisconnect:
155 resp = (msg->resp_wifi_disconnect !=
nullptr) ? msg->resp_wifi_disconnect->resp : -1;
226 switch ((int32_t)req_id) {
227 case (int32_t)RPC_ID__Req_WifiStart:
228 rpc__req__wifi_start__init(&body->
start);
229 req->payload_case = RPC__PAYLOAD_REQ_WIFI_START;
230 req->req_wifi_start = &body->
start;
231 *resp_id = (uint32_t)RPC_ID__Resp_WifiStart;
233 case (int32_t)RPC_ID__Req_WifiStop:
234 rpc__req__wifi_stop__init(&body->
stop);
235 req->payload_case = RPC__PAYLOAD_REQ_WIFI_STOP;
236 req->req_wifi_stop = &body->
stop;
237 *resp_id = (uint32_t)RPC_ID__Resp_WifiStop;
239 case (int32_t)RPC_ID__Req_WifiDeinit:
240 rpc__req__wifi_deinit__init(&body->
deinit);
241 req->payload_case = RPC__PAYLOAD_REQ_WIFI_DEINIT;
242 req->req_wifi_deinit = &body->
deinit;
243 *resp_id = (uint32_t)RPC_ID__Resp_WifiDeinit;
245 case (int32_t)RPC_ID__Req_WifiConnect:
246 rpc__req__wifi_connect__init(&body->
connect);
247 req->payload_case = RPC__PAYLOAD_REQ_WIFI_CONNECT;
248 req->req_wifi_connect = &body->
connect;
249 *resp_id = (uint32_t)RPC_ID__Resp_WifiConnect;
251 case (int32_t)RPC_ID__Req_WifiDisconnect:
252 rpc__req__wifi_disconnect__init(&body->
disconnect);
253 req->payload_case = RPC__PAYLOAD_REQ_WIFI_DISCONNECT;
255 *resp_id = (uint32_t)RPC_ID__Resp_WifiDisconnect;
265 if (link ==
nullptr) {
271 req.msg_type = RPC_TYPE__Req;
272 req.msg_id = (RpcId)req_id;
275 uint32_t resp_id = 0U;
307 wifi_init_config__init(&cfg);
322 cfg.sta_disconnected_pm =
true;
328 rpc__req__wifi_init__init(&body);
333 req.msg_type = RPC_TYPE__Req;
334 req.msg_id = RPC_ID__Req_WifiInit;
335 req.payload_case = RPC__PAYLOAD_REQ_WIFI_INIT;
336 req.req_wifi_init = &body;
340 .rpc_id = (uint32_t)RPC_ID__Req_WifiInit};
343 (uint32_t)RPC_ID__Resp_WifiInit,
368 rpc__req__set_mode__init(&body);
373 req.msg_type = RPC_TYPE__Req;
374 req.msg_id = RPC_ID__Req_SetWifiMode;
375 req.payload_case = RPC__PAYLOAD_REQ_SET_WIFI_MODE;
376 req.req_set_wifi_mode = &body;
380 .rpc_id = (uint32_t)RPC_ID__Req_SetWifiMode};
383 (uint32_t)RPC_ID__Resp_SetWifiMode,
390 if (link ==
nullptr) {
410 if (link ==
nullptr) {
419 return (stopped !=
k_ra8_ok) ? stopped : deinit;
424 if (link ==
nullptr) {
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
The single integration boundary between this firmware and the ESP32-C6.
struct ra8_c6link ra8_c6link_t
bool ra8_c6link_is_open(const ra8_c6link_t *link)
Report whether a handle is currently open.
Cross-translation-unit contract inside libs/ra8_c6link.
ra8_err_t priv_c6link_take_resp(void *ctx, const void *msg_v)
Extract the result code from an answer that carries nothing else.
struct ra8_c6link_take_ctx ra8_c6link_take_ctx_t
ra8_err_t priv_c6link_resp(ra8_c6link_t *link, uint32_t rpc_id, int32_t resp)
Map a co-processor result code onto an ra8 error, recording it.
ra8_err_t priv_c6link_rpc_call(ra8_c6link_t *link, Rpc *req, uint32_t resp_id, ra8_c6link_take_fn_t take, void *take_ctx)
Issue one request and pump until its answer arrives.
ra8_err_t priv_c6link_take_resp(void *ctx, const void *msg_v)
Extract the result code from an answer that carries nothing else.
ra8_err_t ra8_c6link_wifi_stop(ra8_c6link_t *link)
Stop the radio and release the co-processor's Wi-Fi resources.
static ra8_err_t internal_c6link_wifi_do_mode(ra8_c6link_t *link)
Send Req_SetWifiMode selecting station mode.
static bool internal_c6link_wifi_bare_body(Rpc *req, ra8_c6link_bare_body_t *body, uint32_t req_id, uint32_t *resp_id)
Populate an Rpc with the empty body a bare request needs.
struct ra8_c6link_bare_body ra8_c6link_bare_body_t
ra8_err_t priv_c6link_bare_req(ra8_c6link_t *link, uint32_t req_id)
Issue a request whose body carries no fields and whose answer carries only a result code.
static ra8_err_t internal_c6link_wifi_do_init(ra8_c6link_t *link)
Send Req_WifiInit carrying the default configuration set.
ra8_c6link_wifi_init_t
The Req_WifiInit configuration this host transmits.
@ k_ra8_c6link_wifi_rx_mgmt_type
Management receive buffers are static by default.
@ k_ra8_c6link_wifi_espnow_keys
ESP-NOW encrypted peer slots.
@ k_ra8_c6link_wifi_ba_win
Block-ack window.
@ k_ra8_c6link_wifi_feature_caps
Feature bitmap; bit zero is WPA3-SAE, which the bench network does not use but which costs nothing to...
@ k_ra8_c6link_wifi_static_tx
Static transmit buffers; zero because the type above is dynamic.
@ k_ra8_c6link_wifi_dynamic_rx
Dynamic receive buffers.
@ k_ra8_c6link_wifi_static_rx
Static receive buffers.
@ k_ra8_c6link_wifi_tx_type
Transmit buffer type: dynamic, which is the IDF default.
@ k_ra8_c6link_wifi_beacon_max
Longest beacon the soft-AP path would build; unused by a station but part of the validated set.
@ k_ra8_c6link_wifi_dynamic_tx
Dynamic transmit buffers.
@ k_ra8_c6link_wifi_ampdu_on
Aggregation enabled in both directions, as IDF defaults it.
@ k_ra8_c6link_wifi_nvs_on
Let the co-processor persist calibration in its own NVS.
@ k_ra8_c6link_wifi_rx_mgmt_num
Management receive buffers.
@ k_ra8_c6link_wifi_magic
WIFI_INIT_CONFIG_MAGIC; the first thing the far side validates.
@ k_ra8_c6link_wifi_hetb_queues
HE trigger-based queues.
@ k_ra8_c6link_wifi_mgmt_sbuf
Management short-buffer count.
ra8_err_t ra8_c6link_wifi_leave(ra8_c6link_t *link)
Disassociate the station from its current network.
ra8_err_t ra8_c6link_wifi_start(ra8_c6link_t *link)
Start the co-processor's Wi-Fi radio in station mode.
ra8_c6link_wifi_mode_t
The co-processor's own wifi_mode_t values, as transmitted.
@ k_ra8_c6link_mode_null
Radio configured for neither role.
@ k_ra8_c6link_mode_sta
Station.
@ k_ra8_c6link_mode_ap
Access point.
Wi-Fi station bring-up and association over the C6 link.
@ k_ra8_err_not_supported
Requested feature not compiled in, not wired, or not supported by this MCU variant.
@ k_ra8_err_not_initialized
Module not initialized – _init() not yet called successfully.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_null_ptr
Pointer was NULL where a valid pointer was required.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Storage for whichever empty request body a bare call needs.
RpcReqWifiConnect connect
Req_WifiConnect body.
RpcReqWifiStart start
Req_WifiStart body.
RpcReqWifiDisconnect disconnect
Req_WifiDisconnect body.
RpcReqWifiDeinit deinit
Req_WifiDeinit body.
RpcReqWifiStop stop
Req_WifiStop body.
ra8_c6link_t * link
Handle the request was issued on.
uint32_t rpc_id
RPC_ID__Req_* to record in the fault slot.