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