mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s110_nrf51822_7_0_0/s110_nrf51822_7.0.0_API/include/ble_gap.h@277:0dffe5d9e928, 2014-08-08 (annotated)
- Committer:
- mbed_official
- Date:
- Fri Aug 08 14:30:08 2014 +0100
- Revision:
- 277:0dffe5d9e928
Synchronized with git revision 6e585609af67e04984b0c09093a5790a751c6ceb
Full URL: https://github.com/mbedmicro/mbed/commit/6e585609af67e04984b0c09093a5790a751c6ceb/
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 277:0dffe5d9e928 | 1 | /* Copyright (c) 2011 Nordic Semiconductor. All Rights Reserved. |
mbed_official | 277:0dffe5d9e928 | 2 | * |
mbed_official | 277:0dffe5d9e928 | 3 | * The information contained herein is confidential property of Nordic Semiconductor. The use, |
mbed_official | 277:0dffe5d9e928 | 4 | * copying, transfer or disclosure of such information is prohibited except by express written |
mbed_official | 277:0dffe5d9e928 | 5 | * agreement with Nordic Semiconductor. |
mbed_official | 277:0dffe5d9e928 | 6 | * |
mbed_official | 277:0dffe5d9e928 | 7 | */ |
mbed_official | 277:0dffe5d9e928 | 8 | /** |
mbed_official | 277:0dffe5d9e928 | 9 | @addtogroup BLE_GAP Generic Access Profile (GAP) |
mbed_official | 277:0dffe5d9e928 | 10 | @{ |
mbed_official | 277:0dffe5d9e928 | 11 | @brief Definitions and prototypes for the GAP interface. |
mbed_official | 277:0dffe5d9e928 | 12 | */ |
mbed_official | 277:0dffe5d9e928 | 13 | |
mbed_official | 277:0dffe5d9e928 | 14 | #ifndef BLE_GAP_H__ |
mbed_official | 277:0dffe5d9e928 | 15 | #define BLE_GAP_H__ |
mbed_official | 277:0dffe5d9e928 | 16 | |
mbed_official | 277:0dffe5d9e928 | 17 | #include "ble_types.h" |
mbed_official | 277:0dffe5d9e928 | 18 | #include "ble_ranges.h" |
mbed_official | 277:0dffe5d9e928 | 19 | #include "nrf_svc.h" |
mbed_official | 277:0dffe5d9e928 | 20 | |
mbed_official | 277:0dffe5d9e928 | 21 | |
mbed_official | 277:0dffe5d9e928 | 22 | /**@addtogroup BLE_GAP_ENUMERATIONS Enumerations |
mbed_official | 277:0dffe5d9e928 | 23 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 24 | |
mbed_official | 277:0dffe5d9e928 | 25 | /**@brief GAP API SVC numbers. |
mbed_official | 277:0dffe5d9e928 | 26 | */ |
mbed_official | 277:0dffe5d9e928 | 27 | enum BLE_GAP_SVCS |
mbed_official | 277:0dffe5d9e928 | 28 | { |
mbed_official | 277:0dffe5d9e928 | 29 | SD_BLE_GAP_ADDRESS_SET = BLE_GAP_SVC_BASE, /**< Set own Bluetooth Address. */ |
mbed_official | 277:0dffe5d9e928 | 30 | SD_BLE_GAP_ADDRESS_GET, /**< Get own Bluetooth Address. */ |
mbed_official | 277:0dffe5d9e928 | 31 | SD_BLE_GAP_ADV_DATA_SET, /**< Set Advertisement Data. */ |
mbed_official | 277:0dffe5d9e928 | 32 | SD_BLE_GAP_ADV_START, /**< Start Advertising. */ |
mbed_official | 277:0dffe5d9e928 | 33 | SD_BLE_GAP_ADV_STOP, /**< Stop Advertising. */ |
mbed_official | 277:0dffe5d9e928 | 34 | SD_BLE_GAP_CONN_PARAM_UPDATE, /**< Connection Parameter Update. */ |
mbed_official | 277:0dffe5d9e928 | 35 | SD_BLE_GAP_DISCONNECT, /**< Disconnect. */ |
mbed_official | 277:0dffe5d9e928 | 36 | SD_BLE_GAP_TX_POWER_SET, /**< Set TX Power. */ |
mbed_official | 277:0dffe5d9e928 | 37 | SD_BLE_GAP_APPEARANCE_SET, /**< Set Appearance. */ |
mbed_official | 277:0dffe5d9e928 | 38 | SD_BLE_GAP_APPEARANCE_GET, /**< Get Appearance. */ |
mbed_official | 277:0dffe5d9e928 | 39 | SD_BLE_GAP_PPCP_SET, /**< Set PPCP. */ |
mbed_official | 277:0dffe5d9e928 | 40 | SD_BLE_GAP_PPCP_GET, /**< Get PPCP. */ |
mbed_official | 277:0dffe5d9e928 | 41 | SD_BLE_GAP_DEVICE_NAME_SET, /**< Set Device Name. */ |
mbed_official | 277:0dffe5d9e928 | 42 | SD_BLE_GAP_DEVICE_NAME_GET, /**< Get Device Name. */ |
mbed_official | 277:0dffe5d9e928 | 43 | SD_BLE_GAP_AUTHENTICATE, /**< Initiate Pairing/Bonding. */ |
mbed_official | 277:0dffe5d9e928 | 44 | SD_BLE_GAP_SEC_PARAMS_REPLY, /**< Reply with Security Parameters. */ |
mbed_official | 277:0dffe5d9e928 | 45 | SD_BLE_GAP_AUTH_KEY_REPLY, /**< Reply with an authentication key. */ |
mbed_official | 277:0dffe5d9e928 | 46 | SD_BLE_GAP_SEC_INFO_REPLY, /**< Reply with Security Information. */ |
mbed_official | 277:0dffe5d9e928 | 47 | SD_BLE_GAP_CONN_SEC_GET, /**< Obtain connection security level. */ |
mbed_official | 277:0dffe5d9e928 | 48 | SD_BLE_GAP_RSSI_START, /**< Start reporting of changes in RSSI. */ |
mbed_official | 277:0dffe5d9e928 | 49 | SD_BLE_GAP_RSSI_STOP, /**< Stop reporting of changes in RSSI. */ |
mbed_official | 277:0dffe5d9e928 | 50 | }; |
mbed_official | 277:0dffe5d9e928 | 51 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 52 | |
mbed_official | 277:0dffe5d9e928 | 53 | /**@addtogroup BLE_GAP_DEFINES Defines |
mbed_official | 277:0dffe5d9e928 | 54 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 55 | |
mbed_official | 277:0dffe5d9e928 | 56 | /**@defgroup BLE_ERRORS_GAP SVC return values specific to GAP |
mbed_official | 277:0dffe5d9e928 | 57 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 58 | #define BLE_ERROR_GAP_UUID_LIST_MISMATCH (NRF_GAP_ERR_BASE + 0x000) /**< UUID list does not contain an integral number of UUIDs. */ |
mbed_official | 277:0dffe5d9e928 | 59 | #define BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST (NRF_GAP_ERR_BASE + 0x001) /**< Use of Whitelist not permitted with discoverable advertising. */ |
mbed_official | 277:0dffe5d9e928 | 60 | #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. */ |
mbed_official | 277:0dffe5d9e928 | 61 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 62 | |
mbed_official | 277:0dffe5d9e928 | 63 | |
mbed_official | 277:0dffe5d9e928 | 64 | /**@defgroup BLE_GAP_ROLES GAP Roles |
mbed_official | 277:0dffe5d9e928 | 65 | * @note Not explicitly used in peripheral API, but will be relevant for central API. |
mbed_official | 277:0dffe5d9e928 | 66 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 67 | #define BLE_GAP_ROLE_INVALID 0x0 /**< Invalid Role. */ |
mbed_official | 277:0dffe5d9e928 | 68 | #define BLE_GAP_ROLE_PERIPH 0x1 /**< Peripheral Role. */ |
mbed_official | 277:0dffe5d9e928 | 69 | #define BLE_GAP_ROLE_CENTRAL 0x2 /**< Central Role. */ |
mbed_official | 277:0dffe5d9e928 | 70 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 71 | |
mbed_official | 277:0dffe5d9e928 | 72 | |
mbed_official | 277:0dffe5d9e928 | 73 | /**@defgroup BLE_GAP_TIMEOUT_SOURCES GAP Timeout sources |
mbed_official | 277:0dffe5d9e928 | 74 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 75 | #define BLE_GAP_TIMEOUT_SRC_ADVERTISEMENT 0x00 /**< Advertisement timeout. */ |
mbed_official | 277:0dffe5d9e928 | 76 | #define BLE_GAP_TIMEOUT_SRC_SECURITY_REQUEST 0x01 /**< Security request timeout. */ |
mbed_official | 277:0dffe5d9e928 | 77 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 78 | |
mbed_official | 277:0dffe5d9e928 | 79 | |
mbed_official | 277:0dffe5d9e928 | 80 | /**@defgroup BLE_GAP_ADDR_TYPES GAP Address types |
mbed_official | 277:0dffe5d9e928 | 81 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 82 | #define BLE_GAP_ADDR_TYPE_PUBLIC 0x00 /**< Public address. */ |
mbed_official | 277:0dffe5d9e928 | 83 | #define BLE_GAP_ADDR_TYPE_RANDOM_STATIC 0x01 /**< Random Static address. */ |
mbed_official | 277:0dffe5d9e928 | 84 | #define BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE 0x02 /**< Private Resolvable address. */ |
mbed_official | 277:0dffe5d9e928 | 85 | #define BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE 0x03 /**< Private Non-Resolvable address. */ |
mbed_official | 277:0dffe5d9e928 | 86 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 87 | |
mbed_official | 277:0dffe5d9e928 | 88 | /**@defgroup BLE_GAP_ADDR_CYCLE_MODES GAP Address cycle modes |
mbed_official | 277:0dffe5d9e928 | 89 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 90 | #define BLE_GAP_ADDR_CYCLE_MODE_NONE 0x00 /**< Set addresses directly, no automatic address cycling. */ |
mbed_official | 277:0dffe5d9e928 | 91 | #define BLE_GAP_ADDR_CYCLE_MODE_AUTO 0x01 /**< Automatically generate and update private addresses. */ |
mbed_official | 277:0dffe5d9e928 | 92 | /** @} */ |
mbed_official | 277:0dffe5d9e928 | 93 | |
mbed_official | 277:0dffe5d9e928 | 94 | /**@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. */ |
mbed_official | 277:0dffe5d9e928 | 95 | #define BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S (60 * 15) |
mbed_official | 277:0dffe5d9e928 | 96 | |
mbed_official | 277:0dffe5d9e928 | 97 | /** @brief BLE address length. */ |
mbed_official | 277:0dffe5d9e928 | 98 | #define BLE_GAP_ADDR_LEN 6 |
mbed_official | 277:0dffe5d9e928 | 99 | |
mbed_official | 277:0dffe5d9e928 | 100 | |
mbed_official | 277:0dffe5d9e928 | 101 | /**@defgroup BLE_GAP_AD_TYPE_DEFINITIONS GAP Advertising and Scan Response Data format |
mbed_official | 277:0dffe5d9e928 | 102 | * @note Found at https://www.bluetooth.org/Technical/AssignedNumbers/generic_access_profile.htm |
mbed_official | 277:0dffe5d9e928 | 103 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 104 | #define BLE_GAP_AD_TYPE_FLAGS 0x01 /**< Flags for discoverability. */ |
mbed_official | 277:0dffe5d9e928 | 105 | #define BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE 0x02 /**< Partial list of 16 bit service UUIDs. */ |
mbed_official | 277:0dffe5d9e928 | 106 | #define BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_COMPLETE 0x03 /**< Complete list of 16 bit service UUIDs. */ |
mbed_official | 277:0dffe5d9e928 | 107 | #define BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE 0x04 /**< Partial list of 32 bit service UUIDs. */ |
mbed_official | 277:0dffe5d9e928 | 108 | #define BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_COMPLETE 0x05 /**< Complete list of 32 bit service UUIDs. */ |
mbed_official | 277:0dffe5d9e928 | 109 | #define BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE 0x06 /**< Partial list of 128 bit service UUIDs. */ |
mbed_official | 277:0dffe5d9e928 | 110 | #define BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE 0x07 /**< Complete list of 128 bit service UUIDs. */ |
mbed_official | 277:0dffe5d9e928 | 111 | #define BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME 0x08 /**< Short local device name. */ |
mbed_official | 277:0dffe5d9e928 | 112 | #define BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME 0x09 /**< Complete local device name. */ |
mbed_official | 277:0dffe5d9e928 | 113 | #define BLE_GAP_AD_TYPE_TX_POWER_LEVEL 0x0A /**< Transmit power level. */ |
mbed_official | 277:0dffe5d9e928 | 114 | #define BLE_GAP_AD_TYPE_CLASS_OF_DEVICE 0x0D /**< Class of device. */ |
mbed_official | 277:0dffe5d9e928 | 115 | #define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C 0x0E /**< Simple Pairing Hash C. */ |
mbed_official | 277:0dffe5d9e928 | 116 | #define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R 0x0F /**< Simple Pairing Randomizer R. */ |
mbed_official | 277:0dffe5d9e928 | 117 | #define BLE_GAP_AD_TYPE_SECURITY_MANAGER_TK_VALUE 0x10 /**< Security Manager TK Value. */ |
mbed_official | 277:0dffe5d9e928 | 118 | #define BLE_GAP_AD_TYPE_SECURITY_MANAGER_OOB_FLAGS 0x11 /**< Security Manager Out Of Band Flags. */ |
mbed_official | 277:0dffe5d9e928 | 119 | #define BLE_GAP_AD_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE 0x12 /**< Slave Connection Interval Range. */ |
mbed_official | 277:0dffe5d9e928 | 120 | #define BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_16BIT 0x14 /**< List of 16-bit Service Solicitation UUIDs. */ |
mbed_official | 277:0dffe5d9e928 | 121 | #define BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_128BIT 0x15 /**< List of 128-bit Service Solicitation UUIDs. */ |
mbed_official | 277:0dffe5d9e928 | 122 | #define BLE_GAP_AD_TYPE_SERVICE_DATA 0x16 /**< Service Data - 16-bit UUID. */ |
mbed_official | 277:0dffe5d9e928 | 123 | #define BLE_GAP_AD_TYPE_PUBLIC_TARGET_ADDRESS 0x17 /**< Public Target Address. */ |
mbed_official | 277:0dffe5d9e928 | 124 | #define BLE_GAP_AD_TYPE_RANDOM_TARGET_ADDRESS 0x18 /**< Random Target Address. */ |
mbed_official | 277:0dffe5d9e928 | 125 | #define BLE_GAP_AD_TYPE_APPEARANCE 0x19 /**< Appearance. */ |
mbed_official | 277:0dffe5d9e928 | 126 | #define BLE_GAP_AD_TYPE_ADVERTISING_INTERVAL 0x1A /**< Advertising Interval. */ |
mbed_official | 277:0dffe5d9e928 | 127 | #define BLE_GAP_AD_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS 0x1B /**< LE Bluetooth Device Address. */ |
mbed_official | 277:0dffe5d9e928 | 128 | #define BLE_GAP_AD_TYPE_LE_ROLE 0x1C /**< LE Role. */ |
mbed_official | 277:0dffe5d9e928 | 129 | #define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C256 0x1D /**< Simple Pairing Hash C-256. */ |
mbed_official | 277:0dffe5d9e928 | 130 | #define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R256 0x1E /**< Simple Pairing Randomizer R-256. */ |
mbed_official | 277:0dffe5d9e928 | 131 | #define BLE_GAP_AD_TYPE_SERVICE_DATA_32BIT_UUID 0x20 /**< Service Data - 32-bit UUID. */ |
mbed_official | 277:0dffe5d9e928 | 132 | #define BLE_GAP_AD_TYPE_SERVICE_DATA_128BIT_UUID 0x21 /**< Service Data - 128-bit UUID. */ |
mbed_official | 277:0dffe5d9e928 | 133 | #define BLE_GAP_AD_TYPE_3D_INFORMATION_DATA 0x3D /**< 3D Information Data. */ |
mbed_official | 277:0dffe5d9e928 | 134 | #define BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA 0xFF /**< Manufacturer Specific Data. */ |
mbed_official | 277:0dffe5d9e928 | 135 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 136 | |
mbed_official | 277:0dffe5d9e928 | 137 | |
mbed_official | 277:0dffe5d9e928 | 138 | /**@defgroup BLE_GAP_ADV_FLAGS GAP Advertisement Flags |
mbed_official | 277:0dffe5d9e928 | 139 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 140 | #define BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE (0x01) /**< LE Limited Discoverable Mode. */ |
mbed_official | 277:0dffe5d9e928 | 141 | #define BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE (0x02) /**< LE General Discoverable Mode. */ |
mbed_official | 277:0dffe5d9e928 | 142 | #define BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED (0x04) /**< BR/EDR not supported. */ |
mbed_official | 277:0dffe5d9e928 | 143 | #define BLE_GAP_ADV_FLAG_LE_BR_EDR_CONTROLLER (0x08) /**< Simultaneous LE and BR/EDR, Controller. */ |
mbed_official | 277:0dffe5d9e928 | 144 | #define BLE_GAP_ADV_FLAG_LE_BR_EDR_HOST (0x10) /**< Simultaneous LE and BR/EDR, Host. */ |
mbed_official | 277:0dffe5d9e928 | 145 | #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. */ |
mbed_official | 277:0dffe5d9e928 | 146 | #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. */ |
mbed_official | 277:0dffe5d9e928 | 147 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 148 | |
mbed_official | 277:0dffe5d9e928 | 149 | |
mbed_official | 277:0dffe5d9e928 | 150 | /**@defgroup BLE_GAP_ADV_INTERVALS GAP Advertising interval max and min |
mbed_official | 277:0dffe5d9e928 | 151 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 152 | #define BLE_GAP_ADV_INTERVAL_MIN 0x0020 /**< Minimum Advertising interval in 625 us units, i.e. 20 ms. */ |
mbed_official | 277:0dffe5d9e928 | 153 | #define BLE_GAP_ADV_NONCON_INTERVAL_MIN 0x00A0 /**< Minimum Advertising interval in 625 us units for non connectable mode, i.e. 100 ms. */ |
mbed_official | 277:0dffe5d9e928 | 154 | #define BLE_GAP_ADV_INTERVAL_MAX 0x4000 /**< Maximum Advertising interval in 625 us units, i.e. 10.24 s. */ |
mbed_official | 277:0dffe5d9e928 | 155 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 156 | |
mbed_official | 277:0dffe5d9e928 | 157 | |
mbed_official | 277:0dffe5d9e928 | 158 | /**@brief Maximum size of advertising data in octets. */ |
mbed_official | 277:0dffe5d9e928 | 159 | #define BLE_GAP_ADV_MAX_SIZE 31 |
mbed_official | 277:0dffe5d9e928 | 160 | |
mbed_official | 277:0dffe5d9e928 | 161 | |
mbed_official | 277:0dffe5d9e928 | 162 | /**@defgroup BLE_GAP_ADV_TYPES GAP Advertising types |
mbed_official | 277:0dffe5d9e928 | 163 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 164 | #define BLE_GAP_ADV_TYPE_ADV_IND 0x00 /**< Connectable undirected. */ |
mbed_official | 277:0dffe5d9e928 | 165 | #define BLE_GAP_ADV_TYPE_ADV_DIRECT_IND 0x01 /**< Connectable directed. */ |
mbed_official | 277:0dffe5d9e928 | 166 | #define BLE_GAP_ADV_TYPE_ADV_SCAN_IND 0x02 /**< Scannable undirected. */ |
mbed_official | 277:0dffe5d9e928 | 167 | #define BLE_GAP_ADV_TYPE_ADV_NONCONN_IND 0x03 /**< Non connectable undirected. */ |
mbed_official | 277:0dffe5d9e928 | 168 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 169 | |
mbed_official | 277:0dffe5d9e928 | 170 | |
mbed_official | 277:0dffe5d9e928 | 171 | /**@defgroup BLE_GAP_ADV_FILTER_POLICIES GAP Advertising filter policies |
mbed_official | 277:0dffe5d9e928 | 172 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 173 | #define BLE_GAP_ADV_FP_ANY 0x00 /**< Allow scan requests and connect requests from any device. */ |
mbed_official | 277:0dffe5d9e928 | 174 | #define BLE_GAP_ADV_FP_FILTER_SCANREQ 0x01 /**< Filter scan requests with whitelist. */ |
mbed_official | 277:0dffe5d9e928 | 175 | #define BLE_GAP_ADV_FP_FILTER_CONNREQ 0x02 /**< Filter connect requests with whitelist. */ |
mbed_official | 277:0dffe5d9e928 | 176 | #define BLE_GAP_ADV_FP_FILTER_BOTH 0x03 /**< Filter both scan and connect requests with whitelist. */ |
mbed_official | 277:0dffe5d9e928 | 177 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 178 | |
mbed_official | 277:0dffe5d9e928 | 179 | |
mbed_official | 277:0dffe5d9e928 | 180 | /**@defgroup BLE_GAP_ADV_TIMEOUT_VALUES GAP Advertising timeout values |
mbed_official | 277:0dffe5d9e928 | 181 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 182 | #define BLE_GAP_ADV_TIMEOUT_LIMITED_MAX 180 /**< Maximum advertising time in limited discoverable mode (TGAP(lim_adv_timeout) = 180s in spec (Addendum 2)). */ |
mbed_official | 277:0dffe5d9e928 | 183 | #define BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED 0 /**< Unlimited advertising in general discoverable mode. */ |
mbed_official | 277:0dffe5d9e928 | 184 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 185 | |
mbed_official | 277:0dffe5d9e928 | 186 | |
mbed_official | 277:0dffe5d9e928 | 187 | /**@defgroup BLE_GAP_DISC_MODES GAP Discovery modes |
mbed_official | 277:0dffe5d9e928 | 188 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 189 | #define BLE_GAP_DISC_MODE_NOT_DISCOVERABLE 0x00 /**< Not discoverable discovery Mode. */ |
mbed_official | 277:0dffe5d9e928 | 190 | #define BLE_GAP_DISC_MODE_LIMITED 0x01 /**< Limited Discovery Mode. */ |
mbed_official | 277:0dffe5d9e928 | 191 | #define BLE_GAP_DISC_MODE_GENERAL 0x02 /**< General Discovery Mode. */ |
mbed_official | 277:0dffe5d9e928 | 192 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 193 | |
mbed_official | 277:0dffe5d9e928 | 194 | /**@defgroup BLE_GAP_IO_CAPS GAP IO Capabilities |
mbed_official | 277:0dffe5d9e928 | 195 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 196 | #define BLE_GAP_IO_CAPS_DISPLAY_ONLY 0x00 /**< Display Only. */ |
mbed_official | 277:0dffe5d9e928 | 197 | #define BLE_GAP_IO_CAPS_DISPLAY_YESNO 0x01 /**< Display and Yes/No entry. */ |
mbed_official | 277:0dffe5d9e928 | 198 | #define BLE_GAP_IO_CAPS_KEYBOARD_ONLY 0x02 /**< Keyboard Only. */ |
mbed_official | 277:0dffe5d9e928 | 199 | #define BLE_GAP_IO_CAPS_NONE 0x03 /**< No I/O capabilities. */ |
mbed_official | 277:0dffe5d9e928 | 200 | #define BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY 0x04 /**< Keyboard and Display. */ |
mbed_official | 277:0dffe5d9e928 | 201 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 202 | |
mbed_official | 277:0dffe5d9e928 | 203 | |
mbed_official | 277:0dffe5d9e928 | 204 | /**@defgroup BLE_GAP_AUTH_KEY_TYPES GAP Authentication Key Types |
mbed_official | 277:0dffe5d9e928 | 205 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 206 | #define BLE_GAP_AUTH_KEY_TYPE_NONE 0x00 /**< No key (may be used to reject). */ |
mbed_official | 277:0dffe5d9e928 | 207 | #define BLE_GAP_AUTH_KEY_TYPE_PASSKEY 0x01 /**< 6-digit Passkey. */ |
mbed_official | 277:0dffe5d9e928 | 208 | #define BLE_GAP_AUTH_KEY_TYPE_OOB 0x02 /**< Out Of Band data. */ |
mbed_official | 277:0dffe5d9e928 | 209 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 210 | |
mbed_official | 277:0dffe5d9e928 | 211 | /**@defgroup BLE_GAP_SEC_STATUS GAP Security status |
mbed_official | 277:0dffe5d9e928 | 212 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 213 | #define BLE_GAP_SEC_STATUS_SUCCESS 0x00 /**< Successful parameters. */ |
mbed_official | 277:0dffe5d9e928 | 214 | #define BLE_GAP_SEC_STATUS_TIMEOUT 0x01 /**< Procedure timed out. */ |
mbed_official | 277:0dffe5d9e928 | 215 | #define BLE_GAP_SEC_STATUS_PDU_INVALID 0x02 /**< Invalid PDU received. */ |
mbed_official | 277:0dffe5d9e928 | 216 | #define BLE_GAP_SEC_STATUS_PASSKEY_ENTRY_FAILED 0x81 /**< Passkey entry failed (user cancelled or other). */ |
mbed_official | 277:0dffe5d9e928 | 217 | #define BLE_GAP_SEC_STATUS_OOB_NOT_AVAILABLE 0x82 /**< Out of Band Key not available. */ |
mbed_official | 277:0dffe5d9e928 | 218 | #define BLE_GAP_SEC_STATUS_AUTH_REQ 0x83 /**< Authentication requirements not met. */ |
mbed_official | 277:0dffe5d9e928 | 219 | #define BLE_GAP_SEC_STATUS_CONFIRM_VALUE 0x84 /**< Confirm value failed. */ |
mbed_official | 277:0dffe5d9e928 | 220 | #define BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP 0x85 /**< Pairing not supported. */ |
mbed_official | 277:0dffe5d9e928 | 221 | #define BLE_GAP_SEC_STATUS_ENC_KEY_SIZE 0x86 /**< Encryption key size. */ |
mbed_official | 277:0dffe5d9e928 | 222 | #define BLE_GAP_SEC_STATUS_SMP_CMD_UNSUPPORTED 0x87 /**< Unsupported SMP command. */ |
mbed_official | 277:0dffe5d9e928 | 223 | #define BLE_GAP_SEC_STATUS_UNSPECIFIED 0x88 /**< Unspecified reason. */ |
mbed_official | 277:0dffe5d9e928 | 224 | #define BLE_GAP_SEC_STATUS_REPEATED_ATTEMPTS 0x89 /**< Too little time elapsed since last attempt. */ |
mbed_official | 277:0dffe5d9e928 | 225 | #define BLE_GAP_SEC_STATUS_INVALID_PARAMS 0x8A /**< Invalid parameters. */ |
mbed_official | 277:0dffe5d9e928 | 226 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 227 | |
mbed_official | 277:0dffe5d9e928 | 228 | /**@defgroup BLE_GAP_SEC_STATUS_SOURCES GAP Security status sources |
mbed_official | 277:0dffe5d9e928 | 229 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 230 | #define BLE_GAP_SEC_STATUS_SOURCE_LOCAL 0x00 /**< Local failure. */ |
mbed_official | 277:0dffe5d9e928 | 231 | #define BLE_GAP_SEC_STATUS_SOURCE_REMOTE 0x01 /**< Remote failure. */ |
mbed_official | 277:0dffe5d9e928 | 232 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 233 | |
mbed_official | 277:0dffe5d9e928 | 234 | /**@defgroup BLE_GAP_CP_LIMITS GAP Connection Parameters Limits |
mbed_official | 277:0dffe5d9e928 | 235 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 236 | #define BLE_GAP_CP_MIN_CONN_INTVL_NONE 0xFFFF /**< No new minimum connction interval specified in connect parameters. */ |
mbed_official | 277:0dffe5d9e928 | 237 | #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. */ |
mbed_official | 277:0dffe5d9e928 | 238 | #define BLE_GAP_CP_MIN_CONN_INTVL_MAX 0x0C80 /**< Highest minimum connection interval permitted, in units of 1.25 ms, i.e. 4 s. */ |
mbed_official | 277:0dffe5d9e928 | 239 | #define BLE_GAP_CP_MAX_CONN_INTVL_NONE 0xFFFF /**< No new maximum connction interval specified in connect parameters. */ |
mbed_official | 277:0dffe5d9e928 | 240 | #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. */ |
mbed_official | 277:0dffe5d9e928 | 241 | #define BLE_GAP_CP_MAX_CONN_INTVL_MAX 0x0C80 /**< Highest maximum connection interval permitted, in units of 1.25 ms, i.e. 4 s. */ |
mbed_official | 277:0dffe5d9e928 | 242 | #define BLE_GAP_CP_SLAVE_LATENCY_MAX 0x03E8 /**< Highest slave latency permitted, in connection events. */ |
mbed_official | 277:0dffe5d9e928 | 243 | #define BLE_GAP_CP_CONN_SUP_TIMEOUT_NONE 0xFFFF /**< No new supervision timeout specified in connect parameters. */ |
mbed_official | 277:0dffe5d9e928 | 244 | #define BLE_GAP_CP_CONN_SUP_TIMEOUT_MIN 0x000A /**< Lowest supervision timeout permitted, in units of 10 ms, i.e. 100 ms. */ |
mbed_official | 277:0dffe5d9e928 | 245 | #define BLE_GAP_CP_CONN_SUP_TIMEOUT_MAX 0x0C80 /**< Highest supervision timeout permitted, in units of 10 ms, i.e. 32 s. */ |
mbed_official | 277:0dffe5d9e928 | 246 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 247 | |
mbed_official | 277:0dffe5d9e928 | 248 | |
mbed_official | 277:0dffe5d9e928 | 249 | /**@brief GAP device name maximum length. */ |
mbed_official | 277:0dffe5d9e928 | 250 | #define BLE_GAP_DEVNAME_MAX_LEN 31 |
mbed_official | 277:0dffe5d9e928 | 251 | |
mbed_official | 277:0dffe5d9e928 | 252 | |
mbed_official | 277:0dffe5d9e928 | 253 | /**@defgroup BLE_GAP_CONN_SEC_MODE_SET_MACROS GAP attribute security requirement setters |
mbed_official | 277:0dffe5d9e928 | 254 | * |
mbed_official | 277:0dffe5d9e928 | 255 | * See @ref ble_gap_conn_sec_mode_t. |
mbed_official | 277:0dffe5d9e928 | 256 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 257 | /**@brief Set sec_mode pointed to by ptr to have no access rights.*/ |
mbed_official | 277:0dffe5d9e928 | 258 | #define BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(ptr) do {(ptr)->sm = 0; (ptr)->lv = 0;} while(0) |
mbed_official | 277:0dffe5d9e928 | 259 | /**@brief Set sec_mode pointed to by ptr to require no protection, open link.*/ |
mbed_official | 277:0dffe5d9e928 | 260 | #define BLE_GAP_CONN_SEC_MODE_SET_OPEN(ptr) do {(ptr)->sm = 1; (ptr)->lv = 1;} while(0) |
mbed_official | 277:0dffe5d9e928 | 261 | /**@brief Set sec_mode pointed to by ptr to require encryption, but no MITM protection.*/ |
mbed_official | 277:0dffe5d9e928 | 262 | #define BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 2;} while(0) |
mbed_official | 277:0dffe5d9e928 | 263 | /**@brief Set sec_mode pointed to by ptr to require encryption and MITM protection.*/ |
mbed_official | 277:0dffe5d9e928 | 264 | #define BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 3;} while(0) |
mbed_official | 277:0dffe5d9e928 | 265 | /**@brief Set sec_mode pointed to by ptr to require signing or encryption, no MITM protection needed.*/ |
mbed_official | 277:0dffe5d9e928 | 266 | #define BLE_GAP_CONN_SEC_MODE_SET_SIGNED_NO_MITM(ptr) do {(ptr)->sm = 2; (ptr)->lv = 1;} while(0) |
mbed_official | 277:0dffe5d9e928 | 267 | /**@brief Set sec_mode pointed to by ptr to require signing or encryption with MITM protection.*/ |
mbed_official | 277:0dffe5d9e928 | 268 | #define BLE_GAP_CONN_SEC_MODE_SET_SIGNED_WITH_MITM(ptr) do {(ptr)->sm = 2; (ptr)->lv = 2;} while(0) |
mbed_official | 277:0dffe5d9e928 | 269 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 270 | |
mbed_official | 277:0dffe5d9e928 | 271 | |
mbed_official | 277:0dffe5d9e928 | 272 | /**@brief GAP Security Key Length. */ |
mbed_official | 277:0dffe5d9e928 | 273 | #define BLE_GAP_SEC_KEY_LEN 16 |
mbed_official | 277:0dffe5d9e928 | 274 | |
mbed_official | 277:0dffe5d9e928 | 275 | /**@brief GAP Passkey Length. */ |
mbed_official | 277:0dffe5d9e928 | 276 | #define BLE_GAP_PASSKEY_LEN 6 |
mbed_official | 277:0dffe5d9e928 | 277 | |
mbed_official | 277:0dffe5d9e928 | 278 | /**@brief Maximum amount of addresses in a whitelist. */ |
mbed_official | 277:0dffe5d9e928 | 279 | #define BLE_GAP_WHITELIST_ADDR_MAX_COUNT (8) |
mbed_official | 277:0dffe5d9e928 | 280 | |
mbed_official | 277:0dffe5d9e928 | 281 | /**@brief Maximum amount of IRKs in a whitelist. |
mbed_official | 277:0dffe5d9e928 | 282 | * @note The number of IRKs is limited to 8, even if the hardware supports more. |
mbed_official | 277:0dffe5d9e928 | 283 | */ |
mbed_official | 277:0dffe5d9e928 | 284 | #define BLE_GAP_WHITELIST_IRK_MAX_COUNT (8) |
mbed_official | 277:0dffe5d9e928 | 285 | |
mbed_official | 277:0dffe5d9e928 | 286 | /**@defgroup GAP_SEC_MODES GAP Security Modes |
mbed_official | 277:0dffe5d9e928 | 287 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 288 | #define BLE_GAP_SEC_MODE 0x00 /**< No key (may be used to reject). */ |
mbed_official | 277:0dffe5d9e928 | 289 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 290 | |
mbed_official | 277:0dffe5d9e928 | 291 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 292 | |
mbed_official | 277:0dffe5d9e928 | 293 | /**@addtogroup BLE_GAP_STRUCTURES Structures |
mbed_official | 277:0dffe5d9e928 | 294 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 295 | |
mbed_official | 277:0dffe5d9e928 | 296 | /**@brief Bluetooth Low Energy address. */ |
mbed_official | 277:0dffe5d9e928 | 297 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 298 | { |
mbed_official | 277:0dffe5d9e928 | 299 | uint8_t addr_type; /**< See @ref BLE_GAP_ADDR_TYPES. */ |
mbed_official | 277:0dffe5d9e928 | 300 | uint8_t addr[BLE_GAP_ADDR_LEN]; /**< 48-bit address, LSB format. */ |
mbed_official | 277:0dffe5d9e928 | 301 | } ble_gap_addr_t; |
mbed_official | 277:0dffe5d9e928 | 302 | |
mbed_official | 277:0dffe5d9e928 | 303 | |
mbed_official | 277:0dffe5d9e928 | 304 | /**@brief GAP connection parameters. |
mbed_official | 277:0dffe5d9e928 | 305 | * |
mbed_official | 277:0dffe5d9e928 | 306 | * @note When ble_conn_params_t is received in an event, both min_conn_interval and |
mbed_official | 277:0dffe5d9e928 | 307 | * max_conn_interval will be equal to the connection interval set by the central. |
mbed_official | 277:0dffe5d9e928 | 308 | */ |
mbed_official | 277:0dffe5d9e928 | 309 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 310 | { |
mbed_official | 277:0dffe5d9e928 | 311 | uint16_t min_conn_interval; /**< Minimum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/ |
mbed_official | 277:0dffe5d9e928 | 312 | uint16_t max_conn_interval; /**< Maximum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/ |
mbed_official | 277:0dffe5d9e928 | 313 | uint16_t slave_latency; /**< Slave Latency in number of connection events, see @ref BLE_GAP_CP_LIMITS.*/ |
mbed_official | 277:0dffe5d9e928 | 314 | uint16_t conn_sup_timeout; /**< Connection Supervision Timeout in 10 ms units, see @ref BLE_GAP_CP_LIMITS.*/ |
mbed_official | 277:0dffe5d9e928 | 315 | } ble_gap_conn_params_t; |
mbed_official | 277:0dffe5d9e928 | 316 | |
mbed_official | 277:0dffe5d9e928 | 317 | |
mbed_official | 277:0dffe5d9e928 | 318 | /**@brief GAP link requirements. |
mbed_official | 277:0dffe5d9e928 | 319 | * |
mbed_official | 277:0dffe5d9e928 | 320 | * See Bluetooth Core specification, Volume 3 Part C 10.2 for details. |
mbed_official | 277:0dffe5d9e928 | 321 | * |
mbed_official | 277:0dffe5d9e928 | 322 | * Security Mode 0 Level 0: No access permissions at all (this level is not defined by the Bluetooth Core specification).\n |
mbed_official | 277:0dffe5d9e928 | 323 | * Security Mode 1 Level 1: No security is needed (aka open link).\n |
mbed_official | 277:0dffe5d9e928 | 324 | * Security Mode 1 Level 2: Encrypted link required, MITM protection not necessary.\n |
mbed_official | 277:0dffe5d9e928 | 325 | * Security Mode 1 Level 3: MITM protected encrypted link required.\n |
mbed_official | 277:0dffe5d9e928 | 326 | * Security Mode 2 Level 1: Signing or encryption required, MITM protection not necessary.\n |
mbed_official | 277:0dffe5d9e928 | 327 | * Security Mode 2 Level 2: MITM protected signing required, unless link is MITM protected encrypted.\n |
mbed_official | 277:0dffe5d9e928 | 328 | */ |
mbed_official | 277:0dffe5d9e928 | 329 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 330 | { |
mbed_official | 277:0dffe5d9e928 | 331 | uint8_t sm : 4; /**< Security Mode (1 or 2), 0 for no permissions at all. */ |
mbed_official | 277:0dffe5d9e928 | 332 | uint8_t lv : 4; /**< Level (1, 2 or 3), 0 for no permissions at all. */ |
mbed_official | 277:0dffe5d9e928 | 333 | |
mbed_official | 277:0dffe5d9e928 | 334 | } ble_gap_conn_sec_mode_t; |
mbed_official | 277:0dffe5d9e928 | 335 | |
mbed_official | 277:0dffe5d9e928 | 336 | |
mbed_official | 277:0dffe5d9e928 | 337 | /**@brief GAP connection security status.*/ |
mbed_official | 277:0dffe5d9e928 | 338 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 339 | { |
mbed_official | 277:0dffe5d9e928 | 340 | ble_gap_conn_sec_mode_t sec_mode; /**< Currently active security mode for this connection.*/ |
mbed_official | 277:0dffe5d9e928 | 341 | uint8_t encr_key_size; /**< Length of currently active encryption key, 7 to 16 octets (only applicable for bonding procedures). */ |
mbed_official | 277:0dffe5d9e928 | 342 | } ble_gap_conn_sec_t; |
mbed_official | 277:0dffe5d9e928 | 343 | |
mbed_official | 277:0dffe5d9e928 | 344 | |
mbed_official | 277:0dffe5d9e928 | 345 | /**@brief Identity Resolving Key. */ |
mbed_official | 277:0dffe5d9e928 | 346 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 347 | { |
mbed_official | 277:0dffe5d9e928 | 348 | uint8_t irk[BLE_GAP_SEC_KEY_LEN]; /**< Array containing IRK. */ |
mbed_official | 277:0dffe5d9e928 | 349 | } ble_gap_irk_t; |
mbed_official | 277:0dffe5d9e928 | 350 | |
mbed_official | 277:0dffe5d9e928 | 351 | |
mbed_official | 277:0dffe5d9e928 | 352 | /**@brief Whitelist structure. */ |
mbed_official | 277:0dffe5d9e928 | 353 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 354 | { |
mbed_official | 277:0dffe5d9e928 | 355 | ble_gap_addr_t ** pp_addrs; /**< Pointer to array of device address pointers, pointing to addresses to be used in whitelist. NULL if none are given. */ |
mbed_official | 277:0dffe5d9e928 | 356 | uint8_t addr_count; /**< Count of device addresses in array, up to @ref BLE_GAP_WHITELIST_ADDR_MAX_COUNT. */ |
mbed_official | 277:0dffe5d9e928 | 357 | ble_gap_irk_t ** pp_irks; /**< Pointer to array of Identity Resolving Key (IRK) pointers, each pointing to an IRK in the whitelist. NULL if none are given. */ |
mbed_official | 277:0dffe5d9e928 | 358 | uint8_t irk_count; /**< Count of IRKs in array, up to @ref BLE_GAP_WHITELIST_IRK_MAX_COUNT. */ |
mbed_official | 277:0dffe5d9e928 | 359 | } ble_gap_whitelist_t; |
mbed_official | 277:0dffe5d9e928 | 360 | |
mbed_official | 277:0dffe5d9e928 | 361 | |
mbed_official | 277:0dffe5d9e928 | 362 | /**@brief GAP advertising parameters.*/ |
mbed_official | 277:0dffe5d9e928 | 363 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 364 | { |
mbed_official | 277:0dffe5d9e928 | 365 | uint8_t type; /**< See @ref BLE_GAP_ADV_TYPES. */ |
mbed_official | 277:0dffe5d9e928 | 366 | ble_gap_addr_t* p_peer_addr; /**< For BLE_GAP_CONN_MODE_DIRECTED mode only, known peer address. */ |
mbed_official | 277:0dffe5d9e928 | 367 | uint8_t fp; /**< Filter Policy, see @ref BLE_GAP_ADV_FILTER_POLICIES. */ |
mbed_official | 277:0dffe5d9e928 | 368 | ble_gap_whitelist_t * p_whitelist; /**< Pointer to whitelist, NULL if none is given. */ |
mbed_official | 277:0dffe5d9e928 | 369 | uint16_t interval; /**< Advertising interval between 0x0020 and 0x4000 in 0.625 ms units (20ms to 10.24s), see @ref BLE_GAP_ADV_INTERVALS. This parameter must be set to 0 if type equals @ref BLE_GAP_ADV_TYPE_ADV_DIRECT_IND. */ |
mbed_official | 277:0dffe5d9e928 | 370 | uint16_t timeout; /**< Advertising timeout between 0x0001 and 0x3FFF in seconds, 0x0000 disables timeout. See also @ref BLE_GAP_ADV_TIMEOUT_VALUES. This parameter must be set to 0 if type equals @ref BLE_GAP_ADV_TYPE_ADV_DIRECT_IND. */ |
mbed_official | 277:0dffe5d9e928 | 371 | } ble_gap_adv_params_t; |
mbed_official | 277:0dffe5d9e928 | 372 | |
mbed_official | 277:0dffe5d9e928 | 373 | |
mbed_official | 277:0dffe5d9e928 | 374 | /**@brief GAP scanning parameters. */ |
mbed_official | 277:0dffe5d9e928 | 375 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 376 | { |
mbed_official | 277:0dffe5d9e928 | 377 | uint8_t filter; /**< Filter based on discovery mode, see @ref BLE_GAP_DISC_MODES. */ |
mbed_official | 277:0dffe5d9e928 | 378 | uint8_t active : 1; /**< If 1, perform active scanning (scan requests). */ |
mbed_official | 277:0dffe5d9e928 | 379 | uint8_t selective : 1; /**< If 1, ignore unknown devices (non whitelisted). */ |
mbed_official | 277:0dffe5d9e928 | 380 | uint16_t interval; /**< Scan interval between 0x0020 and 0x4000 in 0.625ms units (20ms to 10.24s). */ |
mbed_official | 277:0dffe5d9e928 | 381 | uint16_t window; /**< Scan window between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s). */ |
mbed_official | 277:0dffe5d9e928 | 382 | uint16_t timeout; /**< Scan timeout between 0x0001 and 0x3FFF in seconds, 0x0000 disables timeout. */ |
mbed_official | 277:0dffe5d9e928 | 383 | } ble_gap_scan_params_t; |
mbed_official | 277:0dffe5d9e928 | 384 | |
mbed_official | 277:0dffe5d9e928 | 385 | |
mbed_official | 277:0dffe5d9e928 | 386 | /**@brief GAP security parameters. */ |
mbed_official | 277:0dffe5d9e928 | 387 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 388 | { |
mbed_official | 277:0dffe5d9e928 | 389 | uint16_t timeout; /**< Timeout for SMP transactions or Security Request in seconds, see @ref sd_ble_gap_authenticate and @ref sd_ble_gap_sec_params_reply for more information. */ |
mbed_official | 277:0dffe5d9e928 | 390 | uint8_t bond : 1; /**< Perform bonding. */ |
mbed_official | 277:0dffe5d9e928 | 391 | uint8_t mitm : 1; /**< Man In The Middle protection required. */ |
mbed_official | 277:0dffe5d9e928 | 392 | uint8_t io_caps : 3; /**< IO capabilities, see @ref BLE_GAP_IO_CAPS. */ |
mbed_official | 277:0dffe5d9e928 | 393 | uint8_t oob : 1; /**< Out Of Band data available. */ |
mbed_official | 277:0dffe5d9e928 | 394 | uint8_t min_key_size; /**< Minimum encryption key size in octets between 7 and 16. */ |
mbed_official | 277:0dffe5d9e928 | 395 | uint8_t max_key_size; /**< Maximum encryption key size in octets between min_key_size and 16. */ |
mbed_official | 277:0dffe5d9e928 | 396 | } ble_gap_sec_params_t; |
mbed_official | 277:0dffe5d9e928 | 397 | |
mbed_official | 277:0dffe5d9e928 | 398 | |
mbed_official | 277:0dffe5d9e928 | 399 | /**@brief GAP Encryption Information. */ |
mbed_official | 277:0dffe5d9e928 | 400 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 401 | { |
mbed_official | 277:0dffe5d9e928 | 402 | uint16_t div; /**< Encryption Diversifier. */ |
mbed_official | 277:0dffe5d9e928 | 403 | uint8_t ltk[BLE_GAP_SEC_KEY_LEN]; /**< Long Term Key. */ |
mbed_official | 277:0dffe5d9e928 | 404 | uint8_t auth : 1; /**< Authenticated Key. */ |
mbed_official | 277:0dffe5d9e928 | 405 | uint8_t ltk_len : 7; /**< LTK length in octets. */ |
mbed_official | 277:0dffe5d9e928 | 406 | } ble_gap_enc_info_t; |
mbed_official | 277:0dffe5d9e928 | 407 | |
mbed_official | 277:0dffe5d9e928 | 408 | |
mbed_official | 277:0dffe5d9e928 | 409 | /**@brief GAP Master Identification. */ |
mbed_official | 277:0dffe5d9e928 | 410 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 411 | { |
mbed_official | 277:0dffe5d9e928 | 412 | uint16_t ediv; /**< Encrypted Diversifier. */ |
mbed_official | 277:0dffe5d9e928 | 413 | uint8_t rand[8]; /**< Random Number. */ |
mbed_official | 277:0dffe5d9e928 | 414 | } ble_gap_master_id_t; |
mbed_official | 277:0dffe5d9e928 | 415 | |
mbed_official | 277:0dffe5d9e928 | 416 | |
mbed_official | 277:0dffe5d9e928 | 417 | /**@brief GAP Identity Information. */ |
mbed_official | 277:0dffe5d9e928 | 418 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 419 | { |
mbed_official | 277:0dffe5d9e928 | 420 | ble_gap_addr_t addr; /**< Bluetooth address to which this key applies. */ |
mbed_official | 277:0dffe5d9e928 | 421 | uint8_t irk[BLE_GAP_SEC_KEY_LEN]; /**< Identity Resolution Key. */ |
mbed_official | 277:0dffe5d9e928 | 422 | } ble_gap_id_info_t; |
mbed_official | 277:0dffe5d9e928 | 423 | |
mbed_official | 277:0dffe5d9e928 | 424 | |
mbed_official | 277:0dffe5d9e928 | 425 | /**@brief GAP Signing Information. */ |
mbed_official | 277:0dffe5d9e928 | 426 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 427 | { |
mbed_official | 277:0dffe5d9e928 | 428 | uint8_t csrk[BLE_GAP_SEC_KEY_LEN]; /* Connection Signature Resolving Key. */ |
mbed_official | 277:0dffe5d9e928 | 429 | } ble_gap_sign_info_t; |
mbed_official | 277:0dffe5d9e928 | 430 | |
mbed_official | 277:0dffe5d9e928 | 431 | |
mbed_official | 277:0dffe5d9e928 | 432 | /**@brief GAP Event IDs. |
mbed_official | 277:0dffe5d9e928 | 433 | * Those IDs uniquely identify an event coming from the stack to the application. |
mbed_official | 277:0dffe5d9e928 | 434 | */ |
mbed_official | 277:0dffe5d9e928 | 435 | enum BLE_GAP_EVTS |
mbed_official | 277:0dffe5d9e928 | 436 | { |
mbed_official | 277:0dffe5d9e928 | 437 | BLE_GAP_EVT_CONNECTED = BLE_GAP_EVT_BASE, /**< Connection established. */ |
mbed_official | 277:0dffe5d9e928 | 438 | BLE_GAP_EVT_DISCONNECTED, /**< Disconnected from peer. */ |
mbed_official | 277:0dffe5d9e928 | 439 | BLE_GAP_EVT_CONN_PARAM_UPDATE, /**< Connection Parameters updated. */ |
mbed_official | 277:0dffe5d9e928 | 440 | BLE_GAP_EVT_SEC_PARAMS_REQUEST, /**< Request to provide security parameters. */ |
mbed_official | 277:0dffe5d9e928 | 441 | BLE_GAP_EVT_SEC_INFO_REQUEST, /**< Request to provide security information. */ |
mbed_official | 277:0dffe5d9e928 | 442 | BLE_GAP_EVT_PASSKEY_DISPLAY, /**< Request to display a passkey to the user. */ |
mbed_official | 277:0dffe5d9e928 | 443 | BLE_GAP_EVT_AUTH_KEY_REQUEST, /**< Request to provide an authentication key. */ |
mbed_official | 277:0dffe5d9e928 | 444 | BLE_GAP_EVT_AUTH_STATUS, /**< Authentication procedure completed with status. */ |
mbed_official | 277:0dffe5d9e928 | 445 | BLE_GAP_EVT_CONN_SEC_UPDATE, /**< Connection security updated. */ |
mbed_official | 277:0dffe5d9e928 | 446 | BLE_GAP_EVT_TIMEOUT, /**< Timeout expired. */ |
mbed_official | 277:0dffe5d9e928 | 447 | BLE_GAP_EVT_RSSI_CHANGED, /**< Signal strength measurement report. */ |
mbed_official | 277:0dffe5d9e928 | 448 | }; |
mbed_official | 277:0dffe5d9e928 | 449 | |
mbed_official | 277:0dffe5d9e928 | 450 | |
mbed_official | 277:0dffe5d9e928 | 451 | /** |
mbed_official | 277:0dffe5d9e928 | 452 | * @brief GAP Option IDs. |
mbed_official | 277:0dffe5d9e928 | 453 | * IDs that uniquely identify a GAP option. |
mbed_official | 277:0dffe5d9e928 | 454 | */ |
mbed_official | 277:0dffe5d9e928 | 455 | enum BLE_GAP_OPTS |
mbed_official | 277:0dffe5d9e928 | 456 | { |
mbed_official | 277:0dffe5d9e928 | 457 | BLE_GAP_OPT_LOCAL_CONN_LATENCY = BLE_GAP_OPT_BASE, /**< Local connection latency. */ |
mbed_official | 277:0dffe5d9e928 | 458 | BLE_GAP_OPT_PASSKEY, /**< Set passkey to be used during pairing. This option can be used to make the SoftDevice use an application provided passkey instead of generating a random passkey.*/ |
mbed_official | 277:0dffe5d9e928 | 459 | BLE_GAP_OPT_PRIVACY, /**< Set or get custom IRK or custom private address cycle interval. */ |
mbed_official | 277:0dffe5d9e928 | 460 | }; |
mbed_official | 277:0dffe5d9e928 | 461 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 462 | |
mbed_official | 277:0dffe5d9e928 | 463 | |
mbed_official | 277:0dffe5d9e928 | 464 | /**@brief Event data for connected event. */ |
mbed_official | 277:0dffe5d9e928 | 465 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 466 | { |
mbed_official | 277:0dffe5d9e928 | 467 | ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. */ |
mbed_official | 277:0dffe5d9e928 | 468 | uint8_t irk_match :1; /**< If 1, peer device's address resolved using an IRK. */ |
mbed_official | 277:0dffe5d9e928 | 469 | uint8_t irk_match_idx :7; /**< Index in IRK list where the address was matched. */ |
mbed_official | 277:0dffe5d9e928 | 470 | ble_gap_conn_params_t conn_params; /**< GAP Connection Parameters. */ |
mbed_official | 277:0dffe5d9e928 | 471 | } ble_gap_evt_connected_t; |
mbed_official | 277:0dffe5d9e928 | 472 | |
mbed_official | 277:0dffe5d9e928 | 473 | |
mbed_official | 277:0dffe5d9e928 | 474 | /**@brief Event data for disconnected event. */ |
mbed_official | 277:0dffe5d9e928 | 475 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 476 | { |
mbed_official | 277:0dffe5d9e928 | 477 | uint8_t reason; /**< HCI error code. */ |
mbed_official | 277:0dffe5d9e928 | 478 | } ble_gap_evt_disconnected_t; |
mbed_official | 277:0dffe5d9e928 | 479 | |
mbed_official | 277:0dffe5d9e928 | 480 | |
mbed_official | 277:0dffe5d9e928 | 481 | /**@brief Event data for connection parameter update event. */ |
mbed_official | 277:0dffe5d9e928 | 482 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 483 | { |
mbed_official | 277:0dffe5d9e928 | 484 | ble_gap_conn_params_t conn_params; /**< GAP Connection Parameters. */ |
mbed_official | 277:0dffe5d9e928 | 485 | } ble_gap_evt_conn_param_update_t; |
mbed_official | 277:0dffe5d9e928 | 486 | |
mbed_official | 277:0dffe5d9e928 | 487 | |
mbed_official | 277:0dffe5d9e928 | 488 | /**@brief Event data for security parameters request event. */ |
mbed_official | 277:0dffe5d9e928 | 489 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 490 | { |
mbed_official | 277:0dffe5d9e928 | 491 | ble_gap_sec_params_t peer_params; /**< Initiator Security Parameters. */ |
mbed_official | 277:0dffe5d9e928 | 492 | } ble_gap_evt_sec_params_request_t; |
mbed_official | 277:0dffe5d9e928 | 493 | |
mbed_official | 277:0dffe5d9e928 | 494 | |
mbed_official | 277:0dffe5d9e928 | 495 | /**@brief Event data for security info request event. */ |
mbed_official | 277:0dffe5d9e928 | 496 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 497 | { |
mbed_official | 277:0dffe5d9e928 | 498 | ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. */ |
mbed_official | 277:0dffe5d9e928 | 499 | uint16_t div; /**< Encryption diversifier for LTK lookup. */ |
mbed_official | 277:0dffe5d9e928 | 500 | uint8_t enc_info : 1; /**< If 1, Encryption Information required. */ |
mbed_official | 277:0dffe5d9e928 | 501 | uint8_t id_info : 1; /**< If 1, Identity Information required. */ |
mbed_official | 277:0dffe5d9e928 | 502 | uint8_t sign_info : 1; /**< If 1, Signing Information required. */ |
mbed_official | 277:0dffe5d9e928 | 503 | } ble_gap_evt_sec_info_request_t; |
mbed_official | 277:0dffe5d9e928 | 504 | |
mbed_official | 277:0dffe5d9e928 | 505 | |
mbed_official | 277:0dffe5d9e928 | 506 | /**@brief Event data for passkey display event. */ |
mbed_official | 277:0dffe5d9e928 | 507 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 508 | { |
mbed_official | 277:0dffe5d9e928 | 509 | uint8_t passkey[BLE_GAP_PASSKEY_LEN]; /**< 6-digit passkey in ASCII ('0'-'9' digits only). */ |
mbed_official | 277:0dffe5d9e928 | 510 | } ble_gap_evt_passkey_display_t; |
mbed_official | 277:0dffe5d9e928 | 511 | |
mbed_official | 277:0dffe5d9e928 | 512 | |
mbed_official | 277:0dffe5d9e928 | 513 | /**@brief Event data for authentication key request event. */ |
mbed_official | 277:0dffe5d9e928 | 514 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 515 | { |
mbed_official | 277:0dffe5d9e928 | 516 | uint8_t key_type; /**< See @ref BLE_GAP_AUTH_KEY_TYPES. */ |
mbed_official | 277:0dffe5d9e928 | 517 | } ble_gap_evt_auth_key_request_t; |
mbed_official | 277:0dffe5d9e928 | 518 | |
mbed_official | 277:0dffe5d9e928 | 519 | |
mbed_official | 277:0dffe5d9e928 | 520 | /**@brief Security levels supported. |
mbed_official | 277:0dffe5d9e928 | 521 | * @note See Bluetooth Specification Version 4.1 Volume 3, Part C, Chapter 10. |
mbed_official | 277:0dffe5d9e928 | 522 | */ |
mbed_official | 277:0dffe5d9e928 | 523 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 524 | { |
mbed_official | 277:0dffe5d9e928 | 525 | uint8_t lv1 : 1; /**< If 1: Level 1 is supported. */ |
mbed_official | 277:0dffe5d9e928 | 526 | uint8_t lv2 : 1; /**< If 1: Level 2 is supported. */ |
mbed_official | 277:0dffe5d9e928 | 527 | uint8_t lv3 : 1; /**< If 1: Level 3 is supported. */ |
mbed_official | 277:0dffe5d9e928 | 528 | } ble_gap_sec_levels_t; |
mbed_official | 277:0dffe5d9e928 | 529 | |
mbed_official | 277:0dffe5d9e928 | 530 | |
mbed_official | 277:0dffe5d9e928 | 531 | /**@brief Keys that have been exchanged. */ |
mbed_official | 277:0dffe5d9e928 | 532 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 533 | { |
mbed_official | 277:0dffe5d9e928 | 534 | uint8_t ltk : 1; /**< Long Term Key. */ |
mbed_official | 277:0dffe5d9e928 | 535 | uint8_t ediv_rand : 1; /**< Encrypted Diversifier and Random value. */ |
mbed_official | 277:0dffe5d9e928 | 536 | uint8_t irk : 1; /**< Identity Resolving Key. */ |
mbed_official | 277:0dffe5d9e928 | 537 | uint8_t address : 1; /**< Public or static random address. */ |
mbed_official | 277:0dffe5d9e928 | 538 | uint8_t csrk : 1; /**< Connection Signature Resolving Key. */ |
mbed_official | 277:0dffe5d9e928 | 539 | } ble_gap_sec_keys_t; |
mbed_official | 277:0dffe5d9e928 | 540 | |
mbed_official | 277:0dffe5d9e928 | 541 | |
mbed_official | 277:0dffe5d9e928 | 542 | /**@brief Event data for authentication status event. */ |
mbed_official | 277:0dffe5d9e928 | 543 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 544 | { |
mbed_official | 277:0dffe5d9e928 | 545 | uint8_t auth_status; /**< Authentication status, see @ref BLE_GAP_SEC_STATUS. */ |
mbed_official | 277:0dffe5d9e928 | 546 | uint8_t error_src; /**< On error, source that caused the failure, see @ref BLE_GAP_SEC_STATUS_SOURCES. */ |
mbed_official | 277:0dffe5d9e928 | 547 | ble_gap_sec_levels_t sm1_levels; /**< Levels supported in Security Mode 1. */ |
mbed_official | 277:0dffe5d9e928 | 548 | ble_gap_sec_levels_t sm2_levels; /**< Levels supported in Security Mode 2. */ |
mbed_official | 277:0dffe5d9e928 | 549 | ble_gap_sec_keys_t periph_kex; /**< Bitmap stating which keys were exchanged (distributed) by the peripheral. */ |
mbed_official | 277:0dffe5d9e928 | 550 | ble_gap_sec_keys_t central_kex; /**< Bitmap stating which keys were exchanged (distributed) by the central. */ |
mbed_official | 277:0dffe5d9e928 | 551 | struct periph_keys_t |
mbed_official | 277:0dffe5d9e928 | 552 | { |
mbed_official | 277:0dffe5d9e928 | 553 | ble_gap_enc_info_t enc_info; /**< Peripheral's Encryption information. */ |
mbed_official | 277:0dffe5d9e928 | 554 | } periph_keys; /**< Actual keys distributed from the Peripheral to the Central. */ |
mbed_official | 277:0dffe5d9e928 | 555 | struct central_keys_t |
mbed_official | 277:0dffe5d9e928 | 556 | { |
mbed_official | 277:0dffe5d9e928 | 557 | ble_gap_irk_t irk; /**< Central's IRK. */ |
mbed_official | 277:0dffe5d9e928 | 558 | ble_gap_addr_t id_info; /**< Central's Identity Info. */ |
mbed_official | 277:0dffe5d9e928 | 559 | } central_keys; /**< Actual keys distributed from the Central to the Peripheral. */ |
mbed_official | 277:0dffe5d9e928 | 560 | } ble_gap_evt_auth_status_t; |
mbed_official | 277:0dffe5d9e928 | 561 | |
mbed_official | 277:0dffe5d9e928 | 562 | |
mbed_official | 277:0dffe5d9e928 | 563 | /**@brief Event data for connection security update event. */ |
mbed_official | 277:0dffe5d9e928 | 564 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 565 | { |
mbed_official | 277:0dffe5d9e928 | 566 | ble_gap_conn_sec_t conn_sec; /**< Connection security level. */ |
mbed_official | 277:0dffe5d9e928 | 567 | } ble_gap_evt_conn_sec_update_t; |
mbed_official | 277:0dffe5d9e928 | 568 | |
mbed_official | 277:0dffe5d9e928 | 569 | |
mbed_official | 277:0dffe5d9e928 | 570 | /**@brief Event data for timeout event. */ |
mbed_official | 277:0dffe5d9e928 | 571 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 572 | { |
mbed_official | 277:0dffe5d9e928 | 573 | uint8_t src; /**< Source of timeout event, see @ref BLE_GAP_TIMEOUT_SOURCES. */ |
mbed_official | 277:0dffe5d9e928 | 574 | } ble_gap_evt_timeout_t; |
mbed_official | 277:0dffe5d9e928 | 575 | |
mbed_official | 277:0dffe5d9e928 | 576 | |
mbed_official | 277:0dffe5d9e928 | 577 | /**@brief Event data for advertisement report event. */ |
mbed_official | 277:0dffe5d9e928 | 578 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 579 | { |
mbed_official | 277:0dffe5d9e928 | 580 | int8_t rssi; /**< Received Signal Strength Indication in dBm. */ |
mbed_official | 277:0dffe5d9e928 | 581 | } ble_gap_evt_rssi_changed_t; |
mbed_official | 277:0dffe5d9e928 | 582 | |
mbed_official | 277:0dffe5d9e928 | 583 | |
mbed_official | 277:0dffe5d9e928 | 584 | /**@brief GAP event callback event structure. */ |
mbed_official | 277:0dffe5d9e928 | 585 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 586 | { |
mbed_official | 277:0dffe5d9e928 | 587 | uint16_t conn_handle; /**< Connection Handle on which event occured. */ |
mbed_official | 277:0dffe5d9e928 | 588 | union /**< union alternative identified by evt_id in enclosing struct. */ |
mbed_official | 277:0dffe5d9e928 | 589 | { |
mbed_official | 277:0dffe5d9e928 | 590 | ble_gap_evt_connected_t connected; /**< Connected Event Parameters. */ |
mbed_official | 277:0dffe5d9e928 | 591 | ble_gap_evt_disconnected_t disconnected; /**< Disconnected Event Parameters. */ |
mbed_official | 277:0dffe5d9e928 | 592 | ble_gap_evt_conn_param_update_t conn_param_update; /**< Connection Parameter Update Parameters. */ |
mbed_official | 277:0dffe5d9e928 | 593 | ble_gap_evt_sec_params_request_t sec_params_request; /**< Security Parameters Request Event Parameters. */ |
mbed_official | 277:0dffe5d9e928 | 594 | ble_gap_evt_sec_info_request_t sec_info_request; /**< Security Information Request Event Parameters. */ |
mbed_official | 277:0dffe5d9e928 | 595 | ble_gap_evt_passkey_display_t passkey_display; /**< Passkey Display Event Parameters. */ |
mbed_official | 277:0dffe5d9e928 | 596 | ble_gap_evt_auth_key_request_t auth_key_request; /**< Authentication Key Request Event Parameters. */ |
mbed_official | 277:0dffe5d9e928 | 597 | ble_gap_evt_auth_status_t auth_status; /**< Authentication Status Event Parameters. */ |
mbed_official | 277:0dffe5d9e928 | 598 | ble_gap_evt_conn_sec_update_t conn_sec_update; /**< Connection Security Update Event Parameters. */ |
mbed_official | 277:0dffe5d9e928 | 599 | ble_gap_evt_timeout_t timeout; /**< Timeout Event Parameters. */ |
mbed_official | 277:0dffe5d9e928 | 600 | ble_gap_evt_rssi_changed_t rssi_changed; /**< RSSI Event parameters. */ |
mbed_official | 277:0dffe5d9e928 | 601 | } params; |
mbed_official | 277:0dffe5d9e928 | 602 | |
mbed_official | 277:0dffe5d9e928 | 603 | } ble_gap_evt_t; |
mbed_official | 277:0dffe5d9e928 | 604 | |
mbed_official | 277:0dffe5d9e928 | 605 | |
mbed_official | 277:0dffe5d9e928 | 606 | /**@brief Local connection latency option. |
mbed_official | 277:0dffe5d9e928 | 607 | * |
mbed_official | 277:0dffe5d9e928 | 608 | * Local connection latency is a feature which enables the slave to improve |
mbed_official | 277:0dffe5d9e928 | 609 | * current consumption by ignoring the slave latency set by the peer. The |
mbed_official | 277:0dffe5d9e928 | 610 | * local connection latency can only be set to a multiple of the slave latency, |
mbed_official | 277:0dffe5d9e928 | 611 | * and cannot be longer than half of the supervision timeout. |
mbed_official | 277:0dffe5d9e928 | 612 | * |
mbed_official | 277:0dffe5d9e928 | 613 | * Used with @ref sd_ble_opt_set to set the local connection latency. The |
mbed_official | 277:0dffe5d9e928 | 614 | * @ref sd_ble_opt_get is not supported for this option, but the actual |
mbed_official | 277:0dffe5d9e928 | 615 | * local connection latency (unless set to NULL) is set as a return parameter |
mbed_official | 277:0dffe5d9e928 | 616 | * when setting the option. |
mbed_official | 277:0dffe5d9e928 | 617 | * |
mbed_official | 277:0dffe5d9e928 | 618 | * @note The latency set will be truncated down to the closest slave latency event |
mbed_official | 277:0dffe5d9e928 | 619 | * multiple, or the nearest multiple before half of the supervision timeout. |
mbed_official | 277:0dffe5d9e928 | 620 | * |
mbed_official | 277:0dffe5d9e928 | 621 | * @note The local connection latency is default off, and needs to be set for new |
mbed_official | 277:0dffe5d9e928 | 622 | * connections and whenever the connection is updated. |
mbed_official | 277:0dffe5d9e928 | 623 | * |
mbed_official | 277:0dffe5d9e928 | 624 | * @retval ::NRF_SUCCESS Set successfully. |
mbed_official | 277:0dffe5d9e928 | 625 | * @retval ::NRF_ERROR_NOT_SUPPORTED Get is not supported. |
mbed_official | 277:0dffe5d9e928 | 626 | * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter. |
mbed_official | 277:0dffe5d9e928 | 627 | */ |
mbed_official | 277:0dffe5d9e928 | 628 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 629 | { |
mbed_official | 277:0dffe5d9e928 | 630 | uint16_t conn_handle; /**< Connection Handle */ |
mbed_official | 277:0dffe5d9e928 | 631 | uint16_t requested_latency; /**< Requested local connection latency. */ |
mbed_official | 277:0dffe5d9e928 | 632 | uint16_t * p_actual_latency; /**< Pointer to storage for the actual local connection latency (can be set to NULL to skip return value). */ |
mbed_official | 277:0dffe5d9e928 | 633 | } ble_gap_opt_local_conn_latency_t; |
mbed_official | 277:0dffe5d9e928 | 634 | |
mbed_official | 277:0dffe5d9e928 | 635 | |
mbed_official | 277:0dffe5d9e928 | 636 | /**@brief Passkey Option. |
mbed_official | 277:0dffe5d9e928 | 637 | * |
mbed_official | 277:0dffe5d9e928 | 638 | * Structure containing the passkey to be used during pairing. This can be used with @ref |
mbed_official | 277:0dffe5d9e928 | 639 | * sd_ble_opt_set to make the SoftDevice use a pre-programmed passkey for authentication |
mbed_official | 277:0dffe5d9e928 | 640 | * instead of generating a random one. |
mbed_official | 277:0dffe5d9e928 | 641 | * |
mbed_official | 277:0dffe5d9e928 | 642 | * @note @ref sd_ble_opt_get is not supported for this option. |
mbed_official | 277:0dffe5d9e928 | 643 | * |
mbed_official | 277:0dffe5d9e928 | 644 | */ |
mbed_official | 277:0dffe5d9e928 | 645 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 646 | { |
mbed_official | 277:0dffe5d9e928 | 647 | 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.*/ |
mbed_official | 277:0dffe5d9e928 | 648 | } ble_gap_opt_passkey_t; |
mbed_official | 277:0dffe5d9e928 | 649 | |
mbed_official | 277:0dffe5d9e928 | 650 | |
mbed_official | 277:0dffe5d9e928 | 651 | /**@brief Custom Privacy Options. |
mbed_official | 277:0dffe5d9e928 | 652 | * |
mbed_official | 277:0dffe5d9e928 | 653 | * @note The specified address cycle interval is used when the address cycle mode is |
mbed_official | 277:0dffe5d9e928 | 654 | * @ref BLE_GAP_ADDR_CYCLE_MODE_AUTO. If 0 is given, the address will not be refreshed at any |
mbed_official | 277:0dffe5d9e928 | 655 | * interval, and not at start of advertising. A new address can be generated manually by calling |
mbed_official | 277:0dffe5d9e928 | 656 | * @ref sd_ble_gap_address_set with the same type again. The default interval is |
mbed_official | 277:0dffe5d9e928 | 657 | * @ref BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S. |
mbed_official | 277:0dffe5d9e928 | 658 | * |
mbed_official | 277:0dffe5d9e928 | 659 | * @note If cycle mode is @ref BLE_GAP_ADDR_CYCLE_MODE_AUTO, the address will immediately be |
mbed_official | 277:0dffe5d9e928 | 660 | * refreshed when this option is set. |
mbed_official | 277:0dffe5d9e928 | 661 | */ |
mbed_official | 277:0dffe5d9e928 | 662 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 663 | { |
mbed_official | 277:0dffe5d9e928 | 664 | 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. */ |
mbed_official | 277:0dffe5d9e928 | 665 | uint16_t interval_s; /**< When input: Custom private address cycle interval in seconds. When output: The current private address cycle interval. */ |
mbed_official | 277:0dffe5d9e928 | 666 | } ble_gap_opt_privacy_t; |
mbed_official | 277:0dffe5d9e928 | 667 | |
mbed_official | 277:0dffe5d9e928 | 668 | |
mbed_official | 277:0dffe5d9e928 | 669 | /**@brief Option structure for GAP options. */ |
mbed_official | 277:0dffe5d9e928 | 670 | typedef union |
mbed_official | 277:0dffe5d9e928 | 671 | { |
mbed_official | 277:0dffe5d9e928 | 672 | ble_gap_opt_local_conn_latency_t local_conn_latency; /**< Local connection latency. */ |
mbed_official | 277:0dffe5d9e928 | 673 | ble_gap_opt_passkey_t passkey; /**< Passkey to be used for pairing.*/ |
mbed_official | 277:0dffe5d9e928 | 674 | ble_gap_opt_privacy_t privacy; /**< Custom privacy options. */ |
mbed_official | 277:0dffe5d9e928 | 675 | } ble_gap_opt_t; |
mbed_official | 277:0dffe5d9e928 | 676 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 677 | |
mbed_official | 277:0dffe5d9e928 | 678 | |
mbed_official | 277:0dffe5d9e928 | 679 | /**@addtogroup BLE_GAP_FUNCTIONS Functions |
mbed_official | 277:0dffe5d9e928 | 680 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 681 | |
mbed_official | 277:0dffe5d9e928 | 682 | /**@brief Set local Bluetooth address. |
mbed_official | 277:0dffe5d9e928 | 683 | * |
mbed_official | 277:0dffe5d9e928 | 684 | * If the address cycle mode is @ref BLE_GAP_ADDR_CYCLE_MODE_AUTO, the address type is required to |
mbed_official | 277:0dffe5d9e928 | 685 | * be @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE or |
mbed_official | 277:0dffe5d9e928 | 686 | * @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE. The given address is ignored and the |
mbed_official | 277:0dffe5d9e928 | 687 | * SoftDevice will generate a new private address automatically every time advertising is |
mbed_official | 277:0dffe5d9e928 | 688 | * (re)started, and every @ref BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S seconds. If this API |
mbed_official | 277:0dffe5d9e928 | 689 | * call is used again with the same parameters while advertising, the SoftDevice will immediately |
mbed_official | 277:0dffe5d9e928 | 690 | * generate a new private address to replace the current address. |
mbed_official | 277:0dffe5d9e928 | 691 | * |
mbed_official | 277:0dffe5d9e928 | 692 | * If the application wishes to use a @ref BLE_GAP_ADDR_TYPE_PUBLIC or |
mbed_official | 277:0dffe5d9e928 | 693 | * @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC address, the cycle mode must be |
mbed_official | 277:0dffe5d9e928 | 694 | * @ref BLE_GAP_ADDR_CYCLE_MODE_NONE. |
mbed_official | 277:0dffe5d9e928 | 695 | * |
mbed_official | 277:0dffe5d9e928 | 696 | * If this API function is called while advertising, the softdevice will immediately update the |
mbed_official | 277:0dffe5d9e928 | 697 | * advertising address without the need to stop advertising in the following cases: |
mbed_official | 277:0dffe5d9e928 | 698 | * - If the previously set address is of type @ref BLE_GAP_ADDR_TYPE_PUBLIC and the new address |
mbed_official | 277:0dffe5d9e928 | 699 | * is also of type @ref BLE_GAP_ADDR_TYPE_PUBLIC |
mbed_official | 277:0dffe5d9e928 | 700 | * - If the previously set address is not @ref BLE_GAP_ADDR_TYPE_PUBLIC and the new address is |
mbed_official | 277:0dffe5d9e928 | 701 | * also not @ref BLE_GAP_ADDR_TYPE_PUBLIC. |
mbed_official | 277:0dffe5d9e928 | 702 | * |
mbed_official | 277:0dffe5d9e928 | 703 | * If the address is changed from a @ref BLE_GAP_ADDR_TYPE_PUBLIC address to another type or from |
mbed_official | 277:0dffe5d9e928 | 704 | * another type to a @ref BLE_GAP_ADDR_TYPE_PUBLIC address, the change will take effect the next |
mbed_official | 277:0dffe5d9e928 | 705 | * time advertising is started. |
mbed_official | 277:0dffe5d9e928 | 706 | * |
mbed_official | 277:0dffe5d9e928 | 707 | * @note If the address cycle mode is @ref BLE_GAP_ADDR_CYCLE_MODE_NONE and the application is |
mbed_official | 277:0dffe5d9e928 | 708 | * using privacy, the application must take care to generate and set new private addresses |
mbed_official | 277:0dffe5d9e928 | 709 | * periodically to comply with the Privacy specification in Bluetooth Core Spec. |
mbed_official | 277:0dffe5d9e928 | 710 | * |
mbed_official | 277:0dffe5d9e928 | 711 | * @param[in] addr_cycle_mode Address cycle mode, see @ref BLE_GAP_ADDR_CYCLE_MODES. |
mbed_official | 277:0dffe5d9e928 | 712 | * @param[in] p_addr Pointer to address structure. |
mbed_official | 277:0dffe5d9e928 | 713 | * |
mbed_official | 277:0dffe5d9e928 | 714 | * @return @ref NRF_SUCCESS Address successfully set. |
mbed_official | 277:0dffe5d9e928 | 715 | * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
mbed_official | 277:0dffe5d9e928 | 716 | * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameters. |
mbed_official | 277:0dffe5d9e928 | 717 | * @return @ref BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address. |
mbed_official | 277:0dffe5d9e928 | 718 | * @return @ref NRF_ERROR_BUSY The stack is busy, process pending events and retry. |
mbed_official | 277:0dffe5d9e928 | 719 | */ |
mbed_official | 277:0dffe5d9e928 | 720 | SVCALL(SD_BLE_GAP_ADDRESS_SET, uint32_t, sd_ble_gap_address_set(uint8_t addr_cycle_mode, ble_gap_addr_t const * const p_addr)); |
mbed_official | 277:0dffe5d9e928 | 721 | |
mbed_official | 277:0dffe5d9e928 | 722 | |
mbed_official | 277:0dffe5d9e928 | 723 | /**@brief Get local Bluetooth address. |
mbed_official | 277:0dffe5d9e928 | 724 | * |
mbed_official | 277:0dffe5d9e928 | 725 | * @param[out] p_addr Pointer to address structure. |
mbed_official | 277:0dffe5d9e928 | 726 | * |
mbed_official | 277:0dffe5d9e928 | 727 | * @return @ref NRF_SUCCESS Address successfully retrieved. |
mbed_official | 277:0dffe5d9e928 | 728 | * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
mbed_official | 277:0dffe5d9e928 | 729 | */ |
mbed_official | 277:0dffe5d9e928 | 730 | SVCALL(SD_BLE_GAP_ADDRESS_GET, uint32_t, sd_ble_gap_address_get(ble_gap_addr_t * const p_addr)); |
mbed_official | 277:0dffe5d9e928 | 731 | |
mbed_official | 277:0dffe5d9e928 | 732 | |
mbed_official | 277:0dffe5d9e928 | 733 | /**@brief Set, clear or update advertisement and scan response data. |
mbed_official | 277:0dffe5d9e928 | 734 | * |
mbed_official | 277:0dffe5d9e928 | 735 | * @note The format of the advertisement data will be checked by this call to ensure interoperability. |
mbed_official | 277:0dffe5d9e928 | 736 | * Limitations imposed by this API call to the data provided include having a flags data type in the scan response data and |
mbed_official | 277:0dffe5d9e928 | 737 | * duplicating the local name in the advertisement data and scan response data. |
mbed_official | 277:0dffe5d9e928 | 738 | * |
mbed_official | 277:0dffe5d9e928 | 739 | * @note: To clear the advertisement data and set it to a 0-length packet, simply provide a valid pointer (p_data/p_sr_data) with its corresponding |
mbed_official | 277:0dffe5d9e928 | 740 | * length (dlen/srdlen) set to 0. |
mbed_official | 277:0dffe5d9e928 | 741 | * |
mbed_official | 277:0dffe5d9e928 | 742 | * @note: The call will fail if p_data and p_sr_data are both NULL since this would have no effect. |
mbed_official | 277:0dffe5d9e928 | 743 | * |
mbed_official | 277:0dffe5d9e928 | 744 | * @param[in] p_data Raw data to be placed in advertisement packet. If NULL, no changes are made to the current advertisement packet data. |
mbed_official | 277:0dffe5d9e928 | 745 | * @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. |
mbed_official | 277:0dffe5d9e928 | 746 | * @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. |
mbed_official | 277:0dffe5d9e928 | 747 | * @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. |
mbed_official | 277:0dffe5d9e928 | 748 | * |
mbed_official | 277:0dffe5d9e928 | 749 | * @return @ref NRF_SUCCESS Advertisement data successfully updated or cleared. |
mbed_official | 277:0dffe5d9e928 | 750 | * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
mbed_official | 277:0dffe5d9e928 | 751 | * @return @ref NRF_ERROR_INVALID_FLAGS Invalid combination of advertising flags supplied. |
mbed_official | 277:0dffe5d9e928 | 752 | * @return @ref NRF_ERROR_INVALID_DATA Invalid data type(s) supplied, check the advertising data format specification. |
mbed_official | 277:0dffe5d9e928 | 753 | * @return @ref NRF_ERROR_INVALID_LENGTH Invalid data length(s) supplied. |
mbed_official | 277:0dffe5d9e928 | 754 | * @return @ref BLE_ERROR_GAP_UUID_LIST_MISMATCH Invalid UUID list supplied. |
mbed_official | 277:0dffe5d9e928 | 755 | * @return @ref NRF_ERROR_BUSY The stack is busy, process pending events and retry. |
mbed_official | 277:0dffe5d9e928 | 756 | */ |
mbed_official | 277:0dffe5d9e928 | 757 | SVCALL(SD_BLE_GAP_ADV_DATA_SET, uint32_t, sd_ble_gap_adv_data_set(uint8_t const * const p_data, uint8_t dlen, uint8_t const * const p_sr_data, uint8_t srdlen)); |
mbed_official | 277:0dffe5d9e928 | 758 | |
mbed_official | 277:0dffe5d9e928 | 759 | |
mbed_official | 277:0dffe5d9e928 | 760 | /**@brief Start advertising (GAP Discoverable, Connectable modes, Broadcast Procedure). |
mbed_official | 277:0dffe5d9e928 | 761 | * |
mbed_official | 277:0dffe5d9e928 | 762 | * @param[in] p_adv_params Pointer to advertising parameters structure. |
mbed_official | 277:0dffe5d9e928 | 763 | * |
mbed_official | 277:0dffe5d9e928 | 764 | * @return @ref NRF_SUCCESS The BLE stack has started advertising. |
mbed_official | 277:0dffe5d9e928 | 765 | * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
mbed_official | 277:0dffe5d9e928 | 766 | * @return @ref NRF_ERROR_INVALID_STATE Invalid state to perform operation. |
mbed_official | 277:0dffe5d9e928 | 767 | * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check the accepted ranges and limits. |
mbed_official | 277:0dffe5d9e928 | 768 | * @return @ref BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid Bluetooth address supplied. |
mbed_official | 277:0dffe5d9e928 | 769 | * @return @ref BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST Discoverable mode and whitelist incompatible. |
mbed_official | 277:0dffe5d9e928 | 770 | */ |
mbed_official | 277:0dffe5d9e928 | 771 | SVCALL(SD_BLE_GAP_ADV_START, uint32_t, sd_ble_gap_adv_start(ble_gap_adv_params_t const * const p_adv_params)); |
mbed_official | 277:0dffe5d9e928 | 772 | |
mbed_official | 277:0dffe5d9e928 | 773 | |
mbed_official | 277:0dffe5d9e928 | 774 | /**@brief Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure). |
mbed_official | 277:0dffe5d9e928 | 775 | * |
mbed_official | 277:0dffe5d9e928 | 776 | * @return @ref NRF_SUCCESS The BLE stack has stopped advertising. |
mbed_official | 277:0dffe5d9e928 | 777 | * @return @ref NRF_ERROR_INVALID_STATE Invalid state to perform operation (most probably not in advertising state). |
mbed_official | 277:0dffe5d9e928 | 778 | */ |
mbed_official | 277:0dffe5d9e928 | 779 | SVCALL(SD_BLE_GAP_ADV_STOP, uint32_t, sd_ble_gap_adv_stop(void)); |
mbed_official | 277:0dffe5d9e928 | 780 | |
mbed_official | 277:0dffe5d9e928 | 781 | |
mbed_official | 277:0dffe5d9e928 | 782 | /**@brief Update connection parameters. |
mbed_official | 277:0dffe5d9e928 | 783 | * |
mbed_official | 277:0dffe5d9e928 | 784 | * @details In the central role this will initiate a Link Layer connection parameter update procedure, |
mbed_official | 277:0dffe5d9e928 | 785 | * otherwise in the peripheral role, this will send the corresponding L2CAP request and wait for |
mbed_official | 277:0dffe5d9e928 | 786 | * the central to perform the procedure. In both cases, and regardless of success or failure, the application |
mbed_official | 277:0dffe5d9e928 | 787 | * will be informed of the result with a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE event. |
mbed_official | 277:0dffe5d9e928 | 788 | * |
mbed_official | 277:0dffe5d9e928 | 789 | * @note If both a connection supervision timeout and a maximum connection interval are specified, then the following constraint |
mbed_official | 277:0dffe5d9e928 | 790 | * applies: (conn_sup_timeout * 8) >= (max_conn_interval * (slave_latency + 1)) |
mbed_official | 277:0dffe5d9e928 | 791 | * |
mbed_official | 277:0dffe5d9e928 | 792 | * @param[in] conn_handle Connection handle. |
mbed_official | 277:0dffe5d9e928 | 793 | * @param[in] p_conn_params Pointer to desired connection parameters. If NULL is provided on a peripheral role, |
mbed_official | 277:0dffe5d9e928 | 794 | * the parameters in the PPCP characteristic of the GAP service will be used instead. |
mbed_official | 277:0dffe5d9e928 | 795 | * |
mbed_official | 277:0dffe5d9e928 | 796 | * @return @ref NRF_SUCCESS The Connection Update procedure has been started successfully. |
mbed_official | 277:0dffe5d9e928 | 797 | * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
mbed_official | 277:0dffe5d9e928 | 798 | * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints. |
mbed_official | 277:0dffe5d9e928 | 799 | * @return @ref NRF_ERROR_BUSY Procedure already in progress or not allowed at this time, process pending events and retry. |
mbed_official | 277:0dffe5d9e928 | 800 | * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. |
mbed_official | 277:0dffe5d9e928 | 801 | * @return @ref NRF_ERROR_NO_MEM Not enough memory to complete operation. |
mbed_official | 277:0dffe5d9e928 | 802 | */ |
mbed_official | 277:0dffe5d9e928 | 803 | 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 * const p_conn_params)); |
mbed_official | 277:0dffe5d9e928 | 804 | |
mbed_official | 277:0dffe5d9e928 | 805 | |
mbed_official | 277:0dffe5d9e928 | 806 | /**@brief Disconnect (GAP Link Termination). |
mbed_official | 277:0dffe5d9e928 | 807 | * |
mbed_official | 277:0dffe5d9e928 | 808 | * @details This call initiates the disconnection procedure, and its completion will be communicated to the application |
mbed_official | 277:0dffe5d9e928 | 809 | * with a BLE_GAP_EVT_DISCONNECTED event. |
mbed_official | 277:0dffe5d9e928 | 810 | * |
mbed_official | 277:0dffe5d9e928 | 811 | * @param[in] conn_handle Connection handle. |
mbed_official | 277:0dffe5d9e928 | 812 | * @param[in] hci_status_code HCI status code, see @ref BLE_HCI_STATUS_CODES (accepted values are BTLE_REMOTE_USER_TERMINATED_CONNECTION and BTLE_CONN_INTERVAL_UNACCEPTABLE). |
mbed_official | 277:0dffe5d9e928 | 813 | * |
mbed_official | 277:0dffe5d9e928 | 814 | * @return @ref NRF_SUCCESS The disconnection procedure has been started successfully. |
mbed_official | 277:0dffe5d9e928 | 815 | * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. |
mbed_official | 277:0dffe5d9e928 | 816 | * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. |
mbed_official | 277:0dffe5d9e928 | 817 | * @return @ref NRF_ERROR_INVALID_STATE Invalid state to perform operation (disconnection is already in progress or not connected at all). |
mbed_official | 277:0dffe5d9e928 | 818 | */ |
mbed_official | 277:0dffe5d9e928 | 819 | SVCALL(SD_BLE_GAP_DISCONNECT, uint32_t, sd_ble_gap_disconnect(uint16_t conn_handle, uint8_t hci_status_code)); |
mbed_official | 277:0dffe5d9e928 | 820 | |
mbed_official | 277:0dffe5d9e928 | 821 | |
mbed_official | 277:0dffe5d9e928 | 822 | /**@brief Set the radio's transmit power. |
mbed_official | 277:0dffe5d9e928 | 823 | * |
mbed_official | 277:0dffe5d9e928 | 824 | * @param[in] tx_power Radio transmit power in dBm (accepted values are -40, -30, -20, -16, -12, -8, -4, 0, and 4 dBm). |
mbed_official | 277:0dffe5d9e928 | 825 | * |
mbed_official | 277:0dffe5d9e928 | 826 | * @note -40 dBm will not actually give -40 dBm, but will instead be remapped to -30 dBm. |
mbed_official | 277:0dffe5d9e928 | 827 | * |
mbed_official | 277:0dffe5d9e928 | 828 | * @return @ref NRF_SUCCESS Successfully changed the transmit power. |
mbed_official | 277:0dffe5d9e928 | 829 | * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. |
mbed_official | 277:0dffe5d9e928 | 830 | * @return @ref NRF_ERROR_BUSY The stack is busy, process pending events and retry. |
mbed_official | 277:0dffe5d9e928 | 831 | */ |
mbed_official | 277:0dffe5d9e928 | 832 | SVCALL(SD_BLE_GAP_TX_POWER_SET, uint32_t, sd_ble_gap_tx_power_set(int8_t tx_power)); |
mbed_official | 277:0dffe5d9e928 | 833 | |
mbed_official | 277:0dffe5d9e928 | 834 | |
mbed_official | 277:0dffe5d9e928 | 835 | /**@brief Set GAP Appearance value. |
mbed_official | 277:0dffe5d9e928 | 836 | * |
mbed_official | 277:0dffe5d9e928 | 837 | * @param[in] appearance Appearance (16-bit), see @ref BLE_APPEARANCES. |
mbed_official | 277:0dffe5d9e928 | 838 | * |
mbed_official | 277:0dffe5d9e928 | 839 | * @return @ref NRF_SUCCESS Appearance value set successfully. |
mbed_official | 277:0dffe5d9e928 | 840 | * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. |
mbed_official | 277:0dffe5d9e928 | 841 | */ |
mbed_official | 277:0dffe5d9e928 | 842 | SVCALL(SD_BLE_GAP_APPEARANCE_SET, uint32_t, sd_ble_gap_appearance_set(uint16_t appearance)); |
mbed_official | 277:0dffe5d9e928 | 843 | |
mbed_official | 277:0dffe5d9e928 | 844 | |
mbed_official | 277:0dffe5d9e928 | 845 | /**@brief Get GAP Appearance value. |
mbed_official | 277:0dffe5d9e928 | 846 | * |
mbed_official | 277:0dffe5d9e928 | 847 | * @param[out] p_appearance Appearance (16-bit), see @ref BLE_APPEARANCES. |
mbed_official | 277:0dffe5d9e928 | 848 | * |
mbed_official | 277:0dffe5d9e928 | 849 | * @return @ref NRF_SUCCESS Appearance value retrieved successfully. |
mbed_official | 277:0dffe5d9e928 | 850 | * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
mbed_official | 277:0dffe5d9e928 | 851 | */ |
mbed_official | 277:0dffe5d9e928 | 852 | SVCALL(SD_BLE_GAP_APPEARANCE_GET, uint32_t, sd_ble_gap_appearance_get(uint16_t * const p_appearance)); |
mbed_official | 277:0dffe5d9e928 | 853 | |
mbed_official | 277:0dffe5d9e928 | 854 | |
mbed_official | 277:0dffe5d9e928 | 855 | /**@brief Set GAP Peripheral Preferred Connection Parameters. |
mbed_official | 277:0dffe5d9e928 | 856 | * |
mbed_official | 277:0dffe5d9e928 | 857 | * @param[in] p_conn_params Pointer to a @ref ble_gap_conn_params_t structure with the desired parameters. |
mbed_official | 277:0dffe5d9e928 | 858 | * |
mbed_official | 277:0dffe5d9e928 | 859 | * @return @ref NRF_SUCCESS Peripheral Preferred Connection Parameters set successfully. |
mbed_official | 277:0dffe5d9e928 | 860 | * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
mbed_official | 277:0dffe5d9e928 | 861 | * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. |
mbed_official | 277:0dffe5d9e928 | 862 | */ |
mbed_official | 277:0dffe5d9e928 | 863 | SVCALL(SD_BLE_GAP_PPCP_SET, uint32_t, sd_ble_gap_ppcp_set(ble_gap_conn_params_t const * const p_conn_params)); |
mbed_official | 277:0dffe5d9e928 | 864 | |
mbed_official | 277:0dffe5d9e928 | 865 | |
mbed_official | 277:0dffe5d9e928 | 866 | /**@brief Get GAP Peripheral Preferred Connection Parameters. |
mbed_official | 277:0dffe5d9e928 | 867 | * |
mbed_official | 277:0dffe5d9e928 | 868 | * @param[out] p_conn_params Pointer to a @ref ble_gap_conn_params_t structure where the parameters will be stored. |
mbed_official | 277:0dffe5d9e928 | 869 | * |
mbed_official | 277:0dffe5d9e928 | 870 | * @return @ref NRF_SUCCESS Peripheral Preferred Connection Parameters retrieved successfully. |
mbed_official | 277:0dffe5d9e928 | 871 | * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
mbed_official | 277:0dffe5d9e928 | 872 | */ |
mbed_official | 277:0dffe5d9e928 | 873 | SVCALL(SD_BLE_GAP_PPCP_GET, uint32_t, sd_ble_gap_ppcp_get(ble_gap_conn_params_t * const p_conn_params)); |
mbed_official | 277:0dffe5d9e928 | 874 | |
mbed_official | 277:0dffe5d9e928 | 875 | |
mbed_official | 277:0dffe5d9e928 | 876 | /**@brief Set GAP device name. |
mbed_official | 277:0dffe5d9e928 | 877 | * |
mbed_official | 277:0dffe5d9e928 | 878 | * @param[in] p_write_perm Write permissions for the Device Name characteristic see @ref ble_gap_conn_sec_mode_t. |
mbed_official | 277:0dffe5d9e928 | 879 | * @param[in] p_dev_name Pointer to a UTF-8 encoded, <b>non NULL-terminated</b> string. |
mbed_official | 277:0dffe5d9e928 | 880 | * @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). |
mbed_official | 277:0dffe5d9e928 | 881 | * |
mbed_official | 277:0dffe5d9e928 | 882 | * @return @ref NRF_SUCCESS GAP device name and permissions set successfully. |
mbed_official | 277:0dffe5d9e928 | 883 | * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
mbed_official | 277:0dffe5d9e928 | 884 | * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. |
mbed_official | 277:0dffe5d9e928 | 885 | * @return @ref NRF_ERROR_DATA_SIZE Invalid data size(s) supplied. |
mbed_official | 277:0dffe5d9e928 | 886 | */ |
mbed_official | 277:0dffe5d9e928 | 887 | SVCALL(SD_BLE_GAP_DEVICE_NAME_SET, uint32_t, sd_ble_gap_device_name_set(ble_gap_conn_sec_mode_t const * const p_write_perm, uint8_t const * const p_dev_name, uint16_t len)); |
mbed_official | 277:0dffe5d9e928 | 888 | |
mbed_official | 277:0dffe5d9e928 | 889 | |
mbed_official | 277:0dffe5d9e928 | 890 | /**@brief Get GAP device name. |
mbed_official | 277:0dffe5d9e928 | 891 | * |
mbed_official | 277:0dffe5d9e928 | 892 | * @param[in] 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. |
mbed_official | 277:0dffe5d9e928 | 893 | * @param[in,out] p_len Length of the buffer pointed by p_dev_name, complete device name length on output. |
mbed_official | 277:0dffe5d9e928 | 894 | * |
mbed_official | 277:0dffe5d9e928 | 895 | * @note If the device name is longer than the size of the supplied buffer, |
mbed_official | 277:0dffe5d9e928 | 896 | * p_len will return the complete device name length, |
mbed_official | 277:0dffe5d9e928 | 897 | * and not the number of bytes actually returned in p_dev_name. |
mbed_official | 277:0dffe5d9e928 | 898 | * The application may use this information to allocate a suitable buffer size. |
mbed_official | 277:0dffe5d9e928 | 899 | * |
mbed_official | 277:0dffe5d9e928 | 900 | * @return @ref NRF_SUCCESS GAP device name retrieved successfully. |
mbed_official | 277:0dffe5d9e928 | 901 | * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
mbed_official | 277:0dffe5d9e928 | 902 | * @return @ref NRF_ERROR_DATA_SIZE Invalid data size(s) supplied. |
mbed_official | 277:0dffe5d9e928 | 903 | */ |
mbed_official | 277:0dffe5d9e928 | 904 | SVCALL(SD_BLE_GAP_DEVICE_NAME_GET, uint32_t, sd_ble_gap_device_name_get(uint8_t * const p_dev_name, uint16_t * const p_len)); |
mbed_official | 277:0dffe5d9e928 | 905 | |
mbed_official | 277:0dffe5d9e928 | 906 | |
mbed_official | 277:0dffe5d9e928 | 907 | /**@brief Initiate GAP Authentication procedure. |
mbed_official | 277:0dffe5d9e928 | 908 | * |
mbed_official | 277:0dffe5d9e928 | 909 | * @param[in] conn_handle Connection handle. |
mbed_official | 277:0dffe5d9e928 | 910 | * @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 procedure. |
mbed_official | 277:0dffe5d9e928 | 911 | * |
mbed_official | 277:0dffe5d9e928 | 912 | * @details In the central role, this function will send an SMP Pairing Request, otherwise in the peripheral role, an SMP Security Request will be sent. |
mbed_official | 277:0dffe5d9e928 | 913 | * In the peripheral role, only the timeout, bond and mitm fields of @ref ble_gap_sec_params_t are used. |
mbed_official | 277:0dffe5d9e928 | 914 | * |
mbed_official | 277:0dffe5d9e928 | 915 | * @note The GAP Authentication procedure may be triggered by the central without calling this function when accessing a secure service. |
mbed_official | 277:0dffe5d9e928 | 916 | * @note Calling this function may result in the following events depending on the outcome and parameters: @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST, |
mbed_official | 277:0dffe5d9e928 | 917 | * @ref BLE_GAP_EVT_SEC_INFO_REQUEST, @ref BLE_GAP_EVT_AUTH_KEY_REQUEST, @ref BLE_GAP_EVT_AUTH_STATUS. |
mbed_official | 277:0dffe5d9e928 | 918 | * @note The timeout parameter in @ref ble_gap_sec_params_t is interpreted here as the Security Request timeout |
mbed_official | 277:0dffe5d9e928 | 919 | * |
mbed_official | 277:0dffe5d9e928 | 920 | * |
mbed_official | 277:0dffe5d9e928 | 921 | * @return @ref NRF_SUCCESS Successfully initiated authentication procedure. |
mbed_official | 277:0dffe5d9e928 | 922 | * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
mbed_official | 277:0dffe5d9e928 | 923 | * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. |
mbed_official | 277:0dffe5d9e928 | 924 | * @return @ref NRF_ERROR_INVALID_STATE Invalid state to perform operation. |
mbed_official | 277:0dffe5d9e928 | 925 | * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. |
mbed_official | 277:0dffe5d9e928 | 926 | */ |
mbed_official | 277:0dffe5d9e928 | 927 | SVCALL(SD_BLE_GAP_AUTHENTICATE, uint32_t, sd_ble_gap_authenticate(uint16_t conn_handle, ble_gap_sec_params_t const * const p_sec_params)); |
mbed_official | 277:0dffe5d9e928 | 928 | |
mbed_official | 277:0dffe5d9e928 | 929 | |
mbed_official | 277:0dffe5d9e928 | 930 | /**@brief Reply with GAP security parameters. |
mbed_official | 277:0dffe5d9e928 | 931 | * |
mbed_official | 277:0dffe5d9e928 | 932 | * @param[in] conn_handle Connection handle. |
mbed_official | 277:0dffe5d9e928 | 933 | * @param[in] sec_status Security status, see @ref BLE_GAP_SEC_STATUS. |
mbed_official | 277:0dffe5d9e928 | 934 | * @param[in] p_sec_params Pointer to a @ref ble_gap_sec_params_t security parameters structure. |
mbed_official | 277:0dffe5d9e928 | 935 | * |
mbed_official | 277:0dffe5d9e928 | 936 | * @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 NRF_ERROR_INVALID_STATE. |
mbed_official | 277:0dffe5d9e928 | 937 | * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters. |
mbed_official | 277:0dffe5d9e928 | 938 | * @note The timeout parameter in @ref ble_gap_sec_params_t is interpreted here as the SMP procedure timeout, and must be 30 seconds. The function will fail |
mbed_official | 277:0dffe5d9e928 | 939 | * if the application supplies a different value. |
mbed_official | 277:0dffe5d9e928 | 940 | * |
mbed_official | 277:0dffe5d9e928 | 941 | * @return @ref NRF_SUCCESS Successfully accepted security parameter from the application. |
mbed_official | 277:0dffe5d9e928 | 942 | * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
mbed_official | 277:0dffe5d9e928 | 943 | * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. |
mbed_official | 277:0dffe5d9e928 | 944 | * @return @ref NRF_ERROR_INVALID_STATE Invalid state to perform operation. |
mbed_official | 277:0dffe5d9e928 | 945 | * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. |
mbed_official | 277:0dffe5d9e928 | 946 | */ |
mbed_official | 277:0dffe5d9e928 | 947 | 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 * const p_sec_params)); |
mbed_official | 277:0dffe5d9e928 | 948 | |
mbed_official | 277:0dffe5d9e928 | 949 | |
mbed_official | 277:0dffe5d9e928 | 950 | /**@brief Reply with an authentication key. |
mbed_official | 277:0dffe5d9e928 | 951 | * |
mbed_official | 277:0dffe5d9e928 | 952 | * @param[in] conn_handle Connection handle. |
mbed_official | 277:0dffe5d9e928 | 953 | * @param[in] key_type See @ref BLE_GAP_AUTH_KEY_TYPES. |
mbed_official | 277:0dffe5d9e928 | 954 | * @param[in] key If key type is BLE_GAP_AUTH_KEY_TYPE_NONE, then NULL. |
mbed_official | 277:0dffe5d9e928 | 955 | * If key type is BLE_GAP_AUTH_KEY_TYPE_PASSKEY, then a 6-byte ASCII string (digit 0..9 only, no NULL termination). |
mbed_official | 277:0dffe5d9e928 | 956 | * If key type is BLE_GAP_AUTH_KEY_TYPE_OOB, then a 16-byte OOB key value in Little Endian format. |
mbed_official | 277:0dffe5d9e928 | 957 | * |
mbed_official | 277:0dffe5d9e928 | 958 | * @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 NRF_ERROR_INVALID_STATE. |
mbed_official | 277:0dffe5d9e928 | 959 | * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters. |
mbed_official | 277:0dffe5d9e928 | 960 | * |
mbed_official | 277:0dffe5d9e928 | 961 | * @return @ref NRF_SUCCESS Authentication key successfully set. |
mbed_official | 277:0dffe5d9e928 | 962 | * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
mbed_official | 277:0dffe5d9e928 | 963 | * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. |
mbed_official | 277:0dffe5d9e928 | 964 | * @return @ref NRF_ERROR_INVALID_STATE Invalid state to perform operation. |
mbed_official | 277:0dffe5d9e928 | 965 | * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. |
mbed_official | 277:0dffe5d9e928 | 966 | */ |
mbed_official | 277:0dffe5d9e928 | 967 | 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 * const key)); |
mbed_official | 277:0dffe5d9e928 | 968 | |
mbed_official | 277:0dffe5d9e928 | 969 | |
mbed_official | 277:0dffe5d9e928 | 970 | /**@brief Reply with GAP security information. |
mbed_official | 277:0dffe5d9e928 | 971 | * |
mbed_official | 277:0dffe5d9e928 | 972 | * @param[in] conn_handle Connection handle. |
mbed_official | 277:0dffe5d9e928 | 973 | * @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. |
mbed_official | 277:0dffe5d9e928 | 974 | * @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. |
mbed_official | 277:0dffe5d9e928 | 975 | * |
mbed_official | 277:0dffe5d9e928 | 976 | * @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 NRF_ERROR_INVALID_STATE. |
mbed_official | 277:0dffe5d9e928 | 977 | * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters. |
mbed_official | 277:0dffe5d9e928 | 978 | * @note Data signing is not implemented yet. p_sign_info must therefore be NULL. |
mbed_official | 277:0dffe5d9e928 | 979 | * |
mbed_official | 277:0dffe5d9e928 | 980 | * @return @ref NRF_SUCCESS Successfully accepted security information. |
mbed_official | 277:0dffe5d9e928 | 981 | * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. |
mbed_official | 277:0dffe5d9e928 | 982 | * @return @ref NRF_ERROR_INVALID_STATE Invalid state to perform operation. |
mbed_official | 277:0dffe5d9e928 | 983 | * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. |
mbed_official | 277:0dffe5d9e928 | 984 | * @return @ref NRF_ERROR_BUSY The stack is busy, process pending events and retry. |
mbed_official | 277:0dffe5d9e928 | 985 | */ |
mbed_official | 277:0dffe5d9e928 | 986 | 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 * const p_enc_info, ble_gap_sign_info_t const * const p_sign_info)); |
mbed_official | 277:0dffe5d9e928 | 987 | |
mbed_official | 277:0dffe5d9e928 | 988 | |
mbed_official | 277:0dffe5d9e928 | 989 | /**@brief Get the current connection security. |
mbed_official | 277:0dffe5d9e928 | 990 | * |
mbed_official | 277:0dffe5d9e928 | 991 | * @param[in] conn_handle Connection handle. |
mbed_official | 277:0dffe5d9e928 | 992 | * @param[out] p_conn_sec Pointer to a @ref ble_gap_conn_sec_t structure to be filled in. |
mbed_official | 277:0dffe5d9e928 | 993 | * |
mbed_official | 277:0dffe5d9e928 | 994 | * @return @ref NRF_SUCCESS Current connection security successfully retrieved. |
mbed_official | 277:0dffe5d9e928 | 995 | * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
mbed_official | 277:0dffe5d9e928 | 996 | * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. |
mbed_official | 277:0dffe5d9e928 | 997 | */ |
mbed_official | 277:0dffe5d9e928 | 998 | SVCALL(SD_BLE_GAP_CONN_SEC_GET, uint32_t, sd_ble_gap_conn_sec_get(uint16_t conn_handle, ble_gap_conn_sec_t * const p_conn_sec)); |
mbed_official | 277:0dffe5d9e928 | 999 | |
mbed_official | 277:0dffe5d9e928 | 1000 | |
mbed_official | 277:0dffe5d9e928 | 1001 | /**@brief Start reporting the received signal strength to the application. |
mbed_official | 277:0dffe5d9e928 | 1002 | * |
mbed_official | 277:0dffe5d9e928 | 1003 | * A new event is reported whenever the RSSI value changes, until @ref sd_ble_gap_rssi_stop is called. |
mbed_official | 277:0dffe5d9e928 | 1004 | * |
mbed_official | 277:0dffe5d9e928 | 1005 | * @param[in] conn_handle Connection handle. |
mbed_official | 277:0dffe5d9e928 | 1006 | * |
mbed_official | 277:0dffe5d9e928 | 1007 | * @return @ref NRF_SUCCESS Successfully activated RSSI reporting. |
mbed_official | 277:0dffe5d9e928 | 1008 | * @return @ref NRF_ERROR_INVALID_STATE Invalid state to perform operation. |
mbed_official | 277:0dffe5d9e928 | 1009 | * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. |
mbed_official | 277:0dffe5d9e928 | 1010 | */ |
mbed_official | 277:0dffe5d9e928 | 1011 | SVCALL(SD_BLE_GAP_RSSI_START, uint32_t, sd_ble_gap_rssi_start(uint16_t conn_handle)); |
mbed_official | 277:0dffe5d9e928 | 1012 | |
mbed_official | 277:0dffe5d9e928 | 1013 | |
mbed_official | 277:0dffe5d9e928 | 1014 | /**@brief Stop reporting the received singnal strength. |
mbed_official | 277:0dffe5d9e928 | 1015 | * |
mbed_official | 277:0dffe5d9e928 | 1016 | * An RSSI change detected before the call but not yet received by the application |
mbed_official | 277:0dffe5d9e928 | 1017 | * may be reported after @ref sd_ble_gap_rssi_stop has been called. |
mbed_official | 277:0dffe5d9e928 | 1018 | * |
mbed_official | 277:0dffe5d9e928 | 1019 | * @param[in] conn_handle Connection handle. |
mbed_official | 277:0dffe5d9e928 | 1020 | * |
mbed_official | 277:0dffe5d9e928 | 1021 | * @return @ref NRF_SUCCESS Successfully deactivated RSSI reporting. |
mbed_official | 277:0dffe5d9e928 | 1022 | * @return @ref NRF_ERROR_INVALID_STATE Invalid state to perform operation. |
mbed_official | 277:0dffe5d9e928 | 1023 | * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. |
mbed_official | 277:0dffe5d9e928 | 1024 | */ |
mbed_official | 277:0dffe5d9e928 | 1025 | SVCALL(SD_BLE_GAP_RSSI_STOP, uint32_t, sd_ble_gap_rssi_stop(uint16_t conn_handle)); |
mbed_official | 277:0dffe5d9e928 | 1026 | /**@} */ |
mbed_official | 277:0dffe5d9e928 | 1027 | |
mbed_official | 277:0dffe5d9e928 | 1028 | #endif // BLE_GAP_H__ |
mbed_official | 277:0dffe5d9e928 | 1029 | |
mbed_official | 277:0dffe5d9e928 | 1030 | /** |
mbed_official | 277:0dffe5d9e928 | 1031 | @} |
mbed_official | 277:0dffe5d9e928 | 1032 | */ |