| Airoha M0 BLE API 1.0.5.4

ble_gap.h
1 /******************************************************************************
2 Copyright (c) Airoha 2016 - All rights reserved
3
4 FILE NAME
5 ble_gap.h
6 DESCRIPTION
7 NOTES
8 ********************************************************************************/
9 #ifndef __BLE_GAP_HH
10 #define __BLE_GAP_HH
11 #include <stdint.h>
12 #include "platform.h"
13 #include "bt_constants.h"
14 #include "hci_constant.h"
26 /*************************************************************************
27 * Macro
28 *************************************************************************/
33 #define BLE_GAP_ROLE_MASTER 0x00
34 #define BLE_GAP_ROLE_SLAVE 0x01
35
42 #define BLE_GAP_AD_TYPE_FLAGS 0x01
43 #define BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE 0x02
44 #define BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_COMPLETE 0x03
45 #define BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE 0x04
46 #define BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_COMPLETE 0x05
47 #define BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE 0x06
48 #define BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE 0x07
49 #define BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME 0x08
50 #define BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME 0x09
51 #define BLE_GAP_AD_TYPE_TX_POWER_LEVEL 0x0A
52 #define BLE_GAP_AD_TYPE_CLASS_OF_DEVICE 0x0D
53 #define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C 0x0E
54 #define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R 0x0F
55 #define BLE_GAP_AD_TYPE_SECURITY_MANAGER_TK_VALUE 0x10
56 #define BLE_GAP_AD_TYPE_SECURITY_MANAGER_OOB_FLAGS 0x11
57 #define BLE_GAP_AD_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE 0x12
58 #define BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_16BIT 0x14
59 #define BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_128BIT 0x15
60 #define BLE_GAP_AD_TYPE_SERVICE_DATA 0x16
61 #define BLE_GAP_AD_TYPE_PUBLIC_TARGET_ADDRESS 0x17
62 #define BLE_GAP_AD_TYPE_RANDOM_TARGET_ADDRESS 0x18
63 #define BLE_GAP_AD_TYPE_APPEARANCE 0x19
64 #define BLE_GAP_AD_TYPE_ADVERTISING_INTERVAL 0x1A
65 #define BLE_GAP_AD_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS 0x1B
66 #define BLE_GAP_AD_TYPE_LE_ROLE 0x1C
67 #define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C256 0x1D
68 #define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R256 0x1E
69 #define BLE_GAP_AD_TYPE_SERVICE_DATA_32BIT_UUID 0x20
70 #define BLE_GAP_AD_TYPE_SERVICE_DATA_128BIT_UUID 0x21
71 #define BLE_GAP_AD_TYPE_UNIFORM_RESOUCE_IDENTIFIER 0x24
72 #define BLE_GAP_AD_TYPE_3D_INFORMATION_DATA 0x3D
73 #define BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA 0xFF
74
79 #define BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE (0x01)
80 #define BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE (0x02)
81 #define BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED (0x04)
82 #define BLE_GAP_ADV_FLAG_LE_BR_EDR_CONTROLLER (0x08)
83 #define BLE_GAP_ADV_FLAG_LE_BR_EDR_HOST (0x10)
84 #define BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE (BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED)
85 #define BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE (BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED)
86
93 #define BLE_ADV_INTERVAL_MIN 0x0020
94 #define BLE_ADV_NONCON_INTERVAL_MIN 0x00A0
95 #define BLE_ADV_INTERVAL_MAX 0x4000
96
102 #define BLE_SCAN_INTERVAL_MIN 0x0004
103 #define BLE_SCAN_INTERVAL_MAX 0x4000
104
111 #define BLE_SCAN_WINDOW_MIN 0x0004
112 #define BLE_SCAN_WINDOW_MAX 0x4000
113
120 #define BLE_SCAN_TIMEOUT_MIN 0x0001
121 #define BLE_SCAN_TIMEOUT_MAX 0xFFFF
122
129 #define BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE (0x01)
130 #define BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE (0x02)
131 #define BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED (0x04)
132 #define BLE_GAP_ADV_FLAG_LE_BR_EDR_CONTROLLER (0x08)
133 #define BLE_GAP_ADV_FLAG_LE_BR_EDR_HOST (0x10)
134 #define BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE (BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED)
135 #define BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE (BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED)
136
143 #define BLE_GAP_ADV_INTERVAL_MIN 0x0020
144 #define BLE_GAP_ADV_NONCON_INTERVAL_MIN 0x00A0
145 #define BLE_GAP_ADV_INTERVAL_MAX 0x4000
146
153 #define BLE_GAP_SCAN_INTERVAL_MIN 0x0004
154 #define BLE_GAP_SCAN_INTERVAL_MAX 0x4000
155
160 #define BLE_GAP_SCAN_WINDOW_MIN 0x0004
161 #define BLE_GAP_SCAN_WINDOW_MAX 0x4000
162
166 #define BLE_GAP_ADV_MAX_SIZE 31
167
168
173 #define BLE_GAP_ADDR_TYPE_PUBLIC 0x00
174 #define BLE_GAP_ADDR_TYPE_RANDOM 0x01
175
182 #define BLE_GAP_ADV_TYPE_ADV_IND 0x00
183 #define BLE_GAP_ADV_TYPE_ADV_DIRECT_IND 0x01
184 #define BLE_GAP_ADV_TYPE_ADV_SCAN_IND 0x02
185 #define BLE_GAP_ADV_TYPE_ADV_NONCONN_IND 0x03
186
193 #define BLE_GAP_ADV_CHANNEL_MAP_37 1
194 #define BLE_GAP_ADV_CHANNEL_MAP_38 2
195 #define BLE_GAP_ADV_CHANNEL_MAP_39 4
196 #define BLE_GAP_ADV_CHANNEL_MAP_ALL 7
197
204 #define BLE_GAP_ADV_FP_ANY 0x00
205 #define BLE_GAP_ADV_FP_FILTER_SCANREQ 0x01
206 #define BLE_GAP_ADV_FP_FILTER_CONNREQ 0x02
207 #define BLE_GAP_ADV_FP_FILTER_BOTH 0x03
208
214 #define BLE_CONN_HANDLE_INVALID 0xFFFF
215 #define BLE_CONN_HANDLE_ALL 0xFFFE
216
222 /* Generic UUIDs, applicable to all services */
223 #define BLE_UUID_UNKNOWN 0x0000
224 #define BLE_UUID_SERVICE_PRIMARY 0x2800
225 #define BLE_UUID_SERVICE_SECONDARY 0x2801
226 #define BLE_UUID_SERVICE_INCLUDE 0x2802
227 #define BLE_UUID_CHARACTERISTIC 0x2803
228 #define BLE_UUID_DESCRIPTOR_CHAR_EXT_PROP 0x2900
229 #define BLE_UUID_DESCRIPTOR_CHAR_USER_DESC 0x2901
230 #define BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG 0x2902
231 #define BLE_UUID_DESCRIPTOR_SERVER_CHAR_CONFIG 0x2903
232 #define BLE_UUID_DESCRIPTOR_CHAR_PRESENTATION_FORMAT 0x2904
233 #define BLE_UUID_DESCRIPTOR_CHAR_AGGREGATE_FORMAT 0x2905
234 /* GATT specific UUIDs */
235 #define BLE_UUID_GATT 0x1801
236 #define BLE_UUID_GATT_CHARACTERISTIC_SERVICE_CHANGED 0x2A05
237 /* GAP specific UUIDs */
238 #define BLE_UUID_GAP 0x1800
239 #define BLE_UUID_GAP_CHARACTERISTIC_DEVICE_NAME 0x2A00
240 #define BLE_UUID_GAP_CHARACTERISTIC_APPEARANCE 0x2A01
241 #define BLE_UUID_GAP_CHARACTERISTIC_PPF 0x2A02
242 #define BLE_UUID_GAP_CHARACTERISTIC_RECONN_ADDR 0x2A03
243 #define BLE_UUID_GAP_CHARACTERISTIC_PPCP 0x2A04
244
250 #define BLE_UUID_ALERT_NOTIFICATION_SERVICE 0x1811
251 #define BLE_UUID_BATTERY_SERVICE 0x180F
252 #define BLE_UUID_BLOOD_PRESSURE_SERVICE 0x1810
253 #define BLE_UUID_CURRENT_TIME_SERVICE 0x1805
254 #define BLE_UUID_CYCLING_SPEED_AND_CADENCE 0x1816
255 #define BLE_UUID_LOCATION_AND_NAVIGATION_SERVICE 0x1819
256 #define BLE_UUID_DEVICE_INFORMATION_SERVICE 0x180A
257 #define BLE_UUID_GLUCOSE_SERVICE 0x1808
258 #define BLE_UUID_HEALTH_THERMOMETER_SERVICE 0x1809
259 #define BLE_UUID_HEART_RATE_SERVICE 0x180D
260 #define BLE_UUID_HUMAN_INTERFACE_DEVICE_SERVICE 0x1812
261 #define BLE_UUID_IMMEDIATE_ALERT_SERVICE 0x1802
262 #define BLE_UUID_LINK_LOSS_SERVICE 0x1803
263 #define BLE_UUID_NEXT_DST_CHANGE_SERVICE 0x1807
264 #define BLE_UUID_PHONE_ALERT_STATUS_SERVICE 0x180E
265 #define BLE_UUID_REFERENCE_TIME_UPDATE_SERVICE 0x1806
266 #define BLE_UUID_RUNNING_SPEED_AND_CADENCE 0x1814
267 #define BLE_UUID_SCAN_PARAMETERS_SERVICE 0x1813
268 #define BLE_UUID_TX_POWER_SERVICE 0x1804
269 #define BLE_UUID_IPSP_SERVICE 0x1820
270 #define BLE_UUID_BMS_SERVICE 0x181E
271 #define BLE_UUID_CGM_SERVICE 0x181F
272 #define BLE_UUID_PLX_SERVICE 0x1822
273
274
281 #define BLE_UUID_REMOVABLE_CHAR 0x2A3A
282 #define BLE_UUID_SERVICE_REQUIRED_CHAR 0x2A3B
283 #define BLE_UUID_ALERT_CATEGORY_ID_CHAR 0x2A43
284 #define BLE_UUID_ALERT_CATEGORY_ID_BIT_MASK_CHAR 0x2A42
285 #define BLE_UUID_ALERT_LEVEL_CHAR 0x2A06
286 #define BLE_UUID_ALERT_NOTIFICATION_CONTROL_POINT_CHAR 0x2A44
287 #define BLE_UUID_ALERT_STATUS_CHAR 0x2A3F
288 #define BLE_UUID_BATTERY_LEVEL_CHAR 0x2A19
289 #define BLE_UUID_BLOOD_PRESSURE_FEATURE_CHAR 0x2A49
290 #define BLE_UUID_BLOOD_PRESSURE_MEASUREMENT_CHAR 0x2A35
291 #define BLE_UUID_BODY_SENSOR_LOCATION_CHAR 0x2A38
292 #define BLE_UUID_BOOT_KEYBOARD_INPUT_REPORT_CHAR 0x2A22
293 #define BLE_UUID_BOOT_KEYBOARD_OUTPUT_REPORT_CHAR 0x2A32
294 #define BLE_UUID_BOOT_MOUSE_INPUT_REPORT_CHAR 0x2A33
295 #define BLE_UUID_CURRENT_TIME_CHAR 0x2A2B
296 #define BLE_UUID_DATE_TIME_CHAR 0x2A08
297 #define BLE_UUID_DAY_DATE_TIME_CHAR 0x2A0A
298 #define BLE_UUID_DAY_OF_WEEK_CHAR 0x2A09
299 #define BLE_UUID_DST_OFFSET_CHAR 0x2A0D
300 #define BLE_UUID_EXACT_TIME_256_CHAR 0x2A0C
301 #define BLE_UUID_FIRMWARE_REVISION_STRING_CHAR 0x2A26
302 #define BLE_UUID_GLUCOSE_FEATURE_CHAR 0x2A51
303 #define BLE_UUID_GLUCOSE_MEASUREMENT_CHAR 0x2A18
304 #define BLE_UUID_GLUCOSE_MEASUREMENT_CONTEXT_CHAR 0x2A34
305 #define BLE_UUID_HARDWARE_REVISION_STRING_CHAR 0x2A27
306 #define BLE_UUID_HEART_RATE_CONTROL_POINT_CHAR 0x2A39
307 #define BLE_UUID_HEART_RATE_MEASUREMENT_CHAR 0x2A37
308 #define BLE_UUID_HID_CONTROL_POINT_CHAR 0x2A4C
309 #define BLE_UUID_HID_INFORMATION_CHAR 0x2A4A
310 #define BLE_UUID_IEEE_REGULATORY_CERTIFICATION_DATA_LIST_CHAR 0x2A2A
311 #define BLE_UUID_INTERMEDIATE_CUFF_PRESSURE_CHAR 0x2A36
312 #define BLE_UUID_INTERMEDIATE_TEMPERATURE_CHAR 0x2A1E
313 #define BLE_UUID_LOCAL_TIME_INFORMATION_CHAR 0x2A0F
314 #define BLE_UUID_MANUFACTURER_NAME_STRING_CHAR 0x2A29
315 #define BLE_UUID_MEASUREMENT_INTERVAL_CHAR 0x2A21
316 #define BLE_UUID_MODEL_NUMBER_STRING_CHAR 0x2A24
317 #define BLE_UUID_UNREAD_ALERT_CHAR 0x2A45
318 #define BLE_UUID_NEW_ALERT_CHAR 0x2A46
319 #define BLE_UUID_PNP_ID_CHAR 0x2A50
320 #define BLE_UUID_PROTOCOL_MODE_CHAR 0x2A4E
321 #define BLE_UUID_RECORD_ACCESS_CONTROL_POINT_CHAR 0x2A52
322 #define BLE_UUID_REFERENCE_TIME_INFORMATION_CHAR 0x2A14
323 #define BLE_UUID_REPORT_CHAR 0x2A4D
324 #define BLE_UUID_REPORT_MAP_CHAR 0x2A4B
325 #define BLE_UUID_RINGER_CONTROL_POINT_CHAR 0x2A40
326 #define BLE_UUID_RINGER_SETTING_CHAR 0x2A41
327 #define BLE_UUID_SCAN_INTERVAL_WINDOW_CHAR 0x2A4F
328 #define BLE_UUID_SCAN_REFRESH_CHAR 0x2A31
329 #define BLE_UUID_SERIAL_NUMBER_STRING_CHAR 0x2A25
330 #define BLE_UUID_SOFTWARE_REVISION_STRING_CHAR 0x2A28
331 #define BLE_UUID_SUPPORTED_NEW_ALERT_CATEGORY_CHAR 0x2A47
332 #define BLE_UUID_SUPPORTED_UNREAD_ALERT_CATEGORY_CHAR 0x2A48
333 #define BLE_UUID_SYSTEM_ID_CHAR 0x2A23
334 #define BLE_UUID_TEMPERATURE_MEASUREMENT_CHAR 0x2A1C
335 #define BLE_UUID_TEMPERATURE_TYPE_CHAR 0x2A1D
336 #define BLE_UUID_TIME_ACCURACY_CHAR 0x2A12
337 #define BLE_UUID_TIME_SOURCE_CHAR 0x2A13
338 #define BLE_UUID_TIME_UPDATE_CONTROL_POINT_CHAR 0x2A16
339 #define BLE_UUID_TIME_UPDATE_STATE_CHAR 0x2A17
340 #define BLE_UUID_TIME_WITH_DST_CHAR 0x2A11
341 #define BLE_UUID_TIME_ZONE_CHAR 0x2A0E
342 #define BLE_UUID_TX_POWER_LEVEL_CHAR 0x2A07
343 #define BLE_UUID_CSC_FEATURE_CHAR 0x2A5C
344 #define BLE_UUID_CSC_MEASUREMENT_CHAR 0x2A5B
345 #define BLE_UUID_RSC_FEATURE_CHAR 0x2A54
346 #define BLE_UUID_SC_CTRLPT_CHAR 0x2A55
347 #define BLE_UUID_RSC_MEASUREMENT_CHAR 0x2A53
348 #define BLE_UUID_SENSOR_LOCATION_CHAR 0x2A5D
349 #define BLE_UUID_EXTERNAL_REPORT_REF_DESCR 0x2907
350 #define BLE_UUID_REPORT_REF_DESCR 0x2908
351 #define BLE_UUID_LN_FEATURE_CHAR 0x2A6A
352 #define BLE_UUID_LN_POSITION_QUALITY_CHAR 0x2A69
353 #define BLE_UUID_LN_LOCATION_AND_SPEED_CHAR 0x2A67
354 #define BLE_UUID_LN_NAVIGATION_CHAR 0x2A68
355 #define BLE_UUID_LN_CONTROL_POINT_CHAR 0x2A6B
356 #define BLE_UUID_BMS_CTRLPT 0x2AA4
357 #define BLE_UUID_BMS_FEATURE 0x2AA5
358 #define BLE_UUID_CGM_MEASUREMENT 0x2AA7
359 #define BLE_UUID_CGM_FEATURE 0x2AA8
360 #define BLE_UUID_CGM_STATUS 0x2AA9
361 #define BLE_UUID_CGM_SESSION_START_TIME 0x2AAA
362 #define BLE_UUID_CGM_SESSION_RUN_TIME 0x2AAB
363 #define BLE_UUID_CGM_SPECIFIC_OPS_CTRLPT 0x2AAC
364 #define BLE_UUID_PLX_SPOT_CHECK_MEAS 0x2A5E
365 #define BLE_UUID_PLX_CONTINUOUS_MEAS 0x2A5F
366 #define BLE_UUID_PLX_FEATURES 0x2A60
367
368
374 #define BLE_APPEARANCE_UNKNOWN 0
375 #define BLE_APPEARANCE_GENERIC_PHONE 64
376 #define BLE_APPEARANCE_GENERIC_COMPUTER 128
377 #define BLE_APPEARANCE_GENERIC_WATCH 192
378 #define BLE_APPEARANCE_WATCH_SPORTS_WATCH 193
379 #define BLE_APPEARANCE_GENERIC_CLOCK 256
380 #define BLE_APPEARANCE_GENERIC_DISPLAY 320
381 #define BLE_APPEARANCE_GENERIC_REMOTE_CONTROL 384
382 #define BLE_APPEARANCE_GENERIC_EYE_GLASSES 448
383 #define BLE_APPEARANCE_GENERIC_TAG 512
384 #define BLE_APPEARANCE_GENERIC_KEYRING 576
385 #define BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 640
386 #define BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 704
387 #define BLE_APPEARANCE_GENERIC_THERMOMETER 768
388 #define BLE_APPEARANCE_THERMOMETER_EAR 769
389 #define BLE_APPEARANCE_GENERIC_HEART_RATE_SENSOR 832
390 #define BLE_APPEARANCE_HEART_RATE_SENSOR_HEART_RATE_BELT 833
391 #define BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 896
392 #define BLE_APPEARANCE_BLOOD_PRESSURE_ARM 897
393 #define BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 898
394 #define BLE_APPEARANCE_GENERIC_HID 960
395 #define BLE_APPEARANCE_HID_KEYBOARD 961
396 #define BLE_APPEARANCE_HID_MOUSE 962
397 #define BLE_APPEARANCE_HID_JOYSTICK 963
398 #define BLE_APPEARANCE_HID_GAMEPAD 964
399 #define BLE_APPEARANCE_HID_DIGITIZERSUBTYPE 965
400 #define BLE_APPEARANCE_HID_CARD_READER 966
401 #define BLE_APPEARANCE_HID_DIGITAL_PEN 967
402 #define BLE_APPEARANCE_HID_BARCODE 968
403 #define BLE_APPEARANCE_GENERIC_GLUCOSE_METER 1024
404 #define BLE_APPEARANCE_GENERIC_RUNNING_WALKING_SENSOR 1088
405 #define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_IN_SHOE 1089
406 #define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_SHOE 1090
407 #define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_HIP 1091
408 #define BLE_APPEARANCE_GENERIC_CYCLING 1152
409 #define BLE_APPEARANCE_CYCLING_CYCLING_COMPUTER 1153
410 #define BLE_APPEARANCE_CYCLING_SPEED_SENSOR 1154
411 #define BLE_APPEARANCE_CYCLING_CADENCE_SENSOR 1155
412 #define BLE_APPEARANCE_CYCLING_POWER_SENSOR 1156
413 #define BLE_APPEARANCE_CYCLING_SPEED_CADENCE_SENSOR 1157
414 #define BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 3136
415 #define BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 3137
416 #define BLE_APPEARANCE_PULSE_OXIMETER_WRIST_WORN 3138
417 #define BLE_APPEARANCE_GENERIC_WEIGHT_SCALE 3200
418 #define BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS_ACT 5184
419 #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_DISP 5185
420 #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_DISP 5186
421 #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_POD 5187
422 #define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_POD 5188
423
425 #define HIGH_BYTE(x) ((uint8_t)(((x)&0xFF00)>>8))
426 #define LOW_BYTE(x) ((uint8_t)((x)&0x00FF))
427
428
429 /*************************************************************************
430 * Type Define
431 *************************************************************************/
437 typedef void (*ai_cfm_gap_general)(bool isuccess, uint8_t err_code);
438
439 #ifdef _MSC_VER
440 __pragma(pack(push, 1))
441 #define __attribute__(x)
442 #endif
443
444
449 typedef enum
450 {
451 ble_addr_type_public = 0,
452 ble_addr_type_random_static = 1,
453 ble_addr_type_random_resolvable = 2,
454 ble_addr_type_random_non_resolvable = 3,
455 }__attribute__((packed)) ble_addr_type;
456
460 typedef struct
461 {
462 ble_addr_type addr_type;
463 uint8_t addr[BLE_ADDR_LEN];
464 } __attribute__((packed)) ble_addr_t;
465
470 typedef enum
471 {
472 ble_ad_type_ind = 0x00,
473 ble_ad_type_direct_ind = 0x01,
474 ble_ad_type_scan_ind = 0x02,
475 ble_ad_type_nonconn_ind = 0x03,
476 ble_ad_type_direct_ind_low = 0x04,
477 }__attribute__((packed)) ble_ad_type;
478
483 typedef enum
484 {
485 ble_scan_type_passive = 0x00,
486 ble_scan_type_active = 0x01
487 }__attribute__((packed))ble_scan_type;
488
494 typedef enum
495 {
496 ble_report_type_ind = 0x00,
497 ble_report_type_direct_ind = 0x01,
498 ble_report_type_scan_ind = 0x02,
499 ble_report_type_nonconn_ind = 0x03,
500 ble_report_type_scan_rsp = 0x04
501 }__attribute__((packed)) ble_report_type;
502
507 typedef enum
508 {
509 ble_filter_any = 0x00,
510 ble_filter_filter_scan = 0x01,
511 ble_filter_filter_conn = 0x02,
512 ble_filter_filter_both = 0x03
513 }__attribute__((packed)) ble_filter_policy_t;
514
518 typedef enum
519 {
520 ble_scan_policy_0 = 0x00,
521 ble_scan_policy_1 = 0x01,
523 ble_scan_policy_2 = 0x02,
526 ble_scan_policy_3 = 0x03
531 }__attribute__((packed))ble_scan_policy_t;
537
541 typedef struct
542 {
543 uint8_t addr_count;
544 ble_addr_t *p_addrs;
545 } ble_gap_whitelist_t;
546
550 typedef struct
551 {
552 ble_ad_type ad_type;
553 ble_addr_t *peer_addr;
554 ble_addr_type self_addr_type;
555 ble_filter_policy_t filter;
556 uint16_t min_interval;
557 uint16_t max_interval;
558 uint8_t channel_mask;
559 }__attribute__((packed)) ble_gap_adv_params;
560
564 typedef struct
565 {
566 ble_scan_type type;
567 uint16_t interval;
568 uint16_t window;
569 ble_addr_type owner;
570 ble_scan_policy_t policy;
571 ble_gap_whitelist_t * p_whitelist;
572 bool filter_duplicated;
573 } __attribute__((packed)) ble_gap_scan_params_t;
574
575
579 typedef struct
580 {
581 uint16_t scan_intvl;
582 uint16_t scan_window;
583 ble_scan_policy_t policy;
584 ble_addr_t peer;
585 ble_addr_type owner;
586 uint16_t min_conn_interval;
587 uint16_t max_conn_interval;
588 uint16_t slave_latency;
589 uint16_t conn_sup_timeout;
590 uint16_t ce_min;
591 uint16_t ce_max;
592 } __attribute__((packed)) ble_gap_create_conn_params_t;
593
598 typedef struct
599 {
600 uint16_t min_conn_interval;
601 uint16_t max_conn_interval;
602 uint16_t slave_latency;
603 uint16_t conn_sup_timeout;
604 uint16_t ce_min;
605 uint16_t ce_max;
606 } __attribute__((packed)) ble_gap_conn_params_t;
607
608
610 typedef struct
611 {
612 uint8_t rand[BLE_GAP_SEC_RAND_LEN];
613 uint16_t ediv;
614 uint8_t ltk[BLE_GAP_SEC_KEY_LEN];
615 } __attribute__((packed)) ble_gap_master_id_t;
616
617
619 typedef struct
620 {
621 uint8_t status;
622 uint16_t conn_handle;
623 uint8_t role;
624 ble_addr_t peer_addr;
625 uint16_t connInterval;
626 uint16_t connLatency;
627 uint16_t supervisionTimeout;
628 uint8_t masterClockAccuracy;
629 } __attribute__((packed)) ble_gap_evt_connected_t;
630
631
633 typedef struct
634 {
635 uint16_t conn_handle;
636 uint8_t reason;
637 } __attribute__((packed)) ble_gap_evt_disconnected_t;
638
639
641 typedef struct
642 {
643 uint8_t status;
644 uint16_t conn_handle;
645 uint16_t conn_interval;
646 uint16_t slave_latency;
647 uint16_t conn_sup_timeout;
648 } __attribute__((packed)) ble_gap_evt_conn_param_update_t;
649
650
652 typedef struct
653 {
654 ble_addr_t peer_addr;
655 int8_t rssi;
656 ble_report_type type;
657 uint8_t dlen;
658 uint8_t data[31];
659 } __attribute__((packed)) ble_gap_evt_adv_report_t;
660
661
663 typedef struct
664 {
665 uint16_t handle;
666 uint16_t identifier;
667 uint16_t min_conn_interval;
668 uint16_t max_conn_interval;
669 uint16_t slave_latency;
670 uint16_t conn_sup_timeout;
671 }__attribute__((packed)) ble_gap_evt_conn_param_update_request_t;
672
676 typedef struct
677 {
678 uint8_t err_code;
679 }__attribute__((packed)) ble_gap_evt_operation_fail_t;
680
684 typedef struct
685 {
686 uint8_t err_code;
687 uint16_t handle;
688 uint8_t version;
689 uint16_t manu;
690 uint16_t sub;
691 }__attribute__((packed))ble_gap_evt_remote_version_t;
692
696 typedef struct
697 {
698 union
699 {
700 ble_gap_evt_connected_t connected;
701 ble_gap_evt_disconnected_t disconnected;
702 ble_gap_evt_conn_param_update_t conn_param_update;
703 ble_gap_evt_adv_report_t adv_report;
704 ble_gap_evt_conn_param_update_request_t conn_param_update_request;
705 ble_gap_evt_operation_fail_t operation_fail;
706 ble_gap_evt_remote_version_t remote_version;
707 } __attribute__((packed)) params;
708 } __attribute__((packed)) ble_gap_evt_t;
709
710 #ifdef _MSC_VER
711 __pragma(pack(pop))
712 #undef __attribute__
713 #endif
714
719 typedef enum
720 {
721 BLE_GAP_EVT_CONNECTED = BT_EVENT_GAP,
722 BLE_GAP_EVT_DISCONNECTED,
723 BLE_GAP_EVT_CONNECT_PARM_UPDATE,
724 BLE_GAP_EVT_ADV_REPORT,
725 BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST,
726 BLE_GAP_EVT_DISCONNECT_FAIL,
727 BLE_GAP_EVT_CONNECT_FAIL,
728 BLE_GAP_EVT_START_ENCRYPT_FAIL,
729 BLE_GAP_EVT_CONN_PARM_UPDATE_FAIL,
730 BLE_GAP_EVT_READ_REMOTE_VERSION
731 }ble_gap_event_id;
732
733
734 /*************************************************************************
735 * API
736 *************************************************************************/
737
744 BT_STATUS ble_gap_adv_data_set (uint8_t* p_data, uint8_t dlen, ai_cfm_gap_general cb);
745
752 BT_STATUS ble_gap_scan_data_set (uint8_t* p_data, uint8_t dlen, ai_cfm_gap_general cb);
753
754
762 BT_STATUS ble_gap_adv_set_parameter(ble_gap_adv_params *parm, ai_cfm_gap_general cb);
763
771 BT_STATUS ble_gap_adv_start(ble_gap_adv_params *parm, ai_cfm_gap_general cb);
772
777 BT_STATUS ble_gap_adv_stop(ai_cfm_gap_general cb);
778
784 BT_STATUS ble_gap_address_set(ble_addr_t *addr, ai_cfm_gap_general cb);
785
790 BT_STATUS ble_gap_pub_address_get(ble_addr_t *addr);
791
796 BT_STATUS ble_gap_random_address_get(ble_addr_t *addr);
797
803 BT_STATUS ble_gap_disconnect(uint16_t handle, uint8_t reason);
804
810 BT_STATUS ble_gap_tx_power_set(int8_t tx_power, ai_cfm_gap_general cb);
811
812
820 BT_STATUS ble_gap_scan_set_parameter(ble_gap_scan_params_t *p_scan_params, ai_cfm_gap_general cb);
821
829 BT_STATUS ble_gap_scan_start(ble_gap_scan_params_t const * const p_scan_params, ai_cfm_gap_general cb);
830
835 BT_STATUS ble_gap_scan_stop(ai_cfm_gap_general cb);
836
842 BT_STATUS ble_gap_start_encrypt(uint16_t conn_handle, ble_gap_master_id_t const * p_master_id);
843
849 BT_STATUS ble_gap_conn_param_update(uint16_t handle, ble_gap_conn_params_t const * const p_conn_params);
850
855 BT_STATUS ble_gap_connect(ble_gap_create_conn_params_t* p_conn_params);
856
861 BT_STATUS ble_gap_connect_cancel(ai_cfm_gap_general cb);
862
868 BT_STATUS ble_gap_add_whitelist(ble_gap_whitelist_t* p_wlst, ai_cfm_gap_general cb);
869
870
875 BT_STATUS ble_gap_remote_version(uint16_t handle);
876
877
882 void ble_gap_disable_latency(uint8_t byDisable);
883
889 BT_STATUS ble_gap_get_rssi(uint16_t handle, ai_cfm_gap_general cb);
890
895 #endif
ble_filter_filter_both
Process scan and connection requests only from devices in the White List.
Definition: ble_gap.h:512
ble_gap_adv_start
BT_STATUS ble_gap_adv_start(ble_gap_adv_params *parm, ai_cfm_gap_general cb)
Start Advertisement.
ble_report_type_nonconn_ind
Type for ADV_NONCONN_IND found (passive)
Definition: ble_gap.h:499
ble_gap_evt_conn_param_update_t::slave_latency
uint16_t slave_latency
Slave Latency in number of connection events.
Definition: ble_gap.h:646
ble_gap_create_conn_params_t::ce_max
uint16_t ce_max
Maximal CE.
Definition: ble_gap.h:591
BLE_GAP_EVT_READ_REMOTE_VERSION
Event for ble_gap_remote_version result.
Definition: ble_gap.h:730
ble_ad_type_direct_ind
Type for ADV_DIRECT_IND PDU.
Definition: ble_gap.h:473
ble_gap_whitelist_t::p_addrs
ble_addr_t * p_addrs
device address&#39;s array. Its size is equal to addr_count.
Definition: ble_gap.h:544
ble_gap_create_conn_params_t::scan_window
uint16_t scan_window
Scan window between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s).
Definition: ble_gap.h:582
ble_gap_connect
BT_STATUS ble_gap_connect(ble_gap_create_conn_params_t *p_conn_params)
Connect request.
ble_gap_adv_set_parameter
BT_STATUS ble_gap_adv_set_parameter(ble_gap_adv_params *parm, ai_cfm_gap_general cb)
Set Advertisement Parameter.
ble_gap_whitelist_t::addr_count
uint8_t addr_count
device count
Definition: ble_gap.h:543
ble_gap_get_rssi
BT_STATUS ble_gap_get_rssi(uint16_t handle, ai_cfm_gap_general cb)
Get connection RSSI.
ble_ad_type
ble_ad_type
BLE AD Type The AD type was mapping to advertising PDU ID.
Definition: ble_gap.h:470
ble_gap_evt_adv_report_t
Event structure for BLE_GAP_EVT_ADV_REPORT.
Definition: ble_gap.h:652
ble_scan_policy_2
Definition: ble_gap.h:525
ble_gap_disconnect
BT_STATUS ble_gap_disconnect(uint16_t handle, uint8_t reason)
Disconnect link.
ble_gap_conn_params_t
parameters for a link It is usually used for updating parameters of a connection. ...
Definition: ble_gap.h:598
ble_gap_master_id_t::ediv
uint16_t ediv
Encrypted Diversifier.
Definition: ble_gap.h:613
BLE_GAP_EVT_ADV_REPORT
Event for scanning result.
Definition: ble_gap.h:724
ble_gap_create_conn_params_t::owner
ble_addr_type owner
Definition: ble_gap.h:585
ble_gap_conn_params_t::ce_min
uint16_t ce_min
Minimal CE.
Definition: ble_gap.h:604
BLE_GAP_EVT_DISCONNECT_FAIL
Event for ble_gap_disconnect operation fail.
Definition: ble_gap.h:726
ble_gap_evt_conn_param_update_request_t::min_conn_interval
uint16_t min_conn_interval
Minimum Connection Interval in 1.25 ms units.
Definition: ble_gap.h:667
ble_gap_address_set
BT_STATUS ble_gap_address_set(ble_addr_t *addr, ai_cfm_gap_general cb)
Set BLE address.
ble_addr_t
BLE address structure.
Definition: ble_gap.h:460
ble_gap_evt_remote_version_t::err_code
uint8_t err_code
HCI error code.
Definition: ble_gap.h:686
ble_ad_type_ind
Type for ADV_IND PDU.
Definition: ble_gap.h:472
BLE_GAP_EVT_START_ENCRYPT_FAIL
Event for ble_gap_start_encrypt operation fail.
Definition: ble_gap.h:728
ble_gap_create_conn_params_t::slave_latency
uint16_t slave_latency
Slave Latency in number of connection events.
Definition: ble_gap.h:588
BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST
Event for notifying connection parameter update request from peer.
Definition: ble_gap.h:725
ble_gap_disable_latency
void ble_gap_disable_latency(uint8_t byDisable)
Disable slave latency.
ble_gap_evt_remote_version_t::sub
uint16_t sub
Subversion.
Definition: ble_gap.h:690
ble_gap_remote_version
BT_STATUS ble_gap_remote_version(uint16_t handle)
Obtain remote version information.
ble_scan_type
ble_scan_type
BLE Scan Type Scan type which used in structure ble_gap_scan_params_t.
Definition: ble_gap.h:483
ble_gap_scan_params_t::policy
ble_scan_policy_t policy
Definition: ble_gap.h:570
ble_report_type_scan_rsp
Type for SCAN_RSP found (active)
Definition: ble_gap.h:500
ble_gap_evt_disconnected_t::reason
uint8_t reason
HCI error code.
Definition: ble_gap.h:636
ble_gap_evt_conn_param_update_request_t
Event structure for BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST.
Definition: ble_gap.h:663
ble_gap_event_id
ble_gap_event_id
GAP Event IDs. IDs that uniquely identify an event.
Definition: ble_gap.h:719
ble_gap_evt_t::connected
ble_gap_evt_connected_t connected
Connected Event Parameters.
Definition: ble_gap.h:700
ble_gap_evt_operation_fail_t
Event structure for BLE_GAP_EVT_DISCONNECT_FAIL, BLE_GAP_EVT_CONNECT_FAIL, BLE_GAP_EVT_START_ENCRYPT_...
Definition: ble_gap.h:676
ble_gap_conn_params_t::max_conn_interval
uint16_t max_conn_interval
Maximum Connection Interval in 1.25 ms units.
Definition: ble_gap.h:601
ai_cfm_gap_general
void(* ai_cfm_gap_general)(bool isuccess, uint8_t err_code)
Callback prototype for GAP operations.
Definition: ble_gap.h:437
ble_gap_evt_t::conn_param_update
ble_gap_evt_conn_param_update_t conn_param_update
Connection Parameter Update Parameters.
Definition: ble_gap.h:702
ble_gap_conn_param_update
BT_STATUS ble_gap_conn_param_update(uint16_t handle, ble_gap_conn_params_t const *const p_conn_params)
Connect update request.
ble_addr_type_random_static
random static address
Definition: ble_gap.h:452
ble_gap_connect_cancel
BT_STATUS ble_gap_connect_cancel(ai_cfm_gap_general cb)
Cancel ongoing connection request.
ble_gap_evt_t::remote_version
ble_gap_evt_remote_version_t remote_version
Remote Version.
Definition: ble_gap.h:706
ble_gap_evt_t::conn_param_update_request
ble_gap_evt_conn_param_update_request_t conn_param_update_request
Connection Parameter Update Parameters.
Definition: ble_gap.h:704
ble_gap_evt_connected_t
Event structure for BLE_GAP_EVT_CONNECTED.
Definition: ble_gap.h:619
ble_addr_type_random_non_resolvable
random non resolvable address
Definition: ble_gap.h:454
ble_gap_evt_connected_t::peer_addr
ble_addr_t peer_addr
Bluetooth address of the peer device.
Definition: ble_gap.h:624
ble_gap_conn_params_t::min_conn_interval
uint16_t min_conn_interval
Minimum Connection Interval in 1.25 ms units.
Definition: ble_gap.h:600
ble_gap_adv_data_set
BT_STATUS ble_gap_adv_data_set(uint8_t *p_data, uint8_t dlen, ai_cfm_gap_general cb)
Set Advertisement Data API.
ble_gap_scan_stop
BT_STATUS ble_gap_scan_stop(ai_cfm_gap_general cb)
Stop scan.
ble_filter_any
Process scan and connection requests from all devices (i.e., the White Listis not in use)...
Definition: ble_gap.h:509
ble_addr_type_public
public address
Definition: ble_gap.h:451
ble_gap_scan_start
BT_STATUS ble_gap_scan_start(ble_gap_scan_params_t const *const p_scan_params, ai_cfm_gap_general cb)
Start scan.
ble_scan_policy_1
Definition: ble_gap.h:522
ble_scan_policy_t
ble_scan_policy_t
BLE Scan Fileter Policy.
Definition: ble_gap.h:518
ble_gap_scan_set_parameter
BT_STATUS ble_gap_scan_set_parameter(ble_gap_scan_params_t *p_scan_params, ai_cfm_gap_general cb)
Set Scan parameter.
ble_gap_adv_params
BLE advertisement parameter.
Definition: ble_gap.h:550
ble_gap_conn_params_t::slave_latency
uint16_t slave_latency
Slave Latency in number of connection events.
Definition: ble_gap.h:602
ble_report_type_ind
Type for ADV_IND found (passive)
Definition: ble_gap.h:496
ble_gap_create_conn_params_t::conn_sup_timeout
uint16_t conn_sup_timeout
Connection Supervision Timeout in 10 ms units.
Definition: ble_gap.h:589
ble_ad_type_direct_ind_low
Type for ADV_DIRECT_IND PDU with low duty.
Definition: ble_gap.h:476
BLE_GAP_EVT_CONN_PARM_UPDATE_FAIL
Event for ble_gap_conn_param_update operation fail.
Definition: ble_gap.h:729
BT_EVENT_GAP
GAP event.
Definition: bt_constants.h:43
ble_gap_pub_address_get
BT_STATUS ble_gap_pub_address_get(ble_addr_t *addr)
Get Public BLE address.
ble_gap_evt_remote_version_t
Event structure for BLE_GAP_EVT_READ_REMOTE_VERSION.
Definition: ble_gap.h:684
ble_filter_filter_scan
Process connection requests from all devices and only scan requests from devices that are in the Whit...
Definition: ble_gap.h:510
ble_addr_type_random_resolvable
random resolvable addresss
Definition: ble_gap.h:453
BLE_GAP_SEC_RAND_LEN
#define BLE_GAP_SEC_RAND_LEN
GAP Security Random Number Length.
Definition: bt_constants.h:62
ble_gap_scan_params_t::interval
uint16_t interval
Scan interval between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s).
Definition: ble_gap.h:567
BLE_ADDR_LEN
#define BLE_ADDR_LEN
BLE address byte length.
Definition: bt_constants.h:57
ble_gap_evt_conn_param_update_request_t::handle
uint16_t handle
connection handler
Definition: ble_gap.h:665
ble_gap_evt_disconnected_t
Event structure for BLE_GAP_EVT_DISCONNECTED.
Definition: ble_gap.h:633
ble_gap_scan_params_t
Parameter for scanning.
Definition: ble_gap.h:564
ble_filter_policy_t
ble_filter_policy_t
BLE Advertising Filter Policy. It was used in struct ble_gap_adv_params to indicate policy of filteri...
Definition: ble_gap.h:507
ble_gap_scan_params_t::window
uint16_t window
Scan window between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s).
Definition: ble_gap.h:568
ble_gap_add_whitelist
BT_STATUS ble_gap_add_whitelist(ble_gap_whitelist_t *p_wlst, ai_cfm_gap_general cb)
Add whiteList.
ble_gap_evt_remote_version_t::handle
uint16_t handle
Connection handle.
Definition: ble_gap.h:687
ble_gap_start_encrypt
BT_STATUS ble_gap_start_encrypt(uint16_t conn_handle, ble_gap_master_id_t const *p_master_id)
Start link encrypt.
ble_addr_t::addr_type
ble_addr_type addr_type
address type.
Definition: ble_gap.h:462
ble_gap_evt_t::adv_report
ble_gap_evt_adv_report_t adv_report
Advertising Report Event Parameters.
Definition: ble_gap.h:703
ble_report_type
ble_report_type
BLE Report Type The report type is for the scanned peers&#39; type. It could be AD type of passive scan o...
Definition: ble_gap.h:494
ble_gap_create_conn_params_t::min_conn_interval
uint16_t min_conn_interval
Minimum Connection Interval in 1.25 ms units,.
Definition: ble_gap.h:586
ble_gap_evt_disconnected_t::conn_handle
uint16_t conn_handle
Connection Handle.
Definition: ble_gap.h:635
ble_gap_create_conn_params_t::ce_min
uint16_t ce_min
Minimal CE.
Definition: ble_gap.h:590
ble_scan_type_passive
Pasive scan method.
Definition: ble_gap.h:485
ble_gap_evt_conn_param_update_request_t::max_conn_interval
uint16_t max_conn_interval
Maximum Connection Interval in 1.25 ms units.
Definition: ble_gap.h:668
ble_addr_type
ble_addr_type
BLE ddress Type.
Definition: ble_gap.h:449
ble_gap_scan_params_t::filter_duplicated
bool filter_duplicated
Filter duplicated device.
Definition: ble_gap.h:572
ble_gap_random_address_get
BT_STATUS ble_gap_random_address_get(ble_addr_t *addr)
Get static random BLE address.
ble_gap_evt_t::disconnected
ble_gap_evt_disconnected_t disconnected
Disconnected Event Parameters.
Definition: ble_gap.h:701
ble_gap_evt_operation_fail_t::err_code
uint8_t err_code
Error code. Usually is HCI error code.
Definition: ble_gap.h:678
ble_gap_create_conn_params_t::scan_intvl
uint16_t scan_intvl
Scan interval between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s).
Definition: ble_gap.h:581
ble_gap_evt_conn_param_update_t::status
uint8_t status
0: success else fail
Definition: ble_gap.h:643
ble_gap_evt_t
GAP event structure.
Definition: ble_gap.h:696
ble_gap_scan_data_set
BT_STATUS ble_gap_scan_data_set(uint8_t *p_data, uint8_t dlen, ai_cfm_gap_general cb)
Set Scan Response Data.
ble_ad_type_scan_ind
Type for ADV_SCAN_IND PDU.
Definition: ble_gap.h:474
ble_gap_conn_params_t::conn_sup_timeout
uint16_t conn_sup_timeout
Connection Supervision Timeout in 10 ms units.
Definition: ble_gap.h:603
BLE_GAP_EVT_CONNECT_PARM_UPDATE
Event for notifying connection parameter has been updated.
Definition: ble_gap.h:723
ble_scan_type_active
Active scan method.
Definition: ble_gap.h:486
ble_gap_evt_conn_param_update_request_t::conn_sup_timeout
uint16_t conn_sup_timeout
Connection Supervision Timeout in 10 ms units.
Definition: ble_gap.h:670
ble_scan_policy_0
Definition: ble_gap.h:520
ble_gap_evt_conn_param_update_t::conn_interval
uint16_t conn_interval
Connection Interval in 1.25 ms units,.
Definition: ble_gap.h:645
ble_report_type_scan_ind
Type for ADV_SCAN_IND found (passive)
Definition: ble_gap.h:498
ble_gap_evt_conn_param_update_request_t::slave_latency
uint16_t slave_latency
Slave Latency in number of connection events.
Definition: ble_gap.h:669
BLE_GAP_SEC_KEY_LEN
#define BLE_GAP_SEC_KEY_LEN
GAP Security Key Length.
Definition: bt_constants.h:67
ble_gap_evt_conn_param_update_t::conn_sup_timeout
uint16_t conn_sup_timeout
Connection Supervision Timeout in 10 ms units.
Definition: ble_gap.h:647
ble_gap_evt_remote_version_t::manu
uint16_t manu
Manufacturer name.
Definition: ble_gap.h:689
ble_gap_evt_conn_param_update_t::conn_handle
uint16_t conn_handle
Connection Handle.
Definition: ble_gap.h:644
BLE_GAP_EVT_CONNECT_FAIL
Event for ble_gap_connect operation fail.
Definition: ble_gap.h:727
ble_gap_evt_t::operation_fail
ble_gap_evt_operation_fail_t operation_fail
Operation fail.
Definition: ble_gap.h:705
ble_gap_evt_remote_version_t::version
uint8_t version
Version of current LMP.
Definition: ble_gap.h:688
ble_gap_adv_stop
BT_STATUS ble_gap_adv_stop(ai_cfm_gap_general cb)
Stop Advertisement.
ble_gap_create_conn_params_t
parameters for creating a link
Definition: ble_gap.h:579
BLE_GAP_EVT_CONNECTED
Event for link connected.
Definition: ble_gap.h:721
ble_gap_conn_params_t::ce_max
uint16_t ce_max
Maximal CE.
Definition: ble_gap.h:605
BLE_GAP_EVT_DISCONNECTED
Event for link disconnected.
Definition: ble_gap.h:722
ble_report_type_direct_ind
Type for ADV_DIRECT_IND found (passive)
Definition: ble_gap.h:497
BT_STATUS
BT_STATUS
BT API execution status.
Definition: bt_constants.h:28
ble_gap_evt_connected_t::conn_handle
uint16_t conn_handle
Connection Handle.
Definition: ble_gap.h:622
ble_gap_evt_conn_param_update_request_t::identifier
uint16_t identifier
identifier used to reponse
Definition: ble_gap.h:666
ble_gap_tx_power_set
BT_STATUS ble_gap_tx_power_set(int8_t tx_power, ai_cfm_gap_general cb)
Set TX power.
ble_gap_master_id_t
GAP Master Identification.
Definition: ble_gap.h:610
ble_gap_scan_params_t::p_whitelist
ble_gap_whitelist_t * p_whitelist
Pointer to whitelist, NULL if no whitelist or the current active whitelist is to be used...
Definition: ble_gap.h:571
ble_gap_create_conn_params_t::max_conn_interval
uint16_t max_conn_interval
Maximum Connection Interval in 1.25 ms units,.
Definition: ble_gap.h:587
ble_filter_filter_conn
Process scan requests from all devices and only connection requests from devices that are in the Whit...
Definition: ble_gap.h:511
ble_gap_whitelist_t
BLE while listing.
Definition: ble_gap.h:541
ble_ad_type_nonconn_ind
Type for ADV_NONCONN_IND PDU.
Definition: ble_gap.h:475
ble_scan_policy_3
Definition: ble_gap.h:530
ble_gap_evt_conn_param_update_t
Event structure for BLE_GAP_EVT_CONNECT_PARM_UPDATE.
Definition: ble_gap.h:641