56typedef enum : uint8_t {
71typedef enum : uint8_t {
86typedef enum : uint8_t {
99typedef enum : uint8_t {
107typedef enum : uint32_t {
152 if (params ==
nullptr && params_len > 0U) {
157 if (hci_evt ==
nullptr) {
164 if (params_len > 0U) {
201 if (payload ==
nullptr && len > 0U) {
296 if (buf ==
nullptr) {
299 const uint8_t* bytes = (
const uint8_t*)buf;
300 const uint16_t opcode =
302 const uint8_t params_len = bytes[2];
303 const uint8_t* params = (params_len == 0U) ?
nullptr : &bytes[3];
333 const uint16_t handle =
ble_hci_ra8_ble_acl_layout_t
Layout offsets used when packing/unpacking HCI ACL data.
@ k_ble_hci_acl_off_handle_hi
Handle high byte + flags.
@ k_ble_hci_acl_off_len_lo
Length low byte.
@ k_ble_hci_acl_header_len
Total ACL-header byte count.
@ k_ble_hci_acl_off_len_hi
Length high byte.
@ k_ble_hci_acl_off_payload
Payload start offset.
@ k_ble_hci_acl_off_handle_lo
Handle low byte.
void ble_transport_ll_init(void)
LL-side transport init hook (called by ble_transport_init).
int ble_transport_to_ll_cmd_impl(void *buf)
Controller-side handler for an HCI command from the host.
static void internal_acl_cb(void *ctx, uint16_t handle, const uint8_t *payload, uint16_t len)
Inbound ACL data callback (controller -> host).
ra8_err_t ble_hci_ra8_ble_deinit(void)
Detach the adapter from the ra8_ble HCI ring.
ble_hci_ra8_ble_bits_t
Shared bit-shift constants.
@ k_ble_hci_shift_byte
Byte shift for LE16 fold/unfold.
static void internal_event_cb(void *ctx, uint8_t evt_code, const uint8_t *params, uint8_t params_len)
Inbound HCI event callback (controller -> host).
ble_hci_ra8_ble_masks_t
Shared bit-mask constants.
@ k_ble_hci_mask_byte
Low-byte mask for 16-bit splits.
int ble_transport_to_ll_iso_impl(struct os_mbuf *om)
Stub LL-side ISO transport hook.
ble_hci_ra8_ble_state_t
Adapter lifecycle states.
@ k_ble_hci_ra8_ble_state_idle
Constructed, not yet attached.
@ k_ble_hci_ra8_ble_state_running
Callbacks attached to ra8_ble.
ra8_err_t ble_hci_ra8_ble_init(void)
Attach the adapter to the ra8_ble HCI ring.
int ble_transport_to_ll_acl_impl(struct os_mbuf *om)
Controller-side handler for an ACL packet from the host.
ble_hci_ra8_ble_evt_layout_t
Layout offsets used when packing/unpacking HCI event buffers.
@ k_ble_hci_evt_header_len
Total event-header byte count.
@ k_ble_hci_evt_off_len
Offset of the parameter-length byte.
@ k_ble_hci_evt_off_params
Offset of the parameter payload.
@ k_ble_hci_evt_off_code
Offset of the event-code byte.
Apache NimBLE HCI transport adapter against the ra8_ble HCI ring.
@ k_ble_hci_ra8_ble_acl_buf_max
Maximum HCI ACL payload byte count + 4-byte header.
Weak link stubs standing in for the NimBLE transport core.
int ble_transport_to_hs_acl(struct os_mbuf *om)
Push an ACL packet up to the host stack.
int os_mbuf_free_chain(struct os_mbuf *om)
Free every mbuf in a chain.
void ble_transport_free(void *buf)
Release a buffer obtained from ble_transport_alloc_evt().
uint16_t os_mbuf_len(const struct os_mbuf *om)
Total payload length of an mbuf chain.
int os_mbuf_copydata(const struct os_mbuf *om, int off, int len, void *dst)
Copy a byte range out of an mbuf chain.
int os_mbuf_append(struct os_mbuf *om, const void *data, uint16_t len)
Append bytes to an mbuf chain (upstream os_mbuf.h).
int ble_transport_to_hs_evt(void *buf)
Push an HCI event up to the host stack.
void * ble_transport_alloc_evt(int discardable)
Allocate an HCI event buffer (upstream ble_transport.h).
struct os_mbuf * ble_transport_alloc_acl_from_ll(void)
Allocate an ACL mbuf for the LL-to-host direction.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
BLE HCI transport seam (host-side).
ra8_err_t ra8_ble_attach_event_handler(ra8_ble_event_fn_t fn, void *ctx)
Register a handler for inbound HCI events.
ra8_err_t ra8_ble_attach_acl_handler(ra8_ble_acl_fn_t fn, void *ctx)
Register a handler for inbound HCI ACL data.
ra8_err_t ra8_ble_hci_send_command(uint16_t opcode, const uint8_t *params, uint8_t params_len)
Emit an HCI command packet.
ra8_err_t ra8_ble_hci_send_acl_data(uint16_t handle, const uint8_t *payload, uint16_t len)
Emit an HCI ACL data packet.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_not_initialized
Module not initialized – _init() not yet called successfully.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
void * memcpy(void *dst, const void *src, size_t n)
Copy memory area between non-overlapping regions.