Glimworm Beacons / nRF51822

Fork of nRF51822 by Nordic Semiconductor

Committer:
rgrover1
Date:
Mon Jul 06 10:13:27 2015 +0100
Revision:
371:8f7d2137727a
Parent:
370:295f76db798e
Synchronized with git rev 2716309c
Author: Rohit Grover
Release 0.4.0
=============

This is a major release which introduces the GATT Client functionality. It
aligns with release 0.4.0 of BLE_API.

Enhancements
~~~~~~~~~~~~

* Introduce GattClient. This includes functionality for service-discovery,
connections, and attribute-reads and writes. You'll find a demo program for
LEDBlinker on the mbed.org Bluetooth team page to use the new APIs. Some of
the GATT client functionality hasn't been implemented yet, but the APIs have
been added.

* We've added an implementation for the abstract base class for
SecurityManager. All security related APIs have been moved into that.

* There has been a major cleanup of APIs under BLE. APIs have now been
categorized as belonging to Gap, GattServer, GattClient, or SecurityManager.
There are accessors to get references for Gap, GattServer, GattClient, and
SecurityManager. A former call to ble.setAddress(...) is now expected to be
achieved with ble.gap().setAddress(...).

* We've cleaned up our APIs, and this has resulted in dropping some APIs like
BLE::reset().

* We've also dropped GattServer::initializeGattDatabase(). THis was added at
some point to support controllers where a commit point was needed to
indicate when the application had finished constructing the GATT database.
This API would get called internally before Gap::startAdvertising(). We now
expect the underlying port to do the equivalent of initializeGattDatabase()
implicitly upon Gap::startAdvertising().

* We've added a version of Gap::disconnect() which takes a connection handle.
The previous API (which did not take a connection handle) has been
deprecated; it will still work for situations where there's only a single
active connection. We hold on to that API to allow existing code to migrate
to the new API.

Bugfixes
~~~~~~~~

* None.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rgrover1 371:8f7d2137727a 1 /*
rgrover1 371:8f7d2137727a 2 * Copyright (c) Nordic Semiconductor ASA
rgrover1 371:8f7d2137727a 3 * All rights reserved.
rgrover1 371:8f7d2137727a 4 *
rgrover1 371:8f7d2137727a 5 * Redistribution and use in source and binary forms, with or without modification,
rgrover1 371:8f7d2137727a 6 * are permitted provided that the following conditions are met:
rgrover1 371:8f7d2137727a 7 *
rgrover1 371:8f7d2137727a 8 * 1. Redistributions of source code must retain the above copyright notice, this
rgrover1 371:8f7d2137727a 9 * list of conditions and the following disclaimer.
rgrover1 371:8f7d2137727a 10 *
rgrover1 371:8f7d2137727a 11 * 2. Redistributions in binary form must reproduce the above copyright notice, this
rgrover1 371:8f7d2137727a 12 * list of conditions and the following disclaimer in the documentation and/or
rgrover1 371:8f7d2137727a 13 * other materials provided with the distribution.
rgrover1 371:8f7d2137727a 14 *
rgrover1 371:8f7d2137727a 15 * 3. Neither the name of Nordic Semiconductor ASA nor the names of other
rgrover1 371:8f7d2137727a 16 * contributors to this software may be used to endorse or promote products
rgrover1 371:8f7d2137727a 17 * derived from this software without specific prior written permission.
rgrover1 371:8f7d2137727a 18 *
rgrover1 371:8f7d2137727a 19 *
rgrover1 371:8f7d2137727a 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
rgrover1 371:8f7d2137727a 21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
rgrover1 371:8f7d2137727a 22 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
rgrover1 371:8f7d2137727a 23 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
rgrover1 371:8f7d2137727a 24 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
rgrover1 371:8f7d2137727a 25 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
rgrover1 371:8f7d2137727a 26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
rgrover1 371:8f7d2137727a 27 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
rgrover1 371:8f7d2137727a 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
rgrover1 371:8f7d2137727a 29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
rgrover1 371:8f7d2137727a 30 *
rgrover1 371:8f7d2137727a 31 */
rgrover1 371:8f7d2137727a 32
rgrover1 371:8f7d2137727a 33 /**
rgrover1 371:8f7d2137727a 34 @addtogroup BLE_GAP Generic Access Profile (GAP)
rgrover1 371:8f7d2137727a 35 @{
rgrover1 371:8f7d2137727a 36 @brief Definitions and prototypes for the GAP interface.
rgrover1 371:8f7d2137727a 37 */
rgrover1 371:8f7d2137727a 38
rgrover1 371:8f7d2137727a 39 #ifndef BLE_GAP_H__
rgrover1 371:8f7d2137727a 40 #define BLE_GAP_H__
rgrover1 371:8f7d2137727a 41
rgrover1 371:8f7d2137727a 42 #include "ble_types.h"
rgrover1 371:8f7d2137727a 43 #include "ble_ranges.h"
rgrover1 371:8f7d2137727a 44 #include "nrf_svc.h"
rgrover1 371:8f7d2137727a 45
rgrover1 371:8f7d2137727a 46 /**@addtogroup BLE_GAP_ENUMERATIONS Enumerations
rgrover1 371:8f7d2137727a 47 * @{ */
rgrover1 371:8f7d2137727a 48
rgrover1 371:8f7d2137727a 49 /**@brief GAP API SVC numbers.
rgrover1 371:8f7d2137727a 50 */
rgrover1 371:8f7d2137727a 51 enum BLE_GAP_SVCS
rgrover1 371:8f7d2137727a 52 {
rgrover1 371:8f7d2137727a 53 SD_BLE_GAP_ADDRESS_SET = BLE_GAP_SVC_BASE, /**< Set own Bluetooth Address. */
rgrover1 371:8f7d2137727a 54 SD_BLE_GAP_ADDRESS_GET, /**< Get own Bluetooth Address. */
rgrover1 371:8f7d2137727a 55 SD_BLE_GAP_ADV_DATA_SET, /**< Set Advertising Data. */
rgrover1 371:8f7d2137727a 56 SD_BLE_GAP_ADV_START, /**< Start Advertising. */
rgrover1 371:8f7d2137727a 57 SD_BLE_GAP_ADV_STOP, /**< Stop Advertising. */
rgrover1 371:8f7d2137727a 58 SD_BLE_GAP_CONN_PARAM_UPDATE, /**< Connection Parameter Update. */
rgrover1 371:8f7d2137727a 59 SD_BLE_GAP_DISCONNECT, /**< Disconnect. */
rgrover1 371:8f7d2137727a 60 SD_BLE_GAP_TX_POWER_SET, /**< Set TX Power. */
rgrover1 371:8f7d2137727a 61 SD_BLE_GAP_APPEARANCE_SET, /**< Set Appearance. */
rgrover1 371:8f7d2137727a 62 SD_BLE_GAP_APPEARANCE_GET, /**< Get Appearance. */
rgrover1 371:8f7d2137727a 63 SD_BLE_GAP_PPCP_SET, /**< Set PPCP. */
rgrover1 371:8f7d2137727a 64 SD_BLE_GAP_PPCP_GET, /**< Get PPCP. */
rgrover1 371:8f7d2137727a 65 SD_BLE_GAP_DEVICE_NAME_SET, /**< Set Device Name. */
rgrover1 371:8f7d2137727a 66 SD_BLE_GAP_DEVICE_NAME_GET, /**< Get Device Name. */
rgrover1 371:8f7d2137727a 67 SD_BLE_GAP_AUTHENTICATE, /**< Initiate Pairing/Bonding. */
rgrover1 371:8f7d2137727a 68 SD_BLE_GAP_SEC_PARAMS_REPLY, /**< Reply with Security Parameters. */
rgrover1 371:8f7d2137727a 69 SD_BLE_GAP_AUTH_KEY_REPLY, /**< Reply with an authentication key. */
rgrover1 371:8f7d2137727a 70 SD_BLE_GAP_ENCRYPT, /**< Initiate encryption procedure. */
rgrover1 371:8f7d2137727a 71 SD_BLE_GAP_SEC_INFO_REPLY, /**< Reply with Security Information. */
rgrover1 371:8f7d2137727a 72 SD_BLE_GAP_CONN_SEC_GET, /**< Obtain connection security level. */
rgrover1 371:8f7d2137727a 73 SD_BLE_GAP_RSSI_START, /**< Start reporting of changes in RSSI. */
rgrover1 371:8f7d2137727a 74 SD_BLE_GAP_RSSI_STOP, /**< Stop reporting of changes in RSSI. */
rgrover1 371:8f7d2137727a 75 SD_BLE_GAP_SCAN_START, /**< Start Scanning. */
rgrover1 371:8f7d2137727a 76 SD_BLE_GAP_SCAN_STOP, /**< Stop Scanning. */
rgrover1 371:8f7d2137727a 77 SD_BLE_GAP_CONNECT, /**< Connect. */
rgrover1 371:8f7d2137727a 78 SD_BLE_GAP_CONNECT_CANCEL, /**< Cancel ongoing connection procedure. */
rgrover1 371:8f7d2137727a 79 SD_BLE_GAP_RSSI_GET, /**< Get the last RSSI sample. */
rgrover1 371:8f7d2137727a 80 };
rgrover1 371:8f7d2137727a 81
rgrover1 371:8f7d2137727a 82 /**@brief GAP Event IDs.
rgrover1 371:8f7d2137727a 83 * IDs that uniquely identify an event coming from the stack to the application.
rgrover1 371:8f7d2137727a 84 */
rgrover1 371:8f7d2137727a 85 enum BLE_GAP_EVTS
rgrover1 371:8f7d2137727a 86 {
rgrover1 371:8f7d2137727a 87 BLE_GAP_EVT_CONNECTED = BLE_GAP_EVT_BASE, /**< Connection established. @ref ble_gap_evt_connected_t */
rgrover1 371:8f7d2137727a 88 BLE_GAP_EVT_DISCONNECTED, /**< Disconnected from peer. @ref ble_gap_evt_disconnected_t */
rgrover1 371:8f7d2137727a 89 BLE_GAP_EVT_CONN_PARAM_UPDATE, /**< Connection Parameters updated. ble_gap_evt_conn_param_update_t */
rgrover1 371:8f7d2137727a 90 BLE_GAP_EVT_SEC_PARAMS_REQUEST, /**< Request to provide security parameters. @ref ble_gap_evt_sec_params_request_t */
rgrover1 371:8f7d2137727a 91 BLE_GAP_EVT_SEC_INFO_REQUEST, /**< Request to provide security information. @ref ble_gap_evt_sec_info_request_t */
rgrover1 371:8f7d2137727a 92 BLE_GAP_EVT_PASSKEY_DISPLAY, /**< Request to display a passkey to the user. @ref ble_gap_evt_passkey_display_t */
rgrover1 371:8f7d2137727a 93 BLE_GAP_EVT_AUTH_KEY_REQUEST, /**< Request to provide an authentication key. @ref ble_gap_evt_auth_key_request_t */
rgrover1 371:8f7d2137727a 94 BLE_GAP_EVT_AUTH_STATUS, /**< Authentication procedure completed with status. @ref ble_gap_evt_auth_status_t */
rgrover1 371:8f7d2137727a 95 BLE_GAP_EVT_CONN_SEC_UPDATE, /**< Connection security updated. @ref ble_gap_evt_conn_sec_update_t */
rgrover1 371:8f7d2137727a 96 BLE_GAP_EVT_TIMEOUT, /**< Timeout expired. @ref ble_gap_evt_timeout_t */
rgrover1 371:8f7d2137727a 97 BLE_GAP_EVT_RSSI_CHANGED, /**< RSSI report. @ref ble_gap_evt_rssi_changed_t */
rgrover1 371:8f7d2137727a 98 BLE_GAP_EVT_ADV_REPORT, /**< Advertising report. @ref ble_gap_evt_adv_report_t */
rgrover1 371:8f7d2137727a 99 BLE_GAP_EVT_SEC_REQUEST, /**< Security Request. @ref ble_gap_evt_sec_request_t */
rgrover1 371:8f7d2137727a 100 BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST, /**< Connection Parameter Update Request. @ref ble_gap_evt_conn_param_update_request_t */
rgrover1 371:8f7d2137727a 101 BLE_GAP_EVT_SCAN_REQ_REPORT, /**< Scan request report. @ref ble_gap_evt_scan_req_report_t */
rgrover1 371:8f7d2137727a 102 };
rgrover1 371:8f7d2137727a 103
rgrover1 371:8f7d2137727a 104 /**@brief GAP Option IDs.
rgrover1 371:8f7d2137727a 105 * IDs that uniquely identify a GAP option.
rgrover1 371:8f7d2137727a 106 */
rgrover1 371:8f7d2137727a 107 enum BLE_GAP_OPTS
rgrover1 371:8f7d2137727a 108 {
rgrover1 371:8f7d2137727a 109 BLE_GAP_OPT_CH_MAP = BLE_GAP_OPT_BASE, /**< Channel Map. @ref ble_gap_opt_ch_map_t */
rgrover1 371:8f7d2137727a 110 BLE_GAP_OPT_LOCAL_CONN_LATENCY, /**< Local connection latency. @ref ble_gap_opt_local_conn_latency_t */
rgrover1 371:8f7d2137727a 111 BLE_GAP_OPT_PASSKEY, /**< Set passkey. @ref ble_gap_opt_passkey_t */
rgrover1 371:8f7d2137727a 112 BLE_GAP_OPT_PRIVACY, /**< Custom privacy. @ref ble_gap_opt_privacy_t */
rgrover1 371:8f7d2137727a 113 BLE_GAP_OPT_SCAN_REQ_REPORT, /**< Scan request report. @ref ble_gap_opt_scan_req_report_t */
rgrover1 371:8f7d2137727a 114 BLE_GAP_OPT_COMPAT_MODE /**< Compatibility mode. @ref ble_gap_opt_compat_mode_t */
rgrover1 371:8f7d2137727a 115 };
rgrover1 371:8f7d2137727a 116 /** @} */
rgrover1 371:8f7d2137727a 117
rgrover1 371:8f7d2137727a 118 /**@addtogroup BLE_GAP_DEFINES Defines
rgrover1 371:8f7d2137727a 119 * @{ */
rgrover1 371:8f7d2137727a 120
rgrover1 371:8f7d2137727a 121 /**@defgroup BLE_ERRORS_GAP SVC return values specific to GAP
rgrover1 371:8f7d2137727a 122 * @{ */
rgrover1 371:8f7d2137727a 123 #define BLE_ERROR_GAP_UUID_LIST_MISMATCH (NRF_GAP_ERR_BASE + 0x000) /**< UUID list does not contain an integral number of UUIDs. */
rgrover1 371:8f7d2137727a 124 #define BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST (NRF_GAP_ERR_BASE + 0x001) /**< Use of Whitelist not permitted with discoverable advertising. */
rgrover1 371:8f7d2137727a 125 #define BLE_ERROR_GAP_INVALID_BLE_ADDR (NRF_GAP_ERR_BASE + 0x002) /**< The upper two bits of the address do not correspond to the specified address type. */
rgrover1 371:8f7d2137727a 126 #define BLE_ERROR_GAP_WHITELIST_IN_USE (NRF_GAP_ERR_BASE + 0x003) /**< Attempt to overwrite the whitelist while already in use by another operation. */
rgrover1 371:8f7d2137727a 127 /**@} */
rgrover1 371:8f7d2137727a 128
rgrover1 371:8f7d2137727a 129
rgrover1 371:8f7d2137727a 130 /**@defgroup BLE_GAP_ROLES GAP Roles
rgrover1 371:8f7d2137727a 131 * @note Not explicitly used in peripheral API, but will be relevant for central API.
rgrover1 371:8f7d2137727a 132 * @{ */
rgrover1 371:8f7d2137727a 133 #define BLE_GAP_ROLE_INVALID 0x0 /**< Invalid Role. */
rgrover1 371:8f7d2137727a 134 #define BLE_GAP_ROLE_PERIPH 0x1 /**< Peripheral Role. */
rgrover1 371:8f7d2137727a 135 #define BLE_GAP_ROLE_CENTRAL 0x2 /**< Central Role. */
rgrover1 371:8f7d2137727a 136 /**@} */
rgrover1 371:8f7d2137727a 137
rgrover1 371:8f7d2137727a 138
rgrover1 371:8f7d2137727a 139 /**@defgroup BLE_GAP_TIMEOUT_SOURCES GAP Timeout sources
rgrover1 371:8f7d2137727a 140 * @{ */
rgrover1 371:8f7d2137727a 141 #define BLE_GAP_TIMEOUT_SRC_ADVERTISING 0x00 /**< Advertising timeout. */
rgrover1 371:8f7d2137727a 142 #define BLE_GAP_TIMEOUT_SRC_SECURITY_REQUEST 0x01 /**< Security request timeout. */
rgrover1 371:8f7d2137727a 143 #define BLE_GAP_TIMEOUT_SRC_SCAN 0x02 /**< Scanning timeout. */
rgrover1 371:8f7d2137727a 144 #define BLE_GAP_TIMEOUT_SRC_CONN 0x03 /**< Connection timeout. */
rgrover1 371:8f7d2137727a 145 /**@} */
rgrover1 371:8f7d2137727a 146
rgrover1 371:8f7d2137727a 147
rgrover1 371:8f7d2137727a 148 /**@defgroup BLE_GAP_ADDR_TYPES GAP Address types
rgrover1 371:8f7d2137727a 149 * @{ */
rgrover1 371:8f7d2137727a 150 #define BLE_GAP_ADDR_TYPE_PUBLIC 0x00 /**< Public address. */
rgrover1 371:8f7d2137727a 151 #define BLE_GAP_ADDR_TYPE_RANDOM_STATIC 0x01 /**< Random Static address. */
rgrover1 371:8f7d2137727a 152 #define BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE 0x02 /**< Private Resolvable address. */
rgrover1 371:8f7d2137727a 153 #define BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE 0x03 /**< Private Non-Resolvable address. */
rgrover1 371:8f7d2137727a 154 /**@} */
rgrover1 371:8f7d2137727a 155
rgrover1 371:8f7d2137727a 156 /**@defgroup BLE_GAP_ADDR_CYCLE_MODES GAP Address cycle modes
rgrover1 371:8f7d2137727a 157 * @{ */
rgrover1 371:8f7d2137727a 158 #define BLE_GAP_ADDR_CYCLE_MODE_NONE 0x00 /**< Set addresses directly, no automatic address cycling. */
rgrover1 371:8f7d2137727a 159 #define BLE_GAP_ADDR_CYCLE_MODE_AUTO 0x01 /**< Automatically generate and update private addresses. */
rgrover1 371:8f7d2137727a 160 /** @} */
rgrover1 371:8f7d2137727a 161
rgrover1 371:8f7d2137727a 162 /**@brief The default interval in seconds at which a private address is refreshed when address cycle mode is @ref BLE_GAP_ADDR_CYCLE_MODE_AUTO. */
rgrover1 371:8f7d2137727a 163 #define BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S (60 * 15)
rgrover1 371:8f7d2137727a 164
rgrover1 371:8f7d2137727a 165 /** @brief BLE address length. */
rgrover1 371:8f7d2137727a 166 #define BLE_GAP_ADDR_LEN 6
rgrover1 371:8f7d2137727a 167
rgrover1 371:8f7d2137727a 168
rgrover1 371:8f7d2137727a 169 /**@defgroup BLE_GAP_AD_TYPE_DEFINITIONS GAP Advertising and Scan Response Data format
rgrover1 371:8f7d2137727a 170 * @note Found at https://www.bluetooth.org/Technical/AssignedNumbers/generic_access_profile.htm
rgrover1 371:8f7d2137727a 171 * @{ */
rgrover1 371:8f7d2137727a 172 #define BLE_GAP_AD_TYPE_FLAGS 0x01 /**< Flags for discoverability. */
rgrover1 371:8f7d2137727a 173 #define BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE 0x02 /**< Partial list of 16 bit service UUIDs. */
rgrover1 371:8f7d2137727a 174 #define BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_COMPLETE 0x03 /**< Complete list of 16 bit service UUIDs. */
rgrover1 371:8f7d2137727a 175 #define BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE 0x04 /**< Partial list of 32 bit service UUIDs. */
rgrover1 371:8f7d2137727a 176 #define BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_COMPLETE 0x05 /**< Complete list of 32 bit service UUIDs. */
rgrover1 371:8f7d2137727a 177 #define BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE 0x06 /**< Partial list of 128 bit service UUIDs. */
rgrover1 371:8f7d2137727a 178 #define BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE 0x07 /**< Complete list of 128 bit service UUIDs. */
rgrover1 371:8f7d2137727a 179 #define BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME 0x08 /**< Short local device name. */
rgrover1 371:8f7d2137727a 180 #define BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME 0x09 /**< Complete local device name. */
rgrover1 371:8f7d2137727a 181 #define BLE_GAP_AD_TYPE_TX_POWER_LEVEL 0x0A /**< Transmit power level. */
rgrover1 371:8f7d2137727a 182 #define BLE_GAP_AD_TYPE_CLASS_OF_DEVICE 0x0D /**< Class of device. */
rgrover1 371:8f7d2137727a 183 #define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C 0x0E /**< Simple Pairing Hash C. */
rgrover1 371:8f7d2137727a 184 #define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R 0x0F /**< Simple Pairing Randomizer R. */
rgrover1 371:8f7d2137727a 185 #define BLE_GAP_AD_TYPE_SECURITY_MANAGER_TK_VALUE 0x10 /**< Security Manager TK Value. */
rgrover1 371:8f7d2137727a 186 #define BLE_GAP_AD_TYPE_SECURITY_MANAGER_OOB_FLAGS 0x11 /**< Security Manager Out Of Band Flags. */
rgrover1 371:8f7d2137727a 187 #define BLE_GAP_AD_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE 0x12 /**< Slave Connection Interval Range. */
rgrover1 371:8f7d2137727a 188 #define BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_16BIT 0x14 /**< List of 16-bit Service Solicitation UUIDs. */
rgrover1 371:8f7d2137727a 189 #define BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_128BIT 0x15 /**< List of 128-bit Service Solicitation UUIDs. */
rgrover1 371:8f7d2137727a 190 #define BLE_GAP_AD_TYPE_SERVICE_DATA 0x16 /**< Service Data - 16-bit UUID. */
rgrover1 371:8f7d2137727a 191 #define BLE_GAP_AD_TYPE_PUBLIC_TARGET_ADDRESS 0x17 /**< Public Target Address. */
rgrover1 371:8f7d2137727a 192 #define BLE_GAP_AD_TYPE_RANDOM_TARGET_ADDRESS 0x18 /**< Random Target Address. */
rgrover1 371:8f7d2137727a 193 #define BLE_GAP_AD_TYPE_APPEARANCE 0x19 /**< Appearance. */
rgrover1 371:8f7d2137727a 194 #define BLE_GAP_AD_TYPE_ADVERTISING_INTERVAL 0x1A /**< Advertising Interval. */
rgrover1 371:8f7d2137727a 195 #define BLE_GAP_AD_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS 0x1B /**< LE Bluetooth Device Address. */
rgrover1 371:8f7d2137727a 196 #define BLE_GAP_AD_TYPE_LE_ROLE 0x1C /**< LE Role. */
rgrover1 371:8f7d2137727a 197 #define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C256 0x1D /**< Simple Pairing Hash C-256. */
rgrover1 371:8f7d2137727a 198 #define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R256 0x1E /**< Simple Pairing Randomizer R-256. */
rgrover1 371:8f7d2137727a 199 #define BLE_GAP_AD_TYPE_SERVICE_DATA_32BIT_UUID 0x20 /**< Service Data - 32-bit UUID. */
rgrover1 371:8f7d2137727a 200 #define BLE_GAP_AD_TYPE_SERVICE_DATA_128BIT_UUID 0x21 /**< Service Data - 128-bit UUID. */
rgrover1 371:8f7d2137727a 201 #define BLE_GAP_AD_TYPE_3D_INFORMATION_DATA 0x3D /**< 3D Information Data. */
rgrover1 371:8f7d2137727a 202 #define BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA 0xFF /**< Manufacturer Specific Data. */
rgrover1 371:8f7d2137727a 203 /**@} */
rgrover1 371:8f7d2137727a 204
rgrover1 371:8f7d2137727a 205
rgrover1 371:8f7d2137727a 206 /**@defgroup BLE_GAP_ADV_FLAGS GAP Advertisement Flags
rgrover1 371:8f7d2137727a 207 * @{ */
rgrover1 371:8f7d2137727a 208 #define BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE (0x01) /**< LE Limited Discoverable Mode. */
rgrover1 371:8f7d2137727a 209 #define BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE (0x02) /**< LE General Discoverable Mode. */
rgrover1 371:8f7d2137727a 210 #define BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED (0x04) /**< BR/EDR not supported. */
rgrover1 371:8f7d2137727a 211 #define BLE_GAP_ADV_FLAG_LE_BR_EDR_CONTROLLER (0x08) /**< Simultaneous LE and BR/EDR, Controller. */
rgrover1 371:8f7d2137727a 212 #define BLE_GAP_ADV_FLAG_LE_BR_EDR_HOST (0x10) /**< Simultaneous LE and BR/EDR, Host. */
rgrover1 371:8f7d2137727a 213 #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) /**< LE Limited Discoverable Mode, BR/EDR not supported. */
rgrover1 371:8f7d2137727a 214 #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) /**< LE General Discoverable Mode, BR/EDR not supported. */
rgrover1 371:8f7d2137727a 215 /**@} */
rgrover1 371:8f7d2137727a 216
rgrover1 371:8f7d2137727a 217
rgrover1 371:8f7d2137727a 218 /**@defgroup BLE_GAP_ADV_INTERVALS GAP Advertising interval max and min
rgrover1 371:8f7d2137727a 219 * @{ */
rgrover1 371:8f7d2137727a 220 #define BLE_GAP_ADV_INTERVAL_MIN 0x0020 /**< Minimum Advertising interval in 625 us units, i.e. 20 ms. */
rgrover1 371:8f7d2137727a 221 #define BLE_GAP_ADV_NONCON_INTERVAL_MIN 0x00A0 /**< Minimum Advertising interval in 625 us units for non connectable mode, i.e. 100 ms. */
rgrover1 371:8f7d2137727a 222 #define BLE_GAP_ADV_INTERVAL_MAX 0x4000 /**< Maximum Advertising interval in 625 us units, i.e. 10.24 s. */
rgrover1 371:8f7d2137727a 223 /**@} */
rgrover1 371:8f7d2137727a 224
rgrover1 371:8f7d2137727a 225
rgrover1 371:8f7d2137727a 226 /**@defgroup BLE_GAP_SCAN_INTERVALS GAP Scan interval max and min
rgrover1 371:8f7d2137727a 227 * @{ */
rgrover1 371:8f7d2137727a 228 #define BLE_GAP_SCAN_INTERVAL_MIN 0x0004 /**< Minimum Scan interval in 625 us units, i.e. 2.5 ms. */
rgrover1 371:8f7d2137727a 229 #define BLE_GAP_SCAN_INTERVAL_MAX 0x4000 /**< Maximum Scan interval in 625 us units, i.e. 10.24 s. */
rgrover1 371:8f7d2137727a 230 /** @} */
rgrover1 371:8f7d2137727a 231
rgrover1 371:8f7d2137727a 232
rgrover1 371:8f7d2137727a 233 /**@defgroup BLE_GAP_SCAN_WINDOW GAP Scan window max and min
rgrover1 371:8f7d2137727a 234 * @{ */
rgrover1 371:8f7d2137727a 235 #define BLE_GAP_SCAN_WINDOW_MIN 0x0004 /**< Minimum Scan window in 625 us units, i.e. 2.5 ms. */
rgrover1 371:8f7d2137727a 236 #define BLE_GAP_SCAN_WINDOW_MAX 0x4000 /**< Maximum Scan window in 625 us units, i.e. 10.24 s. */
rgrover1 371:8f7d2137727a 237 /** @} */
rgrover1 371:8f7d2137727a 238
rgrover1 371:8f7d2137727a 239
rgrover1 371:8f7d2137727a 240 /**@defgroup BLE_GAP_SCAN_TIMEOUT GAP Scan timeout max and min
rgrover1 371:8f7d2137727a 241 * @{ */
rgrover1 371:8f7d2137727a 242 #define BLE_GAP_SCAN_TIMEOUT_MIN 0x0001 /**< Minimum Scan timeout in seconds. */
rgrover1 371:8f7d2137727a 243 #define BLE_GAP_SCAN_TIMEOUT_MAX 0xFFFF /**< Maximum Scan timeout in seconds. */
rgrover1 371:8f7d2137727a 244 /** @} */
rgrover1 371:8f7d2137727a 245
rgrover1 371:8f7d2137727a 246
rgrover1 371:8f7d2137727a 247 /**@brief Maximum size of advertising data in octets. */
rgrover1 371:8f7d2137727a 248 #define BLE_GAP_ADV_MAX_SIZE 31
rgrover1 371:8f7d2137727a 249
rgrover1 371:8f7d2137727a 250
rgrover1 371:8f7d2137727a 251 /**@defgroup BLE_GAP_ADV_TYPES GAP Advertising types
rgrover1 371:8f7d2137727a 252 * @{ */
rgrover1 371:8f7d2137727a 253 #define BLE_GAP_ADV_TYPE_ADV_IND 0x00 /**< Connectable undirected. */
rgrover1 371:8f7d2137727a 254 #define BLE_GAP_ADV_TYPE_ADV_DIRECT_IND 0x01 /**< Connectable directed. */
rgrover1 371:8f7d2137727a 255 #define BLE_GAP_ADV_TYPE_ADV_SCAN_IND 0x02 /**< Scannable undirected. */
rgrover1 371:8f7d2137727a 256 #define BLE_GAP_ADV_TYPE_ADV_NONCONN_IND 0x03 /**< Non connectable undirected. */
rgrover1 371:8f7d2137727a 257 /**@} */
rgrover1 371:8f7d2137727a 258
rgrover1 371:8f7d2137727a 259
rgrover1 371:8f7d2137727a 260 /**@defgroup BLE_GAP_ADV_FILTER_POLICIES GAP Advertising filter policies
rgrover1 371:8f7d2137727a 261 * @{ */
rgrover1 371:8f7d2137727a 262 #define BLE_GAP_ADV_FP_ANY 0x00 /**< Allow scan requests and connect requests from any device. */
rgrover1 371:8f7d2137727a 263 #define BLE_GAP_ADV_FP_FILTER_SCANREQ 0x01 /**< Filter scan requests with whitelist. */
rgrover1 371:8f7d2137727a 264 #define BLE_GAP_ADV_FP_FILTER_CONNREQ 0x02 /**< Filter connect requests with whitelist. */
rgrover1 371:8f7d2137727a 265 #define BLE_GAP_ADV_FP_FILTER_BOTH 0x03 /**< Filter both scan and connect requests with whitelist. */
rgrover1 371:8f7d2137727a 266 /**@} */
rgrover1 371:8f7d2137727a 267
rgrover1 371:8f7d2137727a 268
rgrover1 371:8f7d2137727a 269 /**@defgroup BLE_GAP_ADV_TIMEOUT_VALUES GAP Advertising timeout values
rgrover1 371:8f7d2137727a 270 * @{ */
rgrover1 371:8f7d2137727a 271 #define BLE_GAP_ADV_TIMEOUT_LIMITED_MAX 180 /**< Maximum advertising time in limited discoverable mode (TGAP(lim_adv_timeout) = 180s). */
rgrover1 371:8f7d2137727a 272 #define BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED 0 /**< Unlimited advertising in general discoverable mode. */
rgrover1 371:8f7d2137727a 273 /**@} */
rgrover1 371:8f7d2137727a 274
rgrover1 371:8f7d2137727a 275
rgrover1 371:8f7d2137727a 276 /**@defgroup BLE_GAP_DISC_MODES GAP Discovery modes
rgrover1 371:8f7d2137727a 277 * @{ */
rgrover1 371:8f7d2137727a 278 #define BLE_GAP_DISC_MODE_NOT_DISCOVERABLE 0x00 /**< Not discoverable discovery Mode. */
rgrover1 371:8f7d2137727a 279 #define BLE_GAP_DISC_MODE_LIMITED 0x01 /**< Limited Discovery Mode. */
rgrover1 371:8f7d2137727a 280 #define BLE_GAP_DISC_MODE_GENERAL 0x02 /**< General Discovery Mode. */
rgrover1 371:8f7d2137727a 281 /**@} */
rgrover1 371:8f7d2137727a 282
rgrover1 371:8f7d2137727a 283 /**@defgroup BLE_GAP_IO_CAPS GAP IO Capabilities
rgrover1 371:8f7d2137727a 284 * @{ */
rgrover1 371:8f7d2137727a 285 #define BLE_GAP_IO_CAPS_DISPLAY_ONLY 0x00 /**< Display Only. */
rgrover1 371:8f7d2137727a 286 #define BLE_GAP_IO_CAPS_DISPLAY_YESNO 0x01 /**< Display and Yes/No entry. */
rgrover1 371:8f7d2137727a 287 #define BLE_GAP_IO_CAPS_KEYBOARD_ONLY 0x02 /**< Keyboard Only. */
rgrover1 371:8f7d2137727a 288 #define BLE_GAP_IO_CAPS_NONE 0x03 /**< No I/O capabilities. */
rgrover1 371:8f7d2137727a 289 #define BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY 0x04 /**< Keyboard and Display. */
rgrover1 371:8f7d2137727a 290 /**@} */
rgrover1 371:8f7d2137727a 291
rgrover1 371:8f7d2137727a 292
rgrover1 371:8f7d2137727a 293 /**@defgroup BLE_GAP_AUTH_KEY_TYPES GAP Authentication Key Types
rgrover1 371:8f7d2137727a 294 * @{ */
rgrover1 371:8f7d2137727a 295 #define BLE_GAP_AUTH_KEY_TYPE_NONE 0x00 /**< No key (may be used to reject). */
rgrover1 371:8f7d2137727a 296 #define BLE_GAP_AUTH_KEY_TYPE_PASSKEY 0x01 /**< 6-digit Passkey. */
rgrover1 371:8f7d2137727a 297 #define BLE_GAP_AUTH_KEY_TYPE_OOB 0x02 /**< Out Of Band data. */
rgrover1 371:8f7d2137727a 298 /**@} */
rgrover1 371:8f7d2137727a 299
rgrover1 371:8f7d2137727a 300 /**@defgroup BLE_GAP_SEC_STATUS GAP Security status
rgrover1 371:8f7d2137727a 301 * @{ */
rgrover1 371:8f7d2137727a 302 #define BLE_GAP_SEC_STATUS_SUCCESS 0x00 /**< Procedure completed with success. */
rgrover1 371:8f7d2137727a 303 #define BLE_GAP_SEC_STATUS_TIMEOUT 0x01 /**< Procedure timed out. */
rgrover1 371:8f7d2137727a 304 #define BLE_GAP_SEC_STATUS_PDU_INVALID 0x02 /**< Invalid PDU received. */
rgrover1 371:8f7d2137727a 305 #define BLE_GAP_SEC_STATUS_RFU_RANGE1_BEGIN 0x03 /**< Reserved for Future Use range #1 begin. */
rgrover1 371:8f7d2137727a 306 #define BLE_GAP_SEC_STATUS_RFU_RANGE1_END 0x80 /**< Reserved for Future Use range #1 end. */
rgrover1 371:8f7d2137727a 307 #define BLE_GAP_SEC_STATUS_PASSKEY_ENTRY_FAILED 0x81 /**< Passkey entry failed (user cancelled or other). */
rgrover1 371:8f7d2137727a 308 #define BLE_GAP_SEC_STATUS_OOB_NOT_AVAILABLE 0x82 /**< Out of Band Key not available. */
rgrover1 371:8f7d2137727a 309 #define BLE_GAP_SEC_STATUS_AUTH_REQ 0x83 /**< Authentication requirements not met. */
rgrover1 371:8f7d2137727a 310 #define BLE_GAP_SEC_STATUS_CONFIRM_VALUE 0x84 /**< Confirm value failed. */
rgrover1 371:8f7d2137727a 311 #define BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP 0x85 /**< Pairing not supported. */
rgrover1 371:8f7d2137727a 312 #define BLE_GAP_SEC_STATUS_ENC_KEY_SIZE 0x86 /**< Encryption key size. */
rgrover1 371:8f7d2137727a 313 #define BLE_GAP_SEC_STATUS_SMP_CMD_UNSUPPORTED 0x87 /**< Unsupported SMP command. */
rgrover1 371:8f7d2137727a 314 #define BLE_GAP_SEC_STATUS_UNSPECIFIED 0x88 /**< Unspecified reason. */
rgrover1 371:8f7d2137727a 315 #define BLE_GAP_SEC_STATUS_REPEATED_ATTEMPTS 0x89 /**< Too little time elapsed since last attempt. */
rgrover1 371:8f7d2137727a 316 #define BLE_GAP_SEC_STATUS_INVALID_PARAMS 0x8A /**< Invalid parameters. */
rgrover1 371:8f7d2137727a 317 #define BLE_GAP_SEC_STATUS_RFU_RANGE2_BEGIN 0x8B /**< Reserved for Future Use range #2 begin. */
rgrover1 371:8f7d2137727a 318 #define BLE_GAP_SEC_STATUS_RFU_RANGE2_END 0xFF /**< Reserved for Future Use range #2 end. */
rgrover1 371:8f7d2137727a 319 /**@} */
rgrover1 371:8f7d2137727a 320
rgrover1 371:8f7d2137727a 321 /**@defgroup BLE_GAP_SEC_STATUS_SOURCES GAP Security status sources
rgrover1 371:8f7d2137727a 322 * @{ */
rgrover1 371:8f7d2137727a 323 #define BLE_GAP_SEC_STATUS_SOURCE_LOCAL 0x00 /**< Local failure. */
rgrover1 371:8f7d2137727a 324 #define BLE_GAP_SEC_STATUS_SOURCE_REMOTE 0x01 /**< Remote failure. */
rgrover1 371:8f7d2137727a 325 /**@} */
rgrover1 371:8f7d2137727a 326
rgrover1 371:8f7d2137727a 327 /**@defgroup BLE_GAP_CP_LIMITS GAP Connection Parameters Limits
rgrover1 371:8f7d2137727a 328 * @{ */
rgrover1 371:8f7d2137727a 329 #define BLE_GAP_CP_MIN_CONN_INTVL_NONE 0xFFFF /**< No new minimum connction interval specified in connect parameters. */
rgrover1 371:8f7d2137727a 330 #define BLE_GAP_CP_MIN_CONN_INTVL_MIN 0x0006 /**< Lowest mimimum connection interval permitted, in units of 1.25 ms, i.e. 7.5 ms. */
rgrover1 371:8f7d2137727a 331 #define BLE_GAP_CP_MIN_CONN_INTVL_MAX 0x0C80 /**< Highest minimum connection interval permitted, in units of 1.25 ms, i.e. 4 s. */
rgrover1 371:8f7d2137727a 332 #define BLE_GAP_CP_MAX_CONN_INTVL_NONE 0xFFFF /**< No new maximum connction interval specified in connect parameters. */
rgrover1 371:8f7d2137727a 333 #define BLE_GAP_CP_MAX_CONN_INTVL_MIN 0x0006 /**< Lowest maximum connection interval permitted, in units of 1.25 ms, i.e. 7.5 ms. */
rgrover1 371:8f7d2137727a 334 #define BLE_GAP_CP_MAX_CONN_INTVL_MAX 0x0C80 /**< Highest maximum connection interval permitted, in units of 1.25 ms, i.e. 4 s. */
rgrover1 371:8f7d2137727a 335 #define BLE_GAP_CP_SLAVE_LATENCY_MAX 0x01F3 /**< Highest slave latency permitted, in connection events. */
rgrover1 371:8f7d2137727a 336 #define BLE_GAP_CP_CONN_SUP_TIMEOUT_NONE 0xFFFF /**< No new supervision timeout specified in connect parameters. */
rgrover1 371:8f7d2137727a 337 #define BLE_GAP_CP_CONN_SUP_TIMEOUT_MIN 0x000A /**< Lowest supervision timeout permitted, in units of 10 ms, i.e. 100 ms. */
rgrover1 371:8f7d2137727a 338 #define BLE_GAP_CP_CONN_SUP_TIMEOUT_MAX 0x0C80 /**< Highest supervision timeout permitted, in units of 10 ms, i.e. 32 s. */
rgrover1 371:8f7d2137727a 339 /**@} */
rgrover1 371:8f7d2137727a 340
rgrover1 371:8f7d2137727a 341
rgrover1 371:8f7d2137727a 342 /**@brief GAP device name maximum length. */
rgrover1 371:8f7d2137727a 343 #define BLE_GAP_DEVNAME_MAX_LEN 31
rgrover1 371:8f7d2137727a 344
rgrover1 371:8f7d2137727a 345 /**@brief Disable RSSI events for connections */
rgrover1 371:8f7d2137727a 346 #define BLE_GAP_RSSI_THRESHOLD_INVALID 0xFF
rgrover1 371:8f7d2137727a 347
rgrover1 371:8f7d2137727a 348 /**@defgroup BLE_GAP_CONN_SEC_MODE_SET_MACROS GAP attribute security requirement setters
rgrover1 371:8f7d2137727a 349 *
rgrover1 371:8f7d2137727a 350 * See @ref ble_gap_conn_sec_mode_t.
rgrover1 371:8f7d2137727a 351 * @{ */
rgrover1 371:8f7d2137727a 352 /**@brief Set sec_mode pointed to by ptr to have no access rights.*/
rgrover1 371:8f7d2137727a 353 #define BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(ptr) do {(ptr)->sm = 0; (ptr)->lv = 0;} while(0)
rgrover1 371:8f7d2137727a 354 /**@brief Set sec_mode pointed to by ptr to require no protection, open link.*/
rgrover1 371:8f7d2137727a 355 #define BLE_GAP_CONN_SEC_MODE_SET_OPEN(ptr) do {(ptr)->sm = 1; (ptr)->lv = 1;} while(0)
rgrover1 371:8f7d2137727a 356 /**@brief Set sec_mode pointed to by ptr to require encryption, but no MITM protection.*/
rgrover1 371:8f7d2137727a 357 #define BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 2;} while(0)
rgrover1 371:8f7d2137727a 358 /**@brief Set sec_mode pointed to by ptr to require encryption and MITM protection.*/
rgrover1 371:8f7d2137727a 359 #define BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 3;} while(0)
rgrover1 371:8f7d2137727a 360 /**@brief Set sec_mode pointed to by ptr to require signing or encryption, no MITM protection needed.*/
rgrover1 371:8f7d2137727a 361 #define BLE_GAP_CONN_SEC_MODE_SET_SIGNED_NO_MITM(ptr) do {(ptr)->sm = 2; (ptr)->lv = 1;} while(0)
rgrover1 371:8f7d2137727a 362 /**@brief Set sec_mode pointed to by ptr to require signing or encryption with MITM protection.*/
rgrover1 371:8f7d2137727a 363 #define BLE_GAP_CONN_SEC_MODE_SET_SIGNED_WITH_MITM(ptr) do {(ptr)->sm = 2; (ptr)->lv = 2;} while(0)
rgrover1 371:8f7d2137727a 364 /**@} */
rgrover1 371:8f7d2137727a 365
rgrover1 371:8f7d2137727a 366
rgrover1 371:8f7d2137727a 367 /**@brief GAP Security Random Number Length. */
rgrover1 371:8f7d2137727a 368 #define BLE_GAP_SEC_RAND_LEN 8
rgrover1 371:8f7d2137727a 369
rgrover1 371:8f7d2137727a 370 /**@brief GAP Security Key Length. */
rgrover1 371:8f7d2137727a 371 #define BLE_GAP_SEC_KEY_LEN 16
rgrover1 371:8f7d2137727a 372
rgrover1 371:8f7d2137727a 373 /**@brief GAP Passkey Length. */
rgrover1 371:8f7d2137727a 374 #define BLE_GAP_PASSKEY_LEN 6
rgrover1 371:8f7d2137727a 375
rgrover1 371:8f7d2137727a 376 /**@brief Maximum amount of addresses in a whitelist. */
rgrover1 371:8f7d2137727a 377 #define BLE_GAP_WHITELIST_ADDR_MAX_COUNT (8)
rgrover1 371:8f7d2137727a 378
rgrover1 371:8f7d2137727a 379 /**@brief Maximum amount of IRKs in a whitelist.
rgrover1 371:8f7d2137727a 380 * @note The number of IRKs is limited to 8, even if the hardware supports more.
rgrover1 371:8f7d2137727a 381 */
rgrover1 371:8f7d2137727a 382 #define BLE_GAP_WHITELIST_IRK_MAX_COUNT (8)
rgrover1 371:8f7d2137727a 383
rgrover1 371:8f7d2137727a 384 /**@defgroup GAP_SEC_MODES GAP Security Modes
rgrover1 371:8f7d2137727a 385 * @{ */
rgrover1 371:8f7d2137727a 386 #define BLE_GAP_SEC_MODE 0x00 /**< No key (may be used to reject). */
rgrover1 371:8f7d2137727a 387 /**@} */
rgrover1 371:8f7d2137727a 388
rgrover1 371:8f7d2137727a 389 /**@} */
rgrover1 371:8f7d2137727a 390
rgrover1 371:8f7d2137727a 391 /**@addtogroup BLE_GAP_STRUCTURES Structures
rgrover1 371:8f7d2137727a 392 * @{ */
rgrover1 371:8f7d2137727a 393
rgrover1 371:8f7d2137727a 394 /**@brief Bluetooth Low Energy address. */
rgrover1 371:8f7d2137727a 395 typedef struct
rgrover1 371:8f7d2137727a 396 {
rgrover1 371:8f7d2137727a 397 uint8_t addr_type; /**< See @ref BLE_GAP_ADDR_TYPES. */
rgrover1 371:8f7d2137727a 398 uint8_t addr[BLE_GAP_ADDR_LEN]; /**< 48-bit address, LSB format. */
rgrover1 371:8f7d2137727a 399 } ble_gap_addr_t;
rgrover1 371:8f7d2137727a 400
rgrover1 371:8f7d2137727a 401
rgrover1 371:8f7d2137727a 402 /**@brief GAP connection parameters.
rgrover1 371:8f7d2137727a 403 *
rgrover1 371:8f7d2137727a 404 * @note When ble_conn_params_t is received in an event, both min_conn_interval and
rgrover1 371:8f7d2137727a 405 * max_conn_interval will be equal to the connection interval set by the central.
rgrover1 371:8f7d2137727a 406 *
rgrover1 371:8f7d2137727a 407 * @note If both conn_sup_timeout and max_conn_interval are specified, then the following constraint applies:
rgrover1 371:8f7d2137727a 408 * conn_sup_timeout * 4 > (1 + slave_latency) * max_conn_interval
rgrover1 371:8f7d2137727a 409 * that corresponds to the following Bluetooth Spec requirement:
rgrover1 371:8f7d2137727a 410 * The Supervision_Timeout in milliseconds shall be larger than
rgrover1 371:8f7d2137727a 411 * (1 + Conn_Latency) * Conn_Interval_Max * 2, where Conn_Interval_Max is given in milliseconds.
rgrover1 371:8f7d2137727a 412 */
rgrover1 371:8f7d2137727a 413 typedef struct
rgrover1 371:8f7d2137727a 414 {
rgrover1 371:8f7d2137727a 415 uint16_t min_conn_interval; /**< Minimum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/
rgrover1 371:8f7d2137727a 416 uint16_t max_conn_interval; /**< Maximum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/
rgrover1 371:8f7d2137727a 417 uint16_t slave_latency; /**< Slave Latency in number of connection events, see @ref BLE_GAP_CP_LIMITS.*/
rgrover1 371:8f7d2137727a 418 uint16_t conn_sup_timeout; /**< Connection Supervision Timeout in 10 ms units, see @ref BLE_GAP_CP_LIMITS.*/
rgrover1 371:8f7d2137727a 419 } ble_gap_conn_params_t;
rgrover1 371:8f7d2137727a 420
rgrover1 371:8f7d2137727a 421
rgrover1 371:8f7d2137727a 422 /**@brief GAP connection security modes.
rgrover1 371:8f7d2137727a 423 *
rgrover1 371:8f7d2137727a 424 * Security Mode 0 Level 0: No access permissions at all (this level is not defined by the Bluetooth Core specification).\n
rgrover1 371:8f7d2137727a 425 * Security Mode 1 Level 1: No security is needed (aka open link).\n
rgrover1 371:8f7d2137727a 426 * Security Mode 1 Level 2: Encrypted link required, MITM protection not necessary.\n
rgrover1 371:8f7d2137727a 427 * Security Mode 1 Level 3: MITM protected encrypted link required.\n
rgrover1 371:8f7d2137727a 428 * Security Mode 2 Level 1: Signing or encryption required, MITM protection not necessary.\n
rgrover1 371:8f7d2137727a 429 * Security Mode 2 Level 2: MITM protected signing required, unless link is MITM protected encrypted.\n
rgrover1 371:8f7d2137727a 430 */
rgrover1 371:8f7d2137727a 431 typedef struct
rgrover1 371:8f7d2137727a 432 {
rgrover1 371:8f7d2137727a 433 uint8_t sm : 4; /**< Security Mode (1 or 2), 0 for no permissions at all. */
rgrover1 371:8f7d2137727a 434 uint8_t lv : 4; /**< Level (1, 2 or 3), 0 for no permissions at all. */
rgrover1 371:8f7d2137727a 435
rgrover1 371:8f7d2137727a 436 } ble_gap_conn_sec_mode_t;
rgrover1 371:8f7d2137727a 437
rgrover1 371:8f7d2137727a 438
rgrover1 371:8f7d2137727a 439 /**@brief GAP connection security status.*/
rgrover1 371:8f7d2137727a 440 typedef struct
rgrover1 371:8f7d2137727a 441 {
rgrover1 371:8f7d2137727a 442 ble_gap_conn_sec_mode_t sec_mode; /**< Currently active security mode for this connection.*/
rgrover1 371:8f7d2137727a 443 uint8_t encr_key_size; /**< Length of currently active encryption key, 7 to 16 octets (only applicable for bonding procedures). */
rgrover1 371:8f7d2137727a 444 } ble_gap_conn_sec_t;
rgrover1 371:8f7d2137727a 445
rgrover1 371:8f7d2137727a 446
rgrover1 371:8f7d2137727a 447 /**@brief Identity Resolving Key. */
rgrover1 371:8f7d2137727a 448 typedef struct
rgrover1 371:8f7d2137727a 449 {
rgrover1 371:8f7d2137727a 450 uint8_t irk[BLE_GAP_SEC_KEY_LEN]; /**< Array containing IRK. */
rgrover1 371:8f7d2137727a 451 } ble_gap_irk_t;
rgrover1 371:8f7d2137727a 452
rgrover1 371:8f7d2137727a 453
rgrover1 371:8f7d2137727a 454 /**@brief Whitelist structure. */
rgrover1 371:8f7d2137727a 455 typedef struct
rgrover1 371:8f7d2137727a 456 {
rgrover1 371:8f7d2137727a 457 ble_gap_addr_t **pp_addrs; /**< Pointer to an array of device address pointers, pointing to addresses to be used in whitelist. NULL if none are given. */
rgrover1 371:8f7d2137727a 458 uint8_t addr_count; /**< Count of device addresses in array, up to @ref BLE_GAP_WHITELIST_ADDR_MAX_COUNT. */
rgrover1 371:8f7d2137727a 459 ble_gap_irk_t **pp_irks; /**< Pointer to an array of Identity Resolving Key (IRK) pointers, each pointing to an IRK in the whitelist. NULL if none are given. */
rgrover1 371:8f7d2137727a 460 uint8_t irk_count; /**< Count of IRKs in array, up to @ref BLE_GAP_WHITELIST_IRK_MAX_COUNT. */
rgrover1 371:8f7d2137727a 461 } ble_gap_whitelist_t;
rgrover1 371:8f7d2137727a 462
rgrover1 371:8f7d2137727a 463 /**@brief Channel mask for RF channels used in advertising and scanning. */
rgrover1 371:8f7d2137727a 464 typedef struct
rgrover1 371:8f7d2137727a 465 {
rgrover1 371:8f7d2137727a 466 uint8_t ch_37_off : 1; /**< Setting this bit to 1 will turn off advertising on channel 37 */
rgrover1 371:8f7d2137727a 467 uint8_t ch_38_off : 1; /**< Setting this bit to 1 will turn off advertising on channel 38 */
rgrover1 371:8f7d2137727a 468 uint8_t ch_39_off : 1; /**< Setting this bit to 1 will turn off advertising on channel 39 */
rgrover1 371:8f7d2137727a 469 } ble_gap_adv_ch_mask_t;
rgrover1 371:8f7d2137727a 470
rgrover1 371:8f7d2137727a 471 /**@brief GAP advertising parameters.*/
rgrover1 371:8f7d2137727a 472 typedef struct
rgrover1 371:8f7d2137727a 473 {
rgrover1 371:8f7d2137727a 474 uint8_t type; /**< See @ref BLE_GAP_ADV_TYPES. */
rgrover1 371:8f7d2137727a 475 ble_gap_addr_t *p_peer_addr; /**< For @ref BLE_GAP_ADV_TYPE_ADV_DIRECT_IND mode only, known peer address. */
rgrover1 371:8f7d2137727a 476 uint8_t fp; /**< Filter Policy, see @ref BLE_GAP_ADV_FILTER_POLICIES. */
rgrover1 371:8f7d2137727a 477 ble_gap_whitelist_t *p_whitelist; /**< Pointer to whitelist, NULL if no whitelist or the current active whitelist is to be used. */
rgrover1 371:8f7d2137727a 478 uint16_t interval; /**< Advertising interval between 0x0020 and 0x4000 in 0.625 ms units (20ms to 10.24s), see @ref BLE_GAP_ADV_INTERVALS.
rgrover1 371:8f7d2137727a 479 - If type equals @ref BLE_GAP_ADV_TYPE_ADV_DIRECT_IND, this parameter must be set to 0 for high duty cycle directed advertising.
rgrover1 371:8f7d2137727a 480 - If type equals @ref BLE_GAP_ADV_TYPE_ADV_DIRECT_IND, set @ref BLE_GAP_ADV_INTERVAL_MIN <= interval <= @ref BLE_GAP_ADV_INTERVAL_MAX for low duty cycle advertising.*/
rgrover1 371:8f7d2137727a 481 uint16_t timeout; /**< Advertising timeout between 0x0001 and 0x3FFF in seconds, 0x0000 disables timeout. See also @ref BLE_GAP_ADV_TIMEOUT_VALUES. If type equals @ref BLE_GAP_ADV_TYPE_ADV_DIRECT_IND, this parameter must be set to 0 for High duty cycle directed advertising. */
rgrover1 371:8f7d2137727a 482 ble_gap_adv_ch_mask_t channel_mask; /**< Advertising channel mask. @see ble_gap_channel_mask_t for documentation. */
rgrover1 371:8f7d2137727a 483 } ble_gap_adv_params_t;
rgrover1 371:8f7d2137727a 484
rgrover1 371:8f7d2137727a 485
rgrover1 371:8f7d2137727a 486 /**@brief GAP scanning parameters. */
rgrover1 371:8f7d2137727a 487 typedef struct
rgrover1 371:8f7d2137727a 488 {
rgrover1 371:8f7d2137727a 489 uint8_t active : 1; /**< If 1, perform active scanning (scan requests). */
rgrover1 371:8f7d2137727a 490 uint8_t selective : 1; /**< If 1, ignore unknown devices (non whitelisted). */
rgrover1 371:8f7d2137727a 491 ble_gap_whitelist_t * p_whitelist; /**< Pointer to whitelist, NULL if no whitelist or the current active whitelist is to be used. */
rgrover1 371:8f7d2137727a 492 uint16_t interval; /**< Scan interval between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s). */
rgrover1 371:8f7d2137727a 493 uint16_t window; /**< Scan window between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s). */
rgrover1 371:8f7d2137727a 494 uint16_t timeout; /**< Scan timeout between 0x0001 and 0xFFFF in seconds, 0x0000 disables timeout. */
rgrover1 371:8f7d2137727a 495 } ble_gap_scan_params_t;
rgrover1 371:8f7d2137727a 496
rgrover1 371:8f7d2137727a 497
rgrover1 371:8f7d2137727a 498 /** @brief Keys that can be exchanged during a bonding procedure. */
rgrover1 371:8f7d2137727a 499 typedef struct
rgrover1 371:8f7d2137727a 500 {
rgrover1 371:8f7d2137727a 501 uint8_t enc : 1; /**< Long Term Key and Master Identification. */
rgrover1 371:8f7d2137727a 502 uint8_t id : 1; /**< Identity Resolving Key and Identity Address Information. */
rgrover1 371:8f7d2137727a 503 uint8_t sign : 1; /**< Connection Signature Resolving Key. */
rgrover1 371:8f7d2137727a 504 } ble_gap_sec_kdist_t;
rgrover1 371:8f7d2137727a 505
rgrover1 371:8f7d2137727a 506
rgrover1 371:8f7d2137727a 507 /**@brief GAP security parameters. */
rgrover1 371:8f7d2137727a 508 typedef struct
rgrover1 371:8f7d2137727a 509 {
rgrover1 371:8f7d2137727a 510 uint8_t bond : 1; /**< Perform bonding. */
rgrover1 371:8f7d2137727a 511 uint8_t mitm : 1; /**< Man In The Middle protection required. */
rgrover1 371:8f7d2137727a 512 uint8_t io_caps : 3; /**< IO capabilities, see @ref BLE_GAP_IO_CAPS. */
rgrover1 371:8f7d2137727a 513 uint8_t oob : 1; /**< Out Of Band data available. */
rgrover1 371:8f7d2137727a 514 uint8_t min_key_size; /**< Minimum encryption key size in octets between 7 and 16. If 0 then not applicable in this instance. */
rgrover1 371:8f7d2137727a 515 uint8_t max_key_size; /**< Maximum encryption key size in octets between min_key_size and 16. */
rgrover1 371:8f7d2137727a 516 ble_gap_sec_kdist_t kdist_periph; /**< Key distribution bitmap: keys that the peripheral device will distribute. */
rgrover1 371:8f7d2137727a 517 ble_gap_sec_kdist_t kdist_central; /**< Key distribution bitmap: keys that the central device will distribute. */
rgrover1 371:8f7d2137727a 518 } ble_gap_sec_params_t;
rgrover1 371:8f7d2137727a 519
rgrover1 371:8f7d2137727a 520
rgrover1 371:8f7d2137727a 521 /**@brief GAP Encryption Information. */
rgrover1 371:8f7d2137727a 522 typedef struct
rgrover1 371:8f7d2137727a 523 {
rgrover1 371:8f7d2137727a 524 uint8_t ltk[BLE_GAP_SEC_KEY_LEN]; /**< Long Term Key. */
rgrover1 371:8f7d2137727a 525 uint8_t auth : 1; /**< Authenticated Key. */
rgrover1 371:8f7d2137727a 526 uint8_t ltk_len : 7; /**< LTK length in octets. */
rgrover1 371:8f7d2137727a 527 } ble_gap_enc_info_t;
rgrover1 371:8f7d2137727a 528
rgrover1 371:8f7d2137727a 529
rgrover1 371:8f7d2137727a 530 /**@brief GAP Master Identification. */
rgrover1 371:8f7d2137727a 531 typedef struct
rgrover1 371:8f7d2137727a 532 {
rgrover1 371:8f7d2137727a 533 uint16_t ediv; /**< Encrypted Diversifier. */
rgrover1 371:8f7d2137727a 534 uint8_t rand[BLE_GAP_SEC_RAND_LEN]; /**< Random Number. */
rgrover1 371:8f7d2137727a 535 } ble_gap_master_id_t;
rgrover1 371:8f7d2137727a 536
rgrover1 371:8f7d2137727a 537
rgrover1 371:8f7d2137727a 538 /**@brief GAP Signing Information. */
rgrover1 371:8f7d2137727a 539 typedef struct
rgrover1 371:8f7d2137727a 540 {
rgrover1 371:8f7d2137727a 541 uint8_t csrk[BLE_GAP_SEC_KEY_LEN]; /**< Connection Signature Resolving Key. */
rgrover1 371:8f7d2137727a 542 } ble_gap_sign_info_t;
rgrover1 371:8f7d2137727a 543
rgrover1 371:8f7d2137727a 544
rgrover1 371:8f7d2137727a 545 /**@brief Event structure for @ref BLE_GAP_EVT_CONNECTED. */
rgrover1 371:8f7d2137727a 546 typedef struct
rgrover1 371:8f7d2137727a 547 {
rgrover1 371:8f7d2137727a 548 ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. */
rgrover1 371:8f7d2137727a 549 ble_gap_addr_t own_addr; /**< Bluetooth address of the local device used during connection setup. */
rgrover1 371:8f7d2137727a 550 uint8_t role; /**< BLE role for this connection, see @ref BLE_GAP_ROLES */
rgrover1 371:8f7d2137727a 551 uint8_t irk_match :1; /**< If 1, peer device's address resolved using an IRK. */
rgrover1 371:8f7d2137727a 552 uint8_t irk_match_idx :7; /**< Index in IRK list where the address was matched. */
rgrover1 371:8f7d2137727a 553 ble_gap_conn_params_t conn_params; /**< GAP Connection Parameters. */
rgrover1 371:8f7d2137727a 554 } ble_gap_evt_connected_t;
rgrover1 371:8f7d2137727a 555
rgrover1 371:8f7d2137727a 556
rgrover1 371:8f7d2137727a 557 /**@brief Event structure for @ref BLE_GAP_EVT_DISCONNECTED. */
rgrover1 371:8f7d2137727a 558 typedef struct
rgrover1 371:8f7d2137727a 559 {
rgrover1 371:8f7d2137727a 560 uint8_t reason; /**< HCI error code, see @ref BLE_HCI_STATUS_CODES. */
rgrover1 371:8f7d2137727a 561 } ble_gap_evt_disconnected_t;
rgrover1 371:8f7d2137727a 562
rgrover1 371:8f7d2137727a 563
rgrover1 371:8f7d2137727a 564 /**@brief Event structure for @ref BLE_GAP_EVT_CONN_PARAM_UPDATE. */
rgrover1 371:8f7d2137727a 565 typedef struct
rgrover1 371:8f7d2137727a 566 {
rgrover1 371:8f7d2137727a 567 ble_gap_conn_params_t conn_params; /**< GAP Connection Parameters. */
rgrover1 371:8f7d2137727a 568 } ble_gap_evt_conn_param_update_t;
rgrover1 371:8f7d2137727a 569
rgrover1 371:8f7d2137727a 570
rgrover1 371:8f7d2137727a 571 /**@brief Event structure for @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST. */
rgrover1 371:8f7d2137727a 572 typedef struct
rgrover1 371:8f7d2137727a 573 {
rgrover1 371:8f7d2137727a 574 ble_gap_sec_params_t peer_params; /**< Initiator Security Parameters. */
rgrover1 371:8f7d2137727a 575 } ble_gap_evt_sec_params_request_t;
rgrover1 371:8f7d2137727a 576
rgrover1 371:8f7d2137727a 577
rgrover1 371:8f7d2137727a 578 /**@brief Event structure for @ref BLE_GAP_EVT_SEC_INFO_REQUEST. */
rgrover1 371:8f7d2137727a 579 typedef struct
rgrover1 371:8f7d2137727a 580 {
rgrover1 371:8f7d2137727a 581 ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. */
rgrover1 371:8f7d2137727a 582 ble_gap_master_id_t master_id; /**< Master Identification for LTK lookup. */
rgrover1 371:8f7d2137727a 583 uint8_t enc_info : 1; /**< If 1, Encryption Information required. */
rgrover1 371:8f7d2137727a 584 uint8_t id_info : 1; /**< If 1, Identity Information required. */
rgrover1 371:8f7d2137727a 585 uint8_t sign_info : 1; /**< If 1, Signing Information required. */
rgrover1 371:8f7d2137727a 586 } ble_gap_evt_sec_info_request_t;
rgrover1 371:8f7d2137727a 587
rgrover1 371:8f7d2137727a 588
rgrover1 371:8f7d2137727a 589 /**@brief Event structure for @ref BLE_GAP_EVT_PASSKEY_DISPLAY. */
rgrover1 371:8f7d2137727a 590 typedef struct
rgrover1 371:8f7d2137727a 591 {
rgrover1 371:8f7d2137727a 592 uint8_t passkey[BLE_GAP_PASSKEY_LEN]; /**< 6-digit passkey in ASCII ('0'-'9' digits only). */
rgrover1 371:8f7d2137727a 593 } ble_gap_evt_passkey_display_t;
rgrover1 371:8f7d2137727a 594
rgrover1 371:8f7d2137727a 595
rgrover1 371:8f7d2137727a 596 /**@brief Event structure for @ref BLE_GAP_EVT_AUTH_KEY_REQUEST. */
rgrover1 371:8f7d2137727a 597 typedef struct
rgrover1 371:8f7d2137727a 598 {
rgrover1 371:8f7d2137727a 599 uint8_t key_type; /**< See @ref BLE_GAP_AUTH_KEY_TYPES. */
rgrover1 371:8f7d2137727a 600 } ble_gap_evt_auth_key_request_t;
rgrover1 371:8f7d2137727a 601
rgrover1 371:8f7d2137727a 602
rgrover1 371:8f7d2137727a 603 /**@brief Security levels supported.
rgrover1 371:8f7d2137727a 604 * @note See Bluetooth Specification Version 4.1 Volume 3, Part C, Chapter 10.
rgrover1 371:8f7d2137727a 605 */
rgrover1 371:8f7d2137727a 606 typedef struct
rgrover1 371:8f7d2137727a 607 {
rgrover1 371:8f7d2137727a 608 uint8_t lv1 : 1; /**< If 1: Level 1 is supported. */
rgrover1 371:8f7d2137727a 609 uint8_t lv2 : 1; /**< If 1: Level 2 is supported. */
rgrover1 371:8f7d2137727a 610 uint8_t lv3 : 1; /**< If 1: Level 3 is supported. */
rgrover1 371:8f7d2137727a 611 } ble_gap_sec_levels_t;
rgrover1 371:8f7d2137727a 612
rgrover1 371:8f7d2137727a 613
rgrover1 371:8f7d2137727a 614 /**@brief Encryption Key. */
rgrover1 371:8f7d2137727a 615 typedef struct
rgrover1 371:8f7d2137727a 616 {
rgrover1 371:8f7d2137727a 617 ble_gap_enc_info_t enc_info; /**< Encryption Information. */
rgrover1 371:8f7d2137727a 618 ble_gap_master_id_t master_id; /**< Master Identification. */
rgrover1 371:8f7d2137727a 619 } ble_gap_enc_key_t;
rgrover1 371:8f7d2137727a 620
rgrover1 371:8f7d2137727a 621
rgrover1 371:8f7d2137727a 622 /**@brief Identity Key. */
rgrover1 371:8f7d2137727a 623 typedef struct
rgrover1 371:8f7d2137727a 624 {
rgrover1 371:8f7d2137727a 625 ble_gap_irk_t id_info; /**< Identity Information. */
rgrover1 371:8f7d2137727a 626 ble_gap_addr_t id_addr_info; /**< Identity Address Information. */
rgrover1 371:8f7d2137727a 627 } ble_gap_id_key_t;
rgrover1 371:8f7d2137727a 628
rgrover1 371:8f7d2137727a 629
rgrover1 371:8f7d2137727a 630 /**@brief Security Keys. */
rgrover1 371:8f7d2137727a 631 typedef struct
rgrover1 371:8f7d2137727a 632 {
rgrover1 371:8f7d2137727a 633 ble_gap_enc_key_t *p_enc_key; /**< Encryption Key, or NULL. */
rgrover1 371:8f7d2137727a 634 ble_gap_id_key_t *p_id_key; /**< Identity Key, or NULL. */
rgrover1 371:8f7d2137727a 635 ble_gap_sign_info_t *p_sign_key; /**< Signing Key, or NULL. */
rgrover1 371:8f7d2137727a 636 } ble_gap_sec_keys_t;
rgrover1 371:8f7d2137727a 637
rgrover1 371:8f7d2137727a 638
rgrover1 371:8f7d2137727a 639 /**@brief Security key set (both Peripheral and Central keys).
rgrover1 371:8f7d2137727a 640 * Note that when distributing Bluetooth addresses pertaining to the local device those
rgrover1 371:8f7d2137727a 641 * will have to be filled in by the user. */
rgrover1 371:8f7d2137727a 642 typedef struct
rgrover1 371:8f7d2137727a 643 {
rgrover1 371:8f7d2137727a 644 ble_gap_sec_keys_t keys_periph; /**< Keys distributed by the device in the Peripheral role. */
rgrover1 371:8f7d2137727a 645 ble_gap_sec_keys_t keys_central; /**< Keys distributed by the device in the Central role. */
rgrover1 371:8f7d2137727a 646 } ble_gap_sec_keyset_t;
rgrover1 371:8f7d2137727a 647
rgrover1 371:8f7d2137727a 648
rgrover1 371:8f7d2137727a 649 /**@brief Event structure for @ref BLE_GAP_EVT_AUTH_STATUS. */
rgrover1 371:8f7d2137727a 650 typedef struct
rgrover1 371:8f7d2137727a 651 {
rgrover1 371:8f7d2137727a 652 uint8_t auth_status; /**< Authentication status, see @ref BLE_GAP_SEC_STATUS. */
rgrover1 371:8f7d2137727a 653 uint8_t error_src : 2; /**< On error, source that caused the failure, see @ref BLE_GAP_SEC_STATUS_SOURCES. */
rgrover1 371:8f7d2137727a 654 uint8_t bonded : 1; /**< Procedure resulted in a bond. */
rgrover1 371:8f7d2137727a 655 ble_gap_sec_levels_t sm1_levels; /**< Levels supported in Security Mode 1. */
rgrover1 371:8f7d2137727a 656 ble_gap_sec_levels_t sm2_levels; /**< Levels supported in Security Mode 2. */
rgrover1 371:8f7d2137727a 657 ble_gap_sec_kdist_t kdist_periph; /**< Bitmap stating which keys were exchanged (distributed) by the peripheral. */
rgrover1 371:8f7d2137727a 658 ble_gap_sec_kdist_t kdist_central; /**< Bitmap stating which keys were exchanged (distributed) by the central. */
rgrover1 371:8f7d2137727a 659 } ble_gap_evt_auth_status_t;
rgrover1 371:8f7d2137727a 660
rgrover1 371:8f7d2137727a 661
rgrover1 371:8f7d2137727a 662 /**@brief Event structure for @ref BLE_GAP_EVT_CONN_SEC_UPDATE. */
rgrover1 371:8f7d2137727a 663 typedef struct
rgrover1 371:8f7d2137727a 664 {
rgrover1 371:8f7d2137727a 665 ble_gap_conn_sec_t conn_sec; /**< Connection security level. */
rgrover1 371:8f7d2137727a 666 } ble_gap_evt_conn_sec_update_t;
rgrover1 371:8f7d2137727a 667
rgrover1 371:8f7d2137727a 668
rgrover1 371:8f7d2137727a 669 /**@brief Event structure for @ref BLE_GAP_EVT_TIMEOUT. */
rgrover1 371:8f7d2137727a 670 typedef struct
rgrover1 371:8f7d2137727a 671 {
rgrover1 371:8f7d2137727a 672 uint8_t src; /**< Source of timeout event, see @ref BLE_GAP_TIMEOUT_SOURCES. */
rgrover1 371:8f7d2137727a 673 } ble_gap_evt_timeout_t;
rgrover1 371:8f7d2137727a 674
rgrover1 371:8f7d2137727a 675
rgrover1 371:8f7d2137727a 676 /**@brief Event structure for @ref BLE_GAP_EVT_RSSI_CHANGED. */
rgrover1 371:8f7d2137727a 677 typedef struct
rgrover1 371:8f7d2137727a 678 {
rgrover1 371:8f7d2137727a 679 int8_t rssi; /**< Received Signal Strength Indication in dBm. */
rgrover1 371:8f7d2137727a 680 } ble_gap_evt_rssi_changed_t;
rgrover1 371:8f7d2137727a 681
rgrover1 371:8f7d2137727a 682
rgrover1 371:8f7d2137727a 683 /**@brief Event structure for @ref BLE_GAP_EVT_ADV_REPORT. */
rgrover1 371:8f7d2137727a 684 typedef struct
rgrover1 371:8f7d2137727a 685 {
rgrover1 371:8f7d2137727a 686 ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. */
rgrover1 371:8f7d2137727a 687 int8_t rssi; /**< Received Signal Strength Indication in dBm. */
rgrover1 371:8f7d2137727a 688 uint8_t scan_rsp : 1; /**< If 1, the report corresponds to a scan response and the type field may be ignored. */
rgrover1 371:8f7d2137727a 689 uint8_t type : 2; /**< See @ref BLE_GAP_ADV_TYPES. Only valid if the scan_rsp field is 0. */
rgrover1 371:8f7d2137727a 690 uint8_t dlen : 5; /**< Advertising or scan response data length. */
rgrover1 371:8f7d2137727a 691 uint8_t data[BLE_GAP_ADV_MAX_SIZE]; /**< Advertising or scan response data. */
rgrover1 371:8f7d2137727a 692 } ble_gap_evt_adv_report_t;
rgrover1 371:8f7d2137727a 693
rgrover1 371:8f7d2137727a 694
rgrover1 371:8f7d2137727a 695 /**@brief Event structure for @ref BLE_GAP_EVT_SEC_REQUEST. */
rgrover1 371:8f7d2137727a 696 typedef struct
rgrover1 371:8f7d2137727a 697 {
rgrover1 371:8f7d2137727a 698 uint8_t bond : 1; /**< Perform bonding. */
rgrover1 371:8f7d2137727a 699 uint8_t mitm : 1; /**< Man In The Middle protection required. */
rgrover1 371:8f7d2137727a 700 } ble_gap_evt_sec_request_t;
rgrover1 371:8f7d2137727a 701
rgrover1 371:8f7d2137727a 702
rgrover1 371:8f7d2137727a 703 /**@brief Event structure for @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST. */
rgrover1 371:8f7d2137727a 704 typedef struct
rgrover1 371:8f7d2137727a 705 {
rgrover1 371:8f7d2137727a 706 ble_gap_conn_params_t conn_params; /**< GAP Connection Parameters. */
rgrover1 371:8f7d2137727a 707 } ble_gap_evt_conn_param_update_request_t;
rgrover1 371:8f7d2137727a 708
rgrover1 371:8f7d2137727a 709
rgrover1 371:8f7d2137727a 710 /**@brief Event structure for @ref BLE_GAP_EVT_SCAN_REQ_REPORT. */
rgrover1 371:8f7d2137727a 711 typedef struct
rgrover1 371:8f7d2137727a 712 {
rgrover1 371:8f7d2137727a 713 int8_t rssi; /**< Received Signal Strength Indication in dBm. */
rgrover1 371:8f7d2137727a 714 ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. */
rgrover1 371:8f7d2137727a 715 } ble_gap_evt_scan_req_report_t;
rgrover1 371:8f7d2137727a 716
rgrover1 371:8f7d2137727a 717
rgrover1 371:8f7d2137727a 718
rgrover1 371:8f7d2137727a 719 /**@brief GAP event structure. */
rgrover1 371:8f7d2137727a 720 typedef struct
rgrover1 371:8f7d2137727a 721 {
rgrover1 371:8f7d2137727a 722 uint16_t conn_handle; /**< Connection Handle on which event occured. */
rgrover1 371:8f7d2137727a 723 union /**< union alternative identified by evt_id in enclosing struct. */
rgrover1 371:8f7d2137727a 724 {
rgrover1 371:8f7d2137727a 725 ble_gap_evt_connected_t connected; /**< Connected Event Parameters. */
rgrover1 371:8f7d2137727a 726 ble_gap_evt_disconnected_t disconnected; /**< Disconnected Event Parameters. */
rgrover1 371:8f7d2137727a 727 ble_gap_evt_conn_param_update_t conn_param_update; /**< Connection Parameter Update Parameters. */
rgrover1 371:8f7d2137727a 728 ble_gap_evt_sec_params_request_t sec_params_request; /**< Security Parameters Request Event Parameters. */
rgrover1 371:8f7d2137727a 729 ble_gap_evt_sec_info_request_t sec_info_request; /**< Security Information Request Event Parameters. */
rgrover1 371:8f7d2137727a 730 ble_gap_evt_passkey_display_t passkey_display; /**< Passkey Display Event Parameters. */
rgrover1 371:8f7d2137727a 731 ble_gap_evt_auth_key_request_t auth_key_request; /**< Authentication Key Request Event Parameters. */
rgrover1 371:8f7d2137727a 732 ble_gap_evt_auth_status_t auth_status; /**< Authentication Status Event Parameters. */
rgrover1 371:8f7d2137727a 733 ble_gap_evt_conn_sec_update_t conn_sec_update; /**< Connection Security Update Event Parameters. */
rgrover1 371:8f7d2137727a 734 ble_gap_evt_timeout_t timeout; /**< Timeout Event Parameters. */
rgrover1 371:8f7d2137727a 735 ble_gap_evt_rssi_changed_t rssi_changed; /**< RSSI Event parameters. */
rgrover1 371:8f7d2137727a 736 ble_gap_evt_adv_report_t adv_report; /**< Advertising Report Event Parameters. */
rgrover1 371:8f7d2137727a 737 ble_gap_evt_sec_request_t sec_request; /**< Security Request Event Parameters. */
rgrover1 371:8f7d2137727a 738 ble_gap_evt_conn_param_update_request_t conn_param_update_request; /**< Connection Parameter Update Parameters. */
rgrover1 371:8f7d2137727a 739 ble_gap_evt_scan_req_report_t scan_req_report; /**< Scan Request Report parameters. */
rgrover1 371:8f7d2137727a 740 } params; /**< Event Parameters. */
rgrover1 371:8f7d2137727a 741
rgrover1 371:8f7d2137727a 742 } ble_gap_evt_t;
rgrover1 371:8f7d2137727a 743
rgrover1 371:8f7d2137727a 744
rgrover1 371:8f7d2137727a 745 /**@brief Channel Map option.
rgrover1 371:8f7d2137727a 746 * Used with @ref sd_ble_opt_get to get the current channel map
rgrover1 371:8f7d2137727a 747 * or @ref sd_ble_opt_set to set a new channel map. When setting the
rgrover1 371:8f7d2137727a 748 * channel map, it applies to all current and future connections. When getting the
rgrover1 371:8f7d2137727a 749 * current channel map, it applies to a single connection and the connection handle
rgrover1 371:8f7d2137727a 750 * must be supplied.
rgrover1 371:8f7d2137727a 751 *
rgrover1 371:8f7d2137727a 752 * @note Setting the channel map may take some time, depending on connection parameters.
rgrover1 371:8f7d2137727a 753 * The time taken may be different for each connection and the get operation will
rgrover1 371:8f7d2137727a 754 * return the previous channel map until the new one has taken effect.
rgrover1 371:8f7d2137727a 755 *
rgrover1 371:8f7d2137727a 756 * @note After setting the channel map, by spec it can not be set again until at least 1 s has passed.
rgrover1 371:8f7d2137727a 757 * See Bluetooth Specification Version 4.1 Volume 2, Part E, Section 7.3.46.
rgrover1 371:8f7d2137727a 758 *
rgrover1 371:8f7d2137727a 759 * @retval ::NRF_SUCCESS Get or set successful.
rgrover1 371:8f7d2137727a 760 * @retval ::NRF_ERROR_BUSY Channel map was set again before enough time had passed.
rgrover1 371:8f7d2137727a 761 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation.
rgrover1 371:8f7d2137727a 762 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied for get.
rgrover1 371:8f7d2137727a 763 * @retval ::NRF_ERROR_NOT_SUPPORTED Returned by sd_ble_opt_set in peripheral-only SoftDevices.
rgrover1 371:8f7d2137727a 764 *
rgrover1 371:8f7d2137727a 765 */
rgrover1 371:8f7d2137727a 766 typedef struct
rgrover1 371:8f7d2137727a 767 {
rgrover1 371:8f7d2137727a 768 uint16_t conn_handle; /**< Connection Handle (only applicable for get) */
rgrover1 371:8f7d2137727a 769 uint8_t ch_map[5]; /**< Channel Map (37-bit). */
rgrover1 371:8f7d2137727a 770 } ble_gap_opt_ch_map_t;
rgrover1 371:8f7d2137727a 771
rgrover1 371:8f7d2137727a 772
rgrover1 371:8f7d2137727a 773 /**@brief Local connection latency option.
rgrover1 371:8f7d2137727a 774 *
rgrover1 371:8f7d2137727a 775 * Local connection latency is a feature which enables the slave to improve
rgrover1 371:8f7d2137727a 776 * current consumption by ignoring the slave latency set by the peer. The
rgrover1 371:8f7d2137727a 777 * local connection latency can only be set to a multiple of the slave latency,
rgrover1 371:8f7d2137727a 778 * and cannot be longer than half of the supervision timeout.
rgrover1 371:8f7d2137727a 779 *
rgrover1 371:8f7d2137727a 780 * Used with @ref sd_ble_opt_set to set the local connection latency. The
rgrover1 371:8f7d2137727a 781 * @ref sd_ble_opt_get is not supported for this option, but the actual
rgrover1 371:8f7d2137727a 782 * local connection latency (unless set to NULL) is set as a return parameter
rgrover1 371:8f7d2137727a 783 * when setting the option.
rgrover1 371:8f7d2137727a 784 *
rgrover1 371:8f7d2137727a 785 * @note The latency set will be truncated down to the closest slave latency event
rgrover1 371:8f7d2137727a 786 * multiple, or the nearest multiple before half of the supervision timeout.
rgrover1 371:8f7d2137727a 787 *
rgrover1 371:8f7d2137727a 788 * @note The local connection latency is disabled by default, and needs to be enabled for new
rgrover1 371:8f7d2137727a 789 * connections and whenever the connection is updated.
rgrover1 371:8f7d2137727a 790 *
rgrover1 371:8f7d2137727a 791 * @retval ::NRF_SUCCESS Set successfully.
rgrover1 371:8f7d2137727a 792 * @retval ::NRF_ERROR_NOT_SUPPORTED Get is not supported.
rgrover1 371:8f7d2137727a 793 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter.
rgrover1 371:8f7d2137727a 794 */
rgrover1 371:8f7d2137727a 795 typedef struct
rgrover1 371:8f7d2137727a 796 {
rgrover1 371:8f7d2137727a 797 uint16_t conn_handle; /**< Connection Handle */
rgrover1 371:8f7d2137727a 798 uint16_t requested_latency; /**< Requested local connection latency. */
rgrover1 371:8f7d2137727a 799 uint16_t * p_actual_latency; /**< Pointer to storage for the actual local connection latency (can be set to NULL to skip return value). */
rgrover1 371:8f7d2137727a 800 } ble_gap_opt_local_conn_latency_t;
rgrover1 371:8f7d2137727a 801
rgrover1 371:8f7d2137727a 802
rgrover1 371:8f7d2137727a 803 /**@brief Passkey Option.
rgrover1 371:8f7d2137727a 804 *
rgrover1 371:8f7d2137727a 805 * Structure containing the passkey to be used during pairing. This can be used with @ref
rgrover1 371:8f7d2137727a 806 * sd_ble_opt_set to make the SoftDevice use a pre-programmed passkey for authentication
rgrover1 371:8f7d2137727a 807 * instead of generating a random one.
rgrover1 371:8f7d2137727a 808 *
rgrover1 371:8f7d2137727a 809 * @note @ref sd_ble_opt_get is not supported for this option.
rgrover1 371:8f7d2137727a 810 *
rgrover1 371:8f7d2137727a 811 */
rgrover1 371:8f7d2137727a 812 typedef struct
rgrover1 371:8f7d2137727a 813 {
rgrover1 371:8f7d2137727a 814 uint8_t * p_passkey; /**< Pointer to 6-digit ASCII string (digit 0..9 only, no NULL termination) passkey to be used during pairing. If this is NULL, the SoftDevice will generate a random passkey if required.*/
rgrover1 371:8f7d2137727a 815 } ble_gap_opt_passkey_t;
rgrover1 371:8f7d2137727a 816
rgrover1 371:8f7d2137727a 817
rgrover1 371:8f7d2137727a 818 /**@brief Custom Privacy Option.
rgrover1 371:8f7d2137727a 819 *
rgrover1 371:8f7d2137727a 820 * This structure is used with both @ref sd_ble_opt_set (as input) and with
rgrover1 371:8f7d2137727a 821 * @ref sd_ble_opt_get (as output).
rgrover1 371:8f7d2137727a 822 *
rgrover1 371:8f7d2137727a 823 * Structure containing:
rgrover1 371:8f7d2137727a 824 * - A pointer to an IRK to set (if input), or a place to store a read IRK (if output).
rgrover1 371:8f7d2137727a 825 * - A private address refresh cycle.
rgrover1 371:8f7d2137727a 826 *
rgrover1 371:8f7d2137727a 827 * @note The specified address cycle interval is used when the address cycle mode is
rgrover1 371:8f7d2137727a 828 * @ref BLE_GAP_ADDR_CYCLE_MODE_AUTO. If 0 is given, the address will not be automatically
rgrover1 371:8f7d2137727a 829 * refreshed at all. The default interval is @ref BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S.
rgrover1 371:8f7d2137727a 830 *
rgrover1 371:8f7d2137727a 831 * @note If the current address cycle mode is @ref BLE_GAP_ADDR_CYCLE_MODE_AUTO, the address will immediately be
rgrover1 371:8f7d2137727a 832 * refreshed when a custom privacy option is set. A new address can be generated manually by calling
rgrover1 371:8f7d2137727a 833 * @ref sd_ble_gap_address_set with the same type again.
rgrover1 371:8f7d2137727a 834 *
rgrover1 371:8f7d2137727a 835 * @note If the IRK is updated, the new IRK becomes the one to be distributed in all
rgrover1 371:8f7d2137727a 836 * bonding procedures performed after @ref sd_ble_opt_set returns.
rgrover1 371:8f7d2137727a 837 *
rgrover1 371:8f7d2137727a 838 * @retval ::NRF_SUCCESS Set or read successfully.
rgrover1 371:8f7d2137727a 839 * @retval ::NRF_ERROR_INVALID_ADDR The pointer to IRK storage is invalid.
rgrover1 371:8f7d2137727a 840 */
rgrover1 371:8f7d2137727a 841 typedef struct
rgrover1 371:8f7d2137727a 842 {
rgrover1 371:8f7d2137727a 843 ble_gap_irk_t * p_irk; /**< When input: Pointer to custom IRK, or NULL to use/reset to the device's default IRK. When output: Pointer to where the current IRK is to be stored, or NULL to not read out the IRK. */
rgrover1 371:8f7d2137727a 844 uint16_t interval_s; /**< When input: Custom private address cycle interval in seconds. When output: The current private address cycle interval. */
rgrover1 371:8f7d2137727a 845 } ble_gap_opt_privacy_t;
rgrover1 371:8f7d2137727a 846
rgrover1 371:8f7d2137727a 847
rgrover1 371:8f7d2137727a 848 /**@brief Scan request report option.
rgrover1 371:8f7d2137727a 849 *
rgrover1 371:8f7d2137727a 850 * This can be used with @ref sd_ble_opt_set to make the SoftDevice send
rgrover1 371:8f7d2137727a 851 * @ref BLE_GAP_EVT_SCAN_REQ_REPORT events.
rgrover1 371:8f7d2137727a 852 *
rgrover1 371:8f7d2137727a 853 * @note Due to the limited space reserved for scan request report events,
rgrover1 371:8f7d2137727a 854 * not all received scan requests will be reported.
rgrover1 371:8f7d2137727a 855 *
rgrover1 371:8f7d2137727a 856 * @note If whitelisting is used, only whitelisted requests are reported.
rgrover1 371:8f7d2137727a 857 *
rgrover1 371:8f7d2137727a 858 * @retval ::NRF_SUCCESS Set successfully.
rgrover1 371:8f7d2137727a 859 * @retval ::NRF_ERROR_INVALID_STATE When advertising is ongoing while the option is set.
rgrover1 371:8f7d2137727a 860 */
rgrover1 371:8f7d2137727a 861 typedef struct
rgrover1 371:8f7d2137727a 862 {
rgrover1 371:8f7d2137727a 863 uint8_t enable : 1; /**< Enable scan request reports. */
rgrover1 371:8f7d2137727a 864 } ble_gap_opt_scan_req_report_t;
rgrover1 371:8f7d2137727a 865
rgrover1 371:8f7d2137727a 866 /**@brief Compatibility mode option.
rgrover1 371:8f7d2137727a 867 *
rgrover1 371:8f7d2137727a 868 * This can be used with @ref sd_ble_opt_set to enable and disable
rgrover1 371:8f7d2137727a 869 * compatibility modes. Compatibility modes are disabled by default.
rgrover1 371:8f7d2137727a 870 *
rgrover1 371:8f7d2137727a 871 * @note Compatibility mode 1 enables interoperability with devices that do not support
rgrover1 371:8f7d2137727a 872 * a value of 0 for the WinOffset parameter in the Link Layer CONNECT_REQ packet.
rgrover1 371:8f7d2137727a 873 *
rgrover1 371:8f7d2137727a 874 * @retval ::NRF_SUCCESS Set successfully.
rgrover1 371:8f7d2137727a 875 * @retval ::NRF_ERROR_INVALID_STATE When connection creation is ongoing while mode 1 is set.
rgrover1 371:8f7d2137727a 876 */
rgrover1 371:8f7d2137727a 877 typedef struct
rgrover1 371:8f7d2137727a 878 {
rgrover1 371:8f7d2137727a 879 uint8_t mode_1_enable : 1; /**< Enable compatibility mode 1.*/
rgrover1 371:8f7d2137727a 880 } ble_gap_opt_compat_mode_t;
rgrover1 371:8f7d2137727a 881
rgrover1 371:8f7d2137727a 882
rgrover1 371:8f7d2137727a 883 /**@brief Option structure for GAP options. */
rgrover1 371:8f7d2137727a 884 typedef union
rgrover1 371:8f7d2137727a 885 {
rgrover1 371:8f7d2137727a 886 ble_gap_opt_ch_map_t ch_map; /**< Parameters for the Channel Map option. */
rgrover1 371:8f7d2137727a 887 ble_gap_opt_local_conn_latency_t local_conn_latency; /**< Parameters for the Local connection latency option */
rgrover1 371:8f7d2137727a 888 ble_gap_opt_passkey_t passkey; /**< Parameters for the Passkey option.*/
rgrover1 371:8f7d2137727a 889 ble_gap_opt_privacy_t privacy; /**< Parameters for the Custom privacy option. */
rgrover1 371:8f7d2137727a 890 ble_gap_opt_scan_req_report_t scan_req_report; /**< Parameters for the scan request report option.*/
rgrover1 371:8f7d2137727a 891 ble_gap_opt_compat_mode_t compat_mode; /**< Parameters for the compatibility mode option.*/
rgrover1 371:8f7d2137727a 892 } ble_gap_opt_t;
rgrover1 371:8f7d2137727a 893 /**@} */
rgrover1 371:8f7d2137727a 894
rgrover1 371:8f7d2137727a 895
rgrover1 371:8f7d2137727a 896 /**@addtogroup BLE_GAP_FUNCTIONS Functions
rgrover1 371:8f7d2137727a 897 * @{ */
rgrover1 371:8f7d2137727a 898
rgrover1 371:8f7d2137727a 899 /**@brief Set local Bluetooth address.
rgrover1 371:8f7d2137727a 900 *
rgrover1 371:8f7d2137727a 901 * @note If the address cycle mode is @ref BLE_GAP_ADDR_CYCLE_MODE_AUTO, the address type is required to
rgrover1 371:8f7d2137727a 902 * be @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE or
rgrover1 371:8f7d2137727a 903 * @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE. The given address is ignored and the
rgrover1 371:8f7d2137727a 904 * SoftDevice will generate a new private address automatically every
rgrover1 371:8f7d2137727a 905 * @ref BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S seconds. If this API
rgrover1 371:8f7d2137727a 906 * call is used again with the same parameters, the SoftDevice will immediately
rgrover1 371:8f7d2137727a 907 * generate a new private address to replace the current address.
rgrover1 371:8f7d2137727a 908 *
rgrover1 371:8f7d2137727a 909 * @note If the application wishes to use a @ref BLE_GAP_ADDR_TYPE_PUBLIC or
rgrover1 371:8f7d2137727a 910 * @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC address, the cycle mode must be
rgrover1 371:8f7d2137727a 911 * @ref BLE_GAP_ADDR_CYCLE_MODE_NONE.
rgrover1 371:8f7d2137727a 912 *
rgrover1 371:8f7d2137727a 913 * @note If this API function is called while advertising or scanning, the softdevice will immediately update the
rgrover1 371:8f7d2137727a 914 * advertising or scanning address without the need to stop the procedure in the following cases:
rgrover1 371:8f7d2137727a 915 * - If the previously set address is of type @ref BLE_GAP_ADDR_TYPE_PUBLIC and the new address
rgrover1 371:8f7d2137727a 916 * is also of type @ref BLE_GAP_ADDR_TYPE_PUBLIC
rgrover1 371:8f7d2137727a 917 * - If the previously set address is not @ref BLE_GAP_ADDR_TYPE_PUBLIC and the new address is
rgrover1 371:8f7d2137727a 918 * also not @ref BLE_GAP_ADDR_TYPE_PUBLIC.
rgrover1 371:8f7d2137727a 919 * If the address is changed from a @ref BLE_GAP_ADDR_TYPE_PUBLIC address to another type or from
rgrover1 371:8f7d2137727a 920 * another type to a @ref BLE_GAP_ADDR_TYPE_PUBLIC address, the change will take effect the next
rgrover1 371:8f7d2137727a 921 * time an advertising or scanning procedure is started.
rgrover1 371:8f7d2137727a 922 *
rgrover1 371:8f7d2137727a 923 * @note If the address cycle mode is @ref BLE_GAP_ADDR_CYCLE_MODE_NONE and the application is
rgrover1 371:8f7d2137727a 924 * using privacy, the application must take care to generate and set new private addresses
rgrover1 371:8f7d2137727a 925 * periodically to comply with the Privacy specification in Bluetooth Core Spec.
rgrover1 371:8f7d2137727a 926 *
rgrover1 371:8f7d2137727a 927 * @param[in] addr_cycle_mode Address cycle mode, see @ref BLE_GAP_ADDR_CYCLE_MODES.
rgrover1 371:8f7d2137727a 928 * @param[in] p_addr Pointer to address structure.
rgrover1 371:8f7d2137727a 929 *
rgrover1 371:8f7d2137727a 930 * @retval ::NRF_SUCCESS Address successfully set.
rgrover1 371:8f7d2137727a 931 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 932 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameters.
rgrover1 371:8f7d2137727a 933 * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address.
rgrover1 371:8f7d2137727a 934 * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry.
rgrover1 371:8f7d2137727a 935 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation.
rgrover1 371:8f7d2137727a 936 */
rgrover1 371:8f7d2137727a 937 SVCALL(SD_BLE_GAP_ADDRESS_SET, uint32_t, sd_ble_gap_address_set(uint8_t addr_cycle_mode, const ble_gap_addr_t *p_addr));
rgrover1 371:8f7d2137727a 938
rgrover1 371:8f7d2137727a 939
rgrover1 371:8f7d2137727a 940 /**@brief Get local Bluetooth address.
rgrover1 371:8f7d2137727a 941 *
rgrover1 371:8f7d2137727a 942 * @param[out] p_addr Pointer to address structure to be filled in.
rgrover1 371:8f7d2137727a 943 *
rgrover1 371:8f7d2137727a 944 * @retval ::NRF_SUCCESS Address successfully retrieved.
rgrover1 371:8f7d2137727a 945 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 946 */
rgrover1 371:8f7d2137727a 947 SVCALL(SD_BLE_GAP_ADDRESS_GET, uint32_t, sd_ble_gap_address_get(ble_gap_addr_t *p_addr));
rgrover1 371:8f7d2137727a 948
rgrover1 371:8f7d2137727a 949
rgrover1 371:8f7d2137727a 950 /**@brief Set, clear or update advertising and scan response data.
rgrover1 371:8f7d2137727a 951 *
rgrover1 371:8f7d2137727a 952 * @note The format of the advertising data will be checked by this call to ensure interoperability.
rgrover1 371:8f7d2137727a 953 * Limitations imposed by this API call to the data provided include having a flags data type in the scan response data and
rgrover1 371:8f7d2137727a 954 * duplicating the local name in the advertising data and scan response data.
rgrover1 371:8f7d2137727a 955 *
rgrover1 371:8f7d2137727a 956 * @note To clear the advertising data and set it to a 0-length packet, simply provide a valid pointer (p_data/p_sr_data) with its corresponding
rgrover1 371:8f7d2137727a 957 * length (dlen/srdlen) set to 0.
rgrover1 371:8f7d2137727a 958 *
rgrover1 371:8f7d2137727a 959 * @note The call will fail if p_data and p_sr_data are both NULL since this would have no effect.
rgrover1 371:8f7d2137727a 960 *
rgrover1 371:8f7d2137727a 961 * @param[in] p_data Raw data to be placed in advertising packet. If NULL, no changes are made to the current advertising packet data.
rgrover1 371:8f7d2137727a 962 * @param[in] dlen Data length for p_data. Max size: @ref BLE_GAP_ADV_MAX_SIZE octets. Should be 0 if p_data is NULL, can be 0 if p_data is not NULL.
rgrover1 371:8f7d2137727a 963 * @param[in] p_sr_data Raw data to be placed in scan response packet. If NULL, no changes are made to the current scan response packet data.
rgrover1 371:8f7d2137727a 964 * @param[in] srdlen Data length for p_sr_data. Max size: @ref BLE_GAP_ADV_MAX_SIZE octets. Should be 0 if p_sr_data is NULL, can be 0 if p_data is not NULL.
rgrover1 371:8f7d2137727a 965 *
rgrover1 371:8f7d2137727a 966 * @retval ::NRF_SUCCESS Advertising data successfully updated or cleared.
rgrover1 371:8f7d2137727a 967 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 968 * @retval ::NRF_ERROR_INVALID_FLAGS Invalid combination of advertising flags supplied.
rgrover1 371:8f7d2137727a 969 * @retval ::NRF_ERROR_INVALID_DATA Invalid data type(s) supplied, check the advertising data format specification.
rgrover1 371:8f7d2137727a 970 * @retval ::NRF_ERROR_INVALID_LENGTH Invalid data length(s) supplied.
rgrover1 371:8f7d2137727a 971 * @retval ::NRF_ERROR_NOT_SUPPORTED Unsupported data type.
rgrover1 371:8f7d2137727a 972 * @retval ::BLE_ERROR_GAP_UUID_LIST_MISMATCH Invalid UUID list supplied.
rgrover1 371:8f7d2137727a 973 */
rgrover1 371:8f7d2137727a 974 SVCALL(SD_BLE_GAP_ADV_DATA_SET, uint32_t, sd_ble_gap_adv_data_set(uint8_t const *p_data, uint8_t dlen, uint8_t const *p_sr_data, uint8_t srdlen));
rgrover1 371:8f7d2137727a 975
rgrover1 371:8f7d2137727a 976
rgrover1 371:8f7d2137727a 977 /**@brief Start advertising (GAP Discoverable, Connectable modes, Broadcast Procedure).
rgrover1 371:8f7d2137727a 978 *
rgrover1 371:8f7d2137727a 979 * @note An application can start an advertising procedure for broadcasting purposes while a connection
rgrover1 371:8f7d2137727a 980 * is active. After a @ref BLE_GAP_EVT_CONNECTED event is received, this function may therefore
rgrover1 371:8f7d2137727a 981 * be called to start a broadcast advertising procedure. The advertising procedure
rgrover1 371:8f7d2137727a 982 * cannot however be connectable (it must be of type @ref BLE_GAP_ADV_TYPE_ADV_SCAN_IND or
rgrover1 371:8f7d2137727a 983 * @ref BLE_GAP_ADV_TYPE_ADV_NONCONN_IND). @note Only one advertiser may be active at any time.
rgrover1 371:8f7d2137727a 984 *
rgrover1 371:8f7d2137727a 985 * @note To use the currently active whitelist set p_adv_params->p_whitelist to NULL.
rgrover1 371:8f7d2137727a 986 *
rgrover1 371:8f7d2137727a 987 * @param[in] p_adv_params Pointer to advertising parameters structure.
rgrover1 371:8f7d2137727a 988 *
rgrover1 371:8f7d2137727a 989 * @retval ::NRF_SUCCESS The BLE stack has started advertising.
rgrover1 371:8f7d2137727a 990 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 991 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation.
rgrover1 371:8f7d2137727a 992 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check the accepted ranges and limits.
rgrover1 371:8f7d2137727a 993 * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid Bluetooth address supplied.
rgrover1 371:8f7d2137727a 994 * @retval ::BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST Discoverable mode and whitelist incompatible.
rgrover1 371:8f7d2137727a 995 * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry.
rgrover1 371:8f7d2137727a 996 * @retval ::BLE_ERROR_GAP_WHITELIST_IN_USE Unable to replace the whitelist while another operation is using it.
rgrover1 371:8f7d2137727a 997 */
rgrover1 371:8f7d2137727a 998 SVCALL(SD_BLE_GAP_ADV_START, uint32_t, sd_ble_gap_adv_start(ble_gap_adv_params_t const *p_adv_params));
rgrover1 371:8f7d2137727a 999
rgrover1 371:8f7d2137727a 1000
rgrover1 371:8f7d2137727a 1001 /**@brief Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure).
rgrover1 371:8f7d2137727a 1002 *
rgrover1 371:8f7d2137727a 1003 * @retval ::NRF_SUCCESS The BLE stack has stopped advertising.
rgrover1 371:8f7d2137727a 1004 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation (most probably not in advertising state).
rgrover1 371:8f7d2137727a 1005 */
rgrover1 371:8f7d2137727a 1006 SVCALL(SD_BLE_GAP_ADV_STOP, uint32_t, sd_ble_gap_adv_stop(void));
rgrover1 371:8f7d2137727a 1007
rgrover1 371:8f7d2137727a 1008
rgrover1 371:8f7d2137727a 1009 /**@brief Update connection parameters.
rgrover1 371:8f7d2137727a 1010 *
rgrover1 371:8f7d2137727a 1011 * @details In the central role this will initiate a Link Layer connection parameter update procedure,
rgrover1 371:8f7d2137727a 1012 * otherwise in the peripheral role, this will send the corresponding L2CAP request and wait for
rgrover1 371:8f7d2137727a 1013 * the central to perform the procedure. In both cases, and regardless of success or failure, the application
rgrover1 371:8f7d2137727a 1014 * will be informed of the result with a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE event.
rgrover1 371:8f7d2137727a 1015 *
rgrover1 371:8f7d2137727a 1016 * @details This function can be used as a central both to reply to a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST or to start the procedure unrequested.
rgrover1 371:8f7d2137727a 1017 *
rgrover1 371:8f7d2137727a 1018 * @param[in] conn_handle Connection handle.
rgrover1 371:8f7d2137727a 1019 * @param[in] p_conn_params Pointer to desired connection parameters. If NULL is provided on a peripheral role,
rgrover1 371:8f7d2137727a 1020 * the parameters in the PPCP characteristic of the GAP service will be used instead.
rgrover1 371:8f7d2137727a 1021 * If NULL is provided on a central role and in response to a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST, the peripheral request will be rejected
rgrover1 371:8f7d2137727a 1022 *
rgrover1 371:8f7d2137727a 1023 * @retval ::NRF_SUCCESS The Connection Update procedure has been started successfully.
rgrover1 371:8f7d2137727a 1024 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 1025 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints.
rgrover1 371:8f7d2137727a 1026 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation.
rgrover1 371:8f7d2137727a 1027 * @retval ::NRF_ERROR_BUSY Procedure already in progress or not allowed at this time, process pending events and wait for pending procedures to complete and retry.
rgrover1 371:8f7d2137727a 1028 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
rgrover1 371:8f7d2137727a 1029 * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation.
rgrover1 371:8f7d2137727a 1030 */
rgrover1 371:8f7d2137727a 1031 SVCALL(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));
rgrover1 371:8f7d2137727a 1032
rgrover1 371:8f7d2137727a 1033
rgrover1 371:8f7d2137727a 1034 /**@brief Disconnect (GAP Link Termination).
rgrover1 371:8f7d2137727a 1035 *
rgrover1 371:8f7d2137727a 1036 * @details This call initiates the disconnection procedure, and its completion will be communicated to the application
rgrover1 371:8f7d2137727a 1037 * with a @ref BLE_GAP_EVT_DISCONNECTED event.
rgrover1 371:8f7d2137727a 1038 *
rgrover1 371:8f7d2137727a 1039 * @param[in] conn_handle Connection handle.
rgrover1 371:8f7d2137727a 1040 * @param[in] hci_status_code HCI status code, see @ref BLE_HCI_STATUS_CODES (accepted values are @ref BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION and @ref BLE_HCI_CONN_INTERVAL_UNACCEPTABLE).
rgrover1 371:8f7d2137727a 1041 *
rgrover1 371:8f7d2137727a 1042 * @retval ::NRF_SUCCESS The disconnection procedure has been started successfully.
rgrover1 371:8f7d2137727a 1043 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
rgrover1 371:8f7d2137727a 1044 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
rgrover1 371:8f7d2137727a 1045 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation (disconnection is already in progress).
rgrover1 371:8f7d2137727a 1046 */
rgrover1 371:8f7d2137727a 1047 SVCALL(SD_BLE_GAP_DISCONNECT, uint32_t, sd_ble_gap_disconnect(uint16_t conn_handle, uint8_t hci_status_code));
rgrover1 371:8f7d2137727a 1048
rgrover1 371:8f7d2137727a 1049
rgrover1 371:8f7d2137727a 1050 /**@brief Set the radio's transmit power.
rgrover1 371:8f7d2137727a 1051 *
rgrover1 371:8f7d2137727a 1052 * @param[in] tx_power Radio transmit power in dBm (accepted values are -40, -30, -20, -16, -12, -8, -4, 0, and 4 dBm).
rgrover1 371:8f7d2137727a 1053 *
rgrover1 371:8f7d2137727a 1054 * @note -40 dBm will not actually give -40 dBm, but will instead be remapped to -30 dBm.
rgrover1 371:8f7d2137727a 1055 *
rgrover1 371:8f7d2137727a 1056 * @retval ::NRF_SUCCESS Successfully changed the transmit power.
rgrover1 371:8f7d2137727a 1057 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
rgrover1 371:8f7d2137727a 1058 */
rgrover1 371:8f7d2137727a 1059 SVCALL(SD_BLE_GAP_TX_POWER_SET, uint32_t, sd_ble_gap_tx_power_set(int8_t tx_power));
rgrover1 371:8f7d2137727a 1060
rgrover1 371:8f7d2137727a 1061
rgrover1 371:8f7d2137727a 1062 /**@brief Set GAP Appearance value.
rgrover1 371:8f7d2137727a 1063 *
rgrover1 371:8f7d2137727a 1064 * @param[in] appearance Appearance (16-bit), see @ref BLE_APPEARANCES.
rgrover1 371:8f7d2137727a 1065 *
rgrover1 371:8f7d2137727a 1066 * @retval ::NRF_SUCCESS Appearance value set successfully.
rgrover1 371:8f7d2137727a 1067 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
rgrover1 371:8f7d2137727a 1068 */
rgrover1 371:8f7d2137727a 1069 SVCALL(SD_BLE_GAP_APPEARANCE_SET, uint32_t, sd_ble_gap_appearance_set(uint16_t appearance));
rgrover1 371:8f7d2137727a 1070
rgrover1 371:8f7d2137727a 1071
rgrover1 371:8f7d2137727a 1072 /**@brief Get GAP Appearance value.
rgrover1 371:8f7d2137727a 1073 *
rgrover1 371:8f7d2137727a 1074 * @param[out] p_appearance Pointer to appearance (16-bit) to be filled in, see @ref BLE_APPEARANCES.
rgrover1 371:8f7d2137727a 1075 *
rgrover1 371:8f7d2137727a 1076 * @retval ::NRF_SUCCESS Appearance value retrieved successfully.
rgrover1 371:8f7d2137727a 1077 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 1078 */
rgrover1 371:8f7d2137727a 1079 SVCALL(SD_BLE_GAP_APPEARANCE_GET, uint32_t, sd_ble_gap_appearance_get(uint16_t *p_appearance));
rgrover1 371:8f7d2137727a 1080
rgrover1 371:8f7d2137727a 1081
rgrover1 371:8f7d2137727a 1082 /**@brief Set GAP Peripheral Preferred Connection Parameters.
rgrover1 371:8f7d2137727a 1083 *
rgrover1 371:8f7d2137727a 1084 * @param[in] p_conn_params Pointer to a @ref ble_gap_conn_params_t structure with the desired parameters.
rgrover1 371:8f7d2137727a 1085 *
rgrover1 371:8f7d2137727a 1086 * @retval ::NRF_SUCCESS Peripheral Preferred Connection Parameters set successfully.
rgrover1 371:8f7d2137727a 1087 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 1088 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
rgrover1 371:8f7d2137727a 1089 */
rgrover1 371:8f7d2137727a 1090 SVCALL(SD_BLE_GAP_PPCP_SET, uint32_t, sd_ble_gap_ppcp_set(ble_gap_conn_params_t const *p_conn_params));
rgrover1 371:8f7d2137727a 1091
rgrover1 371:8f7d2137727a 1092
rgrover1 371:8f7d2137727a 1093 /**@brief Get GAP Peripheral Preferred Connection Parameters.
rgrover1 371:8f7d2137727a 1094 *
rgrover1 371:8f7d2137727a 1095 * @param[out] p_conn_params Pointer to a @ref ble_gap_conn_params_t structure where the parameters will be stored.
rgrover1 371:8f7d2137727a 1096 *
rgrover1 371:8f7d2137727a 1097 * @retval ::NRF_SUCCESS Peripheral Preferred Connection Parameters retrieved successfully.
rgrover1 371:8f7d2137727a 1098 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 1099 */
rgrover1 371:8f7d2137727a 1100 SVCALL(SD_BLE_GAP_PPCP_GET, uint32_t, sd_ble_gap_ppcp_get(ble_gap_conn_params_t *p_conn_params));
rgrover1 371:8f7d2137727a 1101
rgrover1 371:8f7d2137727a 1102
rgrover1 371:8f7d2137727a 1103 /**@brief Set GAP device name.
rgrover1 371:8f7d2137727a 1104 *
rgrover1 371:8f7d2137727a 1105 * @param[in] p_write_perm Write permissions for the Device Name characteristic, see @ref ble_gap_conn_sec_mode_t.
rgrover1 371:8f7d2137727a 1106 * @param[in] p_dev_name Pointer to a UTF-8 encoded, <b>non NULL-terminated</b> string.
rgrover1 371:8f7d2137727a 1107 * @param[in] len Length of the UTF-8, <b>non NULL-terminated</b> string pointed to by p_dev_name in octets (must be smaller or equal than @ref BLE_GAP_DEVNAME_MAX_LEN).
rgrover1 371:8f7d2137727a 1108 *
rgrover1 371:8f7d2137727a 1109 * @retval ::NRF_SUCCESS GAP device name and permissions set successfully.
rgrover1 371:8f7d2137727a 1110 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 1111 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
rgrover1 371:8f7d2137727a 1112 * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied.
rgrover1 371:8f7d2137727a 1113 */
rgrover1 371:8f7d2137727a 1114 SVCALL(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));
rgrover1 371:8f7d2137727a 1115
rgrover1 371:8f7d2137727a 1116
rgrover1 371:8f7d2137727a 1117 /**@brief Get GAP device name.
rgrover1 371:8f7d2137727a 1118 *
rgrover1 371:8f7d2137727a 1119 * @param[out] p_dev_name Pointer to an empty buffer where the UTF-8 <b>non NULL-terminated</b> string will be placed. Set to NULL to obtain the complete device name length.
rgrover1 371:8f7d2137727a 1120 * @param[in,out] p_len Length of the buffer pointed by p_dev_name, complete device name length on output.
rgrover1 371:8f7d2137727a 1121 *
rgrover1 371:8f7d2137727a 1122 * @note If the device name is longer than the size of the supplied buffer,
rgrover1 371:8f7d2137727a 1123 * p_len will return the complete device name length,
rgrover1 371:8f7d2137727a 1124 * and not the number of bytes actually returned in p_dev_name.
rgrover1 371:8f7d2137727a 1125 * The application may use this information to allocate a suitable buffer size.
rgrover1 371:8f7d2137727a 1126 *
rgrover1 371:8f7d2137727a 1127 * @retval ::NRF_SUCCESS GAP device name retrieved successfully.
rgrover1 371:8f7d2137727a 1128 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 1129 * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied.
rgrover1 371:8f7d2137727a 1130 */
rgrover1 371:8f7d2137727a 1131 SVCALL(SD_BLE_GAP_DEVICE_NAME_GET, uint32_t, sd_ble_gap_device_name_get(uint8_t *p_dev_name, uint16_t *p_len));
rgrover1 371:8f7d2137727a 1132
rgrover1 371:8f7d2137727a 1133
rgrover1 371:8f7d2137727a 1134 /**@brief Initiate the GAP Authentication procedure.
rgrover1 371:8f7d2137727a 1135 *
rgrover1 371:8f7d2137727a 1136 * @param[in] conn_handle Connection handle.
rgrover1 371:8f7d2137727a 1137 * @param[in] p_sec_params Pointer to the @ref ble_gap_sec_params_t structure with the security parameters to be used during the pairing or bonding procedure.
rgrover1 371:8f7d2137727a 1138 * In the peripheral role, only the timeout, bond and mitm fields of this structure are used.
rgrover1 371:8f7d2137727a 1139 * In the central role, this pointer may be NULL to reject a Security Request.
rgrover1 371:8f7d2137727a 1140 *
rgrover1 371:8f7d2137727a 1141 * @details In the central role, this function will send an SMP Pairing Request (or an SMP Pairing Failed if rejected),
rgrover1 371:8f7d2137727a 1142 * otherwise in the peripheral role, an SMP Security Request will be sent.
rgrover1 371:8f7d2137727a 1143 *
rgrover1 371:8f7d2137727a 1144 * @note Calling this function may result in the following events depending on the outcome and parameters: @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST,
rgrover1 371:8f7d2137727a 1145 * @ref BLE_GAP_EVT_SEC_INFO_REQUEST, @ref BLE_GAP_EVT_AUTH_KEY_REQUEST, @ref BLE_GAP_EVT_CONN_SEC_UPDATE, @ref BLE_GAP_EVT_AUTH_STATUS.
rgrover1 371:8f7d2137727a 1146 *
rgrover1 371:8f7d2137727a 1147 *
rgrover1 371:8f7d2137727a 1148 * @retval ::NRF_SUCCESS Successfully initiated authentication procedure.
rgrover1 371:8f7d2137727a 1149 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 1150 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
rgrover1 371:8f7d2137727a 1151 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation.
rgrover1 371:8f7d2137727a 1152 * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry.
rgrover1 371:8f7d2137727a 1153 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
rgrover1 371:8f7d2137727a 1154 * @retval ::NRF_ERROR_TIMEOUT A SMP timout has occured, and further SMP operations on this link is prohibited.
rgrover1 371:8f7d2137727a 1155 */
rgrover1 371:8f7d2137727a 1156 SVCALL(SD_BLE_GAP_AUTHENTICATE, uint32_t, sd_ble_gap_authenticate(uint16_t conn_handle, ble_gap_sec_params_t const *p_sec_params));
rgrover1 371:8f7d2137727a 1157
rgrover1 371:8f7d2137727a 1158
rgrover1 371:8f7d2137727a 1159 /**@brief Reply with GAP security parameters.
rgrover1 371:8f7d2137727a 1160 *
rgrover1 371:8f7d2137727a 1161 * @param[in] conn_handle Connection handle.
rgrover1 371:8f7d2137727a 1162 * @param[in] sec_status Security status, see @ref BLE_GAP_SEC_STATUS.
rgrover1 371:8f7d2137727a 1163 * @param[in] p_sec_params Pointer to a @ref ble_gap_sec_params_t security parameters structure. In the central role this must be set to NULL, as the parameters have
rgrover1 371:8f7d2137727a 1164 * already been provided during a previous call to @ref sd_ble_gap_authenticate.
rgrover1 371:8f7d2137727a 1165 * @param[in,out] p_sec_keyset Pointer to a @ref ble_gap_sec_keyset_t security keyset structure. Any keys distributed as a result of the ongoing security procedure
rgrover1 371:8f7d2137727a 1166 * will be stored into the memory referenced by the pointers inside this structure. The keys will be stored and available to the application
rgrover1 371:8f7d2137727a 1167 * upon reception of a @ref BLE_GAP_EVT_AUTH_STATUS event.
rgrover1 371:8f7d2137727a 1168 * The pointer to the ID key data distributed by the <b>local device</b> constitutes however an exception. It can either point to ID key data
rgrover1 371:8f7d2137727a 1169 * filled in by the user before calling this function, in which case a user-supplied Bluetooth address and IRK will be distributed,
rgrover1 371:8f7d2137727a 1170 * or the pointer to the ID key data structure can be NULL, in which case the device's configured (or default, if none is configured)
rgrover1 371:8f7d2137727a 1171 * Bluetooth address and IRK will be distributed.
rgrover1 371:8f7d2137727a 1172 *
rgrover1 371:8f7d2137727a 1173 * @details This function is only used to reply to a @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE.
rgrover1 371:8f7d2137727a 1174 * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters.
rgrover1 371:8f7d2137727a 1175 *
rgrover1 371:8f7d2137727a 1176 * @retval ::NRF_SUCCESS Successfully accepted security parameter from the application.
rgrover1 371:8f7d2137727a 1177 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 1178 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
rgrover1 371:8f7d2137727a 1179 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation.
rgrover1 371:8f7d2137727a 1180 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
rgrover1 371:8f7d2137727a 1181 */
rgrover1 371:8f7d2137727a 1182 SVCALL(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));
rgrover1 371:8f7d2137727a 1183
rgrover1 371:8f7d2137727a 1184
rgrover1 371:8f7d2137727a 1185 /**@brief Reply with an authentication key.
rgrover1 371:8f7d2137727a 1186 *
rgrover1 371:8f7d2137727a 1187 * @param[in] conn_handle Connection handle.
rgrover1 371:8f7d2137727a 1188 * @param[in] key_type See @ref BLE_GAP_AUTH_KEY_TYPES.
rgrover1 371:8f7d2137727a 1189 * @param[in] p_key If key type is @ref BLE_GAP_AUTH_KEY_TYPE_NONE, then NULL.
rgrover1 371:8f7d2137727a 1190 * If key type is @ref BLE_GAP_AUTH_KEY_TYPE_PASSKEY, then a 6-byte ASCII string (digit 0..9 only, no NULL termination).
rgrover1 371:8f7d2137727a 1191 * If key type is @ref BLE_GAP_AUTH_KEY_TYPE_OOB, then a 16-byte OOB key value in Little Endian format.
rgrover1 371:8f7d2137727a 1192 *
rgrover1 371:8f7d2137727a 1193 * @details This function is only used to reply to a @ref BLE_GAP_EVT_AUTH_KEY_REQUEST, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE.
rgrover1 371:8f7d2137727a 1194 * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters.
rgrover1 371:8f7d2137727a 1195 *
rgrover1 371:8f7d2137727a 1196 * @retval ::NRF_SUCCESS Authentication key successfully set.
rgrover1 371:8f7d2137727a 1197 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 1198 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
rgrover1 371:8f7d2137727a 1199 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation.
rgrover1 371:8f7d2137727a 1200 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
rgrover1 371:8f7d2137727a 1201 */
rgrover1 371:8f7d2137727a 1202 SVCALL(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));
rgrover1 371:8f7d2137727a 1203
rgrover1 371:8f7d2137727a 1204
rgrover1 371:8f7d2137727a 1205 /**@brief Initiate GAP Encryption procedure.
rgrover1 371:8f7d2137727a 1206 *
rgrover1 371:8f7d2137727a 1207 * @param[in] conn_handle Connection handle.
rgrover1 371:8f7d2137727a 1208 * @param[in] p_master_id Pointer to a @ref ble_gap_master_id_t master identification structure.
rgrover1 371:8f7d2137727a 1209 * @param[in] p_enc_info Pointer to a @ref ble_gap_enc_info_t encryption information structure.
rgrover1 371:8f7d2137727a 1210 *
rgrover1 371:8f7d2137727a 1211 * @details In the central role, this function will initiate the encryption procedure using the encryption information provided.
rgrover1 371:8f7d2137727a 1212 *
rgrover1 371:8f7d2137727a 1213 * @note Calling this function may result in the following event depending on the outcome and parameters: @ref BLE_GAP_EVT_CONN_SEC_UPDATE.
rgrover1 371:8f7d2137727a 1214 *
rgrover1 371:8f7d2137727a 1215 * @retval ::NRF_SUCCESS Successfully initiated authentication procedure.
rgrover1 371:8f7d2137727a 1216 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 1217 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation.
rgrover1 371:8f7d2137727a 1218 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
rgrover1 371:8f7d2137727a 1219 * @retval ::BLE_ERROR_INVALID_ROLE Operation is not supported in the Peripheral role.
rgrover1 371:8f7d2137727a 1220 * @retval ::NRF_ERROR_BUSY Procedure already in progress or not allowed at this time, wait for pending procedures to complete and retry.
rgrover1 371:8f7d2137727a 1221 */
rgrover1 371:8f7d2137727a 1222 SVCALL(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));
rgrover1 371:8f7d2137727a 1223
rgrover1 371:8f7d2137727a 1224
rgrover1 371:8f7d2137727a 1225 /**@brief Reply with GAP security information.
rgrover1 371:8f7d2137727a 1226 *
rgrover1 371:8f7d2137727a 1227 * @param[in] conn_handle Connection handle.
rgrover1 371:8f7d2137727a 1228 * @param[in] p_enc_info Pointer to a @ref ble_gap_enc_info_t encryption information structure. May be NULL to signal none is available.
rgrover1 371:8f7d2137727a 1229 * @param[in] p_id_info Pointer to a @ref ble_gap_irk_t identity information structure. May be NULL to signal none is available.
rgrover1 371:8f7d2137727a 1230 * @param[in] p_sign_info Pointer to a @ref ble_gap_sign_info_t signing information structure. May be NULL to signal none is available.
rgrover1 371:8f7d2137727a 1231 *
rgrover1 371:8f7d2137727a 1232 * @details This function is only used to reply to a @ref BLE_GAP_EVT_SEC_INFO_REQUEST, calling it at other times will result in @ref NRF_ERROR_INVALID_STATE.
rgrover1 371:8f7d2137727a 1233 * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters.
rgrover1 371:8f7d2137727a 1234 * @note Data signing is not yet supported, and p_sign_info must therefore be NULL.
rgrover1 371:8f7d2137727a 1235 *
rgrover1 371:8f7d2137727a 1236 * @retval ::NRF_SUCCESS Successfully accepted security information.
rgrover1 371:8f7d2137727a 1237 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
rgrover1 371:8f7d2137727a 1238 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation.
rgrover1 371:8f7d2137727a 1239 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
rgrover1 371:8f7d2137727a 1240 */
rgrover1 371:8f7d2137727a 1241 SVCALL(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, ble_gap_irk_t const *p_id_info, ble_gap_sign_info_t const *p_sign_info));
rgrover1 371:8f7d2137727a 1242
rgrover1 371:8f7d2137727a 1243
rgrover1 371:8f7d2137727a 1244 /**@brief Get the current connection security.
rgrover1 371:8f7d2137727a 1245 *
rgrover1 371:8f7d2137727a 1246 * @param[in] conn_handle Connection handle.
rgrover1 371:8f7d2137727a 1247 * @param[out] p_conn_sec Pointer to a @ref ble_gap_conn_sec_t structure to be filled in.
rgrover1 371:8f7d2137727a 1248 *
rgrover1 371:8f7d2137727a 1249 * @retval ::NRF_SUCCESS Current connection security successfully retrieved.
rgrover1 371:8f7d2137727a 1250 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 1251 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
rgrover1 371:8f7d2137727a 1252 */
rgrover1 371:8f7d2137727a 1253 SVCALL(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));
rgrover1 371:8f7d2137727a 1254
rgrover1 371:8f7d2137727a 1255
rgrover1 371:8f7d2137727a 1256 /**@brief Start reporting the received signal strength to the application.
rgrover1 371:8f7d2137727a 1257 *
rgrover1 371:8f7d2137727a 1258 * A new event is reported whenever the RSSI value changes, until @ref sd_ble_gap_rssi_stop is called.
rgrover1 371:8f7d2137727a 1259 *
rgrover1 371:8f7d2137727a 1260 * @param[in] conn_handle Connection handle.
rgrover1 371:8f7d2137727a 1261 * @param[in] threshold_dbm Minimum change in dBm before triggering the @ref BLE_GAP_EVT_RSSI_CHANGED event. Events are disabled if threshold_dbm equals @ref BLE_GAP_RSSI_THRESHOLD_INVALID.
rgrover1 371:8f7d2137727a 1262 * @param[in] skip_count Number of RSSI samples with a change of threshold_dbm or more before sending a new @ref BLE_GAP_EVT_RSSI_CHANGED event.
rgrover1 371:8f7d2137727a 1263 *
rgrover1 371:8f7d2137727a 1264 * @retval ::NRF_SUCCESS Successfully activated RSSI reporting.
rgrover1 371:8f7d2137727a 1265 * @retval ::NRF_ERROR_INVALID_STATE Disconnection in progress. Invalid state to perform operation.
rgrover1 371:8f7d2137727a 1266 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
rgrover1 371:8f7d2137727a 1267 */
rgrover1 371:8f7d2137727a 1268 SVCALL(SD_BLE_GAP_RSSI_START, uint32_t, sd_ble_gap_rssi_start(uint16_t conn_handle, uint8_t threshold_dbm, uint8_t skip_count));
rgrover1 371:8f7d2137727a 1269
rgrover1 371:8f7d2137727a 1270
rgrover1 371:8f7d2137727a 1271 /**@brief Stop reporting the received signal strength.
rgrover1 371:8f7d2137727a 1272 *
rgrover1 371:8f7d2137727a 1273 * @note An RSSI change detected before the call but not yet received by the application
rgrover1 371:8f7d2137727a 1274 * may be reported after @ref sd_ble_gap_rssi_stop has been called.
rgrover1 371:8f7d2137727a 1275 *
rgrover1 371:8f7d2137727a 1276 * @param[in] conn_handle Connection handle.
rgrover1 371:8f7d2137727a 1277 *
rgrover1 371:8f7d2137727a 1278 * @retval ::NRF_SUCCESS Successfully deactivated RSSI reporting.
rgrover1 371:8f7d2137727a 1279 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation.
rgrover1 371:8f7d2137727a 1280 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
rgrover1 371:8f7d2137727a 1281 */
rgrover1 371:8f7d2137727a 1282 SVCALL(SD_BLE_GAP_RSSI_STOP, uint32_t, sd_ble_gap_rssi_stop(uint16_t conn_handle));
rgrover1 371:8f7d2137727a 1283
rgrover1 371:8f7d2137727a 1284
rgrover1 371:8f7d2137727a 1285 /**@brief Get the received signal strength for the last connection event.
rgrover1 371:8f7d2137727a 1286 *
rgrover1 371:8f7d2137727a 1287 * @param[in] conn_handle Connection handle.
rgrover1 371:8f7d2137727a 1288 * @param[out] p_rssi Pointer to the location where the RSSI measurement shall be stored.
rgrover1 371:8f7d2137727a 1289 *
rgrover1 371:8f7d2137727a 1290 * @ref sd_ble_gap_rssi_start must be called to start reporting RSSI before using this function. @ref NRF_ERROR_NOT_FOUND
rgrover1 371:8f7d2137727a 1291 * will be returned until RSSI was sampled for the first time after calling @ref sd_ble_gap_rssi_start.
rgrover1 371:8f7d2137727a 1292 *
rgrover1 371:8f7d2137727a 1293 * @retval ::NRF_SUCCESS Successfully read the RSSI.
rgrover1 371:8f7d2137727a 1294 * @retval ::NRF_ERROR_NOT_FOUND No sample is available.
rgrover1 371:8f7d2137727a 1295 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 1296 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
rgrover1 371:8f7d2137727a 1297 * @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is not ongoing, or disconnection in progress.
rgrover1 371:8f7d2137727a 1298 */
rgrover1 371:8f7d2137727a 1299 SVCALL(SD_BLE_GAP_RSSI_GET, uint32_t, sd_ble_gap_rssi_get(uint16_t conn_handle, int8_t *p_rssi));
rgrover1 371:8f7d2137727a 1300
rgrover1 371:8f7d2137727a 1301
rgrover1 371:8f7d2137727a 1302 /**@brief Start scanning (GAP Discovery procedure, Observer Procedure).
rgrover1 371:8f7d2137727a 1303 *
rgrover1 371:8f7d2137727a 1304 * @note To use the currently active whitelist set p_scan_params->p_whitelist to NULL.
rgrover1 371:8f7d2137727a 1305 *
rgrover1 371:8f7d2137727a 1306 * @param[in] p_scan_params Pointer to scan parameters structure.
rgrover1 371:8f7d2137727a 1307 *
rgrover1 371:8f7d2137727a 1308 * @retval ::NRF_SUCCESS Successfully initiated scanning procedure.
rgrover1 371:8f7d2137727a 1309 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
rgrover1 371:8f7d2137727a 1310 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation.
rgrover1 371:8f7d2137727a 1311 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
rgrover1 371:8f7d2137727a 1312 * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry.
rgrover1 371:8f7d2137727a 1313 * @retval ::BLE_ERROR_GAP_WHITELIST_IN_USE Unable to replace the whitelist while another operation is using it.
rgrover1 371:8f7d2137727a 1314 */
rgrover1 371:8f7d2137727a 1315 SVCALL(SD_BLE_GAP_SCAN_START, uint32_t, sd_ble_gap_scan_start(ble_gap_scan_params_t const *p_scan_params));
rgrover1 371:8f7d2137727a 1316
rgrover1 371:8f7d2137727a 1317
rgrover1 371:8f7d2137727a 1318 /**@brief Stop scanning (GAP Discovery procedure, Observer Procedure).
rgrover1 371:8f7d2137727a 1319 *
rgrover1 371:8f7d2137727a 1320 * @retval ::NRF_SUCCESS Successfully stopped scanning procedure.
rgrover1 371:8f7d2137727a 1321 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation (most probably not in scanning state).
rgrover1 371:8f7d2137727a 1322 */
rgrover1 371:8f7d2137727a 1323 SVCALL(SD_BLE_GAP_SCAN_STOP, uint32_t, sd_ble_gap_scan_stop(void));
rgrover1 371:8f7d2137727a 1324
rgrover1 371:8f7d2137727a 1325
rgrover1 371:8f7d2137727a 1326 /**@brief Create a connection (GAP Link Establishment).
rgrover1 371:8f7d2137727a 1327 *
rgrover1 371:8f7d2137727a 1328 * @note To use the currently active whitelist set p_scan_params->p_whitelist to NULL.
rgrover1 371:8f7d2137727a 1329 *
rgrover1 371:8f7d2137727a 1330 * @param[in] p_peer_addr Pointer to peer address. If the selective bit is set in @ref ble_gap_scan_params_t, then this must be NULL.
rgrover1 371:8f7d2137727a 1331 * @param[in] p_scan_params Pointer to scan parameters structure.
rgrover1 371:8f7d2137727a 1332 * @param[in] p_conn_params Pointer to desired connection parameters.
rgrover1 371:8f7d2137727a 1333 *
rgrover1 371:8f7d2137727a 1334 * @retval ::NRF_SUCCESS Successfully initiated connection procedure.
rgrover1 371:8f7d2137727a 1335 * @retval ::NRF_ERROR_INVALID_ADDR Invalid parameter(s) pointer supplied.
rgrover1 371:8f7d2137727a 1336 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
rgrover1 371:8f7d2137727a 1337 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation.
rgrover1 371:8f7d2137727a 1338 * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid Peer address.
rgrover1 371:8f7d2137727a 1339 * @retval ::NRF_ERROR_NO_MEM limit of available connections reached.
rgrover1 371:8f7d2137727a 1340 * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry. If another connection is being established wait for the corresponding
rgrover1 371:8f7d2137727a 1341 * @ref BLE_GAP_EVT_CONNECTED event before calling again.
rgrover1 371:8f7d2137727a 1342 * @retval ::BLE_ERROR_GAP_WHITELIST_IN_USE Unable to replace the whitelist while another operation is using it.
rgrover1 371:8f7d2137727a 1343 */
rgrover1 371:8f7d2137727a 1344 SVCALL(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));
rgrover1 371:8f7d2137727a 1345
rgrover1 371:8f7d2137727a 1346
rgrover1 371:8f7d2137727a 1347 /**@brief Cancel a connection establishment.
rgrover1 371:8f7d2137727a 1348 *
rgrover1 371:8f7d2137727a 1349 * @retval ::NRF_SUCCESS Successfully cancelled an ongoing connection procedure.
rgrover1 371:8f7d2137727a 1350 * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation.
rgrover1 371:8f7d2137727a 1351 */
rgrover1 371:8f7d2137727a 1352 SVCALL(SD_BLE_GAP_CONNECT_CANCEL, uint32_t, sd_ble_gap_connect_cancel(void));
rgrover1 371:8f7d2137727a 1353
rgrover1 371:8f7d2137727a 1354 /** @} */
rgrover1 371:8f7d2137727a 1355
rgrover1 371:8f7d2137727a 1356 #endif // BLE_GAP_H__
rgrover1 371:8f7d2137727a 1357
rgrover1 371:8f7d2137727a 1358 /**
rgrover1 371:8f7d2137727a 1359 @}
rgrover1 371:8f7d2137727a 1360 */