ble_gapm.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file ble_gapm.h
5 *
6 * @brief BLE GAPM API
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 *****************************************************************************************
36 */
37
38 /**
39 * @addtogroup BLE
40 * @{
41 * @brief Definitions and prototypes for the BLE SDK interface.
42 */
43
44 /**
45 * @addtogroup BLE_GAP Generic Access Profile (GAP)
46 * @{
47 * @brief Definitions and prototypes for the GAP interface.
48 */
49
50 #ifndef __BLE_GAPM_H__
51 #define __BLE_GAPM_H__
52
53 /*
54 * INCLUDE FILES
55 ****************************************************************************************
56 */
57 #include "ble_error.h"
58 #include "ble_gapc.h"
59 #include <stdint.h> // standard definitions
60 #include <stddef.h> // standard definitions
61
62
63 /**
64 @addtogroup BLE_GAPM Generic Access Profile (GAP) Management
65 @{
66 @brief Definitions and prototypes for the GAP Management interface.
67 */
68
69 /** @addtogroup BLE_GAPM_DEFINES Defines
70 * @{ */
71
72 #define CO_BIT(pos)(1UL<<(pos)) /**< Bit operation helper. */
73 #define MAX_ADV_NUM 5 /**< Maximal advertising instance number. */
74 #define MAX_PER_SYNC_NUM 5 /**< Maximal periodic syncronization instance number. */
75 #define MAX_BOND_NUM 10 /**< Maximal bonding number. */
76 #define MAX_WL_NUM 10 /**< Maximal white list number. */
77
78 #define MAX_PRD_ADV_NUM 4 /**< Maximal periodic advertising list number. */
79 #define MAX_KEY_LEN 16 /**< The key length. */
80 #define INVALID_ADV_IDX 0xFF /**< Invalid adv index. */
81 #define BLE_GAP_DEVNAME_DEFAULT "GOODIX_BLE" /**< Default device name value. */
82 #define BLE_GAP_DEVNAME_MAX_LEN 248 /**< Maximal length of device name. */
83
84 #define BLE_APPEARANCE_UNKNOWN 0 /**< Unknown. */
85 #define BLE_APPEARANCE_GENERIC_PHONE 64 /**< Generic Phone. */
86 #define BLE_APPEARANCE_GENERIC_COMPUTER 128 /**< Generic Computer. */
87 #define BLE_APPEARANCE_GENERIC_WATCH 192 /**< Generic Watch. */
88 #define BLE_APPEARANCE_WATCH_SPORTS_WATCH 193 /**< Watch: Sports Watch. */
89 #define BLE_APPEARANCE_GENERIC_CLOCK 256 /**< Generic Clock. */
90 #define BLE_APPEARANCE_GENERIC_DISPLAY 320 /**< Generic Display. */
91 #define BLE_APPEARANCE_GENERIC_REMOTE_CONTROL 384 /**< Generic Remote Control. */
92 #define BLE_APPEARANCE_GENERIC_EYE_GLASSES 448 /**< Generic Eye-glasses. */
93 #define BLE_APPEARANCE_GENERIC_TAG 512 /**< Generic Tag. */
94 #define BLE_APPEARANCE_GENERIC_KEYRING 576 /**< Generic Keyring. */
95 #define BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 640 /**< Generic Media Player. */
96 #define BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 704 /**< Generic Barcode Scanner. */
97 #define BLE_APPEARANCE_GENERIC_THERMOMETER 768 /**< Generic Thermometer. */
98 #define BLE_APPEARANCE_THERMOMETER_EAR 769 /**< Thermometer: Ear. */
99 #define BLE_APPEARANCE_GENERIC_HEART_RATE_SENSOR 832 /**< Generic Heart Rate Sensor. */
100 #define BLE_APPEARANCE_HEART_RATE_SENSOR_HEART_RATE_BELT 833 /**< Heart Rate Sensor: Heart Rate Belt. */
101 #define BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 896 /**< Generic Blood Pressure. */
102 #define BLE_APPEARANCE_BLOOD_PRESSURE_ARM 897 /**< Blood Pressure: Arm. */
103 #define BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 898 /**< Blood Pressure: Wrist. */
104 #define BLE_APPEARANCE_GENERIC_HID 960 /**< Human Interface Device (HID). */
105 #define BLE_APPEARANCE_HID_KEYBOARD 961 /**< Keyboard (HID Subtype). */
106 #define BLE_APPEARANCE_HID_MOUSE 962 /**< Mouse (HID Subtype). */
107 #define BLE_APPEARANCE_HID_JOYSTICK 963 /**< Joystick (HID Subtype). */
108 #define BLE_APPEARANCE_HID_GAMEPAD 964 /**< Gamepad (HID Subtype). */
109 #define BLE_APPEARANCE_HID_DIGITIZERSUBTYPE 965 /**< Digitizer Tablet (HID Subtype). */
110 #define BLE_APPEARANCE_HID_CARD_READER 966 /**< Card Reader (HID Subtype). */
111 #define BLE_APPEARANCE_HID_DIGITAL_PEN 967 /**< Digital Pen (HID Subtype). */
112 #define BLE_APPEARANCE_HID_BARCODE 968 /**< Barcode Scanner (HID Subtype). */
113 #define BLE_APPEARANCE_GENERIC_GLUCOSE_METER 1024 /**< Generic Glucose Meter. */
114 #define BLE_APPEARANCE_GENERIC_RUNNING_WALKING_SENSOR 1088 /**< Generic Running Walking Sensor. */
115 #define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_IN_SHOE 1089 /**< Running Walking Sensor: In-Shoe. */
116 #define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_SHOE 1090 /**< Running Walking Sensor: On-Shoe. */
117 #define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_HIP 1091 /**< Running Walking Sensor: On-Hip. */
118 #define BLE_APPEARANCE_GENERIC_CYCLING 1152 /**< Generic Cycling. */
119 #define BLE_APPEARANCE_CYCLING_CYCLING_COMPUTER 1153 /**< Cycling: Cycling Computer. */
120 #define BLE_APPEARANCE_CYCLING_SPEED_SENSOR 1154 /**< Cycling: Speed Sensor. */
121 #define BLE_APPEARANCE_CYCLING_CADENCE_SENSOR 1155 /**< Cycling: Cadence Sensor. */
122 #define BLE_APPEARANCE_CYCLING_POWER_SENSOR 1156 /**< Cycling: Power Sensor. */
123 #define BLE_APPEARANCE_CYCLING_SPEED_CADENCE_SENSOR 1157 /**< Cycling: Speed and Cadence Sensor. */
124 #define BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 3136 /**< Generic Pulse Oximeter. */
125 #define BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 3137 /**< Fingertip (Pulse Oximeter subtype). */
126 #define BLE_APPEARANCE_PULSE_OXIMETER_WRIST_WORN 3138 /**< Wrist Worn(Pulse Oximeter subtype). */
127 #define BLE_APPEARANCE_GENERIC_WEIGHT_SCALE 3200 /**< Generic Weight Scale. */
128 #define BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS_ACT 5184 /**< Generic Outdoor Sports Activity. */
129 #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_DISP 5185 /**< Location Display Device (Outdoor Sports Activity subtype). */
130 #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_DISP 5186 /**< Location and Navigation Display Device (Outdoor Sports Activity subtype). */
131 #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_POD 5187 /**< Location Pod (Outdoor Sports Activity subtype). */
132 #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_POD 5188 /**< Location and Navigation Pod (Outdoor Sports Activity subtype). */
133
134 /**@defgroup BLE_GAP_PHYS GAP PHYs (bitmask)
135 * @{ */
136 #define BLE_GAP_PHY_ANY 0x00 /**< No preferred PHY. */
137 #define BLE_GAP_PHY_LE_1MBPS (1 << 0) /**< LE 1M PHY preferred for an active link. */
138 #define BLE_GAP_PHY_LE_2MBPS (1 << 1) /**< LE 2M PHY preferred for an active link. */
139 #define BLE_GAP_PHY_LE_CODED (1 << 2) /**< LE Coded PHY preferred for an active link. */
140 /**@} */
141
142
143 /**@defgroup BLE_GAP_ADV_CHANNEL GAP ADV CHANNEL (bitmask)
144 * @{ */
145 #define GAP_ADV_CHANNEL_37 0x01 /**< Advertising Channel 37 (2402MHz). */
146 #define GAP_ADV_CHANNEL_38 0x02 /**< Advertising Channel 38 (2426MHz). */
147 #define GAP_ADV_CHANNEL_39 0x04 /**< Advertising Channel 39 (2480MHz). */
148 #define GAP_ADV_CHANNEL_37_38_39 0x07 /**< Advertising Channel 37, 38, 39. */
149 /**@} */
150 /**@} */
151
152 /** @addtogroup BLE_GAPM_ENUMERATIONS Enumerations
153 * @{ */
154 /**
155 * @brief GAP role options
156 */
157 typedef enum
158 {
159 BLE_GAP_ROLE_NONE = 0x00, /**< No role set yet. */
160 BLE_GAP_ROLE_OBSERVER = 0x01, /**< Observer role. */
161 BLE_GAP_ROLE_BROADCASTER = 0x02, /**< Broadcaster role. */
162 BLE_GAP_ROLE_CENTRAL = (0x04 | BLE_GAP_ROLE_OBSERVER), /**< Master/Central role. */
163 BLE_GAP_ROLE_PERIPHERAL = (0x08 | BLE_GAP_ROLE_BROADCASTER), /**< Peripheral/Slave role. */
164 BLE_GAP_ROLE_ALL = (BLE_GAP_ROLE_CENTRAL | BLE_GAP_ROLE_PERIPHERAL), /**< Device has all roles, both peripheral and central. */
165 } gap_role_t;
166
167 /**
168 * @brief Own BD address source of the device
169 */
170 typedef enum
171 {
172 BLE_GAP_OWN_ADDR_STATIC = 0, /**< Public or Private Static Address according to device address configuration. */
173 BLE_GAP_OWN_ADDR_GEN_RSLV, /**< Generated resolvable private random address. */
174 BLE_GAP_OWN_ADDR_GEN_NON_RSLV, /**< Generated non-resolvable private random address. */
175 } gap_own_addr_t;
176
177 /**
178 * @brief Write permissions of the device name characteristic
179 */
180 typedef enum
181 {
182 BLE_GAP_WRITE_PERM_DISABLE = 0, /**< Disable write access. */
183 BLE_GAP_WRITE_PERM_NOAUTH, /**< LE Security Mode 1, Level 1. Link does not need to be encrypted or authenticated. */
184 BLE_GAP_WRITE_PERM_UNAUTH, /**< LE Security Mode 1, Level 2. Link needs to be encrypted, but not to be authenticated. */
185 BLE_GAP_WRITE_PERM_AUTH, /**< LE Security Mode 1, Level 3. Link needs to be encrypted and authenticated (MITM). */
186 BLE_GAP_WRITE_PERM_SEC_CON, /**< LE Security Mode 1, Level 4. Link needs to be encrypted and authenticated (secure connections). */
187 } gap_dev_name_write_perm_t;
188
189 /**
190 * @brief Advertising data type
191 */
192 typedef enum
193 {
194 BLE_GAP_ADV_DATA_TYPE_DATA = 0, /**< Advertising data. */
195 BLE_GAP_ADV_DATA_TYPE_SCAN_RSP, /**< Scan response data. */
196 BLE_GAP_ADV_DATA_TYPE_PER_DATA, /**< Periodic advertising data. */
197 } gap_adv_data_type_t;
198
199
200 /**@brief Get device parameters operation code. */
201 typedef enum
202 {
203 BLE_GAP_GET_DEV_VERSION = 0, /**< Get version information for the local Controller. */
204 BLE_GAP_GET_DEV_BDADDR, /**< Get local device BD Address. */
205 //BLE_GAP_GET_DEV_ADV_TX_POWER, /**< Get the transmit power level used for LE advertising channel packets. */
206 BLE_GAP_GET_SUGGESTED_DFLT_LE_DATA_LEN, /**< Get suggested values (SuggestedMaxTxOctets and SuggestedMaxTxTime)
207 for the Controller's maximum transmitted number of payload octets
208 and maximum packet transmission time to be used for new connections. */
209 BLE_GAP_GET_MAX_LE_DATA_LEN, /**< Get the Controller' maximum supported payload octets and packet duration
210 times for transmission and reception (supportedMaxTxOctets and supportedMaxTxTime,
211 supportedMaxRxOctets, and supportedMaxRxTime). */
212 BLE_GAP_GET_NB_ADV_SETS, /**< Read the maximum number of advertising sets currently supported by the controller. */
213 BLE_GAP_GET_MAX_LE_ADV_DATA_LEN, /**< Get maximum data length for advertising data. */
214 BLE_GAP_GET_DEV_TX_POWER, /**< Read the minimum and maximum transmit powers supported by the Controller. */
215 BLE_GAP_GET_DEV_RF_RF_PATH_COMP, /**< Get RF path compensation values. */
216 } gap_dev_info_get_type_t;
217
218 /**@brief GAP advertising modes. */
219 typedef enum
220 {
221 GAP_ADV_TYPE_ADV_IND = 0, /**< Undirected connectable and scannable mode. */
222 GAP_ADV_TYPE_ADV_NONCONN_IND, /**< Non-connectable and non-scanable mode. */
223 GAP_ADV_TYPE_ADV_SCAN_IND, /**< Undirected scannable mode. */
224 GAP_ADV_TYPE_ADV_HIGH_DIRECT_IND, /**< Directed high duty cycle mode. */
225 GAP_ADV_TYPE_ADV_LOW_DIRECT_IND, /**< Directed low duty cycle mode. */
226 } gap_adv_mode_t;
227
228 /**@brief GAP discoverability modes. */
229 typedef enum
230 {
231 GAP_DISC_MODE_NON_DISCOVERABLE = 0, /**< Non-discoverable mode. */
232 GAP_DISC_MODE_GEN_DISCOVERABLE, /**< General-discoverable mode. */
233 GAP_DISC_MODE_LIM_DISCOVERABLE, /**< Limited-discoverable mode. */
234 GAP_DISC_MODE_BROADCASTER, /**< Broadcaster mode. */
235 } gap_disc_mode_t;
236
237 /**
238 * @brief Advertising filter policy
239 */
240 typedef enum
241 {
242 GAP_ADV_ALLOW_SCAN_ANY_CON_ANY = 0, /**< Allow both scan and connection requests from anyone. */
243 GAP_ADV_ALLOW_SCAN_WLST_CON_ANY, /**< Allow scan req from white-list devices only and connection req from anyone. */
244 GAP_ADV_ALLOW_SCAN_ANY_CON_WLST, /**< Allow scan req from anyone and connection req from white-list devices only. */
245 GAP_ADV_ALLOW_SCAN_WLST_CON_WLST, /**< Allow scan and connection requests from white-list devices only. */
246 } gap_adv_filter_policy_t;
247
248 /**
249 * @brief Specify what PHY the Controller has changed for TX/RX. HCI:7.7.65.12
250 */
251 typedef enum
252 {
253 GAP_PHY_UNDEF_VALUE = 0, /**< Undefined LE PHY. */
254 GAP_PHY_1MBPS_VALUE = 1, /**< LE 1M PHY. */
255 GAP_PHY_2MBPS_VALUE = 2, /**< LE 2M PHY. */
256 GAP_PHY_CODED_VALUE = 3, /**< LE Coded PHY. */
257 } gap_le_phy_value_t;
258
259 /**
260 * @brief Advertising type
261 */
262 typedef enum
263 {
264 GAP_ADV_TYPE_LEGACY = 0, /**< Legacy advertising. */
265 GAP_ADV_TYPE_EXTENDED, /**< Extended advertising. */
266 GAP_ADV_TYPE_PERIODIC, /**< Periodic advertising. */
267 } gap_adv_type_t;
268
269 /**
270 * @brief Advertising properties bit field and bit positions
271 */
272 typedef enum
273 {
274 GAP_ADV_PROP_CONNECTABLE_POS = 0, /**< Indicate that advertising is connectable, reception of CONNECT_REQ or
275 UX_CONNECT_REQ PDUs is accepted. Not applicable for periodic advertising. */
276 GAP_ADV_PROP_SCANNABLE_POS, /**< Indicate that advertising is scannable, reception of SCAN_REQ or AUX_SCAN_REQ PDUs is accepted. */
277 GAP_ADV_PROP_DIRECTED_POS, /**< Indicate that advertising targets at a specific device. Only applicable in following cases:
278 - Legacy advertising: if connectable
279 - Extended advertising: connectable or (non-connectable and non-discoverable). */
280 GAP_ADV_PROP_HDC_POS, /**< Indicate that High Duty Cycle has to be used for advertising on primary channel,
281 applicable only if created advertising is not an extended advertising. */
282 GAP_ADV_PROP_USE_LEGACY_PDUS_POS, /**< Use legacy advertising PDUs. */
283 GAP_ADV_PROP_ANONYMOUS_POS, /**< Enable anonymous mode. Device address will not appear in sending PDUs.
284 Valid only if the created advertising is an extended advertising. */
285 GAP_ADV_PROP_TX_PWR_POS, /**< Include TX power in the extended header of the advertising PDU.
286 Valid only if the created advertising is not a legacy advertising. */
287 GAP_ADV_PROP_PER_TX_PWR_POS, /**< Include TX power in the periodic advertising PDU.
288 Valid only if the created advertising is a periodic advertising. */
289 GAP_ADV_PROP_SCAN_REQ_NTF_EN_POS, /**< Indicate if application must be informed about receiving scan request PDUs. */
290 } gap_adv_prop_pos_t;
291
292 /**
293 * @brief Advertising properties bit field bit value
294 */
295 typedef enum
296 {
297 GAP_ADV_PROP_CONNECTABLE_BIT = CO_BIT(GAP_ADV_PROP_CONNECTABLE_POS),
298 GAP_ADV_PROP_SCANNABLE_BIT = CO_BIT(GAP_ADV_PROP_SCANNABLE_POS),
299 GAP_ADV_PROP_DIRECTED_BIT = CO_BIT(GAP_ADV_PROP_DIRECTED_POS),
300 GAP_ADV_PROP_HDC_BIT = CO_BIT(GAP_ADV_PROP_HDC_POS),
301 GAP_ADV_PROP_USE_LEGACY_PDUS_BIT = CO_BIT(GAP_ADV_PROP_USE_LEGACY_PDUS_POS),
302 GAP_ADV_PROP_ANONYMOUS_BIT = CO_BIT(GAP_ADV_PROP_ANONYMOUS_POS),
303 GAP_ADV_PROP_TX_PWR_BIT = CO_BIT(GAP_ADV_PROP_TX_PWR_POS),
304 GAP_ADV_PROP_PER_TX_PWR_BIT = CO_BIT(GAP_ADV_PROP_PER_TX_PWR_POS),
305 GAP_ADV_PROP_SCAN_REQ_NTF_EN_BIT = CO_BIT(GAP_ADV_PROP_SCAN_REQ_NTF_EN_POS),
306 } gap_adv_prop_t;
307
308 /**
309 * @brief Scanning types
310 */
311 typedef enum
312 {
313 GAP_SCAN_ACTIVE = 0, /**< Active scan type. */
314 GAP_SCAN_PASSIVE, /**< Passive scan type. */
315 } gap_scan_type_t;
316
317 /**
318 * @brief Scanning modes
319 */
320 typedef enum
321 {
322 GAP_SCAN_GEN_DISC_MODE = 0, /**< General discoverable mode. */
323 GAP_SCAN_LIM_DISC_MODE, /**< Limited discoverable mode. */
324 GAP_SCAN_OBSERVER_MODE, /**< Observer mode. */
325 } gap_scan_mode_t;
326
327 /**
328 * @brief Duplicate filter policy
329 */
330 typedef enum
331 {
332 GAP_SCAN_FILT_DUPLIC_DIS = 0, /**< Disable filtering of duplicate packets. */
333 GAP_SCAN_FILT_DUPLIC_EN, /**< Enable filtering of duplicate packets. */
334 } gap_scan_dup_filt_policy_t;
335
336 /**
337 * @brief Extended scanning types
338 */
339 typedef enum
340 {
341 GAP_EXT_SCAN_TYPE_GEN_DISC = 0, /**< General discovery. */
342 GAP_EXT_SCAN_TYPE_LIM_DISC, /**< Limited discovery. */
343 GAP_EXT_SCAN_TYPE_OBSERVER, /**< Observer. */
344 GAP_EXT_SCAN_TYPE_SEL_OBSERVER, /**< Selective observer. */
345 GAP_EXT_SCAN_TYPE_CONN_DISC, /**< Connectable discovery. */
346 GAP_EXT_SCAN_TYPE_SEL_CONN_DISC, /**< Selective connectable discovery. */
347 } gap_ext_scan_type_t;
348
349 /**
350 * @brief Scanning properties bit field bit value
351 */
352 typedef enum
353 {
354 GAP_EXT_SCAN_PROP_PHY_1M_BIT = (1 << 0), /**< Scan advertisement on the LE 1M PHY. */
355 GAP_EXT_SCAN_PROP_PHY_CODED_BIT = (1 << 1), /**< Scan advertisement on the LE Coded PHY. */
356 GAP_EXT_SCAN_PROP_ACTIVE_1M_BIT = (1 << 2), /**< Active scan on LE 1M PHY (scan request PDUs may be sent). */
357 GAP_EXT_SCAN_PROP_ACTIVE_CODED_BIT = (1 << 3), /**< Active scan on LE Coded PHY (scan request PDUs may be sent). */
358 GAP_EXT_SCAN_PROP_ACCEPT_RPA_BIT = (1 << 4), /**< Accept directed advertising packets if the uesd RPA and target address cannot be solved by the controller. */
359 GAP_EXT_SCAN_PROP_FILT_TRUNC_BIT = (1 << 5), /**< Filter truncated advertising or scan response reports. */
360 } gap_scan_prop_t;
361
362 /**
363 * @brief Filtering policy for duplicated packets
364 */
365 typedef enum
366 {
367 GAP_EXT_DUP_FILT_DIS = 0, /**< Disable filtering of duplicated packets. */
368 GAP_EXT_DUP_FILT_EN, /**< Enable filtering of duplicated packets. */
369 GAP_EXT_DUP_FILT_EN_PERIOD, /**< Enable filtering of duplicated packets, reset for each scan period. */
370 } gap_ext_scan_dup_filt_policy_t;
371
372 /**
373 * @brief Initiating types
374 */
375 typedef enum
376 {
377 GAP_INIT_TYPE_DIRECT_CONN_EST = 0, /**< Direct connection establishment: establish a connection with an indicated device. */
378 GAP_INIT_TYPE_AUTO_CONN_EST, /**< Automatic connection establishment: establish a connection with all devices whose address is present in the white list. */
379 GAP_INIT_TYPE_NAME_DISC, /**< Name discovery: establish a connection with an indicated device in order to read content of its device name characteristic. Connection is closed once this operation is stopped. */
380 } gap_init_type_t;
381
382 /**
383 * @brief Initiating properties
384 */
385 typedef enum
386 {
387 GAP_INIT_PROP_1M_BIT = (1 << 0), /**< Scan connectable advertisements on the LE 1M PHY. Connection parameters for the LE 1M PHY are provided. */
388 GAP_INIT_PROP_2M_BIT = (1 << 1), /**< Connection parameters for the LE 2M PHY are provided. */
389 GAP_INIT_PROP_CODED_BIT = (1 << 2), /**< Scan connectable advertisements on the LE Coded PHY. Connection parameters for the LE Coded PHY are provided. */
390 } gap_init_prop_t;
391
392 /**
393 * @brief Scanning properties bit field bit value
394 */
395 enum gap_scan_prop
396 {
397 GAP_SCAN_PROP_PHY_1M_BIT = (1 << 0), /**< Scan advertisement on the LE 1M PHY. */
398 GAP_SCAN_PROP_PHY_CODED_BIT = (1 << 1), /**< Scan advertisement on the LE Coded PHY. */
399 GAP_SCAN_PROP_ACTIVE_1M_BIT = (1 << 2), /**< Active scan on LE 1M PHY (scan request PDUs may be sent). */
400 GAP_SCAN_PROP_ACTIVE_CODED_BIT = (1 << 3), /**< Active scan on LE Coded PHY (scan request PDUs may be sent). */
401 GAP_SCAN_PROP_ACCEPT_RPA_BIT = (1 << 4), /**< Accept directed advertising packets if the used RPA and target address cannot be solved by the controller. */
402 GAP_SCAN_PROP_FILT_TRUNC_BIT = (1 << 5), /**< Filter truncated advertising or scan response reports. */
403 };
404
405 /**
406 * @brief Periodic synchronization types
407 */
408 enum gap_per_sync_type
409 {
410 GAP_PER_SYNC_TYPE_GENERAL = 0, /**< Do not use periodic advertiser list for synchronization. */
411 GAP_PER_SYNC_TYPE_SELECTIVE, /**< Use periodic advertiser list for synchronization. */
412 };
413
414 /**
415 * @brief Security level types
416 */
417 enum gap_sec_lvl_type
418 {
419 GAP_SEC_LVL_NO_SECURITY = 0, /**< No encryption or auth. */
420 GAP_SEC_LVL_ENC_NO_AUTH, /**< Encryption with no auth. */
421 GAP_SEC_LVL_LE_ENC_AUTH, /**< Legacy encryption with auth. */
422 GAP_SEC_LVL_SC_ENC_AUTH, /**< Security connection encryption with auth. */
423 };
424
425 /**
426 * @brief GAP advertising types
427 */
428 typedef enum
429 {
430 BLE_GAP_AD_TYPE_FLAGS = 0x01, /**< Flag. */
431 BLE_GAP_AD_TYPE_MORE_16_BIT_UUID = 0x02, /**< Use of more than 16-bit UUID. */
432 BLE_GAP_AD_TYPE_COMPLETE_LIST_16_BIT_UUID = 0x03, /**< Complete List of 16-bit UUID. */
433 BLE_GAP_AD_TYPE_MORE_32_BIT_UUID = 0x04, /**< Use of more than 32-bit UUD. */
434 BLE_GAP_AD_TYPE_COMPLETE_LIST_32_BIT_UUID = 0x05, /**< Complete List of 32-bit UUID. */
435 BLE_GAP_AD_TYPE_MORE_128_BIT_UUID = 0x06, /**< Use of more than 128-bit UUID. */
436 BLE_GAP_AD_TYPE_COMPLETE_LIST_128_BIT_UUID = 0x07, /**< Complete List of 128-bit UUID. */
437 BLE_GAP_AD_TYPE_SHORTENED_NAME = 0x08, /**< Shortened Device name. */
438 BLE_GAP_AD_TYPE_COMPLETE_NAME = 0x09, /**< Complete Device name. */
439 BLE_GAP_AD_TYPE_TRANSMIT_POWER = 0x0A, /**< Transmit power. */
440 BLE_GAP_AD_TYPE_CLASS_OF_DEVICE = 0x0D, /**< Class of device. */
441 BLE_GAP_AD_TYPE_SP_HASH_C = 0x0E, /**< Simple Pairing Hash C. */
442 BLE_GAP_AD_TYPE_SP_RANDOMIZER_R = 0x0F, /**< Simple Pairing Randomizer. */
443 BLE_GAP_AD_TYPE_TK_VALUE = 0x10, /**< Temporary key value. */
444 BLE_GAP_AD_TYPE_OOB_FLAGS = 0x11, /**< Out of Band Flag. */
445 BLE_GAP_AD_TYPE_SLAVE_CONN_INT_RANGE = 0x12, /**< Slave connection interval range. */
446 BLE_GAP_AD_TYPE_RQRD_16_BIT_SVC_UUID = 0x14, /**< Require 16-bit service UUID. */
447 BLE_GAP_AD_TYPE_RQRD_32_BIT_SVC_UUID = 0x1F, /**< Require 32-bit service UUID. */
448 BLE_GAP_AD_TYPE_RQRD_128_BIT_SVC_UUID = 0x15, /**< Require 128-bit service UUID. */
449 BLE_GAP_AD_TYPE_SERVICE_16_BIT_DATA = 0x16, /**< Service data 16-bit UUID. */
450 BLE_GAP_AD_TYPE_SERVICE_32_BIT_DATA = 0x20, /**< Service data 32-bit UUID. */
451 BLE_GAP_AD_TYPE_SERVICE_128_BIT_DATA = 0x21, /**< Service data 128-bit UUID. */
452 BLE_GAP_AD_TYPE_PUB_TGT_ADDR = 0x17, /**< Public Target Address. */
453 BLE_GAP_AD_TYPE_RAND_TGT_ADDR = 0x18, /**< Random Target Address. */
454 BLE_GAP_AD_TYPE_APPEARANCE = 0x19, /**< Appearance. */
455 BLE_GAP_AD_TYPE_ADV_INTV = 0x1A, /**< Advertising Interval. */
456 BLE_GAP_AD_TYPE_LE_BT_ADDR = 0x1B, /**< LE Bluetooth Device Address. */
457 BLE_GAP_AD_TYPE_LE_ROLE = 0x1C, /**< LE Role. */
458 BLE_GAP_AD_TYPE_SPAIR_HASH = 0x1D, /**< Simple Pairing Hash C-256. */
459 BLE_GAP_AD_TYPE_SPAIR_RAND = 0x1E, /**< Simple Pairing Randomizer R-256. */
460 BLE_GAP_AD_TYPE_3D_INFO = 0x3D, /**< 3D Information Data. */
461
462 BLE_GAP_AD_TYPE_MANU_SPECIFIC_DATA = 0xFF, /**< Manufacturer specific data. */
463 }gap_ad_type_t;
464
465 /**
466 * @brief AD Type Flag - Bit mask.
467 */
468 typedef enum
469 {
470 GAP_ADV_FLAG_LE_LIMITED_DISC_MODE = 0x01, /**< Limited discovery flag: AD Flag. */
471 GAP_ADV_FLAG_LE_GENERAL_DISC_MODE = 0x02, /**< General discovery flag: AD Flag. */
472 GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED = 0x04, /**< Legacy BT not supported: AD Flag. */
473 GAP_ADV_FLAG_SIMUL_BR_EDR_LE_CONTROLLER = 0x08, /**< Dual mode for controller supported (BR/EDR/LE): AD Flag. */
474 GAP_ADV_FLAG_SIMUL_BR_EDR_LE_HOST = 0x10, /**< Dual mode for host supported (BR/EDR/LE): AD Flag. */
475 } gap_adv_flags_t;
476
477 /**
478 * @brief Privacy mode.
479 */
480
481 typedef enum
482 {
483 PRIVACY_MODE_NETWORK= 0x00, /**< Set to the network privacy mode for the peer device. */
484 PRIVACY_MODE_DEVICE = 0x01, /**< Set to the device privacy mode for the peer device. */
485 } privacy_mode_t;
486
487 /**
488 * @brief Possible roles of the activity.
489 */
490 typedef enum
491 {
492 GAP_ACTIVITY_ROLE_ADV = 0, /**< Adertise role. */
493 GAP_ACTIVITY_ROLE_CON = 1, /**< Connect role. */
494 GAP_ACTIVITY_ROLE_SCAN_INIT = 2, /**< Scann role. */
495 GAP_ACTIVITY_ROLE_UNKNOWN = 0xf, /**< Unknown role. */
496 } gap_activity_role_t;
497
498 /**
499 * @brief Activity type.
500 */
501 typedef enum
502 {
503 TYPE_ADV = 0,
504 TYPE_SCAN,
505 TYPE_INIT,
506 TYPE_PER_SYNC,
507 } ble_actv_type_t;
508
509 /** @} */
510
511 /**@addtogroup BLE_GAPM_STRUCTURES Structures
512 * @{ */
513
514 /**
515 * @brief Advertising parameters for legacy advertising
516 */
517 typedef struct
518 {
519 uint8_t adv_mode; /**< Advertising mode (see enum @ref gap_adv_mode_t). */
520 uint8_t disc_mode; /**< Discovery mode (see enum @ref gap_disc_mode_t). */
521 uint8_t filter_pol; /**< Advertising filtering policy (see enum @ref gap_adv_filter_policy_t). */
522 gap_bdaddr_t peer_addr; /**< Peer address configuration (only used in case of directed advertising, or used to locate the IRK list). */
523 uint16_t adv_intv_min; /**< Minimum advertising interval (in unit of 625 us). Must be greater than 20 ms. */
524 uint16_t adv_intv_max; /**< Maximum advertising interval (in unit of 625 us). Must be greater than 20 ms. */
525 uint8_t chnl_map; /**< Advertising channel map. See @ref BLE_GAP_ADV_CHANNEL. */
526 bool scan_req_ind_en; /**< Indicate if the application should be informed when receiving a scan request from the scanner. */
527 int8_t max_tx_pwr; /**< Maximum power level at which the advertising packets have to be transmitted (between -20dbm and 7dbm).
528 For the real value, please refer to GR551x Datasheet. */
529 } gap_adv_param_t;
530
531 /**
532 * @brief Configuration for advertising on primary channel
533 */
534 typedef struct
535 {
536 uint32_t adv_intv_min; /**< Minimum advertising interval (in unit of 625 us). Must be greater than 20 ms. */
537 uint32_t adv_intv_max; /**< Maximum advertising interval (in unit of 625 us). Must be greater than 20 ms. */
538 uint8_t chnl_map; /**< Bit field indicating the channel map. See @ref BLE_GAP_ADV_CHANNEL. */
539 gap_le_phy_value_t phy; /**< Indicate on which PHY primary advertising has to be performed. See enum @ref gap_le_phy_value_t.
540 Note that LE 2M PHY is not allowed and that legacy advertising only supports LE 1M PHY. */
541 } gap_adv_prim_cfg_t;
542
543 /**
544 * @brief Configuration for advertising on secondary channel
545 */
546 typedef struct
547 {
548 uint8_t max_skip; /**< Maximum number of advertising events the controller can skip before sending the AUX_ADV_IND packets.
549 The range is 0x00 to 0xFF. 0x00 means that AUX_ADV_IND PDUs shall be sent prior to each advertising events. */
550 gap_le_phy_value_t phy; /**< Indicate on which PHY secondary advertising has to be performed. See enum @ref gap_le_phy_value_t. */
551 uint8_t adv_sid; /**< Advertising SID. Allowed range is 0x00 to 0x0F. */
552 } gap_adv_second_cfg_t;
553
554 /**
555 * @brief Configuration for periodic advertising
556 */
557 typedef struct
558 {
559 uint16_t adv_intv_min; /**< Minimum advertising interval (in unit of 1.25 ms). Must be greater than 20 ms. */
560 uint16_t adv_intv_max; /**< Maximum advertising interval (in unit of 1.25 ms). Must be greater than 20 ms. */
561 } gap_adv_period_cfg_t;
562
563 /**
564 * @brief Advertising parameters for extended advertising and periodic advertising
565 */
566 typedef struct
567 {
568 uint8_t type; /**< Advertising type (see enum @ref gap_adv_type_t). */
569 uint8_t disc_mode; /**< Discovery mode (see enum @ref gap_disc_mode_t). */
570 uint16_t prop; /**< Bit field value provided by advertising properties. See enum @ref gap_adv_prop_t for bit signification. */
571 int8_t max_tx_pwr; /**< Maximum power level at which the advertising packets have to be transmitted (between -20 and 7 dBm). */
572 uint8_t filter_pol; /**< Advertising filtering policy (see enum @ref gap_adv_filter_policy_t). */
573 gap_bdaddr_t peer_addr; /**< Peer address configuration (only used in case of directed advertising or used to locate the IRK list). */
574 gap_adv_prim_cfg_t prim_cfg; /**< Configuration for primary advertising. */
575 gap_adv_second_cfg_t second_cfg; /**< Configuration for secondary advertising (valid only if advertising type is GAP_ADV_TYPE_EXTENDED or GAP_ADV_TYPE_PERIODIC). */
576 gap_adv_period_cfg_t period_cfg; /**< Configuration for periodic advertising (valid only if advertising type is GAP_ADV_TYPE_PERIODIC). */
577 } gap_ext_adv_param_t;
578
579 /**
580 * @brief Advertising timing parameter
581 */
582 typedef struct
583 {
584 uint16_t duration; /**< Advertising duration (in unit of 10ms). 0 means that advertising continues until the host disables it.
585 If Advertising discovery mode is GAP_DISC_MODE_LIM_DISCOVERABLE (see enum @ref gap_disc_mode_t),
586 the setting duration range is [1, 18000].
587 If adv mode is high duty, duration time range is [1, 128]. */
588 uint8_t max_adv_evt; /**< Maximum number of extended advertising events. The controller shall attempt to send prior to terminating the extending advertising.
589 The range is [0, 255]. 0 means no maximum number of advertising events. Valid only if the created advertising is an extended advertising. */
590 } gap_adv_time_param_t;
591
592 /**
593 * @brief Security key
594 */
595 typedef struct
596 {
597 uint8_t key[MAX_KEY_LEN]; /**< Key value MSB -> LSB (MSB followed by LSB). */
598 } gap_sec_key_t;
599
600 /**
601 * @brief Parameters for legacy scanning
602 */
603 typedef struct
604 {
605 gap_scan_type_t scan_type; /**< Active scanning or passive scanning. */
606 gap_scan_mode_t scan_mode; /**< Scan mode. */
607 gap_scan_dup_filt_policy_t scan_dup_filt; /**< Duplicate filter policy. */
608 bool use_whitelist; /**< Filter policy. */
609 uint16_t interval; /**< Scan interval between 0x0004 and 0x4000 in 0.625 ms (range: 2.5 ms to 10.24s). */
610 uint16_t window; /**< Scan window between 0x0004 and 0x4000 in 0.625 ms (range: 2.5 ms to 10.24s). */
611 uint16_t timeout; /**< Scan timeout should be a value between 0x0001 and 0xFFFF(unit: 10 ms). 0x0000 indicates that the timeout has no effect. */
612 } gap_scan_param_t;
613
614 /**
615 * @brief Scan Window operation parameters
616 */
617 typedef struct
618 {
619 uint16_t scan_intv; /**< Scan interval between 0x0004 and 0xFFFF in 0.625 ms (range: 2.5 ms to 40.959375s). */
620 uint16_t scan_wd; /**< Scan window between 0x0004 and 0xFFFF in 0.625 ms (range: 2.5 ms to 40.959375s). */
621 } gap_scan_wd_op_param_t;
622
623 /**
624 * @brief Parameters for extended scanning
625 */
626 typedef struct
627 {
628 uint8_t type; /**< Type of scanning to be started (see enum @ref gap_ext_scan_type_t). */
629 uint8_t prop; /**< Properties for the scan procedure (see enum @ref gap_scan_prop for bit signification). */
630 uint8_t dup_filt_pol; /**< Duplicate packet filtering policy (see enum @ref gap_ext_scan_dup_filt_policy_t). */
631 uint8_t rsvd; /**< Reserved for future use. */
632 gap_scan_wd_op_param_t scan_param_1m; /**< Scan window opening parameters for LE 1M PHY. */
633 gap_scan_wd_op_param_t scan_param_coded; /**< Scan window opening parameters for LE Coded PHY. */
634 uint16_t duration; /**< Scan duration (in unit of 10ms). 0 means that the controller will scan continuously
635 until receiving a stop command from the application (10 ms to 655.35s). */
636 uint16_t period; /**< Scan period, which is the time interval between two consequent starts of a scan duration by the controller.
637 0 means that the scan procedure is not periodic, in unit of 1.28s (1.28s to 83,884.8s). */
638 } gap_ext_scan_param_t;
639
640 /**
641 * @brief Periodic advertising information
642 */
643 typedef struct
644 {
645 gap_bdaddr_t bd_addr; /**< Advertiser address information. */
646 uint8_t adv_sid; /**< Advertising SID. */
647 } gap_period_adv_addr_cfg_t;
648
649 /**
650 * @brief Periodic advertising synchronization parameters
651 */
652 typedef struct
653 {
654 uint16_t skip; /**< Number of periodic advertising that can be skipped after a successful reception.
655 Maximum authorized value is 499. */
656 uint16_t sync_to; /**< Synchronization timeout for the periodic advertising (in unit of 10ms between 100ms and 163.84s). */
657 uint8_t type; /**< Periodic synchronization type (see enum @ref gap_per_sync_type). */
658 uint8_t rsvd; /**< Reserved for future use.*/
659 gap_period_adv_addr_cfg_t adv_addr; /**< Address of advertiser with which synchronization has to be established(used only if use_pal is false). */
660 } gap_per_sync_param_t;
661
662 /**
663 * @brief Legacy initiating parameters
664 */
665 typedef struct
666 {
667 uint8_t type; /**< Initiating type (see enum @ref gap_init_type_t). */
668 gap_bdaddr_t peer_addr; /**< Peer device address. */
669 uint16_t interval_min; /**< Minimum value for the connection interval (in unit of 1.25ms). Shall be less than or equal to interval_max value.
670 Allowed range is 7.5 ms to 4s. */
671 uint16_t interval_max; /**< Maximum value for the connection interval (in unit of 1.25ms). Shall be greater than or equal to interval_min value.
672 Allowed range is 7.5 ms to 4s. */
673 uint16_t slave_latency; /**< Slave latency. Number of events that can be missed by a connected slave device. */
674 uint16_t sup_timeout; /**< Link supervision timeout (in unit of 10ms). Allowed range is 100 ms to 32s. */
675 uint16_t conn_timeout; /**< Timeout for connection establishment (in unit of 10ms).
676 Cancel the procedure if connection has not been connected when the timeout occurs.
677 0 means there is no timeout. */
678 } gap_init_param_t;
679
680
681 /**
682 * @brief Connection parameters
683 */
684 typedef struct
685 {
686 uint16_t conn_intv_min; /**< Minimum value for the connection interval (in unit of 1.25ms). Shall be less than or equal to conn_intv_max value.
687 Allowed range is 7.5 ms to 4s. */
688 uint16_t conn_intv_max; /**< Maximum value for the connection interval (in unit of 1.25ms). Shall be greater than or equal to conn_intv_min value.
689 Allowed range is 7.5 ms to 4s. */
690 uint16_t conn_latency; /**< Slave latency. Number of events that can be missed by a connected slave device. */
691 uint16_t supervision_to; /**< Link supervision timeout (in unit of 10ms). Allowed range is 100 ms to 32s. */
692 uint16_t ce_len; /**< The length of connection event needed for this LE connection. Range: 0x0002 to 0xFFFF, Unit:0.625 ms, Time Range: 1.25 ms to 40.9s. */
693 } gap_ext_conn_param_t;
694
695 /**
696 * @brief Extended initiating parameters
697 */
698 typedef struct
699 {
700 uint8_t type; /**< Initiating type (see enum @ref gap_init_type_t). */
701 uint8_t prop; /**< Properties for the initiating procedure (see enum @ref gap_init_prop_t for bit signification). */
702 uint16_t conn_to; /**< Timeout for automatic connection establishment (in unit of 10ms).
703 Cancel the procedure if connection has not been connected when the timeout occurs.
704 0 means there is no timeout. */
705 gap_scan_wd_op_param_t scan_param_1m; /**< Scan window opening parameters for LE 1M PHY. */
706 gap_scan_wd_op_param_t scan_param_coded; /**< Scan window opening parameters for LE Coded PHY. */
707 gap_ext_conn_param_t conn_param_1m; /**< Connection parameters for LE 1M PHY. */
708 gap_ext_conn_param_t conn_param_2m; /**< Connection parameters for LE 2M PHY. */
709 gap_ext_conn_param_t conn_param_coded; /**< Connection parameters for LE Coded PHY. */
710 gap_bdaddr_t peer_addr; /**< Address of peer device in case white list is not used for connection. */
711 } gap_ext_init_param_t;
712
713 /**
714 * @brief LE Protocol/Service Multiplexer information
715 */
716 typedef struct
717 {
718 uint16_t le_psm; /**< LE Protocol/Service Multiplexer (range: 1 to 255), PSMs should be odd. */
719 uint8_t sec_lvl; /**< Security level requirement, see @ref gap_sec_lvl_type. */
720 bool mks_flag; /**< Whether to use maximum-size key (16 bytes) or not. */
721 } gap_lepsm_register_t;
722
723 /**
724 * @brief Bonded device list
725 */
726 typedef struct
727 {
728 uint8_t num; /**< Number of bonded device. */
729 gap_bdaddr_t items[MAX_BOND_NUM]; /**< Bonded device addr info. */
730 } bond_dev_list_t;
731
732 /**
733 * @brief White list
734 */
735 typedef struct
736 {
737 uint8_t num; /**< Number of available items. */
738 gap_bdaddr_t items[MAX_WL_NUM]; /**< Content of each item. */
739 } white_list_t;
740
741 /**
742 * @brief Periodic advertising list
743 */
744 typedef struct
745 {
746 uint8_t num; /**< Number of available items. */
747 gap_period_adv_addr_cfg_t items[MAX_PRD_ADV_NUM]; /**< Content of each item. */
748 } period_adv_list_t;
749
750 /**
751 * @brief RPA list item info
752 */
753 typedef struct
754 {
755 gap_bdaddr_t bd_addr; /**< Peer device identity. */
756 uint8_t priv_mode; /**< Privacy mode, see enum @ref privacy_mode_t. */
757 uint8_t peer_irk[MAX_KEY_LEN]; /**< Peer IRK. */
758 uint8_t local_irk[MAX_KEY_LEN]; /**< Local IRK. */
759 } gap_ral_dev_info_t;
760
761 /**
762 * @brief RPA list info
763 */
764 typedef struct
765 {
766 uint8_t num; /**< Number of RPA list. */
767 gap_ral_dev_info_t items[MAX_BOND_NUM]; /**< RPA list item info. */
768 } ral_dev_list_t;
769
770 /**
771 * @brief The BLE reslove rpa address callback.
772 */
773 typedef void (*reslv_rpa_addr_callback_t) (uint8_t status, gap_bdaddr_t *iden_addr, uint8_t src_info);
774
775 /**
776 * @brief The BLE rpa address report callback.
777 */
778 typedef void (*rpa_addr_report_callback_t) (ble_actv_type_t type, uint8_t index, const uint8_t *rpa_addr);
779
780 /** @} */
781
782
783 /** @addtogroup BLE_GAPM_FUNCTION Functions
784 * @{ */
785
786 /**
787 ****************************************************************************************
788 * @brief Decide whether to support the pair feature.
789 *
790 * @param[in] enable: Support flag.
791 ****************************************************************************************
792 */
793 void ble_gap_pair_enable(bool enable);
794
795 /**
796 ****************************************************************************************
797 * @brief Set the device identity address (public or random static).
798 *
799 * @param[in] p_addr: Provided public or static random address. If addr_type = 0, it means public address,
800 * If addr_type = 1, it means static random address.
801 *
802 * @retval ::SDK_SUCCESS: Operation is successful.
803 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
804 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
805 ****************************************************************************************
806 */
807 uint16_t ble_gap_addr_set(gap_bdaddr_t const *p_addr);
808
809 /**
810 ****************************************************************************************
811 * @brief Get the device identity address (public or random static).
812 *
813 * @param[in] p_addr: The pointer for the returned identity address.
814 *
815 * @retval ::SDK_SUCCESS: Operation is successful.
816 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
817 ****************************************************************************************
818 */
819 uint16_t ble_gap_addr_get(gap_bdaddr_t *p_addr);
820
821 /**
822 ****************************************************************************************
823 * @brief Set the tx power
824 *
825 * @param[in] role: Select the role to set tx power. @ref gap_activity_role_t for possible roles.
826 * @param[in] index: The idx parameter is interpreted on role.
827 * -If role is @ref GAP_ACTIVITY_ROLE_ADV, it's the index of Advertising.
828 * -If role is @ref GAP_ACTIVITY_ROLE_CON, it's the index of connection.
829 * -For all other roles, it should be ignored.
830 * @param[in] txpwr_dbm: The value of the tx power, Range: -20dbm to 7dbm.
831 *
832 * @retval ::SDK_SUCCESS: Operation is Success.
833 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
834 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
835 * @retval ::SDK_ERR_INVALID_HANDLE: Invalid handle supplied.
836 ****************************************************************************************
837 */
838 uint16_t ble_gap_tx_power_set(gap_activity_role_t role, uint8_t index, int8_t txpwr_dbm);
839
840 /**
841 ****************************************************************************************
842 * @brief Get the tx power
843 *
844 * @param[in] role: Select the role to Get tx power. @ref gap_activity_role_t for possible roles.
845 * @param[in] index: The idx parameter is interpreted on role.
846 * -If role is @ref GAP_ACTIVITY_ROLE_ADV, it's the index of Advertising.
847 * -If role is @ref GAP_ACTIVITY_ROLE_CON, it's the index of connection.
848 * -For all other roles, it should be ignored.
849 * @param[in] txpwr_dbm: The value of the tx power, Range: -20dbm to 7dbm.
850 *
851 * @retval ::SDK_SUCCESS: Operation is Success.
852 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
853 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
854 * @retval ::SDK_ERR_INVALID_HANDLE: Invalid handle supplied.
855 ****************************************************************************************
856 */
857 uint16_t ble_gap_tx_power_get(gap_activity_role_t role, uint8_t index, int8_t *txpwr_dbm);
858
859 /**
860 ****************************************************************************************
861 * @brief Set IRK used for resolvable random BD address generation (LSB first).
862 *
863 * @param[in] p_irk: Device IRK (Identity Resolving Key).
864 *
865 * @retval ::SDK_SUCCESS: Operation is successful.
866 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
867 ****************************************************************************************
868 */
869 uint16_t ble_gap_irk_set(gap_sec_key_t* p_irk);
870
871 /**
872 ****************************************************************************************
873 * @brief Set privacy related parameters.
874 * @param[in] renew_dur: Duration before regenerating a device address when privacy is enabled in seconds. Range: 0x0001 (1s) ~ 0xA1B8 (11.5 hr).
875 * The suggested time is 900s(15 minutes).
876 * @param[in] enable_flag: Indicate the controller privacy is enabled or disabled.
877 *
878 * @retval ::SDK_SUCCESS: Operation is successful.
879 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
880 ****************************************************************************************
881 */
882 uint16_t ble_gap_privacy_params_set(uint16_t renew_dur, bool enable_flag);
883
884 /**
885 ****************************************************************************************
886 * @brief Set suggested default LE data length.
887 *
888 * @param[in] sugg_max_tx_octet: Suggested value for the Controller's maximum transmitted number of payload octets to be used, the range is 27~251.
889 * @param[in] sugg_max_tx_time: Suggested value for the Controller's maximum packet transmission time to be used, the range is 328~2120.
890 *
891 * @retval ::SDK_SUCCESS: Operation is successful.
892 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
893 ****************************************************************************************
894 */
895 uint16_t ble_gap_data_length_set(uint16_t sugg_max_tx_octet,uint16_t sugg_max_tx_time);
896
897 /**
898 ****************************************************************************************
899 * @brief Set L2CAP related parameters.
900 *
901 * @param[in] max_mtu: Maximal MTU acceptable for device, the range is 65~512.
902 * @param[in] max_mps: Maximal MPS Packet size acceptable for device (for COC SDU), the range is 65~max_mtu.
903 * @param[in] max_nb_lecb: Maximum number of LE Credit based connection that can be established, this range is 0x00~0x20.
904 * The actual number is decided by resource available.
905 *
906 * @retval ::SDK_SUCCESS: Operation is successful.
907 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
908 *
909 * @note If these parameters are not set, the stack will config the default value as (max_mtu = 512, max_mps = 512 and max_nb_lecb = 10).
910 ****************************************************************************************
911 */
912 uint16_t ble_gap_l2cap_params_set(uint16_t max_mtu,uint16_t max_mps,uint8_t max_nb_lecb);
913
914 /**
915 ****************************************************************************************
916 * @brief Set the preferred values for the transmitter PHY and receiver PHY.
917 *
918 * @param[in] tx_pref_phy: A bit field that indicates the transmitter PHYs that the Host prefers the Controller to use(see @ref BLE_GAP_PHYS).
919 * @param[in] rx_pref_phy: A bit field that indicates the receiver PHYs that the Host prefers the Controller to use(see @ref BLE_GAP_PHYS).
920 ****************************************************************************************
921 */
922 void ble_gap_pref_phy_set(uint8_t tx_pref_phy, uint8_t rx_pref_phy);
923
924 /**
925 ****************************************************************************************
926 * @brief Set the RF path gain or loss between the RF transceiver and the antenna contributed by intermediate components.
927 *
928 * @param[in] tx_path_comp: RF TX Path Compensation value (from -128dB to 128dB, unit is 0.1dB).
929 * @param[in] rx_path_comp: RF RX Path Compensation value (from -128dB to 128dB, unit is 0.1dB).
930 *
931 * @retval ::SDK_SUCCESS: Operation is successful.
932 * @retval ::SDK_ERR_INVALID_PARAM: The parameter is invalid.
933 ****************************************************************************************
934 */
935 uint16_t ble_gap_path_compensation_set(int16_t tx_path_comp, int16_t rx_path_comp);
936
937 /**
938 ****************************************************************************************
939 * @brief Set advertising channel map before advertising starts.
940 *
941 * @param[in] p_chnl_map: Bitmask of LE channel map. See enum @ref gap_chnl_map_t for BT Core Spec version <= 4.2.
942 *
943 * @retval ::SDK_SUCCESS: Operation is successful.
944 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
945 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
946 *
947 * @note This API is asynchronous.
948 * @note @ref gap_cb_fun_t::app_gap_param_set_cb with op_id: @ref GAP_OPCODE_CHNL_MAP_SET
949 will be called once the operation has completed.
950 ****************************************************************************************
951 */
952 uint16_t ble_gap_chnl_map_set(gap_chnl_map_t* p_chnl_map);
953
954 /**
955 ****************************************************************************************
956 * @brief Get all bonded devices.
957 *
958 * @retval ::SDK_SUCCESS: Operation is successful.
959 * @retval ::SDK_ERR_SDK_INTERNAL: SDK internal error.
960 * @retval ::SDK_ERR_NVDS_NOT_INIT: NVDS is not initiated.
961 * @retval ::SDK_ERR_LIST_ITEM_NOT_FOUND: Item not found in list.
962 * @retval ::SDK_ERR_LIST_FULL: List is full.
963 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
964 ****************************************************************************************
965 */
966 uint16_t ble_gap_bond_devs_get(bond_dev_list_t *p_bond_list);
967
968 /**
969 ****************************************************************************************
970 * @brief Get BD address of the bonded device.
971 *
972 * @param[in] conn_idx: The index of connection.
973 * @param[in] p_peer_addr: Pointer to the peer BD addrss
974 *
975 * @retval ::SDK_SUCCESS: Operation is successful.
976 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
977 * @retval ::SDK_ERR_INVALID_PARAM: The parameter is invalid.
978 ****************************************************************************************
979 */
980 uint16_t ble_gap_bond_dev_addr_get(uint8_t conn_idx, gap_bdaddr_t *p_peer_addr);
981
982 /**
983 ****************************************************************************************
984 * @brief Clear all bonded devices.
985 *
986 * @retval ::SDK_SUCCESS: Operation is successful.
987 * @retval ::SDK_ERR_SDK_INTERNAL: SDK internal error.
988 * @retval ::SDK_ERR_NVDS_NOT_INIT: NVDS is not initiated.
989 * @retval ::SDK_ERR_LIST_ITEM_NOT_FOUND: Item not found in list.
990 * @retval ::SDK_ERR_LIST_FULL: List is full.
991 ****************************************************************************************
992 */
993 uint16_t ble_gap_bond_devs_clear(void);
994
995 /**
996 ****************************************************************************************
997 * @brief Delete a bond device with the specified BD address.
998 *
999 * @param[in] p_peer_addr: Pointer to the BD addrss.
1000 *
1001 * @retval ::SDK_SUCCESS: Operation is successful.
1002 * @retval ::SDK_ERR_SDK_INTERNAL: SDK internal error.
1003 * @retval ::SDK_ERR_NVDS_NOT_INIT: NVDS is not initiated.
1004 * @retval ::SDK_ERR_LIST_ITEM_NOT_FOUND: Item not found in list.
1005 * @retval ::SDK_ERR_LIST_FULL: List is full.
1006 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1007 ****************************************************************************************
1008 */
1009 uint16_t ble_gap_bond_dev_del(const gap_bdaddr_t *p_peer_addr);
1010
1011 /**
1012 ****************************************************************************************
1013 * @brief Get the content of the whole white list.
1014 *
1015 * @param[in] p_whitelist: Pointer to the output white list.
1016 *
1017 * @retval ::SDK_SUCCESS: Operation is successful.
1018 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1019 ****************************************************************************************
1020 */
1021 uint16_t ble_gap_whitelist_get(white_list_t *p_whitelist);
1022
1023 /**
1024 ****************************************************************************************
1025 * @brief Add the devices into current white list. If white list is full or there are duplicated entries, it will return error.
1026 *
1027 * @param[in] p_whitelist: Pointer to input white list.
1028 *
1029 * @retval ::SDK_SUCCESS: Operation is successful.
1030 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1031 * @retval ::SDK_ERR_LIST_ITEM_ALREADY_EXISTED: Item already existed in list.
1032 * @retval ::SDK_ERR_LIST_FULL: List is full.
1033 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1034 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1035 *
1036 * @note This API is asynchronous.
1037 * @note @ref gap_cb_fun_t::app_gap_param_set_cb with op_id: @ref GAP_OPCODE_WHITELIST_SET
1038 * will be called once the operation has completed.
1039 ****************************************************************************************
1040 */
1041 uint16_t ble_gap_whitelist_add(const white_list_t *p_whitelist);
1042
1043 /**
1044 ****************************************************************************************
1045 * @brief Delete the devices out of current white list. If the entries do not exist in the current white list, it will return error.
1046 *
1047 * @param[in] p_whitelist: Pointer to input white list.
1048 *
1049 * @retval ::SDK_SUCCESS: Operation is successful.
1050 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1051 * @retval ::SDK_ERR_LIST_ITEM_NOT_FOUND: Item not found in list.
1052 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1053 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1054 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1055 *
1056 * @note This API is asynchronous.
1057 * @note @ref gap_cb_fun_t::app_gap_param_set_cb with op_id: @ref GAP_OPCODE_WHITELIST_SET
1058 * will be called once the operation has completed.
1059 ****************************************************************************************
1060 */
1061 uint16_t ble_gap_whitelist_del(const white_list_t *p_whitelist);
1062
1063 /**
1064 ****************************************************************************************
1065 * @brief Clear all the entries in the current white list.
1066 *
1067 * @retval ::SDK_SUCCESS: Operation is successful.
1068 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1069 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1070 *
1071 * @note This API is asynchronous.
1072 * @note @ref gap_cb_fun_t::app_gap_param_set_cb with op_id: @ref GAP_OPCODE_WHITELIST_SET
1073 * will be called once the operation has completed.
1074 ****************************************************************************************
1075 */
1076 uint16_t ble_gap_whitelist_clear(void);
1077
1078 /**
1079 ****************************************************************************************
1080 * @brief Get the content of the whole periodic advertising list.
1081 *
1082 * @param[in] p_pal_list: Pointer to the output periodic advertising list.
1083 *
1084 * @retval ::SDK_SUCCESS: Operation is successful.
1085 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1086 ****************************************************************************************
1087 */
1088 uint16_t ble_gap_per_adv_list_get(period_adv_list_t *p_pal_list);
1089
1090 /**
1091 ****************************************************************************************
1092 * @brief Add the devices into current periodic advertising list. If periodic advertising list is full or there are
1093 * duplicated entries, it will return error.
1094 *
1095 * @param[in] p_pal_list: Pointer to input periodic advertising list.
1096 *
1097 * @retval ::SDK_SUCCESS: Operation is successful.
1098 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1099 * @retval ::SDK_ERR_LIST_ITEM_ALREADY_EXISTED: Item already existed in list.
1100 * @retval ::SDK_ERR_LIST_FULL: List is full.
1101 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1102 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1103 *
1104 * @note This API is asynchronous.
1105 * @note @ref gap_cb_fun_t::app_gap_param_set_cb with op_id: @ref GAP_OPCODE_PER_ADV_LIST_SET
1106 * will be called once the operation has completed.
1107 ****************************************************************************************
1108 */
1109 uint16_t ble_gap_per_adv_list_add(const period_adv_list_t *p_pal_list);
1110
1111 /**
1112 ****************************************************************************************
1113 * @brief Delete the devices out of periodic advertising list. If the entries do not exist in the current list, an error will be returned.
1114 *
1115 * @param[in] p_pal_list: Pointer to input periodic advertising list.
1116 *
1117 * @retval ::SDK_SUCCESS: Operation is successful.
1118 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1119 * @retval ::SDK_ERR_LIST_ITEM_NOT_FOUND: Item not found in list.
1120 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1121 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1122 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1123 *
1124 * @note This API is asynchronous.
1125 * @note @ref gap_cb_fun_t::app_gap_param_set_cb with op_id: @ref GAP_OPCODE_PER_ADV_LIST_SET
1126 * will be called once the operation has completed.
1127 ****************************************************************************************
1128 */
1129 uint16_t ble_gap_per_adv_list_del(const period_adv_list_t *p_pal_list);
1130
1131 /**
1132 ****************************************************************************************
1133 * @brief Clear all the entries in the current periodic advertising list.
1134 *
1135 * @note This API is asynchronous.
1136 * @note @ref gap_cb_fun_t::app_gap_param_set_cb with op_id: @ref GAP_OPCODE_PER_ADV_LIST_SET
1137 * will be called once the operation has completed.
1138 *
1139 * @retval ::SDK_SUCCESS: Operation is successful.
1140 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1141 ****************************************************************************************
1142 */
1143 uint16_t ble_gap_per_adv_list_clear(void);
1144
1145 /**
1146 ****************************************************************************************
1147 * @brief Get the RPA list info.
1148 * @param[in] p_rpa_list: Pointer to the output RPA list.
1149 *
1150 * @retval ::SDK_SUCCESS: Operation is successful.
1151 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1152 ****************************************************************************************
1153 */
1154 uint16_t ble_gap_rpa_list_get(ral_dev_list_t *p_rpa_list);
1155
1156 /**
1157 ****************************************************************************************
1158 * @brief Get the device information according to param type.
1159 *
1160 * @param[in] type: Param type.
1161 *
1162 * @retval ::SDK_SUCCESS: Operation is successful.
1163 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1164 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1165 *
1166 * @note This API is asynchronous.
1167 * @note @ref gap_cb_fun_t::app_gap_dev_info_get_cb with the specified op_id (see @ref gap_dev_info_get_type_t)
1168 * will be called once the requested parameters has been got.
1169 ****************************************************************************************
1170 */
1171 uint16_t ble_gap_dev_info_get(gap_dev_info_get_type_t type);
1172
1173 /**
1174 ****************************************************************************************
1175 * @brief Set parameters for advertising. Note that this function must be called prior to advertising started.
1176 * @param[in] adv_idx: Advertising index, range is 0 to 4.
1177 * @param[in] own_addr_type: Own BD address source of the local device.
1178 * @param[in] p_adv_param: The advertising parameters.
1179 *
1180 * @retval ::SDK_SUCCESS: Operation is successful.
1181 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1182 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
1183 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1184 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1185 *
1186
1187 * @note Discovery mode param contains Flags AD type, setting adv data should not set the Flags AD type.
1188 * @note This API is for legacy advertsing (BT Core Spec version <= 4.2).
1189 ****************************************************************************************
1190 */
1191 uint16_t ble_gap_adv_param_set(uint8_t adv_idx, gap_own_addr_t own_addr_type, gap_adv_param_t* p_adv_param);
1192
1193 /**
1194 ****************************************************************************************
1195 * @brief Set extended parameters for advertising. Note that this function must be called prior to advertising.
1196 * @param[in] adv_idx: Advertising index, range is 0 to 4.
1197 * @param[in] own_addr_type: Own BD address source of the local device.
1198 * @param[in] p_adv_param: The advertising parameters.
1199 *
1200 * @retval ::SDK_SUCCESS: Operation is successful.
1201 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1202 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
1203 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1204 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1205 *
1206 * @note This API is for extended and periodic advertising (BT Core Spec version >= 5.0).
1207 ****************************************************************************************
1208 */
1209 uint16_t ble_gap_ext_adv_param_set(uint8_t adv_idx, gap_own_addr_t own_addr_type, gap_ext_adv_param_t* p_adv_param);
1210
1211 /**
1212 ****************************************************************************************
1213 * @brief Set Advertising Data, Scan Response Data and Periodic Advertising Data. See ENUM @ref gap_ad_type_t
1214 for ADV Type definitions. See ENUM @ref gap_adv_flags_t for ADV flag definitions.
1215 *
1216 * @param[in] adv_idx: Advertising index, range is 0 to 4.
1217 * @param[in] type: Data type.
1218 * @param[in] p_data: The data pointer.
1219 * @param[in] length: Data length.
1220 *
1221 * @retval ::SDK_SUCCESS: Operation is successful.
1222 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1223 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
1224 * @retval ::SDK_ERR_INVALID_ADV_DATA_TYPE: Invalid advertising data type supplied.
1225 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1226 *
1227 * @note User should not add extra Flags AD type as the BLE Stack has added the Flags AD type already.
1228 ****************************************************************************************
1229 */
1230 uint16_t ble_gap_adv_data_set(uint8_t adv_idx, gap_adv_data_type_t type, const uint8_t* p_data, uint16_t length);
1231
1232 /**
1233 ****************************************************************************************
1234 * @brief Update Advertising Data, Scan Response Data and Periodic Advertising Data. See ENUM @ref gap_ad_type_t
1235 * for ADV Type definitions. See ENUM @ref gap_adv_flags_t for ADV flag definitions.
1236 *
1237 * @param[in] adv_idx: Advertising index, range is 0 to 4.
1238 * @param[in] type: Data type.
1239 * @param[in] p_data: The data pointer.
1240 * @param[in] length: Data length.
1241 *
1242 * @retval ::SDK_SUCCESS: Operation is successful.
1243 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1244 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
1245 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1246 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1247 *
1248 * @note User should not add extra Flags AD type as the BLE Stack has added the Flags AD type already.
1249 ****************************************************************************************
1250 */
1251 uint16_t ble_gap_update_adv_data(uint8_t adv_idx, gap_adv_data_type_t type, const uint8_t* p_data, uint16_t length);
1252
1253 /**
1254 ****************************************************************************************
1255 * @brief Start advertising.
1256 * @param[in] adv_idx: Advertising index, range is 0 to 4.
1257 * @param[in] p_timeout: Advertising timing parameter.
1258 *
1259 * @retval ::SDK_SUCCESS: Operation is successful.
1260 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1261 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
1262 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1263 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1264 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1265 *
1266 * @note If advertising mode is directed high duty cycle mode, duration should be set nonzero and not be greater than 1.28s.
1267 * @note This API is asynchronous.
1268 * @note If the field scan_req_ind_en in @ref gap_adv_param_t is TRUE passed in @ref ble_gap_adv_param_set function, or if the
1269 GAP_ADV_PROP_SCAN_REQ_NTF_EN_BIT is set in @ref gap_adv_prop_t and passed in @ref ble_gap_ext_adv_param_set function,
1270 @ref gap_cb_fun_t::app_gap_scan_req_ind_cb will be called once a scan request has been received.
1271 * @note @ref gap_cb_fun_t::app_gap_adv_start_cb will be called once the operation has completed.
1272 ****************************************************************************************
1273 */
1274 uint16_t ble_gap_adv_start(uint8_t adv_idx, gap_adv_time_param_t* p_timeout);
1275
1276 /**
1277 ****************************************************************************************
1278 * @brief Stop advertising.
1279 * @param[in] adv_idx: Advertising index, range is 0 to 4.
1280 *
1281 * @retval ::SDK_SUCCESS: Operation is successful.
1282 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
1283 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1284 *
1285 * @note This API is asynchronous.
1286 * @note @ref gap_cb_fun_t::app_gap_adv_stop_cb will be called once the operation has completed or advertising has been stopped.
1287 ****************************************************************************************
1288 */
1289 uint16_t ble_gap_adv_stop(uint8_t adv_idx);
1290
1291 /**
1292 ****************************************************************************************
1293 * @brief Set parameters for scanning. Note that this function must be called prior to scanning started.
1294 * @param[in] own_addr_type: Own BD address source of the local device.
1295 * @param[in] p_scan_param: The scanning parameters.
1296 *
1297 * @retval ::SDK_SUCCESS: Operation is successful.
1298 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1299 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1300 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1301 *
1302 * @note This API is for legacy scanning (BT Core Spec version <= 4.2).
1303 ****************************************************************************************
1304 */
1305 uint16_t ble_gap_scan_param_set(gap_own_addr_t own_addr_type, gap_scan_param_t* p_scan_param);
1306
1307 /**
1308 ****************************************************************************************
1309 * @brief Set extended parameters for scanning. Note that this function must be called prior to scanning started.
1310 * @param[in] own_addr_type: Own BD address source of the local device.
1311 * @param[in] p_scan_param: The scanning parameters.
1312 *
1313 * @retval ::SDK_SUCCESS: Operation is successful.
1314 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1315 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1316 *
1317 * @note This API is for extended scanning (BT Core Spec version >= 5.0).
1318 * The Scan window in p_scan_param should be enough to recieve one packet. For example.
1319 * If you want to recieve packects with 1270 bytes on coded phy(S8), the scan_wd should be greater than 82ms.
1320 * If you want to recieve packects with 1270 bytes on coded phy(S2), the scan_wd should be greater than 21ms.
1321 ****************************************************************************************
1322 */
1323 uint16_t ble_gap_ext_scan_param_set(gap_own_addr_t own_addr_type, gap_ext_scan_param_t* p_scan_param);
1324
1325 /**
1326 ****************************************************************************************
1327 * @brief Start scanning
1328 *
1329 * @retval ::SDK_SUCCESS: Operation is successful.
1330 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1331 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1332 *
1333 * @note This API is asynchronous.
1334 * @note @ref gap_cb_fun_t::app_gap_adv_report_ind_cb will be called once the advertising report has been received.
1335 * @note @ref gap_cb_fun_t::app_gap_scan_stop_cb will be called once the scanning has been stopped.
1336 * @note @ref gap_cb_fun_t::app_gap_scan_start_cb will be called once the operation has completed.
1337 ****************************************************************************************
1338 */
1339 uint16_t ble_gap_scan_start(void);
1340
1341 /**
1342 ****************************************************************************************
1343 * @brief Stop scanning
1344 *
1345 * @retval ::SDK_SUCCESS: Operation is successful.
1346 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1347 *
1348 * @note This API is asynchronous.
1349 * @note @ref gap_cb_fun_t::app_gap_scan_stop_cb will be called once the operation has completed or the scanning has been stopped.
1350 ****************************************************************************************
1351 */
1352 uint16_t ble_gap_scan_stop(void);
1353
1354 /**
1355 ****************************************************************************************
1356 * @brief Set the parameters used for periodic sync.
1357 * @param[in] per_sync_idx: Periodic synchronization index (range is 0 to 4).
1358 * @param[in] p_per_sync_param: Periodic synchronization parameters.
1359 *
1360 * @retval ::SDK_SUCCESS: Operation is successful.
1361 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1362 * @retval ::SDK_ERR_INVALID_PER_SYNC_IDX: Invalid periodic syncronization index supplied.
1363 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1364 ****************************************************************************************
1365 */
1366 uint16_t ble_gap_per_sync_param_set(uint8_t per_sync_idx, gap_per_sync_param_t* p_per_sync_param);
1367
1368 /**
1369 ****************************************************************************************
1370 * @brief Start to synchronize with periodic advertising from an advertiser and begin receiving periodic advertising packets.
1371 * @param[in] per_sync_idx: Periodic synchronization index (range is 0 to 4).
1372 *
1373 * @retval ::SDK_SUCCESS: Operation is successful.
1374 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1375 * @retval ::SDK_ERR_INVALID_PER_SYNC_IDX: Invalid periodic syncronization index supplied.
1376 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1377 *
1378 * @note This API is asynchronous.
1379 * @note @ref gap_cb_fun_t::app_gap_sync_establish_cb will be called once the periodic advertising synchronization has been established.
1380 ****************************************************************************************
1381 */
1382 uint16_t ble_gap_per_sync_start(uint8_t per_sync_idx);
1383
1384 /**
1385 ****************************************************************************************
1386 * @brief Stop periodic synchronization.
1387 * @param[in] per_sync_idx: Periodic synchronization index (range is 0 to 4).
1388 *
1389 * @retval ::SDK_SUCCESS: Operation is successful.
1390 * @retval ::SDK_ERR_INVALID_PER_SYNC_IDX: Invalid periodic syncronization index supplied.
1391 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1392 *
1393 * @note This API is asynchronous.
1394 * @note @ref gap_cb_fun_t::app_gap_stop_sync_cb will be called once the operation has completed.
1395 ****************************************************************************************
1396 */
1397 uint16_t ble_gap_per_sync_stop(uint8_t per_sync_idx);
1398
1399 /**
1400 ****************************************************************************************
1401 * @brief Start a legacy connection to a device.
1402 * @param[in] own_addr_type: Own BD address source of the local device.
1403 * @param[in] p_init_param: Initiate parameters.
1404 *
1405 * @retval ::SDK_SUCCESS: Operation is successful.
1406 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1407 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1408 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1409 *
1410 * @note This API is for legacy connection (BT Core Spec version <= 4.2).
1411 *
1412 * @note This API is asynchronous.
1413 * @note @ref gap_cb_fun_t::app_gap_connect_cb will be called once the operation has completed or the connection has been completed.
1414 * @note @ref gap_cb_fun_t::app_gap_peer_name_ind_cb will be called once the peer name has been got for the
1415 Name Discovery Procedure. See enum @ref GAP_INIT_TYPE_NAME_DISC of type @ref gap_init_type_t.
1416 ****************************************************************************************
1417 */
1418 uint16_t ble_gap_connect(gap_own_addr_t own_addr_type, gap_init_param_t* p_init_param);
1419
1420 /**
1421 ****************************************************************************************
1422 * @brief Start an extended connection to a device.
1423 * @param[in] own_addr_type: Own BD address source of the local device.
1424 * @param[in] p_init_param: Initiate parameters.
1425 *
1426 * @retval ::SDK_SUCCESS: Operation is successful.
1427 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1428 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1429 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1430 *
1431 * @note This API is for extended connection (BT Core Spec version >= 5.0).
1432 *
1433 * @note This API is asynchronous.
1434 * @note @ref gap_cb_fun_t::app_gap_connect_cb will be called once the operation has completed or the connection has been completed.
1435 ****************************************************************************************
1436 */
1437 uint16_t ble_gap_ext_connect(gap_own_addr_t own_addr_type, gap_ext_init_param_t* p_init_param);
1438
1439 /**
1440 ****************************************************************************************
1441 * @brief Cancel an initiated connection.
1442 *
1443 * @retval ::SDK_SUCCESS: Operation is successful.
1444 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1445 *
1446 * @note This API is asynchronous.
1447 * @note @ref gap_cb_fun_t::app_gap_connect_cancel_cb will be called once the operation has completed.
1448 ****************************************************************************************
1449 */
1450 uint16_t ble_gap_connect_cancel(void);
1451
1452 /**
1453 ****************************************************************************************
1454 * @brief Set GAP appearance value.
1455 * @param[in] appearance: Appearance value.
1456 ****************************************************************************************
1457 */
1458 void ble_gap_appearance_set(uint16_t appearance);
1459
1460 /**
1461 ****************************************************************************************
1462 * @brief Get GAP appearance value.
1463 * @param[out] p_appearance: The pointer to appearance value.
1464 *
1465 * @retval ::SDK_SUCCESS: Operation is successful.
1466 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1467 ****************************************************************************************
1468 */
1469 uint16_t ble_gap_appearance_get(uint16_t *p_appearance);
1470
1471 /**
1472 ****************************************************************************************
1473 * @brief Set GAP Peripheral Preferred Connection Parameters present flag.
1474 *
1475 * @param[in] present_flag: Present or not.
1476 ****************************************************************************************
1477 */
1478 void ble_gap_ppcp_present_set(bool present_flag);
1479
1480 /**
1481 ****************************************************************************************
1482 * @brief Set GAP Peripheral Preferred Connection Parameters.
1483 * @param[in] p_conn_params: The pointer to PPCP values.
1484 *
1485 * @retval ::SDK_SUCCESS: Operation is successful.
1486 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1487 ****************************************************************************************
1488 */
1489 uint16_t ble_gap_ppcp_set(gap_conn_param_t const *p_conn_params);
1490
1491 /**
1492 ****************************************************************************************
1493 * @brief Get GAP Peripheral Preferred Connection Parameters.
1494 * @param[out] p_conn_params: The pointer to PPCP values.
1495 *
1496 * @retval ::SDK_SUCCESS: Operation is successful.
1497 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1498 ****************************************************************************************
1499 */
1500 uint16_t ble_gap_ppcp_get(gap_conn_param_t *p_conn_params);
1501
1502 /**
1503 ****************************************************************************************
1504 * @brief Set GAP device name.
1505 * @param[in] write_perm: Write permissions of the device name characteristic.
1506 * @param[in] p_dev_name: The pointer to device name value. If p_dev_name is NULL, this function will only set write permissions of the device name.
1507 * @param[in] length: Device name length.
1508 *
1509 * @retval ::SDK_SUCCESS: Operation is successful.
1510 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1511 ****************************************************************************************
1512 */
1513 uint16_t ble_gap_device_name_set(gap_dev_name_write_perm_t write_perm, uint8_t const *p_dev_name, uint16_t length);
1514
1515 /**
1516 ****************************************************************************************
1517 * @brief Get GAP device name.
1518 * @param[out] p_dev_name: The pointer to device name value, set to NULL to obtain the complete device name length.
1519 * @param[in, out] p_length: Length of the buffer pointed by p_dev_name, complete device name length on output.
1520 *
1521 * @retval ::SDK_SUCCESS: Operation is successful.
1522 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1523 * @retval ::SDK_ERR_INVALID_DATA_LENGTH: Invalid data size(s) supplied.
1524 *
1525 * @note If device name was not set, the default device name "GOODIX_BLE" will be available.
1526 * @note If the device name is longer than the size of the supplied buffer,p_len will return the complete device name length,
1527 * and not the number of bytes actually returned in p_dev_name.
1528 * The application may use this information to allocate a suitable buffer size.
1529 ****************************************************************************************
1530 */
1531 uint16_t ble_gap_device_name_get(uint8_t *p_dev_name, uint16_t *p_length);
1532
1533 /**
1534 ****************************************************************************************
1535 * @brief Register a LE Protocol/Service Multiplexer.
1536 * @param[in] p_lepsm: The lepsm information to be registerred.
1537 *
1538 * @retval ::SDK_SUCCESS: Operation is successful.
1539 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1540 * @retval ::SDK_ERR_INVALID_PSM_NUM: Invalid psm number.
1541 * @retval ::SDK_ERR_INVALID_PSM_EXCEEDED_MAX_PSM_NUM: The maximum psm number limit is exceeded.
1542 * @retval ::SDK_ERR_INVALID_PSM_ALREADY_REGISTERED: The psm number has been registered.
1543 *
1544 * @note This API is asynchronous.
1545 * @ref gap_cb_fun_t::app_gap_psm_manager_cb callback with op_id: @ref GAP_OPCODE_LEPSM_REGISTER will be called.
1546 ****************************************************************************************
1547 */
1548 uint16_t ble_gap_lepsm_register(gap_lepsm_register_t* p_lepsm);
1549
1550 /**
1551 ****************************************************************************************
1552 * @brief Unregister a LE Protocol/Service Multiplexer.
1553 * @param[in] le_psm: LE Protocol/Service Multiplexer (1 to 255).
1554 *
1555 * @retval ::SDK_SUCCESS: Operation is successful.
1556 * @retval ::SDK_ERR_INVALID_PSM_NUM: Invalid psm number.
1557 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1558 *
1559 * @note This API is asynchronous.
1560 * @note app_gap_psm_manager_cb will be called once the operation has completed,
1561 * @ref gap_cb_fun_t::app_gap_psm_manager_cb callback with op_id: @ref GAP_OPCODE_LEPSM_UNREGISTER will be called.
1562 ****************************************************************************************
1563 */
1564 uint16_t ble_gap_lepsm_unregister(uint16_t le_psm);
1565
1566 /**
1567 ****************************************************************************************
1568 * @brief Set privacy mode for peer device.
1569 * @param[in] peer_addr: The peer address.
1570 * @param[in] mode: Privacy mode (see @ref privacy_mode_t).
1571 *
1572 * @retval ::SDK_SUCCESS: Operation is successful.
1573 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1574 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1575 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1576 *
1577 ****************************************************************************************
1578 */
1579 uint16_t ble_gap_privacy_mode_set(gap_bdaddr_t peer_addr, privacy_mode_t mode);
1580
1581 /**
1582 ****************************************************************************************
1583 * @brief Read peer or local resolvable address.
1584 * @param[in] op_code: The operation code (see @ref gap_rslv_addr_read_op_id_t).
1585 * @param[in] peer_iden_addr: The peer identity address.
1586 *
1587 * @retval ::SDK_SUCCESS: Operation is successful.
1588 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1589 *
1590 ****************************************************************************************
1591 */
1592 uint16_t ble_gap_rslv_addr_read(gap_rslv_addr_read_op_id_t op_code, gap_bdaddr_t peer_iden_addr);
1593
1594 /**
1595 *****************************************************************************************
1596 * @brief Resolve the rpa address.
1597 *
1598 * @param[in] reslv_addr: rpa address.
1599 * @param[in] src_info: Information used retrieve requester (src_info >= 10).
1600 * @param[in] cb: Function that will handle the resolved result.
1601 *
1602 * @retval ::SDK_SUCCESS: Operation is Success.
1603 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1604 *****************************************************************************************
1605 */
1606 uint16_t ble_gap_reslv_rpa_addr(uint8_t *reslv_addr, uint8_t src_info, reslv_rpa_addr_callback_t cb);
1607
1608 /**
1609 *****************************************************************************************
1610 * @brief Set the method for updating connection parameter.
1611 *
1612 * @param[in] conn_idx: Connection index.
1613 * @param[in] use_l2cap_flag: Preferred to use l2cap to update connection parameter.
1614 *
1615 * @retval ::SDK_SUCCESS: Operation is Success.
1616 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
1617 *****************************************************************************************
1618 */
1619 uint16_t ble_gap_update_conn_param_method_set(uint8_t conn_idx, bool use_l2cap_flag);
1620
1621 /**
1622 *****************************************************************************************
1623 * @brief Set the cb for rpa address report.
1624 *
1625 * @param[in] cb: the cb for rpa address report.
1626 *
1627 *****************************************************************************************
1628 */
1629 void ble_gap_rpa_addr_report_cb_register(rpa_addr_report_callback_t cb);
1630
1631 /** @} */
1632
1633 #endif
1634 /** @} */
1635
1636 /** @} */
1637 /** @} */
BLE_GAP_AD_TYPE_SP_RANDOMIZER_R
@ BLE_GAP_AD_TYPE_SP_RANDOMIZER_R
Simple Pairing Randomizer.
Definition: ble_gapm.h:442
BLE_GAP_AD_TYPE_COMPLETE_LIST_16_BIT_UUID
@ BLE_GAP_AD_TYPE_COMPLETE_LIST_16_BIT_UUID
Complete List of 16-bit UUID.
Definition: ble_gapm.h:432
gap_ext_scan_param_t::duration
uint16_t duration
Scan duration (in unit of 10ms).
Definition: ble_gapm.h:634
BLE_GAP_AD_TYPE_SERVICE_32_BIT_DATA
@ BLE_GAP_AD_TYPE_SERVICE_32_BIT_DATA
Service data 32-bit UUID.
Definition: ble_gapm.h:450
BLE_GAP_GET_MAX_LE_DATA_LEN
@ BLE_GAP_GET_MAX_LE_DATA_LEN
Get the Controller' maximum supported payload octets and packet duration times for transmission and r...
Definition: ble_gapm.h:209
ble_gap_pref_phy_set
void ble_gap_pref_phy_set(uint8_t tx_pref_phy, uint8_t rx_pref_phy)
Set the preferred values for the transmitter PHY and receiver PHY.
gap_adv_second_cfg_t
Configuration for advertising on secondary channel.
Definition: ble_gapm.h:547
gap_adv_time_param_t::duration
uint16_t duration
Advertising duration (in unit of 10ms).
Definition: ble_gapm.h:584
ble_gap_addr_get
uint16_t ble_gap_addr_get(gap_bdaddr_t *p_addr)
Get the device identity address (public or random static).
gap_period_adv_addr_cfg_t
Periodic advertising information.
Definition: ble_gapm.h:644
gap_init_param_t::sup_timeout
uint16_t sup_timeout
Link supervision timeout (in unit of 10ms).
Definition: ble_gapm.h:674
BLE_GAP_WRITE_PERM_DISABLE
@ BLE_GAP_WRITE_PERM_DISABLE
Disable write access.
Definition: ble_gapm.h:182
GAP_DISC_MODE_LIM_DISCOVERABLE
@ GAP_DISC_MODE_LIM_DISCOVERABLE
Limited-discoverable mode.
Definition: ble_gapm.h:233
BLE_GAP_AD_TYPE_FLAGS
@ BLE_GAP_AD_TYPE_FLAGS
Flag.
Definition: ble_gapm.h:430
BLE_GAP_AD_TYPE_SERVICE_16_BIT_DATA
@ BLE_GAP_AD_TYPE_SERVICE_16_BIT_DATA
Service data 16-bit UUID.
Definition: ble_gapm.h:449
gap_ext_conn_param_t::supervision_to
uint16_t supervision_to
Link supervision timeout (in unit of 10ms).
Definition: ble_gapm.h:691
GAP_EXT_SCAN_PROP_ACTIVE_1M_BIT
@ GAP_EXT_SCAN_PROP_ACTIVE_1M_BIT
Active scan on LE 1M PHY (scan request PDUs may be sent).
Definition: ble_gapm.h:356
gap_ext_adv_param_t::peer_addr
gap_bdaddr_t peer_addr
Peer address configuration (only used in case of directed advertising or used to locate the IRK list)...
Definition: ble_gapm.h:573
PRIVACY_MODE_DEVICE
@ PRIVACY_MODE_DEVICE
Set to the device privacy mode for the peer device.
Definition: ble_gapm.h:484
gap_ext_adv_param_t::disc_mode
uint8_t disc_mode
Discovery mode (see enum gap_disc_mode_t).
Definition: ble_gapm.h:569
BLE_GAP_AD_TYPE_LE_ROLE
@ BLE_GAP_AD_TYPE_LE_ROLE
LE Role.
Definition: ble_gapm.h:457
GAP_PHY_CODED_VALUE
@ GAP_PHY_CODED_VALUE
LE Coded PHY.
Definition: ble_gapm.h:256
gap_ext_init_param_t::conn_param_1m
gap_ext_conn_param_t conn_param_1m
Connection parameters for LE 1M PHY.
Definition: ble_gapm.h:707
BLE_GAP_AD_TYPE_ADV_INTV
@ BLE_GAP_AD_TYPE_ADV_INTV
Advertising Interval.
Definition: ble_gapm.h:455
GAP_SCAN_LIM_DISC_MODE
@ GAP_SCAN_LIM_DISC_MODE
Limited discoverable mode.
Definition: ble_gapm.h:323
ble_gap_scan_start
uint16_t ble_gap_scan_start(void)
Start scanning.
PRIVACY_MODE_NETWORK
@ PRIVACY_MODE_NETWORK
Set to the network privacy mode for the peer device.
Definition: ble_gapm.h:483
gap_ext_conn_param_t::conn_intv_max
uint16_t conn_intv_max
Maximum value for the connection interval (in unit of 1.25ms).
Definition: ble_gapm.h:688
GAP_INIT_PROP_1M_BIT
@ GAP_INIT_PROP_1M_BIT
Scan connectable advertisements on the LE 1M PHY.
Definition: ble_gapm.h:387
GAP_INIT_PROP_CODED_BIT
@ GAP_INIT_PROP_CODED_BIT
Scan connectable advertisements on the LE Coded PHY.
Definition: ble_gapm.h:389
ble_gap_irk_set
uint16_t ble_gap_irk_set(gap_sec_key_t *p_irk)
Set IRK used for resolvable random BD address generation (LSB first).
ble_gap_dev_info_get
uint16_t ble_gap_dev_info_get(gap_dev_info_get_type_t type)
Get the device information according to param type.
GAP_ADV_PROP_SCAN_REQ_NTF_EN_POS
@ GAP_ADV_PROP_SCAN_REQ_NTF_EN_POS
Indicate if application must be informed about receiving scan request PDUs.
Definition: ble_gapm.h:289
GAP_SCAN_ACTIVE
@ GAP_SCAN_ACTIVE
Active scan type.
Definition: ble_gapm.h:313
gap_adv_param_t::disc_mode
uint8_t disc_mode
Discovery mode (see enum gap_disc_mode_t).
Definition: ble_gapm.h:520
period_adv_list_t::num
uint8_t num
Number of available items.
Definition: ble_gapm.h:746
BLE_GAP_AD_TYPE_COMPLETE_NAME
@ BLE_GAP_AD_TYPE_COMPLETE_NAME
Complete Device name.
Definition: ble_gapm.h:438
GAP_SCAN_OBSERVER_MODE
@ GAP_SCAN_OBSERVER_MODE
Observer mode.
Definition: ble_gapm.h:324
gap_scan_param_t::scan_mode
gap_scan_mode_t scan_mode
Scan mode.
Definition: ble_gapm.h:606
gap_init_param_t::type
uint8_t type
Initiating type (see enum gap_init_type_t).
Definition: ble_gapm.h:667
ble_gap_privacy_mode_set
uint16_t ble_gap_privacy_mode_set(gap_bdaddr_t peer_addr, privacy_mode_t mode)
Set privacy mode for peer device.
GAP_INIT_PROP_2M_BIT
@ GAP_INIT_PROP_2M_BIT
Connection parameters for the LE 2M PHY are provided.
Definition: ble_gapm.h:388
gap_scan_param_t
Parameters for legacy scanning.
Definition: ble_gapm.h:604
gap_own_addr_t
gap_own_addr_t
Own BD address source of the device.
Definition: ble_gapm.h:171
gap_adv_mode_t
gap_adv_mode_t
GAP advertising modes.
Definition: ble_gapm.h:220
BLE_GAP_AD_TYPE_SHORTENED_NAME
@ BLE_GAP_AD_TYPE_SHORTENED_NAME
Shortened Device name.
Definition: ble_gapm.h:437
GAP_ADV_PROP_USE_LEGACY_PDUS_BIT
@ GAP_ADV_PROP_USE_LEGACY_PDUS_BIT
Definition: ble_gapm.h:301
GAP_EXT_SCAN_TYPE_SEL_OBSERVER
@ GAP_EXT_SCAN_TYPE_SEL_OBSERVER
Selective observer.
Definition: ble_gapm.h:344
BLE_GAP_GET_SUGGESTED_DFLT_LE_DATA_LEN
@ BLE_GAP_GET_SUGGESTED_DFLT_LE_DATA_LEN
Get suggested values (SuggestedMaxTxOctets and SuggestedMaxTxTime) for the Controller's maximum trans...
Definition: ble_gapm.h:206
gap_adv_param_t::scan_req_ind_en
bool scan_req_ind_en
Indicate if the application should be informed when receiving a scan request from the scanner.
Definition: ble_gapm.h:526
gap_adv_second_cfg_t::adv_sid
uint8_t adv_sid
Advertising SID.
Definition: ble_gapm.h:551
GAP_SEC_LVL_SC_ENC_AUTH
@ GAP_SEC_LVL_SC_ENC_AUTH
Security connection encryption with auth.
Definition: ble_gapm.h:422
GAP_ADV_PROP_SCAN_REQ_NTF_EN_BIT
@ GAP_ADV_PROP_SCAN_REQ_NTF_EN_BIT
Definition: ble_gapm.h:305
ble_gap_connect_cancel
uint16_t ble_gap_connect_cancel(void)
Cancel an initiated connection.
ble_gap_connect
uint16_t ble_gap_connect(gap_own_addr_t own_addr_type, gap_init_param_t *p_init_param)
Start a legacy connection to a device.
BLE_GAP_AD_TYPE_MORE_128_BIT_UUID
@ BLE_GAP_AD_TYPE_MORE_128_BIT_UUID
Use of more than 128-bit UUID.
Definition: ble_gapm.h:435
ble_gap_chnl_map_set
uint16_t ble_gap_chnl_map_set(gap_chnl_map_t *p_chnl_map)
Set advertising channel map before advertising starts.
BLE_GAP_AD_TYPE_SPAIR_RAND
@ BLE_GAP_AD_TYPE_SPAIR_RAND
Simple Pairing Randomizer R-256.
Definition: ble_gapm.h:459
GAP_INIT_TYPE_DIRECT_CONN_EST
@ GAP_INIT_TYPE_DIRECT_CONN_EST
Direct connection establishment: establish a connection with an indicated device.
Definition: ble_gapm.h:377
gap_period_adv_addr_cfg_t::adv_sid
uint8_t adv_sid
Advertising SID.
Definition: ble_gapm.h:646
ble_gap_pair_enable
void ble_gap_pair_enable(bool enable)
Decide whether to support the pair feature.
GAP_SCAN_FILT_DUPLIC_EN
@ GAP_SCAN_FILT_DUPLIC_EN
Enable filtering of duplicate packets.
Definition: ble_gapm.h:333
gap_ext_scan_param_t::rsvd
uint8_t rsvd
Reserved for future use.
Definition: ble_gapm.h:631
BLE_GAP_ROLE_CENTRAL
@ BLE_GAP_ROLE_CENTRAL
Master/Central role.
Definition: ble_gapm.h:162
gap_ext_init_param_t::peer_addr
gap_bdaddr_t peer_addr
Address of peer device in case white list is not used for connection.
Definition: ble_gapm.h:710
gap_ext_init_param_t::scan_param_coded
gap_scan_wd_op_param_t scan_param_coded
Scan window opening parameters for LE Coded PHY.
Definition: ble_gapm.h:706
ble_gap_rslv_addr_read
uint16_t ble_gap_rslv_addr_read(gap_rslv_addr_read_op_id_t op_code, gap_bdaddr_t peer_iden_addr)
Read peer or local resolvable address.
BLE_GAP_OWN_ADDR_GEN_RSLV
@ BLE_GAP_OWN_ADDR_GEN_RSLV
Generated resolvable private random address.
Definition: ble_gapm.h:173
gap_ext_scan_param_t::dup_filt_pol
uint8_t dup_filt_pol
Duplicate packet filtering policy (see enum gap_ext_scan_dup_filt_policy_t).
Definition: ble_gapm.h:630
gap_adv_prop_t
gap_adv_prop_t
Advertising properties bit field bit value.
Definition: ble_gapm.h:296
GAP_ADV_PROP_CONNECTABLE_BIT
@ GAP_ADV_PROP_CONNECTABLE_BIT
Definition: ble_gapm.h:297
ble_gap_whitelist_add
uint16_t ble_gap_whitelist_add(const white_list_t *p_whitelist)
Add the devices into current white list.
GAP_EXT_SCAN_TYPE_SEL_CONN_DISC
@ GAP_EXT_SCAN_TYPE_SEL_CONN_DISC
Selective connectable discovery.
Definition: ble_gapm.h:346
BLE_GAP_ROLE_PERIPHERAL
@ BLE_GAP_ROLE_PERIPHERAL
Peripheral/Slave role.
Definition: ble_gapm.h:163
GAP_SCAN_GEN_DISC_MODE
@ GAP_SCAN_GEN_DISC_MODE
General discoverable mode.
Definition: ble_gapm.h:322
GAP_DISC_MODE_GEN_DISCOVERABLE
@ GAP_DISC_MODE_GEN_DISCOVERABLE
General-discoverable mode.
Definition: ble_gapm.h:232
ble_gap_scan_param_set
uint16_t ble_gap_scan_param_set(gap_own_addr_t own_addr_type, gap_scan_param_t *p_scan_param)
Set parameters for scanning.
ble_gap_bond_devs_clear
uint16_t ble_gap_bond_devs_clear(void)
Clear all bonded devices.
GAP_EXT_DUP_FILT_DIS
@ GAP_EXT_DUP_FILT_DIS
Disable filtering of duplicated packets.
Definition: ble_gapm.h:367
bond_dev_list_t::num
uint8_t num
Number of bonded device.
Definition: ble_gapm.h:728
gap_ext_conn_param_t
Connection parameters.
Definition: ble_gapm.h:685
BLE_GAP_ADV_DATA_TYPE_SCAN_RSP
@ BLE_GAP_ADV_DATA_TYPE_SCAN_RSP
Scan response data.
Definition: ble_gapm.h:195
ble_gap_data_length_set
uint16_t ble_gap_data_length_set(uint16_t sugg_max_tx_octet, uint16_t sugg_max_tx_time)
Set suggested default LE data length.
BLE_GAP_AD_TYPE_COMPLETE_LIST_128_BIT_UUID
@ BLE_GAP_AD_TYPE_COMPLETE_LIST_128_BIT_UUID
Complete List of 128-bit UUID.
Definition: ble_gapm.h:436
gap_scan_type_t
gap_scan_type_t
Scanning types.
Definition: ble_gapm.h:312
BLE_GAP_AD_TYPE_COMPLETE_LIST_32_BIT_UUID
@ BLE_GAP_AD_TYPE_COMPLETE_LIST_32_BIT_UUID
Complete List of 32-bit UUID.
Definition: ble_gapm.h:434
gap_chnl_map_t
Channel map structure.
Definition: ble_gapc.h:392
gap_init_type_t
gap_init_type_t
Initiating types.
Definition: ble_gapm.h:376
GAP_ADV_FLAG_LE_GENERAL_DISC_MODE
@ GAP_ADV_FLAG_LE_GENERAL_DISC_MODE
General discovery flag: AD Flag.
Definition: ble_gapm.h:471
gap_scan_dup_filt_policy_t
gap_scan_dup_filt_policy_t
Duplicate filter policy.
Definition: ble_gapm.h:331
gap_adv_param_t::adv_intv_max
uint16_t adv_intv_max
Maximum advertising interval (in unit of 625 us).
Definition: ble_gapm.h:524
GAP_ADV_FLAG_LE_LIMITED_DISC_MODE
@ GAP_ADV_FLAG_LE_LIMITED_DISC_MODE
Limited discovery flag: AD Flag.
Definition: ble_gapm.h:470
reslv_rpa_addr_callback_t
void(* reslv_rpa_addr_callback_t)(uint8_t status, gap_bdaddr_t *iden_addr, uint8_t src_info)
The BLE reslove rpa address callback.
Definition: ble_gapm.h:773
GAP_INIT_TYPE_NAME_DISC
@ GAP_INIT_TYPE_NAME_DISC
Name discovery: establish a connection with an indicated device in order to read content of its devic...
Definition: ble_gapm.h:379
gap_init_param_t::conn_timeout
uint16_t conn_timeout
Timeout for connection establishment (in unit of 10ms).
Definition: ble_gapm.h:675
BLE_GAP_GET_DEV_VERSION
@ BLE_GAP_GET_DEV_VERSION
Get version information for the local Controller.
Definition: ble_gapm.h:203
gap_ext_init_param_t::prop
uint8_t prop
Properties for the initiating procedure (see enum gap_init_prop_t for bit signification).
Definition: ble_gapm.h:701
gap_ext_scan_param_t::scan_param_coded
gap_scan_wd_op_param_t scan_param_coded
Scan window opening parameters for LE Coded PHY.
Definition: ble_gapm.h:633
gap_disc_mode_t
gap_disc_mode_t
GAP discoverability modes.
Definition: ble_gapm.h:230
GAP_INIT_TYPE_AUTO_CONN_EST
@ GAP_INIT_TYPE_AUTO_CONN_EST
Automatic connection establishment: establish a connection with all devices whose address is present ...
Definition: ble_gapm.h:378
GAP_SCAN_PASSIVE
@ GAP_SCAN_PASSIVE
Passive scan type.
Definition: ble_gapm.h:314
GAP_SEC_LVL_LE_ENC_AUTH
@ GAP_SEC_LVL_LE_ENC_AUTH
Legacy encryption with auth.
Definition: ble_gapm.h:421
ble_gap_bond_devs_get
uint16_t ble_gap_bond_devs_get(bond_dev_list_t *p_bond_list)
Get all bonded devices.
GAP_ADV_PROP_TX_PWR_POS
@ GAP_ADV_PROP_TX_PWR_POS
Include TX power in the extended header of the advertising PDU.
Definition: ble_gapm.h:285
gap_adv_period_cfg_t::adv_intv_max
uint16_t adv_intv_max
Maximum advertising interval (in unit of 1.25 ms).
Definition: ble_gapm.h:560
gap_ext_conn_param_t::conn_latency
uint16_t conn_latency
Slave latency.
Definition: ble_gapm.h:690
GAP_PER_SYNC_TYPE_GENERAL
@ GAP_PER_SYNC_TYPE_GENERAL
Do not use periodic advertiser list for synchronization.
Definition: ble_gapm.h:410
gap_adv_param_t::max_tx_pwr
int8_t max_tx_pwr
Maximum power level at which the advertising packets have to be transmitted (between -20dbm and 7dbm)...
Definition: ble_gapm.h:527
GAP_SEC_LVL_NO_SECURITY
@ GAP_SEC_LVL_NO_SECURITY
No encryption or auth.
Definition: ble_gapm.h:419
gap_sec_lvl_type
gap_sec_lvl_type
Security level types.
Definition: ble_gapm.h:418
white_list_t
White list.
Definition: ble_gapm.h:736
ble_gap_ext_scan_param_set
uint16_t ble_gap_ext_scan_param_set(gap_own_addr_t own_addr_type, gap_ext_scan_param_t *p_scan_param)
Set extended parameters for scanning.
BLE_GAP_WRITE_PERM_NOAUTH
@ BLE_GAP_WRITE_PERM_NOAUTH
LE Security Mode 1, Level 1.
Definition: ble_gapm.h:183
GAP_DISC_MODE_NON_DISCOVERABLE
@ GAP_DISC_MODE_NON_DISCOVERABLE
Non-discoverable mode.
Definition: ble_gapm.h:231
gap_ext_conn_param_t::conn_intv_min
uint16_t conn_intv_min
Minimum value for the connection interval (in unit of 1.25ms).
Definition: ble_gapm.h:686
ble_gap_per_sync_start
uint16_t ble_gap_per_sync_start(uint8_t per_sync_idx)
Start to synchronize with periodic advertising from an advertiser and begin receiving periodic advert...
BLE_GAP_GET_DEV_RF_RF_PATH_COMP
@ BLE_GAP_GET_DEV_RF_RF_PATH_COMP
Get RF path compensation values.
Definition: ble_gapm.h:215
gap_ext_adv_param_t::prop
uint16_t prop
Bit field value provided by advertising properties.
Definition: ble_gapm.h:570
gap_adv_prim_cfg_t::adv_intv_min
uint32_t adv_intv_min
Minimum advertising interval (in unit of 625 us).
Definition: ble_gapm.h:536
gap_adv_type_t
gap_adv_type_t
Advertising type.
Definition: ble_gapm.h:263
gap_ext_scan_param_t::prop
uint8_t prop
Properties for the scan procedure (see enum gap_scan_prop for bit signification).
Definition: ble_gapm.h:629
gap_bdaddr_t
The struct of broadcast address with broadcast type.
Definition: ble_gapc.h:212
BLE_GAP_AD_TYPE_MORE_32_BIT_UUID
@ BLE_GAP_AD_TYPE_MORE_32_BIT_UUID
Use of more than 32-bit UUD.
Definition: ble_gapm.h:433
GAP_ADV_PROP_SCANNABLE_BIT
@ GAP_ADV_PROP_SCANNABLE_BIT
Definition: ble_gapm.h:298
gap_activity_role_t
gap_activity_role_t
Possible roles of the activity.
Definition: ble_gapm.h:491
gap_scan_prop
gap_scan_prop
Scanning properties bit field bit value.
Definition: ble_gapm.h:396
period_adv_list_t
Periodic advertising list.
Definition: ble_gapm.h:745
gap_init_param_t::interval_min
uint16_t interval_min
Minimum value for the connection interval (in unit of 1.25ms).
Definition: ble_gapm.h:669
gap_per_sync_param_t::type
uint8_t type
Periodic synchronization type (see enum gap_per_sync_type).
Definition: ble_gapm.h:657
BLE_GAP_ADV_DATA_TYPE_DATA
@ BLE_GAP_ADV_DATA_TYPE_DATA
Advertising data.
Definition: ble_gapm.h:194
ble_gap_tx_power_get
uint16_t ble_gap_tx_power_get(gap_activity_role_t role, uint8_t index, int8_t *txpwr_dbm)
Get the tx power.
ble_gap_reslv_rpa_addr
uint16_t ble_gap_reslv_rpa_addr(uint8_t *reslv_addr, uint8_t src_info, reslv_rpa_addr_callback_t cb)
Resolve the rpa address.
BLE_GAP_AD_TYPE_TRANSMIT_POWER
@ BLE_GAP_AD_TYPE_TRANSMIT_POWER
Transmit power.
Definition: ble_gapm.h:439
gap_ext_adv_param_t::type
uint8_t type
Advertising type (see enum gap_adv_type_t).
Definition: ble_gapm.h:568
GAP_ADV_PROP_PER_TX_PWR_POS
@ GAP_ADV_PROP_PER_TX_PWR_POS
Include TX power in the periodic advertising PDU.
Definition: ble_gapm.h:287
GAP_SEC_LVL_ENC_NO_AUTH
@ GAP_SEC_LVL_ENC_NO_AUTH
Encryption with no auth.
Definition: ble_gapm.h:420
gap_scan_wd_op_param_t
Scan Window operation parameters.
Definition: ble_gapm.h:618
GAP_ACTIVITY_ROLE_ADV
@ GAP_ACTIVITY_ROLE_ADV
Adertise role.
Definition: ble_gapm.h:492
gap_adv_prop_pos_t
gap_adv_prop_pos_t
Advertising properties bit field and bit positions.
Definition: ble_gapm.h:273
gap_lepsm_register_t::sec_lvl
uint8_t sec_lvl
Security level requirement, see gap_sec_lvl_type.
Definition: ble_gapm.h:719
CO_BIT
#define CO_BIT(pos)
Bit operation helper.
Definition: ble_gapm.h:72
BLE_GAP_AD_TYPE_APPEARANCE
@ BLE_GAP_AD_TYPE_APPEARANCE
Appearance.
Definition: ble_gapm.h:454
gap_dev_name_write_perm_t
gap_dev_name_write_perm_t
Write permissions of the device name characteristic.
Definition: ble_gapm.h:181
gap_adv_param_t
Advertising parameters for legacy advertising.
Definition: ble_gapm.h:518
ble_gap_per_sync_param_set
uint16_t ble_gap_per_sync_param_set(uint8_t per_sync_idx, gap_per_sync_param_t *p_per_sync_param)
Set the parameters used for periodic sync.
ble_gap_addr_set
uint16_t ble_gap_addr_set(gap_bdaddr_t const *p_addr)
Set the device identity address (public or random static).
GAP_SCAN_PROP_ACTIVE_1M_BIT
@ GAP_SCAN_PROP_ACTIVE_1M_BIT
Active scan on LE 1M PHY (scan request PDUs may be sent).
Definition: ble_gapm.h:399
gap_adv_second_cfg_t::max_skip
uint8_t max_skip
Maximum number of advertising events the controller can skip before sending the AUX_ADV_IND packets.
Definition: ble_gapm.h:548
BLE_GAP_GET_DEV_BDADDR
@ BLE_GAP_GET_DEV_BDADDR
Get local device BD Address.
Definition: ble_gapm.h:204
ble_gap_per_sync_stop
uint16_t ble_gap_per_sync_stop(uint8_t per_sync_idx)
Stop periodic synchronization.
MAX_PRD_ADV_NUM
#define MAX_PRD_ADV_NUM
Maximal periodic advertising list number.
Definition: ble_gapm.h:78
ble_gap_path_compensation_set
uint16_t ble_gap_path_compensation_set(int16_t tx_path_comp, int16_t rx_path_comp)
Set the RF path gain or loss between the RF transceiver and the antenna contributed by intermediate c...
gap_adv_time_param_t::max_adv_evt
uint8_t max_adv_evt
Maximum number of extended advertising events.
Definition: ble_gapm.h:588
GAP_ADV_PROP_TX_PWR_BIT
@ GAP_ADV_PROP_TX_PWR_BIT
Definition: ble_gapm.h:303
GAP_EXT_DUP_FILT_EN
@ GAP_EXT_DUP_FILT_EN
Enable filtering of duplicated packets.
Definition: ble_gapm.h:368
BLE_GAP_OWN_ADDR_GEN_NON_RSLV
@ BLE_GAP_OWN_ADDR_GEN_NON_RSLV
Generated non-resolvable private random address.
Definition: ble_gapm.h:174
ble_gap_whitelist_get
uint16_t ble_gap_whitelist_get(white_list_t *p_whitelist)
Get the content of the whole white list.
gap_role_t
gap_role_t
GAP role options.
Definition: ble_gapm.h:158
ble_error.h
File that contains error codes.
ble_gapc.h
BLE GAPC API.
gap_scan_param_t::interval
uint16_t interval
Scan interval between 0x0004 and 0x4000 in 0.625 ms (range: 2.5 ms to 10.24s).
Definition: ble_gapm.h:609
gap_ext_scan_param_t::period
uint16_t period
Scan period, which is the time interval between two consequent starts of a scan duration by the contr...
Definition: ble_gapm.h:636
gap_adv_second_cfg_t::phy
gap_le_phy_value_t phy
Indicate on which PHY secondary advertising has to be performed.
Definition: ble_gapm.h:550
BLE_GAP_WRITE_PERM_AUTH
@ BLE_GAP_WRITE_PERM_AUTH
LE Security Mode 1, Level 3.
Definition: ble_gapm.h:185
GAP_SCAN_FILT_DUPLIC_DIS
@ GAP_SCAN_FILT_DUPLIC_DIS
Disable filtering of duplicate packets.
Definition: ble_gapm.h:332
BLE_GAP_WRITE_PERM_SEC_CON
@ BLE_GAP_WRITE_PERM_SEC_CON
LE Security Mode 1, Level 4.
Definition: ble_gapm.h:186
BLE_GAP_GET_NB_ADV_SETS
@ BLE_GAP_GET_NB_ADV_SETS
Read the maximum number of advertising sets currently supported by the controller.
Definition: ble_gapm.h:212
gap_le_phy_value_t
gap_le_phy_value_t
Specify what PHY the Controller has changed for TX/RX.
Definition: ble_gapm.h:252
GAP_PHY_UNDEF_VALUE
@ GAP_PHY_UNDEF_VALUE
Undefined LE PHY.
Definition: ble_gapm.h:253
BLE_GAP_AD_TYPE_SLAVE_CONN_INT_RANGE
@ BLE_GAP_AD_TYPE_SLAVE_CONN_INT_RANGE
Slave connection interval range.
Definition: ble_gapm.h:445
GAP_EXT_SCAN_PROP_PHY_CODED_BIT
@ GAP_EXT_SCAN_PROP_PHY_CODED_BIT
Scan advertisement on the LE Coded PHY.
Definition: ble_gapm.h:355
gap_adv_data_type_t
gap_adv_data_type_t
Advertising data type.
Definition: ble_gapm.h:193
BLE_GAP_AD_TYPE_LE_BT_ADDR
@ BLE_GAP_AD_TYPE_LE_BT_ADDR
LE Bluetooth Device Address.
Definition: ble_gapm.h:456
ble_gap_rpa_addr_report_cb_register
void ble_gap_rpa_addr_report_cb_register(rpa_addr_report_callback_t cb)
Set the cb for rpa address report.
gap_ext_adv_param_t::second_cfg
gap_adv_second_cfg_t second_cfg
Configuration for secondary advertising (valid only if advertising type is GAP_ADV_TYPE_EXTENDED or G...
Definition: ble_gapm.h:575
GAP_ADV_TYPE_EXTENDED
@ GAP_ADV_TYPE_EXTENDED
Extended advertising.
Definition: ble_gapm.h:265
GAP_ADV_FLAG_SIMUL_BR_EDR_LE_CONTROLLER
@ GAP_ADV_FLAG_SIMUL_BR_EDR_LE_CONTROLLER
Dual mode for controller supported (BR/EDR/LE): AD Flag.
Definition: ble_gapm.h:473
gap_adv_prim_cfg_t::adv_intv_max
uint32_t adv_intv_max
Maximum advertising interval (in unit of 625 us).
Definition: ble_gapm.h:537
gap_adv_filter_policy_t
gap_adv_filter_policy_t
Advertising filter policy.
Definition: ble_gapm.h:241
gap_adv_param_t::adv_intv_min
uint16_t adv_intv_min
Minimum advertising interval (in unit of 625 us).
Definition: ble_gapm.h:523
gap_adv_time_param_t
Advertising timing parameter.
Definition: ble_gapm.h:583
gap_scan_param_t::window
uint16_t window
Scan window between 0x0004 and 0x4000 in 0.625 ms (range: 2.5 ms to 10.24s).
Definition: ble_gapm.h:610
ble_gap_scan_stop
uint16_t ble_gap_scan_stop(void)
Stop scanning.
BLE_GAP_AD_TYPE_SERVICE_128_BIT_DATA
@ BLE_GAP_AD_TYPE_SERVICE_128_BIT_DATA
Service data 128-bit UUID.
Definition: ble_gapm.h:451
gap_init_param_t
Legacy initiating parameters.
Definition: ble_gapm.h:666
gap_per_sync_param_t::skip
uint16_t skip
Number of periodic advertising that can be skipped after a successful reception.
Definition: ble_gapm.h:654
ble_gap_ppcp_present_set
void ble_gap_ppcp_present_set(bool present_flag)
Set GAP Peripheral Preferred Connection Parameters present flag.
GAP_EXT_SCAN_TYPE_CONN_DISC
@ GAP_EXT_SCAN_TYPE_CONN_DISC
Connectable discovery.
Definition: ble_gapm.h:345
BLE_GAP_ROLE_OBSERVER
@ BLE_GAP_ROLE_OBSERVER
Observer role.
Definition: ble_gapm.h:160
GAP_EXT_SCAN_PROP_PHY_1M_BIT
@ GAP_EXT_SCAN_PROP_PHY_1M_BIT
Scan advertisement on the LE 1M PHY.
Definition: ble_gapm.h:354
gap_init_prop_t
gap_init_prop_t
Initiating properties.
Definition: ble_gapm.h:386
BLE_GAP_ROLE_ALL
@ BLE_GAP_ROLE_ALL
Device has all roles, both peripheral and central.
Definition: ble_gapm.h:164
ral_dev_list_t::num
uint8_t num
Number of RPA list.
Definition: ble_gapm.h:766
GAP_ADV_PROP_HDC_BIT
@ GAP_ADV_PROP_HDC_BIT
Definition: ble_gapm.h:300
GAP_EXT_SCAN_PROP_ACTIVE_CODED_BIT
@ GAP_EXT_SCAN_PROP_ACTIVE_CODED_BIT
Active scan on LE Coded PHY (scan request PDUs may be sent).
Definition: ble_gapm.h:357
GAP_SCAN_PROP_ACTIVE_CODED_BIT
@ GAP_SCAN_PROP_ACTIVE_CODED_BIT
Active scan on LE Coded PHY (scan request PDUs may be sent).
Definition: ble_gapm.h:400
ble_actv_type_t
ble_actv_type_t
Activity type.
Definition: ble_gapm.h:502
GAP_SCAN_PROP_ACCEPT_RPA_BIT
@ GAP_SCAN_PROP_ACCEPT_RPA_BIT
Accept directed advertising packets if the used RPA and target address cannot be solved by the contro...
Definition: ble_gapm.h:401
gap_adv_prim_cfg_t::chnl_map
uint8_t chnl_map
Bit field indicating the channel map.
Definition: ble_gapm.h:538
gap_per_sync_param_t::adv_addr
gap_period_adv_addr_cfg_t adv_addr
Address of advertiser with which synchronization has to be established(used only if use_pal is false)...
Definition: ble_gapm.h:659
ble_gap_l2cap_params_set
uint16_t ble_gap_l2cap_params_set(uint16_t max_mtu, uint16_t max_mps, uint8_t max_nb_lecb)
Set L2CAP related parameters.
gap_per_sync_param_t::sync_to
uint16_t sync_to
Synchronization timeout for the periodic advertising (in unit of 10ms between 100ms and 163....
Definition: ble_gapm.h:656
ble_gap_per_adv_list_get
uint16_t ble_gap_per_adv_list_get(period_adv_list_t *p_pal_list)
Get the content of the whole periodic advertising list.
BLE_GAP_AD_TYPE_TK_VALUE
@ BLE_GAP_AD_TYPE_TK_VALUE
Temporary key value.
Definition: ble_gapm.h:443
BLE_GAP_AD_TYPE_RAND_TGT_ADDR
@ BLE_GAP_AD_TYPE_RAND_TGT_ADDR
Random Target Address.
Definition: ble_gapm.h:453
GAP_ADV_PROP_DIRECTED_POS
@ GAP_ADV_PROP_DIRECTED_POS
Indicate that advertising targets at a specific device.
Definition: ble_gapm.h:277
gap_adv_period_cfg_t
Configuration for periodic advertising.
Definition: ble_gapm.h:558
gap_ext_adv_param_t::filter_pol
uint8_t filter_pol
Advertising filtering policy (see enum gap_adv_filter_policy_t).
Definition: ble_gapm.h:572
GAP_SCAN_PROP_PHY_1M_BIT
@ GAP_SCAN_PROP_PHY_1M_BIT
Scan advertisement on the LE 1M PHY.
Definition: ble_gapm.h:397
GAP_ADV_PROP_ANONYMOUS_POS
@ GAP_ADV_PROP_ANONYMOUS_POS
Enable anonymous mode.
Definition: ble_gapm.h:283
GAP_ADV_TYPE_ADV_NONCONN_IND
@ GAP_ADV_TYPE_ADV_NONCONN_IND
Non-connectable and non-scanable mode.
Definition: ble_gapm.h:222
gap_ext_init_param_t::conn_to
uint16_t conn_to
Timeout for automatic connection establishment (in unit of 10ms).
Definition: ble_gapm.h:702
GAP_ADV_FLAG_SIMUL_BR_EDR_LE_HOST
@ GAP_ADV_FLAG_SIMUL_BR_EDR_LE_HOST
Dual mode for host supported (BR/EDR/LE): AD Flag.
Definition: ble_gapm.h:474
white_list_t::num
uint8_t num
Number of available items.
Definition: ble_gapm.h:737
ble_gap_ppcp_get
uint16_t ble_gap_ppcp_get(gap_conn_param_t *p_conn_params)
Get GAP Peripheral Preferred Connection Parameters.
GAP_ADV_TYPE_ADV_SCAN_IND
@ GAP_ADV_TYPE_ADV_SCAN_IND
Undirected scannable mode.
Definition: ble_gapm.h:223
TYPE_SCAN
@ TYPE_SCAN
Definition: ble_gapm.h:504
ble_gap_per_adv_list_del
uint16_t ble_gap_per_adv_list_del(const period_adv_list_t *p_pal_list)
Delete the devices out of periodic advertising list.
GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED
@ GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED
Legacy BT not supported: AD Flag.
Definition: ble_gapm.h:472
GAP_ADV_TYPE_ADV_IND
@ GAP_ADV_TYPE_ADV_IND
Undirected connectable and scannable mode.
Definition: ble_gapm.h:221
gap_ad_type_t
gap_ad_type_t
GAP advertising types.
Definition: ble_gapm.h:429
gap_ext_scan_param_t
Parameters for extended scanning.
Definition: ble_gapm.h:627
GAP_ADV_ALLOW_SCAN_WLST_CON_WLST
@ GAP_ADV_ALLOW_SCAN_WLST_CON_WLST
Allow scan and connection requests from white-list devices only.
Definition: ble_gapm.h:245
ble_gap_adv_data_set
uint16_t ble_gap_adv_data_set(uint8_t adv_idx, gap_adv_data_type_t type, const uint8_t *p_data, uint16_t length)
Set Advertising Data, Scan Response Data and Periodic Advertising Data.
gap_adv_prim_cfg_t::phy
gap_le_phy_value_t phy
Indicate on which PHY primary advertising has to be performed.
Definition: ble_gapm.h:539
BLE_GAP_ROLE_NONE
@ BLE_GAP_ROLE_NONE
No role set yet.
Definition: ble_gapm.h:159
MAX_BOND_NUM
#define MAX_BOND_NUM
Maximal bonding number.
Definition: ble_gapm.h:75
gap_init_param_t::peer_addr
gap_bdaddr_t peer_addr
Peer device address.
Definition: ble_gapm.h:668
MAX_WL_NUM
#define MAX_WL_NUM
Maximal white list number.
Definition: ble_gapm.h:76
BLE_GAP_AD_TYPE_MANU_SPECIFIC_DATA
@ BLE_GAP_AD_TYPE_MANU_SPECIFIC_DATA
Manufacturer specific data.
Definition: ble_gapm.h:462
gap_per_sync_param_t::rsvd
uint8_t rsvd
Reserved for future use.
Definition: ble_gapm.h:658
GAP_PHY_2MBPS_VALUE
@ GAP_PHY_2MBPS_VALUE
LE 2M PHY.
Definition: ble_gapm.h:255
GAP_ADV_ALLOW_SCAN_ANY_CON_ANY
@ GAP_ADV_ALLOW_SCAN_ANY_CON_ANY
Allow both scan and connection requests from anyone.
Definition: ble_gapm.h:242
ble_gap_per_adv_list_clear
uint16_t ble_gap_per_adv_list_clear(void)
Clear all the entries in the current periodic advertising list.
GAP_SCAN_PROP_FILT_TRUNC_BIT
@ GAP_SCAN_PROP_FILT_TRUNC_BIT
Filter truncated advertising or scan response reports.
Definition: ble_gapm.h:402
gap_ext_conn_param_t::ce_len
uint16_t ce_len
The length of connection event needed for this LE connection.
Definition: ble_gapm.h:692
GAP_ADV_PROP_HDC_POS
@ GAP_ADV_PROP_HDC_POS
Indicate that High Duty Cycle has to be used for advertising on primary channel, applicable only if c...
Definition: ble_gapm.h:280
ble_gap_adv_param_set
uint16_t ble_gap_adv_param_set(uint8_t adv_idx, gap_own_addr_t own_addr_type, gap_adv_param_t *p_adv_param)
Set parameters for advertising.
BLE_GAP_GET_MAX_LE_ADV_DATA_LEN
@ BLE_GAP_GET_MAX_LE_ADV_DATA_LEN
Get maximum data length for advertising data.
Definition: ble_gapm.h:213
GAP_SCAN_PROP_PHY_CODED_BIT
@ GAP_SCAN_PROP_PHY_CODED_BIT
Scan advertisement on the LE Coded PHY.
Definition: ble_gapm.h:398
GAP_ACTIVITY_ROLE_UNKNOWN
@ GAP_ACTIVITY_ROLE_UNKNOWN
Unknown role.
Definition: ble_gapm.h:495
ble_gap_adv_stop
uint16_t ble_gap_adv_stop(uint8_t adv_idx)
Stop advertising.
GAP_ADV_TYPE_ADV_LOW_DIRECT_IND
@ GAP_ADV_TYPE_ADV_LOW_DIRECT_IND
Directed low duty cycle mode.
Definition: ble_gapm.h:225
BLE_GAP_OWN_ADDR_STATIC
@ BLE_GAP_OWN_ADDR_STATIC
Public or Private Static Address according to device address configuration.
Definition: ble_gapm.h:172
ble_gap_lepsm_unregister
uint16_t ble_gap_lepsm_unregister(uint16_t le_psm)
Unregister a LE Protocol/Service Multiplexer.
ble_gap_appearance_set
void ble_gap_appearance_set(uint16_t appearance)
Set GAP appearance value.
gap_ext_scan_dup_filt_policy_t
gap_ext_scan_dup_filt_policy_t
Filtering policy for duplicated packets.
Definition: ble_gapm.h:366
ble_gap_ext_adv_param_set
uint16_t ble_gap_ext_adv_param_set(uint8_t adv_idx, gap_own_addr_t own_addr_type, gap_ext_adv_param_t *p_adv_param)
Set extended parameters for advertising.
GAP_ADV_PROP_CONNECTABLE_POS
@ GAP_ADV_PROP_CONNECTABLE_POS
Indicate that advertising is connectable, reception of CONNECT_REQ or UX_CONNECT_REQ PDUs is accepted...
Definition: ble_gapm.h:274
gap_adv_flags_t
gap_adv_flags_t
AD Type Flag - Bit mask.
Definition: ble_gapm.h:469
gap_scan_wd_op_param_t::scan_wd
uint16_t scan_wd
Scan window between 0x0004 and 0xFFFF in 0.625 ms (range: 2.5 ms to 40.959375s).
Definition: ble_gapm.h:620
TYPE_INIT
@ TYPE_INIT
Definition: ble_gapm.h:505
BLE_GAP_ADV_DATA_TYPE_PER_DATA
@ BLE_GAP_ADV_DATA_TYPE_PER_DATA
Periodic advertising data.
Definition: ble_gapm.h:196
gap_rslv_addr_read_op_id_t
gap_rslv_addr_read_op_id_t
Operation code used to read resolvable address.
Definition: ble_gapc.h:157
gap_scan_param_t::use_whitelist
bool use_whitelist
Filter policy.
Definition: ble_gapm.h:608
GAP_ADV_PROP_SCANNABLE_POS
@ GAP_ADV_PROP_SCANNABLE_POS
Indicate that advertising is scannable, reception of SCAN_REQ or AUX_SCAN_REQ PDUs is accepted.
Definition: ble_gapm.h:276
ble_gap_update_conn_param_method_set
uint16_t ble_gap_update_conn_param_method_set(uint8_t conn_idx, bool use_l2cap_flag)
Set the method for updating connection parameter.
gap_init_param_t::interval_max
uint16_t interval_max
Maximum value for the connection interval (in unit of 1.25ms).
Definition: ble_gapm.h:671
GAP_ADV_TYPE_LEGACY
@ GAP_ADV_TYPE_LEGACY
Legacy advertising.
Definition: ble_gapm.h:264
gap_ext_init_param_t::conn_param_coded
gap_ext_conn_param_t conn_param_coded
Connection parameters for LE Coded PHY.
Definition: ble_gapm.h:709
ble_gap_rpa_list_get
uint16_t ble_gap_rpa_list_get(ral_dev_list_t *p_rpa_list)
Get the RPA list info.
GAP_ADV_TYPE_PERIODIC
@ GAP_ADV_TYPE_PERIODIC
Periodic advertising.
Definition: ble_gapm.h:266
gap_lepsm_register_t::le_psm
uint16_t le_psm
LE Protocol/Service Multiplexer (range: 1 to 255), PSMs should be odd.
Definition: ble_gapm.h:718
ble_gap_adv_start
uint16_t ble_gap_adv_start(uint8_t adv_idx, gap_adv_time_param_t *p_timeout)
Start advertising.
BLE_GAP_WRITE_PERM_UNAUTH
@ BLE_GAP_WRITE_PERM_UNAUTH
LE Security Mode 1, Level 2.
Definition: ble_gapm.h:184
ble_gap_update_adv_data
uint16_t ble_gap_update_adv_data(uint8_t adv_idx, gap_adv_data_type_t type, const uint8_t *p_data, uint16_t length)
Update Advertising Data, Scan Response Data and Periodic Advertising Data.
gap_scan_param_t::timeout
uint16_t timeout
Scan timeout should be a value between 0x0001 and 0xFFFF(unit: 10 ms).
Definition: ble_gapm.h:611
BLE_GAP_AD_TYPE_RQRD_128_BIT_SVC_UUID
@ BLE_GAP_AD_TYPE_RQRD_128_BIT_SVC_UUID
Require 128-bit service UUID.
Definition: ble_gapm.h:448
gap_ext_scan_type_t
gap_ext_scan_type_t
Extended scanning types.
Definition: ble_gapm.h:340
gap_adv_param_t::chnl_map
uint8_t chnl_map
Advertising channel map.
Definition: ble_gapm.h:525
gap_lepsm_register_t::mks_flag
bool mks_flag
Whether to use maximum-size key (16 bytes) or not.
Definition: ble_gapm.h:720
gap_ral_dev_info_t::priv_mode
uint8_t priv_mode
Privacy mode, see enum privacy_mode_t.
Definition: ble_gapm.h:756
gap_period_adv_addr_cfg_t::bd_addr
gap_bdaddr_t bd_addr
Advertiser address information.
Definition: ble_gapm.h:645
GAP_ADV_PROP_ANONYMOUS_BIT
@ GAP_ADV_PROP_ANONYMOUS_BIT
Definition: ble_gapm.h:302
GAP_EXT_SCAN_PROP_ACCEPT_RPA_BIT
@ GAP_EXT_SCAN_PROP_ACCEPT_RPA_BIT
Accept directed advertising packets if the uesd RPA and target address cannot be solved by the contro...
Definition: ble_gapm.h:358
bond_dev_list_t
Bonded device list.
Definition: ble_gapm.h:727
GAP_ADV_TYPE_ADV_HIGH_DIRECT_IND
@ GAP_ADV_TYPE_ADV_HIGH_DIRECT_IND
Directed high duty cycle mode.
Definition: ble_gapm.h:224
gap_per_sync_param_t
Periodic advertising synchronization parameters.
Definition: ble_gapm.h:653
ble_gap_ext_connect
uint16_t ble_gap_ext_connect(gap_own_addr_t own_addr_type, gap_ext_init_param_t *p_init_param)
Start an extended connection to a device.
ble_gap_bond_dev_addr_get
uint16_t ble_gap_bond_dev_addr_get(uint8_t conn_idx, gap_bdaddr_t *p_peer_addr)
Get BD address of the bonded device.
ble_gap_appearance_get
uint16_t ble_gap_appearance_get(uint16_t *p_appearance)
Get GAP appearance value.
gap_ext_adv_param_t::prim_cfg
gap_adv_prim_cfg_t prim_cfg
Configuration for primary advertising.
Definition: ble_gapm.h:574
TYPE_PER_SYNC
@ TYPE_PER_SYNC
Definition: ble_gapm.h:506
gap_ext_adv_param_t::period_cfg
gap_adv_period_cfg_t period_cfg
Configuration for periodic advertising (valid only if advertising type is GAP_ADV_TYPE_PERIODIC).
Definition: ble_gapm.h:576
gap_ral_dev_info_t
RPA list item info.
Definition: ble_gapm.h:754
gap_conn_param_t
The parameter of connection.
Definition: ble_gapc.h:354
ble_gap_ppcp_set
uint16_t ble_gap_ppcp_set(gap_conn_param_t const *p_conn_params)
Set GAP Peripheral Preferred Connection Parameters.
gap_ext_scan_param_t::scan_param_1m
gap_scan_wd_op_param_t scan_param_1m
Scan window opening parameters for LE 1M PHY.
Definition: ble_gapm.h:632
gap_scan_mode_t
gap_scan_mode_t
Scanning modes.
Definition: ble_gapm.h:321
BLE_GAP_AD_TYPE_MORE_16_BIT_UUID
@ BLE_GAP_AD_TYPE_MORE_16_BIT_UUID
Use of more than 16-bit UUID.
Definition: ble_gapm.h:431
gap_ext_init_param_t::scan_param_1m
gap_scan_wd_op_param_t scan_param_1m
Scan window opening parameters for LE 1M PHY.
Definition: ble_gapm.h:705
ble_gap_device_name_get
uint16_t ble_gap_device_name_get(uint8_t *p_dev_name, uint16_t *p_length)
Get GAP device name.
BLE_GAP_AD_TYPE_3D_INFO
@ BLE_GAP_AD_TYPE_3D_INFO
3D Information Data.
Definition: ble_gapm.h:460
GAP_ADV_PROP_PER_TX_PWR_BIT
@ GAP_ADV_PROP_PER_TX_PWR_BIT
Definition: ble_gapm.h:304
gap_adv_param_t::adv_mode
uint8_t adv_mode
Advertising mode (see enum gap_adv_mode_t).
Definition: ble_gapm.h:519
gap_scan_param_t::scan_type
gap_scan_type_t scan_type
Active scanning or passive scanning.
Definition: ble_gapm.h:605
GAP_ADV_ALLOW_SCAN_WLST_CON_ANY
@ GAP_ADV_ALLOW_SCAN_WLST_CON_ANY
Allow scan req from white-list devices only and connection req from anyone.
Definition: ble_gapm.h:243
ble_gap_tx_power_set
uint16_t ble_gap_tx_power_set(gap_activity_role_t role, uint8_t index, int8_t txpwr_dbm)
Set the tx power.
gap_ext_adv_param_t::max_tx_pwr
int8_t max_tx_pwr
Maximum power level at which the advertising packets have to be transmitted (between -20 and 7 dBm).
Definition: ble_gapm.h:571
ble_gap_lepsm_register
uint16_t ble_gap_lepsm_register(gap_lepsm_register_t *p_lepsm)
Register a LE Protocol/Service Multiplexer.
gap_adv_prim_cfg_t
Configuration for advertising on primary channel.
Definition: ble_gapm.h:535
gap_ext_init_param_t::type
uint8_t type
Initiating type (see enum gap_init_type_t).
Definition: ble_gapm.h:700
GAP_EXT_SCAN_TYPE_LIM_DISC
@ GAP_EXT_SCAN_TYPE_LIM_DISC
Limited discovery.
Definition: ble_gapm.h:342
gap_scan_param_t::scan_dup_filt
gap_scan_dup_filt_policy_t scan_dup_filt
Duplicate filter policy.
Definition: ble_gapm.h:607
gap_ext_adv_param_t
Advertising parameters for extended advertising and periodic advertising.
Definition: ble_gapm.h:567
GAP_DISC_MODE_BROADCASTER
@ GAP_DISC_MODE_BROADCASTER
Broadcaster mode.
Definition: ble_gapm.h:234
BLE_GAP_AD_TYPE_SP_HASH_C
@ BLE_GAP_AD_TYPE_SP_HASH_C
Simple Pairing Hash C.
Definition: ble_gapm.h:441
gap_ral_dev_info_t::bd_addr
gap_bdaddr_t bd_addr
Peer device identity.
Definition: ble_gapm.h:755
GAP_ACTIVITY_ROLE_SCAN_INIT
@ GAP_ACTIVITY_ROLE_SCAN_INIT
Scann role.
Definition: ble_gapm.h:494
BLE_GAP_AD_TYPE_PUB_TGT_ADDR
@ BLE_GAP_AD_TYPE_PUB_TGT_ADDR
Public Target Address.
Definition: ble_gapm.h:452
rpa_addr_report_callback_t
void(* rpa_addr_report_callback_t)(ble_actv_type_t type, uint8_t index, const uint8_t *rpa_addr)
The BLE rpa address report callback.
Definition: ble_gapm.h:778
GAP_ADV_ALLOW_SCAN_ANY_CON_WLST
@ GAP_ADV_ALLOW_SCAN_ANY_CON_WLST
Allow scan req from anyone and connection req from white-list devices only.
Definition: ble_gapm.h:244
GAP_ADV_PROP_USE_LEGACY_PDUS_POS
@ GAP_ADV_PROP_USE_LEGACY_PDUS_POS
Use legacy advertising PDUs.
Definition: ble_gapm.h:282
ble_gap_privacy_params_set
uint16_t ble_gap_privacy_params_set(uint16_t renew_dur, bool enable_flag)
Set privacy related parameters.
ble_gap_bond_dev_del
uint16_t ble_gap_bond_dev_del(const gap_bdaddr_t *p_peer_addr)
Delete a bond device with the specified BD address.
gap_per_sync_type
gap_per_sync_type
Periodic synchronization types.
Definition: ble_gapm.h:409
gap_adv_period_cfg_t::adv_intv_min
uint16_t adv_intv_min
Minimum advertising interval (in unit of 1.25 ms).
Definition: ble_gapm.h:559
BLE_GAP_AD_TYPE_RQRD_32_BIT_SVC_UUID
@ BLE_GAP_AD_TYPE_RQRD_32_BIT_SVC_UUID
Require 32-bit service UUID.
Definition: ble_gapm.h:447
gap_dev_info_get_type_t
gap_dev_info_get_type_t
Get device parameters operation code.
Definition: ble_gapm.h:202
BLE_GAP_AD_TYPE_OOB_FLAGS
@ BLE_GAP_AD_TYPE_OOB_FLAGS
Out of Band Flag.
Definition: ble_gapm.h:444
gap_sec_key_t
Security key.
Definition: ble_gapm.h:596
GAP_PHY_1MBPS_VALUE
@ GAP_PHY_1MBPS_VALUE
LE 1M PHY.
Definition: ble_gapm.h:254
GAP_ACTIVITY_ROLE_CON
@ GAP_ACTIVITY_ROLE_CON
Connect role.
Definition: ble_gapm.h:493
MAX_KEY_LEN
#define MAX_KEY_LEN
The key length.
Definition: ble_gapm.h:79
TYPE_ADV
@ TYPE_ADV
Definition: ble_gapm.h:503
gap_adv_param_t::peer_addr
gap_bdaddr_t peer_addr
Peer address configuration (only used in case of directed advertising, or used to locate the IRK list...
Definition: ble_gapm.h:522
ble_gap_whitelist_clear
uint16_t ble_gap_whitelist_clear(void)
Clear all the entries in the current white list.
BLE_GAP_AD_TYPE_CLASS_OF_DEVICE
@ BLE_GAP_AD_TYPE_CLASS_OF_DEVICE
Class of device.
Definition: ble_gapm.h:440
GAP_EXT_DUP_FILT_EN_PERIOD
@ GAP_EXT_DUP_FILT_EN_PERIOD
Enable filtering of duplicated packets, reset for each scan period.
Definition: ble_gapm.h:369
gap_init_param_t::slave_latency
uint16_t slave_latency
Slave latency.
Definition: ble_gapm.h:673
gap_scan_wd_op_param_t::scan_intv
uint16_t scan_intv
Scan interval between 0x0004 and 0xFFFF in 0.625 ms (range: 2.5 ms to 40.959375s).
Definition: ble_gapm.h:619
gap_ext_init_param_t::conn_param_2m
gap_ext_conn_param_t conn_param_2m
Connection parameters for LE 2M PHY.
Definition: ble_gapm.h:708
GAP_EXT_SCAN_TYPE_GEN_DISC
@ GAP_EXT_SCAN_TYPE_GEN_DISC
General discovery.
Definition: ble_gapm.h:341
ble_gap_device_name_set
uint16_t ble_gap_device_name_set(gap_dev_name_write_perm_t write_perm, uint8_t const *p_dev_name, uint16_t length)
Set GAP device name.
GAP_EXT_SCAN_PROP_FILT_TRUNC_BIT
@ GAP_EXT_SCAN_PROP_FILT_TRUNC_BIT
Filter truncated advertising or scan response reports.
Definition: ble_gapm.h:359
ble_gap_per_adv_list_add
uint16_t ble_gap_per_adv_list_add(const period_adv_list_t *p_pal_list)
Add the devices into current periodic advertising list.
ble_gap_whitelist_del
uint16_t ble_gap_whitelist_del(const white_list_t *p_whitelist)
Delete the devices out of current white list.
BLE_GAP_ROLE_BROADCASTER
@ BLE_GAP_ROLE_BROADCASTER
Broadcaster role.
Definition: ble_gapm.h:161
gap_ext_scan_param_t::type
uint8_t type
Type of scanning to be started (see enum gap_ext_scan_type_t).
Definition: ble_gapm.h:628
BLE_GAP_AD_TYPE_RQRD_16_BIT_SVC_UUID
@ BLE_GAP_AD_TYPE_RQRD_16_BIT_SVC_UUID
Require 16-bit service UUID.
Definition: ble_gapm.h:446
GAP_EXT_SCAN_TYPE_OBSERVER
@ GAP_EXT_SCAN_TYPE_OBSERVER
Observer.
Definition: ble_gapm.h:343
BLE_GAP_GET_DEV_TX_POWER
@ BLE_GAP_GET_DEV_TX_POWER
Read the minimum and maximum transmit powers supported by the Controller.
Definition: ble_gapm.h:214
ral_dev_list_t
RPA list info.
Definition: ble_gapm.h:765
gap_adv_param_t::filter_pol
uint8_t filter_pol
Advertising filtering policy (see enum gap_adv_filter_policy_t).
Definition: ble_gapm.h:521
gap_lepsm_register_t
LE Protocol/Service Multiplexer information.
Definition: ble_gapm.h:717
BLE_GAP_AD_TYPE_SPAIR_HASH
@ BLE_GAP_AD_TYPE_SPAIR_HASH
Simple Pairing Hash C-256.
Definition: ble_gapm.h:458
gap_ext_init_param_t
Extended initiating parameters.
Definition: ble_gapm.h:699
GAP_PER_SYNC_TYPE_SELECTIVE
@ GAP_PER_SYNC_TYPE_SELECTIVE
Use periodic advertiser list for synchronization.
Definition: ble_gapm.h:411
GAP_ADV_PROP_DIRECTED_BIT
@ GAP_ADV_PROP_DIRECTED_BIT
Definition: ble_gapm.h:299
privacy_mode_t
privacy_mode_t
Privacy mode.
Definition: ble_gapm.h:482
gap_scan_prop_t
gap_scan_prop_t
Scanning properties bit field bit value.
Definition: ble_gapm.h:353