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>
60 #include <stddef.h>
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 BLE_GAP_MAX_ADV_NUM 5 /**< Maximal advertising instance number. */
74 #define BLE_GAP_MAX_PER_SYNC_NUM 5 /**< Maximal periodic syncronization instance number. */
75 #define BLE_GAP_MAX_BOND_NUM 10 /**< Maximal bonding number. */
76 #define BLE_GAP_MAX_WL_NUM 10 /**< Maximal white list number. */
77
78 #define BLE_GAP_MAX_PRD_ADV_NUM 4 /**< Maximal periodic advertising list number. */
79 #define BLE_GAP_MAX_KEY_LEN 16 /**< The key length. */
80 #define BLE_GAP_NVALID_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 BLE_GAP_ADV_CHANNEL_37 0x01 /**< Advertising Channel 37 (2402MHz). */
146 #define BLE_GAP_ADV_CHANNEL_38 0x02 /**< Advertising Channel 38 (2426MHz). */
147 #define BLE_GAP_ADV_CHANNEL_39 0x04 /**< Advertising Channel 39 (2480MHz). */
148 #define BLE_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 } ble_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 } ble_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 } ble_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 } ble_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 } ble_gap_dev_info_get_type_t;
217
218 /**@brief GAP advertising modes. */
219 typedef enum
220 {
221 BLE_GAP_ADV_TYPE_ADV_IND = 0, /**< Undirected connectable and scannable mode. */
222 BLE_GAP_ADV_TYPE_ADV_NONCONN_IND, /**< Non-connectable and non-scanable mode. */
223 BLE_GAP_ADV_TYPE_ADV_SCAN_IND, /**< Undirected scannable mode. */
224 BLE_GAP_ADV_TYPE_ADV_HIGH_DIRECT_IND, /**< Directed high duty cycle mode. */
225 BLE_GAP_ADV_TYPE_ADV_LOW_DIRECT_IND, /**< Directed low duty cycle mode. */
226 } ble_gap_adv_mode_t;
227
228 /**@brief GAP discoverability modes. */
229 typedef enum
230 {
231 BLE_GAP_DISC_MODE_NON_DISCOVERABLE = 0, /**< Non-discoverable mode. */
232 BLE_GAP_DISC_MODE_GEN_DISCOVERABLE, /**< General-discoverable mode. */
233 BLE_GAP_DISC_MODE_LIM_DISCOVERABLE, /**< Limited-discoverable mode. */
234 BLE_GAP_DISC_MODE_BROADCASTER, /**< Broadcaster mode. */
235 } ble_gap_disc_mode_t;
236
237 /**
238 * @brief Advertising filter policy
239 */
240 typedef enum
241 {
242 BLE_GAP_ADV_ALLOW_SCAN_ANY_CON_ANY = 0, /**< Allow both scan and connection requests from anyone. */
243 BLE_GAP_ADV_ALLOW_SCAN_WLST_CON_ANY, /**< Allow scan req from white-list devices only and connection req from anyone. */
244 BLE_GAP_ADV_ALLOW_SCAN_ANY_CON_WLST, /**< Allow scan req from anyone and connection req from white-list devices only. */
245 BLE_GAP_ADV_ALLOW_SCAN_WLST_CON_WLST, /**< Allow scan and connection requests from white-list devices only. */
246 } ble_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 BLE_GAP_PHY_UNDEF_VALUE = 0, /**< Undefined LE PHY. */
254 BLE_GAP_PHY_1MBPS_VALUE = 1, /**< LE 1M PHY. */
255 BLE_GAP_PHY_2MBPS_VALUE = 2, /**< LE 2M PHY. */
256 BLE_GAP_PHY_CODED_VALUE = 3, /**< LE Coded PHY. */
257 } ble_gap_le_phy_value_t;
258
259 /**
260 * @brief Advertising type
261 */
262 typedef enum
263 {
264 BLE_GAP_ADV_TYPE_LEGACY = 0, /**< Legacy advertising. */
265 BLE_GAP_ADV_TYPE_EXTENDED, /**< Extended advertising. */
266 BLE_GAP_ADV_TYPE_PERIODIC, /**< Periodic advertising. */
267 } ble_gap_adv_type_t;
268
269 /**
270 * @brief Advertising properties bit field and bit positions
271 */
272 typedef enum
273 {
274 BLE_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 BLE_GAP_ADV_PROP_SCANNABLE_POS, /**< Indicate that advertising is scannable, reception of SCAN_REQ or AUX_SCAN_REQ PDUs is accepted. */
277 BLE_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 BLE_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 BLE_GAP_ADV_PROP_USE_LEGACY_PDUS_POS, /**< Use legacy advertising PDUs. */
283 BLE_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 BLE_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 BLE_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 BLE_GAP_ADV_PROP_SCAN_REQ_NTF_EN_POS, /**< Indicate if application must be informed about receiving scan request PDUs. */
290 } ble_gap_adv_prop_pos_t;
291
292 /**
293 * @brief Advertising properties bit field bit value
294 */
295 typedef enum
296 {
297 BLE_GAP_ADV_PROP_CONNECTABLE_BIT = CO_BIT(BLE_GAP_ADV_PROP_CONNECTABLE_POS),
298 BLE_GAP_ADV_PROP_SCANNABLE_BIT = CO_BIT(BLE_GAP_ADV_PROP_SCANNABLE_POS),
299 BLE_GAP_ADV_PROP_DIRECTED_BIT = CO_BIT(BLE_GAP_ADV_PROP_DIRECTED_POS),
300 BLE_GAP_ADV_PROP_HDC_BIT = CO_BIT(BLE_GAP_ADV_PROP_HDC_POS),
301 BLE_GAP_ADV_PROP_USE_LEGACY_PDUS_BIT = CO_BIT(BLE_GAP_ADV_PROP_USE_LEGACY_PDUS_POS),
302 BLE_GAP_ADV_PROP_ANONYMOUS_BIT = CO_BIT(BLE_GAP_ADV_PROP_ANONYMOUS_POS),
303 BLE_GAP_ADV_PROP_TX_PWR_BIT = CO_BIT(BLE_GAP_ADV_PROP_TX_PWR_POS),
304 BLE_GAP_ADV_PROP_PER_TX_PWR_BIT = CO_BIT(BLE_GAP_ADV_PROP_PER_TX_PWR_POS),
305 BLE_GAP_ADV_PROP_SCAN_REQ_NTF_EN_BIT = CO_BIT(BLE_GAP_ADV_PROP_SCAN_REQ_NTF_EN_POS),
306 } ble_gap_adv_prop_t;
307
308 /**
309 * @brief Scanning types
310 */
311 typedef enum
312 {
313 BLE_GAP_SCAN_ACTIVE = 0, /**< Active scan type. */
314 BLE_GAP_SCAN_PASSIVE, /**< Passive scan type. */
315 } ble_gap_scan_type_t;
316
317 /**
318 * @brief Scanning modes
319 */
320 typedef enum
321 {
322 BLE_GAP_SCAN_GEN_DISC_MODE = 0, /**< General discoverable mode. */
323 BLE_GAP_SCAN_LIM_DISC_MODE, /**< Limited discoverable mode. */
324 BLE_GAP_SCAN_OBSERVER_MODE, /**< Observer mode. */
325 } ble_gap_scan_mode_t;
326
327 /**
328 * @brief Duplicate filter policy
329 */
330 typedef enum
331 {
332 BLE_GAP_SCAN_FILT_DUPLIC_DIS = 0, /**< Disable filtering of duplicate packets. */
333 BLE_GAP_SCAN_FILT_DUPLIC_EN, /**< Enable filtering of duplicate packets. */
334 } ble_gap_scan_dup_filt_policy_t;
335
336 /**
337 * @brief Extended scanning types
338 */
339 typedef enum
340 {
341 BLE_GAP_EXT_SCAN_TYPE_GEN_DISC = 0, /**< General discovery. */
342 BLE_GAP_EXT_SCAN_TYPE_LIM_DISC, /**< Limited discovery. */
343 BLE_GAP_EXT_SCAN_TYPE_OBSERVER, /**< Observer. */
344 BLE_GAP_EXT_SCAN_TYPE_SEL_OBSERVER, /**< Selective observer. */
345 BLE_GAP_EXT_SCAN_TYPE_CONN_DISC, /**< Connectable discovery. */
346 BLE_GAP_EXT_SCAN_TYPE_SEL_CONN_DISC, /**< Selective connectable discovery. */
347 } ble_gap_ext_scan_type_t;
348
349 /**
350 * @brief Filtering policy for duplicated packets
351 */
352 typedef enum
353 {
354 BLE_GAP_EXT_DUP_FILT_DIS = 0, /**< Disable filtering of duplicated packets. */
355 BLE_GAP_EXT_DUP_FILT_EN, /**< Enable filtering of duplicated packets. */
356 BLE_GAP_EXT_DUP_FILT_EN_PERIOD, /**< Enable filtering of duplicated packets, reset for each scan period. */
357 } ble_gap_ext_scan_dup_filt_policy_t;
358
359 /**
360 * @brief Initiating types
361 */
362 typedef enum
363 {
364 BLE_GAP_INIT_TYPE_DIRECT_CONN_EST = 0, /**< Direct connection establishment: establish a connection with an indicated device. */
365 BLE_GAP_INIT_TYPE_AUTO_CONN_EST, /**< Automatic connection establishment: establish a connection with all devices whose address is present in the white list. */
366 BLE_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. */
367 } ble_gap_init_type_t;
368
369 /**
370 * @brief Initiating properties
371 */
372 typedef enum
373 {
374 BLE_GAP_INIT_PROP_1M_BIT = (1 << 0), /**< Scan connectable advertisements on the LE 1M PHY. Connection parameters for the LE 1M PHY are provided. */
375 BLE_GAP_INIT_PROP_2M_BIT = (1 << 1), /**< Connection parameters for the LE 2M PHY are provided. */
376 BLE_GAP_INIT_PROP_CODED_BIT = (1 << 2), /**< Scan connectable advertisements on the LE Coded PHY. Connection parameters for the LE Coded PHY are provided. */
377 } ble_gap_init_prop_t;
378
379 /**
380 * @brief Scanning properties bit field bit value
381 */
382 typedef enum
383 {
384 BLE_GAP_SCAN_PROP_PHY_1M_BIT = (1 << 0), /**< Scan advertisement on the LE 1M PHY. */
385 BLE_GAP_SCAN_PROP_PHY_CODED_BIT = (1 << 1), /**< Scan advertisement on the LE Coded PHY. */
386 BLE_GAP_SCAN_PROP_ACTIVE_1M_BIT = (1 << 2), /**< Active scan on LE 1M PHY (scan request PDUs may be sent). */
387 BLE_GAP_SCAN_PROP_ACTIVE_CODED_BIT = (1 << 3), /**< Active scan on LE Coded PHY (scan request PDUs may be sent). */
388 BLE_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. */
389 BLE_GAP_SCAN_PROP_FILT_TRUNC_BIT = (1 << 5), /**< Filter truncated advertising or scan response reports. */
390 } ble_gap_scan_prop_t;
391
392 /**
393 * @brief Periodic synchronization types
394 */
395 typedef enum
396 {
397 BLE_GAP_PER_SYNC_TYPE_GENERAL = 0, /**< Do not use periodic advertiser list for synchronization. */
398 BLE_GAP_PER_SYNC_TYPE_SELECTIVE, /**< Use periodic advertiser list for synchronization. */
399 } ble_gap_per_sync_type_t;
400
401 /**
402 * @brief Security level types
403 */
404 typedef enum
405 {
406 BLE_GAP_SEC_LVL_NO_SECURITY = 0, /**< No encryption or auth. */
407 BLE_GAP_SEC_LVL_ENC_NO_AUTH, /**< Encryption with no auth. */
408 BLE_GAP_SEC_LVL_LE_ENC_AUTH, /**< Legacy encryption with auth. */
409 BLE_GAP_SEC_LVL_SC_ENC_AUTH, /**< Security connection encryption with auth. */
410 } ble_gap_sec_lvl_type_t;
411
412 /**
413 * @brief GAP advertising types
414 */
415 typedef enum
416 {
417 BLE_GAP_AD_TYPE_FLAGS = 0x01, /**< Flag. */
418 BLE_GAP_AD_TYPE_MORE_16_BIT_UUID = 0x02, /**< Use of more than 16-bit UUID. */
419 BLE_GAP_AD_TYPE_COMPLETE_LIST_16_BIT_UUID = 0x03, /**< Complete List of 16-bit UUID. */
420 BLE_GAP_AD_TYPE_MORE_32_BIT_UUID = 0x04, /**< Use of more than 32-bit UUD. */
421 BLE_GAP_AD_TYPE_COMPLETE_LIST_32_BIT_UUID = 0x05, /**< Complete List of 32-bit UUID. */
422 BLE_GAP_AD_TYPE_MORE_128_BIT_UUID = 0x06, /**< Use of more than 128-bit UUID. */
423 BLE_GAP_AD_TYPE_COMPLETE_LIST_128_BIT_UUID = 0x07, /**< Complete List of 128-bit UUID. */
424 BLE_GAP_AD_TYPE_SHORTENED_NAME = 0x08, /**< Shortened Device name. */
425 BLE_GAP_AD_TYPE_COMPLETE_NAME = 0x09, /**< Complete Device name. */
426 BLE_GAP_AD_TYPE_TRANSMIT_POWER = 0x0A, /**< Transmit power. */
427 BLE_GAP_AD_TYPE_CLASS_OF_DEVICE = 0x0D, /**< Class of device. */
428 BLE_GAP_AD_TYPE_SP_HASH_C = 0x0E, /**< Simple Pairing Hash C. */
429 BLE_GAP_AD_TYPE_SP_RANDOMIZER_R = 0x0F, /**< Simple Pairing Randomizer. */
430 BLE_GAP_AD_TYPE_TK_VALUE = 0x10, /**< Temporary key value. */
431 BLE_GAP_AD_TYPE_OOB_FLAGS = 0x11, /**< Out of Band Flag. */
432 BLE_GAP_AD_TYPE_SLAVE_CONN_INT_RANGE = 0x12, /**< Slave connection interval range. */
433 BLE_GAP_AD_TYPE_RQRD_16_BIT_SVC_UUID = 0x14, /**< Require 16-bit service UUID. */
434 BLE_GAP_AD_TYPE_RQRD_32_BIT_SVC_UUID = 0x1F, /**< Require 32-bit service UUID. */
435 BLE_GAP_AD_TYPE_RQRD_128_BIT_SVC_UUID = 0x15, /**< Require 128-bit service UUID. */
436 BLE_GAP_AD_TYPE_SERVICE_16_BIT_DATA = 0x16, /**< Service data 16-bit UUID. */
437 BLE_GAP_AD_TYPE_SERVICE_32_BIT_DATA = 0x20, /**< Service data 32-bit UUID. */
438 BLE_GAP_AD_TYPE_SERVICE_128_BIT_DATA = 0x21, /**< Service data 128-bit UUID. */
439 BLE_GAP_AD_TYPE_PUB_TGT_ADDR = 0x17, /**< Public Target Address. */
440 BLE_GAP_AD_TYPE_RAND_TGT_ADDR = 0x18, /**< Random Target Address. */
441 BLE_GAP_AD_TYPE_APPEARANCE = 0x19, /**< Appearance. */
442 BLE_GAP_AD_TYPE_ADV_INTV = 0x1A, /**< Advertising Interval. */
443 BLE_GAP_AD_TYPE_LE_BT_ADDR = 0x1B, /**< LE Bluetooth Device Address. */
444 BLE_GAP_AD_TYPE_LE_ROLE = 0x1C, /**< LE Role. */
445 BLE_GAP_AD_TYPE_SPAIR_HASH = 0x1D, /**< Simple Pairing Hash C-256. */
446 BLE_GAP_AD_TYPE_SPAIR_RAND = 0x1E, /**< Simple Pairing Randomizer R-256. */
447 BLE_GAP_AD_TYPE_3D_INFO = 0x3D, /**< 3D Information Data. */
448
449 BLE_GAP_AD_TYPE_MANU_SPECIFIC_DATA = 0xFF, /**< Manufacturer specific data. */
450 } ble_gap_ad_type_t;
451
452 /**
453 * @brief AD Type Flag - Bit mask.
454 */
455 typedef enum
456 {
457 BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE = 0x01, /**< Limited discovery flag: AD Flag. */
458 BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE = 0x02, /**< General discovery flag: AD Flag. */
459 BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED = 0x04, /**< Legacy BT not supported: AD Flag. */
460 BLE_GAP_ADV_FLAG_SIMUL_BR_EDR_LE_CONTROLLER = 0x08, /**< Dual mode for controller supported (BR/EDR/LE): AD Flag. */
461 BLE_GAP_ADV_FLAG_SIMUL_BR_EDR_LE_HOST = 0x10, /**< Dual mode for host supported (BR/EDR/LE): AD Flag. */
462 } ble_gap_adv_flags_t;
463
464 /** @brief Advertising report type. */
465 typedef enum
466 {
467 BLE_GAP_REPORT_TYPE_ADV_EXT = 0, /**< Extended advertising report. */
468 BLE_GAP_REPORT_TYPE_ADV_LEG, /**< Legacy advertising report. */
469 BLE_GAP_REPORT_TYPE_SCAN_RSP_EXT, /**< Extended scan response report. */
470 BLE_GAP_REPORT_TYPE_SCAN_RSP_LEG, /**< Legacy scan response report. */
471 BLE_GAP_REPORT_TYPE_PER_ADV, /**< Periodic advertising report. */
472 } ble_gap_adv_report_type_t;
473
474 /** @brief Advertising report information. */
475 typedef enum
476 {
477 BLE_GAP_REPORT_INFO_COMPLETE_BIT = (1 << 0), /**< Report is complete. */
478 BLE_GAP_REPORT_INFO_CONN_ADV_BIT = (1 << 1), /**< Connectable advertising. */
479 BLE_GAP_REPORT_INFO_SCAN_ADV_BIT = (1 << 2), /**< Scannable advertising. */
480 BLE_GAP_REPORT_INFO_DIR_ADV_BIT = (1 << 3), /**< Directed advertising. */
481 } ble_gap_adv_report_info_t;
482
483 /** @brief Stop reason code. */
484 typedef enum
485 {
486 BLE_GAP_STOPPED_REASON_TIMEOUT = 0, /**< Stop with timeout. */
487 BLE_GAP_STOPPED_REASON_ON_USER, /**< Stop with user stopping it actively. */
488 BLE_GAP_STOPPED_REASON_CONN_EST /**< Stop with connection established. */
489 } ble_gap_stopped_reason_t;
490
491 /**
492 * @brief Privacy mode.
493 */
494
495 typedef enum
496 {
497 BLE_GAP_PRIVACY_MODE_NETWORK= 0x00, /**< Set to the network privacy mode for the peer device. */
498 BLE_GAP_PRIVACY_MODE_DEVICE = 0x01, /**< Set to the device privacy mode for the peer device. */
499 } ble_gap_privacy_mode_t;
500
501 /**
502 * @brief Possible roles of the activity.
503 */
504 typedef enum
505 {
506 BLE_GAP_ACTIVITY_ROLE_ADV = 0, /**< Adertise role. */
507 BLE_GAP_ACTIVITY_ROLE_CON = 1, /**< Connect role. */
508 BLE_GAP_ACTIVITY_ROLE_SCAN_INIT = 2, /**< Scann role. */
509 BLE_GAP_ACTIVITY_ROLE_UNKNOWN = 0xf, /**< Unknown role. */
510 } ble_gap_actv_role_t;
511
512 /**
513 * @brief Clock ACC error.
514 */
515 typedef enum
516 {
517 BLE_GAP_CLK_ACC_500 = 0, /**< 500 ppm. */
518 BLE_GAP_CLK_ACC_250, /**< 250 ppm. */
519 BLE_GAP_CLK_ACC_150, /**< 150 ppm. */
520 BLE_GAP_CLK_ACC_100, /**< 10 ppm. */
521 BLE_GAP_CLK_ACC_75, /**< 70 ppm. */
522 BLE_GAP_CLK_ACC_50, /**< 50 ppm. */
523 BLE_GAP_CLK_ACC_30, /**< 30 ppm. */
524 BLE_GAP_CLK_ACC_20, /**< 20 ppm. */
525 } ble_gap_clk_acc_t;
526
527 /**
528 * @brief Activity type.
529 */
530 typedef enum
531 {
532 BLE_GAP_ACTV_TYPE_ADV = 0,
533 BLE_GAP_ACTV_TYPE_SCAN,
534 BLE_GAP_ACTV_TYPE_INIT,
535 BLE_GAP_ACTV_TYPE_PER_SYNC,
536 } ble_gap_actv_type_t;
537
538 /** @} */
539
540 /**@addtogroup BLE_GAPM_STRUCTURES Structures
541 * @{ */
542
543 /**
544 * @brief Advertising parameters for legacy advertising
545 */
546 typedef struct
547 {
548 ble_gap_adv_mode_t adv_mode; /**< Advertising mode (see enum @ref ble_gap_adv_mode_t). */
549 ble_gap_disc_mode_t disc_mode; /**< Discovery mode (see enum @ref ble_gap_disc_mode_t). */
550 ble_gap_adv_filter_policy_t filter_pol; /**< Advertising filtering policy (see enum @ref ble_gap_adv_filter_policy_t). */
551 ble_gap_bdaddr_t peer_addr; /**< Peer address configuration (only used in case of directed advertising, or used to locate the IRK list). */
552 uint16_t adv_intv_min; /**< Minimum advertising interval (in unit of 625 us). Must be greater than 20 ms. */
553 uint16_t adv_intv_max; /**< Maximum advertising interval (in unit of 625 us). Must be greater than 20 ms. */
554 uint8_t chnl_map; /**< Advertising channel map. See @ref BLE_GAP_ADV_CHANNEL. */
555 bool scan_req_ind_en; /**< Indicate if the application should be informed when receiving a scan request from the scanner. */
556 int8_t max_tx_pwr; /**< Maximum power level at which the advertising packets have to be transmitted (between -20dbm and 7dbm).For the real value, please refer to Datasheet. */
557 } ble_gap_adv_param_t;
558
559 /**
560 * @brief Configuration for advertising on primary channel
561 */
562 typedef struct
563 {
564 uint32_t adv_intv_min; /**< Minimum advertising interval (in unit of 625 us). Must be greater than 20 ms. */
565 uint32_t adv_intv_max; /**< Maximum advertising interval (in unit of 625 us). Must be greater than 20 ms. */
566 uint8_t chnl_map; /**< Bit field indicating the channel map. See @ref BLE_GAP_ADV_CHANNEL. */
567 ble_gap_le_phy_value_t phy; /**< Indicate on which PHY primary advertising has to be performed. See enum @ref ble_gap_le_phy_value_t. Note that LE 2M PHY is not allowed and that legacy advertising only supports LE 1M PHY. */
568 } ble_gap_adv_prim_cfg_t;
569
570 /**
571 * @brief Configuration for advertising on secondary channel
572 */
573 typedef struct
574 {
575 uint8_t max_skip; /**< Maximum number of advertising events the controller can skip before sending the AUX_ADV_IND packets. The range is 0x00 to 0xFF. 0x00 means that AUX_ADV_IND PDUs shall be sent prior to each advertising events. */
576 ble_gap_le_phy_value_t phy; /**< Indicate on which PHY secondary advertising has to be performed. See enum @ref ble_gap_le_phy_value_t. */
577 uint8_t adv_sid; /**< Advertising SID. Allowed range is 0x00 to 0x0F. */
578 } ble_gap_adv_second_cfg_t;
579
580 /**
581 * @brief Configuration for periodic advertising
582 */
583 typedef struct
584 {
585 uint16_t adv_intv_min; /**< Minimum advertising interval (in unit of 1.25 ms). Must be greater than 20 ms. */
586 uint16_t adv_intv_max; /**< Maximum advertising interval (in unit of 1.25 ms). Must be greater than 20 ms. */
587 } ble_gap_adv_period_cfg_t;
588
589 /**
590 * @brief Advertising parameters for extended advertising and periodic advertising
591 */
592 typedef struct
593 {
594 ble_gap_adv_type_t type; /**< Advertising type (see enum @ref ble_gap_adv_type_t). */
595 ble_gap_disc_mode_t disc_mode; /**< Discovery mode (see enum @ref ble_gap_disc_mode_t). */
596 uint16_t prop; /**< Bit field value provided by advertising properties. See enum @ref ble_gap_adv_prop_t for bit signification. */
597 int8_t max_tx_pwr; /**< Maximum power level at which the advertising packets have to be transmitted (between -20 and 7 dBm). */
598 ble_gap_adv_filter_policy_t filter_pol; /**< Advertising filtering policy (see enum @ref ble_gap_adv_filter_policy_t). */
599 ble_gap_bdaddr_t peer_addr; /**< Peer address configuration (only used in case of directed advertising or used to locate the IRK list). */
600 ble_gap_adv_prim_cfg_t prim_cfg; /**< Configuration for primary advertising. */
601 ble_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). */
602 ble_gap_adv_period_cfg_t period_cfg; /**< Configuration for periodic advertising (valid only if advertising type is GAP_ADV_TYPE_PERIODIC). */
603 } ble_gap_ext_adv_param_t;
604
605 /**
606 * @brief Advertising timing parameter
607 */
608 typedef struct
609 {
610 uint16_t duration; /**< Advertising duration (in unit of 10ms). 0 means that advertising continues until the host disables it. If Advertising discovery mode is GAP_DISC_MODE_LIM_DISCOVERABLE (see enum @ref ble_gap_disc_mode_t), the setting duration range is [1, 18000]. If adv mode is high duty, duration time range is [1, 128]. */
611 uint8_t max_adv_evt; /**< Maximum number of extended advertising events. The controller shall attempt to send prior to terminating the extending advertising. The range is [0, 255]. 0 means no maximum number of advertising events. Valid only if the created advertising is an extended advertising. */
612 } ble_gap_adv_time_param_t;
613
614 /**
615 * @brief Security key
616 */
617 typedef struct
618 {
619 uint8_t key[BLE_GAP_MAX_KEY_LEN]; /**< Key value MSB -> LSB (MSB followed by LSB). */
620 } ble_gap_sec_key_t;
621
622 /**
623 * @brief Parameters for legacy scanning
624 */
625 typedef struct
626 {
627 ble_gap_scan_type_t scan_type; /**< Active scanning or passive scanning. */
628 ble_gap_scan_mode_t scan_mode; /**< Scan mode. */
629 ble_gap_scan_dup_filt_policy_t scan_dup_filt; /**< Duplicate filter policy. */
630 bool use_whitelist; /**< Filter policy. */
631 uint16_t interval; /**< Scan interval between 0x0004 and 0x4000 in 0.625 ms (range: 2.5 ms to 10.24s). */
632 uint16_t window; /**< Scan window between 0x0004 and 0x4000 in 0.625 ms (range: 2.5 ms to 10.24s). */
633 uint16_t timeout; /**< Scan timeout should be a value between 0x0001 and 0xFFFF(unit: 10 ms). 0x0000 indicates that the timeout has no effect. */
634 } ble_gap_scan_param_t;
635
636 /**
637 * @brief Scan Window operation parameters
638 */
639 typedef struct
640 {
641 uint16_t scan_intv; /**< Scan interval between 0x0004 and 0xFFFF in 0.625 ms (range: 2.5 ms to 40.959375s). */
642 uint16_t scan_wd; /**< Scan window between 0x0004 and 0xFFFF in 0.625 ms (range: 2.5 ms to 40.959375s). */
643 } ble_gap_scan_wd_op_param_t;
644
645 /**
646 * @brief Parameters for extended scanning
647 */
648 typedef struct
649 {
650 ble_gap_ext_scan_type_t type; /**< Type of scanning to be started (see enum ble_gap_ext_scan_type_t). */
651 uint8_t prop; /**< Properties for the scan procedure (see enum ble_gap_scan_prop for bit signification). */
652 ble_gap_ext_scan_dup_filt_policy_t dup_filt_pol; /**< Duplicate packet filtering policy (see enum ble_gap_ext_scan_dup_filt_policy_t). */
653 uint8_t rsvd; /**< Reserved for future use. */
654 ble_gap_scan_wd_op_param_t scan_param_1m; /**< Scan window opening parameters for LE 1M PHY. */
655 ble_gap_scan_wd_op_param_t scan_param_coded; /**< Scan window opening parameters for LE Coded PHY. */
656 uint16_t duration; /**< Scan duration (in unit of 10ms). 0 means that the controller will scan continuously until receiving a stop command from the application (10 ms to 655.35s). */
657 uint16_t period; /**< Scan period, which is the time interval between two consequent starts of a scan duration by the controller. 0 means that the scan procedure is not periodic, in unit of 1.28s (1.28s to 83,884.8s). */
658 } ble_gap_ext_scan_param_t;
659
660 /**
661 * @brief Periodic advertising information
662 */
663 typedef struct
664 {
665 ble_gap_bdaddr_t bd_addr; /**< Advertiser address information. */
666 uint8_t adv_sid; /**< Advertising SID. */
667 } ble_gap_period_adv_addr_cfg_t;
668
669 /**
670 * @brief Periodic advertising synchronization parameters
671 */
672 typedef struct
673 {
674 uint16_t skip; /**< Number of periodic advertising that can be skipped after a successful reception. Maximum authorized value is 499. */
675 uint16_t sync_to; /**< Synchronization timeout for the periodic advertising (in unit of 10ms between 100ms and 163.84s). */
676 ble_gap_per_sync_type_t type; /**< Periodic synchronization type (see enum @ref ble_gap_per_sync_type_t). */
677 uint8_t rsvd; /**< Reserved for future use.*/
678 ble_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). */
679 } ble_gap_per_sync_param_t;
680
681 /**
682 * @brief Legacy initiating parameters
683 */
684 typedef struct
685 {
686 ble_gap_init_type_t type; /**< Initiating type (see enum @ref ble_gap_init_type_t). */
687 ble_gap_bdaddr_t peer_addr; /**< Peer device address. */
688 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. Allowed range is 7.5 ms to 4s. */
689 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. Allowed range is 7.5 ms to 4s. */
690 uint16_t slave_latency; /**< Slave latency. Number of events that can be missed by a connected slave device. */
691 uint16_t sup_timeout; /**< Link supervision timeout (in unit of 10ms). Allowed range is 100 ms to 32s. */
692 uint16_t conn_timeout; /**< Timeout for connection establishment (in unit of 10ms). Cancel the procedure if connection has not been connected when the timeout occurs. 0 means there is no timeout. */
693 } ble_gap_init_param_t;
694
695
696 /**
697 * @brief Connection parameters
698 */
699 typedef struct
700 {
701 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. Allowed range is 7.5 ms to 4s. */
702 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. Allowed range is 7.5 ms to 4s. */
703 uint16_t conn_latency; /**< Slave latency. Number of events that can be missed by a connected slave device. */
704 uint16_t supervision_to; /**< Link supervision timeout (in unit of 10ms). Allowed range is 100 ms to 32s. */
705 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. */
706 } ble_gap_ext_conn_param_t;
707
708 /**
709 * @brief Extended initiating parameters
710 */
711 typedef struct
712 {
713 ble_gap_init_type_t type; /**< Initiating type (see enum @ref ble_gap_init_type_t). */
714 uint8_t prop; /**< Properties for the initiating procedure (see enum @ref ble_gap_init_prop_t for bit signification). */
715 uint16_t conn_to; /**< Timeout for automatic connection establishment (in unit of 10ms). Cancel the procedure if connection has not been connected when the timeout occurs.0 means there is no timeout. */
716 ble_gap_scan_wd_op_param_t scan_param_1m; /**< Scan window opening parameters for LE 1M PHY. */
717 ble_gap_scan_wd_op_param_t scan_param_coded; /**< Scan window opening parameters for LE Coded PHY. */
718 ble_gap_ext_conn_param_t conn_param_1m; /**< Connection parameters for LE 1M PHY. */
719 ble_gap_ext_conn_param_t conn_param_2m; /**< Connection parameters for LE 2M PHY. */
720 ble_gap_ext_conn_param_t conn_param_coded; /**< Connection parameters for LE Coded PHY. */
721 ble_gap_bdaddr_t peer_addr; /**< Address of peer device in case white list is not used for connection. */
722 } ble_gap_ext_init_param_t;
723
724 /**
725 * @brief LE Protocol/Service Multiplexer information
726 */
727 typedef struct
728 {
729 uint16_t le_psm; /**< LE Protocol/Service Multiplexer (range: 1 to 255), PSMs should be odd. */
730 ble_gap_sec_lvl_type_t sec_lvl; /**< Security level requirement, see @ref ble_gap_sec_lvl_type_t. */
731 bool mks_flag; /**< Whether to use maximum-size key (16 bytes) or not. */
732 } ble_gap_lepsm_register_t;
733
734 /**
735 * @brief Bonded device list
736 */
737 typedef struct
738 {
739 uint8_t num; /**< Number of bonded device. */
740 ble_gap_bdaddr_t items[BLE_GAP_MAX_BOND_NUM]; /**< Bonded device addr info. */
741 } ble_gap_bond_dev_list_t;
742
743 /**
744 * @brief White list
745 */
746 typedef struct
747 {
748 uint8_t num; /**< Number of available items. */
749 ble_gap_bdaddr_t items[BLE_GAP_MAX_WL_NUM]; /**< Content of each item. */
750 } ble_gap_white_list_t;
751
752 /**
753 * @brief Periodic advertising list
754 */
755 typedef struct
756 {
757 uint8_t num; /**< Number of available items. */
758 ble_gap_period_adv_addr_cfg_t items[BLE_GAP_MAX_PRD_ADV_NUM]; /**< Content of each item. */
759 } ble_gap_period_adv_list_t;
760
761 /**
762 * @brief RPA list item info
763 */
764 typedef struct
765 {
766 ble_gap_bdaddr_t bd_addr; /**< Peer device identity. */
767 ble_gap_privacy_mode_t priv_mode; /**< Privacy mode, see enum @ref ble_gap_privacy_mode_t. */
768 uint8_t peer_irk[BLE_GAP_MAX_KEY_LEN]; /**< Peer IRK. */
769 uint8_t local_irk[BLE_GAP_MAX_KEY_LEN]; /**< Local IRK. */
770 } ble_gap_ral_dev_info_t;
771
772 /**
773 * @brief RPA list info
774 */
775 typedef struct
776 {
777 uint8_t num; /**< Number of RPA list. */
778 ble_gap_ral_dev_info_t items[BLE_GAP_MAX_BOND_NUM]; /**< RPA list item info. */
779 } ble_gap_ral_dev_list_t;
780
781 /**
782 * @brief Operation code used to read resolvable address.
783 */
784 typedef enum
785 {
786 BLE_GAP_OPCODE_LOCAL_RSLV_ADDR_READ, /**< Local resolvable address operation. */
787 BLE_GAP_OPCODE_PEER_RSLV_ADDR_READ, /**< Peer resolvable address operation. */
788 } ble_gap_rslv_addr_read_op_id_t;
789
790 /** @brief Advertising Stop info. */
791 typedef struct
792 {
793 ble_gap_stopped_reason_t reason; /**< Advertising Stop info. */
794 } ble_gap_evt_adv_stop_t;
795
796 /** @brief Scan request info. */
797 typedef struct
798 {
799 ble_gap_bdaddr_t peer_addr; /**< Scan request info. */
800 } ble_gap_evt_scan_req_t;
801
802 /** @brief Scan Stop info struct. */
803 typedef struct
804 {
805 ble_gap_stopped_reason_t reason; /**< Scan Stop info. */
806 } ble_gap_evt_scan_stop_t;
807
808 /** @brief Advertising report event for @ref BLE_GAPM_EVT_ADV_REPORT. */
809 typedef struct
810 {
811 ble_gap_adv_report_type_t adv_type; /**< Advertising type. @ref ble_gap_adv_report_type_t. */
812 ble_gap_adv_report_info_t adv_info; /**< Bit field providing information about the received report. @ref ble_gap_adv_report_info_t. */
813 ble_gap_bdaddr_t broadcaster_addr; /**< Broadcaster device address. */
814 ble_gap_bdaddr_t direct_addr; /**< Target address (in case of a directed advertising report). */
815 int8_t tx_pwr; /**< TX power (in dBm). */
816 int8_t rssi; /**< RSSI (between -127 and +20 dBm). */
817 uint8_t phy_prim; /**< Primary PHY on which advertising report has been received. */
818 uint8_t phy_second; /**< Secondary PHY on which advertising report has been received. */
819 uint8_t adv_sid; /**< Advertising SID , valid only for periodic advertising report. */
820 uint16_t period_adv_intv; /**< Periodic advertising interval (in unit of 1.25ms, min is 7.5ms), valid only for periodic advertising report. */
821 uint8_t per_sync_idx; /**< Periodic syncronization index, valid only for periodic advertising report. */
822 uint16_t length; /**< Report length. */
823 uint8_t *data; /**< Report. */
824 } ble_gap_evt_adv_report_t;
825
826 /** @brief Sync established event for @ref BLE_GAPM_EVT_SYNC_ESTABLISH. */
827 typedef struct
828 {
829 uint8_t phy; /**< PHY on which synchronization has been established. */
830 uint16_t intv; /**< Periodic advertising interval (in unit of 1.25ms, min is 7.5ms). */
831 uint8_t adv_sid; /**< Advertising SID. */
832 uint8_t clk_acc; /**< Advertiser clock accuracy. @ref ble_gap_clk_acc_t. */
833 ble_gap_bdaddr_t bd_addr; /**< Advertiser address. */
834 uint16_t sync_hdl; /**< Sync handle. */
835 } ble_gap_evt_sync_established_t;
836
837 /** @brief Read resolvable address event for @ref BLE_GAPM_EVT_READ_RSLV_ADDR. */
838 typedef struct
839 {
840 uint8_t op_code; /**< Operation code. @ref ble_gap_rslv_addr_read_op_id_t. */
841 ble_gap_addr_t gap_addr; /**< Resolvable address info. */
842 } ble_gap_evt_rslv_addr_read_t;
843
844 /**@brief BLE GAPM event structure. */
845 typedef struct
846 {
847 uint8_t index; /**< Index of connection or advertising. */
848 union
849 {
850 ble_gap_evt_dev_info_get_t dev_info; /**< Device info parameters. */
851 ble_gap_evt_adv_stop_t adv_stop; /**< Advertising stop parameter. */
852 ble_gap_evt_scan_req_t scan_req; /**< Scan Request parameter. */
853 ble_gap_evt_scan_stop_t scan_stop; /**< Scan Stop parameter. */
854 ble_gap_evt_adv_report_t adv_report; /**< Advertising Report parameter. */
855 ble_gap_evt_sync_established_t sync_established; /**< Periodic Advertising Synchronization Established parameter. */
856 ble_gap_evt_rslv_addr_read_t rslv_addr; /**< Read Resolvable Address parameter. */
857 } params; /**< Event Parameters. */
858 } ble_gapm_evt_t;
859 /** @} */
860
861 /** @addtogroup BLE_GAPM_TYPEDEF Typedefs
862 * @{
863 */
864 /** @brief The BLE reslove rpa address callback. */
865 typedef void (*ble_gap_reslv_rpa_addr_callback_t) (uint8_t status, ble_gap_bdaddr_t *iden_addr, uint8_t src_info);
866
867 /** @brief The BLE rpa address report callback. */
868 typedef void (*ble_gap_rpa_addr_report_callback_t) (ble_gap_actv_type_t type, uint8_t index, const uint8_t *rpa_addr);
869 /** @} */
870
871
872 /** @addtogroup BLE_GAPM_FUNCTION Functions
873 * @{ */
874
875 /**
876 ****************************************************************************************
877 * @brief Decide whether to support the pair feature.
878 *
879 * @param[in] enable: Support flag.
880 ****************************************************************************************
881 */
882 void ble_gap_pair_enable(bool enable);
883
884 /**
885 ****************************************************************************************
886 * @brief Set the device identity address (public or random static).
887 *
888 * @param[in] p_addr: Provided public or static random address. If addr_type = 0, it means public address,
889 * If addr_type = 1, it means static random address.
890 *
891 * @retval ::SDK_SUCCESS: Operation is successful.
892 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
893 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
894 ****************************************************************************************
895 */
896 uint16_t ble_gap_addr_set(ble_gap_bdaddr_t const *p_addr);
897
898 /**
899 ****************************************************************************************
900 * @brief Get the device identity address (public or random static).
901 *
902 * @param[in] p_addr: The pointer for the returned identity address.
903 *
904 * @retval ::SDK_SUCCESS: Operation is successful.
905 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
906 ****************************************************************************************
907 */
908 uint16_t ble_gap_addr_get(ble_gap_bdaddr_t *p_addr);
909
910 /**
911 ****************************************************************************************
912 * @brief Set the tx power
913 *
914 * @param[in] role: Select the role to set tx power. @ref ble_gap_actv_role_t for possible roles.
915 * @param[in] index: The idx parameter is interpreted on role.
916 * -If role is @ref BLE_GAP_ACTIVITY_ROLE_ADV, it's the index of Advertising.
917 * -If role is @ref BLE_GAP_ACTIVITY_ROLE_CON, it's the index of connection.
918 * -For all other roles, it should be ignored.
919 * @param[in] txpwr_dbm: The value of the tx power, Range: -20dbm to 7dbm.
920 *
921 * @retval ::SDK_SUCCESS: Operation is Success.
922 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
923 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
924 * @retval ::SDK_ERR_INVALID_HANDLE: Invalid handle supplied.
925 ****************************************************************************************
926 */
927 uint16_t ble_gap_tx_power_set(ble_gap_actv_role_t role, uint8_t index, int8_t txpwr_dbm);
928
929 /**
930 ****************************************************************************************
931 * @brief Get the tx power
932 *
933 * @param[in] role: Select the role to Get tx power. @ref ble_gap_actv_role_t for possible roles.
934 * @param[in] index: The idx parameter is interpreted on role.
935 * -If role is @ref BLE_GAP_ACTIVITY_ROLE_ADV, it's the index of Advertising.
936 * -If role is @ref BLE_GAP_ACTIVITY_ROLE_CON, it's the index of connection.
937 * -For all other roles, it should be ignored.
938 * @param[in] txpwr_dbm: The value of the tx power, Range: -20dbm to 7dbm.
939 *
940 * @retval ::SDK_SUCCESS: Operation is Success.
941 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
942 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
943 * @retval ::SDK_ERR_INVALID_HANDLE: Invalid handle supplied.
944 ****************************************************************************************
945 */
946 uint16_t ble_gap_tx_power_get(ble_gap_actv_role_t role, uint8_t index, int8_t *txpwr_dbm);
947
948 /**
949 ****************************************************************************************
950 * @brief Set IRK used for resolvable random BD address generation (LSB first).
951 *
952 * @param[in] p_irk: Device IRK (Identity Resolving Key).
953 *
954 * @retval ::SDK_SUCCESS: Operation is successful.
955 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
956 ****************************************************************************************
957 */
958 uint16_t ble_gap_irk_set(ble_gap_sec_key_t* p_irk);
959
960 /**
961 ****************************************************************************************
962 * @brief Set privacy related parameters.
963 * @param[in] renew_dur: Duration before regenerating a device address when privacy is enabled in seconds. Range: 0x0001 (1s) ~ 0xA1B8 (11.5 hr).
964 * The suggested time is 900s(15 minutes).
965 * @param[in] enable_flag: Indicate the controller privacy is enabled or disabled.
966 *
967 * @retval ::SDK_SUCCESS: Operation is successful.
968 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
969 ****************************************************************************************
970 */
971 uint16_t ble_gap_privacy_params_set(uint16_t renew_dur, bool enable_flag);
972
973 /**
974 ****************************************************************************************
975 * @brief Set suggested default LE data length.
976 *
977 * @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.
978 * @param[in] sugg_max_tx_time: Suggested value for the Controller's maximum packet transmission time to be used, the range is 328~2120.
979 *
980 * @retval ::SDK_SUCCESS: Operation is successful.
981 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
982 ****************************************************************************************
983 */
984 uint16_t ble_gap_data_length_set(uint16_t sugg_max_tx_octet,uint16_t sugg_max_tx_time);
985
986 /**
987 ****************************************************************************************
988 * @brief Set L2CAP related parameters.
989 *
990 * @param[in] max_mtu: Maximal MTU acceptable for device, the range is 65~512.
991 * @param[in] max_mps: Maximal MPS Packet size acceptable for device (for COC SDU), the range is 65~max_mtu.
992 * @param[in] max_nb_lecb: Maximum number of LE Credit based connection that can be established, this range is 0x00~0x20.
993 * The actual number is decided by resource available.
994 *
995 * @retval ::SDK_SUCCESS: Operation is successful.
996 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
997 *
998 * @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).
999 ****************************************************************************************
1000 */
1001 uint16_t ble_gap_l2cap_params_set(uint16_t max_mtu,uint16_t max_mps,uint8_t max_nb_lecb);
1002
1003 /**
1004 ****************************************************************************************
1005 * @brief Set the preferred values for the transmitter PHY and receiver PHY.
1006 *
1007 * @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_PHY_OPTIONS).
1008 * @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_PHY_OPTIONS).
1009 ****************************************************************************************
1010 */
1011 void ble_gap_pref_phy_set(uint8_t tx_pref_phy, uint8_t rx_pref_phy);
1012
1013 /**
1014 ****************************************************************************************
1015 * @brief Set the RF path gain or loss between the RF transceiver and the antenna contributed by intermediate components.
1016 *
1017 * @param[in] tx_path_comp: RF TX Path Compensation value (from -128dB to 128dB, unit is 0.1dB).
1018 * @param[in] rx_path_comp: RF RX Path Compensation value (from -128dB to 128dB, unit is 0.1dB).
1019 *
1020 * @retval ::SDK_SUCCESS: Operation is successful.
1021 * @retval ::SDK_ERR_INVALID_PARAM: The parameter is invalid.
1022 ****************************************************************************************
1023 */
1024 uint16_t ble_gap_path_compensation_set(int16_t tx_path_comp, int16_t rx_path_comp);
1025
1026 /**
1027 ****************************************************************************************
1028 * @brief Set advertising channel map before advertising starts.
1029 *
1030 * @param[in] p_chnl_map: Bitmask of LE channel map. See enum @ref ble_gap_chnl_map_t for BT Core Spec version <= 4.2.
1031 *
1032 * @retval ::SDK_SUCCESS: Operation is successful.
1033 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1034 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1035 ****************************************************************************************
1036 */
1037 uint16_t ble_gap_chnl_map_set(ble_gap_chnl_map_t* p_chnl_map);
1038
1039 /**
1040 ****************************************************************************************
1041 * @brief Set ble channel map update timer enable or disable.
1042 *
1043 * @param[in] enable_flag: timer enable flag . true is enable,false is disable.
1044 *
1045 * @retval ::SDK_SUCCESS: Operation is successful.
1046 ****************************************************************************************
1047 */
1048 uint16_t ble_gap_chnl_map_timer_set(bool enable_flag);
1049
1050 /**
1051 ****************************************************************************************
1052 * @brief Get all bonded devices.
1053 *
1054 * @retval ::SDK_SUCCESS: Operation is successful.
1055 * @retval ::SDK_ERR_SDK_INTERNAL: SDK internal error.
1056 * @retval ::SDK_ERR_NVDS_NOT_INIT: NVDS is not initiated.
1057 * @retval ::SDK_ERR_LIST_ITEM_NOT_FOUND: Item not found in list.
1058 * @retval ::SDK_ERR_LIST_FULL: List is full.
1059 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1060 ****************************************************************************************
1061 */
1062 uint16_t ble_gap_bond_devs_get(ble_gap_bond_dev_list_t *p_bond_list);
1063
1064 /**
1065 ****************************************************************************************
1066 * @brief Get BD address of the bonded device.
1067 *
1068 * @param[in] conn_idx: The index of connection.
1069 * @param[in] p_peer_addr: Pointer to the peer BD addrss
1070 *
1071 * @retval ::SDK_SUCCESS: Operation is successful.
1072 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1073 * @retval ::SDK_ERR_INVALID_PARAM: The parameter is invalid.
1074 ****************************************************************************************
1075 */
1076 uint16_t ble_gap_bond_dev_addr_get(uint8_t conn_idx, ble_gap_bdaddr_t *p_peer_addr);
1077
1078 /**
1079 ****************************************************************************************
1080 * @brief Clear all bonded devices.
1081 *
1082 * @retval ::SDK_SUCCESS: Operation is successful.
1083 * @retval ::SDK_ERR_SDK_INTERNAL: SDK internal error.
1084 * @retval ::SDK_ERR_NVDS_NOT_INIT: NVDS is not initiated.
1085 * @retval ::SDK_ERR_LIST_ITEM_NOT_FOUND: Item not found in list.
1086 * @retval ::SDK_ERR_LIST_FULL: List is full.
1087 ****************************************************************************************
1088 */
1089 uint16_t ble_gap_bond_devs_clear(void);
1090
1091 /**
1092 ****************************************************************************************
1093 * @brief Delete a bond device with the specified BD address.
1094 *
1095 * @param[in] p_peer_addr: Pointer to the BD addrss.
1096 *
1097 * @retval ::SDK_SUCCESS: Operation is successful.
1098 * @retval ::SDK_ERR_SDK_INTERNAL: SDK internal error.
1099 * @retval ::SDK_ERR_NVDS_NOT_INIT: NVDS is not initiated.
1100 * @retval ::SDK_ERR_LIST_ITEM_NOT_FOUND: Item not found in list.
1101 * @retval ::SDK_ERR_LIST_FULL: List is full.
1102 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1103 ****************************************************************************************
1104 */
1105 uint16_t ble_gap_bond_dev_del(const ble_gap_bdaddr_t *p_peer_addr);
1106
1107 /**
1108 ****************************************************************************************
1109 * @brief Get the content of the whole white list.
1110 *
1111 * @param[in] p_whitelist: Pointer to the output white list.
1112 *
1113 * @retval ::SDK_SUCCESS: Operation is successful.
1114 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1115 ****************************************************************************************
1116 */
1117 uint16_t ble_gap_whitelist_get(ble_gap_white_list_t *p_whitelist);
1118
1119 /**
1120 ****************************************************************************************
1121 * @brief Add the devices into current white list. If white list is full or there are duplicated entries, it will return error.
1122 *
1123 * @param[in] p_whitelist: Pointer to input white list.
1124 *
1125 * @retval ::SDK_SUCCESS: Operation is successful.
1126 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1127 * @retval ::SDK_ERR_LIST_ITEM_ALREADY_EXISTED: Item already existed in list.
1128 * @retval ::SDK_ERR_LIST_FULL: List is full.
1129 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1130 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1131 ****************************************************************************************
1132 */
1133 uint16_t ble_gap_whitelist_add(const ble_gap_white_list_t *p_whitelist);
1134
1135 /**
1136 ****************************************************************************************
1137 * @brief Delete the devices out of current white list. If the entries do not exist in the current white list, it will return error.
1138 *
1139 * @param[in] p_whitelist: Pointer to input white list.
1140 *
1141 * @retval ::SDK_SUCCESS: Operation is successful.
1142 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1143 * @retval ::SDK_ERR_LIST_ITEM_NOT_FOUND: Item not found in list.
1144 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1145 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1146 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1147 ****************************************************************************************
1148 */
1149 uint16_t ble_gap_whitelist_del(const ble_gap_white_list_t *p_whitelist);
1150
1151 /**
1152 ****************************************************************************************
1153 * @brief Clear all the entries in the current white list.
1154 *
1155 * @retval ::SDK_SUCCESS: Operation is successful.
1156 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1157 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1158 ****************************************************************************************
1159 */
1160 uint16_t ble_gap_whitelist_clear(void);
1161
1162 /**
1163 ****************************************************************************************
1164 * @brief Get the content of the whole periodic advertising list.
1165 *
1166 * @param[in] p_pal_list: Pointer to the output periodic advertising list.
1167 *
1168 * @retval ::SDK_SUCCESS: Operation is successful.
1169 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1170 ****************************************************************************************
1171 */
1172 uint16_t ble_gap_per_adv_list_get(ble_gap_period_adv_list_t *p_pal_list);
1173
1174 /**
1175 ****************************************************************************************
1176 * @brief Add the devices into current periodic advertising list. If periodic advertising list is full or there are
1177 * duplicated entries, it will return error.
1178 *
1179 * @param[in] p_pal_list: Pointer to input periodic advertising list.
1180 *
1181 * @retval ::SDK_SUCCESS: Operation is successful.
1182 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1183 * @retval ::SDK_ERR_LIST_ITEM_ALREADY_EXISTED: Item already existed in list.
1184 * @retval ::SDK_ERR_LIST_FULL: List is full.
1185 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1186 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1187 ****************************************************************************************
1188 */
1189 uint16_t ble_gap_per_adv_list_add(const ble_gap_period_adv_list_t *p_pal_list);
1190
1191 /**
1192 ****************************************************************************************
1193 * @brief Delete the devices out of periodic advertising list. If the entries do not exist in the current list, an error will be returned.
1194 *
1195 * @param[in] p_pal_list: Pointer to input periodic advertising list.
1196 *
1197 * @retval ::SDK_SUCCESS: Operation is successful.
1198 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1199 * @retval ::SDK_ERR_LIST_ITEM_NOT_FOUND: Item not found in list.
1200 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1201 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1202 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1203 ****************************************************************************************
1204 */
1205 uint16_t ble_gap_per_adv_list_del(const ble_gap_period_adv_list_t *p_pal_list);
1206
1207 /**
1208 ****************************************************************************************
1209 * @brief Clear all the entries in the current periodic advertising list.
1210 *
1211 * @retval ::SDK_SUCCESS: Operation is successful.
1212 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1213 ****************************************************************************************
1214 */
1215 uint16_t ble_gap_per_adv_list_clear(void);
1216
1217 /**
1218 ****************************************************************************************
1219 * @brief Get the RPA list info.
1220 * @param[in] p_rpa_list: Pointer to the output RPA list.
1221 *
1222 * @retval ::SDK_SUCCESS: Operation is successful.
1223 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1224 ****************************************************************************************
1225 */
1226 uint16_t ble_gap_rpa_list_get(ble_gap_ral_dev_list_t *p_rpa_list);
1227
1228 /**
1229 ****************************************************************************************
1230 * @brief Get the device information according to param type.
1231 *
1232 * @param[in] type: Param type.
1233 *
1234 * @retval ::SDK_SUCCESS: Operation is successful.
1235 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1236 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1237 ****************************************************************************************
1238 */
1239 uint16_t ble_gap_dev_info_get(ble_gap_dev_info_get_type_t type);
1240
1241 /**
1242 ****************************************************************************************
1243 * @brief Set parameters for advertising. Note that this function must be called prior to advertising started.
1244 * @param[in] adv_idx: Advertising index, range is 0 to 4.
1245 * @param[in] own_addr_type: Own BD address source of the local device.
1246 * @param[in] p_adv_param: The advertising parameters.
1247 *
1248 * @retval ::SDK_SUCCESS: Operation is successful.
1249 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1250 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
1251 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1252 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1253 *
1254
1255 * @note Discovery mode param contains Flags AD type, setting adv data should not set the Flags AD type.
1256 * @note This API is for legacy advertsing (BT Core Spec version <= 4.2).
1257 ****************************************************************************************
1258 */
1259 uint16_t ble_gap_adv_param_set(uint8_t adv_idx, ble_gap_own_addr_t own_addr_type, ble_gap_adv_param_t* p_adv_param);
1260
1261 /**
1262 ****************************************************************************************
1263 * @brief Set extended parameters for advertising. Note that this function must be called prior to advertising.
1264 * @param[in] adv_idx: Advertising index, range is 0 to 4.
1265 * @param[in] own_addr_type: Own BD address source of the local device.
1266 * @param[in] p_adv_param: The advertising parameters.
1267 *
1268 * @retval ::SDK_SUCCESS: Operation is successful.
1269 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1270 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
1271 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1272 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1273 *
1274 * @note This API is for extended and periodic advertising (BT Core Spec version >= 5.0).
1275 ****************************************************************************************
1276 */
1277 uint16_t ble_gap_ext_adv_param_set(uint8_t adv_idx, ble_gap_own_addr_t own_addr_type, ble_gap_ext_adv_param_t* p_adv_param);
1278
1279 /**
1280 ****************************************************************************************
1281 * @brief Set Advertising Data, Scan Response Data and Periodic Advertising Data.
1282 *
1283 * @param[in] adv_idx: Advertising index, range is 0 to 4.
1284 * @param[in] type: Data type.
1285 * @param[in] p_data: The data pointer.
1286 * @param[in] length: Data length.
1287 *
1288 * @retval ::SDK_SUCCESS: Operation is successful.
1289 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1290 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
1291 * @retval ::SDK_ERR_INVALID_ADV_DATA_TYPE: Invalid advertising data type supplied.
1292 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1293 *
1294 * @note User should not add extra Flags AD type as the BLE Stack has added the Flags AD type already.
1295 ****************************************************************************************
1296 */
1297 uint16_t ble_gap_adv_data_set(uint8_t adv_idx, ble_gap_adv_data_type_t type, const uint8_t* p_data, uint16_t length);
1298
1299 /**
1300 ****************************************************************************************
1301 * @brief Update Advertising Data, Scan Response Data and Periodic Advertising Data.
1302 *
1303 * @param[in] adv_idx: Advertising index, range is 0 to 4.
1304 * @param[in] type: Data type.
1305 * @param[in] p_data: The data pointer.
1306 * @param[in] length: Data length.
1307 *
1308 * @retval ::SDK_SUCCESS: Operation is successful.
1309 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1310 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
1311 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1312 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1313 *
1314 * @note User should not add extra Flags AD type as the BLE Stack has added the Flags AD type already.
1315 ****************************************************************************************
1316 */
1317 uint16_t ble_gap_update_adv_data(uint8_t adv_idx, ble_gap_adv_data_type_t type, const uint8_t* p_data, uint16_t length);
1318
1319 /**
1320 ****************************************************************************************
1321 * @brief Start advertising.
1322 * @param[in] adv_idx: Advertising index, range is 0 to 4.
1323 * @param[in] p_timeout: Advertising timing parameter.
1324 *
1325 * @retval ::SDK_SUCCESS: Operation is successful.
1326 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1327 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
1328 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1329 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1330 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1331 *
1332 * @note If advertising mode is directed high duty cycle mode, duration should be set nonzero and not be greater than 1.28s.
1333 ****************************************************************************************
1334 */
1335 uint16_t ble_gap_adv_start(uint8_t adv_idx, ble_gap_adv_time_param_t* p_timeout);
1336
1337 /**
1338 ****************************************************************************************
1339 * @brief Stop advertising.
1340 * @param[in] adv_idx: Advertising index, range is 0 to 4.
1341 *
1342 * @retval ::SDK_SUCCESS: Operation is successful.
1343 * @retval ::SDK_ERR_INVALID_ADV_IDX: Invalid advertising index supplied.
1344 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1345 ****************************************************************************************
1346 */
1347 uint16_t ble_gap_adv_stop(uint8_t adv_idx);
1348
1349 /**
1350 ****************************************************************************************
1351 * @brief Set parameters for scanning. Note that this function must be called prior to scanning started.
1352 * @param[in] own_addr_type: Own BD address source of the local device.
1353 * @param[in] p_scan_param: The scanning parameters.
1354 *
1355 * @retval ::SDK_SUCCESS: Operation is successful.
1356 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1357 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1358 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1359 ****************************************************************************************
1360 */
1361 uint16_t ble_gap_scan_param_set(ble_gap_own_addr_t own_addr_type, ble_gap_scan_param_t* p_scan_param);
1362
1363 /**
1364 ****************************************************************************************
1365 * @brief Set extended parameters for scanning. Note that this function must be called prior to scanning started.
1366 * @param[in] own_addr_type: Own BD address source of the local device.
1367 * @param[in] p_scan_param: The scanning parameters.
1368 *
1369 * @retval ::SDK_SUCCESS: Operation is successful.
1370 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1371 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1372 *
1373 * @note This API is for extended scanning (BT Core Spec version >= 5.0).
1374 * The Scan window in p_scan_param should be enough to recieve one packet. For example.
1375 * If you want to recieve packects with 1270 bytes on coded phy(S8), the scan_wd should be greater than 82ms.
1376 * If you want to recieve packects with 1270 bytes on coded phy(S2), the scan_wd should be greater than 21ms.
1377 ****************************************************************************************
1378 */
1379 uint16_t ble_gap_ext_scan_param_set(ble_gap_own_addr_t own_addr_type, ble_gap_ext_scan_param_t* p_scan_param);
1380
1381 /**
1382 ****************************************************************************************
1383 * @brief Start scanning
1384 *
1385 * @retval ::SDK_SUCCESS: Operation is successful.
1386 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1387 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1388 ****************************************************************************************
1389 */
1390 uint16_t ble_gap_scan_start(void);
1391
1392 /**
1393 ****************************************************************************************
1394 * @brief Stop scanning
1395 *
1396 * @retval ::SDK_SUCCESS: Operation is successful.
1397 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1398 ****************************************************************************************
1399 */
1400 uint16_t ble_gap_scan_stop(void);
1401
1402 /**
1403 ****************************************************************************************
1404 * @brief Set the parameters used for periodic sync.
1405 * @param[in] per_sync_idx: Periodic synchronization index (range is 0 to 4).
1406 * @param[in] p_per_sync_param: Periodic synchronization parameters.
1407 *
1408 * @retval ::SDK_SUCCESS: Operation is successful.
1409 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1410 * @retval ::SDK_ERR_INVALID_PER_SYNC_IDX: Invalid periodic syncronization index supplied.
1411 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1412 ****************************************************************************************
1413 */
1414 uint16_t ble_gap_per_sync_param_set(uint8_t per_sync_idx, ble_gap_per_sync_param_t* p_per_sync_param);
1415
1416 /**
1417 ****************************************************************************************
1418 * @brief Start to synchronize with periodic advertising from an advertiser and begin receiving periodic advertising packets.
1419 * @param[in] per_sync_idx: Periodic synchronization index (range is 0 to 4).
1420 *
1421 * @retval ::SDK_SUCCESS: Operation is successful.
1422 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1423 * @retval ::SDK_ERR_INVALID_PER_SYNC_IDX: Invalid periodic syncronization index supplied.
1424 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1425 ****************************************************************************************
1426 */
1427 uint16_t ble_gap_per_sync_start(uint8_t per_sync_idx);
1428
1429 /**
1430 ****************************************************************************************
1431 * @brief Stop periodic synchronization.
1432 * @param[in] per_sync_idx: Periodic synchronization index (range is 0 to 4).
1433 *
1434 * @retval ::SDK_SUCCESS: Operation is successful.
1435 * @retval ::SDK_ERR_INVALID_PER_SYNC_IDX: Invalid periodic syncronization index supplied.
1436 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1437 ****************************************************************************************
1438 */
1439 uint16_t ble_gap_per_sync_stop(uint8_t per_sync_idx);
1440
1441 /**
1442 ****************************************************************************************
1443 * @brief Start a legacy connection to a device.
1444 * @param[in] own_addr_type: Own BD address source of the local device.
1445 * @param[in] p_init_param: Initiate parameters.
1446 *
1447 * @retval ::SDK_SUCCESS: Operation is successful.
1448 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1449 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1450 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1451 *
1452 * @note This API is for legacy connection (BT Core Spec version <= 4.2).
1453 ****************************************************************************************
1454 */
1455 uint16_t ble_gap_connect(ble_gap_own_addr_t own_addr_type, ble_gap_init_param_t* p_init_param);
1456
1457 /**
1458 ****************************************************************************************
1459 * @brief Start an extended connection to a device.
1460 * @param[in] own_addr_type: Own BD address source of the local device.
1461 * @param[in] p_init_param: Initiate parameters.
1462 *
1463 * @retval ::SDK_SUCCESS: Operation is successful.
1464 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1465 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1466 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1467 *
1468 * @note This API is for extended connection (BT Core Spec version >= 5.0).
1469 ****************************************************************************************
1470 */
1471 uint16_t ble_gap_ext_connect(ble_gap_own_addr_t own_addr_type, ble_gap_ext_init_param_t* p_init_param);
1472
1473 /**
1474 ****************************************************************************************
1475 * @brief Cancel an initiated connection.
1476 *
1477 * @retval ::SDK_SUCCESS: Operation is successful.
1478 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1479 ****************************************************************************************
1480 */
1481 uint16_t ble_gap_connect_cancel(void);
1482
1483 /**
1484 ****************************************************************************************
1485 * @brief Set GAP appearance value.
1486 * @param[in] appearance: Appearance value.
1487 ****************************************************************************************
1488 */
1489 void ble_gap_appearance_set(uint16_t appearance);
1490
1491 /**
1492 ****************************************************************************************
1493 * @brief Get GAP appearance value.
1494 * @param[out] p_appearance: The pointer to appearance value.
1495 *
1496 * @retval ::SDK_SUCCESS: Operation is successful.
1497 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1498 ****************************************************************************************
1499 */
1500 uint16_t ble_gap_appearance_get(uint16_t *p_appearance);
1501
1502 /**
1503 ****************************************************************************************
1504 * @brief Set GAP Peripheral Preferred Connection Parameters present flag.
1505 *
1506 * @param[in] present_flag: Present or not.
1507 ****************************************************************************************
1508 */
1509 void ble_gap_ppcp_present_set(bool present_flag);
1510
1511 /**
1512 ****************************************************************************************
1513 * @brief Set GAP Peripheral Preferred Connection Parameters.
1514 * @param[in] p_conn_params: The pointer to PPCP values.
1515 *
1516 * @retval ::SDK_SUCCESS: Operation is successful.
1517 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1518 ****************************************************************************************
1519 */
1520 uint16_t ble_gap_ppcp_set(ble_gap_conn_param_t const *p_conn_params);
1521
1522 /**
1523 ****************************************************************************************
1524 * @brief Get GAP Peripheral Preferred Connection Parameters.
1525 * @param[out] p_conn_params: The pointer to PPCP values.
1526 *
1527 * @retval ::SDK_SUCCESS: Operation is successful.
1528 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1529 ****************************************************************************************
1530 */
1531 uint16_t ble_gap_ppcp_get(ble_gap_conn_param_t *p_conn_params);
1532
1533 /**
1534 ****************************************************************************************
1535 * @brief Set GAP device name.
1536 * @param[in] write_perm: Write permissions of the device name characteristic.
1537 * @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.
1538 * @param[in] length: Device name length.
1539 *
1540 * @retval ::SDK_SUCCESS: Operation is successful.
1541 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1542 ****************************************************************************************
1543 */
1544 uint16_t ble_gap_device_name_set(ble_gap_dev_name_write_perm_t write_perm, uint8_t const *p_dev_name, uint16_t length);
1545
1546 /**
1547 ****************************************************************************************
1548 * @brief Get GAP device name.
1549 * @param[out] p_dev_name: The pointer to device name value, set to NULL to obtain the complete device name length.
1550 * @param[in, out] p_length: Length of the buffer pointed by p_dev_name, complete device name length on output.
1551 *
1552 * @retval ::SDK_SUCCESS: Operation is successful.
1553 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1554 * @retval ::SDK_ERR_INVALID_DATA_LENGTH: Invalid data size(s) supplied.
1555 *
1556 * @note If device name was not set, the default device name "GOODIX_BLE" will be available.
1557 * @note If the device name is longer than the size of the supplied buffer,p_len will return the complete device name length,
1558 * and not the number of bytes actually returned in p_dev_name.
1559 * The application may use this information to allocate a suitable buffer size.
1560 ****************************************************************************************
1561 */
1562 uint16_t ble_gap_device_name_get(uint8_t *p_dev_name, uint16_t *p_length);
1563
1564 /**
1565 ****************************************************************************************
1566 * @brief Register a LE Protocol/Service Multiplexer.
1567 * @param[in] p_lepsm: The lepsm information to be registerred.
1568 *
1569 * @retval ::SDK_SUCCESS: Operation is successful.
1570 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1571 * @retval ::SDK_ERR_INVALID_PSM_NUM: Invalid psm number.
1572 * @retval ::SDK_ERR_INVALID_PSM_EXCEEDED_MAX_PSM_NUM: The maximum psm number limit is exceeded.
1573 * @retval ::SDK_ERR_INVALID_PSM_ALREADY_REGISTERED: The psm number has been registered.
1574 ****************************************************************************************
1575 */
1576 uint16_t ble_gap_lepsm_register(ble_gap_lepsm_register_t* p_lepsm);
1577
1578 /**
1579 ****************************************************************************************
1580 * @brief Unregister a LE Protocol/Service Multiplexer.
1581 * @param[in] le_psm: LE Protocol/Service Multiplexer (1 to 255).
1582 *
1583 * @retval ::SDK_SUCCESS: Operation is successful.
1584 * @retval ::SDK_ERR_INVALID_PSM_NUM: Invalid psm number.
1585 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1586 ****************************************************************************************
1587 */
1588 uint16_t ble_gap_lepsm_unregister(uint16_t le_psm);
1589
1590 /**
1591 ****************************************************************************************
1592 * @brief Set privacy mode for peer device.
1593 * @param[in] peer_addr: The peer address.
1594 * @param[in] mode: Privacy mode.
1595 *
1596 * @retval ::SDK_SUCCESS: Operation is successful.
1597 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1598 * @retval ::SDK_ERR_DISALLOWED: Operation is disallowed.
1599 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
1600 ****************************************************************************************
1601 */
1602 uint16_t ble_gap_privacy_mode_set(ble_gap_bdaddr_t peer_addr, ble_gap_privacy_mode_t mode);
1603
1604 /**
1605 ****************************************************************************************
1606 * @brief Read peer or local resolvable address.
1607 * @param[in] op_code: The operation code (see @ref ble_gap_rslv_addr_read_op_id_t).
1608 * @param[in] peer_iden_addr: The peer identity address.
1609 *
1610 * @retval ::SDK_SUCCESS: Operation is successful.
1611 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1612 *
1613 ****************************************************************************************
1614 */
1615 uint16_t ble_gap_rslv_addr_read(ble_gap_rslv_addr_read_op_id_t op_code, ble_gap_bdaddr_t peer_iden_addr);
1616
1617 /**
1618 *****************************************************************************************
1619 * @brief Resolve the rpa address.
1620 *
1621 * @param[in] reslv_addr: rpa address.
1622 * @param[in] src_info: Information used retrieve requester (src_info >= 10).
1623 * @param[in] cb: Function that will handle the resolved result.
1624 *
1625 * @retval ::SDK_SUCCESS: Operation is Success.
1626 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
1627 *****************************************************************************************
1628 */
1629 uint16_t ble_gap_reslv_rpa_addr(uint8_t *reslv_addr, uint8_t src_info, ble_gap_reslv_rpa_addr_callback_t cb);
1630
1631 /**
1632 *****************************************************************************************
1633 * @brief Set the method for updating connection parameter.
1634 *
1635 * @param[in] conn_idx: Connection index.
1636 * @param[in] use_l2cap_flag: Preferred to use l2cap to update connection parameter.
1637 *
1638 * @retval ::SDK_SUCCESS: Operation is Success.
1639 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
1640 *****************************************************************************************
1641 */
1642 uint16_t ble_gap_update_conn_param_method_set(uint8_t conn_idx, bool use_l2cap_flag);
1643
1644 /**
1645 *****************************************************************************************
1646 * @brief Set the cb for rpa address report.
1647 *
1648 * @param[in] cb: the cb for rpa address report.
1649 *
1650 *****************************************************************************************
1651 */
1652 void ble_gap_rpa_addr_report_cb_register(ble_gap_rpa_addr_report_callback_t cb);
1653
1654 /** @} */
1655
1656 #endif
1657 /** @} */
1658
1659 /** @} */
1660 /** @} */
ble_gap_evt_sync_established_t::phy
uint8_t phy
PHY on which synchronization has been established.
Definition: ble_gapm.h:829
ble_gap_per_sync_type_t
ble_gap_per_sync_type_t
Periodic synchronization types.
Definition: ble_gapm.h:396
ble_gap_rslv_addr_read
uint16_t ble_gap_rslv_addr_read(ble_gap_rslv_addr_read_op_id_t op_code, ble_gap_bdaddr_t peer_iden_addr)
Read peer or local resolvable address.
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:434
BLE_GAP_ROLE_PERIPHERAL
@ BLE_GAP_ROLE_PERIPHERAL
Peripheral/Slave role.
Definition: ble_gapm.h:163
BLE_GAP_ADV_PROP_SCANNABLE_POS
@ BLE_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_PRIVACY_MODE_NETWORK
@ BLE_GAP_PRIVACY_MODE_NETWORK
Set to the network privacy mode for the peer device.
Definition: ble_gapm.h:497
ble_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:575
ble_gap_ext_init_param_t::conn_to
uint16_t conn_to
Timeout for automatic connection establishment (in unit of 10ms).
Definition: ble_gapm.h:715
BLE_GAP_SEC_LVL_LE_ENC_AUTH
@ BLE_GAP_SEC_LVL_LE_ENC_AUTH
Legacy encryption with auth.
Definition: ble_gapm.h:408
ble_gap_ext_init_param_t::scan_param_1m
ble_gap_scan_wd_op_param_t scan_param_1m
Scan window opening parameters for LE 1M PHY.
Definition: ble_gapm.h:716
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.
ble_gap_per_adv_list_del
uint16_t ble_gap_per_adv_list_del(const ble_gap_period_adv_list_t *p_pal_list)
Delete the devices out of periodic advertising list.
BLE_GAP_PHY_CODED_VALUE
@ BLE_GAP_PHY_CODED_VALUE
LE Coded PHY.
Definition: ble_gapm.h:256
ble_gap_init_param_t::sup_timeout
uint16_t sup_timeout
Link supervision timeout (in unit of 10ms).
Definition: ble_gapm.h:691
BLE_GAP_AD_TYPE_TRANSMIT_POWER
@ BLE_GAP_AD_TYPE_TRANSMIT_POWER
Transmit power.
Definition: ble_gapm.h:426
BLE_GAP_CLK_ACC_250
@ BLE_GAP_CLK_ACC_250
250 ppm.
Definition: ble_gapm.h:518
BLE_GAP_ACTV_TYPE_INIT
@ BLE_GAP_ACTV_TYPE_INIT
Definition: ble_gapm.h:534
BLE_GAP_SCAN_GEN_DISC_MODE
@ BLE_GAP_SCAN_GEN_DISC_MODE
General discoverable mode.
Definition: ble_gapm.h:322
ble_gap_whitelist_add
uint16_t ble_gap_whitelist_add(const ble_gap_white_list_t *p_whitelist)
Add the devices into current white list.
ble_gap_adv_prim_cfg_t
Configuration for advertising on primary channel.
Definition: ble_gapm.h:563
ble_gap_irk_set
uint16_t ble_gap_irk_set(ble_gap_sec_key_t *p_irk)
Set IRK used for resolvable random BD address generation (LSB first).
BLE_GAP_CLK_ACC_75
@ BLE_GAP_CLK_ACC_75
70 ppm.
Definition: ble_gapm.h:521
ble_gap_ppcp_get
uint16_t ble_gap_ppcp_get(ble_gap_conn_param_t *p_conn_params)
Get GAP Peripheral Preferred Connection Parameters.
ble_gap_ral_dev_info_t::priv_mode
ble_gap_privacy_mode_t priv_mode
Privacy mode, see enum ble_gap_privacy_mode_t.
Definition: ble_gapm.h:767
ble_gap_scan_wd_op_param_t
Scan Window operation parameters.
Definition: ble_gapm.h:640
ble_gap_adv_param_t::peer_addr
ble_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:551
ble_gap_evt_scan_req_t::peer_addr
ble_gap_bdaddr_t peer_addr
Scan request info.
Definition: ble_gapm.h:799
BLE_GAP_ACTIVITY_ROLE_ADV
@ BLE_GAP_ACTIVITY_ROLE_ADV
Adertise role.
Definition: ble_gapm.h:506
BLE_GAP_REPORT_TYPE_PER_ADV
@ BLE_GAP_REPORT_TYPE_PER_ADV
Periodic advertising report.
Definition: ble_gapm.h:471
ble_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:597
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
BLE_GAP_ADV_ALLOW_SCAN_WLST_CON_ANY
@ BLE_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_ext_adv_param_t::prim_cfg
ble_gap_adv_prim_cfg_t prim_cfg
Configuration for primary advertising.
Definition: ble_gapm.h:600
BLE_GAP_ROLE_BROADCASTER
@ BLE_GAP_ROLE_BROADCASTER
Broadcaster role.
Definition: ble_gapm.h:161
ble_gap_scan_start
uint16_t ble_gap_scan_start(void)
Start scanning.
ble_gap_scan_param_t
Parameters for legacy scanning.
Definition: ble_gapm.h:626
BLE_GAP_ADV_PROP_PER_TX_PWR_POS
@ BLE_GAP_ADV_PROP_PER_TX_PWR_POS
Include TX power in the periodic advertising PDU.
Definition: ble_gapm.h:287
ble_gap_white_list_t
White list.
Definition: ble_gapm.h:747
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:420
BLE_GAP_REPORT_INFO_CONN_ADV_BIT
@ BLE_GAP_REPORT_INFO_CONN_ADV_BIT
Connectable advertising.
Definition: ble_gapm.h:478
ble_gap_privacy_mode_t
ble_gap_privacy_mode_t
Privacy mode.
Definition: ble_gapm.h:496
BLE_GAP_EXT_SCAN_TYPE_LIM_DISC
@ BLE_GAP_EXT_SCAN_TYPE_LIM_DISC
Limited discovery.
Definition: ble_gapm.h:342
ble_gap_ext_scan_param_t::rsvd
uint8_t rsvd
Reserved for future use.
Definition: ble_gapm.h:653
BLE_GAP_ADV_PROP_HDC_BIT
@ BLE_GAP_ADV_PROP_HDC_BIT
Definition: ble_gapm.h:300
BLE_GAP_WRITE_PERM_UNAUTH
@ BLE_GAP_WRITE_PERM_UNAUTH
LE Security Mode 1, Level 2.
Definition: ble_gapm.h:184
BLE_GAP_ROLE_CENTRAL
@ BLE_GAP_ROLE_CENTRAL
Master/Central role.
Definition: ble_gapm.h:162
BLE_GAP_ADV_PROP_TX_PWR_BIT
@ BLE_GAP_ADV_PROP_TX_PWR_BIT
Definition: ble_gapm.h:303
BLE_GAP_ADV_TYPE_LEGACY
@ BLE_GAP_ADV_TYPE_LEGACY
Legacy advertising.
Definition: ble_gapm.h:264
BLE_GAP_ADV_PROP_SCAN_REQ_NTF_EN_POS
@ BLE_GAP_ADV_PROP_SCAN_REQ_NTF_EN_POS
Indicate if application must be informed about receiving scan request PDUs.
Definition: ble_gapm.h:289
ble_gap_scan_dup_filt_policy_t
ble_gap_scan_dup_filt_policy_t
Duplicate filter policy.
Definition: ble_gapm.h:331
BLE_GAP_ROLE_ALL
@ BLE_GAP_ROLE_ALL
Device has all roles, both peripheral and central.
Definition: ble_gapm.h:164
ble_gap_addr_t
The struct of address.
Definition: ble_gapc.h:170
BLE_GAP_ACTV_TYPE_SCAN
@ BLE_GAP_ACTV_TYPE_SCAN
Definition: ble_gapm.h:533
BLE_GAP_GET_DEV_BDADDR
@ BLE_GAP_GET_DEV_BDADDR
Get local device BD Address.
Definition: ble_gapm.h:204
ble_gap_adv_data_type_t
ble_gap_adv_data_type_t
Advertising data type.
Definition: ble_gapm.h:193
ble_gap_reslv_rpa_addr
uint16_t ble_gap_reslv_rpa_addr(uint8_t *reslv_addr, uint8_t src_info, ble_gap_reslv_rpa_addr_callback_t cb)
Resolve the rpa address.
ble_gap_dev_info_get
uint16_t ble_gap_dev_info_get(ble_gap_dev_info_get_type_t type)
Get the device information according to param type.
ble_gap_ext_conn_param_t::conn_latency
uint16_t conn_latency
Slave latency.
Definition: ble_gapm.h:703
BLE_GAP_GET_DEV_VERSION
@ BLE_GAP_GET_DEV_VERSION
Get version information for the local Controller.
Definition: ble_gapm.h:203
ble_gap_ext_adv_param_t::peer_addr
ble_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:599
BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED
@ BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED
Legacy BT not supported: AD Flag.
Definition: ble_gapm.h:459
ble_gap_connect_cancel
uint16_t ble_gap_connect_cancel(void)
Cancel an initiated connection.
BLE_GAP_AD_TYPE_COMPLETE_NAME
@ BLE_GAP_AD_TYPE_COMPLETE_NAME
Complete Device name.
Definition: ble_gapm.h:425
BLE_GAP_CLK_ACC_50
@ BLE_GAP_CLK_ACC_50
50 ppm.
Definition: ble_gapm.h:522
BLE_GAP_ACTV_TYPE_ADV
@ BLE_GAP_ACTV_TYPE_ADV
Definition: ble_gapm.h:532
ble_gap_rpa_list_get
uint16_t ble_gap_rpa_list_get(ble_gap_ral_dev_list_t *p_rpa_list)
Get the RPA list info.
ble_gap_ext_adv_param_t::disc_mode
ble_gap_disc_mode_t disc_mode
Discovery mode (see enum ble_gap_disc_mode_t).
Definition: ble_gapm.h:595
ble_gap_pair_enable
void ble_gap_pair_enable(bool enable)
Decide whether to support the pair feature.
ble_gap_bdaddr_t
The struct of broadcast address with broadcast type.
Definition: ble_gapc.h:176
ble_gap_evt_adv_report_t::length
uint16_t length
Report length.
Definition: ble_gapm.h:822
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_ADV_FLAG_LE_GENERAL_DISC_MODE
@ BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE
General discovery flag: AD Flag.
Definition: ble_gapm.h:458
ble_gap_lepsm_register_t::mks_flag
bool mks_flag
Whether to use maximum-size key (16 bytes) or not.
Definition: ble_gapm.h:731
BLE_GAP_SCAN_ACTIVE
@ BLE_GAP_SCAN_ACTIVE
Active scan type.
Definition: ble_gapm.h:313
BLE_GAP_REPORT_INFO_DIR_ADV_BIT
@ BLE_GAP_REPORT_INFO_DIR_ADV_BIT
Directed advertising.
Definition: ble_gapm.h:480
BLE_GAP_ACTIVITY_ROLE_CON
@ BLE_GAP_ACTIVITY_ROLE_CON
Connect role.
Definition: ble_gapm.h:507
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:418
BLE_GAP_ADV_ALLOW_SCAN_WLST_CON_WLST
@ BLE_GAP_ADV_ALLOW_SCAN_WLST_CON_WLST
Allow scan and connection requests from white-list devices only.
Definition: ble_gapm.h:245
ble_gap_ral_dev_list_t
RPA list info.
Definition: ble_gapm.h:776
BLE_GAP_OWN_ADDR_GEN_RSLV
@ BLE_GAP_OWN_ADDR_GEN_RSLV
Generated resolvable private random address.
Definition: ble_gapm.h:173
BLE_GAP_CLK_ACC_20
@ BLE_GAP_CLK_ACC_20
20 ppm.
Definition: ble_gapm.h:524
ble_gap_evt_adv_report_t
Advertising report event for BLE_GAPM_EVT_ADV_REPORT.
Definition: ble_gapm.h:810
ble_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:675
BLE_GAP_SCAN_LIM_DISC_MODE
@ BLE_GAP_SCAN_LIM_DISC_MODE
Limited discoverable mode.
Definition: ble_gapm.h:323
ble_gap_bond_devs_clear
uint16_t ble_gap_bond_devs_clear(void)
Clear all bonded devices.
BLE_GAP_ADV_PROP_TX_PWR_POS
@ BLE_GAP_ADV_PROP_TX_PWR_POS
Include TX power in the extended header of the advertising PDU.
Definition: ble_gapm.h:285
ble_gap_adv_prim_cfg_t::chnl_map
uint8_t chnl_map
Bit field indicating the channel map.
Definition: ble_gapm.h:566
ble_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:556
ble_gap_adv_time_param_t
Advertising timing parameter.
Definition: ble_gapm.h:609
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:436
BLE_GAP_AD_TYPE_LE_BT_ADDR
@ BLE_GAP_AD_TYPE_LE_BT_ADDR
LE Bluetooth Device Address.
Definition: ble_gapm.h:443
ble_gap_tx_power_get
uint16_t ble_gap_tx_power_get(ble_gap_actv_role_t role, uint8_t index, int8_t *txpwr_dbm)
Get the tx power.
ble_gap_addr_set
uint16_t ble_gap_addr_set(ble_gap_bdaddr_t const *p_addr)
Set the device identity address (public or random static).
ble_gap_adv_prop_pos_t
ble_gap_adv_prop_pos_t
Advertising properties bit field and bit positions.
Definition: ble_gapm.h:273
BLE_GAP_STOPPED_REASON_CONN_EST
@ BLE_GAP_STOPPED_REASON_CONN_EST
Stop with connection established.
Definition: ble_gapm.h:488
ble_gap_per_sync_param_t::adv_addr
ble_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:678
ble_gap_period_adv_addr_cfg_t::bd_addr
ble_gap_bdaddr_t bd_addr
Advertiser address information.
Definition: ble_gapm.h:665
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_STOPPED_REASON_TIMEOUT
@ BLE_GAP_STOPPED_REASON_TIMEOUT
Stop with timeout.
Definition: ble_gapm.h:486
ble_gap_role_t
ble_gap_role_t
GAP role options.
Definition: ble_gapm.h:158
ble_gap_period_adv_addr_cfg_t
Periodic advertising information.
Definition: ble_gapm.h:664
ble_gap_device_name_set
uint16_t ble_gap_device_name_set(ble_gap_dev_name_write_perm_t write_perm, uint8_t const *p_dev_name, uint16_t length)
Set GAP device name.
ble_gap_ext_scan_type_t
ble_gap_ext_scan_type_t
Extended scanning types.
Definition: ble_gapm.h:340
ble_gap_ext_scan_param_t::scan_param_coded
ble_gap_scan_wd_op_param_t scan_param_coded
Scan window opening parameters for LE Coded PHY.
Definition: ble_gapm.h:655
ble_gap_adv_mode_t
ble_gap_adv_mode_t
GAP advertising modes.
Definition: ble_gapm.h:220
ble_gap_evt_adv_report_t::adv_info
ble_gap_adv_report_info_t adv_info
Bit field providing information about the received report.
Definition: ble_gapm.h:812
BLE_GAP_ADV_PROP_ANONYMOUS_BIT
@ BLE_GAP_ADV_PROP_ANONYMOUS_BIT
Definition: ble_gapm.h:302
BLE_GAP_PHY_1MBPS_VALUE
@ BLE_GAP_PHY_1MBPS_VALUE
LE 1M PHY.
Definition: ble_gapm.h:254
ble_gap_actv_role_t
ble_gap_actv_role_t
Possible roles of the activity.
Definition: ble_gapm.h:505
ble_gap_ext_init_param_t
Extended initiating parameters.
Definition: ble_gapm.h:712
BLE_GAP_ADV_TYPE_ADV_LOW_DIRECT_IND
@ BLE_GAP_ADV_TYPE_ADV_LOW_DIRECT_IND
Directed low duty cycle mode.
Definition: ble_gapm.h:225
ble_gap_le_phy_value_t
ble_gap_le_phy_value_t
Specify what PHY the Controller has changed for TX/RX.
Definition: ble_gapm.h:252
BLE_GAP_ADV_PROP_DIRECTED_BIT
@ BLE_GAP_ADV_PROP_DIRECTED_BIT
Definition: ble_gapm.h:299
ble_gap_evt_sync_established_t::clk_acc
uint8_t clk_acc
Advertiser clock accuracy.
Definition: ble_gapm.h:832
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:423
ble_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:565
BLE_GAP_ADV_PROP_SCAN_REQ_NTF_EN_BIT
@ BLE_GAP_ADV_PROP_SCAN_REQ_NTF_EN_BIT
Definition: ble_gapm.h:305
BLE_GAP_WRITE_PERM_DISABLE
@ BLE_GAP_WRITE_PERM_DISABLE
Disable write access.
Definition: ble_gapm.h:182
ble_gap_bond_dev_del
uint16_t ble_gap_bond_dev_del(const ble_gap_bdaddr_t *p_peer_addr)
Delete a bond device with the specified BD address.
ble_gap_whitelist_get
uint16_t ble_gap_whitelist_get(ble_gap_white_list_t *p_whitelist)
Get the content of the whole white list.
ble_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:702
BLE_GAP_CLK_ACC_100
@ BLE_GAP_CLK_ACC_100
10 ppm.
Definition: ble_gapm.h:520
BLE_GAP_EXT_SCAN_TYPE_CONN_DISC
@ BLE_GAP_EXT_SCAN_TYPE_CONN_DISC
Connectable discovery.
Definition: ble_gapm.h:345
ble_gap_rpa_addr_report_callback_t
void(* ble_gap_rpa_addr_report_callback_t)(ble_gap_actv_type_t type, uint8_t index, const uint8_t *rpa_addr)
The BLE rpa address report callback.
Definition: ble_gapm.h:868
ble_gap_per_sync_param_t
Periodic advertising synchronization parameters.
Definition: ble_gapm.h:673
ble_gap_evt_rslv_addr_read_t
Read resolvable address event for BLE_GAPM_EVT_READ_RSLV_ADDR.
Definition: ble_gapm.h:839
ble_gap_rslv_addr_read_op_id_t
ble_gap_rslv_addr_read_op_id_t
Operation code used to read resolvable address.
Definition: ble_gapm.h:785
BLE_GAP_AD_TYPE_PUB_TGT_ADDR
@ BLE_GAP_AD_TYPE_PUB_TGT_ADDR
Public Target Address.
Definition: ble_gapm.h:439
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
ble_gap_chnl_map_timer_set
uint16_t ble_gap_chnl_map_timer_set(bool enable_flag)
Set ble channel map update timer enable or disable.
ble_gap_lepsm_register_t
LE Protocol/Service Multiplexer information.
Definition: ble_gapm.h:728
BLE_GAP_ADV_ALLOW_SCAN_ANY_CON_ANY
@ BLE_GAP_ADV_ALLOW_SCAN_ANY_CON_ANY
Allow both scan and connection requests from anyone.
Definition: ble_gapm.h:242
ble_gap_scan_param_t::scan_type
ble_gap_scan_type_t scan_type
Active scanning or passive scanning.
Definition: ble_gapm.h:627
BLE_GAP_ADV_PROP_PER_TX_PWR_BIT
@ BLE_GAP_ADV_PROP_PER_TX_PWR_BIT
Definition: ble_gapm.h:304
ble_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:701
BLE_GAP_ADV_DATA_TYPE_DATA
@ BLE_GAP_ADV_DATA_TYPE_DATA
Advertising data.
Definition: ble_gapm.h:194
ble_gap_per_sync_param_set
uint16_t ble_gap_per_sync_param_set(uint8_t per_sync_idx, ble_gap_per_sync_param_t *p_per_sync_param)
Set the parameters used for periodic sync.
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_evt_scan_req_t
Scan request info.
Definition: ble_gapm.h:798
ble_gap_evt_adv_report_t::adv_sid
uint8_t adv_sid
Advertising SID , valid only for periodic advertising report.
Definition: ble_gapm.h:819
ble_gap_clk_acc_t
ble_gap_clk_acc_t
Clock ACC error.
Definition: ble_gapm.h:516
BLE_GAP_SCAN_PROP_FILT_TRUNC_BIT
@ BLE_GAP_SCAN_PROP_FILT_TRUNC_BIT
Filter truncated advertising or scan response reports.
Definition: ble_gapm.h:389
ble_gap_init_param_t
Legacy initiating parameters.
Definition: ble_gapm.h:685
BLE_GAP_SCAN_PROP_PHY_CODED_BIT
@ BLE_GAP_SCAN_PROP_PHY_CODED_BIT
Scan advertisement on the LE Coded PHY.
Definition: ble_gapm.h:385
BLE_GAP_ADV_PROP_SCANNABLE_BIT
@ BLE_GAP_ADV_PROP_SCANNABLE_BIT
Definition: ble_gapm.h:298
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:435
BLE_GAP_SCAN_FILT_DUPLIC_EN
@ BLE_GAP_SCAN_FILT_DUPLIC_EN
Enable filtering of duplicate packets.
Definition: ble_gapm.h:333
BLE_GAP_ADV_PROP_USE_LEGACY_PDUS_BIT
@ BLE_GAP_ADV_PROP_USE_LEGACY_PDUS_BIT
Definition: ble_gapm.h:301
BLE_GAP_REPORT_TYPE_SCAN_RSP_LEG
@ BLE_GAP_REPORT_TYPE_SCAN_RSP_LEG
Legacy scan response report.
Definition: ble_gapm.h:470
BLE_GAP_SCAN_FILT_DUPLIC_DIS
@ BLE_GAP_SCAN_FILT_DUPLIC_DIS
Disable filtering of duplicate packets.
Definition: ble_gapm.h:332
BLE_GAP_ADV_PROP_USE_LEGACY_PDUS_POS
@ BLE_GAP_ADV_PROP_USE_LEGACY_PDUS_POS
Use legacy advertising PDUs.
Definition: ble_gapm.h:282
ble_gap_update_adv_data
uint16_t ble_gap_update_adv_data(uint8_t adv_idx, ble_gap_adv_data_type_t type, const uint8_t *p_data, uint16_t length)
Update Advertising Data, Scan Response Data and Periodic Advertising Data.
ble_gap_ext_scan_dup_filt_policy_t
ble_gap_ext_scan_dup_filt_policy_t
Filtering policy for duplicated packets.
Definition: ble_gapm.h:353
ble_gap_evt_adv_report_t::per_sync_idx
uint8_t per_sync_idx
Periodic syncronization index, valid only for periodic advertising report.
Definition: ble_gapm.h:821
BLE_GAP_ADV_TYPE_ADV_IND
@ BLE_GAP_ADV_TYPE_ADV_IND
Undirected connectable and scannable mode.
Definition: ble_gapm.h:221
ble_gap_evt_scan_stop_t
Scan Stop info struct.
Definition: ble_gapm.h:804
ble_gap_evt_scan_stop_t::reason
ble_gap_stopped_reason_t reason
Scan Stop info.
Definition: ble_gapm.h:805
BLE_GAP_PHY_UNDEF_VALUE
@ BLE_GAP_PHY_UNDEF_VALUE
Undefined LE PHY.
Definition: ble_gapm.h:253
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:419
ble_gapm_evt_t::dev_info
ble_gap_evt_dev_info_get_t dev_info
Device info parameters.
Definition: ble_gapm.h:850
ble_gap_ext_adv_param_t::period_cfg
ble_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:602
BLE_GAP_PRIVACY_MODE_DEVICE
@ BLE_GAP_PRIVACY_MODE_DEVICE
Set to the device privacy mode for the peer device.
Definition: ble_gapm.h:498
BLE_GAP_SCAN_PROP_ACTIVE_CODED_BIT
@ BLE_GAP_SCAN_PROP_ACTIVE_CODED_BIT
Active scan on LE Coded PHY (scan request PDUs may be sent).
Definition: ble_gapm.h:387
CO_BIT
#define CO_BIT(pos)
Bit operation helper.
Definition: ble_gapm.h:72
ble_gapm_evt_t
BLE GAPM event structure.
Definition: ble_gapm.h:846
ble_gap_ext_scan_param_t::prop
uint8_t prop
Properties for the scan procedure (see enum ble_gap_scan_prop for bit signification).
Definition: ble_gapm.h:651
ble_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:586
BLE_GAP_ACTIVITY_ROLE_SCAN_INIT
@ BLE_GAP_ACTIVITY_ROLE_SCAN_INIT
Scann role.
Definition: ble_gapm.h:508
BLE_GAP_DISC_MODE_BROADCASTER
@ BLE_GAP_DISC_MODE_BROADCASTER
Broadcaster mode.
Definition: ble_gapm.h:234
ble_gap_actv_type_t
ble_gap_actv_type_t
Activity type.
Definition: ble_gapm.h:531
BLE_GAP_ADV_PROP_ANONYMOUS_POS
@ BLE_GAP_ADV_PROP_ANONYMOUS_POS
Enable anonymous mode.
Definition: ble_gapm.h:283
BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE
@ BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE
Limited discovery flag: AD Flag.
Definition: ble_gapm.h:457
BLE_GAP_CLK_ACC_150
@ BLE_GAP_CLK_ACC_150
150 ppm.
Definition: ble_gapm.h:519
ble_gapm_evt_t::scan_req
ble_gap_evt_scan_req_t scan_req
Scan Request parameter.
Definition: ble_gapm.h:852
ble_gap_period_adv_addr_cfg_t::adv_sid
uint8_t adv_sid
Advertising SID.
Definition: ble_gapm.h:666
ble_gap_ext_adv_param_t::prop
uint16_t prop
Bit field value provided by advertising properties.
Definition: ble_gapm.h:596
BLE_GAP_ADV_ALLOW_SCAN_ANY_CON_WLST
@ BLE_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
BLE_GAP_AD_TYPE_SPAIR_RAND
@ BLE_GAP_AD_TYPE_SPAIR_RAND
Simple Pairing Randomizer R-256.
Definition: ble_gapm.h:446
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
ble_gap_period_adv_list_t::num
uint8_t num
Number of available items.
Definition: ble_gapm.h:757
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_reslv_rpa_addr_callback_t
void(* ble_gap_reslv_rpa_addr_callback_t)(uint8_t status, ble_gap_bdaddr_t *iden_addr, uint8_t src_info)
The BLE reslove rpa address callback.
Definition: ble_gapm.h:865
ble_gap_ext_init_param_t::conn_param_2m
ble_gap_ext_conn_param_t conn_param_2m
Connection parameters for LE 2M PHY.
Definition: ble_gapm.h:719
ble_gap_init_param_t::type
ble_gap_init_type_t type
Initiating type (see enum ble_gap_init_type_t).
Definition: ble_gapm.h:686
ble_gap_per_sync_stop
uint16_t ble_gap_per_sync_stop(uint8_t per_sync_idx)
Stop periodic synchronization.
ble_gap_evt_rslv_addr_read_t::op_code
uint8_t op_code
Operation code.
Definition: ble_gapm.h:840
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...
BLE_GAP_CLK_ACC_30
@ BLE_GAP_CLK_ACC_30
30 ppm.
Definition: ble_gapm.h:523
ble_gap_evt_adv_report_t::tx_pwr
int8_t tx_pwr
TX power (in dBm).
Definition: ble_gapm.h:815
BLE_GAP_OPCODE_PEER_RSLV_ADDR_READ
@ BLE_GAP_OPCODE_PEER_RSLV_ADDR_READ
Peer resolvable address operation.
Definition: ble_gapm.h:787
BLE_GAP_AD_TYPE_LE_ROLE
@ BLE_GAP_AD_TYPE_LE_ROLE
LE Role.
Definition: ble_gapm.h:444
BLE_GAP_ADV_TYPE_ADV_NONCONN_IND
@ BLE_GAP_ADV_TYPE_ADV_NONCONN_IND
Non-connectable and non-scanable mode.
Definition: ble_gapm.h:222
ble_gap_conn_param_t
The parameter of connection.
Definition: ble_gapc.h:258
BLE_GAP_AD_TYPE_SLAVE_CONN_INT_RANGE
@ BLE_GAP_AD_TYPE_SLAVE_CONN_INT_RANGE
Slave connection interval range.
Definition: ble_gapm.h:432
BLE_GAP_ROLE_NONE
@ BLE_GAP_ROLE_NONE
No role set yet.
Definition: ble_gapm.h:159
ble_gap_evt_adv_stop_t::reason
ble_gap_stopped_reason_t reason
Advertising Stop info.
Definition: ble_gapm.h:793
ble_gap_ext_scan_param_t::dup_filt_pol
ble_gap_ext_scan_dup_filt_policy_t dup_filt_pol
Duplicate packet filtering policy (see enum ble_gap_ext_scan_dup_filt_policy_t).
Definition: ble_gapm.h:652
ble_error.h
File that contains error codes.
BLE_GAP_ADV_PROP_HDC_POS
@ BLE_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_gapc.h
BLE GAPC API.
ble_gap_ral_dev_info_t
RPA list item info.
Definition: ble_gapm.h:765
ble_gap_connect
uint16_t ble_gap_connect(ble_gap_own_addr_t own_addr_type, ble_gap_init_param_t *p_init_param)
Start a legacy connection to a device.
ble_gap_ext_init_param_t::conn_param_coded
ble_gap_ext_conn_param_t conn_param_coded
Connection parameters for LE Coded PHY.
Definition: ble_gapm.h:720
ble_gap_init_type_t
ble_gap_init_type_t
Initiating types.
Definition: ble_gapm.h:363
BLE_GAP_REPORT_INFO_SCAN_ADV_BIT
@ BLE_GAP_REPORT_INFO_SCAN_ADV_BIT
Scannable advertising.
Definition: ble_gapm.h:479
BLE_GAP_ADV_PROP_CONNECTABLE_POS
@ BLE_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
BLE_GAP_EXT_DUP_FILT_DIS
@ BLE_GAP_EXT_DUP_FILT_DIS
Disable filtering of duplicated packets.
Definition: ble_gapm.h:354
ble_gapm_evt_t::adv_report
ble_gap_evt_adv_report_t adv_report
Advertising Report parameter.
Definition: ble_gapm.h:854
BLE_GAP_INIT_TYPE_AUTO_CONN_EST
@ BLE_GAP_INIT_TYPE_AUTO_CONN_EST
Automatic connection establishment: establish a connection with all devices whose address is present ...
Definition: ble_gapm.h:365
ble_gap_adv_param_t::adv_mode
ble_gap_adv_mode_t adv_mode
Advertising mode (see enum ble_gap_adv_mode_t).
Definition: ble_gapm.h:548
ble_gap_scan_param_t::use_whitelist
bool use_whitelist
Filter policy.
Definition: ble_gapm.h:630
BLE_GAP_REPORT_INFO_COMPLETE_BIT
@ BLE_GAP_REPORT_INFO_COMPLETE_BIT
Report is complete.
Definition: ble_gapm.h:477
BLE_GAP_REPORT_TYPE_ADV_LEG
@ BLE_GAP_REPORT_TYPE_ADV_LEG
Legacy advertising report.
Definition: ble_gapm.h:468
ble_gap_adv_type_t
ble_gap_adv_type_t
Advertising type.
Definition: ble_gapm.h:263
ble_gap_white_list_t::num
uint8_t num
Number of available items.
Definition: ble_gapm.h:748
ble_gap_adv_second_cfg_t::adv_sid
uint8_t adv_sid
Advertising SID.
Definition: ble_gapm.h:577
ble_gap_scan_prop_t
ble_gap_scan_prop_t
Scanning properties bit field bit value.
Definition: ble_gapm.h:383
BLE_GAP_ADV_TYPE_ADV_SCAN_IND
@ BLE_GAP_ADV_TYPE_ADV_SCAN_IND
Undirected scannable mode.
Definition: ble_gapm.h:223
ble_gap_evt_sync_established_t
Sync established event for BLE_GAPM_EVT_SYNC_ESTABLISH.
Definition: ble_gapm.h:828
ble_gap_sec_key_t
Security key.
Definition: ble_gapm.h:618
ble_gap_scan_type_t
ble_gap_scan_type_t
Scanning types.
Definition: ble_gapm.h:312
BLE_GAP_ADV_FLAG_SIMUL_BR_EDR_LE_HOST
@ BLE_GAP_ADV_FLAG_SIMUL_BR_EDR_LE_HOST
Dual mode for host supported (BR/EDR/LE): AD Flag.
Definition: ble_gapm.h:461
ble_gap_evt_adv_report_t::data
uint8_t * data
Report.
Definition: ble_gapm.h:823
ble_gap_evt_adv_report_t::phy_second
uint8_t phy_second
Secondary PHY on which advertising report has been received.
Definition: ble_gapm.h:818
ble_gap_adv_start
uint16_t ble_gap_adv_start(uint8_t adv_idx, ble_gap_adv_time_param_t *p_timeout)
Start advertising.
BLE_GAP_EXT_DUP_FILT_EN_PERIOD
@ BLE_GAP_EXT_DUP_FILT_EN_PERIOD
Enable filtering of duplicated packets, reset for each scan period.
Definition: ble_gapm.h:356
ble_gap_adv_time_param_t::duration
uint16_t duration
Advertising duration (in unit of 10ms).
Definition: ble_gapm.h:610
ble_gap_bond_dev_list_t
Bonded device list.
Definition: ble_gapm.h:738
BLE_GAP_ADV_FLAG_SIMUL_BR_EDR_LE_CONTROLLER
@ BLE_GAP_ADV_FLAG_SIMUL_BR_EDR_LE_CONTROLLER
Dual mode for controller supported (BR/EDR/LE): AD Flag.
Definition: ble_gapm.h:460
BLE_GAP_INIT_TYPE_NAME_DISC
@ BLE_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:366
BLE_GAP_ADV_DATA_TYPE_PER_DATA
@ BLE_GAP_ADV_DATA_TYPE_PER_DATA
Periodic advertising data.
Definition: ble_gapm.h:196
ble_gap_disc_mode_t
ble_gap_disc_mode_t
GAP discoverability modes.
Definition: ble_gapm.h:230
BLE_GAP_SCAN_PROP_ACTIVE_1M_BIT
@ BLE_GAP_SCAN_PROP_ACTIVE_1M_BIT
Active scan on LE 1M PHY (scan request PDUs may be sent).
Definition: ble_gapm.h:386
ble_gap_dev_name_write_perm_t
ble_gap_dev_name_write_perm_t
Write permissions of the device name characteristic.
Definition: ble_gapm.h:181
ble_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:642
BLE_GAP_ADV_TYPE_PERIODIC
@ BLE_GAP_ADV_TYPE_PERIODIC
Periodic advertising.
Definition: ble_gapm.h:266
ble_gap_scan_stop
uint16_t ble_gap_scan_stop(void)
Stop scanning.
ble_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:564
ble_gap_per_adv_list_get
uint16_t ble_gap_per_adv_list_get(ble_gap_period_adv_list_t *p_pal_list)
Get the content of the whole periodic advertising list.
BLE_GAP_SEC_LVL_ENC_NO_AUTH
@ BLE_GAP_SEC_LVL_ENC_NO_AUTH
Encryption with no auth.
Definition: ble_gapm.h:407
ble_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:555
BLE_GAP_AD_TYPE_APPEARANCE
@ BLE_GAP_AD_TYPE_APPEARANCE
Appearance.
Definition: ble_gapm.h:441
BLE_GAP_REPORT_TYPE_ADV_EXT
@ BLE_GAP_REPORT_TYPE_ADV_EXT
Extended advertising report.
Definition: ble_gapm.h:467
ble_gap_per_sync_param_t::rsvd
uint8_t rsvd
Reserved for future use.
Definition: ble_gapm.h:677
BLE_GAP_EXT_SCAN_TYPE_SEL_OBSERVER
@ BLE_GAP_EXT_SCAN_TYPE_SEL_OBSERVER
Selective observer.
Definition: ble_gapm.h:344
ble_gap_ppcp_present_set
void ble_gap_ppcp_present_set(bool present_flag)
Set GAP Peripheral Preferred Connection Parameters present flag.
ble_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:688
ble_gap_ext_adv_param_t::type
ble_gap_adv_type_t type
Advertising type (see enum ble_gap_adv_type_t).
Definition: ble_gapm.h:594
BLE_GAP_DISC_MODE_LIM_DISCOVERABLE
@ BLE_GAP_DISC_MODE_LIM_DISCOVERABLE
Limited-discoverable mode.
Definition: ble_gapm.h:233
ble_gap_ext_connect
uint16_t ble_gap_ext_connect(ble_gap_own_addr_t own_addr_type, ble_gap_ext_init_param_t *p_init_param)
Start an extended connection to a device.
ble_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:689
ble_gap_per_sync_param_t::type
ble_gap_per_sync_type_t type
Periodic synchronization type (see enum ble_gap_per_sync_type_t).
Definition: ble_gapm.h:676
ble_gap_whitelist_del
uint16_t ble_gap_whitelist_del(const ble_gap_white_list_t *p_whitelist)
Delete the devices out of current white list.
BLE_GAP_MAX_KEY_LEN
#define BLE_GAP_MAX_KEY_LEN
The key length.
Definition: ble_gapm.h:79
ble_gap_chnl_map_set
uint16_t ble_gap_chnl_map_set(ble_gap_chnl_map_t *p_chnl_map)
Set advertising channel map before advertising starts.
BLE_GAP_OPCODE_LOCAL_RSLV_ADDR_READ
@ BLE_GAP_OPCODE_LOCAL_RSLV_ADDR_READ
Local resolvable address operation.
Definition: ble_gapm.h:786
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:438
ble_gap_adv_flags_t
ble_gap_adv_flags_t
AD Type Flag - Bit mask.
Definition: ble_gapm.h:456
BLE_GAP_AD_TYPE_3D_INFO
@ BLE_GAP_AD_TYPE_3D_INFO
3D Information Data.
Definition: ble_gapm.h:447
BLE_GAP_AD_TYPE_SHORTENED_NAME
@ BLE_GAP_AD_TYPE_SHORTENED_NAME
Shortened Device name.
Definition: ble_gapm.h:424
BLE_GAP_CLK_ACC_500
@ BLE_GAP_CLK_ACC_500
500 ppm.
Definition: ble_gapm.h:517
BLE_GAP_PER_SYNC_TYPE_GENERAL
@ BLE_GAP_PER_SYNC_TYPE_GENERAL
Do not use periodic advertiser list for synchronization.
Definition: ble_gapm.h:397
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:437
BLE_GAP_INIT_PROP_CODED_BIT
@ BLE_GAP_INIT_PROP_CODED_BIT
Scan connectable advertisements on the LE Coded PHY.
Definition: ble_gapm.h:376
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.
BLE_GAP_AD_TYPE_SP_HASH_C
@ BLE_GAP_AD_TYPE_SP_HASH_C
Simple Pairing Hash C.
Definition: ble_gapm.h:428
BLE_GAP_EXT_SCAN_TYPE_SEL_CONN_DISC
@ BLE_GAP_EXT_SCAN_TYPE_SEL_CONN_DISC
Selective connectable discovery.
Definition: ble_gapm.h:346
ble_gap_adv_param_t
Advertising parameters for legacy advertising.
Definition: ble_gapm.h:547
BLE_GAP_EXT_SCAN_TYPE_OBSERVER
@ BLE_GAP_EXT_SCAN_TYPE_OBSERVER
Observer.
Definition: ble_gapm.h:343
ble_gap_privacy_mode_set
uint16_t ble_gap_privacy_mode_set(ble_gap_bdaddr_t peer_addr, ble_gap_privacy_mode_t mode)
Set privacy mode for peer device.
ble_gap_stopped_reason_t
ble_gap_stopped_reason_t
Stop reason code.
Definition: ble_gapm.h:485
ble_gap_ext_adv_param_t::filter_pol
ble_gap_adv_filter_policy_t filter_pol
Advertising filtering policy (see enum ble_gap_adv_filter_policy_t).
Definition: ble_gapm.h:598
ble_gapm_evt_t::index
uint8_t index
Index of connection or advertising.
Definition: ble_gapm.h:847
ble_gapm_evt_t::rslv_addr
ble_gap_evt_rslv_addr_read_t rslv_addr
Read Resolvable Address parameter.
Definition: ble_gapm.h:856
ble_gap_ral_dev_info_t::bd_addr
ble_gap_bdaddr_t bd_addr
Peer device identity.
Definition: ble_gapm.h:766
BLE_GAP_STOPPED_REASON_ON_USER
@ BLE_GAP_STOPPED_REASON_ON_USER
Stop with user stopping it actively.
Definition: ble_gapm.h:487
ble_gap_scan_param_t::scan_mode
ble_gap_scan_mode_t scan_mode
Scan mode.
Definition: ble_gapm.h:628
ble_gap_lepsm_register_t::sec_lvl
ble_gap_sec_lvl_type_t sec_lvl
Security level requirement, see ble_gap_sec_lvl_type_t.
Definition: ble_gapm.h:730
ble_gap_evt_adv_report_t::rssi
int8_t rssi
RSSI (between -127 and +20 dBm).
Definition: ble_gapm.h:816
ble_gap_ral_dev_list_t::num
uint8_t num
Number of RPA list.
Definition: ble_gapm.h:777
ble_gap_ppcp_set
uint16_t ble_gap_ppcp_set(ble_gap_conn_param_t const *p_conn_params)
Set GAP Peripheral Preferred Connection Parameters.
ble_gap_adv_second_cfg_t::phy
ble_gap_le_phy_value_t phy
Indicate on which PHY secondary advertising has to be performed.
Definition: ble_gapm.h:576
BLE_GAP_SCAN_PROP_PHY_1M_BIT
@ BLE_GAP_SCAN_PROP_PHY_1M_BIT
Scan advertisement on the LE 1M PHY.
Definition: ble_gapm.h:384
ble_gap_sec_lvl_type_t
ble_gap_sec_lvl_type_t
Security level types.
Definition: ble_gapm.h:405
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.
ble_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:657
ble_gap_evt_adv_report_t::phy_prim
uint8_t phy_prim
Primary PHY on which advertising report has been received.
Definition: ble_gapm.h:817
ble_gap_lepsm_register
uint16_t ble_gap_lepsm_register(ble_gap_lepsm_register_t *p_lepsm)
Register a LE Protocol/Service Multiplexer.
ble_gap_evt_adv_report_t::broadcaster_addr
ble_gap_bdaddr_t broadcaster_addr
Broadcaster device address.
Definition: ble_gapm.h:813
ble_gap_ext_adv_param_t::second_cfg
ble_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:601
ble_gapm_evt_t::sync_established
ble_gap_evt_sync_established_t sync_established
Periodic Advertising Synchronization Established parameter.
Definition: ble_gapm.h:855
ble_gapm_evt_t::scan_stop
ble_gap_evt_scan_stop_t scan_stop
Scan Stop parameter.
Definition: ble_gapm.h:853
ble_gapm_evt_t::adv_stop
ble_gap_evt_adv_stop_t adv_stop
Advertising stop parameter.
Definition: ble_gapm.h:851
ble_gap_ext_scan_param_t
Parameters for extended scanning.
Definition: ble_gapm.h:649
ble_gap_adv_stop
uint16_t ble_gap_adv_stop(uint8_t adv_idx)
Stop advertising.
ble_gap_ext_conn_param_t
Connection parameters.
Definition: ble_gapm.h:700
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
ble_gap_lepsm_unregister
uint16_t ble_gap_lepsm_unregister(uint16_t le_psm)
Unregister a LE Protocol/Service Multiplexer.
BLE_GAP_ADV_TYPE_ADV_HIGH_DIRECT_IND
@ BLE_GAP_ADV_TYPE_ADV_HIGH_DIRECT_IND
Directed high duty cycle mode.
Definition: ble_gapm.h:224
ble_gap_appearance_set
void ble_gap_appearance_set(uint16_t appearance)
Set GAP appearance value.
BLE_GAP_DISC_MODE_NON_DISCOVERABLE
@ BLE_GAP_DISC_MODE_NON_DISCOVERABLE
Non-discoverable mode.
Definition: ble_gapm.h:231
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.
BLE_GAP_WRITE_PERM_NOAUTH
@ BLE_GAP_WRITE_PERM_NOAUTH
LE Security Mode 1, Level 1.
Definition: ble_gapm.h:183
BLE_GAP_DISC_MODE_GEN_DISCOVERABLE
@ BLE_GAP_DISC_MODE_GEN_DISCOVERABLE
General-discoverable mode.
Definition: ble_gapm.h:232
ble_gap_adv_period_cfg_t
Configuration for periodic advertising.
Definition: ble_gapm.h:584
BLE_GAP_MAX_WL_NUM
#define BLE_GAP_MAX_WL_NUM
Maximal white list number.
Definition: ble_gapm.h:76
ble_gap_evt_adv_stop_t
Advertising Stop info.
Definition: ble_gapm.h:792
ble_gap_dev_info_get_type_t
ble_gap_dev_info_get_type_t
Get device parameters operation code.
Definition: ble_gapm.h:202
ble_gap_addr_get
uint16_t ble_gap_addr_get(ble_gap_bdaddr_t *p_addr)
Get the device identity address (public or random static).
ble_gap_evt_adv_report_t::period_adv_intv
uint16_t period_adv_intv
Periodic advertising interval (in unit of 1.25ms, min is 7.5ms), valid only for periodic advertising ...
Definition: ble_gapm.h:820
ble_gap_ext_init_param_t::scan_param_coded
ble_gap_scan_wd_op_param_t scan_param_coded
Scan window opening parameters for LE Coded PHY.
Definition: ble_gapm.h:717
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
ble_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:632
ble_gap_rpa_addr_report_cb_register
void ble_gap_rpa_addr_report_cb_register(ble_gap_rpa_addr_report_callback_t cb)
Set the cb for rpa address report.
BLE_GAP_PER_SYNC_TYPE_SELECTIVE
@ BLE_GAP_PER_SYNC_TYPE_SELECTIVE
Use periodic advertiser list for synchronization.
Definition: ble_gapm.h:398
BLE_GAP_AD_TYPE_FLAGS
@ BLE_GAP_AD_TYPE_FLAGS
Flag.
Definition: ble_gapm.h:417
BLE_GAP_INIT_PROP_1M_BIT
@ BLE_GAP_INIT_PROP_1M_BIT
Scan connectable advertisements on the LE 1M PHY.
Definition: ble_gapm.h:374
ble_gap_period_adv_list_t
Periodic advertising list.
Definition: ble_gapm.h:756
BLE_GAP_MAX_PRD_ADV_NUM
#define BLE_GAP_MAX_PRD_ADV_NUM
Maximal periodic advertising list number.
Definition: ble_gapm.h:78
BLE_GAP_SCAN_PROP_ACCEPT_RPA_BIT
@ BLE_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:388
ble_gap_adv_param_t::chnl_map
uint8_t chnl_map
Advertising channel map.
Definition: ble_gapm.h:554
BLE_GAP_ACTIVITY_ROLE_UNKNOWN
@ BLE_GAP_ACTIVITY_ROLE_UNKNOWN
Unknown role.
Definition: ble_gapm.h:509
BLE_GAP_SCAN_PASSIVE
@ BLE_GAP_SCAN_PASSIVE
Passive scan type.
Definition: ble_gapm.h:314
ble_gap_evt_adv_report_t::adv_type
ble_gap_adv_report_type_t adv_type
Advertising type.
Definition: ble_gapm.h:811
ble_gap_ext_scan_param_t::scan_param_1m
ble_gap_scan_wd_op_param_t scan_param_1m
Scan window opening parameters for LE 1M PHY.
Definition: ble_gapm.h:654
BLE_GAP_AD_TYPE_CLASS_OF_DEVICE
@ BLE_GAP_AD_TYPE_CLASS_OF_DEVICE
Class of device.
Definition: ble_gapm.h:427
ble_gap_adv_prim_cfg_t::phy
ble_gap_le_phy_value_t phy
Indicate on which PHY primary advertising has to be performed.
Definition: ble_gapm.h:567
ble_gap_appearance_get
uint16_t ble_gap_appearance_get(uint16_t *p_appearance)
Get GAP appearance value.
BLE_GAP_AD_TYPE_OOB_FLAGS
@ BLE_GAP_AD_TYPE_OOB_FLAGS
Out of Band Flag.
Definition: ble_gapm.h:431
BLE_GAP_AD_TYPE_RAND_TGT_ADDR
@ BLE_GAP_AD_TYPE_RAND_TGT_ADDR
Random Target Address.
Definition: ble_gapm.h:440
ble_gap_ext_scan_param_t::duration
uint16_t duration
Scan duration (in unit of 10ms).
Definition: ble_gapm.h:656
ble_gap_ext_init_param_t::prop
uint8_t prop
Properties for the initiating procedure (see enum ble_gap_init_prop_t for bit signification).
Definition: ble_gapm.h:714
ble_gap_adv_data_set
uint16_t ble_gap_adv_data_set(uint8_t adv_idx, ble_gap_adv_data_type_t type, const uint8_t *p_data, uint16_t length)
Set Advertising Data, Scan Response Data and Periodic Advertising Data.
ble_gap_adv_report_type_t
ble_gap_adv_report_type_t
Advertising report type.
Definition: ble_gapm.h:466
ble_gap_init_param_t::slave_latency
uint16_t slave_latency
Slave latency.
Definition: ble_gapm.h:690
ble_gap_adv_param_set
uint16_t ble_gap_adv_param_set(uint8_t adv_idx, ble_gap_own_addr_t own_addr_type, ble_gap_adv_param_t *p_adv_param)
Set parameters for advertising.
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:421
ble_gap_scan_mode_t
ble_gap_scan_mode_t
Scanning modes.
Definition: ble_gapm.h:321
BLE_GAP_REPORT_TYPE_SCAN_RSP_EXT
@ BLE_GAP_REPORT_TYPE_SCAN_RSP_EXT
Extended scan response report.
Definition: ble_gapm.h:469
ble_gap_bond_dev_list_t::num
uint8_t num
Number of bonded device.
Definition: ble_gapm.h:739
BLE_GAP_ROLE_OBSERVER
@ BLE_GAP_ROLE_OBSERVER
Observer role.
Definition: ble_gapm.h:160
ble_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:641
BLE_GAP_MAX_BOND_NUM
#define BLE_GAP_MAX_BOND_NUM
Maximal bonding number.
Definition: ble_gapm.h:75
ble_gap_ext_init_param_t::peer_addr
ble_gap_bdaddr_t peer_addr
Address of peer device in case white list is not used for connection.
Definition: ble_gapm.h:721
BLE_GAP_AD_TYPE_MANU_SPECIFIC_DATA
@ BLE_GAP_AD_TYPE_MANU_SPECIFIC_DATA
Manufacturer specific data.
Definition: ble_gapm.h:449
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_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_adv_param_t::filter_pol
ble_gap_adv_filter_policy_t filter_pol
Advertising filtering policy (see enum ble_gap_adv_filter_policy_t).
Definition: ble_gapm.h:550
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:422
ble_gap_per_adv_list_add
uint16_t ble_gap_per_adv_list_add(const ble_gap_period_adv_list_t *p_pal_list)
Add the devices into current periodic advertising list.
ble_gap_own_addr_t
ble_gap_own_addr_t
Own BD address source of the device.
Definition: ble_gapm.h:171
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:433
ble_gap_bond_dev_addr_get
uint16_t ble_gap_bond_dev_addr_get(uint8_t conn_idx, ble_gap_bdaddr_t *p_peer_addr)
Get BD address of the bonded device.
ble_gap_ext_scan_param_t::type
ble_gap_ext_scan_type_t type
Type of scanning to be started (see enum ble_gap_ext_scan_type_t).
Definition: ble_gapm.h:650
ble_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:585
BLE_GAP_INIT_PROP_2M_BIT
@ BLE_GAP_INIT_PROP_2M_BIT
Connection parameters for the LE 2M PHY are provided.
Definition: ble_gapm.h:375
ble_gap_evt_rslv_addr_read_t::gap_addr
ble_gap_addr_t gap_addr
Resolvable address info.
Definition: ble_gapm.h:841
BLE_GAP_AD_TYPE_SP_RANDOMIZER_R
@ BLE_GAP_AD_TYPE_SP_RANDOMIZER_R
Simple Pairing Randomizer.
Definition: ble_gapm.h:429
ble_gap_adv_param_t::disc_mode
ble_gap_disc_mode_t disc_mode
Discovery mode (see enum ble_gap_disc_mode_t).
Definition: ble_gapm.h:549
ble_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:631
ble_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:674
ble_gap_ext_init_param_t::conn_param_1m
ble_gap_ext_conn_param_t conn_param_1m
Connection parameters for LE 1M PHY.
Definition: ble_gapm.h:718
BLE_GAP_AD_TYPE_ADV_INTV
@ BLE_GAP_AD_TYPE_ADV_INTV
Advertising Interval.
Definition: ble_gapm.h:442
ble_gap_evt_adv_report_t::direct_addr
ble_gap_bdaddr_t direct_addr
Target address (in case of a directed advertising report).
Definition: ble_gapm.h:814
ble_gap_chnl_map_t
Channel map structure.
Definition: ble_gapc.h:282
ble_gap_evt_dev_info_get_t
Get device info event for BLE_GAPC_EVT_DEV_INFO_GOT.
Definition: ble_gapc.h:371
BLE_GAP_ACTV_TYPE_PER_SYNC
@ BLE_GAP_ACTV_TYPE_PER_SYNC
Definition: ble_gapm.h:535
ble_gap_adv_time_param_t::max_adv_evt
uint8_t max_adv_evt
Maximum number of extended advertising events.
Definition: ble_gapm.h:611
ble_gap_adv_second_cfg_t
Configuration for advertising on secondary channel.
Definition: ble_gapm.h:574
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_devs_get
uint16_t ble_gap_bond_devs_get(ble_gap_bond_dev_list_t *p_bond_list)
Get all bonded devices.
ble_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:633
BLE_GAP_EXT_DUP_FILT_EN
@ BLE_GAP_EXT_DUP_FILT_EN
Enable filtering of duplicated packets.
Definition: ble_gapm.h:355
BLE_GAP_ADV_TYPE_EXTENDED
@ BLE_GAP_ADV_TYPE_EXTENDED
Extended advertising.
Definition: ble_gapm.h:265
ble_gap_scan_param_t::scan_dup_filt
ble_gap_scan_dup_filt_policy_t scan_dup_filt
Duplicate filter policy.
Definition: ble_gapm.h:629
ble_gap_ext_init_param_t::type
ble_gap_init_type_t type
Initiating type (see enum ble_gap_init_type_t).
Definition: ble_gapm.h:713
ble_gap_init_param_t::conn_timeout
uint16_t conn_timeout
Timeout for connection establishment (in unit of 10ms).
Definition: ble_gapm.h:692
BLE_GAP_WRITE_PERM_AUTH
@ BLE_GAP_WRITE_PERM_AUTH
LE Security Mode 1, Level 3.
Definition: ble_gapm.h:185
ble_gap_adv_param_t::adv_intv_max
uint16_t adv_intv_max
Maximum advertising interval (in unit of 625 us).
Definition: ble_gapm.h:553
ble_gap_ext_adv_param_t
Advertising parameters for extended advertising and periodic advertising.
Definition: ble_gapm.h:593
ble_gap_evt_sync_established_t::bd_addr
ble_gap_bdaddr_t bd_addr
Advertiser address.
Definition: ble_gapm.h:833
ble_gap_adv_param_t::adv_intv_min
uint16_t adv_intv_min
Minimum advertising interval (in unit of 625 us).
Definition: ble_gapm.h:552
BLE_GAP_ADV_PROP_DIRECTED_POS
@ BLE_GAP_ADV_PROP_DIRECTED_POS
Indicate that advertising targets at a specific device.
Definition: ble_gapm.h:277
ble_gap_whitelist_clear
uint16_t ble_gap_whitelist_clear(void)
Clear all the entries in the current white list.
BLE_GAP_EXT_SCAN_TYPE_GEN_DISC
@ BLE_GAP_EXT_SCAN_TYPE_GEN_DISC
General discovery.
Definition: ble_gapm.h:341
ble_gap_adv_filter_policy_t
ble_gap_adv_filter_policy_t
Advertising filter policy.
Definition: ble_gapm.h:241
ble_gap_scan_param_set
uint16_t ble_gap_scan_param_set(ble_gap_own_addr_t own_addr_type, ble_gap_scan_param_t *p_scan_param)
Set parameters for scanning.
ble_gap_evt_sync_established_t::adv_sid
uint8_t adv_sid
Advertising SID.
Definition: ble_gapm.h:831
BLE_GAP_SEC_LVL_SC_ENC_AUTH
@ BLE_GAP_SEC_LVL_SC_ENC_AUTH
Security connection encryption with auth.
Definition: ble_gapm.h:409
ble_gap_ad_type_t
ble_gap_ad_type_t
GAP advertising types.
Definition: ble_gapm.h:416
ble_gap_ext_adv_param_set
uint16_t ble_gap_ext_adv_param_set(uint8_t adv_idx, ble_gap_own_addr_t own_addr_type, ble_gap_ext_adv_param_t *p_adv_param)
Set extended parameters for advertising.
ble_gap_adv_prop_t
ble_gap_adv_prop_t
Advertising properties bit field bit value.
Definition: ble_gapm.h:296
BLE_GAP_SEC_LVL_NO_SECURITY
@ BLE_GAP_SEC_LVL_NO_SECURITY
No encryption or auth.
Definition: ble_gapm.h:406
BLE_GAP_AD_TYPE_SPAIR_HASH
@ BLE_GAP_AD_TYPE_SPAIR_HASH
Simple Pairing Hash C-256.
Definition: ble_gapm.h:445
ble_gap_init_param_t::peer_addr
ble_gap_bdaddr_t peer_addr
Peer device address.
Definition: ble_gapm.h:687
BLE_GAP_ADV_PROP_CONNECTABLE_BIT
@ BLE_GAP_ADV_PROP_CONNECTABLE_BIT
Definition: ble_gapm.h:297
BLE_GAP_PHY_2MBPS_VALUE
@ BLE_GAP_PHY_2MBPS_VALUE
LE 2M PHY.
Definition: ble_gapm.h:255
ble_gap_evt_sync_established_t::intv
uint16_t intv
Periodic advertising interval (in unit of 1.25ms, min is 7.5ms).
Definition: ble_gapm.h:830
ble_gap_evt_sync_established_t::sync_hdl
uint16_t sync_hdl
Sync handle.
Definition: ble_gapm.h:834
ble_gap_ext_conn_param_t::supervision_to
uint16_t supervision_to
Link supervision timeout (in unit of 10ms).
Definition: ble_gapm.h:704
BLE_GAP_ADV_DATA_TYPE_SCAN_RSP
@ BLE_GAP_ADV_DATA_TYPE_SCAN_RSP
Scan response data.
Definition: ble_gapm.h:195
ble_gap_adv_report_info_t
ble_gap_adv_report_info_t
Advertising report information.
Definition: ble_gapm.h:476
ble_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:729
ble_gap_ext_scan_param_set
uint16_t ble_gap_ext_scan_param_set(ble_gap_own_addr_t own_addr_type, ble_gap_ext_scan_param_t *p_scan_param)
Set extended parameters for scanning.
ble_gap_init_prop_t
ble_gap_init_prop_t
Initiating properties.
Definition: ble_gapm.h:373
BLE_GAP_SCAN_OBSERVER_MODE
@ BLE_GAP_SCAN_OBSERVER_MODE
Observer mode.
Definition: ble_gapm.h:324
BLE_GAP_AD_TYPE_TK_VALUE
@ BLE_GAP_AD_TYPE_TK_VALUE
Temporary key value.
Definition: ble_gapm.h:430
ble_gap_tx_power_set
uint16_t ble_gap_tx_power_set(ble_gap_actv_role_t role, uint8_t index, int8_t txpwr_dbm)
Set the tx power.
ble_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:705
BLE_GAP_INIT_TYPE_DIRECT_CONN_EST
@ BLE_GAP_INIT_TYPE_DIRECT_CONN_EST
Direct connection establishment: establish a connection with an indicated device.
Definition: ble_gapm.h:364
BLE_GAP_WRITE_PERM_SEC_CON
@ BLE_GAP_WRITE_PERM_SEC_CON
LE Security Mode 1, Level 4.
Definition: ble_gapm.h:186