32#include "ble_hs_adv.h"
33#include "nimble/porting/nimble/include/syscfg/syscfg.h"
34#include "ble_esp_gap.h"
36#if MYNEWT_VAL(ENC_ADV_DATA)
37#include "../../src/ble_hs_hci_priv.h"
44struct hci_le_conn_complete;
45struct hci_conn_update;
47#define BLE_GAP_ADV_ITVL_MS(t) ((t) * 1000 / BLE_HCI_ADV_ITVL)
48#define BLE_GAP_SCAN_ITVL_MS(t) ((t) * 1000 / BLE_HCI_SCAN_ITVL)
49#define BLE_GAP_SCAN_WIN_MS(t) ((t) * 1000 / BLE_HCI_SCAN_ITVL)
50#define BLE_GAP_CONN_ITVL_MS(t) ((t) * 1000 / BLE_HCI_CONN_ITVL)
51#define BLE_GAP_SUPERVISION_TIMEOUT_MS(t) ((t) / 10)
52#define BLE_GAP_PERIODIC_ITVL_MS(t) ((t) * 1000 / BLE_HCI_PERIODIC_ADV_ITVL)
54#if MYNEWT_VAL(BLE_HIGH_DUTY_ADV_ITVL)
56#define BLE_GAP_ADV_FAST_INTERVAL1_MIN BLE_GAP_ADV_ITVL_MS(5)
59#define BLE_GAP_ADV_FAST_INTERVAL1_MIN BLE_GAP_ADV_ITVL_MS(30)
63#define BLE_GAP_ADV_FAST_INTERVAL1_MAX BLE_GAP_ADV_ITVL_MS(60)
65#if MYNEWT_VAL(BLE_HIGH_DUTY_ADV_ITVL)
67#define BLE_GAP_ADV_FAST_INTERVAL2_MIN BLE_GAP_ADV_ITVL_MS(5)
70#define BLE_GAP_ADV_FAST_INTERVAL2_MIN BLE_GAP_ADV_ITVL_MS(100)
74#define BLE_GAP_ADV_FAST_INTERVAL2_MAX BLE_GAP_ADV_ITVL_MS(150)
77#define BLE_GAP_SCAN_FAST_INTERVAL_MIN BLE_GAP_SCAN_ITVL_MS(30)
80#define BLE_GAP_SCAN_FAST_INTERVAL_MAX BLE_GAP_SCAN_ITVL_MS(60)
83#define BLE_GAP_LIM_DISC_SCAN_INT BLE_GAP_SCAN_ITVL_MS(11.25)
86#define BLE_GAP_LIM_DISC_SCAN_WINDOW BLE_GAP_SCAN_WIN_MS(11.25)
89#define BLE_GAP_SCAN_FAST_WINDOW BLE_GAP_SCAN_WIN_MS(30)
92#define BLE_GAP_SCAN_FAST_PERIOD BLE_GAP_SCAN_ITVL_MS(30.72)
95#define BLE_GAP_SCAN_SLOW_INTERVAL1 BLE_GAP_SCAN_ITVL_MS(1280)
98#define BLE_GAP_SCAN_SLOW_WINDOW1 BLE_GAP_SCAN_WIN_MS(11.25)
101#define BLE_GAP_DISC_DUR_DFLT (10.24 * 1000)
104#define BLE_GAP_CONN_DUR_DFLT (30 * 1000)
107#define BLE_GAP_CONN_PAUSE_CENTRAL (1 * 1000)
110#define BLE_GAP_CONN_PAUSE_PERIPHERAL (5 * 1000)
113#define BLE_GAP_INITIAL_CONN_ITVL_MIN BLE_GAP_CONN_ITVL_MS(30)
116#define BLE_GAP_INITIAL_CONN_ITVL_MAX BLE_GAP_CONN_ITVL_MS(50)
119#define BLE_GAP_ADV_DFLT_CHANNEL_MAP 0x07
121#define BLE_GAP_INITIAL_CONN_LATENCY 0
122#define BLE_GAP_INITIAL_SUPERVISION_TIMEOUT 0x0100
123#define BLE_GAP_INITIAL_CONN_MIN_CE_LEN 0x0000
124#define BLE_GAP_INITIAL_CONN_MAX_CE_LEN 0x0000
126#define BLE_GAP_ROLE_MASTER 0
127#define BLE_GAP_ROLE_SLAVE 1
129#define BLE_GAP_EVENT_CONNECT 0
130#define BLE_GAP_EVENT_DISCONNECT 1
132#define BLE_GAP_EVENT_CONN_UPDATE 3
133#define BLE_GAP_EVENT_CONN_UPDATE_REQ 4
134#define BLE_GAP_EVENT_L2CAP_UPDATE_REQ 5
135#define BLE_GAP_EVENT_TERM_FAILURE 6
136#define BLE_GAP_EVENT_DISC 7
137#define BLE_GAP_EVENT_DISC_COMPLETE 8
138#define BLE_GAP_EVENT_ADV_COMPLETE 9
139#define BLE_GAP_EVENT_ENC_CHANGE 10
140#define BLE_GAP_EVENT_PASSKEY_ACTION 11
141#define BLE_GAP_EVENT_NOTIFY_RX 12
142#define BLE_GAP_EVENT_NOTIFY_TX 13
143#define BLE_GAP_EVENT_SUBSCRIBE 14
144#define BLE_GAP_EVENT_MTU 15
145#define BLE_GAP_EVENT_IDENTITY_RESOLVED 16
146#define BLE_GAP_EVENT_REPEAT_PAIRING 17
147#define BLE_GAP_EVENT_PHY_UPDATE_COMPLETE 18
148#define BLE_GAP_EVENT_EXT_DISC 19
149#define BLE_GAP_EVENT_PERIODIC_SYNC 20
150#define BLE_GAP_EVENT_PERIODIC_REPORT 21
151#define BLE_GAP_EVENT_PERIODIC_SYNC_LOST 22
152#define BLE_GAP_EVENT_SCAN_REQ_RCVD 23
153#define BLE_GAP_EVENT_PERIODIC_TRANSFER 24
154#define BLE_GAP_EVENT_PATHLOSS_THRESHOLD 25
155#define BLE_GAP_EVENT_TRANSMIT_POWER 26
156#define BLE_GAP_EVENT_SUBRATE_CHANGE 27
157#define BLE_GAP_EVENT_VS_HCI 28
158#define BLE_GAP_EVENT_REATTEMPT_COUNT 29
159#define BLE_GAP_EVENT_AUTHORIZE 30
160#define BLE_GAP_EVENT_TEST_UPDATE 31
161#define BLE_GAP_EVENT_DATA_LEN_CHG 32
164#define BLE_GAP_DTM_TX_START_EVT 0
165#define BLE_GAP_DTM_RX_START_EVT 1
166#define BLE_GAP_DTM_END_EVT 2
171#define BLE_GAP_SUBSCRIBE_REASON_WRITE 1
174#define BLE_GAP_SUBSCRIBE_REASON_TERM 2
180#define BLE_GAP_SUBSCRIBE_REASON_RESTORE 3
182#define BLE_GAP_REPEAT_PAIRING_RETRY 1
183#define BLE_GAP_REPEAT_PAIRING_IGNORE 2
190#define BLE_STATIC_RAND_ADDR_MASK 0xC0
193#define BLE_NON_RPA_MASK 0x3F
198#define BLE_GAP_AUTHORIZE_ACCEPT 1
199#define BLE_GAP_AUTHORIZE_REJECT 2
382#if MYNEWT_VAL(BLE_EXT_ADV)
384#define BLE_GAP_EXT_ADV_DATA_STATUS_COMPLETE 0x00
385#define BLE_GAP_EXT_ADV_DATA_STATUS_INCOMPLETE 0x01
386#define BLE_GAP_EXT_ADV_DATA_STATUS_TRUNCATED 0x02
389struct ble_gap_ext_disc_desc {
414 uint8_t legacy_event_type;
442 uint16_t periodic_adv_itvl;
453 ble_addr_t direct_addr;
486struct ble_gap_repeat_pairing {
488 uint16_t conn_handle;
491 uint8_t cur_key_size;
492 uint8_t cur_authenticated:1;
499 uint8_t new_key_size;
500 uint8_t new_authenticated:1;
502 uint8_t new_bonding:1;
563#if MYNEWT_VAL(BLE_EXT_ADV)
569 struct ble_gap_ext_disc_desc ext_disc;
604#if MYNEWT_VAL(BLE_EXT_ADV)
616 uint8_t num_ext_adv_events;
686 uint16_t conn_handle;
742 uint16_t conn_handle;
772 uint16_t conn_handle;
775 uint16_t attr_handle;
783 uint8_t indication:1;
877 uint16_t conn_handle;
888#if MYNEWT_VAL(BLE_PERIODIC_ADV)
900 uint16_t sync_handle;
916 uint16_t per_adv_ival;
919 uint8_t adv_clk_accuracy;
929 uint16_t sync_handle;
960 uint16_t sync_handle;
966 } periodic_sync_lost;
969#if MYNEWT_VAL(BLE_EXT_ADV)
980 ble_addr_t scan_addr;
983#if MYNEWT_VAL(BLE_PERIODIC_ADV_SYNC_TRANSFER)
996 uint16_t sync_handle;
1002 uint16_t service_data;
1008 ble_addr_t adv_addr;
1018 uint16_t per_adv_itvl;
1021 uint8_t adv_clk_accuracy;
1022 } periodic_transfer;
1025#if MYNEWT_VAL(BLE_POWER_CONTROL)
1037 uint8_t current_path_loss;
1040 uint8_t zone_entered;
1041 } pathloss_threshold;
1063 int8_t transmit_power_level;
1066 uint8_t transmit_power_level_flag;
1073#if MYNEWT_VAL(BLE_CONN_SUBRATING)
1088 uint16_t subrate_factor;
1091 uint16_t periph_latency;
1097 uint16_t supervision_tmo;
1101#if MYNEWT_VAL(BLE_HCI_VS)
1139#if MYNEWT_VAL(BLE_ENABLE_CONN_REATTEMPT)
1191 uint16_t max_tx_octets;
1194 uint16_t max_tx_time;
1197 uint16_t max_rx_octets;
1200 uint16_t max_rx_time;
1205#if MYNEWT_VAL(OPTIMIZE_MULTI_CONN)
1207struct ble_gap_multi_conn_params {
1209 uint8_t own_addr_type;
1211#if MYNEWT_VAL(BLE_EXT_ADV)
1217 const ble_addr_t *peer_addr;
1220 int32_t duration_ms;
1229#if MYNEWT_VAL(BLE_EXT_ADV)
1247 uint32_t scheduling_len_us;
1251typedef int ble_gap_event_fn(
struct ble_gap_event *event,
void *arg);
1253#define BLE_GAP_CONN_MODE_NON 0
1254#define BLE_GAP_CONN_MODE_DIR 1
1255#define BLE_GAP_CONN_MODE_UND 2
1257#define BLE_GAP_DISC_MODE_NON 0
1258#define BLE_GAP_DISC_MODE_LTD 1
1259#define BLE_GAP_DISC_MODE_GEN 2
1306 ble_gap_event_fn *cb,
void *cb_arg);
1337 int32_t duration_ms,
1339 ble_gap_event_fn *cb,
void *cb_arg);
1420#if MYNEWT_VAL(ENC_ADV_DATA)
1432#define BLE_GAP_DATA_SERIALIZED_SIZE(data_len) ((data_len) + 2)
1433#define BLE_GAP_ENC_ADV_DATA 0x31
1434struct enc_adv_data {
1450#define ENC_ADV_DATA(_type, _data, _data_len) \
1453 .len = (_data_len), \
1454 .data = (uint8_t *)(_data), \
1458#if MYNEWT_VAL(BLE_EXT_ADV)
1460struct ble_gap_ext_adv_params {
1462 unsigned int connectable:1;
1465 unsigned int scannable:1;
1468 unsigned int directed:1;
1471 unsigned int high_duty_directed:1;
1486 unsigned int legacy_pdu:1;
1489 unsigned int anonymous:1;
1492 unsigned int include_tx_power:1;
1495 unsigned int scan_req_notif:1;
1508 uint8_t channel_map;
1511 uint8_t own_addr_type;
1517 uint8_t filter_policy;
1523 uint8_t primary_phy;
1530 uint8_t secondary_phy;
1555int ble_gap_ext_adv_configure(uint8_t instance,
1556 const struct ble_gap_ext_adv_params *params,
1557 int8_t *selected_tx_power,
1558 ble_gap_event_fn *cb,
void *cb_arg);
1568int ble_gap_ext_adv_set_addr(uint8_t instance,
const ble_addr_t *addr);
1586int ble_gap_ext_adv_start(uint8_t instance,
int duration,
int max_events);
1596int ble_gap_ext_adv_stop(uint8_t instance);
1607int ble_gap_ext_adv_set_data(uint8_t instance,
struct os_mbuf *data);
1619int ble_gap_ext_adv_rsp_set_data(uint8_t instance,
struct os_mbuf *data);
1630int ble_gap_ext_adv_remove(uint8_t instance);
1638int ble_gap_ext_adv_clear(
void);
1650int ble_gap_ext_adv_active(uint8_t instance);
1654#if MYNEWT_VAL(BLE_PERIODIC_ADV)
1657struct ble_gap_periodic_adv_params {
1659 unsigned int include_tx_power:1;
1672#if MYNEWT_VAL(BLE_PERIODIC_ADV_ENH)
1674struct ble_gap_periodic_adv_start_params {
1676 unsigned int include_adi:1;
1680struct ble_gap_periodic_adv_sync_reporting_params {
1682 unsigned int filter_duplicates:1;
1686struct ble_gap_periodic_adv_set_data_params {
1688 unsigned int update_did:1;
1693struct ble_gap_periodic_sync_params {
1701 uint16_t sync_timeout;
1704 unsigned int reports_disabled:1;
1706#if MYNEWT_VAL(BLE_PERIODIC_ADV_ENH)
1709 unsigned int filter_duplicates:1;
1725int ble_gap_periodic_adv_configure(uint8_t instance,
1726 const struct ble_gap_periodic_adv_params *params);
1728#if MYNEWT_VAL(BLE_PERIODIC_ADV_ENH)
1739ble_gap_periodic_adv_start(uint8_t instance,
1740 const struct ble_gap_periodic_adv_start_params *params);
1750int ble_gap_periodic_adv_start(uint8_t instance);
1760int ble_gap_periodic_adv_stop(uint8_t instance);
1762#if MYNEWT_VAL(BLE_PERIODIC_ADV_ENH)
1774int ble_gap_periodic_adv_set_data(uint8_t instance,
1776 struct ble_gap_periodic_adv_set_data_params *params);
1787int ble_gap_periodic_adv_set_data(uint8_t instance,
struct os_mbuf *data);
1806int ble_gap_periodic_adv_sync_create(
const ble_addr_t *addr, uint8_t adv_sid,
1807 const struct ble_gap_periodic_sync_params *params,
1808 ble_gap_event_fn *cb,
void *cb_arg);
1815int ble_gap_periodic_adv_sync_create_cancel(
void);
1824int ble_gap_periodic_adv_sync_terminate(uint16_t sync_handle);
1826#if MYNEWT_VAL(BLE_PERIODIC_ADV_SYNC_TRANSFER)
1827#if MYNEWT_VAL(BLE_PERIODIC_ADV_ENH)
1838int ble_gap_periodic_adv_sync_reporting(uint16_t sync_handle,
1840 const struct ble_gap_periodic_adv_sync_reporting_params *params);
1850int ble_gap_periodic_adv_sync_reporting(uint16_t sync_handle,
bool enable);
1863int ble_gap_periodic_adv_sync_transfer(uint16_t sync_handle,
1864 uint16_t conn_handle,
1865 uint16_t service_data);
1878int ble_gap_periodic_adv_sync_set_info(uint8_t instance,
1879 uint16_t conn_handle,
1880 uint16_t service_data);
1890int periodic_adv_set_default_sync_params(
const struct ble_gap_periodic_sync_params *params);
1913int ble_gap_periodic_adv_sync_receive(uint16_t conn_handle,
1914 const struct ble_gap_periodic_sync_params *params,
1915 ble_gap_event_fn *cb,
void *cb_arg);
1926int ble_gap_add_dev_to_periodic_adv_list(
const ble_addr_t *peer_addr,
1937int ble_gap_rem_dev_from_periodic_adv_list(
const ble_addr_t *peer_addr,
1945int ble_gap_clear_periodic_adv_list(
void);
1954int ble_gap_read_periodic_adv_list_size(uint8_t *per_adv_list_size);
1987int ble_gap_disc(uint8_t own_addr_type, int32_t duration_ms,
1989 ble_gap_event_fn *cb,
void *cb_arg);
2041int ble_gap_ext_disc(uint8_t own_addr_type, uint16_t duration, uint16_t period,
2042 uint8_t filter_duplicates, uint8_t filter_policy,
2046 ble_gap_event_fn *cb,
void *cb_arg);
2105int ble_gap_connect(uint8_t own_addr_type,
const ble_addr_t *peer_addr,
2106 int32_t duration_ms,
2108 ble_gap_event_fn *cb,
void *cb_arg);
2162 int32_t duration_ms, uint8_t phy_mask,
2166 ble_gap_event_fn *cb,
void *cb_arg);
2168#if MYNEWT_VAL(OPTIMIZE_MULTI_CONN)
2177int ble_gap_common_factor_set(
bool enable, uint32_t common_factor);
2202int ble_gap_multi_connect(
struct ble_gap_multi_conn_params *multi_conn_params,
2203 ble_gap_event_fn *cb,
void *cb_arg);
2247int ble_gap_wl_set(
const ble_addr_t *addrs, uint8_t white_list_count);
2300 uint16_t *out_sugg_max_tx_time);
2372 const uint8_t *ltk, uint16_t ediv,
2373 uint64_t rand_val,
int auth);
2432#define BLE_GAP_PRIVATE_MODE_NETWORK 0
2433#define BLE_GAP_PRIVATE_MODE_DEVICE 1
2448#define BLE_GAP_LE_PHY_1M 1
2449#define BLE_GAP_LE_PHY_2M 2
2450#define BLE_GAP_LE_PHY_CODED 3
2470#define BLE_GAP_LE_PHY_1M_MASK 0x01
2471#define BLE_GAP_LE_PHY_2M_MASK 0x02
2472#define BLE_GAP_LE_PHY_CODED_MASK 0x04
2473#define BLE_GAP_LE_PHY_ANY_MASK 0x0F
2493 uint8_t rx_phys_mask);
2495#define BLE_GAP_LE_PHY_CODED_ANY 0
2496#define BLE_GAP_LE_PHY_CODED_S2 1
2497#define BLE_GAP_LE_PHY_CODED_S8 2
2522 uint8_t rx_phys_mask, uint16_t phy_opts);
2524#if MYNEWT_VAL(BLE_CONN_SUBRATING)
2539int ble_gap_set_default_subrate(uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency,
2540 uint16_t cont_num, uint16_t supervision_timeout);
2559ble_gap_subrate_req(uint16_t conn_handle, uint16_t subrate_min, uint16_t subrate_max,
2560 uint16_t max_latency, uint16_t cont_num,
2561 uint16_t supervision_timeout);
2569 ble_gap_event_fn *fn;
2590 ble_gap_event_fn *fn,
void *arg);
2602#if MYNEWT_VAL(BLE_POWER_CONTROL)
2613int ble_gap_set_path_loss_reporting_enable(uint16_t conn_handle, uint8_t enable);
2627int ble_gap_set_transmit_power_reporting_enable(uint16_t conn_handle,
2628 uint8_t local_enable,
2629 uint8_t remote_enable);
2647int ble_gap_enh_read_transmit_power_level(uint16_t conn_handle, uint8_t phy,
2648 uint8_t *out_status, uint8_t *out_phy,
2649 uint8_t *out_curr_tx_power_level,
2650 uint8_t *out_max_tx_power_level);
2660int ble_gap_read_remote_transmit_power_level(uint16_t conn_handle, uint8_t phy);
2674int ble_gap_set_path_loss_reporting_param(uint16_t conn_handle, uint8_t high_threshold,
2675 uint8_t high_hysteresis, uint8_t low_threshold,
2676 uint8_t low_hysteresis, uint16_t min_time_spent);
int ble_gap_wl_set(const ble_addr_t *addrs, uint8_t white_list_count)
Definition ble_gap.c:2609
int ble_gap_write_sugg_def_data_len(uint16_t sugg_max_tx_octets, uint16_t sugg_max_tx_time)
Definition ble_gap.c:6693
int ble_gap_conn_find_by_addr(const ble_addr_t *addr, struct ble_gap_conn_desc *out_desc)
Definition ble_gap.c:565
int ble_gap_unpair_oldest_peer(void)
Definition ble_gap.c:6935
int ble_gap_conn_rssi(uint16_t conn_handle, int8_t *out_rssi)
Definition ble_gap.c:7107
int ble_gap_set_event_cb(uint16_t conn_handle, ble_gap_event_fn *cb, void *cb_arg)
Definition ble_gap.c:2475
int ble_gap_adv_rsp_set_data(const uint8_t *data, int data_len)
Definition ble_gap.c:3069
int ble_gap_set_prefered_default_le_phy(uint8_t tx_phys_mask, uint8_t rx_phys_mask)
Definition ble_gap.c:682
int ble_gap_disc_active(void)
Definition ble_gap.c:5403
int ble_gap_set_data_related_addr_change_param(uint8_t adv_handle, uint8_t change_reason)
Definition ble_gap.c:7833
int ble_gap_read_le_phy(uint16_t conn_handle, uint8_t *tx_phy, uint8_t *rx_phy)
Definition ble_gap.c:639
int ble_gap_adv_stop(void)
Definition ble_gap.c:2726
int ble_gap_disc(uint8_t own_addr_type, int32_t duration_ms, const struct ble_gap_disc_params *disc_params, ble_gap_event_fn *cb, void *cb_arg)
Definition ble_gap.c:5287
int ble_gap_conn_active(void)
Definition ble_gap.c:6201
int ble_gap_adv_set_fields(const struct ble_hs_adv_fields *rsp_fields)
Definition ble_gap.c:3097
int ble_gap_dtm_enh_tx_start(uint8_t tx_chan, uint8_t test_data_len, uint8_t payload, uint8_t phy)
Definition ble_gap.c:7857
int ble_gap_disc_cancel(void)
Definition ble_gap.c:5057
int ble_gap_conn_cancel(void)
Definition ble_gap.c:6334
int ble_gap_dtm_stop(void)
Definition ble_gap.c:7851
int ble_gap_conn_find(uint16_t handle, struct ble_gap_conn_desc *out_desc)
int ble_gap_dtm_tx_start(uint8_t tx_chan, uint8_t test_data_len, uint8_t payload)
Definition ble_gap.c:7839
int ble_gap_set_data_len(uint16_t conn_handle, uint16_t tx_octets, uint16_t tx_time)
Definition ble_gap.c:6683
int ble_gap_dtm_enh_rx_start(uint8_t rx_chan, uint8_t index, uint8_t phy)
Definition ble_gap.c:7864
int ble_gap_ext_disc(uint8_t own_addr_type, uint16_t duration, uint16_t period, uint8_t filter_duplicates, uint8_t filter_policy, uint8_t limited, const struct ble_gap_ext_disc_params *uncoded_params, const struct ble_gap_ext_disc_params *coded_params, ble_gap_event_fn *cb, void *cb_arg)
Definition ble_gap.c:5149
int ble_gap_adv_active(void)
Definition ble_gap.c:3152
int ble_gap_security_initiate(uint16_t conn_handle)
Definition ble_gap.c:6702
int ble_gap_ext_connect(uint8_t own_addr_type, const ble_addr_t *peer_addr, int32_t duration_ms, uint8_t phy_mask, const struct ble_gap_conn_params *phy_1m_conn_params, const struct ble_gap_conn_params *phy_2m_conn_params, const struct ble_gap_conn_params *phy_coded_conn_params, ble_gap_event_fn *cb, void *cb_arg)
int ble_gap_encryption_initiate(uint16_t conn_handle, uint8_t key_size, const uint8_t *ltk, uint16_t ediv, uint64_t rand_val, int auth)
Definition ble_gap.c:6818
int ble_gap_unpair_oldest_except(const ble_addr_t *peer_addr)
Definition ble_gap.c:6968
int ble_gap_dtm_rx_start(uint8_t rx_chan)
Definition ble_gap.c:7845
int ble_gap_adv_rsp_set_fields(const struct ble_hs_adv_fields *rsp_fields)
Definition ble_gap.c:3128
int ble_gap_set_prefered_le_phy(uint16_t conn_handle, uint8_t tx_phys_mask, uint8_t rx_phys_mask, uint16_t phy_opts)
Definition ble_gap.c:726
int ble_gap_connect(uint8_t own_addr_type, const ble_addr_t *peer_addr, int32_t duration_ms, const struct ble_gap_conn_params *params, ble_gap_event_fn *cb, void *cb_arg)
Definition ble_gap.c:5878
int ble_gap_unpair(const ble_addr_t *peer_addr)
Definition ble_gap.c:6851
int ble_gap_terminate(uint16_t conn_handle, uint8_t hci_reason)
Definition ble_gap.c:6248
int ble_gap_event_listener_unregister(struct ble_gap_event_listener *listener)
Definition ble_gap.c:7495
int ble_gap_pair_initiate(uint16_t conn_handle)
Definition ble_gap.c:6804
int ble_gap_adv_start(uint8_t own_addr_type, const ble_addr_t *direct_addr, int32_t duration_ms, const struct ble_gap_adv_params *adv_params, ble_gap_event_fn *cb, void *cb_arg)
Start advertising.
Definition ble_gap.c:2935
int ble_gap_adv_set_data(const uint8_t *data, int data_len)
Definition ble_gap.c:3039
int ble_gap_update_params(uint16_t conn_handle, const struct ble_gap_upd_params *params)
Definition ble_gap.c:6587
int ble_gap_set_priv_mode(const ble_addr_t *peer_addr, uint8_t priv_mode)
Definition ble_gap.c:625
int ble_gap_event_listener_register(struct ble_gap_event_listener *listener, ble_gap_event_fn *fn, void *arg)
Definition ble_gap.c:7465
int ble_gap_read_sugg_def_data_len(uint16_t *out_sugg_max_tx_octets, uint16_t *out_sugg_max_tx_time)
Definition ble_gap.c:6688
uint8_t channel_map
Definition ble_gap.h:239
uint8_t high_duty_cycle
Definition ble_gap.h:245
uint16_t itvl_min
Definition ble_gap.h:235
uint8_t disc_mode
Definition ble_gap.h:232
uint16_t itvl_max
Definition ble_gap.h:237
uint8_t conn_mode
Definition ble_gap.h:226
uint8_t filter_policy
Definition ble_gap.h:242
Connection descriptor.
Definition ble_gap.h:249
ble_addr_t peer_ota_addr
Definition ble_gap.h:263
uint8_t role
Definition ble_gap.h:280
struct ble_gap_sec_state sec_state
Definition ble_gap.h:251
uint16_t supervision_timeout
Definition ble_gap.h:275
uint16_t conn_latency
Definition ble_gap.h:272
ble_addr_t our_id_addr
Definition ble_gap.h:254
uint8_t master_clock_accuracy
Definition ble_gap.h:283
uint16_t conn_handle
Definition ble_gap.h:266
ble_addr_t our_ota_addr
Definition ble_gap.h:260
ble_addr_t peer_id_addr
Definition ble_gap.h:257
uint16_t conn_itvl
Definition ble_gap.h:269
Connection parameters
Definition ble_gap.h:287
uint16_t min_ce_len
Definition ble_gap.h:307
uint16_t latency
Definition ble_gap.h:301
uint16_t itvl_max
Definition ble_gap.h:298
uint16_t supervision_timeout
Definition ble_gap.h:304
uint16_t max_ce_len
Definition ble_gap.h:310
uint16_t itvl_min
Definition ble_gap.h:295
uint16_t scan_window
Definition ble_gap.h:292
uint16_t scan_itvl
Definition ble_gap.h:289
Advertising report.
Definition ble_gap.h:458
ble_addr_t direct_addr
Definition ble_gap.h:483
uint8_t event_type
Definition ble_gap.h:466
int8_t rssi
Definition ble_gap.h:475
ble_addr_t addr
Definition ble_gap.h:472
const uint8_t * data
Definition ble_gap.h:478
uint8_t length_data
Definition ble_gap.h:469
Discovery parameters.
Definition ble_gap.h:326
uint16_t itvl
Definition ble_gap.h:328
uint8_t filter_policy
Definition ble_gap.h:334
uint8_t limited
Definition ble_gap.h:337
uint16_t window
Definition ble_gap.h:331
uint8_t filter_duplicates
Definition ble_gap.h:343
uint8_t passive
Definition ble_gap.h:340
Definition ble_gap.h:2568
struct ble_gap_event::@7::@17 passkey
struct os_mbuf * om
Definition ble_gap.h:736
const struct ble_gap_upd_params * peer_params
Definition ble_gap.h:660
struct ble_gap_event::@7::@26 data_len_chg
uint8_t cur_indicate
Definition ble_gap.h:820
uint16_t conn_handle
Definition ble_gap.h:537
struct ble_gap_event::@7::@15 term_failure
struct ble_gap_passkey_params params
Definition ble_gap.h:718
struct ble_gap_upd_params * self_params
Definition ble_gap.h:668
struct ble_gap_event::@7::@14 conn_update_req
uint8_t prev_notify
Definition ble_gap.h:811
struct ble_gap_event::@7::@18 notify_rx
struct ble_gap_conn_desc conn
Definition ble_gap.h:553
struct ble_gap_event::@7::@11 disc_complete
uint8_t cur_notify
Definition ble_gap.h:814
struct ble_gap_event::@7::@16 enc_change
struct ble_gap_event::@7::@21 mtu
struct ble_gap_disc_desc disc
Definition ble_gap.h:561
struct ble_gap_event::@7::@23 phy_updated
struct ble_gap_repeat_pairing repeat_pairing
Definition ble_gap.h:869
uint8_t prev_indicate
Definition ble_gap.h:817
uint16_t channel_id
Definition ble_gap.h:837
uint8_t tx_phy
Definition ble_gap.h:885
struct ble_gap_event::@7::@25 dtm_state
struct ble_gap_event::@7::@24 authorize
struct ble_gap_event::@7::@12 adv_complete
uint16_t attr_handle
Definition ble_gap.h:739
struct ble_gap_event::@7::@19 notify_tx
int reason
Definition ble_gap.h:550
struct ble_gap_event::@7::@13 conn_update
struct ble_gap_event::@7::@22 identity_resolved
uint8_t indication
Definition ble_gap.h:750
struct ble_gap_event::@7::@10 disconnect
uint8_t reason
Definition ble_gap.h:808
int status
Definition ble_gap.h:534
struct ble_gap_event::@7::@9 connect
uint8_t type
Definition ble_gap.h:515
struct ble_gap_event::@7::@20 subscribe
Extended discovery parameters.
Definition ble_gap.h:314
uint8_t passive
Definition ble_gap.h:322
uint16_t window
Definition ble_gap.h:319
uint16_t itvl
Definition ble_gap.h:316
Passkey query.
Definition ble_gap.h:368
uint32_t numcmp
Definition ble_gap.h:379
uint8_t action
Definition ble_gap.h:376
unsigned bonded
Definition ble_gap.h:210
unsigned key_size
Definition ble_gap.h:213
unsigned authenticated
Definition ble_gap.h:207
unsigned encrypted
Definition ble_gap.h:204
unsigned authorize
Definition ble_gap.h:216
Connection parameters update parameters.
Definition ble_gap.h:347
uint16_t itvl_max
Definition ble_gap.h:352
uint16_t max_ce_len
Definition ble_gap.h:364
uint16_t min_ce_len
Definition ble_gap.h:361
uint16_t latency
Definition ble_gap.h:355
uint16_t itvl_min
Definition ble_gap.h:349
uint16_t supervision_timeout
Definition ble_gap.h:358