Zephyr Project
A Scalable Open Source RTOS for IoT Embedded Devices
gap.h
Go to the documentation of this file.
1 
5 /*
6  * Copyright (c) 2019 Nordic Semiconductor ASA
7  *
8  * SPDX-License-Identifier: Apache-2.0
9  */
10 
11 #ifndef ZEPHYR_INCLUDE_BLUETOOTH_GAP_H_
12 #define ZEPHYR_INCLUDE_BLUETOOTH_GAP_H_
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
26 #define BT_COMP_ID_LF 0x05f1 /* The Linux Foundation */
27 
29 #define BT_DATA_FLAGS 0x01 /* AD flags */
30 #define BT_DATA_UUID16_SOME 0x02 /* 16-bit UUID, more available */
31 #define BT_DATA_UUID16_ALL 0x03 /* 16-bit UUID, all listed */
32 #define BT_DATA_UUID32_SOME 0x04 /* 32-bit UUID, more available */
33 #define BT_DATA_UUID32_ALL 0x05 /* 32-bit UUID, all listed */
34 #define BT_DATA_UUID128_SOME 0x06 /* 128-bit UUID, more available */
35 #define BT_DATA_UUID128_ALL 0x07 /* 128-bit UUID, all listed */
36 #define BT_DATA_NAME_SHORTENED 0x08 /* Shortened name */
37 #define BT_DATA_NAME_COMPLETE 0x09 /* Complete name */
38 #define BT_DATA_TX_POWER 0x0a /* Tx Power */
39 #define BT_DATA_SM_TK_VALUE 0x10 /* Security Manager TK Value */
40 #define BT_DATA_SM_OOB_FLAGS 0x11 /* Security Manager OOB Flags */
41 #define BT_DATA_SOLICIT16 0x14 /* Solicit UUIDs, 16-bit */
42 #define BT_DATA_SOLICIT128 0x15 /* Solicit UUIDs, 128-bit */
43 #define BT_DATA_SVC_DATA16 0x16 /* Service data, 16-bit UUID */
44 #define BT_DATA_GAP_APPEARANCE 0x19 /* GAP appearance */
45 #define BT_DATA_LE_BT_DEVICE_ADDRESS 0x1b /* LE Bluetooth Device Address */
46 #define BT_DATA_LE_ROLE 0x1c /* LE Role */
47 #define BT_DATA_SOLICIT32 0x1f /* Solicit UUIDs, 32-bit */
48 #define BT_DATA_SVC_DATA32 0x20 /* Service data, 32-bit UUID */
49 #define BT_DATA_SVC_DATA128 0x21 /* Service data, 128-bit UUID */
50 #define BT_DATA_LE_SC_CONFIRM_VALUE 0x22 /* LE SC Confirmation Value */
51 #define BT_DATA_LE_SC_RANDOM_VALUE 0x23 /* LE SC Random Value */
52 #define BT_DATA_URI 0x24 /* URI */
53 #define BT_DATA_MESH_PROV 0x29 /* Mesh Provisioning PDU */
54 #define BT_DATA_MESH_MESSAGE 0x2a /* Mesh Networking PDU */
55 #define BT_DATA_MESH_BEACON 0x2b /* Mesh Beacon */
56 #define BT_DATA_BIG_INFO 0x2c /* BIGInfo */
57 #define BT_DATA_BROADCAST_CODE 0x2d /* Broadcast Code */
58 
59 #define BT_DATA_MANUFACTURER_DATA 0xff /* Manufacturer Specific Data */
60 
61 #define BT_LE_AD_LIMITED 0x01 /* Limited Discoverable */
62 #define BT_LE_AD_GENERAL 0x02 /* General Discoverable */
63 #define BT_LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */
64 
65 /* Defined GAP timers */
66 #define BT_GAP_SCAN_FAST_INTERVAL 0x0060 /* 60 ms */
67 #define BT_GAP_SCAN_FAST_WINDOW 0x0030 /* 30 ms */
68 #define BT_GAP_SCAN_SLOW_INTERVAL_1 0x0800 /* 1.28 s */
69 #define BT_GAP_SCAN_SLOW_WINDOW_1 0x0012 /* 11.25 ms */
70 #define BT_GAP_SCAN_SLOW_INTERVAL_2 0x1000 /* 2.56 s */
71 #define BT_GAP_SCAN_SLOW_WINDOW_2 0x0012 /* 11.25 ms */
72 #define BT_GAP_ADV_FAST_INT_MIN_1 0x0030 /* 30 ms */
73 #define BT_GAP_ADV_FAST_INT_MAX_1 0x0060 /* 60 ms */
74 #define BT_GAP_ADV_FAST_INT_MIN_2 0x00a0 /* 100 ms */
75 #define BT_GAP_ADV_FAST_INT_MAX_2 0x00f0 /* 150 ms */
76 #define BT_GAP_ADV_SLOW_INT_MIN 0x0640 /* 1 s */
77 #define BT_GAP_ADV_SLOW_INT_MAX 0x0780 /* 1.2 s */
78 #define BT_GAP_INIT_CONN_INT_MIN 0x0018 /* 30 ms */
79 #define BT_GAP_INIT_CONN_INT_MAX 0x0028 /* 50 ms */
80 
82 enum {
91 };
92 
94 enum {
107 };
108 
110 enum {
121 };
122 
124 #define BT_GAP_ADV_MAX_ADV_DATA_LEN 31
125 
130 #define BT_GAP_ADV_MAX_EXT_ADV_DATA_LEN 1650
131 
132 #define BT_GAP_TX_POWER_INVALID 0x7f
133 #define BT_GAP_RSSI_INVALID 0x7f
134 #define BT_GAP_SID_INVALID 0xff
135 #define BT_GAP_NO_TIMEOUT 0x0000
136 
137 /* The maximum allowed high duty cycle directed advertising timeout, 1.28
138  * seconds in 10 ms unit.
139  */
140 #define BT_GAP_ADV_HIGH_DUTY_CYCLE_MAX_TIMEOUT 128
141 
142 #define BT_GAP_DATA_LEN_DEFAULT 0x001b /* 27 bytes */
143 #define BT_GAP_DATA_LEN_MAX 0x00fb /* 251 bytes */
144 
145 #define BT_GAP_DATA_TIME_DEFAULT 0x0148 /* 328 us */
146 #define BT_GAP_DATA_TIME_MAX 0x4290 /* 17040 us */
147 
148 #define BT_GAP_SID_MAX 0x0F
149 #define BT_GAP_PER_ADV_MAX_SKIP 0x01F3
150 #define BT_GAP_PER_ADV_MIN_TIMEOUT 0x000A
151 #define BT_GAP_PER_ADV_MAX_TIMEOUT 0x4000
152 
153 #define BT_GAP_PER_ADV_MIN_INTERVAL 0x0006
154 
155 #define BT_GAP_PER_ADV_MAX_INTERVAL 0xFFFF
156 
157 
159 enum {
168 };
169 
170 
172 enum {
182 };
183 
188 #ifdef __cplusplus
189 }
190 #endif
191 
192 #endif /* ZEPHYR_INCLUDE_BLUETOOTH_GAP_H_ */
BT_GAP_ADV_TYPE_EXT_ADV
@ BT_GAP_ADV_TYPE_EXT_ADV
Definition: gap.h:106
BT_GAP_ADV_TYPE_SCAN_RSP
@ BT_GAP_ADV_TYPE_SCAN_RSP
Definition: gap.h:104
BT_GAP_SCA_151_250
@ BT_GAP_SCA_151_250
Definition: gap.h:175
BT_GAP_SCA_UNKNOWN
@ BT_GAP_SCA_UNKNOWN
Definition: gap.h:173
BT_GAP_SCA_101_150
@ BT_GAP_SCA_101_150
Definition: gap.h:176
BT_GAP_ADV_PROP_SCAN_RESPONSE
@ BT_GAP_ADV_PROP_SCAN_RESPONSE
Definition: gap.h:118
BT_GAP_SCA_251_500
@ BT_GAP_SCA_251_500
Definition: gap.h:174
BT_GAP_CTE_AOA
@ BT_GAP_CTE_AOA
Definition: gap.h:161
BT_GAP_SCA_21_30
@ BT_GAP_SCA_21_30
Definition: gap.h:180
BT_GAP_LE_PHY_CODED
@ BT_GAP_LE_PHY_CODED
Definition: gap.h:90
BT_GAP_ADV_TYPE_ADV_SCAN_IND
@ BT_GAP_ADV_TYPE_ADV_SCAN_IND
Definition: gap.h:100
BT_GAP_SCA_0_20
@ BT_GAP_SCA_0_20
Definition: gap.h:181
BT_GAP_ADV_TYPE_ADV_DIRECT_IND
@ BT_GAP_ADV_TYPE_ADV_DIRECT_IND
Definition: gap.h:98
BT_GAP_CTE_AOD_1US
@ BT_GAP_CTE_AOD_1US
Definition: gap.h:163
BT_GAP_CTE_NONE
@ BT_GAP_CTE_NONE
Definition: gap.h:167
BT_GAP_SCA_51_75
@ BT_GAP_SCA_51_75
Definition: gap.h:178
BIT
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition: util.h:316
BT_GAP_SCA_76_100
@ BT_GAP_SCA_76_100
Definition: gap.h:177
BT_GAP_ADV_PROP_CONNECTABLE
@ BT_GAP_ADV_PROP_CONNECTABLE
Definition: gap.h:112
BT_GAP_ADV_TYPE_ADV_NONCONN_IND
@ BT_GAP_ADV_TYPE_ADV_NONCONN_IND
Definition: gap.h:102
BT_GAP_ADV_TYPE_ADV_IND
@ BT_GAP_ADV_TYPE_ADV_IND
Definition: gap.h:96
BT_GAP_ADV_PROP_DIRECTED
@ BT_GAP_ADV_PROP_DIRECTED
Definition: gap.h:116
BT_GAP_ADV_PROP_SCANNABLE
@ BT_GAP_ADV_PROP_SCANNABLE
Definition: gap.h:114
BT_GAP_ADV_PROP_EXT_ADV
@ BT_GAP_ADV_PROP_EXT_ADV
Definition: gap.h:120
BT_GAP_SCA_31_50
@ BT_GAP_SCA_31_50
Definition: gap.h:179
BT_GAP_LE_PHY_NONE
@ BT_GAP_LE_PHY_NONE
Definition: gap.h:84
BT_GAP_CTE_AOD_2US
@ BT_GAP_CTE_AOD_2US
Definition: gap.h:165
BT_GAP_LE_PHY_1M
@ BT_GAP_LE_PHY_1M
Definition: gap.h:86
BT_GAP_LE_PHY_2M
@ BT_GAP_LE_PHY_2M
Definition: gap.h:88