2018-12-18 05:48:20 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2019 Nordic Semiconductor ASA
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct lll_scan {
|
|
|
|
struct lll_hdr hdr;
|
|
|
|
|
|
|
|
#if defined(CONFIG_BT_CENTRAL)
|
2021-03-16 11:46:30 +05:30
|
|
|
/* NOTE: conn context SHALL be after lll_hdr,
|
|
|
|
* check ull_conn_setup how it access the connection LLL
|
|
|
|
* context.
|
|
|
|
*/
|
2021-03-16 11:48:07 +05:30
|
|
|
struct lll_conn *volatile conn;
|
2021-03-16 11:46:30 +05:30
|
|
|
|
|
|
|
uint8_t adv_addr[BDADDR_SIZE];
|
2020-05-27 11:26:57 -05:00
|
|
|
uint32_t conn_win_offset_us;
|
|
|
|
uint16_t conn_timeout;
|
2018-12-18 05:48:20 +01:00
|
|
|
#endif /* CONFIG_BT_CENTRAL */
|
|
|
|
|
2020-05-27 11:26:57 -05:00
|
|
|
uint8_t state:1;
|
|
|
|
uint8_t chan:2;
|
|
|
|
uint8_t filter_policy:2;
|
|
|
|
uint8_t type:1;
|
2021-03-16 11:46:30 +05:30
|
|
|
uint8_t init_addr_type:1;
|
2021-04-27 12:35:27 +05:30
|
|
|
uint8_t is_stop:1;
|
2018-12-18 05:48:20 +01:00
|
|
|
|
|
|
|
#if defined(CONFIG_BT_CTLR_ADV_EXT)
|
2020-10-12 21:56:59 +05:30
|
|
|
uint16_t duration_reload;
|
|
|
|
uint16_t duration_expire;
|
2020-05-27 11:26:57 -05:00
|
|
|
uint8_t phy:3;
|
2020-04-09 14:43:24 +05:30
|
|
|
uint8_t is_adv_ind:1;
|
2018-12-18 05:48:20 +01:00
|
|
|
#endif /* CONFIG_BT_CTLR_ADV_EXT */
|
|
|
|
|
2021-04-27 12:35:27 +05:30
|
|
|
#if defined(CONFIG_BT_CENTRAL)
|
|
|
|
uint8_t adv_addr_type:1;
|
|
|
|
#endif /* CONFIG_BT_CENTRAL */
|
|
|
|
|
2018-12-18 05:48:20 +01:00
|
|
|
#if defined(CONFIG_BT_CTLR_PRIVACY)
|
2020-05-27 11:26:57 -05:00
|
|
|
uint8_t rpa_gen:1;
|
2018-12-18 05:48:20 +01:00
|
|
|
/* initiator only */
|
2020-05-27 11:26:57 -05:00
|
|
|
uint8_t rl_idx;
|
2018-12-18 05:48:20 +01:00
|
|
|
#endif /* CONFIG_BT_CTLR_PRIVACY */
|
|
|
|
|
2020-05-27 11:26:57 -05:00
|
|
|
uint8_t init_addr[BDADDR_SIZE];
|
2018-12-18 05:48:20 +01:00
|
|
|
|
2020-05-27 11:26:57 -05:00
|
|
|
uint16_t interval;
|
|
|
|
uint32_t ticks_window;
|
2019-10-22 13:13:24 +02:00
|
|
|
|
|
|
|
#if defined(CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL)
|
2020-05-27 11:26:57 -05:00
|
|
|
int8_t tx_pwr_lvl;
|
2019-10-22 13:13:24 +02:00
|
|
|
#endif /* CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL */
|
2018-12-18 05:48:20 +01:00
|
|
|
};
|
|
|
|
|
2020-04-21 11:12:41 +05:30
|
|
|
struct lll_scan_aux {
|
|
|
|
struct lll_hdr hdr;
|
|
|
|
|
|
|
|
uint8_t chan:6;
|
2021-07-27 21:05:07 +05:30
|
|
|
uint8_t state:1;
|
2020-04-21 11:12:41 +05:30
|
|
|
|
|
|
|
uint8_t phy:3;
|
|
|
|
|
2020-04-22 16:13:45 +05:30
|
|
|
uint32_t window_size_us;
|
2020-06-15 20:43:54 +05:30
|
|
|
|
|
|
|
#if defined(CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL)
|
|
|
|
int8_t tx_pwr_lvl;
|
|
|
|
#endif /* CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL */
|
2021-04-14 14:16:29 +02:00
|
|
|
|
|
|
|
#if defined(CONFIG_BT_CENTRAL)
|
|
|
|
struct node_rx_pdu *node_conn_rx;
|
|
|
|
#endif /* CONFIG_BT_CENTRAL */
|
2020-04-21 11:12:41 +05:30
|
|
|
};
|
|
|
|
|
2018-12-18 05:48:20 +01:00
|
|
|
int lll_scan_init(void);
|
|
|
|
int lll_scan_reset(void);
|
|
|
|
|
|
|
|
void lll_scan_prepare(void *param);
|
2019-07-03 12:02:52 +05:30
|
|
|
|
2020-04-08 16:17:48 +05:30
|
|
|
extern uint8_t ull_scan_lll_handle_get(struct lll_scan *lll);
|