40#include "esp_hosted_header.h"
41#include "esp_hosted_interface.h"
42#include "esp_hosted_rpc.pb-c.h"
43#include "esp_hosted_transport.h"
44#include "protobuf-c/protobuf-c.h"
68typedef enum : uint8_t {
383typedef enum : uint8_t {
464typedef enum : uint16_t {
551[[nodiscard]]
RA8_PRIV const uint8_t*
820 uint16_t max_transactions,
944 const ProtobufCBinaryData* src);
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
The single integration boundary between this firmware and the ESP32-C6.
struct ra8_c6link_mac ra8_c6link_mac_t
ra8_err_t(* ra8_c6link_take_fn_t)(void *ctx, const void *msg)
Extractor that copies an answer's fields out.
struct ra8_c6link_stats ra8_c6link_stats_t
struct ra8_c6link_event ra8_c6link_event_t
struct ra8_c6link ra8_c6link_t
ra8_err_t priv_c6link_pump(ra8_c6link_t *link, uint16_t max_transactions, ra8_c6link_stats_t *stats)
Clock transactions until the budget or the wait says stop.
void priv_c6link_arena_free(void *ctx, void *pointer)
Return a block to the link's decode arena.
void priv_c6link_frame_seal(uint8_t *tx, uint8_t if_type, uint8_t if_num, uint16_t len)
Wrap an already-staged payload in a payload header.
const uint8_t * priv_c6link_tlv_body(const uint8_t *payload, uint16_t len, uint16_t *proto_len)
Strip the envelope off a received serial payload.
bool priv_c6link_rpc_consume(ra8_c6link_t *link, const uint8_t *payload, uint16_t len)
Decode one control-plane payload and act on it.
ra8_err_t priv_c6link_take_resp(void *ctx, const void *msg_v)
Extract the result code from an answer that carries nothing else.
uint8_t priv_c6link_caps(uint8_t *out, uint8_t cap)
Build the host-capabilities announcement.
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.
struct ra8_c6link_take_ctx ra8_c6link_take_ctx_t
void priv_c6link_frame_filler(uint8_t *tx)
Stamp the transmit transaction as the host's idle filler.
ra8_c6link_frame_class_t
What one received transaction turned out to be.
@ k_ra8_c6link_frame_malformed
The offset was not the header size, or the length did not fit.
@ k_ra8_c6link_frame_data
A well-formed frame whose checksum verified; the payload is real.
@ k_ra8_c6link_frame_idle
The co-processor's filler frame: zero length, and legitimately offset = 0, which is not a defect.
@ k_ra8_c6link_frame_bad_checksum
The recomputed checksum disagreed with the transmitted one.
ra8_c6link_frame_class_t priv_c6link_frame_classify(uint8_t *rx, ra8_c6link_rx_view_t *view)
Decide what a received transaction is, and where its payload lies.
ra8_err_t priv_c6link_tlv_open(uint8_t *out, uint16_t cap, uint16_t proto_len, uint16_t *body_at)
Write both envelope tags ahead of a protobuf payload.
void priv_c6link_emit(ra8_c6link_t *link, const ra8_c6link_event_t *ev)
Deliver one decoded announcement to the registered callback.
struct ra8_c6link_rx_view ra8_c6link_rx_view_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.
void priv_c6link_arena_bind(ProtobufCAllocator *out, ra8_c6link_t *link)
Bind an allocator descriptor to a link's arena.
bool priv_c6link_dispatch(ra8_c6link_t *link, const ra8_c6link_rx_view_t *view)
Route one well-formed received frame to whatever understands 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.
void * priv_c6link_arena_alloc(void *ctx, size_t size)
Take a block from the link's decode arena.
void priv_c6link_arena_reset(ra8_c6link_t *link)
Empty the link's decode arena.
ra8_c6link_tlv_t
The serial endpoint's TLV envelope, tag by tag.
@ k_ra8_c6link_tlv_overhead
Bytes the envelope costs on top of the protobuf payload.
@ k_ra8_c6link_tlv_ep_len
Endpoint-name length; both endpoint names share it.
@ k_ra8_c6link_tlv_value
Offset of a tag's value.
@ k_ra8_c6link_tlv_t_epname
Tag introducing the endpoint name.
@ k_ra8_c6link_tlv_shift
Shift between the two length bytes.
@ k_ra8_c6link_tlv_t_data
Tag introducing the protobuf payload.
@ k_ra8_c6link_tlv_len_lo
Offset of a tag's length, low byte.
@ k_ra8_c6link_tlv_type
Offset of a tag's type byte.
@ k_ra8_c6link_tlv_len_hi
Offset of a tag's length, high byte.
@ k_ra8_c6link_tlv_mask
Byte mask for a length byte.
ra8_c6link_caps_t
The host-capabilities announcement, tag by tag.
@ k_ra8_c6link_caps_stride
Octets one one-valued TLV occupies.
@ k_ra8_c6link_caps_throttle_high
Flow-control high-water mark, H_WIFI_TX_DATA_THROTTLE_HIGH_THRESHOLD.
@ k_ra8_c6link_caps_bytes
Whole frame: two header octets plus five three-octet TLVs.
@ k_ra8_c6link_caps_hdr
Octets before the first TLV.
@ k_ra8_c6link_caps_type
Offset of the event-type octet.
@ k_ra8_c6link_caps_throttle_low
Flow-control low-water mark, H_WIFI_TX_DATA_THROTTLE_LOW_THRESHOLD.
@ k_ra8_c6link_caps_chip
ESP_PRIV_FIRMWARE_CHIP_ESP32C6: the part this board carries.
@ k_ra8_c6link_caps_value_len
Value width of every tag emitted.
@ k_ra8_c6link_caps_raw_tp
Raw-throughput test direction; disabled, matching H_TEST_RAW_TP_DIR.
@ k_ra8_c6link_caps_tags
TLVs this host emits.
@ k_ra8_c6link_caps_host
Host capability word.
@ k_ra8_c6link_caps_len
Offset of the event-length octet.
uint8_t priv_c6link_copy_str(char *dst, uint8_t cap, const ProtobufCBinaryData *src)
Copy a length-counted binary field into a NUL-terminated string.
bool priv_c6link_copy_mac(ra8_c6link_mac_t *dst, const ProtobufCBinaryData *src)
Copy a binary field into a MAC address, all-or-nothing.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Where the payload of a classified frame is, and what it claims to be.
uint16_t offset
Byte offset of the payload within the transaction.
uint8_t if_num
Interface number from the header.
uint16_t len
Payload length in bytes.
uint8_t if_type
Interface type from the header.
What an answer extractor is given alongside the decoded message.
ra8_c6link_t * link
Handle the request was issued on.
uint32_t rpc_id
RPC_ID__Req_* to record in the fault slot.
void * out
Where the extracted fields go, or null.