23#include "nimble/porting/nimble/include/syscfg/syscfg.h"
37#define BLE_LL_ADV_ITVL (625)
38#define BLE_LL_ADV_ITVL_MIN (32)
39#define BLE_LL_ADV_ITVL_MAX (16384)
40#define BLE_LL_ADV_ITVL_MS_MIN (20)
41#define BLE_LL_ADV_ITVL_MS_MAX (10240)
42#define BLE_LL_ADV_ITVL_SCAN_MIN (160)
43#define BLE_LL_ADV_ITVL_SCAN_MS_MIN (100)
44#define BLE_LL_ADV_ITVL_NONCONN_MS_MIN (100)
45#define BLE_LL_ADV_DELAY_MS_MIN (0)
46#define BLE_LL_ADV_DELAY_MS_MAX (10)
47#define BLE_LL_ADV_PDU_ITVL_LD_MS_MAX (10)
48#define BLE_LL_ADV_PDU_ITVL_HD_MS_MAX (3750)
49#define BLE_LL_ADV_STATE_HD_MAX (1280)
50#define BLE_LL_ADV_PERIODIC_ITVL (1250)
53#define BLE_ADV_LEGACY_DATA_MAX_LEN (31)
54#define BLE_ADV_LEGACY_MAX_PKT_LEN (37)
56#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
57#define BLE_ADV_DATA_MAX_LEN MYNEWT_VAL(BLE_EXT_ADV_MAX_SIZE)
59#define BLE_ADV_DATA_MAX_LEN BLE_ADV_LEGACY_DATA_MAX_LEN
70#define BLE_ADV_IND_MIN_LEN (6)
71#define BLE_ADV_IND_MAX_LEN (37)
85#define BLE_ADV_DIRECT_IND_LEN (12)
96#define BLE_ADV_NONCONN_IND_MIN_LEN (6)
97#define BLE_ADV_NONCONN_IND_MAX_LEN (37)
108#define BLE_ADV_SCAN_IND_MIN_LEN (6)
109#define BLE_ADV_SCAN_IND_MAX_LEN (37)
113struct ble_ll_conn_sm;
116int ble_ll_adv_start_req(uint8_t adv_chanmask, uint8_t adv_type,
117 uint8_t *init_addr, uint16_t adv_itvl,
void *handle);
120int ble_ll_hci_adv_set_enable(
const uint8_t *cmdbuf, uint8_t len);
123int ble_ll_hci_set_adv_data(
const uint8_t *cmdbuf, uint8_t len);
126int ble_ll_hci_set_scan_rsp_data(
const uint8_t *cmd, uint8_t cmd_len);
129int ble_ll_adv_set_adv_params(
const uint8_t *cmdbuf, uint8_t len);
132int ble_ll_adv_read_txpwr(uint8_t *rspbuf, uint8_t *rsplen);
136void ble_ll_adv_send_conn_comp_ev(
struct ble_ll_conn_sm *connsm,
137 struct ble_mbuf_hdr *rxhdr);
140uint8_t *ble_ll_adv_get_local_rpa(
struct ble_ll_adv_sm *advsm);
143uint8_t *ble_ll_adv_get_peer_rpa(
struct ble_ll_adv_sm *advsm);
146void ble_ll_adv_init(
void);
149void ble_ll_adv_wfr_timer_exp(
void);
152void ble_ll_adv_reset(
void);
155int ble_ll_adv_rx_isr_start(uint8_t pdu_type);
158int ble_ll_adv_rx_isr_end(uint8_t pdu_type,
struct os_mbuf *rxpdu,
int crcok);
161void ble_ll_adv_rx_pkt_in(uint8_t ptype, uint8_t *rxbuf,
162 struct ble_mbuf_hdr *hdr);
165int ble_ll_adv_can_chg_whitelist(
void);
171void ble_ll_adv_event_rmvd_from_sched(
struct ble_ll_adv_sm *advsm);
177void ble_ll_adv_periodic_rmvd_from_sched(
struct ble_ll_adv_sm *advsm);
180void ble_ll_adv_halt(
void);
183uint8_t ble_ll_adv_enabled(
void);
185int ble_ll_adv_hci_set_random_addr(
const uint8_t *cmdbuf, uint8_t len);
186int ble_ll_adv_set_random_addr(
const uint8_t *addr, uint8_t instance);
187int ble_ll_adv_remove(
const uint8_t *addr, uint8_t len);
188int ble_ll_adv_clear_all(
void);
189int ble_ll_adv_ext_set_param(
const uint8_t *cmdbuf, uint8_t len,
190 uint8_t *rspbuf, uint8_t *rsplen);
191int ble_ll_adv_ext_set_adv_data(
const uint8_t *cmdbuf, uint8_t cmdlen);
192int ble_ll_adv_ext_set_scan_rsp(
const uint8_t *cmdbuf, uint8_t cmdlen);
193int ble_ll_adv_ext_set_enable(
const uint8_t *cmdbuf, uint8_t len);
195int ble_ll_adv_periodic_set_param(
const uint8_t *cmdbuf, uint8_t len);
196int ble_ll_adv_periodic_set_data(
const uint8_t *cmdbuf, uint8_t len);
197int ble_ll_adv_periodic_enable(
const uint8_t *cmdbuf, uint8_t len);
199int ble_ll_adv_periodic_set_info_transfer(
const uint8_t *cmdbuf, uint8_t len,
200 uint8_t *rspbuf, uint8_t *rsplen);
203void ble_ll_adv_rpa_timeout(
void);