38static_assert(
sizeof(RPC_EP_NAME_RSP) ==
sizeof(RPC_EP_NAME_EVT),
39 "esp-hosted requires every RPC endpoint name to have one length");
96 if ((out ==
nullptr) || (body_at ==
nullptr)) {
109 out[at + i] = (uint8_t)RPC_EP_NAME_RSP[i];
138 if ((got != (uint8_t)RPC_EP_NAME_RSP[i]) && (got != (uint8_t)RPC_EP_NAME_EVT[i])) {
148 if ((payload ==
nullptr) || (proto_len ==
nullptr)) {
152 const uint16_t data_tag =
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.
Cross-translation-unit contract inside libs/ra8_c6link.
@ 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.
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.
static bool internal_c6link_tlv_named(const uint8_t *payload)
Check that a payload names one of the two RPC endpoints.
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.
static uint16_t internal_c6link_tlv_len(const uint8_t *buf, uint16_t at)
Read one tag's little-endian 16-bit length.
static uint16_t internal_c6link_tlv_tag(uint8_t *out, uint16_t at, uint8_t type, uint16_t len)
Write one three-byte tag header at a cursor.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_null_ptr
Pointer was NULL where a valid pointer was required.
@ k_ra8_err_invalid_size
Invalid size parameter (too large, too small, or misaligned).
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.