Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
gap.h File Reference

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

Go to the source code of this file.

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.
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 */

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...

Detailed Description

Bluetooth Generic Access Profile defines and Assigned Numbers.