File syn_ble_gap.h¶
FileList > ble > syn_ble_gap.h
Go to the source code of this file
Zero-Heap Generic Access Profile (GAP) Layer.
#include "../common/syn_defs.h"#include "syn_ble_hci.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_BLE_GAP_AdvParams |
| struct | SYN_BLE_GAP_AdvReport |
| struct | SYN_BLE_GAP_ConnInfo |
| struct | SYN_BLE_GAP_s |
Public Types¶
| Type | Name |
|---|---|
| typedef void(* | SYN_BLE_GAP_EventCb |
| enum | SYN_BLE_GAP_EventType |
Public Functions¶
| Type | Name |
|---|---|
| SYN_Status | syn_ble_gap_init (SYN_BLE_GAP * gap, SYN_BLE_HCI * hci, SYN_BLE_GAP_EventCb evt_cb, void * user_data) Initialize GAP engine context. |
| SYN_Status | syn_ble_gap_process_hci_evt (SYN_BLE_GAP * gap, uint8_t evt_code, const uint8_t * payload, uint8_t len) Process HCI Event for GAP state updates. |
| SYN_Status | syn_ble_gap_set_adv_data (SYN_BLE_GAP * gap, const uint8_t * data, uint8_t len, uint8_t * tx_buf, uint16_t * tx_len) Set Advertising Data. |
| SYN_Status | syn_ble_gap_set_adv_enable (SYN_BLE_GAP * gap, bool enable, uint8_t * tx_buf, uint16_t * tx_len) Enable or Disable Advertising. |
Macros¶
| Type | Name |
|---|---|
| define | SYN_BLE_ADV_DIRECT_IND 0x01U |
| define | SYN_BLE_ADV_IND 0x00U |
| define | SYN_BLE_ADV_NONCONN_IND 0x03U |
| define | SYN_BLE_ADV_SCAN_IND 0x02U |
Public Types Documentation¶
typedef SYN_BLE_GAP_EventCb¶
typedef void(* SYN_BLE_GAP_EventCb) (SYN_BLE_GAP *gap, SYN_BLE_GAP_EventType evt_type, const void *evt_data, void *user_data);
GAP Event Callback
enum SYN_BLE_GAP_EventType¶
enum SYN_BLE_GAP_EventType {
SYN_BLE_GAP_EVT_CONNECTED = 0,
SYN_BLE_GAP_EVT_DISCONNECTED,
SYN_BLE_GAP_EVT_ADV_REPORT
};
GAP Event Type
Public Functions Documentation¶
function syn_ble_gap_init¶
Initialize GAP engine context.
SYN_Status syn_ble_gap_init (
SYN_BLE_GAP * gap,
SYN_BLE_HCI * hci,
SYN_BLE_GAP_EventCb evt_cb,
void * user_data
)
Parameters:
gapContext handle pointer.hciInitialized HCI driver handle.evt_cbGAP event callback.user_dataUser context pointer.
Returns:
SYN_OK on success.
function syn_ble_gap_process_hci_evt¶
Process HCI Event for GAP state updates.
SYN_Status syn_ble_gap_process_hci_evt (
SYN_BLE_GAP * gap,
uint8_t evt_code,
const uint8_t * payload,
uint8_t len
)
Parameters:
gapContext handle pointer.evt_codeHCI Event code.payloadEvent payload.lenEvent length.
Returns:
SYN_OK on success.
function syn_ble_gap_set_adv_data¶
Set Advertising Data.
SYN_Status syn_ble_gap_set_adv_data (
SYN_BLE_GAP * gap,
const uint8_t * data,
uint8_t len,
uint8_t * tx_buf,
uint16_t * tx_len
)
Parameters:
gapContext handle pointer.dataAD data payload.lenData length (max 31 bytes).tx_bufHCI TX staging buffer (min 36 bytes).tx_lenOutput length pointer.
Returns:
SYN_OK on success.
function syn_ble_gap_set_adv_enable¶
Enable or Disable Advertising.
SYN_Status syn_ble_gap_set_adv_enable (
SYN_BLE_GAP * gap,
bool enable,
uint8_t * tx_buf,
uint16_t * tx_len
)
Parameters:
gapContext handle pointer.enableTrue to start, false to stop.tx_bufHCI TX staging buffer (min 6 bytes).tx_lenOutput length pointer.
Returns:
SYN_OK on success.
Macro Definition Documentation¶
define SYN_BLE_ADV_DIRECT_IND¶
Connectable directed advertising
define SYN_BLE_ADV_IND¶
Connectable undirected advertising
define SYN_BLE_ADV_NONCONN_IND¶
Non-connectable undirected advertising
define SYN_BLE_ADV_SCAN_IND¶
Scannable undirected advertising
The documentation for this class was generated from the following file src/syntropic/ble/syn_ble_gap.h