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-2025 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 "gr5405_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 /// CTE length (in number of 8us periods)
74 #define BLE_GAP_MIN_CTE_LEN 0x02 /**< The minimum CTE length. */
75 #define BLE_GAP_MAX_CTE_LEN 0x14 /**< The maximum CTE length. */
76 
77 /// CTE count
78 #define BLE_GAP_MIN_CTE_CNT 0x01 /**< The minimum CTE count. */
79 #define BLE_GAP_MAX_CTE_CNT 0x10 /**< The maximum CTE count. */
80 
81 #define BLE_GAP_MIN_IQ_SAMPLE_NUM 0x09 /**< The minimum IQ sample number. */
82 #define BLE_GAP_MAX_IQ_SAMPLE_NUM 0x52 /**< The maximum IQ sample number. */
83 
84 /** @} */
85 
86 /**
87  * @defgroup BLE_SDK_GAP_ENUM Enumerations
88  * @{
89  */
90 
91 /** @brief The identity address type */
92 typedef enum
93 {
94  BLE_GAP_ADDR_TYPE_PUBLIC = 0, /**< Public (identity) address.*/
95  BLE_GAP_ADDR_TYPE_RANDOM_STATIC, /**< Random static (identity) address. */
97 
98 /**
99  * @brief Bit field use to select the preferred TX or RX LE PHY.
100  */
101 typedef enum
102 {
103  /// No preferred PHY
105  /// LE 1M PHY preferred for an active link
107  /// LE 2M PHY preferred for an active link
109  /// LE Coded PHY preferred for an active link
112 
113 /** @brief The phy options */
114 typedef enum
115 {
116  BLE_GAP_PHY_OPT_NO_CODING = 0, /**< The Host has no preferred coding when transmitting on the LE Coded PHY. */
117  BLE_GAP_PHY_OPT_S2_CODING, /**< The Host prefers that S=2 coding be used when transmitting on the LE Coded PHY. */
118  BLE_GAP_PHY_OPT_S8_CODING, /**< The Host prefers that S=8 coding be used when transmitting on the LE Coded PHY. */
120 
121 /** @brief The operation code used to get connection info */
122 typedef enum
123 {
124  BLE_GAP_GET_CON_RSSI = 0, /**< Get connection RSSI info. */
125  BLE_GAP_GET_CON_CHANNEL_MAP, /**< Get connection channel map. */
126  BLE_GAP_GET_PHY, /**< Get connection PHY. */
128 
129 /**@brief The operation code used to get peer device info. */
130 typedef enum
131 {
132  BLE_GAP_GET_PEER_VERSION = 0, /**< Get peer device version info. */
133  BLE_GAP_GET_PEER_FEATURES /**< Get peer device features info. */
135 
136 /** @brief Device role of LL layer type */
137 typedef enum
138 {
139  BLE_GAP_LL_ROLE_MASTER = 0, /**< Master role. */
140  BLE_GAP_LL_ROLE_SLAVE = 1, /**< Slave role. */
142 
143 /**
144  * @brief Operation code used to set param(s).
145  */
146 typedef enum
147 {
148  BLE_GAP_OPCODE_CHNL_MAP_SET, /**< Set Channel Map. */
149  BLE_GAP_OPCODE_WHITELIST_SET, /**< Set white list. */
150  BLE_GAP_OPCODE_PER_ADV_LIST_SET, /**< Set periodic advertising list. */
151  BLE_GAP_OPCODE_PRIVACY_MODE_SET, /**< Set privacy mode for peer device. */
153 
154 /**
155  * @brief The specified reason for terminating a connection.
156  */
157 typedef enum
158 {
159  BLE_GAP_HCI_AUTHENTICATION_FAILURE = 0x05, /**< Authentication Failure. */
160  BLE_GAP_HCI_REMOTE_USER_TERMINATED_CONNECTION = 0x13, /**< Remote User Terminated Connection. */
161  BLE_GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES = 0x14, /**< Remote Device Terminated Connection due to Low Resources. */
162  BLE_GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF = 0x15, /**< Remote Device Terminated Connection due to Power Off. */
163  BLE_GAP_HCI_UNSUPPORTED_REMOTE_FEATURE = 0x1A, /**< Unsupported Remote Feature. */
164  BLE_GAP_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED = 0X29, /**< Pairing With Unit Key Not Supported. */
165  BLE_GAP_HCI_CONN_INTERVAL_UNACCEPTABLE = 0x3B, /**< Unacceptable Connection Parameters. */
167 
168 /**
169  * @brief Operation code used for LEPSM manager.
170  */
171 typedef enum
172 {
173  BLE_GAP_OPCODE_LEPSM_REGISTER, /**< LEPSM register operation. */
174  BLE_GAP_OPCODE_LEPSM_UNREGISTER, /**< LEPSM unregister operation. */
176 
177 /** @brief GAP Device inforamtion write indication. */
178 typedef enum
179 {
180  BLE_GAPC_DEV_NAME, /* Device name type*/
181  BLE_GAPC_DEV_APPEARANCE, /* Device Appearance Icon type*/
183 
184 /**
185  * @brief Type of constant tone extension.
186  */
187 typedef enum
188 {
189  BLE_GAP_CTE_TYPE_AOA = 0x01 << 0, /**< Allow AoA Constant Tone Extension Response. */
190  BLE_GAP_CTE_TYPE_AOD_1US = 0x01 << 1, /**< Allow AoD Constant Tone Extension Response with 1us slots. */
191  BLE_GAP_CTE_TYPE_AOD_2US = 0x01 << 2, /**< Allow AoD Constant Tone Extension Response with 2us slots. */
193 
194 /**
195  * @brief Type of switching and sampling slots
196  */
197 typedef enum
198 {
199  BLE_GAP_SLOT_1US = 0x01, /**< Switching and sampling slots are 1us each. */
200  BLE_GAP_SLOT_2US, /**< Switching and sampling slots are 2us each. */
202 
203 /**
204  * @brief Status of IQ report packet
205  */
206 typedef enum
207 {
208  BLE_GAP_CRC_OK, /**< CRC was correct. */
209  BLE_GAP_CRC_ERR1, /**< CRC was incorrect and the Length and CTETime fields of the packet were used to determine sampling points. */
210  BLE_GAP_CRC_ERR2, /**< CRC was incorrect but the Controller has determined the position and length of the Constant Tone Extension in some other way. */
211  BLE_GAP_INSUFFI_RESOURCE = 0xFF /**< Insufficient resources to sample (data_channel_idx, cte_type, and slot_dur invalid). */
213 
214 /**
215  * @brief Phy for power control management
216  */
217 typedef enum
218 {
219  BLE_GAP_PHY_1M = 0x01, /**< LE 1M PHY. */
220  BLE_GAP_PHY_2M = 0x02, /**< LE 2M PHY. */
221  BLE_GAP_PHY_CODED = 0x03, /**< LE Coded PHY, used for BLE_GAPC_EVT_PHY_UPDATED. */
222  BLE_GAP_PHY_CODED_S8 = 0x03, /**< LE Coded PHY with S=8 data coding, used for dtm test. */
223  BLE_GAP_PHY_CODED_S2 = 0x04 /**< LE Coded PHY with S=2 data coding, used for dtm test. */
225 
226 /**
227  * @brief Transmit power change reporting reason.
228  */
229 typedef enum
230 {
231  BLE_GAP_PWR_LOCAL_TX_CHG = 0x00, /**< Local transmit power changed. */
232  BLE_GAP_PWR_REMOTE_TX_CHG = 0x01, /**< Remote transmit power changed. */
234 
235 /**
236  * @brief Transmit Power level flag.
237  */
238 typedef enum
239 {
240  BLE_GAP_PWR_MID_LVL = 0x00, /**< Transmit power level is between minimum and max level. */
241  BLE_GAP_PWR_MIN_LVL = 0x01, /**< Transmit power level is at minimum level. */
242  BLE_GAP_PWR_MAX_LVL = 0x02 /**< Transmit power level is at maximum level. */
244 
245 /// Path Loss zones. HCI:7.8.118
246 typedef enum
247 {
248  BLE_GAP_PATH_LOSS_LOW = 0x00, /**< Entered Low zone. */
249  BLE_GAP_PATH_LOSS_MID = 0x01, /**< Entered Middle zone. */
250  BLE_GAP_PATH_LOSS_HIGH = 0x02, /**< Entered High zone. */
252 
253 /** @} */
254 
255 
256 /**
257  * @defgroup BLE_GAPC_STRUCT Structures
258  * @{
259  */
260 
261 /** @brief The struct of address. */
262 typedef struct
263 {
264  uint8_t addr[BLE_GAP_ADDR_LEN]; /**< 6-byte array address value. */
266 
267 /** @brief The struct of broadcast address with broadcast type. */
268 typedef struct
269 {
270  ble_gap_addr_t gap_addr; /**< Device BD Address. */
271  uint8_t addr_type; /**< Address type of the device: 0=public/1=random. please @ref ble_gap_addr_type_t. */
273 
274 /** @brief Sync established indication. */
275 typedef struct
276 {
277  uint8_t phy; /**< PHY on which synchronization has been established. @see gap_phy_type. */
278  uint16_t intv; /**< Periodic advertising interval (in unit of 1.25ms, min is 7.5ms). */
279  uint8_t adv_sid; /**< Advertising SID. */
280  uint8_t clk_acc; /**< Advertiser clock accuracy. @see enum gapm_clk_acc. */
281  ble_gap_bdaddr_t bd_addr; /**< Advertiser address. */
282  uint16_t sync_hdl; /**< Sync handle. */
283  uint16_t serv_data; /**< Service data. */
284  bool report_flag; /**< Report Flag. */
286 
287 
288 /** @brief APP receives the extended advertising report indication info struct. */
289 typedef struct
290 {
291  uint8_t adv_type; /**< Advertising type. @see enum gap_adv_report_type_t. */
292  uint8_t adv_info; /**< Bit field providing information about the received report. @see enum gap_adv_report_info_t. */
293  ble_gap_bdaddr_t broadcaster_addr; /**< Broadcaster device address. */
294  ble_gap_bdaddr_t direct_addr; /**< Target address (in case of a directed advertising report). */
295  int8_t tx_pwr; /**< TX power (in dBm). */
296  int8_t rssi; /**< RSSI (between -127 and +20 dBm). */
297  uint8_t phy_prim; /**< Primary PHY on which advertising report has been received. */
298  uint8_t phy_second; /**< Secondary PHY on which advertising report has been received. */
299  uint8_t adv_sid; /**< Advertising SID , valid only for periodic advertising report. */
300  uint16_t period_adv_intv; /**< Periodic advertising interval (in unit of 1.25ms, min is 7.5ms), valid only for periodic advertising report. */
301  uint8_t per_sync_idx; /**< Periodic syncronization index, valid only for periodic advertising report. */
302  uint16_t length; /**< Report length. */
303  uint8_t data[__ARRAY_EMPTY]; /**< Report. */
305 
306 /** @brief Connection parameter used to update connection parameters. */
307 typedef struct
308 {
309  uint16_t interval; /**< Connection interval. Range: 0x0006 to 0x0C80. Unit: 1.25 ms. Time range: 7.5 ms to 4 s. */
310  uint16_t latency; /**< Latency for the connection in number of connection events. Range: 0x0000 to 0x01F3. */
311  uint16_t sup_timeout; /**< Supervision timeout for the LE link. Range: 0x000A to 0x0C80, unit: 10 ms, time range: 100 ms to 32 s. */
313 
314 /** @brief The parameter of connection. */
315 typedef struct
316 {
317  uint16_t interval_min; /**< Minimum value for the connection interval. This shall be less than or equal to Conn_Interval_Max.
318  Range: 0x0006 to 0x0C80, unit: 1.25 ms, time range: 7.5 ms to 4 s*/
319  uint16_t interval_max; /**< Maximum value for the connection interval. This shall be greater than or equal to Conn_Interval_Min.
320  Range: 0x0006 to 0x0C80, unit: 1.25 ms, time range: 7.5 ms to 4 s.*/
321  uint16_t slave_latency; /**< Slave latency for the connection in number of connection events. Range: 0x0000 to 0x01F3. */
322  uint16_t sup_timeout; /**< Supervision timeout for the LE link. Range: 0x000A to 0x0C80, unit: 10 ms, time range: 100 ms to 32 s. */
324 
325 /** @brief The parameter of update connection. */
326 typedef struct
327 {
328  uint16_t interval_min; /**< Minimum value for the connection interval. This shall be less than or equal to Conn_Interval_Max.
329  Range: 0x0006 to 0x0C80, unit: 1.25 ms, time range: 7.5 ms to 4 s*/
330  uint16_t interval_max; /**< Maximum value for the connection interval. This shall be greater than or equal to Conn_Interval_Min.
331  Range: 0x0006 to 0x0C80, unit: 1.25 ms, time range: 7.5 ms to 4 s.*/
332  uint16_t slave_latency; /**< Slave latency for the connection in number of connection events. Range: 0x0000 to 0x01F3. */
333  uint16_t sup_timeout; /**< Supervision timeout for the LE link. range: 0x000A to 0x0C80, unit: 10 ms, Time range: 100 ms to 32 s. */
334  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.
335  recommended value: 0x0002 for 1M phy, 0x0006 for coded phy*/
337 
338 /** @brief Connection complete info. */
339 typedef struct
340 {
341  uint16_t conhdl; /**< Connection_Handle. Range: 0x0000-0x0EFF (all other values reserved for future use). */
342  uint16_t con_interval; /**< Connection interval. Range: 0x0006 to 0x0C80, unit: 1.25 ms, time range: 7.5 ms to 4 s. */
343  uint16_t con_latency; /**< Latency for the connection in number of connection events. Range: 0x0000 to 0x01F3. */
344  uint16_t sup_to; /**< Connection supervision timeout. Range: 0x000A to 0x0C80, unit: 10 ms, time range: 100 ms to 32 s. */
345  uint8_t clk_accuracy; /**< Clock accuracy (0x00: 500 ppm, 0x01: 250 ppm, 0x02: 150 ppm, 0x03: 100 ppm, 0x04: 75 ppm,
346  0x05:50 ppm, 0x06:30 ppm, 0x07:20 ppm, others: reserved for future use). */
347  uint8_t peer_addr_type; /**< Peer address type(0x00: Public Device Address, 0x01 : Random Device Address, others: reserved for future use). */
348  ble_gap_addr_t peer_addr; /**< Peer BT address. */
349  ble_gap_ll_role_type_t ll_role; /**< Device Role of LL Layer. */
351 
352 /** @brief Channel map structure. */
353 typedef struct
354 {
355  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.
356  Channel n is unused = 0, channel n is used = 1. The most significant bits are reserved for future use.*/
358 
359 /** @brief PHY info. */
360 typedef struct
361 {
362  uint8_t tx_phy; /**< LE PHY for data transmission. @see ble_gap_phy_type_t. */
363  uint8_t rx_phy; /**< LE PHY for data reception. @see ble_gap_phy_type_t. */
365 
366 /** @brief Connection info. */
367 typedef union
368 {
369  int8_t rssi; /**< RSSI. */
370  ble_gap_chnl_map_t chnl_map; /**< channel map. */
371  ble_gap_le_phy_ind_t phy; /**< PHY indicaiton. */
372  uint8_t chan_sel_algo; /**< Chanel Selection algorithm, 0x00: LE Channel Selection Algorithm #1 is used.
373  0x01: LE Channel Selection Algorithm #2 is used.\n 0x02-0xFF: reserved. */
375 
376 /** @brief The info of connecting operation. */
377 typedef struct
378 {
379  uint8_t opcode; /**< Operation code. See @ref ble_gap_get_conn_info_op_t. */
380  ble_gap_conn_info_t info; /**< Connection info. */
382 
383 /** @brief Peer version info. */
384 typedef struct
385 {
386  uint16_t compid; /**<Manufacturer name. */
387  uint16_t lmp_subvers; /**< LMP subversion. */
388  uint8_t lmp_vers; /**< LMP version. */
390 
391 
392 /** @brief LE features info. */
393 typedef struct
394 {
395  uint8_t features[BLE_GAP_FEATS_LEN]; /**< 8-byte array for LE features\n
396  Feature Setting field's bit mapping to Controller Features (0: not support, 1: support) \n
397  |Bit position | Link Layer Feature|
398  |-------------|-----------------|
399  |0 | LE Encryption|
400  |1 |Connection Parameters Request Procedure|
401  |2 |Extended Reject Indication|
402  |3 | Slave-initiated Features Exchange |
403  |4 |LE Ping |
404  |5 |LE Data Packet Length Extension |
405  |6 |LL Privacy |
406  |7 |Extended Scanner Filter Policies |
407  |8 |LE 2M PHY|
408  |9 | Stable Modulation Index - Transmitter |
409  |10 | Stable Modulation Index - Receiver |
410  |11 |LE Coded PHY |
411  |12 |LE Extended Advertising|
412  |13 | LE Periodic Advertising|
413  |14 | Channel Selection Algorithm #2|
414  |15 |LE Power Class 1|
415  |16 |Minimum Number of Used Channels Procedure|
416  |17 |Connection CTE Request|
417  |18 |Connection CTE Response|
418  |19 |Connectionless CTE Transmitter|
419  |20 |Connectionless CTE Receiver|
420  |21 |Antenna Switching During CTE Transmission(AoD)|
421  |22 |Antenna Switching During CTE Reception(AoA)|
422  |23 |Receiving Constant Tone Extensions|
423  |24 |Periodic Advertising Sync Transfer - Sender|
424  |25 |Periodic Advertising Sync Transfer - Recipient|
425  |26 |Sleep Clock Accuracy Updates|
426  |27 |Remote Public Key Validation|
427  |33 |LE Power Control Request|
428  |34 |LE Power Change Indication|
429  |35 |LE Path Loss Monitoring|
430 
431  |All other values |Reserved for Future Use|*/
433 
434 /** @brief LE peer info. */
435 typedef union
436 {
440 
441 /** @brief Get peer info operation struct. */
442 typedef struct
443 {
444  uint8_t opcode; /**< Operation code. See @ref ble_gap_get_peer_info_op_t. */
445  ble_gap_peer_info_t peer_info; /**< Peer info. */
447 
448 /** @brief Supported data length size Indication. */
449 typedef struct
450 {
451  uint16_t max_tx_octets; /**< The maximum number of payload octets in TX. */
452  uint16_t max_tx_time; /**< The maximum time that the local Controller will take to TX. */
453  uint16_t max_rx_octets; /**< The maximum number of payload octets in RX. */
454  uint16_t max_rx_time; /**< The maximum time that the local Controller will take to RX. */
456 
457 /**@brief The Structure for BLE Connection Arrangement. */
458 typedef struct
459 {
460  uint16_t conn_idx; /**< Connection Index. */
461  uint32_t interval; /**< Connection Interval (in 312.5 us). */
462  uint32_t offset; /**< Connection Offset (in 312.5 us). */
463  uint32_t duration; /**< Connection Duration (in 312.5 us). */
465 
466 /** @brief Set preference slave event duration */
467 typedef struct
468 {
469  uint16_t duration; /**< Preferred event duration. */
470  uint8_t single_tx; /**< Slave transmits a single packet per connection event (False/True). */
472 
473 /** @brief GAP Device name struct. */
474 typedef struct
475 {
476  uint16_t length; /**< Device name length. */
477  uint8_t value[__ARRAY_EMPTY]; /**< Device name data. */
479 
480 /** @brief Device information data struct. */
481 typedef union
482 {
483  ble_gap_dev_name_ind_t dev_name; /**< Device name. see @ref ble_gap_dev_name_ind_t. */
484  uint16_t appearance; /**< Device appearance */
486 
487 
488 /** @brief GAP Device inforamtion write indication. */
489 typedef struct
490 {
491  ble_gap_dev_info_type_t info_type; /**< Device info type. see @ref ble_gap_dev_info_type_t. */
492  ble_gapc_set_dev_info_t info; /**< Device info data. see @ref ble_gap_cte_type_t. */
494 
495 /**
496  * @brief Default periodic advertising synchronization transfer parameters
497  */
498 typedef struct
499 {
500  uint8_t mode; /**< @see gap_per_adv_sync_info_rec_mode. */
501  uint16_t skip; /**< Number of periodic advertising that can be skipped after a successful receive.
502  Maximum authorized value is 499. */
503  uint16_t sync_to; /**< Synchronization timeout for the periodic advertising (in unit of 10 ms between 100 ms and 163.84s). */
504  uint8_t cte_type; /**< Type of Constant Tone Extension device should sync on (@see enum gap_sync_cte_type). */
506 
507 /**
508  * @brief Connectionless IQ Report info
509  */
510 typedef struct
511 {
512  uint8_t channel_idx; /**< The index of the channel on which the packet was received, range 0x00 to 0x24. */
513  int16_t rssi; /**< RSSI units: 0.1 dBm, range -1270 to +200. */
514  uint8_t rssi_antenna_id; /**< RSSI antenna ID. */
515  uint8_t cte_type; /**< CTE type (0: GAP_CET_AOA | 1: GAP_CET_AOD_1US | 2: GAP_CET_AOD_2US), @see enum ble_gap_cte_type_t. */
516  uint8_t slot_dur; /**< Slot durations (1: GAP_SLOT_1US | 2: GAP_SLOT_2US), see @ref ble_gap_switching_sampling_type_t. */
517  uint8_t pkt_status; /**< Packet status, @see enum ble_gap_iq_report_status_t. */
518  uint16_t pa_evt_cnt; /**< Periodic advertising event counter. */
519  uint8_t nb_samples; /**< Number of samples. 0x00: no samples provided (only permitted if pkt_status is 0xFF),
520  0x09 to 0x52: total number of sample pairs. */
521  int8_t i_sample[BLE_GAP_MAX_IQ_SAMPLE_NUM]; /**< The list of i samples for the reported PDU. */
522  int8_t q_sample[BLE_GAP_MAX_IQ_SAMPLE_NUM]; /**< The list of q samples for the reported PDU. */
524 
525 /** @brief Set connection CTE transmit parameters info. */
526 typedef struct
527 {
528  uint8_t cte_type; /**< The type of cte, see @ref ble_gap_cte_type_t. */
529  uint8_t num_antenna; /**< The number of Antenna IDs in the pattern, range 0x02 to 0x4B. */
530  uint8_t *antenna_id; /**< List of Antenna IDs in the pattern. */
532 
533 /** @brief Set connection CTE receive parameters info. */
534 typedef struct
535 {
536  bool sampling_enable; /**< Wheter to sample IQ from the CTE. */
537  uint8_t slot_durations; /**< The slot for sample IQ from the CTE, see @ref ble_gap_switching_sampling_type_t. */
538  uint8_t num_antenna; /**< The number of Antenna IDs in the pattern, range 0x02 to 0x4B. */
539  uint8_t *antenna_id; /**< List of Antenna IDs in the pattern. */
541 
542 /** @brief Set connection CTE Request enable info. */
543 typedef struct
544 {
545  uint16_t cte_req_interval; /**< Defines whether the cte request procedure is initiated only once or periodically.
546  0x0000: initiate the Constant Tone Extension Request procedure once.
547  0x0001 to 0xFFFF: requested interval for initiating the cte request procedure in number of connection events. */
548  uint8_t cte_req_len; /**< Minimum length of the cte being requested in 8us units, range 0x02 to 0x14. */
549  uint8_t cte_req_type; /**< The type for requested cte, see @ref ble_gap_cte_type_t. */
551 
552 /** @brief Connection IQ Report info. */
553 typedef struct
554 {
555  uint8_t rx_phy; /**< Rx PHY (0x01: 1M | 0x02: 2M), see @ref ble_gap_phy_type_t. */
556  uint8_t data_channel_idx; /**< Data channel index, range 0x00 to 0x24. */
557  int16_t rssi; /**< RSSI units: 0.1 dBm, range -1270 to +200. */
558  uint8_t rssi_antenna_id; /**< RSSI antenna ID. */
559  uint8_t cte_type; /**< CTE type (0: GAP_CET_AOA | 1: GAP_CET_AOD_1US | 2: GAP_CET_AOD_2US), @see enum ble_gap_cte_type_t. */
560  uint8_t slot_dur; /**< Slot durations (1: GAP_SLOT_1US | 2: GAP_SLOT_2US), see @ref ble_gap_switching_sampling_type_t. */
561  uint8_t pkt_status; /**< Packet status, @see enum ble_gap_iq_report_status_t. */
562  uint16_t con_evt_cnt; /**< Connection event counter. */
563  uint8_t nb_samples; /**< Number of samples. 0x00: no samples provided (only permitted if pkt_status is 0xFF),
564  0x09 to 0x52: total number of sample pairs. */
565  int8_t i_sample[BLE_GAP_MAX_IQ_SAMPLE_NUM]; /**< The list of i samples for the reported PDU. */
566  int8_t q_sample[BLE_GAP_MAX_IQ_SAMPLE_NUM]; /**< The list of q samples for the reported PDU. */
568 
569 /** @brief Set path loss reporting parameter info. */
570 typedef struct
571 {
572  uint8_t high_thr; /**< High threshold for the path loss (dB). */
573  uint8_t high_hyst; /**< Hysteresis value for the high threshold (dB). */
574  uint8_t low_thr; /**< Low threshold for the path loss (dB). */
575  uint8_t low_hyst; /**< Hysteresis value for the low threshold (dB). */
576  uint16_t min_conn_evt_num; /**< Minimum time in number of connection events to be observed. */
578 
579 /**@brief PHY update event for @ref BLE_GAPC_EVT_PHY_UPDATED. */
580 typedef struct
581 {
582  uint8_t tx_phy; /**< LE PHY for data transmission. (0x00:1M, 0x01:2M, 0x03:coded) @ref ble_gap_phy_type_t. */
583  uint8_t rx_phy; /**< LE PHY for data reception. (0x00:1M, 0x01:2M, 0x03:coded) @ref ble_gap_phy_type_t. */
585 
586 /** @brief Connection complete event for @ref BLE_GAPC_EVT_CONNECTED. */
587 typedef struct
588 {
589  uint16_t conn_handle; /**< Connection_Handle. Range: 0x0000-0x0EFF (all other values reserved for future use). */
590  uint16_t conn_interval; /**< Connection interval. Range: 0x0006 to 0x0C80, unit: 1.25 ms, time range: 7.5 ms to 4 s. */
591  uint16_t slave_latency; /**< Latency for the connection in number of connection events. Range: 0x0000 to 0x01F3. */
592  uint16_t sup_timeout; /**< Connection supervision timeout. Range: 0x000A to 0x0C80, unit: 10 ms, time range: 100 ms to 32 s. */
593  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). */
594  uint8_t peer_addr_type; /**< Peer address type(0x00: Public Device Address, 0x01 : Random Device Address, others: reserved for future use). */
595  ble_gap_addr_t peer_addr; /**< Peer BT address. */
596  ble_gap_ll_role_type_t ll_role; /**< Device Role of LL Layer. */
598 
599 /**@brief Disconnection event for @ref BLE_GAPC_EVT_DISCONNECTED. */
600 typedef struct
601 {
602  uint8_t reason; /**< Hci error code. */
604 
605 /** @brief Name of peer device indication event for @ref BLE_GAPC_EVT_PEER_NAME_GOT. */
606 typedef struct
607 {
608  ble_gap_addr_t peer_addr; /**< Peer device bd address. */
609  uint8_t addr_type; /**< Peer device address type. */
610  uint8_t name_len; /**< Peer device name length. */
611  uint8_t *name; /**< Peer device name. */
613 
614 /** @brief Get peer info event for @ref BLE_GAPC_EVT_PEER_INFO_GOT. */
615 typedef struct
616 {
617  uint8_t opcode; /**< Operation code. See @ref ble_gap_get_peer_info_op_t. */
618  ble_gap_peer_info_t peer_info; /**< Peer info. */
620 
621 /** @brief Connection parameter updated event for @ref BLE_GAPC_EVT_CONN_PARAM_UPDATED. */
622 typedef struct
623 {
624  uint16_t conn_interval; /**< Connection interval. Range: 0x0006 to 0x0C80. Unit: 1.25 ms. Time range: 7.5 ms to 4 s. */
625  uint16_t slave_latency; /**< Latency for the connection in number of connection events. Range: 0x0000 to 0x01F3. */
626  uint16_t sup_timeout; /**< Supervision timeout for the LE link. Range: 0x000A to 0x0C80, unit: 10 ms, time range: 100 ms to 32 s. */
628 
629 /** @brief Connection parameter update request event for @ref BLE_GAPC_EVT_CONN_PARAM_UPDATE_REQ. */
630 typedef struct
631 {
632  uint16_t interval_min; /**< Minimum value for the connection interval. This shall be less than or equal to Conn_Interval_Max.
633  Range: 0x0006 to 0x0C80, unit: 1.25 ms, time range: 7.5 ms to 4 s*/
634  uint16_t interval_max; /**< Maximum value for the connection interval. This shall be greater than or equal to Conn_Interval_Min.
635  Range: 0x0006 to 0x0C80, unit: 1.25 ms, time range: 7.5 ms to 4 s.*/
636  uint16_t slave_latency; /**< Slave latency for the connection in number of connection events. Range: 0x0000 to 0x01F3. */
637  uint16_t sup_timeout; /**< Supervision timeout for the LE link. Range: 0x000A to 0x0C80, unit: 10 ms, time range: 100 ms to 32 s. */
639 
640 /** @brief Get Connection info event for @ref BLE_GAPC_EVT_CONN_INFO_GOT. */
641 typedef struct
642 {
643  uint8_t opcode; /**< Operation code. See @ref ble_gap_get_conn_info_op_t. */
644  ble_gap_conn_info_t info; /**< Connection info. */
646 
647 /** @brief Data Length Updated event for @ref BLE_GAPC_EVT_DATA_LENGTH_UPDATED. */
648 typedef struct
649 {
650  uint16_t max_tx_octets; /**< The maximum number of payload octets in TX. */
651  uint16_t max_tx_time; /**< The maximum time that the local Controller will take to TX. */
652  uint16_t max_rx_octets; /**< The maximum number of payload octets in RX. */
653  uint16_t max_rx_time; /**< The maximum time that the local Controller will take to RX. */
655 
656 /** @brief Device Information set event for @ref BLE_GAPC_EVT_DEV_INFO_SET. */
657 typedef struct
658 {
659  ble_gap_dev_info_type_t info_type; /**< Device info type. see @ref ble_gap_dev_info_type_t. */
660  ble_gapc_set_dev_info_t info; /**< Device info data. see @ref ble_gap_cte_type_t. */
662 
663 /** @brief Connection IQ Report info event for @ref BLE_GAPC_EVT_CONNECT_IQ_REPORT. */
664 typedef struct
665 {
666  uint8_t rx_phy; /**< Rx PHY (0x01: 1M | 0x02: 2M). */
667  uint8_t data_channel_idx; /**< Data channel index, range 0x00 to 0x24. */
668  int16_t rssi; /**< RSSI units: 0.1 dBm, range -1270 to +200. */
669  uint8_t rssi_antenna_id; /**< RSSI antenna ID. */
670  uint8_t cte_type; /**< CTE type (0: GAP_CET_AOA | 1: GAP_CET_AOD_1US | 2: GAP_CET_AOD_2US), @see enum ble_gap_cte_type_t. */
671  uint8_t slot_dur; /**< Slot durations (1: GAP_SLOT_1US | 2: GAP_SLOT_2US), see @ref ble_gap_switching_sampling_type_t. */
672  uint8_t pkt_status; /**< Packet status, @see enum ble_gap_iq_report_status_t. */
673  uint16_t con_evt_cnt; /**< Connection event counter. */
674  uint8_t nb_samples; /**< Number of samples. 0x00: no samples provided (only permitted if pkt_status is 0xFF),
675  0x09 to 0x52: total number of sample pairs. */
676  int8_t i_sample[BLE_GAP_MAX_IQ_SAMPLE_NUM]; /**< The list of i samples for the reported PDU. */
677  int8_t q_sample[BLE_GAP_MAX_IQ_SAMPLE_NUM]; /**< The list of q samples for the reported PDU. */
679 
680 /** @brief Connectionless IQ Report info event for @ref BLE_GAPC_EVT_CONNECTLESS_IQ_REPORT. */
681 typedef struct
682 {
683  uint8_t channel_idx; /**< The index of the channel on which the packet was received, range 0x00 to 0x24. */
684  int16_t rssi; /**< RSSI units: 0.1 dBm, range -1270 to +200. */
685  uint8_t rssi_antenna_id; /**< RSSI antenna ID. */
686  uint8_t cte_type; /**< CTE type (0: GAP_CET_AOA | 1: GAP_CET_AOD_1US | 2: GAP_CET_AOD_2US), @see enum ble_gap_cte_type_t. */
687  uint8_t slot_dur; /**< Slot durations (1: GAP_SLOT_1US | 2: GAP_SLOT_2US), see @ref ble_gap_switching_sampling_type_t. */
688  uint8_t pkt_status; /**< Packet status, @see enum ble_gap_iq_report_status_t. */
689  uint16_t pa_evt_cnt; /**< Periodic advertising event counter. */
690  uint8_t nb_samples; /**< Number of samples. 0x00: no samples provided (only permitted if pkt_status is 0xFF),
691  0x09 to 0x52: total number of sample pairs. */
692  int8_t i_sample[BLE_GAP_MAX_IQ_SAMPLE_NUM]; /**< The list of i samples for the reported PDU. */
693  int8_t q_sample[BLE_GAP_MAX_IQ_SAMPLE_NUM]; /**< The list of q samples for the reported PDU. */
695 
696 /** @brief Le event notification reporting info event for @ref BLE_GAPC_EVT_LE_EVT_NOTI_REPORT. */
697 typedef struct
698 {
699  int8_t rssi; /**< RSSI value (dBm). */
700  uint8_t channel; /**< Connection channel. */
701  uint16_t event_counter; /**< Connection event counter. */
702  uint16_t anchor_ts_hus; /**< BLE time stamp of the anchor point with this event_counter, unit 0.5us. */
703  uint32_t anchor_ts_hs; /**< BLE time stamp of the anchor point with this event_counter, unit 312.5us. */
705 
706 /**@brief BLE GAPC event structure. */
707 typedef struct
708 {
709  uint8_t index; /**< Index of connection. */
710  union /**< union alternative identified by evt_id in enclosing struct. */
711  {
712  ble_gap_evt_phy_update_t phy_update; /**< PHY update parameters. */
713  ble_gap_evt_connected_t connected; /**< Connection parameters. */
714  ble_gap_evt_disconnected_t disconnected; /**< Disconnection parameters. See @ref BLE_STACK_ERROR_CODES. */
715  ble_gap_evt_peer_name_get_t peer_name; /**< Peer device name indication parameters. */
716  ble_gap_evt_peer_info_t peer_info; /**< Peer info indication parameters. */
717  ble_gap_evt_conn_param_updated_t conn_param_updated; /**< Connection parameter updated parameters. */
718  ble_gap_evt_conn_param_update_req_t conn_param_update_req; /**< Connection parameter update request parameters. */
719  ble_gap_evt_conn_info_t conn_info; /**< Connection info parameters. */
720  ble_gap_evt_data_length_t data_length; /**< Data Length Update parameter. */
721  ble_gap_evt_dev_info_set_t dev_info_ind; /**< Device info parameters. */
722  ble_gap_evt_conn_iq_report_t conn_iq_report; /**< Connection IQ Report info parameters. */
723  ble_gap_evt_connless_iq_report_t connless_iq_report; /**< Connectionless IQ Report info parameters. */
724  ble_gap_evt_le_event_noti_report_t le_evt_noti_report; /**< Le event notification reporting info parameters. */
725  } params; /**< Event Parameters. */
727 
728 /** @} */
729 
730 /**
731  * @defgroup BLE_GAPC_FUNCTION Functions
732  * @{
733  */
734 /**
735  ****************************************************************************************
736  * @brief Terminate an existing connection.
737  *
738  * @param[in] conn_idx: The index of connection.
739  *
740  * @retval ::SDK_SUCCESS: Operation is Success.
741  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
742  * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
743  ****************************************************************************************
744  */
745 uint16_t ble_gap_disconnect(uint8_t conn_idx);
746 
747 /**
748  ****************************************************************************************
749  * @brief Terminate an existing connection with a specified reason.
750  *
751  * @param[in] conn_idx: The index of connection.
752  * @param[in] reason: The specified reason.
753  *
754  * @retval ::SDK_SUCCESS: Operation is Success.
755  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
756  * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
757  ****************************************************************************************
758  */
759 uint16_t ble_gap_disconnect_with_reason(uint8_t conn_idx, ble_gap_disconn_reason_t reason);
760 
761 /**
762  ****************************************************************************************
763  * @brief Change the Link Layer connection parameters of a connection.
764  *
765  * @param[in] conn_idx: The index of connection.
766  * @param[in] p_conn_param: The new connection param.
767  *
768  * @retval ::SDK_SUCCESS: Operation is Success.
769  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
770  * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
771  * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
772  ****************************************************************************************
773  */
774 uint16_t ble_gap_conn_param_update(uint8_t conn_idx, const ble_gap_conn_update_param_t *p_conn_param);
775 
776 /**
777  *****************************************************************************************
778  * @brief Set the method for updating connection parameter.
779  *
780  * @param[in] conn_idx: Connection index.
781  * @param[in] use_l2cap_flag: Preferred to use l2cap to update connection parameter.
782  *
783  * @retval ::SDK_SUCCESS: Operation is Success.
784  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
785  *****************************************************************************************
786  */
787 uint16_t ble_gap_update_conn_param_method_set(uint8_t conn_idx, bool use_l2cap_flag);
788 
789 /**
790  *****************************************************************************************
791  * @brief Set connection's Latency.
792  * @note The latency shall be set to X value by LLCP firstly, then uses this API to change the latency in [0, X].
793  *
794  * @param[in] conn_idx: The index of connection.
795  * @param[in] latency: The latency of connection.
796  *
797  * @retval ::SDK_SUCCESS: Operation is Success.
798  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
799  *****************************************************************************************
800  */
801 uint16_t ble_gap_latency_set(uint8_t conn_idx, uint16_t latency);
802 
803 /**
804  *****************************************************************************************
805  * @brief Get connection's Latency.
806  * @note This function is used to get connection's Latency.
807  *
808  * @param[in] conn_idx: The index of connection.
809  * @param[in] latency: Pointer to the latency of connection.
810  *
811  * @retval ::SDK_SUCCESS: Operation is Success.
812  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
813  *****************************************************************************************
814  */
815 uint16_t ble_gap_latency_get(uint8_t conn_idx, uint16_t *latency);
816 
817 /**
818  *****************************************************************************************
819  * @brief Consult BLE connection activity plan situation function.
820  * @note This function should be called when connection established and no periodic advertising exists.
821  *
822  * @param[out] p_act_num: Pointer to the number of existing connection activities.
823  * @param[out] p_conn_plan_arr: Pointer to the global array that stores planned connection activities.
824  *
825  * @retval ::SDK_SUCCESS: Operation is Success.
826  * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
827  *****************************************************************************************
828  */
829 uint16_t ble_gap_con_plan_consult(uint8_t *p_act_num, ble_gap_con_plan_tag_t **p_conn_plan_arr);
830 
831 /**
832  ****************************************************************************************
833  * @brief Connection param update reply to peer device.
834  *
835  * @param[in] conn_idx: The index of connection.
836  * @param[in] accept: True to accept connection parameters, false to reject.
837  *
838  * @retval ::SDK_SUCCESS: Operation is success.
839  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
840  * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
841  * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
842  ****************************************************************************************
843  */
844 uint16_t ble_gap_conn_param_update_reply(uint8_t conn_idx, bool accept);
845 
846 /**
847  ****************************************************************************************
848  * @brief The suggested maximum transmission packet size and maximum packet transmission time to be used for a given connection.
849  *
850  * @param[in] conn_idx: The index of connection.
851  * @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.
852  * Range 0x001B-0x00FB (all other values reserved for future use).
853  * @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.
854  * Range 0x0148-0x4290 (all other values reserved for future use).
855  *
856  *
857  * @retval ::SDK_SUCCESS: Operation is Success.
858  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
859  * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
860  ****************************************************************************************
861  */
862 uint16_t ble_gap_data_length_update(uint8_t conn_idx, uint16_t tx_octects , uint16_t tx_time);
863 
864 /**
865  ****************************************************************************************
866  * @brief Set the PHY preferences for the connection identified by the connection index.
867  *
868  * @param[in] conn_idx: The index of connection.
869  * @param[in] tx_phys: A bit field that indicates the transmitter PHYs that the Host prefers the Controller to use (see @ref ble_gap_phy_bit_t).
870  * @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).
871  * @param[in] phy_opt: A bit field that allows the Host to specify options for PHYs (see @ref ble_gap_phy_options_t), only valid for coded phy.
872  *
873  * @retval ::SDK_SUCCESS: Operation is Success.
874  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
875  * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
876  ****************************************************************************************
877  */
878 uint16_t ble_gap_phy_update(uint8_t conn_idx, uint8_t tx_phys, uint8_t rx_phys, uint8_t phy_opt);
879 
880 /**
881  ****************************************************************************************
882  * @brief Get the information of the connection.
883  *
884  * @param[in] conn_idx: The index of connection.
885  * @param[in] opcode: The operation code. See @ref ble_gap_get_conn_info_op_t.
886  *
887  * @retval ::SDK_SUCCESS: Operation is Success.
888  * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
889  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
890  * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
891  ****************************************************************************************
892  */
893 uint16_t ble_gap_conn_info_get(uint8_t conn_idx, ble_gap_get_conn_info_op_t opcode);
894 
895 /**
896  ****************************************************************************************
897  * @brief Get the information of the peer device.
898  *
899  * @param[in] conn_idx: The index of connection.
900  * @param[in] opcode: The operation code. See @ref ble_gap_get_peer_info_op_t.
901  *
902  * @retval ::SDK_SUCCESS: Operation is Success.
903  * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
904  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
905  * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
906  ****************************************************************************************
907  */
908 uint16_t ble_gap_peer_info_get(uint8_t conn_idx, ble_gap_get_peer_info_op_t opcode);
909 
910 /**
911  ****************************************************************************************
912  * @brief Get BD address of the bonded device.
913  *
914  * @param[in] conn_idx: The index of connection.
915  * @param[in] p_peer_addr: Pointer to the peer BD addrss
916  *
917  * @retval ::SDK_SUCCESS: Operation is Success.
918  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
919  * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
920  ****************************************************************************************
921  */
922 uint16_t ble_gap_bond_dev_addr_get(uint8_t conn_idx, ble_gap_bdaddr_t *p_peer_addr);
923 
924 /**
925  ****************************************************************************************
926  * @brief Set connection CTE transmit parameters.
927  *
928  * @param[in] conn_idx: The index of connection.
929  * @param[in] param: Set connection CTE transmit parameters info, see @ref ble_gap_set_conn_cte_trans_param_t.
930  *
931  * @retval ::SDK_SUCCESS: Operation is Success.
932  * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
933  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
934  ****************************************************************************************
935  */
937 
938 /**
939  ****************************************************************************************
940  * @brief Set connection CTE receive parameters.
941  *
942  * @param[in] conn_idx: The index of connection.
943  * @param[in] param: Set connection CTE receive parameters info, see @ref ble_gap_set_conn_cte_rcv_param_t.
944 
945  * @retval ::SDK_SUCCESS: Operation is Success.
946  * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
947  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
948  ****************************************************************************************
949  */
951 
952 /**
953  ****************************************************************************************
954  * @brief Set connection CTE request enable.
955  *
956  * @param[in] conn_idx: The index of connection.
957  * @param[in] enable_flag: Wheter to request the cte for the connection. If enable_flag is set to false, the param shall be NULL.
958  * @param[in] param: Set connection CTE request enable info, see @ref ble_gap_set_conn_cte_req_enable_t.
959 
960  * @retval ::SDK_SUCCESS: Operation is Success.
961  * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
962  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
963  ****************************************************************************************
964  */
965 uint16_t ble_gap_conn_cte_req_enable_set(uint8_t conn_idx, bool enable_flag, ble_gap_set_conn_cte_req_enable_t *param);
966 
967 /**
968  ****************************************************************************************
969  * @brief Set connection CTE response enable.
970  *
971  * @param[in] conn_idx: The index of connection.
972  * @param[in] enable_flag: Wheter to response the cte req for the connection.
973 
974  * @retval ::SDK_SUCCESS: Operation is Success.
975  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
976  ****************************************************************************************
977  */
978 uint16_t ble_gap_conn_cte_rsp_enable_set(uint8_t conn_idx, bool enable_flag);
979 
980 /**
981  ****************************************************************************************
982  * @brief Get BD address of the local device by the conidx.
983  *
984  * @param[in] conidx: The index of conncetion.
985  * @param[in] p_addr: Pointer to the local BD addrss
986  ****************************************************************************************
987  */
988 void ble_gap_get_local_addr_by_conidx(uint8_t conidx, uint8_t *p_addr);
989 
990 /**
991  ****************************************************************************************
992  * @brief Enable or disable the reporting of LE event notification.
993  * @note This API is asynchronous.
994  * @note After invoking this API, the event @ref BLE_GAPC_EVT_LE_EVT_NOTI_REPORT will be called.
995  *
996  * @param[in] conn_idx: The index of connection.
997  * @param[in] enable_flag: The enable flag for reporting of LE event notification.
998 
999  * @retval ::SDK_SUCCESS: Operation is Success.
1000  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
1001  ****************************************************************************************
1002  */
1003 uint16_t ble_gap_le_event_noti_report_enable_set(uint8_t conn_idx, bool enable_flag);
1004 
1005 /**
1006  ****************************************************************************************
1007  * @brief Get connection link number.
1008 
1009  * @retval ::Return the number of connection link.
1010  ****************************************************************************************
1011  */
1013 
1014 /**
1015  ****************************************************************************************
1016  * @brief Ignore latency with numbers indicated by ignore_num, after slave sending data.
1017  *
1018  * @param[in] conn_idx: The index of connection.
1019  * @param[in] ignore_flag: Latency ignore flag.
1020  * @param[in] ignore_num: Number for ignore latency, only valid if ignore_flag is true.
1021 
1022  * @retval ::SDK_SUCCESS: Operation is Success.
1023  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
1024  ****************************************************************************************
1025  */
1026 uint16_t ble_gap_ignore_latency_set(uint8_t conn_idx, bool ignore_flag, uint8_t ignore_num);
1027 
1028 /**
1029  ****************************************************************************************
1030  * @brief Get adv address by connection index, only used for slave role.
1031  *
1032  * @param[in] conn_idx: The index of connection.
1033  * @param[in] p_adv_addr: Pointer to the adv address.
1034 
1035  * @retval ::SDK_SUCCESS: Operation is success.
1036  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
1037  * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
1038  ****************************************************************************************
1039  */
1040 uint16_t ble_gap_get_adv_addr_by_conidx(uint8_t conn_idx, uint8_t *p_adv_addr);
1041 
1042 /** @} */
1043 #endif
1044 /** @} */
1045 /** @} */
1046 /** @} */
ble_gap_evt_le_event_noti_report_t
Le event notification reporting info event for BLE_GAPC_EVT_LE_EVT_NOTI_REPORT.
Definition: ble_gapc.h:698
ble_gap_evt_conn_iq_report_t::rssi
int16_t rssi
Definition: ble_gapc.h:668
ble_gap_evt_le_event_noti_report_t::anchor_ts_hus
uint16_t anchor_ts_hus
Definition: ble_gapc.h:702
ble_gap_sync_established_ind_t::sync_hdl
uint16_t sync_hdl
Definition: ble_gapc.h:282
ble_gap_connless_iq_report_t::slot_dur
uint8_t slot_dur
Definition: ble_gapc.h:516
ble_gap_le_pkt_size_ind_t::max_rx_time
uint16_t max_rx_time
Definition: ble_gapc.h:454
ble_gap_per_sync_trans_param_t::cte_type
uint8_t cte_type
Definition: ble_gapc.h:504
ble_gap_le_pkt_size_ind_t::max_tx_octets
uint16_t max_tx_octets
Definition: ble_gapc.h:451
ble_gap_conn_iq_report_t::cte_type
uint8_t cte_type
Definition: ble_gapc.h:559
ble_gap_ext_adv_report_ind_t::adv_sid
uint8_t adv_sid
Definition: ble_gapc.h:299
BLE_GAP_PATH_LOSS_MID
@ BLE_GAP_PATH_LOSS_MID
Definition: ble_gapc.h:249
BLE_GAP_SLOT_1US
@ BLE_GAP_SLOT_1US
Definition: ble_gapc.h:199
ble_gap_latency_get
uint16_t ble_gap_latency_get(uint8_t conn_idx, uint16_t *latency)
Get connection's Latency.
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:123
BLE_GAP_ADDR_TYPE_RANDOM_STATIC
@ BLE_GAP_ADDR_TYPE_RANDOM_STATIC
Definition: ble_gapc.h:95
ble_gapc_set_dev_info_t::appearance
uint16_t appearance
Definition: ble_gapc.h:484
ble_gapc_set_dev_info_t
Device information data struct.
Definition: ble_gapc.h:482
ble_gap_evt_peer_info_t::peer_info
ble_gap_peer_info_t peer_info
Definition: ble_gapc.h:618
ble_gap_sync_established_ind_t
Sync established indication.
Definition: ble_gapc.h:276
ble_gap_peer_features_ind_t
LE features info.
Definition: ble_gapc.h:394
BLE_GAP_MAX_IQ_SAMPLE_NUM
#define BLE_GAP_MAX_IQ_SAMPLE_NUM
Definition: ble_gapc.h:82
ble_gap_evt_connected_t
Connection complete event for BLE_GAPC_EVT_CONNECTED.
Definition: ble_gapc.h:588
ble_gap_peer_info_t::peer_features
ble_gap_peer_features_ind_t peer_features
Definition: ble_gapc.h:438
ble_gap_evt_peer_name_get_t::peer_addr
ble_gap_addr_t peer_addr
Definition: ble_gapc.h:608
ble_gap_conn_iq_report_t::con_evt_cnt
uint16_t con_evt_cnt
Definition: ble_gapc.h:562
ble_gap_connless_iq_report_t::nb_samples
uint8_t nb_samples
Definition: ble_gapc.h:519
ble_gap_evt_dev_info_set_t::info
ble_gapc_set_dev_info_t info
Definition: ble_gapc.h:660
ble_gapc_evt_t::phy_update
ble_gap_evt_phy_update_t phy_update
Definition: ble_gapc.h:712
gap_conn_cmp_t::conhdl
uint16_t conhdl
Definition: ble_gapc.h:341
gap_conn_cmp_t::ll_role
ble_gap_ll_role_type_t ll_role
Definition: ble_gapc.h:349
ble_gapc_evt_t::disconnected
ble_gap_evt_disconnected_t disconnected
Definition: ble_gapc.h:714
ble_gap_ext_adv_report_ind_t::per_sync_idx
uint8_t per_sync_idx
Definition: ble_gapc.h:301
BLE_GAP_CTE_TYPE_AOD_1US
@ BLE_GAP_CTE_TYPE_AOD_1US
Definition: ble_gapc.h:190
ble_gap_conn_iq_report_t::rssi_antenna_id
uint8_t rssi_antenna_id
Definition: ble_gapc.h:558
ble_gap_ext_adv_report_ind_t::phy_second
uint8_t phy_second
Definition: ble_gapc.h:298
ble_gap_conn_update_param_t::interval_max
uint16_t interval_max
Definition: ble_gapc.h:330
BLE_GAP_GET_PEER_FEATURES
@ BLE_GAP_GET_PEER_FEATURES
Definition: ble_gapc.h:133
ble_gap_addr_t
The struct of address.
Definition: ble_gapc.h:263
ble_gap_dev_name_ind_t
GAP Device name struct.
Definition: ble_gapc.h:475
ble_gap_peer_version_ind_t
Peer version info.
Definition: ble_gapc.h:385
ble_gap_conn_param_t::slave_latency
uint16_t slave_latency
Definition: ble_gapc.h:321
ble_gap_conn_info_t::rssi
int8_t rssi
Definition: ble_gapc.h:369
ble_gap_peer_version_ind_t::lmp_vers
uint8_t lmp_vers
Definition: ble_gapc.h:388
ble_gap_conn_iq_report_t::slot_dur
uint8_t slot_dur
Definition: ble_gapc.h:560
ble_gap_conn_param_t::sup_timeout
uint16_t sup_timeout
Definition: ble_gapc.h:322
ble_gap_evt_connected_t::sup_timeout
uint16_t sup_timeout
Definition: ble_gapc.h:592
ble_gap_per_sync_trans_param_t
Default periodic advertising synchronization transfer parameters.
Definition: ble_gapc.h:499
ble_gap_evt_disconnected_t
Disconnection event for BLE_GAPC_EVT_DISCONNECTED.
Definition: ble_gapc.h:601
ble_gap_con_plan_tag_t
The Structure for BLE Connection Arrangement.
Definition: ble_gapc.h:459
ble_gap_ext_adv_report_ind_t::adv_type
uint8_t adv_type
Definition: ble_gapc.h:291
ble_gap_set_path_loss_report_param_t::high_thr
uint8_t high_thr
Definition: ble_gapc.h:572
ble_gapc_evt_t::peer_info
ble_gap_evt_peer_info_t peer_info
Definition: ble_gapc.h:716
BLE_GAP_GET_PHY
@ BLE_GAP_GET_PHY
Definition: ble_gapc.h:126
ble_gap_evt_connless_iq_report_t::slot_dur
uint8_t slot_dur
Definition: ble_gapc.h:687
ble_gapc_evt_t::conn_iq_report
ble_gap_evt_conn_iq_report_t conn_iq_report
Definition: ble_gapc.h:722
BLE_GAP_GET_PEER_VERSION
@ BLE_GAP_GET_PEER_VERSION
Definition: ble_gapc.h:132
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:102
ble_gap_evt_peer_info_t
Get peer info event for BLE_GAPC_EVT_PEER_INFO_GOT.
Definition: ble_gapc.h:616
ble_gap_set_conn_cte_req_enable_t::cte_req_type
uint8_t cte_req_type
Definition: ble_gapc.h:549
ble_gap_evt_data_length_t::max_rx_time
uint16_t max_rx_time
Definition: ble_gapc.h:653
ble_gap_bdaddr_t
The struct of broadcast address with broadcast type.
Definition: ble_gapc.h:269
ble_gap_evt_dev_info_set_t::info_type
ble_gap_dev_info_type_t info_type
Definition: ble_gapc.h:659
ble_gap_peer_info_t
LE peer info.
Definition: ble_gapc.h:436
ble_gap_le_phy_ind_t::rx_phy
uint8_t rx_phy
Definition: ble_gapc.h:363
ble_gap_sync_established_ind_t::serv_data
uint16_t serv_data
Definition: ble_gapc.h:283
ble_gap_evt_phy_update_t
PHY update event for BLE_GAPC_EVT_PHY_UPDATED.
Definition: ble_gapc.h:581
ble_gap_switching_sampling_type_t
ble_gap_switching_sampling_type_t
Type of switching and sampling slots.
Definition: ble_gapc.h:198
ble_gap_conn_update_param_t::interval_min
uint16_t interval_min
Definition: ble_gapc.h:328
ble_gap_phy_type_t
ble_gap_phy_type_t
Phy for power control management.
Definition: ble_gapc.h:218
ble_gap_evt_conn_iq_report_t::nb_samples
uint8_t nb_samples
Definition: ble_gapc.h:674
BLE_GAP_PHY_CODED_S2
@ BLE_GAP_PHY_CODED_S2
Definition: ble_gapc.h:223
BLE_GAP_PATH_LOSS_LOW
@ BLE_GAP_PATH_LOSS_LOW
Definition: ble_gapc.h:248
BLE_GAP_PHY_LE_CODED
@ BLE_GAP_PHY_LE_CODED
LE Coded PHY preferred for an active link.
Definition: ble_gapc.h:110
ble_gap_set_conn_cte_trans_param_t::antenna_id
uint8_t * antenna_id
Definition: ble_gapc.h:530
ble_gap_ext_adv_report_ind_t::length
uint16_t length
Definition: ble_gapc.h:302
ble_gap_evt_peer_name_get_t
Name of peer device indication event for BLE_GAPC_EVT_PEER_NAME_GOT.
Definition: ble_gapc.h:607
BLE_GAP_PWR_MAX_LVL
@ BLE_GAP_PWR_MAX_LVL
Definition: ble_gapc.h:242
ble_gap_psm_manager_op_id_t
ble_gap_psm_manager_op_id_t
Operation code used for LEPSM manager.
Definition: ble_gapc.h:172
ble_gap_connless_iq_report_t::channel_idx
uint8_t channel_idx
Definition: ble_gapc.h:512
gap_conn_cmp_t::peer_addr
ble_gap_addr_t peer_addr
Definition: ble_gapc.h:348
ble_gap_peer_version_ind_t::lmp_subvers
uint16_t lmp_subvers
Definition: ble_gapc.h:387
ble_gap_per_sync_trans_param_t::mode
uint8_t mode
Definition: ble_gapc.h:500
ble_gap_con_plan_tag_t::interval
uint32_t interval
Definition: ble_gapc.h:461
ble_gap_conn_link_num_get
uint8_t ble_gap_conn_link_num_get(void)
Get connection link number.
ble_gap_evt_connless_iq_report_t::pkt_status
uint8_t pkt_status
Definition: ble_gapc.h:688
ble_gap_cte_type_t
ble_gap_cte_type_t
Type of constant tone extension.
Definition: ble_gapc.h:188
ble_gap_conn_update_cmp_t::sup_timeout
uint16_t sup_timeout
Definition: ble_gapc.h:311
ble_gap_evt_connless_iq_report_t::rssi_antenna_id
uint8_t rssi_antenna_id
Definition: ble_gapc.h:685
BLE_GAP_PWR_REMOTE_TX_CHG
@ BLE_GAP_PWR_REMOTE_TX_CHG
Definition: ble_gapc.h:232
ble_gapc_evt_t::peer_name
ble_gap_evt_peer_name_get_t peer_name
Definition: ble_gapc.h:715
BLE_GAP_PHY_OPT_S8_CODING
@ BLE_GAP_PHY_OPT_S8_CODING
Definition: ble_gapc.h:118
ble_gap_conn_info_t::chnl_map
ble_gap_chnl_map_t chnl_map
Definition: ble_gapc.h:370
ble_gap_set_conn_cte_rcv_param_t::antenna_id
uint8_t * antenna_id
Definition: ble_gapc.h:539
ble_gapc_evt_t::dev_info_ind
ble_gap_evt_dev_info_set_t dev_info_ind
Definition: ble_gapc.h:721
gr5405_sys_cfg.h
Define the chip configuration.
BLE_GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES
@ BLE_GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES
Definition: ble_gapc.h:161
ble_gap_conn_iq_report_t::rx_phy
uint8_t rx_phy
Definition: ble_gapc.h:555
ble_gap_le_pkt_size_ind_t
Supported data length size Indication.
Definition: ble_gapc.h:450
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_gapc_evt_t::le_evt_noti_report
ble_gap_evt_le_event_noti_report_t le_evt_noti_report
Definition: ble_gapc.h:724
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.
gap_conn_cmp_t::clk_accuracy
uint8_t clk_accuracy
Definition: ble_gapc.h:345
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_conn_update_cmp_t::latency
uint16_t latency
Definition: ble_gapc.h:310
ble_gap_set_conn_cte_trans_param_t::num_antenna
uint8_t num_antenna
Definition: ble_gapc.h:529
ble_gap_peer_info_param_t
Get peer info operation struct.
Definition: ble_gapc.h:443
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:463
BLE_GAP_SLOT_2US
@ BLE_GAP_SLOT_2US
Definition: ble_gapc.h:200
ble_gapc_evt_t::conn_param_update_req
ble_gap_evt_conn_param_update_req_t conn_param_update_req
Definition: ble_gapc.h:718
ble_gap_set_pref_slave_evt_dur_param_t
Set preference slave event duration.
Definition: ble_gapc.h:468
ble_gap_con_plan_tag_t::conn_idx
uint16_t conn_idx
Definition: ble_gapc.h:460
ble_gap_evt_connected_t::peer_addr_type
uint8_t peer_addr_type
Definition: ble_gapc.h:594
ble_gap_conn_iq_report_t::nb_samples
uint8_t nb_samples
Definition: ble_gapc.h:563
gap_conn_cmp_t::peer_addr_type
uint8_t peer_addr_type
Definition: ble_gapc.h:347
ble_gapc_evt_t::conn_param_updated
ble_gap_evt_conn_param_updated_t conn_param_updated
Definition: ble_gapc.h:717
BLE_GAP_CTE_TYPE_AOA
@ BLE_GAP_CTE_TYPE_AOA
Definition: ble_gapc.h:189
BLE_GAP_OPCODE_CHNL_MAP_SET
@ BLE_GAP_OPCODE_CHNL_MAP_SET
Definition: ble_gapc.h:148
ble_gap_sync_established_ind_t::bd_addr
ble_gap_bdaddr_t bd_addr
Definition: ble_gapc.h:281
ble_gap_conn_info_t
Connection info.
Definition: ble_gapc.h:368
BLE_GAP_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED
@ BLE_GAP_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED
Definition: ble_gapc.h:164
ble_gap_evt_conn_param_updated_t::conn_interval
uint16_t conn_interval
Definition: ble_gapc.h:624
ble_gap_tx_pwr_change_report_reason_t
ble_gap_tx_pwr_change_report_reason_t
Transmit power change reporting reason.
Definition: ble_gapc.h:230
ble_gap_conn_cte_trans_param_set
uint16_t ble_gap_conn_cte_trans_param_set(uint8_t conn_idx, ble_gap_set_conn_cte_trans_param_t *param)
Set connection CTE transmit parameters.
ble_gap_evt_le_event_noti_report_t::rssi
int8_t rssi
Definition: ble_gapc.h:699
ble_gap_conn_param_t::interval_min
uint16_t interval_min
Definition: ble_gapc.h:317
ble_gap_evt_conn_iq_report_t::cte_type
uint8_t cte_type
Definition: ble_gapc.h:670
ble_gap_evt_connless_iq_report_t::rssi
int16_t rssi
Definition: ble_gapc.h:684
ble_gap_evt_conn_info_t
Get Connection info event for BLE_GAPC_EVT_CONN_INFO_GOT.
Definition: ble_gapc.h:642
ble_gap_connless_iq_report_t::rssi
int16_t rssi
Definition: ble_gapc.h:513
ble_gap_connless_iq_report_t::rssi_antenna_id
uint8_t rssi_antenna_id
Definition: ble_gapc.h:514
ble_gap_conn_cte_req_enable_set
uint16_t ble_gap_conn_cte_req_enable_set(uint8_t conn_idx, bool enable_flag, ble_gap_set_conn_cte_req_enable_t *param)
Set connection CTE request enable.
gap_conn_cmp_t
Connection complete info.
Definition: ble_gapc.h:340
ble_gapc_evt_t::connected
ble_gap_evt_connected_t connected
Definition: ble_gapc.h:713
ble_gap_evt_data_length_t::max_tx_octets
uint16_t max_tx_octets
Definition: ble_gapc.h:650
BLE_GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF
@ BLE_GAP_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF
Definition: ble_gapc.h:162
BLE_GAP_PHY_OPT_S2_CODING
@ BLE_GAP_PHY_OPT_S2_CODING
Definition: ble_gapc.h:117
ble_gap_set_conn_cte_req_enable_t::cte_req_len
uint8_t cte_req_len
Definition: ble_gapc.h:548
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:623
ble_gap_per_sync_trans_param_t::skip
uint16_t skip
Definition: ble_gapc.h:501
ble_gap_evt_data_length_t::max_rx_octets
uint16_t max_rx_octets
Definition: ble_gapc.h:652
ble_gap_set_path_loss_report_param_t::min_conn_evt_num
uint16_t min_conn_evt_num
Definition: ble_gapc.h:576
BLE_GAP_PATH_LOSS_HIGH
@ BLE_GAP_PATH_LOSS_HIGH
Definition: ble_gapc.h:250
ble_gap_ext_adv_report_ind_t
APP receives the extended advertising report indication info struct.
Definition: ble_gapc.h:290
BLE_GAP_PHY_CODED_S8
@ BLE_GAP_PHY_CODED_S8
Definition: ble_gapc.h:222
BLE_GAP_ADDR_TYPE_PUBLIC
@ BLE_GAP_ADDR_TYPE_PUBLIC
Definition: ble_gapc.h:94
ble_gap_evt_conn_param_update_req_t::interval_max
uint16_t interval_max
Definition: ble_gapc.h:634
ble_gap_evt_conn_iq_report_t::con_evt_cnt
uint16_t con_evt_cnt
Definition: ble_gapc.h:673
ble_gap_evt_conn_param_update_req_t::slave_latency
uint16_t slave_latency
Definition: ble_gapc.h:636
ble_gap_evt_conn_param_updated_t::slave_latency
uint16_t slave_latency
Definition: ble_gapc.h:625
ble_gap_phy_options_t
ble_gap_phy_options_t
The phy options.
Definition: ble_gapc.h:115
ble_gap_evt_conn_iq_report_t::rssi_antenna_id
uint8_t rssi_antenna_id
Definition: ble_gapc.h:669
ble_gap_evt_connless_iq_report_t::channel_idx
uint8_t channel_idx
Definition: ble_gapc.h:683
ble_gap_evt_le_event_noti_report_t::anchor_ts_hs
uint32_t anchor_ts_hs
Definition: ble_gapc.h:703
ble_gap_bdaddr_t::addr_type
uint8_t addr_type
Definition: ble_gapc.h:271
ble_gap_conn_param_t
The parameter of connection.
Definition: ble_gapc.h:316
ble_gap_ext_adv_report_ind_t::rssi
int8_t rssi
Definition: ble_gapc.h:296
ble_gap_sync_established_ind_t::phy
uint8_t phy
Definition: ble_gapc.h:277
ble_gap_set_conn_cte_rcv_param_t::num_antenna
uint8_t num_antenna
Definition: ble_gapc.h:538
BLE_GAP_PHY_LE_1MBPS
@ BLE_GAP_PHY_LE_1MBPS
LE 1M PHY preferred for an active link.
Definition: ble_gapc.h:106
ble_error.h
File that contains error codes.
BLE_GAP_FEATS_LEN
#define BLE_GAP_FEATS_LEN
Definition: ble_gapc.h:69
ble_gap_evt_conn_iq_report_t::pkt_status
uint8_t pkt_status
Definition: ble_gapc.h:672
ble_gap_evt_conn_iq_report_t::rx_phy
uint8_t rx_phy
Definition: ble_gapc.h:666
ble_gap_conn_update_param_t
The parameter of update connection.
Definition: ble_gapc.h:327
ble_gap_addr_type_t
ble_gap_addr_type_t
The identity address type.
Definition: ble_gapc.h:93
BLE_GAP_OPCODE_LEPSM_REGISTER
@ BLE_GAP_OPCODE_LEPSM_REGISTER
Definition: ble_gapc.h:173
ble_gap_evt_connless_iq_report_t::nb_samples
uint8_t nb_samples
Definition: ble_gapc.h:690
ble_gap_bond_dev_addr_get
uint16_t ble_gap_bond_dev_addr_get(uint8_t conn_idx, ble_gap_bdaddr_t *p_peer_addr)
Get BD address of the bonded device.
ble_gap_evt_le_event_noti_report_t::event_counter
uint16_t event_counter
Definition: ble_gapc.h:701
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:602
BLE_GAP_HCI_UNSUPPORTED_REMOTE_FEATURE
@ BLE_GAP_HCI_UNSUPPORTED_REMOTE_FEATURE
Definition: ble_gapc.h:163
ble_gap_evt_connected_t::peer_addr
ble_gap_addr_t peer_addr
Definition: ble_gapc.h:595
ble_gap_evt_connected_t::clk_accuracy
uint8_t clk_accuracy
Definition: ble_gapc.h:593
ble_gap_evt_peer_info_t::opcode
uint8_t opcode
Definition: ble_gapc.h:617
ble_gap_set_conn_cte_req_enable_t
Set connection CTE Request enable info.
Definition: ble_gapc.h:544
ble_gap_le_pkt_size_ind_t::max_rx_octets
uint16_t max_rx_octets
Definition: ble_gapc.h:453
ble_gap_evt_conn_param_update_req_t::sup_timeout
uint16_t sup_timeout
Definition: ble_gapc.h:637
ble_gap_evt_conn_param_updated_t::sup_timeout
uint16_t sup_timeout
Definition: ble_gapc.h:626
BLE_GAP_CRC_ERR2
@ BLE_GAP_CRC_ERR2
Definition: ble_gapc.h:210
BLE_GAP_OPCODE_LEPSM_UNREGISTER
@ BLE_GAP_OPCODE_LEPSM_UNREGISTER
Definition: ble_gapc.h:174
ble_gap_conn_iq_report_t
Connection IQ Report info.
Definition: ble_gapc.h:554
__ARRAY_EMPTY
#define __ARRAY_EMPTY
Definition: gr5405_sys_cfg.h:53
ble_gap_connless_iq_report_t::cte_type
uint8_t cte_type
Definition: ble_gapc.h:515
ble_gap_set_path_loss_report_param_t::low_thr
uint8_t low_thr
Definition: ble_gapc.h:574
ble_gap_conn_cte_recv_param_set
uint16_t ble_gap_conn_cte_recv_param_set(uint8_t conn_idx, ble_gap_set_conn_cte_rcv_param_t *param)
Set connection CTE receive parameters.
gapc_set_dev_info_ind_t::info
ble_gapc_set_dev_info_t info
Definition: ble_gapc.h:492
BLE_GAP_PWR_MIN_LVL
@ BLE_GAP_PWR_MIN_LVL
Definition: ble_gapc.h:241
ble_gap_conn_info_t::chan_sel_algo
uint8_t chan_sel_algo
Definition: ble_gapc.h:372
ble_gap_peer_info_param_t::peer_info
ble_gap_peer_info_t peer_info
Definition: ble_gapc.h:445
BLE_GAP_OPCODE_PER_ADV_LIST_SET
@ BLE_GAP_OPCODE_PER_ADV_LIST_SET
Definition: ble_gapc.h:150
BLE_GAP_OPCODE_WHITELIST_SET
@ BLE_GAP_OPCODE_WHITELIST_SET
Definition: ble_gapc.h:149
ble_gap_update_conn_param_method_set
uint16_t ble_gap_update_conn_param_method_set(uint8_t conn_idx, bool use_l2cap_flag)
Set the method for updating connection parameter.
gapc_set_dev_info_ind_t
GAP Device inforamtion write indication.
Definition: ble_gapc.h:490
ble_gap_ext_adv_report_ind_t::broadcaster_addr
ble_gap_bdaddr_t broadcaster_addr
Definition: ble_gapc.h:293
gapc_set_dev_info_ind_t::info_type
ble_gap_dev_info_type_t info_type
Definition: ble_gapc.h:491
ble_gap_evt_connected_t::conn_interval
uint16_t conn_interval
Definition: ble_gapc.h:590
ble_gap_set_path_loss_report_param_t::low_hyst
uint8_t low_hyst
Definition: ble_gapc.h:575
BLE_GAP_HCI_CONN_INTERVAL_UNACCEPTABLE
@ BLE_GAP_HCI_CONN_INTERVAL_UNACCEPTABLE
Definition: ble_gapc.h:165
BLE_GAP_ADDR_LEN
#define BLE_GAP_ADDR_LEN
Definition: ble_gapc.h:70
ble_gap_ext_adv_report_ind_t::direct_addr
ble_gap_bdaddr_t direct_addr
Definition: ble_gapc.h:294
ble_gap_connless_iq_report_t::pa_evt_cnt
uint16_t pa_evt_cnt
Definition: ble_gapc.h:518
gap_conn_cmp_t::con_latency
uint16_t con_latency
Definition: ble_gapc.h:343
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_set_conn_cte_rcv_param_t
Set connection CTE receive parameters info.
Definition: ble_gapc.h:535
ble_gap_conn_update_cmp_t
Connection parameter used to update connection parameters.
Definition: ble_gapc.h:308
ble_gap_conn_info_param_t
The info of connecting operation.
Definition: ble_gapc.h:378
ble_gap_evt_data_length_t
Data Length Updated event for BLE_GAPC_EVT_DATA_LENGTH_UPDATED.
Definition: ble_gapc.h:649
ble_gap_conn_update_param_t::slave_latency
uint16_t slave_latency
Definition: ble_gapc.h:332
ble_gap_conn_cte_rsp_enable_set
uint16_t ble_gap_conn_cte_rsp_enable_set(uint8_t conn_idx, bool enable_flag)
Set connection CTE response enable.
ble_gap_evt_conn_iq_report_t
Connection IQ Report info event for BLE_GAPC_EVT_CONNECT_IQ_REPORT.
Definition: ble_gapc.h:665
ble_gap_connless_iq_report_t
Connectionless IQ Report info.
Definition: ble_gapc.h:511
BLE_GAP_PWR_MID_LVL
@ BLE_GAP_PWR_MID_LVL
Definition: ble_gapc.h:240
ble_gap_conn_info_t::phy
ble_gap_le_phy_ind_t phy
Definition: ble_gapc.h:371
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:147
BLE_GAP_CTE_TYPE_AOD_2US
@ BLE_GAP_CTE_TYPE_AOD_2US
Definition: ble_gapc.h:191
ble_gapc_set_dev_info_t::dev_name
ble_gap_dev_name_ind_t dev_name
Definition: ble_gapc.h:483
ble_gap_evt_connected_t::ll_role
ble_gap_ll_role_type_t ll_role
Definition: ble_gapc.h:596
BLE_GAPC_DEV_NAME
@ BLE_GAPC_DEV_NAME
Definition: ble_gapc.h:180
ble_gapc_evt_t
BLE GAPC event structure.
Definition: ble_gapc.h:708
ble_gapc_evt_t::connless_iq_report
ble_gap_evt_connless_iq_report_t connless_iq_report
Definition: ble_gapc.h:723
ble_gap_le_phy_ind_t::tx_phy
uint8_t tx_phy
Definition: ble_gapc.h:362
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_dev_name_ind_t::length
uint16_t length
Definition: ble_gapc.h:476
ble_gap_peer_version_ind_t::compid
uint16_t compid
Definition: ble_gapc.h:386
gap_conn_cmp_t::con_interval
uint16_t con_interval
Definition: ble_gapc.h:342
ble_gap_dev_info_type_t
ble_gap_dev_info_type_t
GAP Device inforamtion write indication.
Definition: ble_gapc.h:179
ble_gap_evt_conn_iq_report_t::slot_dur
uint8_t slot_dur
Definition: ble_gapc.h:671
ble_gap_evt_dev_info_set_t
Device Information set event for BLE_GAPC_EVT_DEV_INFO_SET.
Definition: ble_gapc.h:658
ble_gap_disconn_reason_t
ble_gap_disconn_reason_t
The specified reason for terminating a connection.
Definition: ble_gapc.h:158
ble_gap_conn_update_cmp_t::interval
uint16_t interval
Definition: ble_gapc.h:309
ble_gap_con_plan_tag_t::offset
uint32_t offset
Definition: ble_gapc.h:462
ble_gap_conn_info_param_t::info
ble_gap_conn_info_t info
Definition: ble_gapc.h:380
BLE_GAP_CRC_ERR1
@ BLE_GAP_CRC_ERR1
Definition: ble_gapc.h:209
ble_gap_le_phy_ind_t
PHY info.
Definition: ble_gapc.h:361
ble_gap_conn_info_param_t::opcode
uint8_t opcode
Definition: ble_gapc.h:379
gap_conn_cmp_t::sup_to
uint16_t sup_to
Definition: ble_gapc.h:344
ble_gap_conn_iq_report_t::data_channel_idx
uint8_t data_channel_idx
Definition: ble_gapc.h:556
ble_gap_sync_established_ind_t::clk_acc
uint8_t clk_acc
Definition: ble_gapc.h:280
ble_gap_peer_info_param_t::opcode
uint8_t opcode
Definition: ble_gapc.h:444
ble_gap_evt_peer_name_get_t::name
uint8_t * name
Definition: ble_gapc.h:611
ble_gap_le_event_noti_report_enable_set
uint16_t ble_gap_le_event_noti_report_enable_set(uint8_t conn_idx, bool enable_flag)
Enable or disable the reporting of LE event notification.
ble_gap_ll_role_type_t
ble_gap_ll_role_type_t
Device role of LL layer type.
Definition: ble_gapc.h:138
ble_gap_evt_connected_t::slave_latency
uint16_t slave_latency
Definition: ble_gapc.h:591
ble_gap_evt_data_length_t::max_tx_time
uint16_t max_tx_time
Definition: ble_gapc.h:651
ble_gap_ext_adv_report_ind_t::adv_info
uint8_t adv_info
Definition: ble_gapc.h:292
ble_gap_evt_conn_info_t::opcode
uint8_t opcode
Definition: ble_gapc.h:643
BLE_GAP_PHY_OPT_NO_CODING
@ BLE_GAP_PHY_OPT_NO_CODING
Definition: ble_gapc.h:116
ble_gap_per_sync_trans_param_t::sync_to
uint16_t sync_to
Definition: ble_gapc.h:503
BLE_GAP_LL_ROLE_SLAVE
@ BLE_GAP_LL_ROLE_SLAVE
Definition: ble_gapc.h:140
BLE_GAP_PHY_LE_2MBPS
@ BLE_GAP_PHY_LE_2MBPS
LE 2M PHY preferred for an active link.
Definition: ble_gapc.h:108
ble_gap_conn_param_t::interval_max
uint16_t interval_max
Definition: ble_gapc.h:319
BLE_GAPC_DEV_APPEARANCE
@ BLE_GAPC_DEV_APPEARANCE
Definition: ble_gapc.h:181
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:131
ble_gap_set_conn_cte_trans_param_t
Set connection CTE transmit parameters info.
Definition: ble_gapc.h:527
ble_gap_conn_iq_report_t::pkt_status
uint8_t pkt_status
Definition: ble_gapc.h:561
BLE_GAP_PHY_CODED
@ BLE_GAP_PHY_CODED
Definition: ble_gapc.h:221
ble_gap_evt_conn_param_update_req_t::interval_min
uint16_t interval_min
Definition: ble_gapc.h:632
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:631
ble_gap_ext_adv_report_ind_t::period_adv_intv
uint16_t period_adv_intv
Definition: ble_gapc.h:300
BLE_GAP_LL_ROLE_MASTER
@ BLE_GAP_LL_ROLE_MASTER
Definition: ble_gapc.h:139
ble_gap_evt_phy_update_t::tx_phy
uint8_t tx_phy
Definition: ble_gapc.h:582
BLE_GAP_PWR_LOCAL_TX_CHG
@ BLE_GAP_PWR_LOCAL_TX_CHG
Definition: ble_gapc.h:231
BLE_GAP_INSUFFI_RESOURCE
@ BLE_GAP_INSUFFI_RESOURCE
Definition: ble_gapc.h:211
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:333
ble_gap_peer_info_t::peer_version
ble_gap_peer_version_ind_t peer_version
Definition: ble_gapc.h:437
BLE_GAP_CRC_OK
@ BLE_GAP_CRC_OK
Definition: ble_gapc.h:208
ble_gap_set_pref_slave_evt_dur_param_t::single_tx
uint8_t single_tx
Definition: ble_gapc.h:470
ble_gap_set_conn_cte_rcv_param_t::slot_durations
uint8_t slot_durations
Definition: ble_gapc.h:537
ble_gap_evt_conn_iq_report_t::data_channel_idx
uint8_t data_channel_idx
Definition: ble_gapc.h:667
ble_gap_evt_conn_info_t::info
ble_gap_conn_info_t info
Definition: ble_gapc.h:644
ble_gap_get_adv_addr_by_conidx
uint16_t ble_gap_get_adv_addr_by_conidx(uint8_t conn_idx, uint8_t *p_adv_addr)
Get adv address by connection index, only used for slave role.
ble_gap_pwr_lvl_flag_t
ble_gap_pwr_lvl_flag_t
Transmit Power level flag.
Definition: ble_gapc.h:239
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_conn_iq_report_t::rssi
int16_t rssi
Definition: ble_gapc.h:557
ble_gap_bdaddr_t::gap_addr
ble_gap_addr_t gap_addr
Definition: ble_gapc.h:270
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_evt_connless_iq_report_t::cte_type
uint8_t cte_type
Definition: ble_gapc.h:686
ble_gap_evt_le_event_noti_report_t::channel
uint8_t channel
Definition: ble_gapc.h:700
ble_gap_set_conn_cte_req_enable_t::cte_req_interval
uint16_t cte_req_interval
Definition: ble_gapc.h:545
BLE_GAP_HCI_AUTHENTICATION_FAILURE
@ BLE_GAP_HCI_AUTHENTICATION_FAILURE
Definition: ble_gapc.h:159
ble_gap_set_conn_cte_rcv_param_t::sampling_enable
bool sampling_enable
Definition: ble_gapc.h:536
ble_gap_chnl_map_t
Channel map structure.
Definition: ble_gapc.h:354
BLE_GAP_PHY_1M
@ BLE_GAP_PHY_1M
Definition: ble_gapc.h:219
ble_gapc_evt_t::data_length
ble_gap_evt_data_length_t data_length
Definition: ble_gapc.h:720
ble_gap_iq_report_status_t
ble_gap_iq_report_status_t
Status of IQ report packet.
Definition: ble_gapc.h:207
ble_gap_connless_iq_report_t::pkt_status
uint8_t pkt_status
Definition: ble_gapc.h:517
ble_gap_evt_peer_name_get_t::addr_type
uint8_t addr_type
Definition: ble_gapc.h:609
ble_gapc_evt_t::index
uint8_t index
Definition: ble_gapc.h:709
ble_gap_le_pkt_size_ind_t::max_tx_time
uint16_t max_tx_time
Definition: ble_gapc.h:452
ble_gap_conn_update_param_t::ce_len
uint16_t ce_len
Definition: ble_gapc.h:334
ble_gap_sync_established_ind_t::adv_sid
uint8_t adv_sid
Definition: ble_gapc.h:279
ble_gap_set_conn_cte_trans_param_t::cte_type
uint8_t cte_type
Definition: ble_gapc.h:528
ble_gap_path_loss_zone_t
ble_gap_path_loss_zone_t
Path Loss zones. HCI:7.8.118.
Definition: ble_gapc.h:247
ble_gap_set_path_loss_report_param_t
Set path loss reporting parameter info.
Definition: ble_gapc.h:571
ble_gap_ext_adv_report_ind_t::phy_prim
uint8_t phy_prim
Definition: ble_gapc.h:297
BLE_GAP_HCI_REMOTE_USER_TERMINATED_CONNECTION
@ BLE_GAP_HCI_REMOTE_USER_TERMINATED_CONNECTION
Definition: ble_gapc.h:160
BLE_GAP_GET_CON_RSSI
@ BLE_GAP_GET_CON_RSSI
Definition: ble_gapc.h:124
ble_gap_set_pref_slave_evt_dur_param_t::duration
uint16_t duration
Definition: ble_gapc.h:469
ble_gap_ignore_latency_set
uint16_t ble_gap_ignore_latency_set(uint8_t conn_idx, bool ignore_flag, uint8_t ignore_num)
Ignore latency with numbers indicated by ignore_num, after slave sending data.
ble_gap_evt_phy_update_t::rx_phy
uint8_t rx_phy
Definition: ble_gapc.h:583
ble_gap_ext_adv_report_ind_t::tx_pwr
int8_t tx_pwr
Definition: ble_gapc.h:295
BLE_GAP_PHY_ANY
@ BLE_GAP_PHY_ANY
No preferred PHY.
Definition: ble_gapc.h:104
ble_gap_set_path_loss_report_param_t::high_hyst
uint8_t high_hyst
Definition: ble_gapc.h:573
ble_gap_evt_connected_t::conn_handle
uint16_t conn_handle
Definition: ble_gapc.h:589
BLE_GAP_PHY_2M
@ BLE_GAP_PHY_2M
Definition: ble_gapc.h:220
ble_gapc_evt_t::conn_info
ble_gap_evt_conn_info_t conn_info
Definition: ble_gapc.h:719
BLE_GAP_GET_CON_CHANNEL_MAP
@ BLE_GAP_GET_CON_CHANNEL_MAP
Definition: ble_gapc.h:125
BLE_GAP_OPCODE_PRIVACY_MODE_SET
@ BLE_GAP_OPCODE_PRIVACY_MODE_SET
Definition: ble_gapc.h:151
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_connless_iq_report_t::pa_evt_cnt
uint16_t pa_evt_cnt
Definition: ble_gapc.h:689
ble_gap_evt_connless_iq_report_t
Connectionless IQ Report info event for BLE_GAPC_EVT_CONNECTLESS_IQ_REPORT.
Definition: ble_gapc.h:682
ble_gap_evt_peer_name_get_t::name_len
uint8_t name_len
Definition: ble_gapc.h:610
ble_gap_sync_established_ind_t::report_flag
bool report_flag
Definition: ble_gapc.h:284
ble_gap_sync_established_ind_t::intv
uint16_t intv
Definition: ble_gapc.h:278