File syn_ble_hci.c¶
FileList > ble > syn_ble_hci.c
Go to the source code of this file
Zero-Heap Host Controller Interface (HCI) Driver implementation.
#include "syn_ble_hci.h"#include <string.h>
Public Functions¶
| Type | Name |
|---|---|
| SYN_Status | syn_ble_hci_encode_acl (uint16_t conn_handle, uint8_t pb_flags, uint8_t bc_flags, const uint8_t * data, uint16_t len, uint8_t * tx_buf, uint16_t * tx_len) Encode HCI ACL Data Packet. |
| SYN_Status | syn_ble_hci_encode_command (uint16_t opcode, const uint8_t * params, uint8_t param_len, uint8_t * tx_buf, uint16_t * tx_len) Send HCI Command Packet. |
| SYN_Status | syn_ble_hci_init (SYN_BLE_HCI * hci, const SYN_BLE_HCI_Config * cfg) Initialize HCI Driver Context. |
| SYN_Status | syn_ble_hci_rx_buf (SYN_BLE_HCI * hci, const uint8_t * buf, uint16_t len) Feed raw buffer into HCI receiver state machine. |
| SYN_Status | syn_ble_hci_rx_byte (SYN_BLE_HCI * hci, uint8_t byte) Feed raw bytes from UART/SPI into HCI receiver state machine. |
Public Static Functions¶
| Type | Name |
|---|---|
| void | parse_and_dispatch (SYN_BLE_HCI * hci) Internal parse and dispatch helper. |
Macros¶
| Type | Name |
|---|---|
| define | SYN_BLE_HCI_RX_STATE_HDR 1U |
| define | SYN_BLE_HCI_RX_STATE_PAYLOAD 2U |
| define | SYN_BLE_HCI_RX_STATE_TYPE 0U |
Public Functions Documentation¶
function syn_ble_hci_encode_acl¶
Encode HCI ACL Data Packet.
SYN_Status syn_ble_hci_encode_acl (
uint16_t conn_handle,
uint8_t pb_flags,
uint8_t bc_flags,
const uint8_t * data,
uint16_t len,
uint8_t * tx_buf,
uint16_t * tx_len
)
Parameters:
conn_handle12-bit Connection Handle.pb_flagsPacket Boundary flags (2 bits).bc_flagsBroadcast flags (2 bits).dataData payload bytes.lenData payload length in bytes.tx_bufBuffer to store framed ACL packet (minimum 5 + len bytes).tx_lenPointer to store resulting framed size.
Returns:
SYN_OK on success.
function syn_ble_hci_encode_command¶
Send HCI Command Packet.
SYN_Status syn_ble_hci_encode_command (
uint16_t opcode,
const uint8_t * params,
uint8_t param_len,
uint8_t * tx_buf,
uint16_t * tx_len
)
Parameters:
opcode16-bit HCI Command Opcode.paramsPointer to parameter payload (or NULL if len is 0).param_lenParameter payload length in bytes.tx_bufBuffer to store framed HCI packet (minimum 4 + param_len bytes).tx_lenPointer to store resulting framed size.
Returns:
SYN_OK on success.
function syn_ble_hci_init¶
Initialize HCI Driver Context.
Parameters:
hciDriver handle pointer.cfgDriver configuration struct.
Returns:
SYN_OK on success, SYN_INVALID_PARAM if null.
function syn_ble_hci_rx_buf¶
Feed raw buffer into HCI receiver state machine.
Parameters:
hciDriver handle pointer.bufData buffer pointer.lenData buffer length.
Returns:
SYN_OK on success.
function syn_ble_hci_rx_byte¶
Feed raw bytes from UART/SPI into HCI receiver state machine.
Parameters:
hciDriver handle pointer.byteSingle received byte from H:4 transport.
Returns:
SYN_OK on success.
Public Static Functions Documentation¶
function parse_and_dispatch¶
Internal parse and dispatch helper.
Parameters:
hciHCI driver handle.
Macro Definition Documentation¶
define SYN_BLE_HCI_RX_STATE_HDR¶
RX State: Header
define SYN_BLE_HCI_RX_STATE_PAYLOAD¶
RX State: Payload
define SYN_BLE_HCI_RX_STATE_TYPE¶
RX State: Packet Type
The documentation for this class was generated from the following file src/syntropic/ble/syn_ble_hci.c