Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Defines and Assigned Numbers

Bluetooth Generic Access Profile defines and Assigned Numbers. More...

Macros

#define BT_GAP_ADV_MAX_ADV_DATA_LEN   31
 Maximum advertising data length.
#define BT_GAP_ADV_MAX_EXT_ADV_DATA_LEN   1650
 Maximum extended advertising data length.
#define BT_GAP_TX_POWER_INVALID   0x7f
#define BT_GAP_RSSI_INVALID   0x7f
#define BT_GAP_SID_INVALID   0xff
#define BT_GAP_NO_TIMEOUT   0x0000
#define BT_GAP_ADV_HIGH_DUTY_CYCLE_MAX_TIMEOUT   128
#define BT_GAP_DATA_LEN_DEFAULT   0x001b /* 27 bytes */
 Default data length.
#define BT_GAP_DATA_LEN_MAX   0x00fb /* 251 bytes */
 Maximum data length.
#define BT_GAP_DATA_TIME_DEFAULT   0x0148 /* 328 us */
 Default data time.
#define BT_GAP_DATA_TIME_MAX   0x4290 /* 17040 us */
 Maximum data time.
#define BT_GAP_SID_MIN   0x00
 Minimum advertising set number.
#define BT_GAP_SID_MAX   0x0F
 Maximum advertising set number.
#define BT_GAP_PER_ADV_MAX_SKIP   0x01F3
 Maximum number of consecutive periodic advertisement events that can be skipped after a successful receive.
#define BT_GAP_PER_ADV_MIN_TIMEOUT   0x000A /* 100 ms */
 Minimum Periodic Advertising Timeout (N * 10 ms)
#define BT_GAP_PER_ADV_MAX_TIMEOUT   0x4000 /* 163.84 s */
 Maximum Periodic Advertising Timeout (N * 10 ms)
#define BT_GAP_PER_ADV_MIN_INTERVAL   0x0006 /* 7.5 ms */
 Minimum Periodic Advertising Interval (N * 1.25 ms)
#define BT_GAP_PER_ADV_MAX_INTERVAL   0xFFFF /* 81.91875 s */
 Maximum Periodic Advertising Interval (N * 1.25 ms)
#define BT_GAP_ADV_INTERVAL_TO_US(_interval)
 Convert periodic advertising interval (N * 0.625 ms) to microseconds.
#define BT_GAP_ADV_INTERVAL_TO_MS(_interval)
 Convert periodic advertising interval (N * 0.625 ms) to milliseconds.
#define BT_GAP_ISO_INTERVAL_TO_US(_interval)
 Convert isochronous interval (N * 1.25 ms) to microseconds.
#define BT_GAP_ISO_INTERVAL_TO_MS(_interval)
 Convert isochronous interval (N * 1.25 ms) to milliseconds.
#define BT_GAP_PER_ADV_INTERVAL_TO_US(_interval)
 Convert periodic advertising interval (N * 1.25 ms) to microseconds *.
#define BT_GAP_PER_ADV_INTERVAL_TO_MS(_interval)
 Convert periodic advertising interval (N * 1.25 ms) to milliseconds.
#define BT_GAP_US_TO_ADV_INTERVAL(_interval)
 Convert microseconds to advertising interval units (0.625 ms)
#define BT_GAP_MS_TO_ADV_INTERVAL(_interval)
 Convert milliseconds to advertising interval units (0.625 ms)
#define BT_GAP_US_TO_PER_ADV_INTERVAL(_interval)
 Convert microseconds to periodic advertising interval units (1.25 ms)
#define BT_GAP_MS_TO_PER_ADV_INTERVAL(_interval)
 Convert milliseconds to periodic advertising interval units (1.25 ms)
#define BT_GAP_MS_TO_PER_ADV_SYNC_TIMEOUT(_timeout)
 Convert milliseconds to periodic advertising sync timeout units (10 ms)
#define BT_GAP_US_TO_PER_ADV_SYNC_TIMEOUT(_timeout)
 Convert microseconds to periodic advertising sync timeout units (10 ms)
#define BT_GAP_US_TO_SCAN_INTERVAL(_interval)
 Convert microseconds to scan interval units (0.625 ms)
#define BT_GAP_MS_TO_SCAN_INTERVAL(_interval)
 Convert milliseconds to scan interval units (0.625 ms)
#define BT_GAP_US_TO_SCAN_WINDOW(_window)
 Convert microseconds to scan window units (0.625 ms)
#define BT_GAP_MS_TO_SCAN_WINDOW(_window)
 Convert milliseconds to scan window units (0.625 ms)
#define BT_GAP_US_TO_CONN_INTERVAL(_interval)
 Convert microseconds to connection interval units (1.25 ms)
#define BT_GAP_MS_TO_CONN_INTERVAL(_interval)
 Convert milliseconds to connection interval units (1.25 ms)
#define BT_GAP_MS_TO_CONN_TIMEOUT(_timeout)
 Convert milliseconds to connection supervision timeout units (10 ms)
#define BT_GAP_US_TO_CONN_TIMEOUT(_timeout)
 Convert microseconds to connection supervision timeout units (10 ms)
#define BT_GAP_US_TO_CONN_EVENT_LEN(_event_len)
 Convert milliseconds to connection event length units (0.625)
#define BT_GAP_MS_TO_CONN_EVENT_LEN(_event_len)
 Convert milliseconds to connection event length units (0.625)
#define BT_LE_SUPP_FEAT_40_ENCODE(w64)
 Encode 40 least significant bits of 64-bit LE Supported Features into array values in little-endian format.
#define BT_LE_SUPP_FEAT_32_ENCODE(w64)
 Encode 4 least significant bytes of 64-bit LE Supported Features into 4 bytes long array of values in little-endian format.
#define BT_LE_SUPP_FEAT_24_ENCODE(w64)
 Encode 3 least significant bytes of 64-bit LE Supported Features into 3 bytes long array of values in little-endian format.
#define BT_LE_SUPP_FEAT_16_ENCODE(w64)
 Encode 2 least significant bytes of 64-bit LE Supported Features into 2 bytes long array of values in little-endian format.
#define BT_LE_SUPP_FEAT_8_ENCODE(w64)
 Encode the least significant byte of 64-bit LE Supported Features into single byte long array.
#define BT_LE_SUPP_FEAT_VALIDATE(w64)
 Validate whether LE Supported Features value does not use bits that are reserved for future use.

Enumerations

enum  bt_gap_le_phy {
  BT_GAP_LE_PHY_NONE = 0 , BT_GAP_LE_PHY_1M = BIT(0) , BT_GAP_LE_PHY_2M = BIT(1) , BT_GAP_LE_PHY_CODED = BIT(2) ,
  BT_GAP_LE_PHY_CODED_S8 = BIT(3) , BT_GAP_LE_PHY_CODED_S2 = BIT(4)
}
 LE PHY types. More...
enum  bt_gap_adv_type {
  BT_GAP_ADV_TYPE_ADV_IND = 0x00 , BT_GAP_ADV_TYPE_ADV_DIRECT_IND = 0x01 , BT_GAP_ADV_TYPE_ADV_SCAN_IND = 0x02 , BT_GAP_ADV_TYPE_ADV_NONCONN_IND = 0x03 ,
  BT_GAP_ADV_TYPE_SCAN_RSP = 0x04 , BT_GAP_ADV_TYPE_EXT_ADV = 0x05
}
 Advertising PDU types. More...
enum  bt_gap_adv_prop {
  BT_GAP_ADV_PROP_CONNECTABLE = BIT(0) , BT_GAP_ADV_PROP_SCANNABLE = BIT(1) , BT_GAP_ADV_PROP_DIRECTED = BIT(2) , BT_GAP_ADV_PROP_SCAN_RESPONSE = BIT(3) ,
  BT_GAP_ADV_PROP_EXT_ADV = BIT(4)
}
 Advertising PDU properties. More...
enum  bt_gap_cte { BT_GAP_CTE_AOA = 0x00 , BT_GAP_CTE_AOD_1US = 0x01 , BT_GAP_CTE_AOD_2US = 0x02 , BT_GAP_CTE_NONE = 0xFF }
 Constant Tone Extension (CTE) types. More...
enum  bt_gap_sca {
  BT_GAP_SCA_UNKNOWN = 0 , BT_GAP_SCA_251_500 = 0 , BT_GAP_SCA_151_250 = 1 , BT_GAP_SCA_101_150 = 2 ,
  BT_GAP_SCA_76_100 = 3 , BT_GAP_SCA_51_75 = 4 , BT_GAP_SCA_31_50 = 5 , BT_GAP_SCA_21_30 = 6 ,
  BT_GAP_SCA_0_20 = 7
}
 Peripheral sleep clock accuracy (SCA) in ppm (parts per million) More...

Company Identifiers (see Bluetooth Assigned Numbers)

#define BT_COMP_ID_LF   0x05f1
 The Linux Foundation.

Defined GAP timers

#define BT_GAP_SCAN_FAST_INTERVAL_MIN   0x0030 /* 30 ms */
#define BT_GAP_SCAN_FAST_INTERVAL   0x0060 /* 60 ms */
#define BT_GAP_SCAN_FAST_WINDOW   0x0030 /* 30 ms */
#define BT_GAP_SCAN_SLOW_INTERVAL_1   0x0800 /* 1.28 s */
#define BT_GAP_SCAN_SLOW_WINDOW_1   0x0012 /* 11.25 ms */
#define BT_GAP_SCAN_SLOW_INTERVAL_2   0x1000 /* 2.56 s */
#define BT_GAP_SCAN_SLOW_WINDOW_2   0x0012 /* 11.25 ms */
#define BT_GAP_ADV_FAST_INT_MIN_1   0x0030 /* 30 ms */
#define BT_GAP_ADV_FAST_INT_MAX_1   0x0060 /* 60 ms */
#define BT_GAP_ADV_FAST_INT_MIN_2   0x00a0 /* 100 ms */
#define BT_GAP_ADV_FAST_INT_MAX_2   0x00f0 /* 150 ms */
#define BT_GAP_ADV_SLOW_INT_MIN   0x0640 /* 1 s */
#define BT_GAP_ADV_SLOW_INT_MAX   0x0780 /* 1.2 s */
#define BT_GAP_PER_ADV_FAST_INT_MIN_1   0x0018 /* 30 ms */
#define BT_GAP_PER_ADV_FAST_INT_MAX_1   0x0030 /* 60 ms */
#define BT_GAP_PER_ADV_FAST_INT_MIN_2   0x0050 /* 100 ms */
#define BT_GAP_PER_ADV_FAST_INT_MAX_2   0x0078 /* 150 ms */
#define BT_GAP_PER_ADV_SLOW_INT_MIN   0x0320 /* 1 s */
#define BT_GAP_PER_ADV_SLOW_INT_MAX   0x03C0 /* 1.2 s */
#define BT_GAP_INIT_CONN_INT_MIN   0x0018 /* 30 ms */
#define BT_GAP_INIT_CONN_INT_MAX   0x0028 /* 50 ms */

Detailed Description

Bluetooth Generic Access Profile defines and Assigned Numbers.

Macro Definition Documentation

◆ BT_COMP_ID_LF

#define BT_COMP_ID_LF   0x05f1

#include <zephyr/bluetooth/gap.h>

The Linux Foundation.

◆ BT_GAP_ADV_FAST_INT_MAX_1

#define BT_GAP_ADV_FAST_INT_MAX_1   0x0060 /* 60 ms */

◆ BT_GAP_ADV_FAST_INT_MAX_2

#define BT_GAP_ADV_FAST_INT_MAX_2   0x00f0 /* 150 ms */

◆ BT_GAP_ADV_FAST_INT_MIN_1

#define BT_GAP_ADV_FAST_INT_MIN_1   0x0030 /* 30 ms */

◆ BT_GAP_ADV_FAST_INT_MIN_2

#define BT_GAP_ADV_FAST_INT_MIN_2   0x00a0 /* 100 ms */

◆ BT_GAP_ADV_HIGH_DUTY_CYCLE_MAX_TIMEOUT

#define BT_GAP_ADV_HIGH_DUTY_CYCLE_MAX_TIMEOUT   128

◆ BT_GAP_ADV_INTERVAL_TO_MS

#define BT_GAP_ADV_INTERVAL_TO_MS ( _interval)

#include <zephyr/bluetooth/gap.h>

Value:
#define BT_GAP_ADV_INTERVAL_TO_US(_interval)
Convert periodic advertising interval (N * 0.625 ms) to microseconds.
Definition gap.h:168
#define USEC_PER_MSEC
number of microseconds per millisecond
Definition clock.h:89

Convert periodic advertising interval (N * 0.625 ms) to milliseconds.

Value range of _interval is BT_LE_ADV_INTERVAL_MIN to BT_LE_ADV_INTERVAL_MAX

Note
When intervals cannot be represented in milliseconds, this will round down. For example BT_GAP_ADV_INTERVAL_TO_MS(0x0021) will become 20 ms instead of 20.625 ms

◆ BT_GAP_ADV_INTERVAL_TO_US

#define BT_GAP_ADV_INTERVAL_TO_US ( _interval)

#include <zephyr/bluetooth/gap.h>

Value:
((uint32_t)((_interval) * 625U))
__UINT32_TYPE__ uint32_t
Definition stdint.h:90

Convert periodic advertising interval (N * 0.625 ms) to microseconds.

Value range of _interval is BT_LE_ADV_INTERVAL_MIN to BT_LE_ADV_INTERVAL_MAX

◆ BT_GAP_ADV_MAX_ADV_DATA_LEN

#define BT_GAP_ADV_MAX_ADV_DATA_LEN   31

#include <zephyr/bluetooth/gap.h>

Maximum advertising data length.

◆ BT_GAP_ADV_MAX_EXT_ADV_DATA_LEN

#define BT_GAP_ADV_MAX_EXT_ADV_DATA_LEN   1650

#include <zephyr/bluetooth/gap.h>

Maximum extended advertising data length.

Note
The maximum advertising data length that can be sent by an extended advertiser is defined by the controller.

◆ BT_GAP_ADV_SLOW_INT_MAX

#define BT_GAP_ADV_SLOW_INT_MAX   0x0780 /* 1.2 s */

◆ BT_GAP_ADV_SLOW_INT_MIN

#define BT_GAP_ADV_SLOW_INT_MIN   0x0640 /* 1 s */

◆ BT_GAP_DATA_LEN_DEFAULT

#define BT_GAP_DATA_LEN_DEFAULT   0x001b /* 27 bytes */

#include <zephyr/bluetooth/gap.h>

Default data length.

◆ BT_GAP_DATA_LEN_MAX

#define BT_GAP_DATA_LEN_MAX   0x00fb /* 251 bytes */

#include <zephyr/bluetooth/gap.h>

Maximum data length.

◆ BT_GAP_DATA_TIME_DEFAULT

#define BT_GAP_DATA_TIME_DEFAULT   0x0148 /* 328 us */

#include <zephyr/bluetooth/gap.h>

Default data time.

◆ BT_GAP_DATA_TIME_MAX

#define BT_GAP_DATA_TIME_MAX   0x4290 /* 17040 us */

#include <zephyr/bluetooth/gap.h>

Maximum data time.

◆ BT_GAP_INIT_CONN_INT_MAX

#define BT_GAP_INIT_CONN_INT_MAX   0x0028 /* 50 ms */

◆ BT_GAP_INIT_CONN_INT_MIN

#define BT_GAP_INIT_CONN_INT_MIN   0x0018 /* 30 ms */

◆ BT_GAP_ISO_INTERVAL_TO_MS

#define BT_GAP_ISO_INTERVAL_TO_MS ( _interval)

#include <zephyr/bluetooth/gap.h>

Value:
#define BT_GAP_ISO_INTERVAL_TO_US(_interval)
Convert isochronous interval (N * 1.25 ms) to microseconds.
Definition gap.h:185

Convert isochronous interval (N * 1.25 ms) to milliseconds.

Value range of _interval is BT_HCI_ISO_INTERVAL_MIN to BT_HCI_ISO_INTERVAL_MAX

Note
When intervals cannot be represented in milliseconds, this will round down. For example BT_GAP_ISO_INTERVAL_TO_MS(0x0005) will become 6 ms instead of 6.25 ms

◆ BT_GAP_ISO_INTERVAL_TO_US

#define BT_GAP_ISO_INTERVAL_TO_US ( _interval)

#include <zephyr/bluetooth/gap.h>

Value:
((uint32_t)((_interval) * 1250U))

Convert isochronous interval (N * 1.25 ms) to microseconds.

Value range of _interval is BT_HCI_ISO_INTERVAL_MIN to BT_HCI_ISO_INTERVAL_MAX

◆ BT_GAP_MS_TO_ADV_INTERVAL

#define BT_GAP_MS_TO_ADV_INTERVAL ( _interval)

#include <zephyr/bluetooth/gap.h>

Value:
#define BT_GAP_US_TO_ADV_INTERVAL(_interval)
Convert microseconds to advertising interval units (0.625 ms)
Definition gap.h:221

Convert milliseconds to advertising interval units (0.625 ms)

Value range of _interval is 20 to 1024

Note
If _interval is not a multiple of the unit, it will round down to nearest. For example BT_GAP_MS_TO_ADV_INTERVAL(21) will become 20.625 milliseconds

◆ BT_GAP_MS_TO_CONN_EVENT_LEN

#define BT_GAP_MS_TO_CONN_EVENT_LEN ( _event_len)

#include <zephyr/bluetooth/gap.h>

Value:
#define BT_GAP_US_TO_CONN_EVENT_LEN(_event_len)
Convert milliseconds to connection event length units (0.625)
Definition gap.h:370

Convert milliseconds to connection event length units (0.625)

Value range of _event_len is 0 to 40959.375

Note
If _event_len is not a multiple of the unit, it will round down to nearest. For example BT_GAP_MS_TO_CONN_EVENT_LEN(21) will become 20.625 milliseconds

◆ BT_GAP_MS_TO_CONN_INTERVAL

#define BT_GAP_MS_TO_CONN_INTERVAL ( _interval)

#include <zephyr/bluetooth/gap.h>

Value:
#define BT_GAP_US_TO_CONN_INTERVAL(_interval)
Convert microseconds to connection interval units (1.25 ms)
Definition gap.h:329

Convert milliseconds to connection interval units (1.25 ms)

Value range of _interval is 7.5 to 4000

Note
If _interval is not a multiple of the unit, it will round down to nearest. For example BT_GAP_MS_TO_CONN_INTERVAL(21) will become 20 milliseconds

◆ BT_GAP_MS_TO_CONN_TIMEOUT

#define BT_GAP_MS_TO_CONN_TIMEOUT ( _timeout)

#include <zephyr/bluetooth/gap.h>

Value:
((uint16_t)((_timeout) / 10U))
__UINT16_TYPE__ uint16_t
Definition stdint.h:89

Convert milliseconds to connection supervision timeout units (10 ms)

Value range of _timeout is 100 to 32000

Note
If _timeout is not a multiple of the unit, it will round down to nearest. For example BT_GAP_MS_TO_CONN_TIMEOUT(4005) will become 4000 milliseconds

◆ BT_GAP_MS_TO_PER_ADV_INTERVAL

#define BT_GAP_MS_TO_PER_ADV_INTERVAL ( _interval)

#include <zephyr/bluetooth/gap.h>

Value:
#define BT_GAP_US_TO_PER_ADV_INTERVAL(_interval)
Convert microseconds to periodic advertising interval units (1.25 ms)
Definition gap.h:242

Convert milliseconds to periodic advertising interval units (1.25 ms)

Value range of _interval is 7.5 to 81918.75

Note
If _interval is not a multiple of the unit, it will round down to nearest. For example BT_GAP_MS_TO_PER_ADV_INTERVAL(11) will become 10 milliseconds

◆ BT_GAP_MS_TO_PER_ADV_SYNC_TIMEOUT

#define BT_GAP_MS_TO_PER_ADV_SYNC_TIMEOUT ( _timeout)

#include <zephyr/bluetooth/gap.h>

Value:
((uint16_t)((_timeout) / 10U))

Convert milliseconds to periodic advertising sync timeout units (10 ms)

Value range of _timeout is 100 to 163840

Note
If _timeout is not a multiple of the unit, it will round down to nearest. For example BT_GAP_MS_TO_PER_ADV_SYNC_TIMEOUT(4005) will become 4000 milliseconds

◆ BT_GAP_MS_TO_SCAN_INTERVAL

#define BT_GAP_MS_TO_SCAN_INTERVAL ( _interval)

#include <zephyr/bluetooth/gap.h>

Value:
#define BT_GAP_US_TO_SCAN_INTERVAL(_interval)
Convert microseconds to scan interval units (0.625 ms)
Definition gap.h:285

Convert milliseconds to scan interval units (0.625 ms)

Value range of _interval is 2.5 to 40959.375 if CONFIG_BT_EXT_ADV else 2500 to 10240

Note
If _interval is not a multiple of the unit, it will round down to nearest. For example BT_GAP_MS_TO_SCAN_INTERVAL(21) will become 20.625 milliseconds

◆ BT_GAP_MS_TO_SCAN_WINDOW

#define BT_GAP_MS_TO_SCAN_WINDOW ( _window)

#include <zephyr/bluetooth/gap.h>

Value:
#define BT_GAP_US_TO_SCAN_WINDOW(_window)
Convert microseconds to scan window units (0.625 ms)
Definition gap.h:308

Convert milliseconds to scan window units (0.625 ms)

Value range of _window is 2.5 to 40959.375 if CONFIG_BT_EXT_ADV else 2500 to 10240

Note
If _window is not a multiple of the unit, it will round down to nearest. For example BT_GAP_MS_TO_SCAN_WINDOW(21) will become 20.625 milliseconds

◆ BT_GAP_NO_TIMEOUT

#define BT_GAP_NO_TIMEOUT   0x0000

◆ BT_GAP_PER_ADV_FAST_INT_MAX_1

#define BT_GAP_PER_ADV_FAST_INT_MAX_1   0x0030 /* 60 ms */

◆ BT_GAP_PER_ADV_FAST_INT_MAX_2

#define BT_GAP_PER_ADV_FAST_INT_MAX_2   0x0078 /* 150 ms */

◆ BT_GAP_PER_ADV_FAST_INT_MIN_1

#define BT_GAP_PER_ADV_FAST_INT_MIN_1   0x0018 /* 30 ms */

◆ BT_GAP_PER_ADV_FAST_INT_MIN_2

#define BT_GAP_PER_ADV_FAST_INT_MIN_2   0x0050 /* 100 ms */

◆ BT_GAP_PER_ADV_INTERVAL_TO_MS

#define BT_GAP_PER_ADV_INTERVAL_TO_MS ( _interval)

#include <zephyr/bluetooth/gap.h>

Value:
#define BT_GAP_PER_ADV_INTERVAL_TO_US(_interval)
Convert periodic advertising interval (N * 1.25 ms) to microseconds *.
Definition gap.h:202

Convert periodic advertising interval (N * 1.25 ms) to milliseconds.

Note
When intervals cannot be represented in milliseconds, this will round down. For example BT_GAP_PER_ADV_INTERVAL_TO_MS(0x0009) will become 11 ms instead of 11.25 ms

◆ BT_GAP_PER_ADV_INTERVAL_TO_US

#define BT_GAP_PER_ADV_INTERVAL_TO_US ( _interval)

#include <zephyr/bluetooth/gap.h>

Value:
((uint32_t)((_interval) * 1250U))

Convert periodic advertising interval (N * 1.25 ms) to microseconds *.

Value range of _interval is BT_HCI_LE_PER_ADV_INTERVAL_MIN to BT_HCI_LE_PER_ADV_INTERVAL_MAX

◆ BT_GAP_PER_ADV_MAX_INTERVAL

#define BT_GAP_PER_ADV_MAX_INTERVAL   0xFFFF /* 81.91875 s */

#include <zephyr/bluetooth/gap.h>

Maximum Periodic Advertising Interval (N * 1.25 ms)

◆ BT_GAP_PER_ADV_MAX_SKIP

#define BT_GAP_PER_ADV_MAX_SKIP   0x01F3

#include <zephyr/bluetooth/gap.h>

Maximum number of consecutive periodic advertisement events that can be skipped after a successful receive.

◆ BT_GAP_PER_ADV_MAX_TIMEOUT

#define BT_GAP_PER_ADV_MAX_TIMEOUT   0x4000 /* 163.84 s */

#include <zephyr/bluetooth/gap.h>

Maximum Periodic Advertising Timeout (N * 10 ms)

◆ BT_GAP_PER_ADV_MIN_INTERVAL

#define BT_GAP_PER_ADV_MIN_INTERVAL   0x0006 /* 7.5 ms */

#include <zephyr/bluetooth/gap.h>

Minimum Periodic Advertising Interval (N * 1.25 ms)

◆ BT_GAP_PER_ADV_MIN_TIMEOUT

#define BT_GAP_PER_ADV_MIN_TIMEOUT   0x000A /* 100 ms */

#include <zephyr/bluetooth/gap.h>

Minimum Periodic Advertising Timeout (N * 10 ms)

◆ BT_GAP_PER_ADV_SLOW_INT_MAX

#define BT_GAP_PER_ADV_SLOW_INT_MAX   0x03C0 /* 1.2 s */

◆ BT_GAP_PER_ADV_SLOW_INT_MIN

#define BT_GAP_PER_ADV_SLOW_INT_MIN   0x0320 /* 1 s */

◆ BT_GAP_RSSI_INVALID

#define BT_GAP_RSSI_INVALID   0x7f

◆ BT_GAP_SCAN_FAST_INTERVAL

#define BT_GAP_SCAN_FAST_INTERVAL   0x0060 /* 60 ms */

◆ BT_GAP_SCAN_FAST_INTERVAL_MIN

#define BT_GAP_SCAN_FAST_INTERVAL_MIN   0x0030 /* 30 ms */

◆ BT_GAP_SCAN_FAST_WINDOW

#define BT_GAP_SCAN_FAST_WINDOW   0x0030 /* 30 ms */

◆ BT_GAP_SCAN_SLOW_INTERVAL_1

#define BT_GAP_SCAN_SLOW_INTERVAL_1   0x0800 /* 1.28 s */

◆ BT_GAP_SCAN_SLOW_INTERVAL_2

#define BT_GAP_SCAN_SLOW_INTERVAL_2   0x1000 /* 2.56 s */

◆ BT_GAP_SCAN_SLOW_WINDOW_1

#define BT_GAP_SCAN_SLOW_WINDOW_1   0x0012 /* 11.25 ms */

◆ BT_GAP_SCAN_SLOW_WINDOW_2

#define BT_GAP_SCAN_SLOW_WINDOW_2   0x0012 /* 11.25 ms */

◆ BT_GAP_SID_INVALID

#define BT_GAP_SID_INVALID   0xff

◆ BT_GAP_SID_MAX

#define BT_GAP_SID_MAX   0x0F

#include <zephyr/bluetooth/gap.h>

Maximum advertising set number.

◆ BT_GAP_SID_MIN

#define BT_GAP_SID_MIN   0x00

#include <zephyr/bluetooth/gap.h>

Minimum advertising set number.

◆ BT_GAP_TX_POWER_INVALID

#define BT_GAP_TX_POWER_INVALID   0x7f

◆ BT_GAP_US_TO_ADV_INTERVAL

#define BT_GAP_US_TO_ADV_INTERVAL ( _interval)

#include <zephyr/bluetooth/gap.h>

Value:
((uint16_t)((_interval) / 625U))

Convert microseconds to advertising interval units (0.625 ms)

Value range of _interval is 20000 to 1024000

Note
If _interval is not a multiple of the unit, it will round down to nearest. For example BT_GAP_US_TO_ADV_INTERVAL(21000) will become 20625 microseconds

◆ BT_GAP_US_TO_CONN_EVENT_LEN

#define BT_GAP_US_TO_CONN_EVENT_LEN ( _event_len)

#include <zephyr/bluetooth/gap.h>

Value:
((uint16_t)((_event_len) / 625U))

Convert milliseconds to connection event length units (0.625)

Value range of _event_len is 0 to 40959375

Note
If _event_len is not a multiple of the unit, it will round down to nearest. For example BT_GAP_US_TO_CONN_EVENT_LEN(21000) will become 20625 milliseconds

◆ BT_GAP_US_TO_CONN_INTERVAL

#define BT_GAP_US_TO_CONN_INTERVAL ( _interval)

#include <zephyr/bluetooth/gap.h>

Value:
((uint16_t)((_interval) / 1250U))

Convert microseconds to connection interval units (1.25 ms)

Value range of _interval is 7500 to 4000000

Note
If _interval is not a multiple of the unit, it will round down to nearest. For example BT_GAP_US_TO_CONN_INTERVAL(21000) will become 20000 microseconds

◆ BT_GAP_US_TO_CONN_TIMEOUT

#define BT_GAP_US_TO_CONN_TIMEOUT ( _timeout)

#include <zephyr/bluetooth/gap.h>

Value:
#define BT_GAP_MS_TO_CONN_TIMEOUT(_timeout)
Convert milliseconds to connection supervision timeout units (10 ms)
Definition gap.h:350

Convert microseconds to connection supervision timeout units (10 ms)

Value range of _timeout is 100000 to 32000000

Note
If _timeout is not a multiple of the unit, it will round down to nearest. For example BT_GAP_MS_TO_CONN_TIMEOUT(4005000) will become 4000000 microseconds

◆ BT_GAP_US_TO_PER_ADV_INTERVAL

#define BT_GAP_US_TO_PER_ADV_INTERVAL ( _interval)

#include <zephyr/bluetooth/gap.h>

Value:
((uint16_t)((_interval) / 1250U))

Convert microseconds to periodic advertising interval units (1.25 ms)

Value range of _interval is 7500 to 81918750

Note
If _interval is not a multiple of the unit, it will round down to nearest. For example BT_GAP_US_TO_PER_ADV_INTERVAL(11000) will become 10000 microseconds

◆ BT_GAP_US_TO_PER_ADV_SYNC_TIMEOUT

#define BT_GAP_US_TO_PER_ADV_SYNC_TIMEOUT ( _timeout)

#include <zephyr/bluetooth/gap.h>

Value:
#define BT_GAP_MS_TO_PER_ADV_SYNC_TIMEOUT(_timeout)
Convert milliseconds to periodic advertising sync timeout units (10 ms)
Definition gap.h:263

Convert microseconds to periodic advertising sync timeout units (10 ms)

Value range of _timeout is 100000 to 163840000

Note
If _timeout is not a multiple of the unit, it will round down to nearest. For example BT_GAP_MS_TO_PER_ADV_SYNC_TIMEOUT(4005000) will become 4000000 microseconds

◆ BT_GAP_US_TO_SCAN_INTERVAL

#define BT_GAP_US_TO_SCAN_INTERVAL ( _interval)

#include <zephyr/bluetooth/gap.h>

Value:
((uint16_t)((_interval) / 625U))

Convert microseconds to scan interval units (0.625 ms)

Value range of _interval is 2500 to 40959375 if CONFIG_BT_EXT_ADV else 2500 to 10240000

Note
If _interval is not a multiple of the unit, it will round down to nearest. For example BT_GAP_US_TO_SCAN_INTERVAL(21000) will become 20625 microseconds

◆ BT_GAP_US_TO_SCAN_WINDOW

#define BT_GAP_US_TO_SCAN_WINDOW ( _window)

#include <zephyr/bluetooth/gap.h>

Value:
((uint16_t)((_window) / 625U))

Convert microseconds to scan window units (0.625 ms)

Value range of _window is 2500 to 40959375 if CONFIG_BT_EXT_ADV else 2500 to 10240000

Note
If _window is not a multiple of the unit, it will round down to nearest. For example BT_GAP_US_TO_SCAN_WINDOW(21000) will become 20625 microseconds

◆ BT_LE_SUPP_FEAT_16_ENCODE

#define BT_LE_SUPP_FEAT_16_ENCODE ( w64)

#include <zephyr/bluetooth/gap.h>

Value:
#define BT_BYTES_LIST_LE16(_v)
Encode 16-bit value into array values in little-endian format.
Definition byteorder.h:36

Encode 2 least significant bytes of 64-bit LE Supported Features into 2 bytes long array of values in little-endian format.

Helper macro to encode 64-bit LE Supported Features value into advertising data. The macro encodes 3 least significant bytes into advertising data. Other 6 bytes are not encoded.

Example of how to encode the 0x000000DFF00DF00D into advertising data.

#define BT_DATA_LE_SUPPORTED_FEATURES
LE Supported Features.
Definition assigned_numbers.h:689
#define BT_LE_SUPP_FEAT_16_ENCODE(w64)
Encode 2 least significant bytes of 64-bit LE Supported Features into 2 bytes long array of values in...
Definition gap.h:489
#define BT_DATA_BYTES(_type, _bytes...)
Helper to declare elements of bt_data arrays.
Definition bluetooth.h:573
Parameters
w64LE Supported Features value (64-bits)
Returns
The comma separated values for LE Supported Features value that may be used directly as an argument for BT_DATA_BYTES.

◆ BT_LE_SUPP_FEAT_24_ENCODE

#define BT_LE_SUPP_FEAT_24_ENCODE ( w64)

#include <zephyr/bluetooth/gap.h>

Value:
#define BT_BYTES_LIST_LE24(_v)
Encode 24-bit value into array values in little-endian format.
Definition byteorder.h:50

Encode 3 least significant bytes of 64-bit LE Supported Features into 3 bytes long array of values in little-endian format.

Helper macro to encode 64-bit LE Supported Features value into advertising data. The macro encodes 3 least significant bytes into advertising data. Other 5 bytes are not encoded.

Example of how to encode the 0x000000DFF00DF00D into advertising data.

#define BT_LE_SUPP_FEAT_24_ENCODE(w64)
Encode 3 least significant bytes of 64-bit LE Supported Features into 3 bytes long array of values in...
Definition gap.h:468
Parameters
w64LE Supported Features value (64-bits)
Returns
The comma separated values for LE Supported Features value that may be used directly as an argument for BT_DATA_BYTES.

◆ BT_LE_SUPP_FEAT_32_ENCODE

#define BT_LE_SUPP_FEAT_32_ENCODE ( w64)

#include <zephyr/bluetooth/gap.h>

Value:
#define BT_BYTES_LIST_LE32(_v)
Encode 32-bit value into array values in little-endian format.
Definition byteorder.h:64

Encode 4 least significant bytes of 64-bit LE Supported Features into 4 bytes long array of values in little-endian format.

Helper macro to encode 64-bit LE Supported Features value into advertising data. The macro encodes 4 least significant bytes into advertising data. Other 4 bytes are not encoded.

Example of how to encode the 0x000000DFF00DF00D into advertising data.

#define BT_LE_SUPP_FEAT_32_ENCODE(w64)
Encode 4 least significant bytes of 64-bit LE Supported Features into 4 bytes long array of values in...
Definition gap.h:447
Parameters
w64LE Supported Features value (64-bits)
Returns
The comma separated values for LE Supported Features value that may be used directly as an argument for BT_DATA_BYTES.

◆ BT_LE_SUPP_FEAT_40_ENCODE

#define BT_LE_SUPP_FEAT_40_ENCODE ( w64)

#include <zephyr/bluetooth/gap.h>

Value:
#define BT_BYTES_LIST_LE40(_v)
Encode 40-bit value into array values in little-endian format.
Definition byteorder.h:78

Encode 40 least significant bits of 64-bit LE Supported Features into array values in little-endian format.

Helper macro to encode 40 least significant bits of 64-bit LE Supported Features value into advertising data. The number of bits that are encoded is a number of LE Supported Features defined by BT 5.3 Core specification.

Example of how to encode the 0x000000DFF00DF00D into advertising data.

#define BT_LE_SUPP_FEAT_40_ENCODE(w64)
Encode 40 least significant bits of 64-bit LE Supported Features into array values in little-endian f...
Definition gap.h:427
Parameters
w64LE Supported Features value (64-bits)
Returns
The comma separated values for LE Supported Features value that may be used directly as an argument for BT_DATA_BYTES.

◆ BT_LE_SUPP_FEAT_8_ENCODE

#define BT_LE_SUPP_FEAT_8_ENCODE ( w64)

#include <zephyr/bluetooth/gap.h>

Value:
(((w64) >> 0) & 0xFF)

Encode the least significant byte of 64-bit LE Supported Features into single byte long array.

Helper macro to encode 64-bit LE Supported Features value into advertising data. The macro encodes the least significant byte into advertising data. Other 7 bytes are not encoded.

Example of how to encode the 0x000000DFF00DF00D into advertising data.

#define BT_LE_SUPP_FEAT_8_ENCODE(w64)
Encode the least significant byte of 64-bit LE Supported Features into single byte long array.
Definition gap.h:510
Parameters
w64LE Supported Features value (64-bits)
Returns
The value of least significant byte of LE Supported Features value that may be used directly as an argument for BT_DATA_BYTES.

◆ BT_LE_SUPP_FEAT_VALIDATE

#define BT_LE_SUPP_FEAT_VALIDATE ( w64)

#include <zephyr/bluetooth/gap.h>

Value:
BUILD_ASSERT(!((w64) & (~BIT64_MASK(40))), \
"RFU bit in LE Supported Features are not zeros.")
#define BIT64_MASK(n)
64-bit bit mask with bits 0 through n-1 (inclusive) set, or 0 if n is 0.
Definition util_macro.h:74
#define BUILD_ASSERT(EXPR, MSG...)
Definition llvm.h:51

Validate whether LE Supported Features value does not use bits that are reserved for future use.

Helper macro to check if w64 has zeros as bits 40-63. The macro is compliant with BT 5.3 Core Specification where bits 0-40 has assigned values. In case of invalid value, build time error is reported.

Enumeration Type Documentation

◆ bt_gap_adv_prop

#include <zephyr/bluetooth/gap.h>

Advertising PDU properties.

Enumerator
BT_GAP_ADV_PROP_CONNECTABLE 

Connectable advertising.

BT_GAP_ADV_PROP_SCANNABLE 

Scannable advertising.

BT_GAP_ADV_PROP_DIRECTED 

Directed advertising.

BT_GAP_ADV_PROP_SCAN_RESPONSE 

Additional advertising data requested by an active scanner.

BT_GAP_ADV_PROP_EXT_ADV 

Extended advertising.

◆ bt_gap_adv_type

#include <zephyr/bluetooth/gap.h>

Advertising PDU types.

Enumerator
BT_GAP_ADV_TYPE_ADV_IND 

Scannable and connectable advertising.

BT_GAP_ADV_TYPE_ADV_DIRECT_IND 

Directed connectable advertising.

BT_GAP_ADV_TYPE_ADV_SCAN_IND 

Non-connectable and scannable advertising.

BT_GAP_ADV_TYPE_ADV_NONCONN_IND 

Non-connectable and non-scannable advertising.

BT_GAP_ADV_TYPE_SCAN_RSP 

Additional advertising data requested by an active scanner.

BT_GAP_ADV_TYPE_EXT_ADV 

Extended advertising, see advertising properties.

◆ bt_gap_cte

enum bt_gap_cte

#include <zephyr/bluetooth/gap.h>

Constant Tone Extension (CTE) types.

Enumerator
BT_GAP_CTE_AOA 

Angle of Arrival.

BT_GAP_CTE_AOD_1US 

Angle of Departure with 1 us slots.

BT_GAP_CTE_AOD_2US 

Angle of Departure with 2 us slots.

BT_GAP_CTE_NONE 

No extensions.

◆ bt_gap_le_phy

#include <zephyr/bluetooth/gap.h>

LE PHY types.

Enumerator
BT_GAP_LE_PHY_NONE 

Convenience macro for when no PHY is set.

BT_GAP_LE_PHY_1M 

LE 1M PHY.

BT_GAP_LE_PHY_2M 

LE 2M PHY.

BT_GAP_LE_PHY_CODED 

LE Coded PHY, coding scheme not specified.

BT_GAP_LE_PHY_CODED_S8 

LE Coded S=8 PHY.

Only used for advertising reports when Kconfig BT_EXT_ADV_CODING_SELECTION is enabled.

BT_GAP_LE_PHY_CODED_S2 

LE Coded S=2 PHY.

Only used for advertising reports when Kconfig BT_EXT_ADV_CODING_SELECTION is enabled.

◆ bt_gap_sca

enum bt_gap_sca

#include <zephyr/bluetooth/gap.h>

Peripheral sleep clock accuracy (SCA) in ppm (parts per million)

Enumerator
BT_GAP_SCA_UNKNOWN 

Unknown.

BT_GAP_SCA_251_500 

251 ppm to 500 ppm

BT_GAP_SCA_151_250 

151 ppm to 250 ppm

BT_GAP_SCA_101_150 

101 ppm to 150 ppm

BT_GAP_SCA_76_100 

76 ppm to 100 ppm

BT_GAP_SCA_51_75 

51 ppm to 75 ppm

BT_GAP_SCA_31_50 

31 ppm to 50 ppm

BT_GAP_SCA_21_30 

21 ppm to 30 ppm

BT_GAP_SCA_0_20 

0 ppm to 20 ppm