ble_gapc.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file ble_gapc.h
5 *
6 * @brief BLE GAPC 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 /**
51 * @defgroup BLE_GAPC Generic Access Profile (GAP) Connection Control
52 * @{
53 * @brief Definitions and prototypes for the GAP Connection Control interface.
54 */
55 #ifndef __BLE_GAPC_H__
56 #define __BLE_GAPC_H__
57
58 #include "ble_error.h"
59 #include "gr55xx_sys_cfg.h"
60 #include <stdint.h> // Standard Integer
61 #include <string.h>
62 #include <stdbool.h>
63
64 /**
65 * @defgroup BLE_GAPC_DEFINES Defines
66 * @{
67 */
68 #define BLE_GAP_CHNL_MAP_LEN 0x05 /**< The length of channel map. */
69 #define BLE_GAP_FEATS_LEN 0x08 /**< The length of features. */
70 #define BLE_GAP_ADDR_LEN 0x06 /**< The length of address. */
71 #define BLE_GAP_INVALID_CONN_INDEX 0xFF /**< Invalid connection index. */
72
73 /**@defgroup BLE_GAP_ADDR_TYPES GAP Address types
74 * @{ */
75 #define BLE_GAP_ADDR_TYPE_PUBLIC 0x00 /**< Public (identity) address.*/
76 #define BLE_GAP_ADDR_TYPE_RANDOM_STATIC 0x01 /**< Random static (identity) address. */
77 /**@} */
78
79 /**@defgroup BLE_GAP_PHY_OPTIONS GAP PHY OPTIONS (bitmask)
80 * @{ */
81 #define BLE_GAP_PHY_OPT_NO_CODING 0x00 /**< The Host has no preferred coding when transmitting on the LE Coded PHY. */
82 #define BLE_GAP_PHY_OPT_S2_CODING 0x01 /**< The Host prefers that S=2 coding be used when transmitting on the LE Coded PHY. */
83 #define BLE_GAP_PHY_OPT_S8_CODING 0x02 /**< The Host prefers that S=8 coding be used when transmitting on the LE Coded PHY. */
84 /**@} */
85
86 /** @} */
87
88 /**
89 * @defgroup BLE_GAPC_ENUM Enumerations
90 * @{
91 */
92 /** @brief The operation code used to get connection info */
93 typedef enum
94 {
95 BLE_GAP_GET_CON_RSSI = 0, /**< Get connection RSSI info. */
96 BLE_GAP_GET_CON_CHANNEL_MAP, /**< Get connection channel map. */
97 BLE_GAP_GET_PHY, /**< Get connection PHY. */
98 BLE_GAP_GET_CHAN_SEL_ALGO /**< Get selection algorithm for connection channel. */
99 } ble_gap_get_conn_info_op_t;
100
101 /**@brief The operation code used to get peer device info. */
102 typedef enum
103 {
104 BLE_GAP_GET_PEER_VERSION = 0, /**< Get peer device version info. */
105 BLE_GAP_GET_PEER_FEATURES /**< Get peer device features info. */
106 } ble_gap_get_peer_info_op_t;
107
108 /** @brief Device role of LL layer type */
109 typedef enum
110 {
111 BLE_GAP_LL_ROLE_MASTER = 0, /**< Master role. */
112 BLE_GAP_LL_ROLE_SLAVE = 1, /**< Slave role. */
113 } ble_gap_ll_role_type_t;
114
115 /**
116 * @brief Operation code used to set param(s).
117 */
118 typedef enum
119 {
120 BLE_GAP_OPCODE_CHNL_MAP_SET, /**< Set Channel Map. */
121 BLE_GAP_OPCODE_WHITELIST_SET, /**< Set white list. */
122 BLE_GAP_OPCODE_PER_ADV_LIST_SET, /**< Set periodic advertising list. */
123 BLE_GAP_OPCODE_PRIVACY_MODE_SET, /**< Set privacy mode for peer device. */
124 } ble_gap_param_set_op_id_t;
125
126 /**
127 * @brief Operation code used for LEPSM manager.
128 */
129 typedef enum
130 {
131 BLE_GAP_OPCODE_LEPSM_REGISTER, /**< LEPSM register operation. */
132 BLE_GAP_OPCODE_LEPSM_UNREGISTER, /**< LEPSM unregister operation. */
133 } ble_gap_psm_manager_op_id_t;
134
135 /**
136 * @brief The specified reason for terminating a connection.
137 */
138 typedef enum
139 {
140 BLE_GAP_HCI_AUTHENTICATION_FAILURE = 0x05, /**< Authentication Failure. */
141 BLE_GAP_HCI_REMOTE_USER_TERMINATED_CONNECTION = 0x13, /**< Remote User Terminated Connection. */
142 BLE_GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES = 0x14, /**< Remote Device Terminated Connection due to Low Resources . */
143 BLE_GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF = 0x15, /**< Remote Device Terminated Connection due to Power Off. */
144 BLE_GAP_HCI_UNSUPPORTED_REMOTE_FEATURE = 0x1A, /**< Unsupported Remote Feature. */
145 BLE_GAP_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED = 0X29, /**< Pairing With Unit Key Not Supported. */
146 BLE_GAP_HCI_CONN_INTERVAL_UNACCEPTABLE = 0x3B, /**< Unacceptable Connection Parameters. */
147 } ble_gap_disconn_reason_t;
148
149 /** @} */
150
151 /**
152 * @defgroup BLE_GAPC_STRUCT Structures
153 * @{
154 */
155
156 /** @brief The struct of device version. */
157 typedef struct
158 {
159 uint8_t hci_ver; /**< HCI version. */
160 uint8_t lmp_ver; /**< LMP version. */
161 uint8_t host_ver; /**< Host version. */
162 uint16_t hci_subver; /**< HCI subversion. */
163 uint16_t lmp_subver; /**< LMP subversion. */
164 uint16_t host_subver; /**< Host subversion. */
165 uint16_t manuf_name; /**< Manufacturer name. */
166 } ble_gap_dev_version_ind_t;
167
168 /** @brief The struct of address. */
169 typedef struct
170 {
171 uint8_t addr[BLE_GAP_ADDR_LEN]; /**< 6-byte array address value. */
172 } ble_gap_addr_t;
173
174 /** @brief The struct of broadcast address with broadcast type. */
175 typedef struct
176 {
177 ble_gap_addr_t gap_addr; /**< Device BD Address. */
178 uint8_t addr_type; /**< Address type of the device: 0=public/1=random. please @ref BLE_GAP_ADDR_TYPES. */
179 } ble_gap_bdaddr_t;
180
181 /** @brief Get broadcast address struct. */
182 typedef struct
183 {
184 uint8_t index; /**< Advertsing index. The valid range is: 0 - 4. */
185 ble_gap_bdaddr_t bd_addr; /**< BD address. */
186 } ble_gap_get_bd_addr_t;
187
188 /** @brief TX power info struct. */
189 typedef struct
190 {
191 int8_t power_lvl; /**< Advertising channel TX power level. Range: -20 to 10. Unit: dBm. Accuracy: +/-4dB. */
192 } ble_gap_dev_adv_tx_power_t;
193
194 /** @brief TX power info struct. */
195 typedef struct
196 {
197 int8_t min_tx_pwr; /**< MIN of TX power. Size: 1 octet (signed integer). Range: -127 to +126. Unit: dBm. */
198 int8_t max_tx_pwr; /**< MAX of TX power. Size: 1 octet (signed integer). Range: -127 to +126. Unit: dBm. */
199 } ble_gap_dev_tx_power_t;
200
201 /** @brief Max data length info struct. */
202 typedef struct
203 {
204 uint16_t suppted_max_tx_octets; /**< Maximum number of payload octets that the local Controller supports for transmission of a single Link Layer packet on a data connection.
205 Range: 0x001B-0x00FB (all other values reserved for future use). */
206 uint16_t suppted_max_tx_time; /**< Maximum time, in microseconds, that the local Controller supports for transmission of a single Link Layer packet on a data connection.
207 Range: 0x0148-0x4290 (all other values reserved for future use). */
208 uint16_t suppted_max_rx_octets; /**< Maximum number of payload octets that the local Controller supports for reception of a single Link Layer packet on a data connection.
209 Range: 0x001B-0x00FB (all other values reserved for future use). */
210 uint16_t suppted_max_rx_time; /**< Maximum time, in microseconds, that the local Controller supports for reception of a single Link Layer packet on a data connection.
211 Range: 0x0148-0x4290 (all other values reserved for future use). */
212 } ble_gap_max_data_len_t;
213
214 /** @brief Suggested default data length info. */
215 typedef struct
216 {
217 uint16_t suggted_max_tx_octets; /**< The Host's suggested value for the Controller's maximum transmitted number of payload octets to be used for new connections.
218 Range: 0x001B-0x00FB (all other values reserved for future use), default: 0x001B */
219 uint16_t suggted_max_tx_time; /**< The Host's suggested value for the Controller's maximum packet transmission time to be used for new connections.
220 Range: 0x0148-0x4290 (all other values reserved for future use), default: 0x0148*/
221 } ble_gap_sugg_dflt_data_len_t;
222
223 /** @brief Number of available advertising sets info. */
224 typedef struct
225 {
226 uint8_t nb_adv_sets; /**< Number of available advertising sets. */
227 } ble_gap_nb_adv_sets_t;
228
229 /** @brief Maximum advertising data length info. */
230 typedef struct
231 {
232 uint16_t length; /**< Maximum advertising data length supported by controller. */
233 } ble_gap_max_adv_data_len_ind_t;
234
235 /** @brief RF path compensation values info. */
236 typedef struct
237 {
238 uint16_t tx_path_comp; /**< RF TX path compensation. */
239 uint16_t rx_path_comp; /**< RF RX path compensation. */
240 } ble_gap_dev_rf_path_comp_ind_t;
241
242 /** @brief Device info. */
243 typedef union
244 {
245 ble_gap_dev_version_ind_t dev_version; /**< Version info. */
246 ble_gap_get_bd_addr_t get_bd_addr; /**< Device BD address info. */
247 ble_gap_dev_adv_tx_power_t adv_tx_power; /**< Advertising TX power info. */
248 ble_gap_sugg_dflt_data_len_t sugg_dflt_data_len; /**< Suggested default data length info. */
249 ble_gap_max_data_len_t max_data_len; /**< Suggested MAX data length info. */
250 ble_gap_nb_adv_sets_t nb_adv_sets; /**< Number of available advertising sets. */
251 ble_gap_max_adv_data_len_ind_t max_adv_data_len; /**< Maximum advertising data length info. */
252 ble_gap_dev_tx_power_t dev_tx_power; /**< Device TX power info. */
253 ble_gap_dev_rf_path_comp_ind_t dev_rf_path_comp; /**< RF path compensation values. */
254 } ble_gap_dev_info_t;
255
256 /** @brief The parameter of connection. */
257 typedef struct
258 {
259 uint16_t interval_min; /**< Minimum value for the connection interval. This shall be less than or equal to Conn_Interval_Max.
260 Range: 0x0006 to 0x0C80, unit: 1.25 ms, time range: 7.5 ms to 4 s*/
261 uint16_t interval_max; /**< Maximum value for the connection interval. This shall be greater than or equal to Conn_Interval_Min.
262 Range: 0x0006 to 0x0C80, unit: 1.25 ms, time range: 7.5 ms to 4 s.*/
263 uint16_t slave_latency; /**< Slave latency for the connection in number of connection events. Range: 0x0000 to 0x01F3. */
264 uint16_t sup_timeout; /**< Supervision timeout for the LE link. Range: 0x000A to 0x0C80, unit: 10 ms, time range: 100 ms to 32 s. */
265 } ble_gap_conn_param_t;
266
267 /** @brief The parameter of update connection. */
268 typedef struct
269 {
270 uint16_t interval_min; /**< Minimum value for the connection interval. This shall be less than or equal to Conn_Interval_Max.
271 Range: 0x0006 to 0x0C80, unit: 1.25 ms, time range: 7.5 ms to 4 s*/
272 uint16_t interval_max; /**< Maximum value for the connection interval. This shall be greater than or equal to Conn_Interval_Min.
273 Range: 0x0006 to 0x0C80, unit: 1.25 ms, time range: 7.5 ms to 4 s.*/
274 uint16_t slave_latency; /**< Slave latency for the connection in number of connection events. Range: 0x0000 to 0x01F3. */
275 uint16_t sup_timeout; /**< Supervision timeout for the LE link. range: 0x000A to 0x0C80, unit: 10 ms, Time range: 100 ms to 32 s. */
276 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.9 s.
277 recommended value: 0x0002 for 1M phy, 0x0006 for coded phy */
278 } ble_gap_conn_update_param_t;
279
280 /** @brief Channel map structure. */
281 typedef struct
282 {
283 uint8_t map[BLE_GAP_CHNL_MAP_LEN]; /**< This parameter contains 37 1-bit fields. The nth bit (n is in the range of 0 to 36) contains the value for the link layer channel index n.
284 Channel n is unused = 0, channel n is used = 1. The most significant bits are reserved for future use.*/
285 } ble_gap_chnl_map_t;
286
287 /** @brief PHY info. */
288 typedef struct
289 {
290 uint8_t tx_phy; /**< LE PHY for data transmission. @ref BLE_GAP_PHY_OPTIONS. */
291 uint8_t rx_phy; /**< LE PHY for data reception. @ref BLE_GAP_PHY_OPTIONS. */
292 } ble_gap_le_phy_ind_t;
293
294 /** @brief Connection info. */
295 typedef union
296 {
297 int8_t rssi; /**< RSSI. */
298 ble_gap_chnl_map_t chnl_map; /**< channel map. */
299 ble_gap_le_phy_ind_t phy; /**< PHY indicaiton. */
300 uint8_t chan_sel_algo; /**< Chanel Selection algorithm, 0x00: LE Channel Selection Algorithm #1 is used.
301 0x01: LE Channel Selection Algorithm #2 is used.\n 0x02-0xFF: reserved. */
302 } ble_gap_conn_info_t;
303
304 /** @brief Peer version info. */
305 typedef struct
306 {
307 uint16_t compid; /**<Manufacturer name. */
308 uint16_t lmp_subvers; /**< LMP subversion. */
309 uint8_t lmp_vers; /**< LMP version. */
310 } ble_gap_peer_version_ind_t;
311
312 /** @brief LE features info. */
313 typedef struct
314 {
315 uint8_t features[BLE_GAP_FEATS_LEN]; /**< 8-byte array for LE features\n
316 Feature Setting field's bit mapping to Controller Features (0: not support, 1: support) \n
317 |Bit position | Link Layer Feature|
318 |-------------|-----------------|
319 |0 | LE Encryption|
320 |1 |Connection Parameters Request Procedure|
321 |2 |Extended Reject Indication|
322 |3 | Slave-initiated Features Exchange |
323 |4 |LE Ping |
324 |5 |LE Data Packet Length Extension |
325 |6 |LL Privacy |
326 |7 |Extended Scanner Filter Policies |
327 |8 |LE 2M PHY|
328 |9 | Stable Modulation Index - Transmitter |
329 |10 | Stable Modulation Index - Receiver |
330 |11 |LE Coded PHY |
331 |12 |LE Extended Advertising|
332 |13 | LE Periodic Advertising|
333 |14 | Channel Selection Algorithm #2|
334 |15 |LE Power Class 1|
335 |16 |Minimum Number of Used Channels Procedure|
336 |All other values |Reserved for Future Use|*/
337 } ble_gap_peer_features_ind_t;
338
339 /** @brief LE peer info. */
340 typedef union
341 {
342 ble_gap_peer_version_ind_t peer_version; /**< Version info. */
343 ble_gap_peer_features_ind_t peer_features; /**< Features info. */
344 } ble_gap_peer_info_t;
345
346 /**@brief The Structure for BLE Connection Arrangement. */
347 typedef struct
348 {
349 uint16_t conn_idx; /**< Connection Index. */
350 uint32_t interval; /**< Connection Interval (in 625us). */
351 uint32_t offset; /**< Connection Offset (in 625us). */
352 uint32_t duration; /**< Connection Duration (in 625us). */
353 } ble_gap_con_plan_tag_t;
354
355 /** @brief Set preference slave event duration */
356 typedef struct
357 {
358 uint16_t duration; /**< Preferred event duration. */
359 uint8_t single_tx; /**< Slave transmits a single packet per connection event (False/True). */
360 } ble_gap_set_pref_slave_evt_dur_param_t;
361
362 /**@brief PHY update event for @ref BLE_GAPC_EVT_PHY_UPDATED. */
363 typedef struct
364 {
365 uint8_t tx_phy; /**< LE PHY for data transmission. @ref BLE_GAP_PHY_OPTIONS. */
366 uint8_t rx_phy; /**< LE PHY for data reception. @ref BLE_GAP_PHY_OPTIONS. */
367 } ble_gap_evt_phy_update_t;
368
369 /** @brief Get device info event for BLE_GAPC_EVT_DEV_INFO_GOT. */
370 typedef struct
371 {
372 uint8_t operation; /**< Operation code. @ref ble_gap_dev_info_get_type_t. */
373 ble_gap_dev_info_t dev_info; /**< Device info. */
374 } ble_gap_evt_dev_info_get_t;
375
376 /** @brief Connection complete event for @ref BLE_GAPC_EVT_CONNECTED. */
377 typedef struct
378 {
379 uint16_t conn_index; /**< Connection index. Range: 0x0000-0x0EFF (all other values reserved for future use). */
380 uint16_t conn_interval; /**< Connection interval. Range: 0x0006 to 0x0C80, unit: 1.25 ms, time range: 7.5 ms to 4 s. */
381 uint16_t slave_latency; /**< Latency for the connection in number of connection events. Range: 0x0000 to 0x01F3. */
382 uint16_t sup_timeout; /**< Connection supervision timeout. Range: 0x000A to 0x0C80, unit: 10 ms, time range: 100 ms to 32 s. */
383 uint8_t clk_accuracy; /**< Clock accuracy (0x00: 500 ppm, 0x01: 250 ppm, 0x02: 150 ppm, 0x03: 100 ppm, 0x04: 75 ppm, 0x05:50 ppm, 0x06:30 ppm, 0x07:20 ppm, others: reserved for future use). */
384 uint8_t peer_addr_type; /**< Peer address type(0x00: Public Device Address, 0x01 : Random Device Address, others: reserved for future use). */
385 ble_gap_addr_t peer_addr; /**< Peer BT address. */
386 ble_gap_ll_role_type_t ll_role; /**< Device Role of LL Layer. */
387 } ble_gap_evt_connected_t;
388
389 /**@brief Disconnection event for @ref BLE_GAPC_EVT_DISCONNECTED. */
390 typedef struct
391 {
392 uint8_t reason; /**< HCI error code, see BLE_HCI_STATUS_CODES. */
393 } ble_gap_evt_disconnected_t;
394
395 /** @brief Name of peer device indication event for @ref BLE_GAPC_EVT_PEER_NAME_GOT. */
396 typedef struct
397 {
398 ble_gap_addr_t peer_addr; /**< Peer device bd address. */
399 uint8_t addr_type; /**< Peer device address type. */
400 uint8_t name_len; /**< Peer device name length. */
401 uint8_t *name; /**< Peer device name. */
402 } ble_gap_evt_peer_name_get_t;
403
404 /** @brief Get peer info event for @ref BLE_GAPC_EVT_PEER_INFO_GOT. */
405 typedef struct
406 {
407 uint8_t opcode; /**< Operation code. See @ref ble_gap_get_peer_info_op_t. */
408 ble_gap_peer_info_t peer_info; /**< Peer info. */
409 } ble_gap_evt_peer_info_t;
410
411 /** @brief Connection parameter updated event for @ref BLE_GAPC_EVT_CONN_PARAM_UPDATED. */
412 typedef struct
413 {
414 uint16_t conn_interval; /**< Connection interval. Range: 0x0006 to 0x0C80. Unit: 1.25 ms. Time range: 7.5 ms to 4 s. */
415 uint16_t slave_latency; /**< Latency for the connection in number of connection events. Range: 0x0000 to 0x01F3. */
416 uint16_t sup_timeout; /**< Supervision timeout for the LE link. Range: 0x000A to 0x0C80, unit: 10 ms, time range: 100 ms to 32 s. */
417 } ble_gap_evt_conn_param_updated_t;
418
419 /** @brief Connection parameter update request event for @ref BLE_GAPC_EVT_CONN_PARAM_UPDATE_REQ. */
420 typedef struct
421 {
422 uint16_t interval_min; /**< Minimum value for the connection interval. This shall be less than or equal to Conn_Interval_Max.
423 Range: 0x0006 to 0x0C80, unit: 1.25 ms, time range: 7.5 ms to 4 s*/
424 uint16_t interval_max; /**< Maximum value for the connection interval. This shall be greater than or equal to Conn_Interval_Min.
425 Range: 0x0006 to 0x0C80, unit: 1.25 ms, time range: 7.5 ms to 4 s.*/
426 uint16_t slave_latency; /**< Slave latency for the connection in number of connection events. Range: 0x0000 to 0x01F3. */
427 uint16_t sup_timeout; /**< Supervision timeout for the LE link. Range: 0x000A to 0x0C80, unit: 10 ms, time range: 100 ms to 32 s. */
428 } ble_gap_evt_conn_param_update_req_t;
429
430 /** @brief Get Connection info event for @ref BLE_GAPC_EVT_CONN_INFO_GOT. */
431 typedef struct
432 {
433 uint8_t opcode; /**< Operation code. See @ref ble_gap_get_conn_info_op_t. */
434 ble_gap_conn_info_t info; /**< Connection info. */
435 } ble_gap_evt_conn_info_t;
436
437 /** @brief Data Length Updated event for @ref BLE_GAPC_EVT_DATA_LENGTH_UPDATED. */
438 typedef struct
439 {
440 uint16_t max_tx_octets; /**< The maximum number of payload octets in TX. */
441 uint16_t max_tx_time; /**< The maximum time that the local Controller will take to TX. */
442 uint16_t max_rx_octets; /**< The maximum number of payload octets in RX. */
443 uint16_t max_rx_time; /**< The maximum time that the local Controller will take to RX. */
444 } ble_gap_evt_data_length_t;
445
446 /**@brief BLE GAPC event structure. */
447 typedef struct
448 {
449 uint8_t index; /**< Index of connection. */
450 union /**< union alternative identified by evt_id in enclosing struct. */
451 {
452 ble_gap_evt_phy_update_t phy_update; /**< PHY update parameters. */
453 ble_gap_evt_connected_t connected; /**< Connection parameters. */
454 ble_gap_evt_disconnected_t disconnected; /**< Disconnection parameters. See @ref BLE_STACK_ERROR_CODES. */
455 ble_gap_evt_peer_name_get_t peer_name; /**< Peer device name indication parameters. */
456 ble_gap_evt_peer_info_t peer_info; /**< Peer info indication parameters. */
457 ble_gap_evt_conn_param_updated_t conn_param_updated; /**< Connection parameter updated parameters. */
458 ble_gap_evt_conn_param_update_req_t conn_param_update_req; /**< Connection parameter update request parameters. */
459 ble_gap_evt_conn_info_t conn_info; /**< Connection info parameters. */
460 ble_gap_evt_data_length_t data_length; /**< Data Length Update parameter. */
461 } params; /**< Event Parameters. */
462 } ble_gapc_evt_t;
463
464 /** @} */
465
466 /**
467 * @defgroup BLE_GAPC_FUNCTION Functions
468 * @{
469 */
470 /**
471 ****************************************************************************************
472 * @brief Terminate an existing connection.
473 *
474 * @param[in] conn_idx: The index of connection.
475 *
476 * @retval ::SDK_SUCCESS: Operation is Success.
477 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
478 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
479 ****************************************************************************************
480 */
481 uint16_t ble_gap_disconnect(uint8_t conn_idx);
482
483 /**
484 ****************************************************************************************
485 * @brief Terminate an existing connection with a specified reason.
486 *
487 * @param[in] conn_idx: The index of connection.
488 * @param[in] reason: The specified reason.
489 *
490 * @retval ::SDK_SUCCESS: Operation is Success.
491 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
492 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
493 ****************************************************************************************
494 */
495 uint16_t ble_gap_disconnect_with_reason(uint8_t conn_idx, ble_gap_disconn_reason_t reason);
496
497 /**
498 ****************************************************************************************
499 * @brief Change the Link Layer connection parameters of a connection.
500 *
501 * @param[in] conn_idx: The index of connection.
502 * @param[in] p_conn_param: Pointer to the new connection param.
503 *
504 * @retval ::SDK_SUCCESS: Operation is Success.
505 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
506 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
507 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
508 ****************************************************************************************
509 */
510 uint16_t ble_gap_conn_param_update (uint8_t conn_idx, const ble_gap_conn_update_param_t *p_conn_param);
511
512 /**
513 *****************************************************************************************
514 * @brief Set connection's Latency.
515 * @note The latency shall be set to X value by LLCP firstly, then uses this API to change the latency in [0, X].
516 *
517 * @param[in] conn_idx: The index of connection.
518 * @param[in] latency: The latency of connection.
519 *
520 * @retval ::SDK_SUCCESS: Operation is Success.
521 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
522 *****************************************************************************************
523 */
524 uint16_t ble_gap_latency_set(uint8_t conn_idx, uint16_t latency);
525
526 /**
527 *****************************************************************************************
528 * @brief Consult BLE connection activity plan situation function.
529 * @note This function should be called when connection established and no periodic advertising exists.
530 *
531 * @param[out] p_act_num: Pointer to the number of existing connection activities.
532 * @param[out] p_conn_plan_arr: Pointer to the global array that stores planned connection activities.
533 *
534 * @retval ::SDK_SUCCESS: Operation is Success.
535 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
536 *****************************************************************************************
537 */
538 uint16_t ble_gap_con_plan_consult(uint8_t *p_act_num, ble_gap_con_plan_tag_t **p_conn_plan_arr);
539
540 /**
541 ****************************************************************************************
542 * @brief Connection param update reply to peer device.
543 *
544 * @param[in] conn_idx: The index of connection.
545 * @param[in] accept: True to accept connection parameters, false to reject.
546 *
547 * @retval ::SDK_SUCCESS: Operation is success.
548 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
549 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
550 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
551 ****************************************************************************************
552 */
553 uint16_t ble_gap_conn_param_update_reply(uint8_t conn_idx, bool accept);
554
555 /**
556 ****************************************************************************************
557 * @brief The suggested maximum transmission packet size and maximum packet transmission time to be used for a given connection.
558 *
559 * @param[in] conn_idx: The index of connection.
560 * @param[in] tx_octects: Preferred maximum number of payload octets that the local Controller should include in a single Link Layer packet on this connection.
561 * Range 0x001B-0x00FB (all other values reserved for future use).
562 * @param[in] tx_time: Preferred maximum number of microseconds that the local Controller should use to transmit a single Link Layer packet on this connection.
563 * Range 0x0148-0x4290 (all other values reserved for future use).
564 *
565 * @retval ::SDK_SUCCESS: Operation is Success.
566 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
567 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
568 ****************************************************************************************
569 */
570 uint16_t ble_gap_data_length_update(uint8_t conn_idx, uint16_t tx_octects , uint16_t tx_time);
571
572 /**
573 ****************************************************************************************
574 * @brief Set the PHY preferences for the connection identified by the connection index.
575 *
576 * @param[in] conn_idx: The index of connection.
577 * @param[in] tx_phys: The transmitter PHYs that the Host prefers the Controller to use (see @ref BLE_GAP_PHY_OPTIONS).
578 * @param[in] rx_phys: A bit field that indicates the receiver PHYs that the Host prefers the Controller to use (see @ref BLE_GAP_PHY_OPTIONS).
579 * @param[in] phy_opt: A bit field that allows the Host to specify options for PHYs (see @ref BLE_GAP_PHY_OPTIONS).
580 *
581 * @retval ::SDK_SUCCESS: Operation is Success.
582 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
583 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
584 ****************************************************************************************
585 */
586 uint16_t ble_gap_phy_update(uint8_t conn_idx, uint8_t tx_phys , uint8_t rx_phys, uint8_t phy_opt);
587
588 /**
589 ****************************************************************************************
590 * @brief Get the information of the connection.
591 *
592 * @param[in] conn_idx: The index of connection.
593 * @param[in] opcode: The operation code. See @ref ble_gap_get_conn_info_op_t.
594 *
595 * @retval ::SDK_SUCCESS: Operation is Success.
596 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
597 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
598 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
599 ****************************************************************************************
600 */
601 uint16_t ble_gap_conn_info_get(uint8_t conn_idx, ble_gap_get_conn_info_op_t opcode);
602
603 /**
604 ****************************************************************************************
605 * @brief Get the information of the peer device.
606 *
607 * @param[in] conn_idx: The index of connection.
608 * @param[in] opcode: The operation code. See @ref ble_gap_get_peer_info_op_t.
609 *
610 * @retval ::SDK_SUCCESS: Operation is Success.
611 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
612 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
613 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
614 ****************************************************************************************
615 */
616 uint16_t ble_gap_peer_info_get(uint8_t conn_idx, ble_gap_get_peer_info_op_t opcode);
617
618 /** @} */
619
620 #endif
621 /** @} */
622 /** @} */
623 /** @} */
ble_gap_get_bd_addr_t::index
uint8_t index
Definition: ble_gapc.h:184
ble_gap_dev_adv_tx_power_t
TX power info struct.
Definition: ble_gapc.h:190
ble_gap_dev_rf_path_comp_ind_t
RF path compensation values info.
Definition: ble_gapc.h:237
ble_gap_get_bd_addr_t
Get broadcast address struct.
Definition: ble_gapc.h:183
ble_gap_evt_peer_info_t::peer_info
ble_gap_peer_info_t peer_info
Definition: ble_gapc.h:408
BLE_GAP_OPCODE_LEPSM_UNREGISTER
@ BLE_GAP_OPCODE_LEPSM_UNREGISTER
Definition: ble_gapc.h:132
ble_gap_peer_features_ind_t
LE features info.
Definition: ble_gapc.h:314
ble_gap_evt_connected_t
Connection complete event for BLE_GAPC_EVT_CONNECTED.
Definition: ble_gapc.h:378
ble_gap_peer_info_t::peer_features
ble_gap_peer_features_ind_t peer_features
Definition: ble_gapc.h:343
ble_gap_evt_peer_name_get_t::peer_addr
ble_gap_addr_t peer_addr
Definition: ble_gapc.h:398
ble_gap_disconn_reason_t
ble_gap_disconn_reason_t
The specified reason for terminating a connection.
Definition: ble_gapc.h:139
ble_gapc_evt_t::phy_update
ble_gap_evt_phy_update_t phy_update
Definition: ble_gapc.h:452
ble_gapc_evt_t::disconnected
ble_gap_evt_disconnected_t disconnected
Definition: ble_gapc.h:454
ble_gap_dev_rf_path_comp_ind_t::tx_path_comp
uint16_t tx_path_comp
Definition: ble_gapc.h:238
ble_gap_max_adv_data_len_ind_t::length
uint16_t length
Definition: ble_gapc.h:232
ble_gap_conn_update_param_t::interval_max
uint16_t interval_max
Definition: ble_gapc.h:272
ble_gap_addr_t
The struct of address.
Definition: ble_gapc.h:170
ble_gap_peer_version_ind_t
Peer version info.
Definition: ble_gapc.h:306
ble_gap_conn_param_t::slave_latency
uint16_t slave_latency
Definition: ble_gapc.h:263
ble_gap_conn_info_t::rssi
int8_t rssi
Definition: ble_gapc.h:297
ble_gap_dev_info_t::dev_rf_path_comp
ble_gap_dev_rf_path_comp_ind_t dev_rf_path_comp
Definition: ble_gapc.h:253
ble_gap_peer_version_ind_t::lmp_vers
uint8_t lmp_vers
Definition: ble_gapc.h:309
ble_gap_max_data_len_t::suppted_max_rx_time
uint16_t suppted_max_rx_time
Definition: ble_gapc.h:210
ble_gap_conn_param_t::sup_timeout
uint16_t sup_timeout
Definition: ble_gapc.h:264
ble_gap_evt_connected_t::sup_timeout
uint16_t sup_timeout
Definition: ble_gapc.h:382
ble_gap_evt_disconnected_t
Disconnection event for BLE_GAPC_EVT_DISCONNECTED.
Definition: ble_gapc.h:391
BLE_GAP_LL_ROLE_SLAVE
@ BLE_GAP_LL_ROLE_SLAVE
Definition: ble_gapc.h:112
ble_gap_con_plan_tag_t
The Structure for BLE Connection Arrangement.
Definition: ble_gapc.h:348
ble_gapc_evt_t::peer_info
ble_gap_evt_peer_info_t peer_info
Definition: ble_gapc.h:456
ble_gap_evt_peer_info_t
Get peer info event for BLE_GAPC_EVT_PEER_INFO_GOT.
Definition: ble_gapc.h:406
ble_gap_evt_data_length_t::max_rx_time
uint16_t max_rx_time
Definition: ble_gapc.h:443
ble_gap_psm_manager_op_id_t
ble_gap_psm_manager_op_id_t
Operation code used for LEPSM manager.
Definition: ble_gapc.h:130
ble_gap_bdaddr_t
The struct of broadcast address with broadcast type.
Definition: ble_gapc.h:176
ble_gap_dev_info_t
Device info.
Definition: ble_gapc.h:244
ble_gap_peer_info_t
LE peer info.
Definition: ble_gapc.h:341
ble_gap_dev_version_ind_t::hci_subver
uint16_t hci_subver
Definition: ble_gapc.h:162
ble_gap_le_phy_ind_t::rx_phy
uint8_t rx_phy
Definition: ble_gapc.h:291
ble_gap_evt_phy_update_t
PHY update event for BLE_GAPC_EVT_PHY_UPDATED.
Definition: ble_gapc.h:364
ble_gap_dev_rf_path_comp_ind_t::rx_path_comp
uint16_t rx_path_comp
Definition: ble_gapc.h:239
ble_gap_dev_version_ind_t::hci_ver
uint8_t hci_ver
Definition: ble_gapc.h:159
ble_gap_conn_update_param_t::interval_min
uint16_t interval_min
Definition: ble_gapc.h:270
BLE_GAP_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED
@ BLE_GAP_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED
Definition: ble_gapc.h:145
ble_gap_nb_adv_sets_t
Number of available advertising sets info.
Definition: ble_gapc.h:225
ble_gap_evt_peer_name_get_t
Name of peer device indication event for BLE_GAPC_EVT_PEER_NAME_GOT.
Definition: ble_gapc.h:397
BLE_GAP_OPCODE_PRIVACY_MODE_SET
@ BLE_GAP_OPCODE_PRIVACY_MODE_SET
Definition: ble_gapc.h:123
ble_gap_peer_version_ind_t::lmp_subvers
uint16_t lmp_subvers
Definition: ble_gapc.h:308
ble_gap_con_plan_tag_t::interval
uint32_t interval
Definition: ble_gapc.h:350
ble_gap_dev_info_t::max_adv_data_len
ble_gap_max_adv_data_len_ind_t max_adv_data_len
Definition: ble_gapc.h:251
BLE_GAP_GET_CON_RSSI
@ BLE_GAP_GET_CON_RSSI
Definition: ble_gapc.h:95
ble_gapc_evt_t::peer_name
ble_gap_evt_peer_name_get_t peer_name
Definition: ble_gapc.h:455
ble_gap_conn_info_t::chnl_map
ble_gap_chnl_map_t chnl_map
Definition: ble_gapc.h:298
ble_gap_evt_dev_info_get_t::operation
uint8_t operation
Definition: ble_gapc.h:372
ble_gap_sugg_dflt_data_len_t::suggted_max_tx_octets
uint16_t suggted_max_tx_octets
Definition: ble_gapc.h:217
ble_gap_conn_info_get
uint16_t ble_gap_conn_info_get(uint8_t conn_idx, ble_gap_get_conn_info_op_t opcode)
Get the information of the connection.
ble_gap_disconnect_with_reason
uint16_t ble_gap_disconnect_with_reason(uint8_t conn_idx, ble_gap_disconn_reason_t reason)
Terminate an existing connection with a specified reason.
ble_gap_peer_info_get
uint16_t ble_gap_peer_info_get(uint8_t conn_idx, ble_gap_get_peer_info_op_t opcode)
Get the information of the peer device.
ble_gap_latency_set
uint16_t ble_gap_latency_set(uint8_t conn_idx, uint16_t latency)
Set connection's Latency.
ble_gap_con_plan_tag_t::duration
uint32_t duration
Definition: ble_gapc.h:352
ble_gapc_evt_t::conn_param_update_req
ble_gap_evt_conn_param_update_req_t conn_param_update_req
Definition: ble_gapc.h:458
ble_gap_set_pref_slave_evt_dur_param_t
Set preference slave event duration.
Definition: ble_gapc.h:357
ble_gap_con_plan_tag_t::conn_idx
uint16_t conn_idx
Definition: ble_gapc.h:349
ble_gap_evt_connected_t::peer_addr_type
uint8_t peer_addr_type
Definition: ble_gapc.h:384
gr55xx_sys_cfg.h
Define the chip configuration.
BLE_GAP_GET_PEER_VERSION
@ BLE_GAP_GET_PEER_VERSION
Definition: ble_gapc.h:104
ble_gap_dev_tx_power_t::max_tx_pwr
int8_t max_tx_pwr
Definition: ble_gapc.h:198
ble_gapc_evt_t::conn_param_updated
ble_gap_evt_conn_param_updated_t conn_param_updated
Definition: ble_gapc.h:457
ble_gap_conn_info_t
Connection info.
Definition: ble_gapc.h:296
ble_gap_evt_conn_param_updated_t::conn_interval
uint16_t conn_interval
Definition: ble_gapc.h:414
ble_gap_param_set_op_id_t
ble_gap_param_set_op_id_t
Operation code used to set param(s).
Definition: ble_gapc.h:119
ble_gap_dev_version_ind_t::host_ver
uint8_t host_ver
Definition: ble_gapc.h:161
BLE_GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF
@ BLE_GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF
Definition: ble_gapc.h:143
ble_gap_dev_info_t::adv_tx_power
ble_gap_dev_adv_tx_power_t adv_tx_power
Definition: ble_gapc.h:247
BLE_GAP_GET_PEER_FEATURES
@ BLE_GAP_GET_PEER_FEATURES
Definition: ble_gapc.h:105
ble_gap_conn_param_t::interval_min
uint16_t interval_min
Definition: ble_gapc.h:259
ble_gap_evt_conn_info_t
Get Connection info event for BLE_GAPC_EVT_CONN_INFO_GOT.
Definition: ble_gapc.h:432
ble_gap_max_data_len_t::suppted_max_tx_time
uint16_t suppted_max_tx_time
Definition: ble_gapc.h:206
ble_gapc_evt_t::connected
ble_gap_evt_connected_t connected
Definition: ble_gapc.h:453
BLE_GAP_OPCODE_WHITELIST_SET
@ BLE_GAP_OPCODE_WHITELIST_SET
Definition: ble_gapc.h:121
ble_gap_evt_data_length_t::max_tx_octets
uint16_t max_tx_octets
Definition: ble_gapc.h:440
ble_gap_phy_update
uint16_t ble_gap_phy_update(uint8_t conn_idx, uint8_t tx_phys, uint8_t rx_phys, uint8_t phy_opt)
Set the PHY preferences for the connection identified by the connection index.
ble_gap_evt_conn_param_updated_t
Connection parameter updated event for BLE_GAPC_EVT_CONN_PARAM_UPDATED.
Definition: ble_gapc.h:413
ble_gap_evt_data_length_t::max_rx_octets
uint16_t max_rx_octets
Definition: ble_gapc.h:442
BLE_GAP_HCI_CONN_INTERVAL_UNACCEPTABLE
@ BLE_GAP_HCI_CONN_INTERVAL_UNACCEPTABLE
Definition: ble_gapc.h:146
BLE_GAP_GET_PHY
@ BLE_GAP_GET_PHY
Definition: ble_gapc.h:97
ble_gap_evt_conn_param_update_req_t::interval_max
uint16_t interval_max
Definition: ble_gapc.h:424
ble_gap_evt_conn_param_update_req_t::slave_latency
uint16_t slave_latency
Definition: ble_gapc.h:426
ble_gap_evt_conn_param_updated_t::slave_latency
uint16_t slave_latency
Definition: ble_gapc.h:415
ble_gap_evt_dev_info_get_t::dev_info
ble_gap_dev_info_t dev_info
Definition: ble_gapc.h:373
ble_gap_bdaddr_t::addr_type
uint8_t addr_type
Definition: ble_gapc.h:178
ble_gap_conn_param_t
The parameter of connection.
Definition: ble_gapc.h:258
BLE_GAP_OPCODE_LEPSM_REGISTER
@ BLE_GAP_OPCODE_LEPSM_REGISTER
Definition: ble_gapc.h:131
BLE_GAP_LL_ROLE_MASTER
@ BLE_GAP_LL_ROLE_MASTER
Definition: ble_gapc.h:111
ble_error.h
File that contains error codes.
BLE_GAP_FEATS_LEN
#define BLE_GAP_FEATS_LEN
Definition: ble_gapc.h:69
ble_gap_conn_update_param_t
The parameter of update connection.
Definition: ble_gapc.h:269
BLE_GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES
@ BLE_GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES
Definition: ble_gapc.h:142
BLE_GAP_CHNL_MAP_LEN
#define BLE_GAP_CHNL_MAP_LEN
Definition: ble_gapc.h:68
ble_gap_evt_disconnected_t::reason
uint8_t reason
Definition: ble_gapc.h:392
ble_gap_evt_connected_t::peer_addr
ble_gap_addr_t peer_addr
Definition: ble_gapc.h:385
ble_gap_dev_tx_power_t
TX power info struct.
Definition: ble_gapc.h:196
ble_gap_evt_connected_t::clk_accuracy
uint8_t clk_accuracy
Definition: ble_gapc.h:383
ble_gap_evt_peer_info_t::opcode
uint8_t opcode
Definition: ble_gapc.h:407
ble_gap_evt_conn_param_update_req_t::sup_timeout
uint16_t sup_timeout
Definition: ble_gapc.h:427
ble_gap_evt_conn_param_updated_t::sup_timeout
uint16_t sup_timeout
Definition: ble_gapc.h:416
BLE_GAP_HCI_AUTHENTICATION_FAILURE
@ BLE_GAP_HCI_AUTHENTICATION_FAILURE
Definition: ble_gapc.h:140
ble_gap_dev_info_t::dev_tx_power
ble_gap_dev_tx_power_t dev_tx_power
Definition: ble_gapc.h:252
ble_gap_dev_info_t::dev_version
ble_gap_dev_version_ind_t dev_version
Definition: ble_gapc.h:245
ble_gap_dev_version_ind_t::manuf_name
uint16_t manuf_name
Definition: ble_gapc.h:165
BLE_GAP_OPCODE_PER_ADV_LIST_SET
@ BLE_GAP_OPCODE_PER_ADV_LIST_SET
Definition: ble_gapc.h:122
ble_gap_conn_info_t::chan_sel_algo
uint8_t chan_sel_algo
Definition: ble_gapc.h:300
ble_gap_evt_connected_t::conn_interval
uint16_t conn_interval
Definition: ble_gapc.h:380
BLE_GAP_ADDR_LEN
#define BLE_GAP_ADDR_LEN
Definition: ble_gapc.h:70
ble_gap_conn_param_update
uint16_t ble_gap_conn_param_update(uint8_t conn_idx, const ble_gap_conn_update_param_t *p_conn_param)
Change the Link Layer connection parameters of a connection.
ble_gap_dev_version_ind_t
The struct of device version.
Definition: ble_gapc.h:158
ble_gap_evt_data_length_t
Data Length Updated event for BLE_GAPC_EVT_DATA_LENGTH_UPDATED.
Definition: ble_gapc.h:439
ble_gap_get_bd_addr_t::bd_addr
ble_gap_bdaddr_t bd_addr
Definition: ble_gapc.h:185
ble_gap_conn_update_param_t::slave_latency
uint16_t slave_latency
Definition: ble_gapc.h:274
ble_gap_conn_info_t::phy
ble_gap_le_phy_ind_t phy
Definition: ble_gapc.h:299
ble_gap_dev_info_t::get_bd_addr
ble_gap_get_bd_addr_t get_bd_addr
Definition: ble_gapc.h:246
ble_gap_evt_connected_t::ll_role
ble_gap_ll_role_type_t ll_role
Definition: ble_gapc.h:386
ble_gap_get_peer_info_op_t
ble_gap_get_peer_info_op_t
The operation code used to get peer device info.
Definition: ble_gapc.h:103
ble_gapc_evt_t
BLE GAPC event structure.
Definition: ble_gapc.h:448
ble_gap_le_phy_ind_t::tx_phy
uint8_t tx_phy
Definition: ble_gapc.h:290
ble_gap_data_length_update
uint16_t ble_gap_data_length_update(uint8_t conn_idx, uint16_t tx_octects, uint16_t tx_time)
The suggested maximum transmission packet size and maximum packet transmission time to be used for a ...
ble_gap_peer_version_ind_t::compid
uint16_t compid
Definition: ble_gapc.h:307
BLE_GAP_GET_CHAN_SEL_ALGO
@ BLE_GAP_GET_CHAN_SEL_ALGO
Definition: ble_gapc.h:98
ble_gap_con_plan_tag_t::offset
uint32_t offset
Definition: ble_gapc.h:351
ble_gap_ll_role_type_t
ble_gap_ll_role_type_t
Device role of LL layer type.
Definition: ble_gapc.h:110
ble_gap_le_phy_ind_t
PHY info.
Definition: ble_gapc.h:289
ble_gap_dev_tx_power_t::min_tx_pwr
int8_t min_tx_pwr
Definition: ble_gapc.h:197
ble_gap_evt_peer_name_get_t::name
uint8_t * name
Definition: ble_gapc.h:401
ble_gap_dev_version_ind_t::lmp_ver
uint8_t lmp_ver
Definition: ble_gapc.h:160
BLE_GAP_HCI_REMOTE_USER_TERMINATED_CONNECTION
@ BLE_GAP_HCI_REMOTE_USER_TERMINATED_CONNECTION
Definition: ble_gapc.h:141
ble_gap_evt_connected_t::slave_latency
uint16_t slave_latency
Definition: ble_gapc.h:381
ble_gap_evt_data_length_t::max_tx_time
uint16_t max_tx_time
Definition: ble_gapc.h:441
ble_gap_dev_version_ind_t::host_subver
uint16_t host_subver
Definition: ble_gapc.h:164
ble_gap_evt_conn_info_t::opcode
uint8_t opcode
Definition: ble_gapc.h:433
ble_gap_max_data_len_t::suppted_max_tx_octets
uint16_t suppted_max_tx_octets
Definition: ble_gapc.h:204
ble_gap_conn_param_t::interval_max
uint16_t interval_max
Definition: ble_gapc.h:261
ble_gap_nb_adv_sets_t::nb_adv_sets
uint8_t nb_adv_sets
Definition: ble_gapc.h:226
ble_gap_sugg_dflt_data_len_t
Suggested default data length info.
Definition: ble_gapc.h:216
BLE_GAP_GET_CON_CHANNEL_MAP
@ BLE_GAP_GET_CON_CHANNEL_MAP
Definition: ble_gapc.h:96
ble_gap_evt_conn_param_update_req_t::interval_min
uint16_t interval_min
Definition: ble_gapc.h:422
ble_gap_evt_conn_param_update_req_t
Connection parameter update request event for BLE_GAPC_EVT_CONN_PARAM_UPDATE_REQ.
Definition: ble_gapc.h:421
ble_gap_evt_phy_update_t::tx_phy
uint8_t tx_phy
Definition: ble_gapc.h:365
ble_gap_max_data_len_t
Max data length info struct.
Definition: ble_gapc.h:203
ble_gap_disconnect
uint16_t ble_gap_disconnect(uint8_t conn_idx)
Terminate an existing connection.
ble_gap_conn_update_param_t::sup_timeout
uint16_t sup_timeout
Definition: ble_gapc.h:275
ble_gap_peer_info_t::peer_version
ble_gap_peer_version_ind_t peer_version
Definition: ble_gapc.h:342
ble_gap_evt_connected_t::conn_index
uint16_t conn_index
Definition: ble_gapc.h:379
ble_gap_max_data_len_t::suppted_max_rx_octets
uint16_t suppted_max_rx_octets
Definition: ble_gapc.h:208
ble_gap_set_pref_slave_evt_dur_param_t::single_tx
uint8_t single_tx
Definition: ble_gapc.h:359
ble_gap_evt_conn_info_t::info
ble_gap_conn_info_t info
Definition: ble_gapc.h:434
BLE_GAP_HCI_UNSUPPORTED_REMOTE_FEATURE
@ BLE_GAP_HCI_UNSUPPORTED_REMOTE_FEATURE
Definition: ble_gapc.h:144
ble_gap_bdaddr_t::gap_addr
ble_gap_addr_t gap_addr
Definition: ble_gapc.h:177
BLE_GAP_OPCODE_CHNL_MAP_SET
@ BLE_GAP_OPCODE_CHNL_MAP_SET
Definition: ble_gapc.h:120
ble_gap_conn_param_update_reply
uint16_t ble_gap_conn_param_update_reply(uint8_t conn_idx, bool accept)
Connection param update reply to peer device.
ble_gap_get_conn_info_op_t
ble_gap_get_conn_info_op_t
The operation code used to get connection info.
Definition: ble_gapc.h:94
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_dev_adv_tx_power_t::power_lvl
int8_t power_lvl
Definition: ble_gapc.h:191
ble_gapc_evt_t::data_length
ble_gap_evt_data_length_t data_length
Definition: ble_gapc.h:460
ble_gap_max_adv_data_len_ind_t
Maximum advertising data length info.
Definition: ble_gapc.h:231
ble_gap_evt_peer_name_get_t::addr_type
uint8_t addr_type
Definition: ble_gapc.h:399
ble_gap_dev_info_t::nb_adv_sets
ble_gap_nb_adv_sets_t nb_adv_sets
Definition: ble_gapc.h:250
ble_gapc_evt_t::index
uint8_t index
Definition: ble_gapc.h:449
ble_gap_sugg_dflt_data_len_t::suggted_max_tx_time
uint16_t suggted_max_tx_time
Definition: ble_gapc.h:219
ble_gap_conn_update_param_t::ce_len
uint16_t ce_len
Definition: ble_gapc.h:276
ble_gap_dev_info_t::sugg_dflt_data_len
ble_gap_sugg_dflt_data_len_t sugg_dflt_data_len
Definition: ble_gapc.h:248
ble_gap_set_pref_slave_evt_dur_param_t::duration
uint16_t duration
Definition: ble_gapc.h:358
ble_gap_evt_phy_update_t::rx_phy
uint8_t rx_phy
Definition: ble_gapc.h:366
ble_gap_dev_info_t::max_data_len
ble_gap_max_data_len_t max_data_len
Definition: ble_gapc.h:249
ble_gapc_evt_t::conn_info
ble_gap_evt_conn_info_t conn_info
Definition: ble_gapc.h:459
ble_gap_con_plan_consult
uint16_t ble_gap_con_plan_consult(uint8_t *p_act_num, ble_gap_con_plan_tag_t **p_conn_plan_arr)
Consult BLE connection activity plan situation function.
ble_gap_evt_peer_name_get_t::name_len
uint8_t name_len
Definition: ble_gapc.h:400
ble_gap_dev_version_ind_t::lmp_subver
uint16_t lmp_subver
Definition: ble_gapc.h:163