Commit 6de47479 authored by Carles Cufi's avatar Carles Cufi Committed by Johan Hedberg
Browse files

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: default avatarCarles Cufi <carles.cufi@nordicsemi.no>
parent 324374d2
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -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
+42 −23
Original line number Diff line number Diff line
@@ -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.
+12 −9
Original line number Diff line number Diff line
@@ -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.
+1 −1
Original line number Diff line number Diff line
@@ -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;

+1 −1
Original line number Diff line number Diff line
@@ -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;
Loading