S145 SoftDevice for nRF54LM20 API documentation 10.0.0
Loading...
Searching...
No Matches
ble_gap.h
1/*
2 * Copyright (c) Nordic Semiconductor ASA
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without modification,
6 * are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice, this
9 * list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form, except as embedded into a Nordic
12 * Semiconductor ASA integrated circuit in a product or a software update for
13 * such product, must reproduce the above copyright notice, this list of
14 * conditions and the following disclaimer in the documentation and/or other
15 * materials provided with the distribution.
16 *
17 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
18 * contributors may be used to endorse or promote products derived from this
19 * software without specific prior written permission.
20 *
21 * 4. This software, with or without modification, must only be used with a
22 * Nordic Semiconductor ASA integrated circuit.
23 *
24 * 5. Any software provided in binary form under this license must not be reverse
25 * engineered, decompiled, modified and/or disassembled.
26 *
27 * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
28 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
29 * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
30 * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
33 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
36 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 */
38
45#ifndef BLE_GAP_H__
46#define BLE_GAP_H__
47
48#include <stdint.h>
49#include "nrf_svc.h"
50#include "nrf_error.h"
51#include "ble_hci.h"
52#include "ble_ranges.h"
53#include "ble_types.h"
54#include "ble_err.h"
55
56#ifdef __cplusplus
57extern "C" {
58#endif
59
66{
108};
109
139
151
165
174
184
185
193
201#define BLE_ERROR_GAP_UUID_LIST_MISMATCH (NRF_GAP_ERR_BASE + 0x000)
202#define BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST (NRF_GAP_ERR_BASE + 0x001)
203#define BLE_ERROR_GAP_INVALID_BLE_ADDR (NRF_GAP_ERR_BASE + 0x002)
204#define BLE_ERROR_GAP_WHITELIST_IN_USE (NRF_GAP_ERR_BASE + 0x003)
205#define BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE (NRF_GAP_ERR_BASE + 0x004)
206#define BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE (NRF_GAP_ERR_BASE + 0x005)
207#define BLE_ERROR_GAP_ZERO_IRK_NOT_ALLOWED (NRF_GAP_ERR_BASE + 0x006)
213#define BLE_GAP_ROLE_INVALID 0x0
214#define BLE_GAP_ROLE_PERIPH 0x1
215#define BLE_GAP_ROLE_CENTRAL 0x2
221#define BLE_GAP_TIMEOUT_SRC_SCAN 0x01
222#define BLE_GAP_TIMEOUT_SRC_CONN 0x02
223#define BLE_GAP_TIMEOUT_SRC_AUTH_PAYLOAD 0x03
229#define BLE_GAP_ADDR_TYPE_PUBLIC 0x00
230#define BLE_GAP_ADDR_TYPE_RANDOM_STATIC 0x01
231#define BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE 0x02
232#define BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE 0x03
233#define BLE_GAP_ADDR_TYPE_ANONYMOUS 0x7F
239#define BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S (900) /* 15 minutes. */
241#define BLE_GAP_MAX_PRIVATE_ADDR_CYCLE_INTERVAL_S (41400) /* 11 hours 30 minutes. */
242
243
245#define BLE_GAP_ADDR_LEN (6)
246
249#define BLE_GAP_PRIVACY_MODE_OFF 0x00
250#define BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY 0x01
251#define BLE_GAP_PRIVACY_MODE_NETWORK_PRIVACY 0x02
257#define BLE_GAP_POWER_LEVEL_INVALID 127
258
260#define BLE_GAP_ADV_SET_HANDLE_NOT_SET (0xFF)
261
263#define BLE_GAP_ADV_SET_COUNT_DEFAULT (1)
264
266#define BLE_GAP_ADV_SET_COUNT_MAX (1)
267
270#define BLE_GAP_ADV_SET_DATA_SIZE_MAX (31)
272#define BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED (255)
274#define BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED (238)
278#define BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE 0xFF
279
282#define BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_TIMEOUT 0x01
283#define BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_LIMIT_REACHED 0x02
289#define BLE_GAP_AD_TYPE_FLAGS 0x01
290#define BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE 0x02
291#define BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_COMPLETE 0x03
292#define BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE 0x04
293#define BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_COMPLETE 0x05
294#define BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE 0x06
295#define BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE 0x07
296#define BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME 0x08
297#define BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME 0x09
298#define BLE_GAP_AD_TYPE_TX_POWER_LEVEL 0x0A
299#define BLE_GAP_AD_TYPE_CLASS_OF_DEVICE 0x0D
300#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C 0x0E
301#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R 0x0F
302#define BLE_GAP_AD_TYPE_SECURITY_MANAGER_TK_VALUE 0x10
303#define BLE_GAP_AD_TYPE_SECURITY_MANAGER_OOB_FLAGS 0x11
304#define BLE_GAP_AD_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE 0x12
305#define BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_16BIT 0x14
306#define BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_128BIT 0x15
307#define BLE_GAP_AD_TYPE_SERVICE_DATA 0x16
308#define BLE_GAP_AD_TYPE_PUBLIC_TARGET_ADDRESS 0x17
309#define BLE_GAP_AD_TYPE_RANDOM_TARGET_ADDRESS 0x18
310#define BLE_GAP_AD_TYPE_APPEARANCE 0x19
311#define BLE_GAP_AD_TYPE_ADVERTISING_INTERVAL 0x1A
312#define BLE_GAP_AD_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS 0x1B
313#define BLE_GAP_AD_TYPE_LE_ROLE 0x1C
314#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C256 0x1D
315#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R256 0x1E
316#define BLE_GAP_AD_TYPE_SERVICE_DATA_32BIT_UUID 0x20
317#define BLE_GAP_AD_TYPE_SERVICE_DATA_128BIT_UUID 0x21
318#define BLE_GAP_AD_TYPE_LESC_CONFIRMATION_VALUE 0x22
319#define BLE_GAP_AD_TYPE_LESC_RANDOM_VALUE 0x23
320#define BLE_GAP_AD_TYPE_URI 0x24
321#define BLE_GAP_AD_TYPE_3D_INFORMATION_DATA 0x3D
322#define BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA 0xFF
328#define BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE (0x01)
329#define BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE (0x02)
330#define BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED (0x04)
331#define BLE_GAP_ADV_FLAG_LE_BR_EDR_CONTROLLER (0x08)
332#define BLE_GAP_ADV_FLAG_LE_BR_EDR_HOST (0x10)
333#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)
334#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)
340#define BLE_GAP_ADV_INTERVAL_MIN 0x000020
341#define BLE_GAP_ADV_INTERVAL_MAX 0xFFFFFF
346#define BLE_GAP_SCAN_INTERVAL_US_MIN 2500UL
347#define BLE_GAP_SCAN_INTERVAL_US_MAX 40959375UL
353#define BLE_GAP_SCAN_WINDOW_US_MIN 2500UL
354#define BLE_GAP_SCAN_WINDOW_1MBPS_US_MIN 1875UL
355#define BLE_GAP_SCAN_WINDOW_US_MAX 40959375UL
361#define BLE_GAP_SCAN_TIMEOUT_MIN 0x0001
362#define BLE_GAP_SCAN_TIMEOUT_UNLIMITED 0x0000
371#define BLE_GAP_SCAN_BUFFER_MIN (31)
373#define BLE_GAP_SCAN_BUFFER_MAX (31)
375#define BLE_GAP_SCAN_BUFFER_EXTENDED_MIN (255)
377#define BLE_GAP_SCAN_BUFFER_EXTENDED_MAX (1650)
379#define BLE_GAP_SCAN_BUFFER_EXTENDED_MAX_SUPPORTED (255)
394#define BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED 0x01
396#define BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE 0x02
404#define BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED 0x03
407#define BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED 0x04
409#define BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED 0x05
411#define BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED 0x06
413#define BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_DIRECTED 0x07
415#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED 0x08
418#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_DIRECTED 0x09
421#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED 0x0A
423#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_DIRECTED 0x0B
429#define BLE_GAP_ADV_FP_ANY 0x00
430#define BLE_GAP_ADV_FP_FILTER_SCANREQ 0x01
431#define BLE_GAP_ADV_FP_FILTER_CONNREQ 0x02
432#define BLE_GAP_ADV_FP_FILTER_BOTH 0x03
437#define BLE_GAP_ADV_DATA_STATUS_COMPLETE 0x00
438#define BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA 0x01
442#define BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_TRUNCATED 0x02
445#define BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MISSED 0x03
452#define BLE_GAP_SCAN_FP_ACCEPT_ALL 0x00
454#define BLE_GAP_SCAN_FP_WHITELIST 0x01
456#define BLE_GAP_SCAN_FP_ALL_NOT_RESOLVED_DIRECTED 0x02
460#define BLE_GAP_SCAN_FP_WHITELIST_NOT_RESOLVED_DIRECTED 0x03
468#define BLE_GAP_ADV_TIMEOUT_HIGH_DUTY_MAX (128)
469#define BLE_GAP_ADV_TIMEOUT_LIMITED_MAX (18000)
470#define BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED (0)
476#define BLE_GAP_IO_CAPS_DISPLAY_ONLY 0x00
477#define BLE_GAP_IO_CAPS_DISPLAY_YESNO 0x01
478#define BLE_GAP_IO_CAPS_KEYBOARD_ONLY 0x02
479#define BLE_GAP_IO_CAPS_NONE 0x03
480#define BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY 0x04
486#define BLE_GAP_AUTH_KEY_TYPE_NONE 0x00
487#define BLE_GAP_AUTH_KEY_TYPE_PASSKEY 0x01
488#define BLE_GAP_AUTH_KEY_TYPE_OOB 0x02
494#define BLE_GAP_KP_NOT_TYPE_PASSKEY_START 0x00
495#define BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_IN 0x01
496#define BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_OUT 0x02
497#define BLE_GAP_KP_NOT_TYPE_PASSKEY_CLEAR 0x03
498#define BLE_GAP_KP_NOT_TYPE_PASSKEY_END 0x04
504#define BLE_GAP_SEC_STATUS_SUCCESS 0x00
505#define BLE_GAP_SEC_STATUS_PASSKEY_ENTRY_FAILED 0x01
506#define BLE_GAP_SEC_STATUS_OOB_NOT_AVAILABLE 0x02
507#define BLE_GAP_SEC_STATUS_AUTH_REQ 0x03
508#define BLE_GAP_SEC_STATUS_CONFIRM_VALUE 0x04
509#define BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP 0x05
510#define BLE_GAP_SEC_STATUS_ENC_KEY_SIZE 0x06
511#define BLE_GAP_SEC_STATUS_SMP_CMD_UNSUPPORTED 0x07
512#define BLE_GAP_SEC_STATUS_UNSPECIFIED 0x08
513#define BLE_GAP_SEC_STATUS_REPEATED_ATTEMPTS 0x09
514#define BLE_GAP_SEC_STATUS_INVALID_PARAMS 0x0A
515#define BLE_GAP_SEC_STATUS_DHKEY_FAILURE 0x0B
516#define BLE_GAP_SEC_STATUS_NUM_COMP_FAILURE 0x0C
517#define BLE_GAP_SEC_STATUS_BR_EDR_IN_PROG 0x0D
518#define BLE_GAP_SEC_STATUS_X_TRANS_KEY_DISALLOWED 0x0E
519#define BLE_GAP_SEC_STATUS_KEY_REJECTED 0x0F
520#define BLE_GAP_SEC_STATUS_BUSY 0x10
521#define BLE_GAP_SEC_STATUS_TIMEOUT 0x81
522#define BLE_GAP_SEC_STATUS_PDU_INVALID 0x82
528#define BLE_GAP_SEC_STATUS_SOURCE_LOCAL 0x00
529#define BLE_GAP_SEC_STATUS_SOURCE_REMOTE 0x01
536#define BLE_GAP_CONN_INTVL_MS_TO_UNITS(CI_MS) ((uint16_t)((CI_MS) / 1.25))
543#define BLE_GAP_CP_MIN_CONN_INTVL_NONE 0xFFFF
544#define BLE_GAP_CP_MIN_CONN_INTVL_MIN 0x0006
545#define BLE_GAP_CP_MIN_CONN_INTVL_MAX 0x0C80
546#define BLE_GAP_CP_MAX_CONN_INTVL_NONE 0xFFFF
547#define BLE_GAP_CP_MAX_CONN_INTVL_MIN 0x0006
548#define BLE_GAP_CP_MAX_CONN_INTVL_MAX 0x0C80
549#define BLE_GAP_CP_SLAVE_LATENCY_MAX 0x01F3
550#define BLE_GAP_CP_CONN_SUP_TIMEOUT_NONE 0xFFFF
551#define BLE_GAP_CP_CONN_SUP_TIMEOUT_MIN 0x000A
552#define BLE_GAP_CP_CONN_SUP_TIMEOUT_MAX 0x0C80
557#define BLE_GAP_DEVNAME_DEFAULT "nRF5x"
558#define BLE_GAP_DEVNAME_DEFAULT_LEN 31
559#define BLE_GAP_DEVNAME_MAX_LEN 248
563#define BLE_GAP_RSSI_UNAVAILABLE 127
564
566#define BLE_GAP_RSSI_THRESHOLD_INVALID 0xFF
567
570#define BLE_GAP_PHY_AUTO 0x00
571#define BLE_GAP_PHY_1MBPS 0x01
572#define BLE_GAP_PHY_2MBPS 0x02
573#define BLE_GAP_PHY_CODED 0x04
574#define BLE_GAP_PHY_NOT_SET 0xFF
577#define BLE_GAP_PHYS_SUPPORTED (BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS)
586#define BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(ptr) do {(ptr)->sm = 0; (ptr)->lv = 0;} while(0)
588#define BLE_GAP_CONN_SEC_MODE_SET_OPEN(ptr) do {(ptr)->sm = 1; (ptr)->lv = 1;} while(0)
590#define BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 2;} while(0)
592#define BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 3;} while(0)
594#define BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 4;} while(0)
599#define BLE_GAP_SEC_RAND_LEN 8
600
601
603#define BLE_GAP_SEC_KEY_LEN 16
604
605
607#define BLE_GAP_LESC_P256_PK_LEN 64
608
609
611#define BLE_GAP_LESC_DHKEY_LEN 32
612
613
615#define BLE_GAP_PASSKEY_LEN 6
616
617
619#define BLE_GAP_WHITELIST_ADDR_MAX_COUNT (8)
620
621
623#define BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT (8)
624
625
627#define BLE_GAP_CONN_COUNT_DEFAULT (1)
628
629
637#define BLE_GAP_EVENT_LENGTH_MIN (2)
638#define BLE_GAP_EVENT_LENGTH_1MBPS_PHY_MIN (2)
639#define BLE_GAP_EVENT_LENGTH_2MBPS_PHY_MIN (1)
640#define BLE_GAP_EVENT_LENGTH_DEFAULT (3)
646#define BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT (1)
647#define BLE_GAP_ROLE_COUNT_CENTRAL_DEFAULT (3)
648#define BLE_GAP_ROLE_COUNT_CENTRAL_SEC_DEFAULT (1)
649#define BLE_GAP_ROLE_COUNT_COMBINED_MAX (20)
653#define BLE_GAP_DATA_LENGTH_AUTO 0
654
657#define BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MAX (48000)
658#define BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MIN (1)
663#define BLE_GAP_SEC_MODE 0x00
671#define BLE_GAP_CHAR_INCL_CONFIG_INCLUDE (0)
672#define BLE_GAP_CHAR_INCL_CONFIG_EXCLUDE_WITH_SPACE (1)
678#define BLE_GAP_CHAR_INCL_CONFIG_EXCLUDE_WITHOUT_SPACE (2)
686#define BLE_GAP_PPCP_INCL_CONFIG_DEFAULT (BLE_GAP_CHAR_INCL_CONFIG_INCLUDE)
687#define BLE_GAP_CAR_INCL_CONFIG_DEFAULT (BLE_GAP_CHAR_INCL_CONFIG_INCLUDE)
692#define BLE_GAP_SLAVE_LATENCY_ENABLE (0)
695#define BLE_GAP_SLAVE_LATENCY_DISABLE (1)
698#define BLE_GAP_SLAVE_LATENCY_WAIT_FOR_ACK (2)
708typedef struct
709{
710 uint8_t type;
711 uint8_t anonymous : 1;
715 uint8_t include_tx_power : 1;
717
719typedef struct
720{
721 uint16_t connectable : 1;
722 uint16_t scannable : 1;
723 uint16_t directed : 1;
724 uint16_t scan_response : 1;
725 uint16_t extended_pdu : 1;
726 uint16_t status : 2;
727 uint16_t reserved : 9;
729
731typedef struct
732{
733 uint16_t aux_offset;
734 uint8_t aux_phy;
736
738typedef struct
739{
740 uint8_t addr_id_peer : 1;
746 uint8_t addr_type : 7;
747 uint8_t addr[BLE_GAP_ADDR_LEN];
750
751
763typedef struct
764{
767 uint16_t slave_latency;
770
779typedef struct
780{
781 uint8_t sm : 4;
782 uint8_t lv : 4;
785
786
793
795typedef struct
796{
797 uint8_t irk[BLE_GAP_SEC_KEY_LEN];
799
800
806typedef uint8_t ble_gap_ch_mask_t[5];
807
808
885
899
901typedef struct
902{
903 uint8_t extended : 1;
914 uint8_t active : 1;
916 uint8_t filter_policy : 2;
920 uint8_t scan_phys;
938 uint32_t interval;
939 uint32_t window;
945 uint16_t timeout;
951
952
978
979
988typedef struct
989{
990 uint8_t tx_phys;
991 uint8_t rx_phys;
993
995typedef struct
996{
997 uint8_t enc : 1;
998 uint8_t id : 1;
1000
1001
1003typedef struct
1004{
1005 uint8_t bond : 1;
1006 uint8_t mitm : 1;
1007 uint8_t lesc : 1;
1008 uint8_t keypress : 1;
1009 uint8_t io_caps : 3;
1010 uint8_t oob : 1;
1020
1021
1023typedef struct
1024{
1025 uint8_t ltk[BLE_GAP_SEC_KEY_LEN];
1026 uint8_t lesc : 1;
1027 uint8_t auth : 1;
1028 uint8_t ltk_len : 6;
1030
1031
1033typedef struct
1034{
1035 uint16_t ediv;
1036 uint8_t rand[BLE_GAP_SEC_RAND_LEN];
1038
1039
1041typedef struct
1042{
1045
1046
1048typedef struct
1049{
1052
1053
1061
1062
1073
1074
1076typedef struct
1077{
1078 uint8_t reason;
1080
1081
1087
1093
1095typedef struct
1096{
1097 uint8_t status;
1098 uint8_t tx_phy;
1099 uint8_t rx_phy;
1101
1107
1108
1117
1119typedef struct
1120{
1121 uint8_t passkey[BLE_GAP_PASSKEY_LEN];
1122 uint8_t match_request : 1;
1126
1128typedef struct
1129{
1130 uint8_t kp_not;
1132
1133
1135typedef struct
1136{
1137 uint8_t key_type;
1139
1147
1148
1152typedef struct
1153{
1154 uint8_t lv1 : 1;
1155 uint8_t lv2 : 1;
1156 uint8_t lv3 : 1;
1157 uint8_t lv4 : 1;
1159
1160
1167
1168
1175
1176
1185
1186
1193
1194
1196typedef struct
1197{
1198 uint16_t max_tx_octets;
1199 uint16_t max_rx_octets;
1203
1204
1212
1213
1225
1226
1232
1233
1235typedef struct
1236{
1237 uint8_t src;
1238 union
1239 {
1242 } params;
1244
1245
1247typedef struct
1248{
1249 int8_t rssi;
1251 uint8_t ch_index;
1253
1263
1308
1309
1311typedef struct
1312{
1313 uint8_t bond : 1;
1314 uint8_t mitm : 1;
1315 uint8_t lesc : 1;
1316 uint8_t keypress : 1;
1318
1319
1325
1326
1336
1342
1349
1350
1352typedef struct
1353{
1354 uint16_t event_counter;
1355 uint8_t ch_index;
1356 uint16_t crc_ok_count;
1358 uint16_t nak_count;
1359 uint8_t rx_timeout : 1;
1361
1393
1394
1403typedef struct
1404{
1405 uint8_t conn_count;
1407 uint16_t event_length;
1414
1415
1437
1438
1475
1476
1478typedef struct
1479{
1480 uint8_t include_cfg;
1484
1485
1487typedef struct
1488{
1489 uint8_t include_cfg;
1492
1503
1504
1528typedef struct
1529{
1530 uint16_t conn_handle;
1531 uint8_t ch_map[5];
1533
1534
1547typedef struct
1548{
1549 uint16_t conn_handle;
1550 uint8_t disable;
1552
1553
1574typedef struct
1575{
1576 uint8_t const * p_passkey;
1578
1579
1595typedef struct
1596{
1597 uint8_t enable : 1;
1599
1600
1625
1635
1670
1671
1683
1684
1701SVCALL(SD_BLE_GAP_ADV_ADDR_GET, uint32_t, sd_ble_gap_adv_addr_get(uint8_t adv_handle, ble_gap_addr_t *p_addr));
1702
1703
1727SVCALL(SD_BLE_GAP_WHITELIST_SET, uint32_t, sd_ble_gap_whitelist_set(ble_gap_addr_t const * const * pp_wl_addrs, uint8_t len));
1728
1729
1759SVCALL(SD_BLE_GAP_DEVICE_IDENTITIES_SET, uint32_t, sd_ble_gap_device_identities_set(ble_gap_id_key_t const * const * pp_id_keys, ble_gap_irk_t const * const * pp_local_irks, uint8_t len));
1760
1761
1789
1790
1803
1804
1848SVCALL(SD_BLE_GAP_ADV_SET_CONFIGURE, uint32_t, sd_ble_gap_adv_set_configure(uint8_t *p_adv_handle, ble_gap_adv_data_t const *p_adv_data, ble_gap_adv_params_t const *p_adv_params));
1849
1850
1897SVCALL(SD_BLE_GAP_ADV_START, uint32_t, sd_ble_gap_adv_start(uint8_t adv_handle, uint8_t conn_cfg_tag));
1898
1899
1913SVCALL(SD_BLE_GAP_ADV_STOP, uint32_t, sd_ble_gap_adv_stop(uint8_t adv_handle));
1914
1915
1950SVCALL(SD_BLE_GAP_CONN_PARAM_UPDATE, uint32_t, sd_ble_gap_conn_param_update(uint16_t conn_handle, ble_gap_conn_params_t const *p_conn_params));
1951
1952
1975SVCALL(SD_BLE_GAP_DISCONNECT, uint32_t, sd_ble_gap_disconnect(uint16_t conn_handle, uint8_t hci_status_code));
1976
1977
2000SVCALL(SD_BLE_GAP_TX_POWER_SET, uint32_t, sd_ble_gap_tx_power_set(uint8_t role, uint16_t handle, int8_t tx_power));
2001
2002
2010SVCALL(SD_BLE_GAP_APPEARANCE_SET, uint32_t, sd_ble_gap_appearance_set(uint16_t appearance));
2011
2012
2020SVCALL(SD_BLE_GAP_APPEARANCE_GET, uint32_t, sd_ble_gap_appearance_get(uint16_t *p_appearance));
2021
2022
2033SVCALL(SD_BLE_GAP_PPCP_SET, uint32_t, sd_ble_gap_ppcp_set(ble_gap_conn_params_t const *p_conn_params));
2034
2035
2046
2047
2063SVCALL(SD_BLE_GAP_DEVICE_NAME_SET, uint32_t, sd_ble_gap_device_name_set(ble_gap_conn_sec_mode_t const *p_write_perm, uint8_t const *p_dev_name, uint16_t len));
2064
2065
2080SVCALL(SD_BLE_GAP_DEVICE_NAME_GET, uint32_t, sd_ble_gap_device_name_get(uint8_t *p_dev_name, uint16_t *p_len));
2081
2082
2136SVCALL(SD_BLE_GAP_AUTHENTICATE, uint32_t, sd_ble_gap_authenticate(uint16_t conn_handle, ble_gap_sec_params_t const *p_sec_params));
2137
2138
2199SVCALL(SD_BLE_GAP_SEC_PARAMS_REPLY, uint32_t, sd_ble_gap_sec_params_reply(uint16_t conn_handle, uint8_t sec_status, ble_gap_sec_params_t const *p_sec_params, ble_gap_sec_keyset_t const *p_sec_keyset));
2200
2201
2234SVCALL(SD_BLE_GAP_AUTH_KEY_REPLY, uint32_t, sd_ble_gap_auth_key_reply(uint16_t conn_handle, uint8_t key_type, uint8_t const *p_key));
2235
2236
2277SVCALL(SD_BLE_GAP_LESC_DHKEY_REPLY, uint32_t, sd_ble_gap_lesc_dhkey_reply(uint16_t conn_handle, uint8_t sec_status, ble_gap_lesc_dhkey_t const *p_dhkey));
2278
2279
2299SVCALL(SD_BLE_GAP_KEYPRESS_NOTIFY, uint32_t, sd_ble_gap_keypress_notify(uint16_t conn_handle, uint8_t kp_not));
2300
2301
2320SVCALL(SD_BLE_GAP_LESC_OOB_DATA_GET, uint32_t, sd_ble_gap_lesc_oob_data_get(uint16_t conn_handle, ble_gap_lesc_p256_pk_t const *p_pk_own, ble_gap_lesc_oob_data_t *p_oobd_own));
2321
2322
2353SVCALL(SD_BLE_GAP_LESC_OOB_DATA_SET, uint32_t, sd_ble_gap_lesc_oob_data_set(uint16_t conn_handle, ble_gap_lesc_oob_data_t const *p_oobd_own, ble_gap_lesc_oob_data_t const *p_oobd_peer));
2354
2355
2383SVCALL(SD_BLE_GAP_ENCRYPT, uint32_t, sd_ble_gap_encrypt(uint16_t conn_handle, ble_gap_master_id_t const *p_master_id, ble_gap_enc_info_t const *p_enc_info));
2384
2385
2405SVCALL(SD_BLE_GAP_SEC_INFO_REPLY, uint32_t, sd_ble_gap_sec_info_reply(uint16_t conn_handle, ble_gap_enc_info_t const *p_enc_info));
2406
2407
2417SVCALL(SD_BLE_GAP_CONN_SEC_GET, uint32_t, sd_ble_gap_conn_sec_get(uint16_t conn_handle, ble_gap_conn_sec_t *p_conn_sec));
2418
2419
2474SVCALL(SD_BLE_GAP_SCAN_START, uint32_t, sd_ble_gap_scan_start(ble_gap_scan_params_t const *p_scan_params, ble_data_t const * p_adv_report_buffer));
2475
2476
2490
2491
2536SVCALL(SD_BLE_GAP_CONNECT, uint32_t, sd_ble_gap_connect(ble_gap_addr_t const *p_peer_addr, ble_gap_scan_params_t const *p_scan_params, ble_gap_conn_params_t const *p_conn_params, uint8_t conn_cfg_tag));
2537
2538
2550
2551
2605SVCALL(SD_BLE_GAP_PHY_UPDATE, uint32_t, sd_ble_gap_phy_update(uint16_t conn_handle, ble_gap_phys_t const *p_gap_phys));
2606
2607
2642SVCALL(SD_BLE_GAP_DATA_LENGTH_UPDATE, uint32_t, sd_ble_gap_data_length_update(uint16_t conn_handle, ble_gap_data_length_params_t const *p_dl_params, ble_gap_data_length_limitation_t *p_dl_limitation));
2643
2644
2666SVCALL(SD_BLE_GAP_NEXT_CONN_EVT_COUNTER_GET, uint32_t, sd_ble_gap_next_conn_evt_counter_get(uint16_t conn_handle, uint16_t * p_counter));
2667
2668
2692SVCALL(SD_BLE_GAP_EVT_TRIGGER_SET, uint32_t, sd_ble_gap_evt_trigger_set(uint8_t role, uint16_t handle, uint32_t task_address));
2693
2694
2718SVCALL(SD_BLE_GAP_RSSI_START, uint32_t, sd_ble_gap_rssi_start(uint16_t conn_handle, uint8_t threshold_dbm, uint8_t skip_count));
2719
2720
2737SVCALL(SD_BLE_GAP_RSSI_STOP, uint32_t, sd_ble_gap_rssi_stop(uint16_t conn_handle));
2738
2739
2758SVCALL(SD_BLE_GAP_RSSI_GET, uint32_t, sd_ble_gap_rssi_get(uint16_t conn_handle, int8_t *p_rssi, uint8_t *p_ch_index));
2759
2760
2773
2774
2777#ifdef __cplusplus
2778}
2779#endif
2780#endif // BLE_GAP_H__
2781
#define BLE_GAP_PASSKEY_LEN
GAP Passkey Length.
Definition ble_gap.h:615
#define BLE_GAP_LESC_DHKEY_LEN
GAP LE Secure Connections Elliptic Curve Diffie-Hellman DHKey Length.
Definition ble_gap.h:611
#define BLE_GAP_ADDR_LEN
BLE address length.
Definition ble_gap.h:245
#define BLE_GAP_SEC_RAND_LEN
GAP Security Random Number Length.
Definition ble_gap.h:599
#define BLE_GAP_LESC_P256_PK_LEN
GAP LE Secure Connections Elliptic Curve Diffie-Hellman P-256 Public Key Length.
Definition ble_gap.h:607
#define BLE_GAP_SEC_KEY_LEN
GAP Security Key Length.
Definition ble_gap.h:603
BLE_GAP_QOS_CONN_EVENT_REPORT
QOS connection event report enable.
Definition ble_gap.h:189
@ BLE_GAP_QOS_CONN_EVENT_REPORT_DISABLE
Definition ble_gap.h:190
@ BLE_GAP_QOS_CONN_EVENT_REPORT_ENABLE
Definition ble_gap.h:191
BLE_GAP_OPTS
GAP Option IDs. IDs that uniquely identify a GAP option.
Definition ble_gap.h:144
@ BLE_GAP_OPT_SLAVE_LATENCY_DISABLE
Definition ble_gap.h:149
@ BLE_GAP_OPT_AUTH_PAYLOAD_TIMEOUT
Definition ble_gap.h:148
@ BLE_GAP_OPT_COMPAT_MODE_1
Definition ble_gap.h:147
@ BLE_GAP_OPT_CH_MAP
Definition ble_gap.h:145
@ BLE_GAP_OPT_PASSKEY
Definition ble_gap.h:146
BLE_GAP_LL_ROLES
GAP LL roles.
Definition ble_gap.h:178
@ BLE_GAP_LL_ROLE_CONN
Definition ble_gap.h:181
@ BLE_GAP_LL_ROLE_SCAN
Definition ble_gap.h:179
@ BLE_GAP_LL_ROLE_INIT
Definition ble_gap.h:180
@ BLE_GAP_LL_ROLE_ADV
Definition ble_gap.h:182
BLE_GAP_CFGS
GAP Configuration IDs.
Definition ble_gap.h:157
@ BLE_GAP_CFG_DEVICE_NAME
Definition ble_gap.h:159
@ BLE_GAP_CFG_PPCP_INCL_CONFIG
Definition ble_gap.h:160
@ BLE_GAP_CFG_ROLE_COUNT
Definition ble_gap.h:158
@ BLE_GAP_CFG_CAR_INCL_CONFIG
Definition ble_gap.h:162
BLE_GAP_TX_POWER_ROLES
GAP TX Power roles.
Definition ble_gap.h:169
@ BLE_GAP_TX_POWER_ROLE_ADV
Definition ble_gap.h:170
@ BLE_GAP_TX_POWER_ROLE_CONN
Definition ble_gap.h:172
@ BLE_GAP_TX_POWER_ROLE_SCAN_INIT
Definition ble_gap.h:171
BLE_GAP_EVTS
GAP Event IDs. IDs that uniquely identify an event coming from the stack to the application.
Definition ble_gap.h:114
@ BLE_GAP_EVT_DISCONNECTED
Definition ble_gap.h:116
@ BLE_GAP_EVT_LESC_DHKEY_REQUEST
Definition ble_gap.h:123
@ BLE_GAP_EVT_ADV_SET_TERMINATED
Definition ble_gap.h:136
@ BLE_GAP_EVT_CONN_SEC_UPDATE
Definition ble_gap.h:125
@ BLE_GAP_EVT_ADV_REPORT
Definition ble_gap.h:128
@ BLE_GAP_EVT_RSSI_CHANGED
Definition ble_gap.h:127
@ BLE_GAP_EVT_TIMEOUT
Definition ble_gap.h:126
@ BLE_GAP_EVT_AUTH_KEY_REQUEST
Definition ble_gap.h:122
@ BLE_GAP_EVT_SEC_PARAMS_REQUEST
Definition ble_gap.h:118
@ BLE_GAP_EVT_QOS_CONN_EVENT_REPORT
Definition ble_gap.h:137
@ BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST
Definition ble_gap.h:134
@ BLE_GAP_EVT_PHY_UPDATE_REQUEST
Definition ble_gap.h:132
@ BLE_GAP_EVT_AUTH_STATUS
Definition ble_gap.h:124
@ BLE_GAP_EVT_SEC_REQUEST
Definition ble_gap.h:129
@ BLE_GAP_EVT_CONN_PARAM_UPDATE
Definition ble_gap.h:117
@ BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST
Definition ble_gap.h:130
@ BLE_GAP_EVT_CONNECTED
Definition ble_gap.h:115
@ BLE_GAP_EVT_DATA_LENGTH_UPDATE
Definition ble_gap.h:135
@ BLE_GAP_EVT_PHY_UPDATE
Definition ble_gap.h:133
@ BLE_GAP_EVT_SCAN_REQ_REPORT
Definition ble_gap.h:131
@ BLE_GAP_EVT_PASSKEY_DISPLAY
Definition ble_gap.h:120
@ BLE_GAP_EVT_SEC_INFO_REQUEST
Definition ble_gap.h:119
@ BLE_GAP_EVT_KEY_PRESSED
Definition ble_gap.h:121
BLE_GAP_SVCS
GAP API SVC numbers.
Definition ble_gap.h:66
@ SD_BLE_GAP_PRIVACY_SET
Definition ble_gap.h:72
@ SD_BLE_GAP_ADV_SET_CONFIGURE
Definition ble_gap.h:74
@ SD_BLE_GAP_QOS_CONN_EVENT_REPORT_ENABLE
Definition ble_gap.h:107
@ SD_BLE_GAP_RSSI_START
Definition ble_gap.h:105
@ SD_BLE_GAP_KEYPRESS_NOTIFY
Definition ble_gap.h:90
@ SD_BLE_GAP_RSSI_STOP
Definition ble_gap.h:106
@ SD_BLE_GAP_ADV_START
Definition ble_gap.h:75
@ SD_BLE_GAP_LESC_OOB_DATA_GET
Definition ble_gap.h:91
@ SD_BLE_GAP_PPCP_SET
Definition ble_gap.h:82
@ SD_BLE_GAP_LESC_DHKEY_REPLY
Definition ble_gap.h:89
@ SD_BLE_GAP_PRIVACY_GET
Definition ble_gap.h:73
@ SD_BLE_GAP_ADDR_GET
Definition ble_gap.h:68
@ SD_BLE_GAP_ADV_STOP
Definition ble_gap.h:76
@ SD_BLE_GAP_DISCONNECT
Definition ble_gap.h:78
@ SD_BLE_GAP_APPEARANCE_GET
Definition ble_gap.h:81
@ SD_BLE_GAP_EVT_TRIGGER_SET
Definition ble_gap.h:103
@ SD_BLE_GAP_APPEARANCE_SET
Definition ble_gap.h:80
@ SD_BLE_GAP_DEVICE_NAME_GET
Definition ble_gap.h:85
@ SD_BLE_GAP_CONN_PARAM_UPDATE
Definition ble_gap.h:77
@ SD_BLE_GAP_PHY_UPDATE
Definition ble_gap.h:100
@ SD_BLE_GAP_AUTHENTICATE
Definition ble_gap.h:86
@ SD_BLE_GAP_DATA_LENGTH_UPDATE
Definition ble_gap.h:101
@ SD_BLE_GAP_NEXT_CONN_EVT_COUNTER_GET
Definition ble_gap.h:102
@ SD_BLE_GAP_SCAN_STOP
Definition ble_gap.h:97
@ SD_BLE_GAP_RSSI_GET
Definition ble_gap.h:104
@ SD_BLE_GAP_ADV_ADDR_GET
Definition ble_gap.h:69
@ SD_BLE_GAP_ENCRYPT
Definition ble_gap.h:93
@ SD_BLE_GAP_WHITELIST_SET
Definition ble_gap.h:70
@ SD_BLE_GAP_CONNECT
Definition ble_gap.h:98
@ SD_BLE_GAP_SEC_INFO_REPLY
Definition ble_gap.h:94
@ SD_BLE_GAP_SEC_PARAMS_REPLY
Definition ble_gap.h:87
@ SD_BLE_GAP_DEVICE_NAME_SET
Definition ble_gap.h:84
@ SD_BLE_GAP_CONN_SEC_GET
Definition ble_gap.h:95
@ SD_BLE_GAP_LESC_OOB_DATA_SET
Definition ble_gap.h:92
@ SD_BLE_GAP_PPCP_GET
Definition ble_gap.h:83
@ SD_BLE_GAP_AUTH_KEY_REPLY
Definition ble_gap.h:88
@ SD_BLE_GAP_DEVICE_IDENTITIES_SET
Definition ble_gap.h:71
@ SD_BLE_GAP_CONNECT_CANCEL
Definition ble_gap.h:99
@ SD_BLE_GAP_SCAN_START
Definition ble_gap.h:96
@ SD_BLE_GAP_TX_POWER_SET
Definition ble_gap.h:79
@ SD_BLE_GAP_ADDR_SET
Definition ble_gap.h:67
uint32_t sd_ble_gap_auth_key_reply(uint16_t conn_handle, uint8_t key_type, uint8_t const *p_key)
Reply with an authentication key.
uint32_t sd_ble_gap_conn_sec_get(uint16_t conn_handle, ble_gap_conn_sec_t *p_conn_sec)
Get the current connection security.
uint32_t sd_ble_gap_addr_get(ble_gap_addr_t *p_addr)
Get local Bluetooth identity address.
uint32_t sd_ble_gap_scan_stop(void)
Stop scanning (GAP Discovery procedure, Observer Procedure).
uint32_t sd_ble_gap_device_identities_set(ble_gap_id_key_t const *const *pp_id_keys, ble_gap_irk_t const *const *pp_local_irks, uint8_t len)
Set device identity list.
uint32_t sd_ble_gap_privacy_set(ble_gap_privacy_params_t const *p_privacy_params)
Set privacy settings.
uint32_t sd_ble_gap_lesc_dhkey_reply(uint16_t conn_handle, uint8_t sec_status, ble_gap_lesc_dhkey_t const *p_dhkey)
Reply with an LE Secure connections DHKey.
uint32_t sd_ble_gap_disconnect(uint16_t conn_handle, uint8_t hci_status_code)
Disconnect (GAP Link Termination).
uint32_t sd_ble_gap_appearance_get(uint16_t *p_appearance)
Get GAP Appearance value.
uint32_t sd_ble_gap_adv_addr_get(uint8_t adv_handle, ble_gap_addr_t *p_addr)
Get the Bluetooth device address used by the advertiser.
uint32_t sd_ble_gap_lesc_oob_data_get(uint16_t conn_handle, ble_gap_lesc_p256_pk_t const *p_pk_own, ble_gap_lesc_oob_data_t *p_oobd_own)
Generate a set of OOB data to send to a peer out of band.
uint32_t sd_ble_gap_encrypt(uint16_t conn_handle, ble_gap_master_id_t const *p_master_id, ble_gap_enc_info_t const *p_enc_info)
Initiate GAP Encryption procedure.
uint32_t sd_ble_gap_authenticate(uint16_t conn_handle, ble_gap_sec_params_t const *p_sec_params)
Initiate the GAP Authentication procedure.
uint32_t sd_ble_gap_rssi_get(uint16_t conn_handle, int8_t *p_rssi, uint8_t *p_ch_index)
Get the received signal strength for the last connection event.
uint32_t sd_ble_gap_rssi_stop(uint16_t conn_handle)
Stop reporting the received signal strength.
uint32_t sd_ble_gap_evt_trigger_set(uint8_t role, uint16_t handle, uint32_t task_address)
Configure triggering a peripheral task register on the start of a Bluetooth Link Layer event.
uint32_t sd_ble_gap_lesc_oob_data_set(uint16_t conn_handle, ble_gap_lesc_oob_data_t const *p_oobd_own, ble_gap_lesc_oob_data_t const *p_oobd_peer)
Provide the OOB data sent/received out of band.
uint32_t sd_ble_gap_device_name_get(uint8_t *p_dev_name, uint16_t *p_len)
Get GAP device name.
uint32_t sd_ble_gap_adv_stop(uint8_t adv_handle)
Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure).
uint32_t sd_ble_gap_adv_start(uint8_t adv_handle, uint8_t conn_cfg_tag)
Start advertising (GAP Discoverable, Connectable modes, Broadcast Procedure).
uint32_t sd_ble_gap_sec_params_reply(uint16_t conn_handle, uint8_t sec_status, ble_gap_sec_params_t const *p_sec_params, ble_gap_sec_keyset_t const *p_sec_keyset)
Reply with GAP security parameters.
uint32_t sd_ble_gap_keypress_notify(uint16_t conn_handle, uint8_t kp_not)
Notify the peer of a local keypress.
uint32_t sd_ble_gap_ppcp_set(ble_gap_conn_params_t const *p_conn_params)
Set GAP Peripheral Preferred Connection Parameters.
uint32_t sd_ble_gap_privacy_get(ble_gap_privacy_params_t *p_privacy_params)
Get privacy settings.
uint32_t sd_ble_gap_adv_set_configure(uint8_t *p_adv_handle, ble_gap_adv_data_t const *p_adv_data, ble_gap_adv_params_t const *p_adv_params)
Configure an advertising set. Set, clear or update advertising and scan response data.
uint32_t sd_ble_gap_connect_cancel(void)
Cancel a connection establishment.
uint32_t sd_ble_gap_next_conn_evt_counter_get(uint16_t conn_handle, uint16_t *p_counter)
Obtain the next connection event counter value.
uint32_t sd_ble_gap_ppcp_get(ble_gap_conn_params_t *p_conn_params)
Get GAP Peripheral Preferred Connection Parameters.
uint32_t sd_ble_gap_phy_update(uint16_t conn_handle, ble_gap_phys_t const *p_gap_phys)
Initiate or respond to a PHY Update Procedure.
uint32_t sd_ble_gap_scan_start(ble_gap_scan_params_t const *p_scan_params, ble_data_t const *p_adv_report_buffer)
Start or continue scanning (GAP Discovery procedure, Observer Procedure).
uint32_t sd_ble_gap_rssi_start(uint16_t conn_handle, uint8_t threshold_dbm, uint8_t skip_count)
Start reporting the received signal strength to the application.
uint32_t sd_ble_gap_data_length_update(uint16_t conn_handle, ble_gap_data_length_params_t const *p_dl_params, ble_gap_data_length_limitation_t *p_dl_limitation)
Initiate or respond to a Data Length Update Procedure.
uint32_t sd_ble_gap_connect(ble_gap_addr_t const *p_peer_addr, ble_gap_scan_params_t const *p_scan_params, ble_gap_conn_params_t const *p_conn_params, uint8_t conn_cfg_tag)
Create a connection (GAP Link Establishment).
uint32_t sd_ble_gap_whitelist_set(ble_gap_addr_t const *const *pp_wl_addrs, uint8_t len)
Set the active whitelist in the SoftDevice.
uint32_t sd_ble_gap_sec_info_reply(uint16_t conn_handle, ble_gap_enc_info_t const *p_enc_info)
Reply with GAP security information.
uint32_t sd_ble_gap_tx_power_set(uint8_t role, uint16_t handle, int8_t tx_power)
Set the radio's transmit power.
uint32_t sd_ble_gap_appearance_set(uint16_t appearance)
Set GAP Appearance value.
uint32_t sd_ble_gap_device_name_set(ble_gap_conn_sec_mode_t const *p_write_perm, uint8_t const *p_dev_name, uint16_t len)
Set GAP device name.
uint32_t sd_ble_gap_qos_conn_event_report_enable(uint8_t enable)
Enable or disable Quality of Service (QoS) connection event reporting.
uint32_t sd_ble_gap_addr_set(ble_gap_addr_t const *p_addr)
Set the local Bluetooth identity address.
uint32_t sd_ble_gap_conn_param_update(uint16_t conn_handle, ble_gap_conn_params_t const *p_conn_params)
Update connection parameters.
uint8_t ble_gap_ch_mask_t[5]
Channel mask (40 bits). Every channel is represented with a bit positioned as per channel index defin...
Definition ble_gap.h:806
#define BLE_GAP_OPT_BASE
Definition ble_ranges.h:101
#define BLE_GAP_EVT_BASE
Definition ble_ranges.h:85
#define BLE_GAP_CFG_BASE
Definition ble_ranges.h:123
#define BLE_GAP_SVC_BASE
Definition ble_ranges.h:69
Data structure.
Definition ble_types.h:200
uint8_t addr_id_peer
Definition ble_gap.h:740
uint8_t addr_type
Definition ble_gap.h:746
Bluetooth Low Energy address.
Definition ble_gap.h:739
ble_data_t scan_rsp_data
Definition ble_gap.h:894
ble_data_t adv_data
Definition ble_gap.h:890
GAP advertising data buffers.
Definition ble_gap.h:889
ble_gap_addr_t const * p_peer_addr
Definition ble_gap.h:813
uint16_t duration
Definition ble_gap.h:831
ble_gap_ch_mask_t channel_mask
Definition ble_gap.h:844
uint8_t scan_req_notification
Definition ble_gap.h:878
uint8_t set_id
Definition ble_gap.h:874
uint8_t filter_policy
Definition ble_gap.h:847
uint32_t interval
Definition ble_gap.h:827
uint8_t primary_phy
Definition ble_gap.h:848
uint8_t secondary_phy
Definition ble_gap.h:858
ble_gap_adv_properties_t properties
Definition ble_gap.h:812
uint8_t max_adv_evts
Definition ble_gap.h:836
GAP advertising parameters.
Definition ble_gap.h:811
uint8_t type
Definition ble_gap.h:710
uint8_t anonymous
Definition ble_gap.h:711
uint8_t include_tx_power
Definition ble_gap.h:715
Advertising event properties.
Definition ble_gap.h:709
uint16_t reserved
Definition ble_gap.h:727
uint16_t scannable
Definition ble_gap.h:722
uint16_t connectable
Definition ble_gap.h:721
uint16_t directed
Definition ble_gap.h:723
uint16_t extended_pdu
Definition ble_gap.h:725
uint16_t status
Definition ble_gap.h:726
uint16_t scan_response
Definition ble_gap.h:724
Advertising report type.
Definition ble_gap.h:720
uint16_t aux_offset
Definition ble_gap.h:733
uint8_t aux_phy
Definition ble_gap.h:734
Advertising Auxiliary Pointer.
Definition ble_gap.h:732
uint8_t include_cfg
Definition ble_gap.h:1489
Central Address Resolution include configuration parameters, set with sd_ble_cfg_set.
Definition ble_gap.h:1488
uint8_t vloc
Definition ble_gap.h:1470
ble_gap_conn_sec_mode_t write_perm
Definition ble_gap.h:1469
uint8_t * p_value
Definition ble_gap.h:1471
uint16_t current_len
Definition ble_gap.h:1472
uint16_t max_len
Definition ble_gap.h:1473
Device name and its properties, set with sd_ble_cfg_set.
Definition ble_gap.h:1468
uint8_t include_cfg
Definition ble_gap.h:1480
Peripheral Preferred Connection Parameters include configuration parameters, set with sd_ble_cfg_set.
Definition ble_gap.h:1479
uint8_t central_sec_count
Definition ble_gap.h:1435
uint8_t adv_set_count
Definition ble_gap.h:1432
uint8_t central_role_count
Definition ble_gap.h:1434
uint8_t periph_role_count
Definition ble_gap.h:1433
Configuration of maximum concurrent connections in the different connected roles, set with sd_ble_cfg...
Definition ble_gap.h:1431
uint8_t conn_count
Definition ble_gap.h:1405
uint16_t event_length
Definition ble_gap.h:1407
BLE GAP connection configuration parameters, set with sd_ble_cfg_set.
Definition ble_gap.h:1404
uint16_t min_conn_interval
Definition ble_gap.h:765
uint16_t slave_latency
Definition ble_gap.h:767
uint16_t conn_sup_timeout
Definition ble_gap.h:768
uint16_t max_conn_interval
Definition ble_gap.h:766
GAP connection parameters.
Definition ble_gap.h:764
uint8_t lv
Definition ble_gap.h:782
uint8_t sm
Definition ble_gap.h:781
GAP connection security modes.
Definition ble_gap.h:780
uint8_t encr_key_size
Definition ble_gap.h:791
ble_gap_conn_sec_mode_t sec_mode
Definition ble_gap.h:790
GAP connection security status.
Definition ble_gap.h:789
uint16_t tx_payload_limited_octets
Definition ble_gap.h:1208
uint16_t rx_payload_limited_octets
Definition ble_gap.h:1209
uint16_t tx_rx_time_limited_us
Definition ble_gap.h:1210
Data Length Update Procedure local limitation.
Definition ble_gap.h:1207
uint16_t max_tx_time_us
Definition ble_gap.h:1200
uint16_t max_rx_octets
Definition ble_gap.h:1199
uint16_t max_tx_octets
Definition ble_gap.h:1198
uint16_t max_rx_time_us
Definition ble_gap.h:1201
Data Length Update Procedure parameters.
Definition ble_gap.h:1197
uint8_t auth
Definition ble_gap.h:1027
uint8_t ltk_len
Definition ble_gap.h:1028
uint8_t lesc
Definition ble_gap.h:1026
GAP Encryption Information.
Definition ble_gap.h:1024
ble_gap_enc_info_t enc_info
Definition ble_gap.h:1164
ble_gap_master_id_t master_id
Definition ble_gap.h:1165
Encryption Key.
Definition ble_gap.h:1163
uint8_t primary_phy
Definition ble_gap.h:1287
ble_gap_aux_pointer_t aux_pointer
Definition ble_gap.h:1304
ble_gap_adv_report_type_t type
Definition ble_gap.h:1274
int8_t tx_power
Definition ble_gap.h:1292
uint8_t set_id
Definition ble_gap.h:1298
int8_t rssi
Definition ble_gap.h:1296
ble_gap_addr_t direct_addr
Definition ble_gap.h:1278
ble_gap_addr_t peer_addr
Definition ble_gap.h:1275
ble_data_t data
Definition ble_gap.h:1300
uint8_t secondary_phy
Definition ble_gap.h:1289
Event structure for BLE_GAP_EVT_ADV_REPORT.
Definition ble_gap.h:1273
uint8_t reason
Definition ble_gap.h:1257
uint8_t num_completed_adv_events
Definition ble_gap.h:1260
uint8_t adv_handle
Definition ble_gap.h:1259
Event structure for BLE_GAP_EVT_ADV_SET_TERMINATED.
Definition ble_gap.h:1256
uint8_t key_type
Definition ble_gap.h:1137
Event structure for BLE_GAP_EVT_AUTH_KEY_REQUEST.
Definition ble_gap.h:1136
ble_gap_sec_kdist_t kdist_own
Definition ble_gap.h:1222
ble_gap_sec_kdist_t kdist_peer
Definition ble_gap.h:1223
uint8_t bonded
Definition ble_gap.h:1219
ble_gap_sec_levels_t sm1_levels
Definition ble_gap.h:1221
uint8_t auth_status
Definition ble_gap.h:1217
uint8_t error_src
Definition ble_gap.h:1218
uint8_t lesc
Definition ble_gap.h:1220
Event structure for BLE_GAP_EVT_AUTH_STATUS.
Definition ble_gap.h:1216
ble_gap_conn_params_t conn_params
Definition ble_gap.h:1323
Event structure for BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST.
Definition ble_gap.h:1322
ble_gap_conn_params_t conn_params
Definition ble_gap.h:1085
Event structure for BLE_GAP_EVT_CONN_PARAM_UPDATE.
Definition ble_gap.h:1084
ble_gap_conn_sec_t conn_sec
Definition ble_gap.h:1230
Event structure for BLE_GAP_EVT_CONN_SEC_UPDATE.
Definition ble_gap.h:1229
ble_gap_conn_params_t conn_params
Definition ble_gap.h:1069
ble_gap_addr_t peer_addr
Definition ble_gap.h:1066
uint8_t role
Definition ble_gap.h:1068
uint8_t adv_handle
Definition ble_gap.h:1070
Event structure for BLE_GAP_EVT_CONNECTED.
Definition ble_gap.h:1065
ble_gap_data_length_params_t peer_params
Definition ble_gap.h:1340
Event structure for BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST.
Definition ble_gap.h:1339
ble_gap_data_length_params_t effective_params
Definition ble_gap.h:1347
Event structure for BLE_GAP_EVT_DATA_LENGTH_UPDATE.
Definition ble_gap.h:1346
uint8_t reason
Definition ble_gap.h:1078
Event structure for BLE_GAP_EVT_DISCONNECTED.
Definition ble_gap.h:1077
uint8_t kp_not
Definition ble_gap.h:1130
Event structure for BLE_GAP_EVT_KEY_PRESSED.
Definition ble_gap.h:1129
uint8_t oobd_req
Definition ble_gap.h:1145
ble_gap_lesc_p256_pk_t * p_pk_peer
Definition ble_gap.h:1143
Event structure for BLE_GAP_EVT_LESC_DHKEY_REQUEST.
Definition ble_gap.h:1142
uint8_t match_request
Definition ble_gap.h:1122
Event structure for BLE_GAP_EVT_PASSKEY_DISPLAY.
Definition ble_gap.h:1120
ble_gap_phys_t peer_preferred_phys
Definition ble_gap.h:1091
Event structure for BLE_GAP_EVT_PHY_UPDATE_REQUEST.
Definition ble_gap.h:1090
uint8_t status
Definition ble_gap.h:1097
uint8_t rx_phy
Definition ble_gap.h:1099
uint8_t tx_phy
Definition ble_gap.h:1098
Event Structure for BLE_GAP_EVT_PHY_UPDATE.
Definition ble_gap.h:1096
uint16_t crc_ok_count
Definition ble_gap.h:1356
uint16_t crc_error_count
Definition ble_gap.h:1357
uint8_t ch_index
Definition ble_gap.h:1355
uint16_t nak_count
Definition ble_gap.h:1358
uint8_t rx_timeout
Definition ble_gap.h:1359
uint16_t event_counter
Definition ble_gap.h:1354
Event structure for BLE_GAP_EVT_QOS_CONN_EVENT_REPORT.
Definition ble_gap.h:1353
uint8_t ch_index
Definition ble_gap.h:1251
int8_t rssi
Definition ble_gap.h:1249
Event structure for BLE_GAP_EVT_RSSI_CHANGED.
Definition ble_gap.h:1248
ble_gap_addr_t peer_addr
Definition ble_gap.h:1333
uint8_t adv_handle
Definition ble_gap.h:1330
int8_t rssi
Definition ble_gap.h:1331
Event structure for BLE_GAP_EVT_SCAN_REQ_REPORT.
Definition ble_gap.h:1329
ble_gap_addr_t peer_addr
Definition ble_gap.h:1112
uint8_t id_info
Definition ble_gap.h:1115
ble_gap_master_id_t master_id
Definition ble_gap.h:1113
uint8_t enc_info
Definition ble_gap.h:1114
Event structure for BLE_GAP_EVT_SEC_INFO_REQUEST.
Definition ble_gap.h:1111
ble_gap_sec_params_t peer_params
Definition ble_gap.h:1105
Event structure for BLE_GAP_EVT_SEC_PARAMS_REQUEST.
Definition ble_gap.h:1104
uint8_t bond
Definition ble_gap.h:1313
uint8_t keypress
Definition ble_gap.h:1316
uint8_t lesc
Definition ble_gap.h:1315
uint8_t mitm
Definition ble_gap.h:1314
Event structure for BLE_GAP_EVT_SEC_REQUEST.
Definition ble_gap.h:1312
ble_gap_evt_data_length_update_t data_length_update
Definition ble_gap.h:1389
ble_gap_evt_adv_set_terminated_t adv_set_terminated
Definition ble_gap.h:1382
ble_gap_evt_sec_request_t sec_request
Definition ble_gap.h:1383
ble_gap_evt_conn_param_update_request_t conn_param_update_request
Definition ble_gap.h:1384
ble_gap_evt_phy_update_request_t phy_update_request
Definition ble_gap.h:1386
ble_gap_evt_disconnected_t disconnected
Definition ble_gap.h:1369
ble_gap_evt_qos_conn_event_report_t qos_conn_event_report
Definition ble_gap.h:1390
uint16_t conn_handle
Definition ble_gap.h:1365
ble_gap_evt_passkey_display_t passkey_display
Definition ble_gap.h:1373
ble_gap_evt_rssi_changed_t rssi_changed
Definition ble_gap.h:1380
ble_gap_evt_sec_info_request_t sec_info_request
Definition ble_gap.h:1372
ble_gap_evt_adv_report_t adv_report
Definition ble_gap.h:1381
ble_gap_evt_sec_params_request_t sec_params_request
Definition ble_gap.h:1371
ble_gap_evt_auth_key_request_t auth_key_request
Definition ble_gap.h:1375
ble_gap_evt_data_length_update_request_t data_length_update_request
Definition ble_gap.h:1388
ble_gap_evt_conn_sec_update_t conn_sec_update
Definition ble_gap.h:1378
ble_gap_evt_auth_status_t auth_status
Definition ble_gap.h:1377
ble_gap_evt_conn_param_update_t conn_param_update
Definition ble_gap.h:1370
ble_gap_evt_key_pressed_t key_pressed
Definition ble_gap.h:1374
ble_gap_evt_phy_update_t phy_update
Definition ble_gap.h:1387
ble_gap_evt_lesc_dhkey_request_t lesc_dhkey_request
Definition ble_gap.h:1376
ble_gap_evt_timeout_t timeout
Definition ble_gap.h:1379
ble_gap_evt_connected_t connected
Definition ble_gap.h:1368
ble_gap_evt_scan_req_report_t scan_req_report
Definition ble_gap.h:1385
GAP event structure.
Definition ble_gap.h:1364
ble_data_t adv_report_buffer
Definition ble_gap.h:1240
uint8_t src
Definition ble_gap.h:1237
Event structure for BLE_GAP_EVT_TIMEOUT.
Definition ble_gap.h:1236
ble_gap_addr_t id_addr_info
Definition ble_gap.h:1173
ble_gap_irk_t id_info
Definition ble_gap.h:1172
Identity Key.
Definition ble_gap.h:1171
Identity Resolving Key.
Definition ble_gap.h:796
GAP LE Secure Connections DHKey.
Definition ble_gap.h:1049
ble_gap_addr_t addr
Definition ble_gap.h:1057
GAP LE Secure Connections OOB data.
Definition ble_gap.h:1056
GAP LE Secure Connections P-256 Public Key.
Definition ble_gap.h:1042
uint16_t ediv
Definition ble_gap.h:1035
GAP Master Identification.
Definition ble_gap.h:1034
uint16_t conn_handle
Definition ble_gap.h:1622
uint16_t auth_payload_timeout
Definition ble_gap.h:1623
Authenticated payload timeout option.
Definition ble_gap.h:1621
uint16_t conn_handle
Definition ble_gap.h:1530
Channel Map option.
Definition ble_gap.h:1529
uint8_t enable
Definition ble_gap.h:1597
Compatibility mode 1 option.
Definition ble_gap.h:1596
uint8_t const * p_passkey
Definition ble_gap.h:1576
Passkey Option.
Definition ble_gap.h:1575
uint8_t disable
Definition ble_gap.h:1550
uint16_t conn_handle
Definition ble_gap.h:1549
Disable slave latency.
Definition ble_gap.h:1548
uint8_t tx_phys
Definition ble_gap.h:990
uint8_t rx_phys
Definition ble_gap.h:991
PHY preferences for TX and RX.
Definition ble_gap.h:989
ble_gap_irk_t * p_device_irk
Definition ble_gap.h:975
uint8_t private_addr_type
Definition ble_gap.h:973
uint8_t privacy_mode
Definition ble_gap.h:972
uint16_t private_addr_cycle_s
Definition ble_gap.h:974
Privacy.
Definition ble_gap.h:971
uint16_t timeout
Definition ble_gap.h:945
uint8_t report_incomplete_evts
Definition ble_gap.h:907
uint8_t scan_phys
Definition ble_gap.h:920
uint32_t interval
Definition ble_gap.h:938
ble_gap_ch_mask_t channel_mask
Definition ble_gap.h:946
uint8_t active
Definition ble_gap.h:914
uint8_t extended
Definition ble_gap.h:903
uint8_t filter_policy
Definition ble_gap.h:916
uint32_t window
Definition ble_gap.h:939
GAP scanning parameters.
Definition ble_gap.h:902
uint8_t id
Definition ble_gap.h:998
uint8_t enc
Definition ble_gap.h:997
Keys that can be exchanged during a bonding procedure.
Definition ble_gap.h:996
ble_gap_enc_key_t * p_enc_key
Definition ble_gap.h:1180
ble_gap_id_key_t * p_id_key
Definition ble_gap.h:1181
ble_gap_lesc_p256_pk_t * p_pk
Definition ble_gap.h:1182
Security Keys.
Definition ble_gap.h:1179
ble_gap_sec_keys_t keys_peer
Definition ble_gap.h:1191
ble_gap_sec_keys_t keys_own
Definition ble_gap.h:1190
Security key set for both local and peer keys.
Definition ble_gap.h:1189
uint8_t lv2
Definition ble_gap.h:1155
uint8_t lv4
Definition ble_gap.h:1157
uint8_t lv3
Definition ble_gap.h:1156
uint8_t lv1
Definition ble_gap.h:1154
Security levels supported.
Definition ble_gap.h:1153
uint8_t io_caps
Definition ble_gap.h:1009
uint8_t lesc
Definition ble_gap.h:1007
uint8_t max_key_size
Definition ble_gap.h:1016
uint8_t min_key_size
Definition ble_gap.h:1015
uint8_t oob
Definition ble_gap.h:1010
ble_gap_sec_kdist_t kdist_peer
Definition ble_gap.h:1018
uint8_t mitm
Definition ble_gap.h:1006
uint8_t keypress
Definition ble_gap.h:1008
uint8_t bond
Definition ble_gap.h:1005
ble_gap_sec_kdist_t kdist_own
Definition ble_gap.h:1017
GAP security parameters.
Definition ble_gap.h:1004
ble_gap_cfg_car_incl_cfg_t car_include_cfg
Definition ble_gap.h:1500
ble_gap_cfg_device_name_t device_name_cfg
Definition ble_gap.h:1497
ble_gap_cfg_role_count_t role_count_cfg
Definition ble_gap.h:1496
ble_gap_cfg_ppcp_incl_cfg_t ppcp_include_cfg
Definition ble_gap.h:1498
Configuration structure for GAP configurations.
Definition ble_gap.h:1495
ble_gap_opt_auth_payload_timeout_t auth_payload_timeout
Definition ble_gap.h:1632
ble_gap_opt_ch_map_t ch_map
Definition ble_gap.h:1629
ble_gap_opt_slave_latency_disable_t slave_latency_disable
Definition ble_gap.h:1633
ble_gap_opt_passkey_t passkey
Definition ble_gap.h:1630
ble_gap_opt_compat_mode_1_t compat_mode_1
Definition ble_gap.h:1631
Option structure for GAP options.
Definition ble_gap.h:1628