Bluetooth: Update terms in public API to spec v5.3

The Bluetooth Core Specification, version 5.3, has introduced multiple
changes to several widely-used terms in order to make them inclusive.
Update the public API to reflect this, excluding hci.h, which will be
done in a subsequent commit.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2021-09-14 12:28:45 +02:00 committed by Johan Hedberg
parent 324374d20c
commit 6de4747979
18 changed files with 152 additions and 105 deletions

View file

@ -33,8 +33,24 @@ Deprecated in this release
were deprecated in favor of utilizing
:c:macro:`DT_STRING_TOKEN` and :c:macro:`DT_STRING_UPPER_TOKEN`
Changes in this release
* :c:macro:`BT_CONN_ROLE_MASTER` and :c:macro:`BT_CONN_ROLE_SLAVE`
have been deprecated in favor of
:c:macro:`BT_CONN_ROLE_CENTRAL` and :c:macro:`BT_CONN_ROLE_PERIPHAL`
* :c:macro:`BT_LE_SCAN_OPT_FILTER_WHITELIST`
has been deprecated in favor of
:c:macro:`BT_LE_SCAN_OPT_FILTER_ACCEPT_LIST`
* The following whitelist functions have been deprecated:
:c:func:`bt_le_whitelist_add`
:c:func:`bt_le_whitelist_rem`
:c:func:`bt_le_whitelist_clear`
in favor of
:c:func:`bt_le_filter_accept_list_add`
:c:func:`bt_le_filter_accept_list_remove`
:c:func:`bt_le_filter_accept_list_clear`
Changes in this release
==========================
Removed APIs in this release

View file

@ -347,7 +347,7 @@ enum {
* Don't try to resume connectable advertising after a connection.
* This option is only meaningful when used together with
* BT_LE_ADV_OPT_CONNECTABLE. If set the advertising will be stopped
* when bt_le_adv_stop() is called or when an incoming (slave)
* when bt_le_adv_stop() is called or when an incoming (peripheral)
* connection happens. If this option is not set the stack will
* take care of keeping advertising enabled even as connections
* occur.
@ -413,11 +413,12 @@ enum {
*/
BT_LE_ADV_OPT_DIR_ADDR_RPA = BIT(5),
/** Use whitelist to filter devices that can request scan response data.
/** Use filter accept list to filter devices that can request scan
* response data.
*/
BT_LE_ADV_OPT_FILTER_SCAN_REQ = BIT(6),
/** Use whitelist to filter devices that can connect. */
/** Use filter accept list to filter devices that can connect. */
BT_LE_ADV_OPT_FILTER_CONN = BIT(7),
/** Notify the application when a scan response data has been sent to an
@ -1596,6 +1597,7 @@ int bt_le_per_adv_list_remove(const bt_addr_le_t *addr, uint8_t sid);
*/
int bt_le_per_adv_list_clear(void);
enum {
/** Convenience value when no options are specified. */
BT_LE_SCAN_OPT_NONE = 0,
@ -1603,8 +1605,8 @@ enum {
/** Filter duplicates. */
BT_LE_SCAN_OPT_FILTER_DUPLICATE = BIT(0),
/** Filter using whitelist. */
BT_LE_SCAN_OPT_FILTER_WHITELIST = BIT(1),
/** Filter using filter accept list. */
BT_LE_SCAN_OPT_FILTER_ACCEPT_LIST = BIT(1),
/** Enable scan on coded PHY (Long Range).*/
BT_LE_SCAN_OPT_CODED = BIT(2),
@ -1617,6 +1619,8 @@ enum {
BT_LE_SCAN_OPT_NO_1M = BIT(3),
};
#define BT_LE_SCAN_OPT_FILTER_WHITELIST __DEPRECATED_MACRO BT_LE_SCAN_OPT_FILTER_ACCEPT_LIST
enum {
/** Scan without requesting additional information from advertisers. */
BT_LE_SCAN_TYPE_PASSIVE = 0x00,
@ -1852,50 +1856,65 @@ void bt_le_scan_cb_register(struct bt_le_scan_cb *cb);
void bt_le_scan_cb_unregister(struct bt_le_scan_cb *cb);
/**
* @brief Add device (LE) to whitelist.
* @brief Add device (LE) to filter accept list.
*
* Add peer device LE address to the whitelist.
* Add peer device LE address to the filter accept list.
*
* @note The whitelist cannot be modified when an LE role is using
* the whitelist, i.e advertiser or scanner using a whitelist or automatic
* connecting to devices using whitelist.
* @note The filter accept list cannot be modified when an LE role is using
* the filter accept list, i.e advertiser or scanner using a filter accept list
* or automatic connecting to devices using filter accept list.
*
* @param addr Bluetooth LE identity address.
*
* @return Zero on success or error code otherwise, positive in case of
* protocol error or negative (POSIX) in case of stack internal error.
*/
int bt_le_whitelist_add(const bt_addr_le_t *addr);
int bt_le_filter_accept_list_add(const bt_addr_le_t *addr);
__deprecated
static inline int bt_le_whitelist_add(const bt_addr_le_t *addr)
{
return bt_le_filter_accept_list_add(addr);
}
/**
* @brief Remove device (LE) from whitelist.
* @brief Remove device (LE) from filter accept list.
*
* Remove peer device LE address from the whitelist.
* Remove peer device LE address from the filter accept list.
*
* @note The whitelist cannot be modified when an LE role is using
* the whitelist, i.e advertiser or scanner using a whitelist or automatic
* connecting to devices using whitelist.
* @note The filter accept list cannot be modified when an LE role is using
* the filter accept list, i.e advertiser or scanner using a filter accept list
* or automatic connecting to devices using filter accept list.
*
* @param addr Bluetooth LE identity address.
*
* @return Zero on success or error code otherwise, positive in case of
* protocol error or negative (POSIX) in case of stack internal error.
*/
int bt_le_whitelist_rem(const bt_addr_le_t *addr);
int bt_le_filter_accept_list_remove(const bt_addr_le_t *addr);
__deprecated
static inline int bt_le_whitelist_rem(const bt_addr_le_t *addr)
{
return bt_le_filter_accept_list_remove(addr);
}
/**
* @brief Clear whitelist.
* @brief Clear filter accept list.
*
* Clear all devices from the whitelist.
* Clear all devices from the filter accept list.
*
* @note The whitelist cannot be modified when an LE role is using
* the whitelist, i.e advertiser or scanner using a whitelist or automatic
* connecting to devices using whitelist.
* @note The filter accept list cannot be modified when an LE role is using
* the filter accept list, i.e advertiser or scanner using a filter accept
* list or automatic connecting to devices using filter accept list.
*
* @return Zero on success or error code otherwise, positive in case of
* protocol error or negative (POSIX) in case of stack internal error.
*/
int bt_le_whitelist_clear(void);
int bt_le_filter_accept_list_clear(void);
__deprecated
static inline int bt_le_whitelist_clear(void)
{
return bt_le_filter_accept_list_clear();
}
/**
* @brief Set (LE) channel map.

View file

@ -285,7 +285,7 @@ struct bt_conn_le_info {
/** Remote device address used during connection setup. */
const bt_addr_le_t *remote;
uint16_t interval; /** Connection interval */
uint16_t latency; /** Connection slave latency */
uint16_t latency; /** Connection peripheral latency */
uint16_t timeout; /** Connection supervision timeout */
#if defined(CONFIG_BT_USER_PHY_UPDATE)
@ -303,12 +303,15 @@ struct bt_conn_br_info {
const bt_addr_t *dst; /** Destination (Remote) BR/EDR address */
};
/** Connection role (master or slave) */
enum {
BT_CONN_ROLE_MASTER,
BT_CONN_ROLE_SLAVE,
BT_CONN_ROLE_CENTRAL = 0,
BT_CONN_ROLE_PERIPHERAL = 1,
};
/** Connection role (central or peripheral) */
#define BT_CONN_ROLE_MASTER __DEPRECATED_MACRO BT_CONN_ROLE_CENTRAL
#define BT_CONN_ROLE_SLAVE __DEPRECATED_MACRO BT_CONN_ROLE_PERIPHERAL
/** Connection Info Structure */
struct bt_conn_info {
/** Connection Type. */
@ -582,7 +585,7 @@ struct bt_conn_le_create_param {
BT_GAP_SCAN_FAST_INTERVAL, \
BT_GAP_SCAN_FAST_INTERVAL)
/** Default LE create connection using whitelist parameters.
/** Default LE create connection using filter accept list parameters.
* Scan window: 30 ms.
* Scan interval: 60 ms.
*/
@ -615,14 +618,14 @@ int bt_conn_le_create(const bt_addr_le_t *peer,
const struct bt_le_conn_param *conn_param,
struct bt_conn **conn);
/** @brief Automatically connect to remote devices in whitelist.
/** @brief Automatically connect to remote devices in the filter accept list..
*
* This uses the Auto Connection Establishment procedure.
* The procedure will continue until a single connection is established or the
* procedure is stopped through @ref bt_conn_create_auto_stop.
* To establish connections to all devices in the whitelist the procedure
* should be started again in the connected callback after a new connection has
* been established.
* To establish connections to all devices in the the filter accept list the
* procedure should be started again in the connected callback after a
* new connection has been established.
*
* @param create_param Create connection parameters
* @param conn_param Initial connection parameters.

View file

@ -244,7 +244,7 @@ static void connected(struct bt_conn *conn, uint8_t err)
}
bt_conn_get_info(conn, &info);
initiator = (info.role == BT_CONN_ROLE_MASTER);
initiator = (info.role == BT_CONN_ROLE_CENTRAL);
remote_ready = false;
remote_handle = 0U;

View file

@ -3496,7 +3496,7 @@ static void le_cis_established(struct pdu_data *pdu_data,
cis = node_rx->hdr.rx_ftr.param;
cig = cis->group;
lll_cis = &cis->lll;
is_central = cig->lll.role == BT_CONN_ROLE_MASTER;
is_central = cig->lll.role == BT_CONN_ROLE_CENTRAL;
lll_cis_c = is_central ? &lll_cis->tx : &lll_cis->rx;
lll_cis_p = is_central ? &lll_cis->rx : &lll_cis->tx;
est = (void *)pdu_data;

View file

@ -55,7 +55,7 @@ uint8_t ll_cis_accept(uint16_t handle)
return BT_HCI_ERR_UNKNOWN_CONN_ID;
}
if (acl_conn->lll.role == BT_CONN_ROLE_MASTER) {
if (acl_conn->lll.role == BT_CONN_ROLE_CENTRAL) {
BT_ERR("Not allowed for central");
return BT_HCI_ERR_CMD_DISALLOWED;
}

View file

@ -87,6 +87,11 @@ if(CONFIG_BT_HCI_HOST)
endif()
endif()
if(CONFIG_BT_WHITELIST)
message(WARNING "CONFIG_BT_WHITELIST is deprecated.
Please use CONFIG_BT_FILTER_ACCEPT_LIST instead."
)
endif()
if(CONFIG_BT_DEBUG_SMP OR CONFIG_BT_DEBUG_KEYS OR CONFIG_BT_LOG_SNIFFER_INFO)
message(WARNING "One of these options are enabled:
CONFIG_BT_DEBUG_SMP CONFIG_BT_DEBUG_KEYS CONFIG_BT_LOG_SNIFFER_INFO.

View file

@ -173,19 +173,23 @@ config BT_SETTINGS_USE_PRINTK
endif # BT_SETTINGS
config BT_WHITELIST
bool "Enable whitelist support"
bool "DEPRECATED: Use BT_FILTER_ACCEPT_LIST instead"
select BT_FILTER_ACCEPT_LIST
config BT_FILTER_ACCEPT_LIST
bool "Enable filter accept list support"
help
This option enables the whitelist API. This takes advantage of the
whitelisting feature of a BLE controller.
The whitelist is a global list and the same whitelist is used
by both scanner and advertiser. The whitelist cannot be modified while
This option enables the filter accep list API. This takes advantage of the
filtering feature of a BLE controller.
The filter accept list is a global list and the same list is used
by both scanner and advertiser. The filter accept list cannot be modified while
it is in use.
An Advertiser can whitelist which peers can connect or request scan
An Advertiser can filter which peers can connect or request scan
response data.
A scanner can whitelist advertiser for which it will generate
A scanner can filter advertisers for which it will generate
advertising reports.
Connections can be established automatically for whitelisted peers.
Connections can be established automatically for accepted peers.
This options deprecates the bt_le_set_auto_conn API in favor of the
bt_conn_create_aute_le API.

View file

@ -694,7 +694,7 @@ int bt_le_adv_update_data(const struct bt_data *ad, size_t ad_len,
static uint8_t get_filter_policy(uint32_t options)
{
if (!IS_ENABLED(CONFIG_BT_WHITELIST)) {
if (!IS_ENABLED(CONFIG_BT_FILTER_ACCEPT_LIST)) {
return BT_LE_ADV_FP_NO_WHITELIST;
} else if ((options & BT_LE_ADV_OPT_FILTER_SCAN_REQ) &&
(options & BT_LE_ADV_OPT_FILTER_CONN)) {

View file

@ -697,9 +697,9 @@ void bt_hci_role_change(struct net_buf *buf)
}
if (evt->role) {
conn->role = BT_CONN_ROLE_SLAVE;
conn->role = BT_CONN_ROLE_PERIPHERAL;
} else {
conn->role = BT_CONN_ROLE_MASTER;
conn->role = BT_CONN_ROLE_CENTRAL;
}
bt_conn_unref(conn);

View file

@ -839,7 +839,7 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state)
sys_slist_init(&conn->channels);
if (IS_ENABLED(CONFIG_BT_PERIPHERAL) &&
conn->role == BT_CONN_ROLE_SLAVE) {
conn->role == BT_CONN_ROLE_PERIPHERAL) {
k_work_schedule(&conn->deferred_work,
CONN_UPDATE_TIMEOUT);
}
@ -1206,12 +1206,12 @@ int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason)
* and we could send LE Create Connection as soon as the remote
* starts advertising.
*/
#if !defined(CONFIG_BT_WHITELIST)
#if !defined(CONFIG_BT_FILTER_ACCEPT_LIST)
if (IS_ENABLED(CONFIG_BT_CENTRAL) &&
conn->type == BT_CONN_TYPE_LE) {
bt_le_set_auto_conn(&conn->le.dst, NULL);
}
#endif /* !defined(CONFIG_BT_WHITELIST) */
#endif /* !defined(CONFIG_BT_FILTER_ACCEPT_LIST) */
switch (conn->state) {
case BT_CONN_CONNECT_SCAN:
@ -1547,7 +1547,7 @@ static void deferred_work(struct k_work *work)
}
if (IS_ENABLED(CONFIG_BT_CENTRAL) &&
conn->role == BT_CONN_ROLE_MASTER) {
conn->role == BT_CONN_ROLE_CENTRAL) {
/* we don't call bt_conn_disconnect as it would also clear
* auto connect flag if it was set, instead just cancel
* connection directly
@ -1642,7 +1642,7 @@ struct bt_conn *bt_conn_create_br(const bt_addr_t *peer,
}
bt_conn_set_state(conn, BT_CONN_CONNECT);
conn->role = BT_CONN_ROLE_MASTER;
conn->role = BT_CONN_ROLE_CENTRAL;
return conn;
}
@ -2326,7 +2326,7 @@ int bt_conn_le_param_update(struct bt_conn *conn,
}
if (IS_ENABLED(CONFIG_BT_CENTRAL) &&
conn->role == BT_CONN_ROLE_MASTER) {
conn->role == BT_CONN_ROLE_CENTRAL) {
return send_conn_le_param_update(conn, param);
}
@ -2445,7 +2445,7 @@ static void create_param_setup(const struct bt_conn_le_create_param *param)
bt_dev.create_param.window;
}
#if defined(CONFIG_BT_WHITELIST)
#if defined(CONFIG_BT_FILTER_ACCEPT_LIST)
int bt_conn_le_create_auto(const struct bt_conn_le_create_param *create_param,
const struct bt_le_conn_param *param)
{
@ -2539,7 +2539,7 @@ int bt_conn_create_auto_stop(void)
return 0;
}
#endif /* defined(CONFIG_BT_WHITELIST) */
#endif /* defined(CONFIG_BT_FILTER_ACCEPT_LIST) */
int bt_conn_le_create(const bt_addr_le_t *peer,
const struct bt_conn_le_create_param *create_param,
@ -2628,7 +2628,7 @@ int bt_conn_le_create(const bt_addr_le_t *peer,
return 0;
}
#if !defined(CONFIG_BT_WHITELIST)
#if !defined(CONFIG_BT_FILTER_ACCEPT_LIST)
int bt_le_set_auto_conn(const bt_addr_le_t *addr,
const struct bt_le_conn_param *param)
{
@ -2684,7 +2684,7 @@ int bt_le_set_auto_conn(const bt_addr_le_t *addr,
return 0;
}
#endif /* !defined(CONFIG_BT_WHITELIST) */
#endif /* !defined(CONFIG_BT_FILTER_ACCEPT_LIST) */
#endif /* CONFIG_BT_CENTRAL */
int bt_conn_le_conn_update(struct bt_conn *conn,
@ -2872,14 +2872,14 @@ int bt_conn_init(void)
continue;
}
#if !defined(CONFIG_BT_WHITELIST)
#if !defined(CONFIG_BT_FILTER_ACCEPT_LIST)
if (atomic_test_bit(conn->flags,
BT_CONN_AUTO_CONNECT)) {
/* Only the default identity is supported */
conn->id = BT_ID_DEFAULT;
bt_conn_set_state(conn, BT_CONN_CONNECT_SCAN);
}
#endif /* !defined(CONFIG_BT_WHITELIST) */
#endif /* !defined(CONFIG_BT_FILTER_ACCEPT_LIST) */
bt_conn_unref(conn);
}

View file

@ -496,7 +496,7 @@ int bt_le_create_conn_ext(const struct bt_conn *conn)
uint8_t num_phys;
int err;
if (IS_ENABLED(CONFIG_BT_WHITELIST)) {
if (IS_ENABLED(CONFIG_BT_FILTER_ACCEPT_LIST)) {
use_filter = atomic_test_bit(conn->flags, BT_CONN_AUTO_CONNECT);
}
@ -575,7 +575,7 @@ int bt_le_create_conn_legacy(const struct bt_conn *conn)
uint8_t own_addr_type;
int err;
if (IS_ENABLED(CONFIG_BT_WHITELIST)) {
if (IS_ENABLED(CONFIG_BT_FILTER_ACCEPT_LIST)) {
use_filter = atomic_test_bit(conn->flags, BT_CONN_AUTO_CONNECT);
}
@ -761,12 +761,12 @@ static void hci_disconn_complete(struct net_buf *buf)
return;
}
#if defined(CONFIG_BT_CENTRAL) && !defined(CONFIG_BT_WHITELIST)
#if defined(CONFIG_BT_CENTRAL) && !defined(CONFIG_BT_FILTER_ACCEPT_LIST)
if (atomic_test_bit(conn->flags, BT_CONN_AUTO_CONNECT)) {
bt_conn_set_state(conn, BT_CONN_CONNECT_SCAN);
bt_le_scan_update(false);
}
#endif /* defined(CONFIG_BT_CENTRAL) && !defined(CONFIG_BT_WHITELIST) */
#endif /* defined(CONFIG_BT_CENTRAL) && !defined(CONFIG_BT_FILTER_ACCEPT_LIST) */
bt_conn_unref(conn);
}
@ -899,7 +899,7 @@ static struct bt_conn *find_pending_connect(uint8_t role, bt_addr_le_t *peer_add
if (IS_ENABLED(CONFIG_BT_CENTRAL) && role == BT_HCI_ROLE_MASTER) {
conn = bt_conn_lookup_state_le(BT_ID_DEFAULT, peer_addr,
BT_CONN_CONNECT);
if (IS_ENABLED(CONFIG_BT_WHITELIST) && !conn) {
if (IS_ENABLED(CONFIG_BT_FILTER_ACCEPT_LIST) && !conn) {
conn = bt_conn_lookup_state_le(BT_ID_DEFAULT,
BT_ADDR_LE_NONE,
BT_CONN_CONNECT_AUTO);
@ -1005,7 +1005,7 @@ static void le_conn_complete_cancel(void)
conn->err = BT_HCI_ERR_UNKNOWN_CONN_ID;
/* Handle cancellation of outgoing connection attempt. */
if (!IS_ENABLED(CONFIG_BT_WHITELIST)) {
if (!IS_ENABLED(CONFIG_BT_FILTER_ACCEPT_LIST)) {
/* We notify before checking autoconnect flag
* as application may choose to change it from
* callback.
@ -1789,7 +1789,7 @@ static void hci_encrypt_change(struct net_buf *buf)
* master on the link
*/
if (atomic_test_bit(conn->flags, BT_CONN_BR_PAIRING) &&
conn->role == BT_CONN_ROLE_MASTER) {
conn->role == BT_CONN_ROLE_CENTRAL) {
bt_smp_br_send_pairing_req(conn);
}
}
@ -3653,8 +3653,8 @@ bool bt_addr_le_is_bonded(uint8_t id, const bt_addr_le_t *addr)
}
}
#if defined(CONFIG_BT_WHITELIST)
int bt_le_whitelist_add(const bt_addr_le_t *addr)
#if defined(CONFIG_BT_FILTER_ACCEPT_LIST)
int bt_le_filter_accept_list_add(const bt_addr_le_t *addr)
{
struct bt_hci_cp_le_add_dev_to_wl *cp;
struct net_buf *buf;
@ -3682,7 +3682,7 @@ int bt_le_whitelist_add(const bt_addr_le_t *addr)
return 0;
}
int bt_le_whitelist_rem(const bt_addr_le_t *addr)
int bt_le_filter_accept_list_remove(const bt_addr_le_t *addr)
{
struct bt_hci_cp_le_rem_dev_from_wl *cp;
struct net_buf *buf;
@ -3709,7 +3709,7 @@ int bt_le_whitelist_rem(const bt_addr_le_t *addr)
return 0;
}
int bt_le_whitelist_clear(void)
int bt_le_filter_accept_list_clear(void)
{
int err;
@ -3725,7 +3725,7 @@ int bt_le_whitelist_clear(void)
return 0;
}
#endif /* defined(CONFIG_BT_WHITELIST) */
#endif /* defined(CONFIG_BT_FILTER_ACCEPT_LIST) */
int bt_le_set_chan_map(uint8_t chan_map[5])
{

View file

@ -388,7 +388,7 @@ static void le_update_private_addr(void)
}
#endif
if (IS_ENABLED(CONFIG_BT_CENTRAL) &&
IS_ENABLED(CONFIG_BT_WHITELIST) &&
IS_ENABLED(CONFIG_BT_FILTER_ACCEPT_LIST) &&
atomic_test_bit(bt_dev.flags, BT_DEV_INITIATING)) {
/* Canceled initiating procedure will be restarted by
* connection complete event.

View file

@ -160,7 +160,7 @@ static int start_le_scan_ext(struct bt_hci_ext_scan_phy *phy_1m,
set_param->own_addr_type = own_addr_type;
set_param->phys = 0;
if (IS_ENABLED(CONFIG_BT_WHITELIST) &&
if (IS_ENABLED(CONFIG_BT_FILTER_ACCEPT_LIST) &&
atomic_test_bit(bt_dev.flags, BT_DEV_SCAN_WL)) {
set_param->filter_policy = BT_HCI_LE_SCAN_FP_USE_WHITELIST;
} else {
@ -209,7 +209,7 @@ static int start_le_scan_legacy(uint8_t scan_type, uint16_t interval, uint16_t w
set_param.interval = sys_cpu_to_le16(interval);
set_param.window = sys_cpu_to_le16(window);
if (IS_ENABLED(CONFIG_BT_WHITELIST) &&
if (IS_ENABLED(CONFIG_BT_FILTER_ACCEPT_LIST) &&
atomic_test_bit(bt_dev.flags, BT_DEV_SCAN_WL)) {
set_param.filter_policy = BT_HCI_LE_SCAN_FP_USE_WHITELIST;
} else {
@ -935,7 +935,7 @@ static bool valid_le_scan_param(const struct bt_le_scan_param *param)
}
if (param->options & ~(BT_LE_SCAN_OPT_FILTER_DUPLICATE |
BT_LE_SCAN_OPT_FILTER_WHITELIST |
BT_LE_SCAN_OPT_FILTER_ACCEPT_LIST |
BT_LE_SCAN_OPT_CODED |
BT_LE_SCAN_OPT_NO_1M)) {
return false;
@ -989,10 +989,10 @@ int bt_le_scan_start(const struct bt_le_scan_param *param, bt_le_scan_cb_t cb)
atomic_set_bit_to(bt_dev.flags, BT_DEV_SCAN_FILTER_DUP,
param->options & BT_LE_SCAN_OPT_FILTER_DUPLICATE);
#if defined(CONFIG_BT_WHITELIST)
#if defined(CONFIG_BT_FILTER_ACCEPT_LIST)
atomic_set_bit_to(bt_dev.flags, BT_DEV_SCAN_WL,
param->options & BT_LE_SCAN_OPT_FILTER_WHITELIST);
#endif /* defined(CONFIG_BT_WHITELIST) */
param->options & BT_LE_SCAN_OPT_FILTER_ACCEPT_LIST);
#endif /* defined(CONFIG_BT_FILTER_ACCEPT_LIST) */
if (IS_ENABLED(CONFIG_BT_EXT_ADV) &&
BT_DEV_FEAT_LE_EXT_ADV(bt_dev.le.features)) {

View file

@ -1499,7 +1499,7 @@ static uint8_t smp_br_ident_addr_info(struct bt_smp_br *smp,
atomic_set_bit(smp->allowed_cmds, BT_SMP_CMD_SIGNING_INFO);
}
if (conn->role == BT_CONN_ROLE_MASTER && !smp->remote_dist) {
if (conn->role == BT_CONN_ROLE_CENTRAL && !smp->remote_dist) {
smp_br_distribute_keys(smp);
}
@ -1538,7 +1538,7 @@ static uint8_t smp_br_signing_info(struct bt_smp_br *smp, struct net_buf *buf)
smp->remote_dist &= ~BT_SMP_DIST_SIGN;
if (conn->role == BT_CONN_ROLE_MASTER && !smp->remote_dist) {
if (conn->role == BT_CONN_ROLE_CENTRAL && !smp->remote_dist) {
smp_br_distribute_keys(smp);
}
@ -5573,7 +5573,7 @@ int bt_smp_auth_pairing_confirm(struct bt_conn *conn)
}
if (IS_ENABLED(CONFIG_BT_CENTRAL) &&
conn->role == BT_CONN_ROLE_MASTER) {
conn->role == BT_CONN_ROLE_CENTRAL) {
if (!atomic_test_bit(smp->flags, SMP_FLAG_SC)) {
atomic_set_bit(smp->allowed_cmds,
BT_SMP_CMD_PAIRING_CONFIRM);

View file

@ -872,7 +872,7 @@ static void gatt_connected(struct bt_conn *conn, uint8_t err)
struct bt_conn_info info;
bt_conn_get_info(conn, &info);
if (info.role != BT_CONN_ROLE_SLAVE) {
if (info.role != BT_CONN_ROLE_PERIPHERAL) {
return;
}
@ -903,7 +903,7 @@ static void gatt_disconnected(struct bt_conn *conn, uint8_t reason)
struct bt_conn_info info;
bt_conn_get_info(conn, &info);
if (info.role != BT_CONN_ROLE_SLAVE) {
if (info.role != BT_CONN_ROLE_PERIPHERAL) {
return;
}

View file

@ -904,7 +904,7 @@ static int cmd_scan(const struct shell *shell, size_t argc, char *argv[])
} else if (!strcmp(arg, "nodups")) {
options &= ~BT_LE_SCAN_OPT_FILTER_DUPLICATE;
} else if (!strcmp(arg, "wl")) {
options |= BT_LE_SCAN_OPT_FILTER_WHITELIST;
options |= BT_LE_SCAN_OPT_FILTER_ACCEPT_LIST;
} else if (!strcmp(arg, "coded")) {
options |= BT_LE_SCAN_OPT_CODED;
} else if (!strcmp(arg, "no-1m")) {
@ -1876,7 +1876,7 @@ static int cmd_connect_le(const struct shell *shell, size_t argc, char *argv[])
return 0;
}
#if !defined(CONFIG_BT_WHITELIST)
#if !defined(CONFIG_BT_FILTER_ACCEPT_LIST)
static int cmd_auto_conn(const struct shell *shell, size_t argc, char *argv[])
{
bt_addr_le_t addr;
@ -1901,7 +1901,7 @@ static int cmd_auto_conn(const struct shell *shell, size_t argc, char *argv[])
return 0;
}
#endif /* !defined(CONFIG_BT_WHITELIST) */
#endif /* !defined(CONFIG_BT_FILTER_ACCEPT_LIST) */
#endif /* CONFIG_BT_CENTRAL */
static int cmd_disconnect(const struct shell *shell, size_t argc, char *argv[])
@ -1985,8 +1985,8 @@ static const char *get_conn_type_str(uint8_t type)
static const char *get_conn_role_str(uint8_t role)
{
switch (role) {
case BT_CONN_ROLE_MASTER: return "master";
case BT_CONN_ROLE_SLAVE: return "slave";
case BT_CONN_ROLE_CENTRAL: return "central";
case BT_CONN_ROLE_PERIPHERAL: return "peripheral";
default: return "Invalid";
}
}
@ -2440,10 +2440,10 @@ static int cmd_bonds(const struct shell *shell, size_t argc, char *argv[])
static const char *role_str(uint8_t role)
{
switch (role) {
case BT_CONN_ROLE_MASTER:
return "Master";
case BT_CONN_ROLE_SLAVE:
return "Slave";
case BT_CONN_ROLE_CENTRAL:
return "Central";
case BT_CONN_ROLE_PERIPHERAL:
return "Peripheral";
}
return "Unknown";
@ -2891,7 +2891,7 @@ static int cmd_auth_pairing_confirm(const struct shell *shell,
return 0;
}
#if defined(CONFIG_BT_WHITELIST)
#if defined(CONFIG_BT_FILTER_ACCEPT_LIST)
static int cmd_wl_add(const struct shell *shell, size_t argc, char *argv[])
{
bt_addr_le_t addr;
@ -2903,9 +2903,9 @@ static int cmd_wl_add(const struct shell *shell, size_t argc, char *argv[])
return err;
}
err = bt_le_whitelist_add(&addr);
err = bt_le_filter_accept_list_add(&addr);
if (err) {
shell_error(shell, "Add to whitelist failed (err %d)", err);
shell_error(shell, "Add to fa list failed (err %d)", err);
return err;
}
@ -2923,9 +2923,9 @@ static int cmd_wl_rem(const struct shell *shell, size_t argc, char *argv[])
return err;
}
err = bt_le_whitelist_rem(&addr);
err = bt_le_filter_accept_list_remove(&addr);
if (err) {
shell_error(shell, "Remove from whitelist failed (err %d)",
shell_error(shell, "Remove from fa list failed (err %d)",
err);
return err;
}
@ -2936,9 +2936,9 @@ static int cmd_wl_clear(const struct shell *shell, size_t argc, char *argv[])
{
int err;
err = bt_le_whitelist_clear();
err = bt_le_filter_accept_list_clear();
if (err) {
shell_error(shell, "Clearing whitelist failed (err %d)", err);
shell_error(shell, "Clearing fa list failed (err %d)", err);
return err;
}
@ -2990,7 +2990,7 @@ static int cmd_wl_connect(const struct shell *shell, size_t argc, char *argv[])
return 0;
}
#endif /* CONFIG_BT_CENTRAL */
#endif /* defined(CONFIG_BT_WHITELIST) */
#endif /* defined(CONFIG_BT_FILTER_ACCEPT_LIST) */
#if defined(CONFIG_BT_FIXED_PASSKEY)
static int cmd_fixed_passkey(const struct shell *shell,
@ -3165,9 +3165,9 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds,
#if defined(CONFIG_BT_CENTRAL)
SHELL_CMD_ARG(connect, NULL, HELP_ADDR_LE EXT_ADV_SCAN_OPT,
cmd_connect_le, 3, 3),
#if !defined(CONFIG_BT_WHITELIST)
#if !defined(CONFIG_BT_FILTER_ACCEPT_LIST)
SHELL_CMD_ARG(auto-conn, NULL, HELP_ADDR_LE, cmd_auto_conn, 3, 0),
#endif /* !defined(CONFIG_BT_WHITELIST) */
#endif /* !defined(CONFIG_BT_FILTER_ACCEPT_LIST) */
#endif /* CONFIG_BT_CENTRAL */
SHELL_CMD_ARG(disconnect, NULL, HELP_NONE, cmd_disconnect, 1, 2),
SHELL_CMD_ARG(select, NULL, HELP_ADDR_LE, cmd_select, 3, 0),
@ -3213,7 +3213,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds,
HELP_ADDR_LE" <oob rand> <oob confirm>",
cmd_oob_remote, 3, 2),
SHELL_CMD_ARG(oob-clear, NULL, HELP_NONE, cmd_oob_clear, 1, 0),
#if defined(CONFIG_BT_WHITELIST)
#if defined(CONFIG_BT_FILTER_ACCEPT_LIST)
SHELL_CMD_ARG(wl-add, NULL, HELP_ADDR_LE, cmd_wl_add, 3, 0),
SHELL_CMD_ARG(wl-rem, NULL, HELP_ADDR_LE, cmd_wl_rem, 3, 0),
SHELL_CMD_ARG(wl-clear, NULL, HELP_NONE, cmd_wl_clear, 1, 0),
@ -3222,7 +3222,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds,
SHELL_CMD_ARG(wl-connect, NULL, "<on, off>" EXT_ADV_SCAN_OPT,
cmd_wl_connect, 2, 3),
#endif /* CONFIG_BT_CENTRAL */
#endif /* defined(CONFIG_BT_WHITELIST) */
#endif /* defined(CONFIG_BT_FILTER_ACCEPT_LIST) */
#if defined(CONFIG_BT_FIXED_PASSKEY)
SHELL_CMD_ARG(fixed-passkey, NULL, "[passkey]", cmd_fixed_passkey,
1, 1),

View file

@ -24,7 +24,7 @@ CONFIG_BT_EATT=y
CONFIG_BT_L2CAP_ECRED=y
CONFIG_BT_GATT_DYNAMIC_DB=y
CONFIG_BT_HRS=y
CONFIG_BT_WHITELIST=y
CONFIG_BT_FILTER_ACCEPT_LIST=y
CONFIG_BT_REMOTE_INFO=y
CONFIG_BT_REMOTE_VERSION=y
CONFIG_BT_GATT_AUTO_DISCOVER_CCC=y