BLE_API wrapper library for STMicroelectronics' BlueNRG Bluetooth Low Energy expansion board shield

Fork of X_NUCLEO_IDB0XA1 by ST Expansion SW Team

Committer:
Wolfgang Betz
Date:
Wed Oct 07 08:39:04 2015 +0200
Revision:
132:51056160fa4a
Child:
208:48776140c30d
Andrea's version as of mail from 10/06/2015 05:56 PM

From: Andrea PALMIERI <andrea.palmieri@st.com>
To: Wolfgang BETZ <wolfgang.betz@st.com>, Rohit Grover <rohit.grover@arm.com>,
Antonio VILEI <antonio.vilei@st.com>, Mihail Stoyanov
<Mihail.Stoyanov@arm.com>
CC: Nicola CAPOVILLA <nicola.capovilla@st.com>, Silvio Lucio OLIVA
<silvio.oliva@st.com>, "jonathan.austin@arm.com" <jonathan.austin@arm.com>
Content-Class: urn:content-classes:message
Date: Tue, 6 Oct 2015 17:56:34 +0200
Subject: RE: Arduino Compatibility of X-NUCLEO-IDB04A1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Wolfgang Betz 132:51056160fa4a 1 /******************** (C) COPYRIGHT 2014 STMicroelectronics ********************
Wolfgang Betz 132:51056160fa4a 2 * File Name : bluenrg_gap_aci.h
Wolfgang Betz 132:51056160fa4a 3 * Author : AMS - AAS
Wolfgang Betz 132:51056160fa4a 4 * Version : V1.0.0
Wolfgang Betz 132:51056160fa4a 5 * Date : 26-Jun-2014
Wolfgang Betz 132:51056160fa4a 6 * Description : Header file with GAP commands for BlueNRG FW6.3.
Wolfgang Betz 132:51056160fa4a 7 ********************************************************************************
Wolfgang Betz 132:51056160fa4a 8 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
Wolfgang Betz 132:51056160fa4a 9 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
Wolfgang Betz 132:51056160fa4a 10 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
Wolfgang Betz 132:51056160fa4a 11 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
Wolfgang Betz 132:51056160fa4a 12 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
Wolfgang Betz 132:51056160fa4a 13 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
Wolfgang Betz 132:51056160fa4a 14 *******************************************************************************/
Wolfgang Betz 132:51056160fa4a 15
Wolfgang Betz 132:51056160fa4a 16 #ifndef __BLUENRG_GAP_ACI_H__
Wolfgang Betz 132:51056160fa4a 17 #define __BLUENRG_GAP_ACI_H__
Wolfgang Betz 132:51056160fa4a 18
Wolfgang Betz 132:51056160fa4a 19 /**
Wolfgang Betz 132:51056160fa4a 20 *@addtogroup GAP GAP
Wolfgang Betz 132:51056160fa4a 21 *@brief GAP layer.
Wolfgang Betz 132:51056160fa4a 22 *@{
Wolfgang Betz 132:51056160fa4a 23 */
Wolfgang Betz 132:51056160fa4a 24
Wolfgang Betz 132:51056160fa4a 25 /**
Wolfgang Betz 132:51056160fa4a 26 *@defgroup GAP_Functions GAP functions
Wolfgang Betz 132:51056160fa4a 27 *@brief API for GAP layer.
Wolfgang Betz 132:51056160fa4a 28 *@{
Wolfgang Betz 132:51056160fa4a 29 */
Wolfgang Betz 132:51056160fa4a 30
Wolfgang Betz 132:51056160fa4a 31 /**
Wolfgang Betz 132:51056160fa4a 32 * @brief Initialize the GAP layer.
Wolfgang Betz 132:51056160fa4a 33 * @note Register the GAP service with the GATT.
Wolfgang Betz 132:51056160fa4a 34 * All the standard GAP characteristics will also be added:
Wolfgang Betz 132:51056160fa4a 35 * @li Device Name
Wolfgang Betz 132:51056160fa4a 36 * @li Appearance
Wolfgang Betz 132:51056160fa4a 37 * @li Peripheral Preferred Connection Parameters (peripheral role only)
Wolfgang Betz 132:51056160fa4a 38 * @code
Wolfgang Betz 132:51056160fa4a 39
Wolfgang Betz 132:51056160fa4a 40 tBleStatus ret;
Wolfgang Betz 132:51056160fa4a 41 uint16_t service_handle, dev_name_char_handle, appearance_char_handle;
Wolfgang Betz 132:51056160fa4a 42
Wolfgang Betz 132:51056160fa4a 43 ret = aci_gap_init_IDB05A1(1, 0, 0x07, &service_handle, &dev_name_char_handle, &appearance_char_handle);
Wolfgang Betz 132:51056160fa4a 44 if(ret){
Wolfgang Betz 132:51056160fa4a 45 PRINTF("GAP_Init failed.\n");
Wolfgang Betz 132:51056160fa4a 46 reboot();
Wolfgang Betz 132:51056160fa4a 47 }
Wolfgang Betz 132:51056160fa4a 48 const char *name = "BlueNRG";
Wolfgang Betz 132:51056160fa4a 49 ret = aci_gatt_update_char_value(service_handle, dev_name_char_handle, 0, strlen(name), (uint8_t *)name);
Wolfgang Betz 132:51056160fa4a 50 if(ret){
Wolfgang Betz 132:51056160fa4a 51 PRINTF("aci_gatt_update_char_value failed.\n");
Wolfgang Betz 132:51056160fa4a 52 }
Wolfgang Betz 132:51056160fa4a 53 * @endcode
Wolfgang Betz 132:51056160fa4a 54 * @param role Bitmap of allowed roles: see @ref gap_roles "GAP roles".
Wolfgang Betz 132:51056160fa4a 55 * @param privacy_enabled Enable (1) or disable (0) privacy.
Wolfgang Betz 132:51056160fa4a 56 * @param device_name_char_len Length of the device name characteristic
Wolfgang Betz 132:51056160fa4a 57 * @param[out] service_handle Handle of the GAP service.
Wolfgang Betz 132:51056160fa4a 58 * @param[out] dev_name_char_handle Device Name Characteristic handle
Wolfgang Betz 132:51056160fa4a 59 * @param[out] appearance_char_handle Appearance Characteristic handle
Wolfgang Betz 132:51056160fa4a 60 * @retval tBleStatus Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 61 */
Wolfgang Betz 132:51056160fa4a 62 tBleStatus aci_gap_init_IDB05A1(uint8_t role, uint8_t privacy_enabled,
Wolfgang Betz 132:51056160fa4a 63 uint8_t device_name_char_len,
Wolfgang Betz 132:51056160fa4a 64 uint16_t* service_handle,
Wolfgang Betz 132:51056160fa4a 65 uint16_t* dev_name_char_handle,
Wolfgang Betz 132:51056160fa4a 66 uint16_t* appearance_char_handle);
Wolfgang Betz 132:51056160fa4a 67 /**
Wolfgang Betz 132:51056160fa4a 68 * @brief Initialize the GAP layer.
Wolfgang Betz 132:51056160fa4a 69 * @note Register the GAP service with the GATT.
Wolfgang Betz 132:51056160fa4a 70 * All the standard GAP characteristics will also be added:
Wolfgang Betz 132:51056160fa4a 71 * @li Device Name
Wolfgang Betz 132:51056160fa4a 72 * @li Appearance
Wolfgang Betz 132:51056160fa4a 73 * @li Peripheral Privacy Flag (peripheral role only)
Wolfgang Betz 132:51056160fa4a 74 * @li Reconnection Address (peripheral role only)
Wolfgang Betz 132:51056160fa4a 75 * @li Peripheral Preferred Connection Parameters (peripheral role only)
Wolfgang Betz 132:51056160fa4a 76 * @code
Wolfgang Betz 132:51056160fa4a 77
Wolfgang Betz 132:51056160fa4a 78 tBleStatus ret;
Wolfgang Betz 132:51056160fa4a 79 uint16_t service_handle, dev_name_char_handle, appearance_char_handle;
Wolfgang Betz 132:51056160fa4a 80
Wolfgang Betz 132:51056160fa4a 81 ret = aci_gap_init_IDB04A1(1, &service_handle, &dev_name_char_handle, &appearance_char_handle);
Wolfgang Betz 132:51056160fa4a 82 if(ret){
Wolfgang Betz 132:51056160fa4a 83 PRINTF("GAP_Init failed.\n");
Wolfgang Betz 132:51056160fa4a 84 reboot();
Wolfgang Betz 132:51056160fa4a 85 }
Wolfgang Betz 132:51056160fa4a 86 const char *name = "BlueNRG";
Wolfgang Betz 132:51056160fa4a 87 ret = aci_gatt_update_char_value(service_handle, dev_name_char_handle, 0, strlen(name), (uint8_t *)name);
Wolfgang Betz 132:51056160fa4a 88 if(ret){
Wolfgang Betz 132:51056160fa4a 89 PRINTF("aci_gatt_update_char_value failed.\n");
Wolfgang Betz 132:51056160fa4a 90 }
Wolfgang Betz 132:51056160fa4a 91 * @endcode
Wolfgang Betz 132:51056160fa4a 92 * @param role One of the allowed roles: @ref GAP_PERIPHERAL_ROLE or @ref GAP_CENTRAL_ROLE. See @ref gap_roles "GAP roles".
Wolfgang Betz 132:51056160fa4a 93 * @param[out] service_handle Handle of the GAP service.
Wolfgang Betz 132:51056160fa4a 94 * @param[out] dev_name_char_handle Device Name Characteristic handle
Wolfgang Betz 132:51056160fa4a 95 * @param[out] appearance_char_handle Appearance Characteristic handle
Wolfgang Betz 132:51056160fa4a 96 * @retval tBleStatus Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 97 */
Wolfgang Betz 132:51056160fa4a 98 tBleStatus aci_gap_init_IDB04A1(uint8_t role,
Wolfgang Betz 132:51056160fa4a 99 uint16_t* service_handle,
Wolfgang Betz 132:51056160fa4a 100 uint16_t* dev_name_char_handle,
Wolfgang Betz 132:51056160fa4a 101 uint16_t* appearance_char_handle);
Wolfgang Betz 132:51056160fa4a 102
Wolfgang Betz 132:51056160fa4a 103 /**
Wolfgang Betz 132:51056160fa4a 104 * @brief Set the Device in non-discoverable mode.
Wolfgang Betz 132:51056160fa4a 105 * @note This command will disable the LL advertising.
Wolfgang Betz 132:51056160fa4a 106 * @retval tBleStatus Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 107 */
Wolfgang Betz 132:51056160fa4a 108 tBleStatus aci_gap_set_non_discoverable(void);
Wolfgang Betz 132:51056160fa4a 109
Wolfgang Betz 132:51056160fa4a 110 /**
Wolfgang Betz 132:51056160fa4a 111 * @brief Put the device in limited discoverable mode
Wolfgang Betz 132:51056160fa4a 112 * (as defined in GAP specification volume 3, section 9.2.3).
Wolfgang Betz 132:51056160fa4a 113 * @note The device will be discoverable for TGAP (lim_adv_timeout) = 180 seconds.
Wolfgang Betz 132:51056160fa4a 114 * The advertising can be disabled at any time by issuing
Wolfgang Betz 132:51056160fa4a 115 * aci_gap_set_non_discoverable() command.
Wolfgang Betz 132:51056160fa4a 116 * The AdvIntervMin and AdvIntervMax parameters are optional. If both
Wolfgang Betz 132:51056160fa4a 117 * are set to 0, the GAP will use default values (250 ms and 500 ms respectively).
Wolfgang Betz 132:51056160fa4a 118 * Host can set the Local Name, a Service UUID list and the Slave Connection
Wolfgang Betz 132:51056160fa4a 119 * Minimum and Maximum. If provided, these data will be inserted into the
Wolfgang Betz 132:51056160fa4a 120 * advertising packet payload as AD data. These parameters are optional
Wolfgang Betz 132:51056160fa4a 121 * in this command. These values can be also set using aci_gap_update_adv_data()
Wolfgang Betz 132:51056160fa4a 122 * separately.
Wolfgang Betz 132:51056160fa4a 123 * The total size of data in advertising packet cannot exceed 31 bytes.
Wolfgang Betz 132:51056160fa4a 124 * With this command, the BLE Stack will also add automatically the following
Wolfgang Betz 132:51056160fa4a 125 * standard AD types:
Wolfgang Betz 132:51056160fa4a 126 * @li AD Flags
Wolfgang Betz 132:51056160fa4a 127 * @li TX Power Level
Wolfgang Betz 132:51056160fa4a 128 *
Wolfgang Betz 132:51056160fa4a 129 * When advertising timeout happens (i.e. limited discovery period has elapsed), controller generates
Wolfgang Betz 132:51056160fa4a 130 * @ref EVT_BLUE_GAP_LIMITED_DISCOVERABLE event.
Wolfgang Betz 132:51056160fa4a 131 *
Wolfgang Betz 132:51056160fa4a 132 * Example:
Wolfgang Betz 132:51056160fa4a 133 * @code
Wolfgang Betz 132:51056160fa4a 134 *
Wolfgang Betz 132:51056160fa4a 135 * #define ADV_INTERVAL_MIN_MS 100
Wolfgang Betz 132:51056160fa4a 136 * #define ADV_INTERVAL_MAX_MS 200
Wolfgang Betz 132:51056160fa4a 137 *
Wolfgang Betz 132:51056160fa4a 138 * tBleStatus ret;
Wolfgang Betz 132:51056160fa4a 139 *
Wolfgang Betz 132:51056160fa4a 140 * const char local_name[] = {AD_TYPE_COMPLETE_LOCAL_NAME,'B','l','u','e','N','R','G'};
Wolfgang Betz 132:51056160fa4a 141 * const uint8_t serviceUUIDList[] = {AD_TYPE_16_BIT_SERV_UUID,0x34,0x12};
Wolfgang Betz 132:51056160fa4a 142 *
Wolfgang Betz 132:51056160fa4a 143 * ret = aci_gap_set_limited_discoverable(ADV_IND, (ADV_INTERVAL_MIN_MS*1000)/0.625,
Wolfgang Betz 132:51056160fa4a 144 * (ADV_INTERVAL_MAX_MS*1000)/0.625,
Wolfgang Betz 132:51056160fa4a 145 * STATIC_RANDOM_ADDR, NO_WHITE_LIST_USE,
Wolfgang Betz 132:51056160fa4a 146 * sizeof(local_name), local_name,
Wolfgang Betz 132:51056160fa4a 147 * sizeof(serviceUUIDList), serviceUUIDList,
Wolfgang Betz 132:51056160fa4a 148 * 0, 0);
Wolfgang Betz 132:51056160fa4a 149 * @endcode
Wolfgang Betz 132:51056160fa4a 150 *
Wolfgang Betz 132:51056160fa4a 151 * @param AdvType One of the advertising types:
Wolfgang Betz 132:51056160fa4a 152 * @arg @ref ADV_IND Connectable undirected advertising
Wolfgang Betz 132:51056160fa4a 153 * @arg @ref ADV_SCAN_IND Scannable undirected advertising
Wolfgang Betz 132:51056160fa4a 154 * @arg @ref ADV_NONCONN_IND Non connectable undirected advertising
Wolfgang Betz 132:51056160fa4a 155 * @param AdvIntervMin Minimum advertising interval.
Wolfgang Betz 132:51056160fa4a 156 * Range: 0x0020 to 0x4000
Wolfgang Betz 132:51056160fa4a 157 * Default: 250 ms
Wolfgang Betz 132:51056160fa4a 158 * Time = N * 0.625 msec
Wolfgang Betz 132:51056160fa4a 159 * Time Range: 20 ms to 10.24 sec (minimum 100 ms for ADV_SCAN_IND or ADV_NONCONN_IND).
Wolfgang Betz 132:51056160fa4a 160 * @param AdvIntervMax Maximum advertising interval.
Wolfgang Betz 132:51056160fa4a 161 * Range: 0x0020 to 0x4000
Wolfgang Betz 132:51056160fa4a 162 * Default: 500 ms
Wolfgang Betz 132:51056160fa4a 163 * Time = N * 0.625 msec
Wolfgang Betz 132:51056160fa4a 164 * Time Range: 20 ms to 10.24 sec (minimum 100 ms for ADV_SCAN_IND or ADV_NONCONN_IND).
Wolfgang Betz 132:51056160fa4a 165 * @param OwnAddrType Type of our address used during advertising
Wolfgang Betz 132:51056160fa4a 166 * (@ref PUBLIC_ADDR,@ref STATIC_RANDOM_ADDR).
Wolfgang Betz 132:51056160fa4a 167 * @param AdvFilterPolicy Filter policy:
Wolfgang Betz 132:51056160fa4a 168 * @arg NO_WHITE_LIST_USE
Wolfgang Betz 132:51056160fa4a 169 * @arg WHITE_LIST_FOR_ONLY_SCAN
Wolfgang Betz 132:51056160fa4a 170 * @arg WHITE_LIST_FOR_ONLY_CONN
Wolfgang Betz 132:51056160fa4a 171 * @arg WHITE_LIST_FOR_ALL
Wolfgang Betz 132:51056160fa4a 172 * @param LocalNameLen Length of LocalName array.
Wolfgang Betz 132:51056160fa4a 173 * @param LocalName Array containing the Local Name AD data. First byte is the AD type:
Wolfgang Betz 132:51056160fa4a 174 * @ref AD_TYPE_SHORTENED_LOCAL_NAME or @ref AD_TYPE_COMPLETE_LOCAL_NAME.
Wolfgang Betz 132:51056160fa4a 175 * @param ServiceUUIDLen Length of ServiceUUIDList array.
Wolfgang Betz 132:51056160fa4a 176 * @param ServiceUUIDList This is the list of the UUIDs AD Types as defined in Volume 3,
Wolfgang Betz 132:51056160fa4a 177 * Section 11.1.1 of GAP Specification. First byte is the AD Type.
Wolfgang Betz 132:51056160fa4a 178 * @arg @ref AD_TYPE_16_BIT_SERV_UUID
Wolfgang Betz 132:51056160fa4a 179 * @arg @ref AD_TYPE_16_BIT_SERV_UUID_CMPLT_LIST
Wolfgang Betz 132:51056160fa4a 180 * @arg @ref AD_TYPE_128_BIT_SERV_UUID
Wolfgang Betz 132:51056160fa4a 181 * @arg @ref AD_TYPE_128_BIT_SERV_UUID_CMPLT_LIST
Wolfgang Betz 132:51056160fa4a 182 * @param SlaveConnIntervMin Slave connection interval minimum value suggested by Peripheral.
Wolfgang Betz 132:51056160fa4a 183 * If SlaveConnIntervMin and SlaveConnIntervMax are not 0x0000,
Wolfgang Betz 132:51056160fa4a 184 * Slave Connection Interval Range AD structure will be added in advertising
Wolfgang Betz 132:51056160fa4a 185 * data.
Wolfgang Betz 132:51056160fa4a 186 * Connection interval is defined in the following manner:
Wolfgang Betz 132:51056160fa4a 187 * connIntervalmin = Slave_Conn_Interval_Min x 1.25ms
Wolfgang Betz 132:51056160fa4a 188 * Slave_Conn_Interval_Min range: 0x0006 to 0x0C80
Wolfgang Betz 132:51056160fa4a 189 * Value of 0xFFFF indicates no specific minimum.
Wolfgang Betz 132:51056160fa4a 190 * @param SlaveConnIntervMax Slave connection interval maximum value suggested by Peripheral.
Wolfgang Betz 132:51056160fa4a 191 * If SlaveConnIntervMin and SlaveConnIntervMax are not 0x0000,
Wolfgang Betz 132:51056160fa4a 192 * Slave Connection Interval Range AD structure will be added in advertising
Wolfgang Betz 132:51056160fa4a 193 * data.
Wolfgang Betz 132:51056160fa4a 194 * ConnIntervalmax = Slave_Conn_Interval_Max x 1.25ms
Wolfgang Betz 132:51056160fa4a 195 * Slave_Conn_Interval_Max range: 0x0006 to 0x0C80
Wolfgang Betz 132:51056160fa4a 196 * Slave_ Conn_Interval_Max shall be equal to or greater than the Slave_Conn_Interval_Min.
Wolfgang Betz 132:51056160fa4a 197 * Value of 0xFFFF indicates no specific maximum.
Wolfgang Betz 132:51056160fa4a 198 *
Wolfgang Betz 132:51056160fa4a 199 * @retval tBleStatus Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 200 */
Wolfgang Betz 132:51056160fa4a 201 tBleStatus aci_gap_set_limited_discoverable(uint8_t AdvType, uint16_t AdvIntervMin, uint16_t AdvIntervMax,
Wolfgang Betz 132:51056160fa4a 202 uint8_t OwnAddrType, uint8_t AdvFilterPolicy, uint8_t LocalNameLen,
Wolfgang Betz 132:51056160fa4a 203 const char *LocalName, uint8_t ServiceUUIDLen, uint8_t* ServiceUUIDList,
Wolfgang Betz 132:51056160fa4a 204 uint16_t SlaveConnIntervMin, uint16_t SlaveConnIntervMax);
Wolfgang Betz 132:51056160fa4a 205 /**
Wolfgang Betz 132:51056160fa4a 206 * @brief Put the Device in general discoverable mode (as defined in GAP specification volume 3, section 9.2.4).
Wolfgang Betz 132:51056160fa4a 207 * @note The device will be discoverable until the Host issue Bluehci_Gap_Set_Non_Discoverable command.
Wolfgang Betz 132:51056160fa4a 208 * The Adv_Interval_Min and Adv_Interval_Max parameters are optional. If both are set to 0, the GAP uses
Wolfgang Betz 132:51056160fa4a 209 * the default values for advertising intervals (1.28 s and 2.56 s respectively).
Wolfgang Betz 132:51056160fa4a 210 * Host can set the Local Name, a Service UUID list and the Slave Connection Interval Range. If provided,
Wolfgang Betz 132:51056160fa4a 211 * these data will be inserted into the advertising packet payload as AD data. These parameters are optional
Wolfgang Betz 132:51056160fa4a 212 * in this command. These values can be also set using aci_gap_update_adv_data() separately.
Wolfgang Betz 132:51056160fa4a 213 * The total size of data in advertising packet cannot exceed 31 bytes.
Wolfgang Betz 132:51056160fa4a 214 * With this command, the BLE Stack will also add automatically the following standard AD types:
Wolfgang Betz 132:51056160fa4a 215 * @li AD Flags
Wolfgang Betz 132:51056160fa4a 216 * @li TX Power Level
Wolfgang Betz 132:51056160fa4a 217 *
Wolfgang Betz 132:51056160fa4a 218 * Usage example:
Wolfgang Betz 132:51056160fa4a 219 *
Wolfgang Betz 132:51056160fa4a 220 * @code
Wolfgang Betz 132:51056160fa4a 221 *
Wolfgang Betz 132:51056160fa4a 222 * #define ADV_INTERVAL_MIN_MS 800
Wolfgang Betz 132:51056160fa4a 223 * #define ADV_INTERVAL_MAX_MS 900
Wolfgang Betz 132:51056160fa4a 224 * #define CONN_INTERVAL_MIN_MS 100
Wolfgang Betz 132:51056160fa4a 225 * #define CONN_INTERVAL_MAX_MS 300
Wolfgang Betz 132:51056160fa4a 226 *
Wolfgang Betz 132:51056160fa4a 227 * tBleStatus ret;
Wolfgang Betz 132:51056160fa4a 228 *
Wolfgang Betz 132:51056160fa4a 229 * const char local_name[] = {AD_TYPE_COMPLETE_LOCAL_NAME,'B','l','u','e','N','R','G'};
Wolfgang Betz 132:51056160fa4a 230 * const uint8_t serviceUUIDList[] = {AD_TYPE_16_BIT_SERV_UUID,0x34,0x12};
Wolfgang Betz 132:51056160fa4a 231 *
Wolfgang Betz 132:51056160fa4a 232 * ret = aci_gap_set_discoverable(ADV_IND, (ADV_INTERVAL_MIN_MS*1000)/0.625,
Wolfgang Betz 132:51056160fa4a 233 * (ADV_INTERVAL_MAX_MS*1000)/0.625,
Wolfgang Betz 132:51056160fa4a 234 * STATIC_RANDOM_ADDR, NO_WHITE_LIST_USE,
Wolfgang Betz 132:51056160fa4a 235 * sizeof(local_name), local_name,
Wolfgang Betz 132:51056160fa4a 236 * 0, NULL,
Wolfgang Betz 132:51056160fa4a 237 * (CONN_INTERVAL_MIN_MS*1000)/1250,
Wolfgang Betz 132:51056160fa4a 238 * (CONN_INTERVAL_MAX_MS*1000)/1250);
Wolfgang Betz 132:51056160fa4a 239 * @endcode
Wolfgang Betz 132:51056160fa4a 240 *
Wolfgang Betz 132:51056160fa4a 241 * @param AdvType One of the advertising types:
Wolfgang Betz 132:51056160fa4a 242 * @arg @ref ADV_IND Connectable undirected advertising
Wolfgang Betz 132:51056160fa4a 243 * @arg @ref ADV_SCAN_IND Scannable undirected advertising
Wolfgang Betz 132:51056160fa4a 244 * @arg @ref ADV_NONCONN_IND Non connectable undirected advertising
Wolfgang Betz 132:51056160fa4a 245 * @param AdvIntervMin Minimum advertising interval.
Wolfgang Betz 132:51056160fa4a 246 * Range: 0x0020 to 0x4000
Wolfgang Betz 132:51056160fa4a 247 * Default: 1.28 s
Wolfgang Betz 132:51056160fa4a 248 * Time = N * 0.625 msec
Wolfgang Betz 132:51056160fa4a 249 * Time Range: 20 ms to 10.24 sec (minimum 100 ms for ADV_SCAN_IND or ADV_NONCONN_IND).
Wolfgang Betz 132:51056160fa4a 250 * @param AdvIntervMax Maximum advertising interval.
Wolfgang Betz 132:51056160fa4a 251 * Range: 0x0020 to 0x4000
Wolfgang Betz 132:51056160fa4a 252 * Default: 2.56 s
Wolfgang Betz 132:51056160fa4a 253 * Time = N * 0.625 msec
Wolfgang Betz 132:51056160fa4a 254 * Time Range: 20 ms to 10.24 sec (minimum 100 ms for ADV_SCAN_IND or ADV_NONCONN_IND).
Wolfgang Betz 132:51056160fa4a 255 * @param OwnAddrType Type of our address used during advertising
Wolfgang Betz 132:51056160fa4a 256 * (@ref PUBLIC_ADDR,@ref STATIC_RANDOM_ADDR).
Wolfgang Betz 132:51056160fa4a 257 * @param AdvFilterPolicy Filter policy:
Wolfgang Betz 132:51056160fa4a 258 * @arg @ref NO_WHITE_LIST_USE
Wolfgang Betz 132:51056160fa4a 259 * @arg @ref WHITE_LIST_FOR_ONLY_SCAN
Wolfgang Betz 132:51056160fa4a 260 * @arg @ref WHITE_LIST_FOR_ONLY_CONN
Wolfgang Betz 132:51056160fa4a 261 * @arg @ref WHITE_LIST_FOR_ALL
Wolfgang Betz 132:51056160fa4a 262 * @param LocalNameLen Length of LocalName array.
Wolfgang Betz 132:51056160fa4a 263 * @param LocalName Array containing the Local Name AD data. First byte is the AD type:
Wolfgang Betz 132:51056160fa4a 264 * @ref AD_TYPE_SHORTENED_LOCAL_NAME or @ref AD_TYPE_COMPLETE_LOCAL_NAME.
Wolfgang Betz 132:51056160fa4a 265 * @param ServiceUUIDLen Length of ServiceUUIDList array.
Wolfgang Betz 132:51056160fa4a 266 * @param ServiceUUIDList This is the list of the UUIDs AD Types as defined in Volume 3,
Wolfgang Betz 132:51056160fa4a 267 * Section 11.1.1 of GAP Specification. First byte is the AD Type.
Wolfgang Betz 132:51056160fa4a 268 * @arg @ref AD_TYPE_16_BIT_SERV_UUID
Wolfgang Betz 132:51056160fa4a 269 * @arg @ref AD_TYPE_16_BIT_SERV_UUID_CMPLT_LIST
Wolfgang Betz 132:51056160fa4a 270 * @arg @ref AD_TYPE_128_BIT_SERV_UUID
Wolfgang Betz 132:51056160fa4a 271 * @arg @ref AD_TYPE_128_BIT_SERV_UUID_CMPLT_LIST
Wolfgang Betz 132:51056160fa4a 272 * @param SlaveConnIntervMin Slave connection interval minimum value suggested by Peripheral.
Wolfgang Betz 132:51056160fa4a 273 * If SlaveConnIntervMin and SlaveConnIntervMax are not 0x0000,
Wolfgang Betz 132:51056160fa4a 274 * Slave Connection Interval Range AD structure will be added in advertising
Wolfgang Betz 132:51056160fa4a 275 * data.
Wolfgang Betz 132:51056160fa4a 276 * Connection interval is defined in the following manner:
Wolfgang Betz 132:51056160fa4a 277 * connIntervalmin = Slave_Conn_Interval_Min x 1.25ms
Wolfgang Betz 132:51056160fa4a 278 * Slave_Conn_Interval_Min range: 0x0006 to 0x0C80
Wolfgang Betz 132:51056160fa4a 279 * Value of 0xFFFF indicates no specific minimum.
Wolfgang Betz 132:51056160fa4a 280 * @param SlaveConnIntervMax Slave connection interval maximum value suggested by Peripheral.
Wolfgang Betz 132:51056160fa4a 281 * If SlaveConnIntervMin and SlaveConnIntervMax are not 0x0000,
Wolfgang Betz 132:51056160fa4a 282 * Slave Connection Interval Range AD structure will be added in advertising
Wolfgang Betz 132:51056160fa4a 283 * data.
Wolfgang Betz 132:51056160fa4a 284 * ConnIntervalmax = Slave_Conn_Interval_Max x 1.25ms
Wolfgang Betz 132:51056160fa4a 285 * Slave_Conn_Interval_Max range: 0x0006 to 0x0C80
Wolfgang Betz 132:51056160fa4a 286 * Slave_ Conn_Interval_Max shall be equal to or greater than the Slave_Conn_Interval_Min.
Wolfgang Betz 132:51056160fa4a 287 * Value of 0xFFFF indicates no specific maximum.
Wolfgang Betz 132:51056160fa4a 288 *
Wolfgang Betz 132:51056160fa4a 289 * @retval tBleStatus Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 290 */
Wolfgang Betz 132:51056160fa4a 291 tBleStatus aci_gap_set_discoverable(uint8_t AdvType, uint16_t AdvIntervMin, uint16_t AdvIntervMax,
Wolfgang Betz 132:51056160fa4a 292 uint8_t OwnAddrType, uint8_t AdvFilterPolicy, uint8_t LocalNameLen,
Wolfgang Betz 132:51056160fa4a 293 const char *LocalName, uint8_t ServiceUUIDLen, uint8_t* ServiceUUIDList,
Wolfgang Betz 132:51056160fa4a 294 uint16_t SlaveConnIntervMin, uint16_t SlaveConnIntervMax);
Wolfgang Betz 132:51056160fa4a 295
Wolfgang Betz 132:51056160fa4a 296 /**
Wolfgang Betz 132:51056160fa4a 297 * @brief Set the Device in direct connectable mode (as defined in GAP specification Volume 3, Section 9.3.3).
Wolfgang Betz 132:51056160fa4a 298 * @note If the privacy is enabled, the reconnection address is used for advertising, otherwise the address
Wolfgang Betz 132:51056160fa4a 299 * of the type specified in OwnAddrType is used. The device will be in directed connectable mode only
Wolfgang Betz 132:51056160fa4a 300 * for 1.28 seconds. If no connection is established within this duration, the device enters non
Wolfgang Betz 132:51056160fa4a 301 * discoverable mode and advertising will have to be again enabled explicitly.
Wolfgang Betz 132:51056160fa4a 302 * The controller generates a @ref EVT_LE_CONN_COMPLETE event with the status set to @ref HCI_DIRECTED_ADV_TIMEOUT
Wolfgang Betz 132:51056160fa4a 303 * if the connection was not established and 0x00 if the connection was successfully established.
Wolfgang Betz 132:51056160fa4a 304 *
Wolfgang Betz 132:51056160fa4a 305 * Usage example:
Wolfgang Betz 132:51056160fa4a 306 * @code
Wolfgang Betz 132:51056160fa4a 307 *
Wolfgang Betz 132:51056160fa4a 308 * tBleStatus ret;
Wolfgang Betz 132:51056160fa4a 309 *
Wolfgang Betz 132:51056160fa4a 310 * const uint8_t central_address[] = {0x43,0x27,0x84,0xE1,0x80,0x02};
Wolfgang Betz 132:51056160fa4a 311 * ret = aci_gap_set_direct_connectable_IDB05A1(PUBLIC_ADDR, HIGH_DUTY_CYCLE_DIRECTED_ADV, PUBLIC_ADDR, central_address);
Wolfgang Betz 132:51056160fa4a 312 * @endcode
Wolfgang Betz 132:51056160fa4a 313 *
Wolfgang Betz 132:51056160fa4a 314 *
Wolfgang Betz 132:51056160fa4a 315 *
Wolfgang Betz 132:51056160fa4a 316 * @param OwnAddrType Type of our address used during advertising (@ref PUBLIC_ADDR,@ref STATIC_RANDOM_ADDR).
Wolfgang Betz 132:51056160fa4a 317 * @param directed_adv_type Type of directed advertising (@ref HIGH_DUTY_CYCLE_DIRECTED_ADV, @ref LOW_DUTY_CYCLE_DIRECTED_ADV).
Wolfgang Betz 132:51056160fa4a 318 * @param InitiatorAddrType Type of peer address (@ref PUBLIC_ADDR,@ref STATIC_RANDOM_ADDR).
Wolfgang Betz 132:51056160fa4a 319 * @param InitiatorAddr Initiator's address (Little Endian).
Wolfgang Betz 132:51056160fa4a 320 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 321 */
Wolfgang Betz 132:51056160fa4a 322 tBleStatus aci_gap_set_direct_connectable_IDB05A1(uint8_t own_addr_type, uint8_t directed_adv_type, uint8_t initiator_addr_type, const uint8_t *initiator_addr);
Wolfgang Betz 132:51056160fa4a 323 /**
Wolfgang Betz 132:51056160fa4a 324 * @brief Set the Device in direct connectable mode (as defined in GAP specification Volume 3, Section 9.3.3).
Wolfgang Betz 132:51056160fa4a 325 * @note If the privacy is enabled, the reconnection address is used for advertising, otherwise the address
Wolfgang Betz 132:51056160fa4a 326 * of the type specified in OwnAddrType is used. The device will be in directed connectable mode only
Wolfgang Betz 132:51056160fa4a 327 * for 1.28 seconds. If no connection is established within this duration, the device enters non
Wolfgang Betz 132:51056160fa4a 328 * discoverable mode and advertising will have to be again enabled explicitly.
Wolfgang Betz 132:51056160fa4a 329 * The controller generates a @ref EVT_LE_CONN_COMPLETE event with the status set to @ref HCI_DIRECTED_ADV_TIMEOUT
Wolfgang Betz 132:51056160fa4a 330 * if the connection was not established and 0x00 if the connection was successfully established.
Wolfgang Betz 132:51056160fa4a 331 *
Wolfgang Betz 132:51056160fa4a 332 * Usage example:
Wolfgang Betz 132:51056160fa4a 333 * @code
Wolfgang Betz 132:51056160fa4a 334 *
Wolfgang Betz 132:51056160fa4a 335 * tBleStatus ret;
Wolfgang Betz 132:51056160fa4a 336 *
Wolfgang Betz 132:51056160fa4a 337 * const uint8_t central_address = {0x43,0x27,0x84,0xE1,0x80,0x02};
Wolfgang Betz 132:51056160fa4a 338 * ret = aci_gap_set_direct_connectable_IDB04A1(PUBLIC_ADDR, PUBLIC_ADDR, central_address);
Wolfgang Betz 132:51056160fa4a 339 * @endcode
Wolfgang Betz 132:51056160fa4a 340 *
Wolfgang Betz 132:51056160fa4a 341 *
Wolfgang Betz 132:51056160fa4a 342 *
Wolfgang Betz 132:51056160fa4a 343 * @param OwnAddrType Type of our address used during advertising (@ref PUBLIC_ADDR,@ref STATIC_RANDOM_ADDR).
Wolfgang Betz 132:51056160fa4a 344 * @param InitiatorAddrType Type of peer address (@ref PUBLIC_ADDR,@ref STATIC_RANDOM_ADDR).
Wolfgang Betz 132:51056160fa4a 345 * @param InitiatorAddr Initiator's address (Little Endian).
Wolfgang Betz 132:51056160fa4a 346 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 347 */
Wolfgang Betz 132:51056160fa4a 348 tBleStatus aci_gap_set_direct_connectable_IDB04A1(uint8_t own_addr_type, uint8_t initiator_addr_type, const uint8_t *initiator_addr);
Wolfgang Betz 132:51056160fa4a 349
Wolfgang Betz 132:51056160fa4a 350 /**
Wolfgang Betz 132:51056160fa4a 351 * @brief Set the IO capabilities of the device.
Wolfgang Betz 132:51056160fa4a 352 * @note This command has to be given only when the device is not in a connected state.
Wolfgang Betz 132:51056160fa4a 353 * @param io_capability One of the allowed codes for IO Capability:
Wolfgang Betz 132:51056160fa4a 354 * @arg @ref IO_CAP_DISPLAY_ONLY
Wolfgang Betz 132:51056160fa4a 355 * @arg @ref IO_CAP_DISPLAY_YES_NO
Wolfgang Betz 132:51056160fa4a 356 * @arg @ref IO_CAP_KEYBOARD_ONLY
Wolfgang Betz 132:51056160fa4a 357 * @arg @ref IO_CAP_NO_INPUT_NO_OUTPUT
Wolfgang Betz 132:51056160fa4a 358 * @arg @ref IO_CAP_KEYBOARD_DISPLAY
Wolfgang Betz 132:51056160fa4a 359 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 360 */
Wolfgang Betz 132:51056160fa4a 361 tBleStatus aci_gap_set_io_capability(uint8_t io_capability);
Wolfgang Betz 132:51056160fa4a 362
Wolfgang Betz 132:51056160fa4a 363 /**
Wolfgang Betz 132:51056160fa4a 364 * @brief Set the authentication requirements for the device.
Wolfgang Betz 132:51056160fa4a 365 * @note If the oob_enable is set to 0, oob_data will be ignored.
Wolfgang Betz 132:51056160fa4a 366 * This command has to be given only when the device is not in a connected state.
Wolfgang Betz 132:51056160fa4a 367 * @param mitm_mode MITM mode:
Wolfgang Betz 132:51056160fa4a 368 * @arg @ref MITM_PROTECTION_NOT_REQUIRED
Wolfgang Betz 132:51056160fa4a 369 * @arg @ref MITM_PROTECTION_REQUIRED
Wolfgang Betz 132:51056160fa4a 370 * @param oob_enable If OOB data are present or not:
Wolfgang Betz 132:51056160fa4a 371 * @arg @ref OOB_AUTH_DATA_ABSENT
Wolfgang Betz 132:51056160fa4a 372 * @arg @ref OOB_AUTH_DATA_PRESENT
Wolfgang Betz 132:51056160fa4a 373 * @param oob_data Out-Of-Band data
Wolfgang Betz 132:51056160fa4a 374 * @param min_encryption_key_size Minimum size of the encryption key to be used during the pairing process
Wolfgang Betz 132:51056160fa4a 375 * @param max_encryption_key_size Maximum size of the encryption key to be used during the pairing process
Wolfgang Betz 132:51056160fa4a 376 * @param use_fixed_pin If application wants to use a fixed pin or not:
Wolfgang Betz 132:51056160fa4a 377 * @arg @ref USE_FIXED_PIN_FOR_PAIRING
Wolfgang Betz 132:51056160fa4a 378 * @arg @ref DONOT_USE_FIXED_PIN_FOR_PAIRING
Wolfgang Betz 132:51056160fa4a 379 * If a fixed pin is not used, it has to be provided by the application with
Wolfgang Betz 132:51056160fa4a 380 * aci_gap_pass_key_response() after @ref EVT_BLUE_GAP_PASS_KEY_REQUEST event.
Wolfgang Betz 132:51056160fa4a 381 * @param fixed_pin If use_fixed_pin is USE_FIXED_PIN_FOR_PAIRING, this is the value of the pin that will
Wolfgang Betz 132:51056160fa4a 382 * be used during pairing if MIMT protection is enabled. Any value between 0 to 999999 is
Wolfgang Betz 132:51056160fa4a 383 * accepted.
Wolfgang Betz 132:51056160fa4a 384 * @param bonding_mode One of the bonding modes:
Wolfgang Betz 132:51056160fa4a 385 * @arg @ref BONDING
Wolfgang Betz 132:51056160fa4a 386 * @arg @ref NO_BONDING
Wolfgang Betz 132:51056160fa4a 387 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 388 */
Wolfgang Betz 132:51056160fa4a 389 tBleStatus aci_gap_set_auth_requirement(uint8_t mitm_mode,
Wolfgang Betz 132:51056160fa4a 390 uint8_t oob_enable,
Wolfgang Betz 132:51056160fa4a 391 uint8_t oob_data[16],
Wolfgang Betz 132:51056160fa4a 392 uint8_t min_encryption_key_size,
Wolfgang Betz 132:51056160fa4a 393 uint8_t max_encryption_key_size,
Wolfgang Betz 132:51056160fa4a 394 uint8_t use_fixed_pin,
Wolfgang Betz 132:51056160fa4a 395 uint32_t fixed_pin,
Wolfgang Betz 132:51056160fa4a 396 uint8_t bonding_mode);
Wolfgang Betz 132:51056160fa4a 397 /**
Wolfgang Betz 132:51056160fa4a 398 * @brief Set the authorization requirements of the device.
Wolfgang Betz 132:51056160fa4a 399 * @note This command has to be given only when the device is not in a connected state.
Wolfgang Betz 132:51056160fa4a 400 * @param conn_handle Handle of the connection in case BlueNRG is configured as a master (otherwise it can be also 0).
Wolfgang Betz 132:51056160fa4a 401 * @param authorization_enable @arg @ref AUTHORIZATION_NOT_REQUIRED : Authorization not required
Wolfgang Betz 132:51056160fa4a 402 * @arg @ref AUTHORIZATION_REQUIRED : Authorization required. This enables
Wolfgang Betz 132:51056160fa4a 403 * the authorization requirement in the device and when a remote device
Wolfgang Betz 132:51056160fa4a 404 * tries to connect to GATT server, @ref EVT_BLUE_GAP_AUTHORIZATION_REQUEST event
Wolfgang Betz 132:51056160fa4a 405 * will be sent to the Host.
Wolfgang Betz 132:51056160fa4a 406 *
Wolfgang Betz 132:51056160fa4a 407 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 408 */
Wolfgang Betz 132:51056160fa4a 409 tBleStatus aci_gap_set_author_requirement(uint16_t conn_handle, uint8_t authorization_enable);
Wolfgang Betz 132:51056160fa4a 410
Wolfgang Betz 132:51056160fa4a 411 /**
Wolfgang Betz 132:51056160fa4a 412 * @brief Provide the pass key that will be used during pairing.
Wolfgang Betz 132:51056160fa4a 413 * @note This command should be sent by the Host in response to @ref EVT_BLUE_GAP_PASS_KEY_REQUEST event.
Wolfgang Betz 132:51056160fa4a 414 * @param conn_handle Connection handle
Wolfgang Betz 132:51056160fa4a 415 * @param passkey Pass key that will be used during the pairing process. Must be a number between
Wolfgang Betz 132:51056160fa4a 416 * 0 and 999999.
Wolfgang Betz 132:51056160fa4a 417 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 418 */
Wolfgang Betz 132:51056160fa4a 419 tBleStatus aci_gap_pass_key_response(uint16_t conn_handle, uint32_t passkey);
Wolfgang Betz 132:51056160fa4a 420
Wolfgang Betz 132:51056160fa4a 421 /**
Wolfgang Betz 132:51056160fa4a 422 * @brief Authorize a device to access attributes.
Wolfgang Betz 132:51056160fa4a 423 * @note Application should send this command after it has received a @ref EVT_BLUE_GAP_AUTHORIZATION_REQUEST.
Wolfgang Betz 132:51056160fa4a 424 *
Wolfgang Betz 132:51056160fa4a 425 * @param conn_handle Connection handle
Wolfgang Betz 132:51056160fa4a 426 * @param authorize @arg @ref CONNECTION_AUTHORIZED : Authorize (accept connection)
Wolfgang Betz 132:51056160fa4a 427 * @arg @ref CONNECTION_REJECTED : Reject (reject connection)
Wolfgang Betz 132:51056160fa4a 428 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 429 */
Wolfgang Betz 132:51056160fa4a 430 tBleStatus aci_gap_authorization_response(uint16_t conn_handle, uint8_t authorize);
Wolfgang Betz 132:51056160fa4a 431
Wolfgang Betz 132:51056160fa4a 432 /**
Wolfgang Betz 132:51056160fa4a 433 * @brief Put the device into non-connectable mode.
Wolfgang Betz 132:51056160fa4a 434 * @param adv_type One of the allowed advertising types:
Wolfgang Betz 132:51056160fa4a 435 * @arg @ref ADV_SCAN_IND : Scannable undirected advertising
Wolfgang Betz 132:51056160fa4a 436 * @arg @ref ADV_NONCONN_IND : Non-connectable undirected advertising
Wolfgang Betz 132:51056160fa4a 437 * @param own_address_type If Privacy is disabled, then the peripheral address can be
Wolfgang Betz 132:51056160fa4a 438 * @arg @ref PUBLIC_ADDR.
Wolfgang Betz 132:51056160fa4a 439 * @arg @ref STATIC_RANDOM_ADDR.
Wolfgang Betz 132:51056160fa4a 440 * If Privacy is enabled, then the peripheral address can be
Wolfgang Betz 132:51056160fa4a 441 * @arg @ref RESOLVABLE_PRIVATE_ADDR
Wolfgang Betz 132:51056160fa4a 442 * @arg @ref NON_RESOLVABLE_PRIVATE_ADDR
Wolfgang Betz 132:51056160fa4a 443 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 444 */
Wolfgang Betz 132:51056160fa4a 445 tBleStatus aci_gap_set_non_connectable_IDB05A1(uint8_t adv_type, uint8_t own_address_type);
Wolfgang Betz 132:51056160fa4a 446 /**
Wolfgang Betz 132:51056160fa4a 447 * @brief Put the device into non-connectable mode.
Wolfgang Betz 132:51056160fa4a 448 * @param adv_type One of the allowed advertising types:
Wolfgang Betz 132:51056160fa4a 449 * @arg @ref ADV_SCAN_IND : Scannable undirected advertising
Wolfgang Betz 132:51056160fa4a 450 * @arg @ref ADV_NONCONN_IND : Non-connectable undirected advertising
Wolfgang Betz 132:51056160fa4a 451 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 452 */
Wolfgang Betz 132:51056160fa4a 453 tBleStatus aci_gap_set_non_connectable_IDB04A1(uint8_t adv_type);
Wolfgang Betz 132:51056160fa4a 454
Wolfgang Betz 132:51056160fa4a 455 /**
Wolfgang Betz 132:51056160fa4a 456 * @brief Put the device into undirected connectable mode.
Wolfgang Betz 132:51056160fa4a 457 * @note If privacy is enabled in the device, a resolvable private address is generated and used
Wolfgang Betz 132:51056160fa4a 458 * as the advertiser's address. If not, the address of the type specified in own_addr_type
Wolfgang Betz 132:51056160fa4a 459 * is used for advertising.
Wolfgang Betz 132:51056160fa4a 460 * @param own_addr_type Type of our address used during advertising:
Wolfgang Betz 132:51056160fa4a 461 * if BLUENRG (IDB04A1)
Wolfgang Betz 132:51056160fa4a 462 * @arg @ref PUBLIC_ADDR.
Wolfgang Betz 132:51056160fa4a 463 * @arg @ref STATIC_RANDOM_ADDR.
Wolfgang Betz 132:51056160fa4a 464 * else if BLUENRG_MS (IDB05A1)
Wolfgang Betz 132:51056160fa4a 465 * If Privacy is disabled:
Wolfgang Betz 132:51056160fa4a 466 * @arg @ref PUBLIC_ADDR.
Wolfgang Betz 132:51056160fa4a 467 * @arg @ref STATIC_RANDOM_ADDR.
Wolfgang Betz 132:51056160fa4a 468 * If Privacy is enabled:
Wolfgang Betz 132:51056160fa4a 469 * @arg @ref RESOLVABLE_PRIVATE_ADDR
Wolfgang Betz 132:51056160fa4a 470 * @arg @ref NON_RESOLVABLE_PRIVATE_ADDR
Wolfgang Betz 132:51056160fa4a 471 * @param adv_filter_policy Filter policy:
Wolfgang Betz 132:51056160fa4a 472 * @arg @ref NO_WHITE_LIST_USE
Wolfgang Betz 132:51056160fa4a 473 * @arg @ref WHITE_LIST_FOR_ALL
Wolfgang Betz 132:51056160fa4a 474 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 475 */
Wolfgang Betz 132:51056160fa4a 476 tBleStatus aci_gap_set_undirected_connectable(uint8_t own_addr_type, uint8_t adv_filter_policy);
Wolfgang Betz 132:51056160fa4a 477
Wolfgang Betz 132:51056160fa4a 478 /**
Wolfgang Betz 132:51056160fa4a 479 * @brief Send a slave security request to the master.
Wolfgang Betz 132:51056160fa4a 480 * @note This command has to be issued to notify the master of the security requirements of the slave.
Wolfgang Betz 132:51056160fa4a 481 * The master may encrypt the link, initiate the pairing procedure, or reject the request.
Wolfgang Betz 132:51056160fa4a 482 * @param conn_handle Connection handle
Wolfgang Betz 132:51056160fa4a 483 * @param bonding One of the bonding modes:
Wolfgang Betz 132:51056160fa4a 484 * @arg @ref BONDING
Wolfgang Betz 132:51056160fa4a 485 * @arg @ref NO_BONDING
Wolfgang Betz 132:51056160fa4a 486 * @param mitm_protection If MITM protection is required or not:
Wolfgang Betz 132:51056160fa4a 487 * @arg @ref MITM_PROTECTION_NOT_REQUIRED
Wolfgang Betz 132:51056160fa4a 488 * @arg @ref MITM_PROTECTION_REQUIRED
Wolfgang Betz 132:51056160fa4a 489 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 490 */
Wolfgang Betz 132:51056160fa4a 491 tBleStatus aci_gap_slave_security_request(uint16_t conn_handle, uint8_t bonding, uint8_t mitm_protection);
Wolfgang Betz 132:51056160fa4a 492
Wolfgang Betz 132:51056160fa4a 493 /**
Wolfgang Betz 132:51056160fa4a 494 * @brief Update advertising data.
Wolfgang Betz 132:51056160fa4a 495 * @note This command can be used to update the advertising data for a particular AD type.
Wolfgang Betz 132:51056160fa4a 496 * If the AD type specified does not exist, then it is added to the advertising data.
Wolfgang Betz 132:51056160fa4a 497 * If the overall advertising data length is more than 31 octets after the update, then
Wolfgang Betz 132:51056160fa4a 498 * the command is rejected and the old data is retained.
Wolfgang Betz 132:51056160fa4a 499 * @param AdvLen Length of AdvData array
Wolfgang Betz 132:51056160fa4a 500 * @param AdvData Advertisement Data, formatted as specified in Bluetooth specification
Wolfgang Betz 132:51056160fa4a 501 * (Volume 3, Part C, 11), including data length. It can contain more than one AD type.
Wolfgang Betz 132:51056160fa4a 502 * Example
Wolfgang Betz 132:51056160fa4a 503 * @code
Wolfgang Betz 132:51056160fa4a 504 * tBleStatus ret;
Wolfgang Betz 132:51056160fa4a 505 * const char local_name[] = {AD_TYPE_COMPLETE_LOCAL_NAME,'B','l','u','e','N','R','G'};
Wolfgang Betz 132:51056160fa4a 506 * const uint8_t serviceUUIDList[] = {AD_TYPE_16_BIT_SERV_UUID,0x34,0x12};
Wolfgang Betz 132:51056160fa4a 507 * const uint8_t manuf_data[] = {4, AD_TYPE_MANUFACTURER_SPECIFIC_DATA, 0x05, 0x02, 0x01};
Wolfgang Betz 132:51056160fa4a 508 *
Wolfgang Betz 132:51056160fa4a 509 * ret = aci_gap_set_discoverable(ADV_IND, 0, 0, STATIC_RANDOM_ADDR, NO_WHITE_LIST_USE,
Wolfgang Betz 132:51056160fa4a 510 * 8, local_name, 3, serviceUUIDList, 0, 0);
Wolfgang Betz 132:51056160fa4a 511 * ret = aci_gap_update_adv_data(5, manuf_data);
Wolfgang Betz 132:51056160fa4a 512 * @endcode
Wolfgang Betz 132:51056160fa4a 513 *
Wolfgang Betz 132:51056160fa4a 514 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 515 */
Wolfgang Betz 132:51056160fa4a 516 tBleStatus aci_gap_update_adv_data(uint8_t AdvLen, const uint8_t *AdvData);
Wolfgang Betz 132:51056160fa4a 517
Wolfgang Betz 132:51056160fa4a 518 /**
Wolfgang Betz 132:51056160fa4a 519 * @brief Delete an AD Type
Wolfgang Betz 132:51056160fa4a 520 * @note This command can be used to delete the specified AD type from the advertisement data if
Wolfgang Betz 132:51056160fa4a 521 * present.
Wolfgang Betz 132:51056160fa4a 522 * @param ad_type One of the allowed AD types (see @ref AD_Types)
Wolfgang Betz 132:51056160fa4a 523 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 524 */
Wolfgang Betz 132:51056160fa4a 525 tBleStatus aci_gap_delete_ad_type(uint8_t ad_type);
Wolfgang Betz 132:51056160fa4a 526
Wolfgang Betz 132:51056160fa4a 527 /**
Wolfgang Betz 132:51056160fa4a 528 * @brief Get the current security settings
Wolfgang Betz 132:51056160fa4a 529 * @note This command can be used to get the current security settings of the device.
Wolfgang Betz 132:51056160fa4a 530 * @param mitm_protection @arg 0: Not required
Wolfgang Betz 132:51056160fa4a 531 * @arg 1: Required
Wolfgang Betz 132:51056160fa4a 532 * @param bonding @arg 0: No bonding mode
Wolfgang Betz 132:51056160fa4a 533 * @arg 1: Bonding mode
Wolfgang Betz 132:51056160fa4a 534 * @param oob_data @arg 0: Data absent
Wolfgang Betz 132:51056160fa4a 535 * @arg 1: Data present
Wolfgang Betz 132:51056160fa4a 536 * @param passkey_required @arg 0: Not required
Wolfgang Betz 132:51056160fa4a 537 * @arg 1: Fixed pin is present which is being used
Wolfgang Betz 132:51056160fa4a 538 * @arg 2: Passkey required for pairing. An event will be generated
Wolfgang Betz 132:51056160fa4a 539 * when required.
Wolfgang Betz 132:51056160fa4a 540 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 541 */
Wolfgang Betz 132:51056160fa4a 542 tBleStatus aci_gap_get_security_level(uint8_t* mitm_protection, uint8_t* bonding,
Wolfgang Betz 132:51056160fa4a 543 uint8_t* oob_data, uint8_t* passkey_required);
Wolfgang Betz 132:51056160fa4a 544
Wolfgang Betz 132:51056160fa4a 545 /**
Wolfgang Betz 132:51056160fa4a 546 * @brief Add addresses of bonded devices into the controller's whitelist.
Wolfgang Betz 132:51056160fa4a 547 * @note The command will return an error if there are no devices in the database or if it was unable
Wolfgang Betz 132:51056160fa4a 548 * to add the device into the whitelist.
Wolfgang Betz 132:51056160fa4a 549 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 550 */
Wolfgang Betz 132:51056160fa4a 551 tBleStatus aci_gap_configure_whitelist(void);
Wolfgang Betz 132:51056160fa4a 552
Wolfgang Betz 132:51056160fa4a 553 /**
Wolfgang Betz 132:51056160fa4a 554 * @brief Terminate a connection.
Wolfgang Betz 132:51056160fa4a 555 * @note A @ref EVT_DISCONN_COMPLETE event will be generated when the link is disconnected.
Wolfgang Betz 132:51056160fa4a 556 * @param conn_handle Connection handle
Wolfgang Betz 132:51056160fa4a 557 * @param reason Reason for requesting disconnection. The error code can be any of ones as specified
Wolfgang Betz 132:51056160fa4a 558 * for the disconnected command in the HCI specification (See @ref HCI_Error_codes).
Wolfgang Betz 132:51056160fa4a 559 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 560 */
Wolfgang Betz 132:51056160fa4a 561 tBleStatus aci_gap_terminate(uint16_t conn_handle, uint8_t reason);
Wolfgang Betz 132:51056160fa4a 562
Wolfgang Betz 132:51056160fa4a 563 /**
Wolfgang Betz 132:51056160fa4a 564 * @brief Clear the security database.
Wolfgang Betz 132:51056160fa4a 565 * @note All the devices in the security database will be removed.
Wolfgang Betz 132:51056160fa4a 566 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 567 */
Wolfgang Betz 132:51056160fa4a 568 tBleStatus aci_gap_clear_security_database(void);
Wolfgang Betz 132:51056160fa4a 569
Wolfgang Betz 132:51056160fa4a 570 /**
Wolfgang Betz 132:51056160fa4a 571 * @brief Allows the security manager to complete the pairing procedure and re-bond with the master.
Wolfgang Betz 132:51056160fa4a 572 * @note This command can be issued by the application if a @ref EVT_BLUE_GAP_BOND_LOST event is generated.
Wolfgang Betz 132:51056160fa4a 573 * @param conn_handle
Wolfgang Betz 132:51056160fa4a 574 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 575 */
Wolfgang Betz 132:51056160fa4a 576 tBleStatus aci_gap_allow_rebond_IDB05A1(uint16_t conn_handle);
Wolfgang Betz 132:51056160fa4a 577 /**
Wolfgang Betz 132:51056160fa4a 578 * @brief Allows the security manager to complete the pairing procedure and re-bond with the master.
Wolfgang Betz 132:51056160fa4a 579 * @note This command can be issued by the application if a @ref EVT_BLUE_GAP_BOND_LOST event is generated.
Wolfgang Betz 132:51056160fa4a 580 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 581 */
Wolfgang Betz 132:51056160fa4a 582 tBleStatus aci_gap_allow_rebond_IDB04A1(void);
Wolfgang Betz 132:51056160fa4a 583
Wolfgang Betz 132:51056160fa4a 584 /**
Wolfgang Betz 132:51056160fa4a 585 * @brief Start the limited discovery procedure.
Wolfgang Betz 132:51056160fa4a 586 * @note The controller is commanded to start active scanning. When this procedure is started,
Wolfgang Betz 132:51056160fa4a 587 * only the devices in limited discoverable mode are returned to the upper layers.
Wolfgang Betz 132:51056160fa4a 588 * The procedure is terminated when either the upper layers issue a command to terminate the
Wolfgang Betz 132:51056160fa4a 589 * procedure by issuing the command aci_gap_terminate_gap_procedure() with the procedure code
Wolfgang Betz 132:51056160fa4a 590 * set to @ref GAP_LIMITED_DISCOVERY_PROC or a timeout happens. When the procedure is terminated
Wolfgang Betz 132:51056160fa4a 591 * due to any of the above reasons, @ref EVT_BLUE_GAP_PROCEDURE_COMPLETE event is returned with
Wolfgang Betz 132:51056160fa4a 592 * the procedure code set to @ref GAP_LIMITED_DISCOVERY_PROC.
Wolfgang Betz 132:51056160fa4a 593 * The device found when the procedure is ongoing is returned to the upper layers through the
Wolfgang Betz 132:51056160fa4a 594 * event @ref EVT_BLUE_GAP_DEVICE_FOUND.
Wolfgang Betz 132:51056160fa4a 595 * @param scanInterval Time interval from when the Controller started its last LE scan until it begins
Wolfgang Betz 132:51056160fa4a 596 * the subsequent LE scan. The scan interval should be a number in the range
Wolfgang Betz 132:51056160fa4a 597 * 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec.
Wolfgang Betz 132:51056160fa4a 598 * For a number N, Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 599 * @param scanWindow Amount of time for the duration of the LE scan. Scan_Window shall be less than
Wolfgang Betz 132:51056160fa4a 600 * or equal to Scan_Interval. The scan window should be a number in the range
Wolfgang Betz 132:51056160fa4a 601 * 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec.
Wolfgang Betz 132:51056160fa4a 602 * For a number N, Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 603 * @param own_address_type Type of our address used during advertising (@ref PUBLIC_ADDR, @ref STATIC_RANDOM_ADDR).
Wolfgang Betz 132:51056160fa4a 604 * @param filterDuplicates Duplicate filtering enabled or not.
Wolfgang Betz 132:51056160fa4a 605 * @arg 0x00: Do not filter the duplicates
Wolfgang Betz 132:51056160fa4a 606 * @arg 0x01: Filter duplicates
Wolfgang Betz 132:51056160fa4a 607 *
Wolfgang Betz 132:51056160fa4a 608 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 609 */
Wolfgang Betz 132:51056160fa4a 610 tBleStatus aci_gap_start_limited_discovery_proc(uint16_t scanInterval, uint16_t scanWindow,
Wolfgang Betz 132:51056160fa4a 611 uint8_t own_address_type, uint8_t filterDuplicates);
Wolfgang Betz 132:51056160fa4a 612
Wolfgang Betz 132:51056160fa4a 613 /**
Wolfgang Betz 132:51056160fa4a 614 * @brief Start the general discovery procedure.
Wolfgang Betz 132:51056160fa4a 615 * @note The controller is commanded to start active scanning. The procedure is terminated when
Wolfgang Betz 132:51056160fa4a 616 * either the upper layers issue a command to terminate the procedure by issuing the command
Wolfgang Betz 132:51056160fa4a 617 * aci_gap_terminate_gap_procedure() with the procedure code set to GAP_GENERAL_DISCOVERY_PROC
Wolfgang Betz 132:51056160fa4a 618 * or a timeout happens. When the procedure is terminated due to any of the above reasons,
Wolfgang Betz 132:51056160fa4a 619 * @ref EVT_BLUE_GAP_PROCEDURE_COMPLETE event is returned with the procedure code set to
Wolfgang Betz 132:51056160fa4a 620 * @ref GAP_GENERAL_DISCOVERY_PROC. The device found when the procedure is ongoing is returned to
Wolfgang Betz 132:51056160fa4a 621 * the upper layers through the event @ref EVT_BLUE_GAP_DEVICE_FOUND.
Wolfgang Betz 132:51056160fa4a 622 * @param scanInterval Time interval from when the Controller started its last LE scan until it begins
Wolfgang Betz 132:51056160fa4a 623 * the subsequent LE scan. The scan interval should be a number in the range
Wolfgang Betz 132:51056160fa4a 624 * 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec.
Wolfgang Betz 132:51056160fa4a 625 * For a number N, Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 626 * @param scanWindow Amount of time for the duration of the LE scan. Scan_Window shall be less than
Wolfgang Betz 132:51056160fa4a 627 * or equal to Scan_Interval. The scan window should be a number in the range
Wolfgang Betz 132:51056160fa4a 628 * 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec.
Wolfgang Betz 132:51056160fa4a 629 * For a number N, Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 630 * @param own_address_type Type of our address used during advertising (@ref PUBLIC_ADDR, @ref STATIC_RANDOM_ADDR).
Wolfgang Betz 132:51056160fa4a 631 * @param filterDuplicates Duplicate filtering enabled or not.
Wolfgang Betz 132:51056160fa4a 632 * @arg 0x00: Do not filter the duplicates
Wolfgang Betz 132:51056160fa4a 633 * @arg 0x01: Filter duplicates
Wolfgang Betz 132:51056160fa4a 634 *
Wolfgang Betz 132:51056160fa4a 635 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 636 */
Wolfgang Betz 132:51056160fa4a 637 tBleStatus aci_gap_start_general_discovery_proc(uint16_t scanInterval, uint16_t scanWindow,
Wolfgang Betz 132:51056160fa4a 638 uint8_t own_address_type, uint8_t filterDuplicates);
Wolfgang Betz 132:51056160fa4a 639
Wolfgang Betz 132:51056160fa4a 640 /**
Wolfgang Betz 132:51056160fa4a 641 * @brief Start the name discovery procedure.
Wolfgang Betz 132:51056160fa4a 642 * @note A LE_Create_Connection call will be made to the controller by GAP with the initiator filter
Wolfgang Betz 132:51056160fa4a 643 * policy set to “ignore whitelist and process connectable advertising packets only for the
Wolfgang Betz 132:51056160fa4a 644 * specified device”. Once a connection is established, GATT procedure is started to read the
Wolfgang Betz 132:51056160fa4a 645 * device name characteristic. When the read is completed (successfully or unsuccessfully),
Wolfgang Betz 132:51056160fa4a 646 * a @ref EVT_BLUE_GAP_PROCEDURE_COMPLETE event is given to the upper layer. The event also
Wolfgang Betz 132:51056160fa4a 647 * contains the name of the device if the device name was read successfully.
Wolfgang Betz 132:51056160fa4a 648 * @param scanInterval Time interval from when the Controller started its last LE scan until it begins
Wolfgang Betz 132:51056160fa4a 649 * the subsequent LE scan. The scan interval should be a number in the range
Wolfgang Betz 132:51056160fa4a 650 * 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec.
Wolfgang Betz 132:51056160fa4a 651 * For a number N, Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 652 * @param scanWindow Amount of time for the duration of the LE scan. Scan_Window shall be less than
Wolfgang Betz 132:51056160fa4a 653 * or equal to Scan_Interval. The scan window should be a number in the range
Wolfgang Betz 132:51056160fa4a 654 * 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec.
Wolfgang Betz 132:51056160fa4a 655 * For a number N, Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 656 * @param peer_bdaddr_type Type of the peer address (@ref PUBLIC_ADDR, @ref STATIC_RANDOM_ADDR).
Wolfgang Betz 132:51056160fa4a 657 * @param peer_bdaddr Address of the peer device with which a connection has to be established.
Wolfgang Betz 132:51056160fa4a 658 * @param own_bdaddr_type Type of our address used during advertising (PUBLIC_ADDR,STATIC_RANDOM_ADDR).
Wolfgang Betz 132:51056160fa4a 659 * @param conn_min_interval Minimum value for the connection event interval. This shall be less than or
Wolfgang Betz 132:51056160fa4a 660 * equal to Conn_Interval_Max.\n
Wolfgang Betz 132:51056160fa4a 661 * Range: 0x0006 to 0x0C80\n
Wolfgang Betz 132:51056160fa4a 662 * Time = N x 1.25 msec\n
Wolfgang Betz 132:51056160fa4a 663 * Time Range: 7.5 msec to 4 seconds
Wolfgang Betz 132:51056160fa4a 664 * @param conn_max_interval Maximum value for the connection event interval. This shall be greater than or
Wolfgang Betz 132:51056160fa4a 665 * equal to Conn_Interval_Min.\n
Wolfgang Betz 132:51056160fa4a 666 * Range: 0x0006 to 0x0C80\n
Wolfgang Betz 132:51056160fa4a 667 * Time = N x 1.25 msec\n
Wolfgang Betz 132:51056160fa4a 668 * Time Range: 7.5 msec to 4 seconds
Wolfgang Betz 132:51056160fa4a 669 * @param conn_latency Slave latency for the connection in number of connection events.\n
Wolfgang Betz 132:51056160fa4a 670 * Range: 0x0000 to 0x01F4
Wolfgang Betz 132:51056160fa4a 671 * @param supervision_timeout Supervision timeout for the LE Link.\n
Wolfgang Betz 132:51056160fa4a 672 * Range: 0x000A to 0x0C80\n
Wolfgang Betz 132:51056160fa4a 673 * Time = N x 10 msec\n
Wolfgang Betz 132:51056160fa4a 674 * Time Range: 100 msec to 32 seconds
Wolfgang Betz 132:51056160fa4a 675 * @param min_conn_length Minimum length of connection needed for the LE connection.\n
Wolfgang Betz 132:51056160fa4a 676 * Range: 0x0000 - 0xFFFF\n
Wolfgang Betz 132:51056160fa4a 677 * Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 678 * @param max_conn_length Maximum length of connection needed for the LE connection.\n
Wolfgang Betz 132:51056160fa4a 679 * Range: 0x0000 - 0xFFFF\n
Wolfgang Betz 132:51056160fa4a 680 * Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 681 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 682 */
Wolfgang Betz 132:51056160fa4a 683 tBleStatus aci_gap_start_name_discovery_proc(uint16_t scanInterval, uint16_t scanWindow,
Wolfgang Betz 132:51056160fa4a 684 uint8_t peer_bdaddr_type, tBDAddr peer_bdaddr,
Wolfgang Betz 132:51056160fa4a 685 uint8_t own_bdaddr_type, uint16_t conn_min_interval,
Wolfgang Betz 132:51056160fa4a 686 uint16_t conn_max_interval, uint16_t conn_latency,
Wolfgang Betz 132:51056160fa4a 687 uint16_t supervision_timeout, uint16_t min_conn_length,
Wolfgang Betz 132:51056160fa4a 688 uint16_t max_conn_length);
Wolfgang Betz 132:51056160fa4a 689
Wolfgang Betz 132:51056160fa4a 690 /**
Wolfgang Betz 132:51056160fa4a 691 * @brief Start the auto connection establishment procedure.
Wolfgang Betz 132:51056160fa4a 692 * @note The devices specified are added to the white list of the controller and a LE_Create_Connection
Wolfgang Betz 132:51056160fa4a 693 * call will be made to the controller by GAP with the initiator filter policy set to
Wolfgang Betz 132:51056160fa4a 694 * “use whitelist to determine which advertiser to connect to”. When a command is issued to
Wolfgang Betz 132:51056160fa4a 695 * terminate the procedure by upper layer, a LE_Create_Connection_Cancel call will be made to the
Wolfgang Betz 132:51056160fa4a 696 * controller by GAP.
Wolfgang Betz 132:51056160fa4a 697 * The procedure is terminated when either a connection is successfully established with one of
Wolfgang Betz 132:51056160fa4a 698 * the specified devices in the white list or the procedure is explicitly terminated by issuing
Wolfgang Betz 132:51056160fa4a 699 * the command aci_gap_terminate_gap_procedure() with the procedure code set to
Wolfgang Betz 132:51056160fa4a 700 * @ref GAP_AUTO_CONNECTION_ESTABLISHMENT_PROC. A @ref EVT_BLUE_GAP_PROCEDURE_COMPLETE event is returned with
Wolfgang Betz 132:51056160fa4a 701 * the procedure code set to @ref GAP_AUTO_CONNECTION_ESTABLISHMENT_PROC.
Wolfgang Betz 132:51056160fa4a 702 * @param scanInterval Time interval from when the Controller started its last LE scan until it begins
Wolfgang Betz 132:51056160fa4a 703 * the subsequent LE scan. The scan interval should be a number in the range
Wolfgang Betz 132:51056160fa4a 704 * 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec.
Wolfgang Betz 132:51056160fa4a 705 * For a number N, Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 706 * @param scanWindow Amount of time for the duration of the LE scan. Scan_Window shall be less than
Wolfgang Betz 132:51056160fa4a 707 * or equal to Scan_Interval. The scan window should be a number in the range
Wolfgang Betz 132:51056160fa4a 708 * 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec.
Wolfgang Betz 132:51056160fa4a 709 * For a number N, Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 710 * @param own_bdaddr_type Type of our address used during advertising (PUBLIC_ADDR,STATIC_RANDOM_ADDR).
Wolfgang Betz 132:51056160fa4a 711 * @param conn_min_interval Minimum value for the connection event interval. This shall be less than or
Wolfgang Betz 132:51056160fa4a 712 * equal to Conn_Interval_Max.\n
Wolfgang Betz 132:51056160fa4a 713 * Range: 0x0006 to 0x0C80\n
Wolfgang Betz 132:51056160fa4a 714 * Time = N x 1.25 msec\n
Wolfgang Betz 132:51056160fa4a 715 * Time Range: 7.5 msec to 4 seconds
Wolfgang Betz 132:51056160fa4a 716 * @param conn_max_interval Maximum value for the connection event interval. This shall be greater than or
Wolfgang Betz 132:51056160fa4a 717 * equal to Conn_Interval_Min.\n
Wolfgang Betz 132:51056160fa4a 718 * Range: 0x0006 to 0x0C80\n
Wolfgang Betz 132:51056160fa4a 719 * Time = N x 1.25 msec\n
Wolfgang Betz 132:51056160fa4a 720 * Time Range: 7.5 msec to 4 seconds
Wolfgang Betz 132:51056160fa4a 721 * @param conn_latency Slave latency for the connection in number of connection events.\n
Wolfgang Betz 132:51056160fa4a 722 * Range: 0x0000 to 0x01F4
Wolfgang Betz 132:51056160fa4a 723 * @param supervision_timeout Supervision timeout for the LE Link.\n
Wolfgang Betz 132:51056160fa4a 724 * Range: 0x000A to 0x0C80\n
Wolfgang Betz 132:51056160fa4a 725 * Time = N x 10 msec\n
Wolfgang Betz 132:51056160fa4a 726 * Time Range: 100 msec to 32 seconds
Wolfgang Betz 132:51056160fa4a 727 * @param min_conn_length Minimum length of connection needed for the LE connection.\n
Wolfgang Betz 132:51056160fa4a 728 * Range: 0x0000 - 0xFFFF\n
Wolfgang Betz 132:51056160fa4a 729 * Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 730 * @param max_conn_length Maximum length of connection needed for the LE connection.\n
Wolfgang Betz 132:51056160fa4a 731 * Range: 0x0000 - 0xFFFF\n
Wolfgang Betz 132:51056160fa4a 732 * Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 733 * @cond BLUENRG
Wolfgang Betz 132:51056160fa4a 734 * @param use_reconn_addr If 1, the provided reconnection address is used as our address during the procedure (the address
Wolfgang Betz 132:51056160fa4a 735 * has been previously notified to the application through @ref EVT_BLUE_GAP_RECONNECTION_ADDRESS event).\n
Wolfgang Betz 132:51056160fa4a 736 * @param reconn_addr Reconnection address used if use_reconn_addr is 1.
Wolfgang Betz 132:51056160fa4a 737 * @endcond
Wolfgang Betz 132:51056160fa4a 738 * @param num_whitelist_entries Number of devices that have to be added to the whitelist.
Wolfgang Betz 132:51056160fa4a 739 * @param addr_array addr_array will contain the addresses that have to be added into the whitelist. The
Wolfgang Betz 132:51056160fa4a 740 * format of the addr_array should be: address type followed by address.
Wolfgang Betz 132:51056160fa4a 741 * Example:
Wolfgang Betz 132:51056160fa4a 742 * @code
Wolfgang Betz 132:51056160fa4a 743 * uint8_t addr_array[] = {PUBLIC_ADDR,0x01,0x00,0x00,0xe1,0x80,0x02,
Wolfgang Betz 132:51056160fa4a 744 * PUBLIC_ADDR,0x02,0x00,0x00,0xe1,0x80,0x02};
Wolfgang Betz 132:51056160fa4a 745 * @endcode
Wolfgang Betz 132:51056160fa4a 746 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 747 */
Wolfgang Betz 132:51056160fa4a 748 tBleStatus aci_gap_start_auto_conn_establish_proc_IDB05A1(uint16_t scanInterval, uint16_t scanWindow,
Wolfgang Betz 132:51056160fa4a 749 uint8_t own_bdaddr_type, uint16_t conn_min_interval,
Wolfgang Betz 132:51056160fa4a 750 uint16_t conn_max_interval, uint16_t conn_latency,
Wolfgang Betz 132:51056160fa4a 751 uint16_t supervision_timeout, uint16_t min_conn_length,
Wolfgang Betz 132:51056160fa4a 752 uint16_t max_conn_length,
Wolfgang Betz 132:51056160fa4a 753 uint8_t num_whitelist_entries,
Wolfgang Betz 132:51056160fa4a 754 const uint8_t *addr_array);
Wolfgang Betz 132:51056160fa4a 755 tBleStatus aci_gap_start_auto_conn_establish_proc_IDB04A1(uint16_t scanInterval, uint16_t scanWindow,
Wolfgang Betz 132:51056160fa4a 756 uint8_t own_bdaddr_type, uint16_t conn_min_interval,
Wolfgang Betz 132:51056160fa4a 757 uint16_t conn_max_interval, uint16_t conn_latency,
Wolfgang Betz 132:51056160fa4a 758 uint16_t supervision_timeout, uint16_t min_conn_length,
Wolfgang Betz 132:51056160fa4a 759 uint16_t max_conn_length,
Wolfgang Betz 132:51056160fa4a 760 uint8_t use_reconn_addr,
Wolfgang Betz 132:51056160fa4a 761 const tBDAddr reconn_addr,
Wolfgang Betz 132:51056160fa4a 762 uint8_t num_whitelist_entries,
Wolfgang Betz 132:51056160fa4a 763 const uint8_t *addr_array);
Wolfgang Betz 132:51056160fa4a 764
Wolfgang Betz 132:51056160fa4a 765 /**
Wolfgang Betz 132:51056160fa4a 766 * @brief Start a general connection establishment procedure.
Wolfgang Betz 132:51056160fa4a 767 * @note The host enables scanning in the controller with the scanner filter policy set
Wolfgang Betz 132:51056160fa4a 768 * to “accept all advertising packets” and from the scanning results all the devices
Wolfgang Betz 132:51056160fa4a 769 * are sent to the upper layer using the event @ref EVT_BLUE_GAP_DEVICE_FOUND.
Wolfgang Betz 132:51056160fa4a 770 * The upper layer then has to select one of the devices to which it wants to connect
Wolfgang Betz 132:51056160fa4a 771 * by issuing the command aci_gap_create_connection(). The procedure is terminated
Wolfgang Betz 132:51056160fa4a 772 * when a connection is established or the upper layer terminates the procedure by
Wolfgang Betz 132:51056160fa4a 773 * issuing the command aci_gap_terminate_gap_procedure() with the procedure code set to
Wolfgang Betz 132:51056160fa4a 774 * @ref GAP_GENERAL_CONNECTION_ESTABLISHMENT_PROC. On completion of the procedure a
Wolfgang Betz 132:51056160fa4a 775 * @ref EVT_BLUE_GAP_PROCEDURE_COMPLETE event is generated with the procedure code set to
Wolfgang Betz 132:51056160fa4a 776 * @ref GAP_GENERAL_CONNECTION_ESTABLISHMENT_PROC.
Wolfgang Betz 132:51056160fa4a 777 * @param scan_type Passive or active scanning (@ref PASSIVE_SCAN, @ref ACTIVE_SCAN)
Wolfgang Betz 132:51056160fa4a 778 * @param scan_interval Time interval from when the Controller started its last LE scan until it begins
Wolfgang Betz 132:51056160fa4a 779 * the subsequent LE scan. The scan interval should be a number in the range
Wolfgang Betz 132:51056160fa4a 780 * 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec.
Wolfgang Betz 132:51056160fa4a 781 * For a number N, Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 782 * @param scan_window Amount of time for the duration of the LE scan. Scan_Window shall be less than
Wolfgang Betz 132:51056160fa4a 783 * or equal to Scan_Interval. The scan window should be a number in the range
Wolfgang Betz 132:51056160fa4a 784 * 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec.
Wolfgang Betz 132:51056160fa4a 785 * For a number N, Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 786 * @param own_address_type Type of our address used during active scanning (@ref PUBLIC_ADDR, @ref STATIC_RANDOM_ADDR).
Wolfgang Betz 132:51056160fa4a 787 * @param filter_duplicates Duplicate filtering enabled or not.
Wolfgang Betz 132:51056160fa4a 788 * @arg 0x00: Do not filter the duplicates
Wolfgang Betz 132:51056160fa4a 789 * @arg 0x01: Filter duplicates
Wolfgang Betz 132:51056160fa4a 790 * @cond BLUENRG
Wolfgang Betz 132:51056160fa4a 791 * @param use_reconn_addr If 1, the provided reconnection address is used as our address during the procedure (the address
Wolfgang Betz 132:51056160fa4a 792 * has been previously notified to the application through @ref EVT_BLUE_GAP_RECONNECTION_ADDRESS event).\n
Wolfgang Betz 132:51056160fa4a 793 * @param reconn_addr Reconnection address used if use_reconn_addr is 1.
Wolfgang Betz 132:51056160fa4a 794 * @endcond
Wolfgang Betz 132:51056160fa4a 795 *
Wolfgang Betz 132:51056160fa4a 796 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 797 */
Wolfgang Betz 132:51056160fa4a 798 tBleStatus aci_gap_start_general_conn_establish_proc_IDB05A1(uint8_t scan_type, uint16_t scan_interval, uint16_t scan_window,
Wolfgang Betz 132:51056160fa4a 799 uint8_t own_address_type, uint8_t filter_duplicates);
Wolfgang Betz 132:51056160fa4a 800 tBleStatus aci_gap_start_general_conn_establish_proc_IDB04A1(uint8_t scan_type, uint16_t scan_interval, uint16_t scan_window,
Wolfgang Betz 132:51056160fa4a 801 uint8_t own_address_type, uint8_t filter_duplicates, uint8_t use_reconn_addr, const tBDAddr reconn_addr);
Wolfgang Betz 132:51056160fa4a 802
Wolfgang Betz 132:51056160fa4a 803 /**
Wolfgang Betz 132:51056160fa4a 804 * @brief Start a selective connection establishment procedure.
Wolfgang Betz 132:51056160fa4a 805 * @note The GAP adds the specified device addresses into white list and enables scanning in
Wolfgang Betz 132:51056160fa4a 806 * the controller with the scanner filter policy set to “accept packets only from
Wolfgang Betz 132:51056160fa4a 807 * devices in whitelist”. All the devices found are sent to the upper layer by the
Wolfgang Betz 132:51056160fa4a 808 * event @ref EVT_BLUE_GAP_DEVICE_FOUND. The upper layer then has to select one of the
Wolfgang Betz 132:51056160fa4a 809 * devices to which it wants to connect by issuing the command aci_gap_create_connection().
Wolfgang Betz 132:51056160fa4a 810 * On completion of the procedure a @ref EVT_BLUE_GAP_PROCEDURE_COMPLETE event is generated
Wolfgang Betz 132:51056160fa4a 811 * with the procedure code set to @ref GAP_SELECTIVE_CONNECTION_ESTABLISHMENT_PROC.
Wolfgang Betz 132:51056160fa4a 812 * The procedure is terminated when a connection is established or the upper layer terminates
Wolfgang Betz 132:51056160fa4a 813 * the procedure by issuing the command aci_gap_terminate_gap_procedure with the procedure
Wolfgang Betz 132:51056160fa4a 814 * code set to @ref GAP_SELECTIVE_CONNECTION_ESTABLISHMENT_PROC.
Wolfgang Betz 132:51056160fa4a 815 * @param scan_type Passive or active scanning (@ref PASSIVE_SCAN, @ref ACTIVE_SCAN)
Wolfgang Betz 132:51056160fa4a 816 * @param scan_interval Time interval from when the Controller started its last LE scan until it begins
Wolfgang Betz 132:51056160fa4a 817 * the subsequent LE scan. The scan interval should be a number in the range
Wolfgang Betz 132:51056160fa4a 818 * 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec.
Wolfgang Betz 132:51056160fa4a 819 * For a number N, Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 820 * @param scan_window Amount of time for the duration of the LE scan. Scan_Window shall be less than
Wolfgang Betz 132:51056160fa4a 821 * or equal to Scan_Interval. The scan window should be a number in the range
Wolfgang Betz 132:51056160fa4a 822 * 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec.
Wolfgang Betz 132:51056160fa4a 823 * For a number N, Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 824 * @param own_address_type Type of our address used during active scanning (@ref PUBLIC_ADDR, @ref STATIC_RANDOM_ADDR).
Wolfgang Betz 132:51056160fa4a 825 * @param filter_duplicates Duplicate filtering enabled or not.
Wolfgang Betz 132:51056160fa4a 826 * @arg 0x00: Do not filter the duplicates
Wolfgang Betz 132:51056160fa4a 827 * @arg 0x01: Filter duplicates
Wolfgang Betz 132:51056160fa4a 828 * @param num_whitelist_entries Number of devices that have to be added to the whitelist.
Wolfgang Betz 132:51056160fa4a 829 * @param addr_array addr_array will contain the addresses that have to be added into the whitelist. The
Wolfgang Betz 132:51056160fa4a 830 * format of the addr_array should be: address type followed by address.
Wolfgang Betz 132:51056160fa4a 831 * Example:
Wolfgang Betz 132:51056160fa4a 832 * @code
Wolfgang Betz 132:51056160fa4a 833 * uint8_t addr_array[] = {PUBLIC_ADDR,0x01,0x00,0x00,0xe1,0x80,0x02,
Wolfgang Betz 132:51056160fa4a 834 * PUBLIC_ADDR,0x02,0x00,0x00,0xe1,0x80,0x02};
Wolfgang Betz 132:51056160fa4a 835 * @endcode
Wolfgang Betz 132:51056160fa4a 836 *
Wolfgang Betz 132:51056160fa4a 837 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 838 */
Wolfgang Betz 132:51056160fa4a 839 tBleStatus aci_gap_start_selective_conn_establish_proc(uint8_t scan_type, uint16_t scan_interval, uint16_t scan_window,
Wolfgang Betz 132:51056160fa4a 840 uint8_t own_address_type, uint8_t filter_duplicates, uint8_t num_whitelist_entries,
Wolfgang Betz 132:51056160fa4a 841 const uint8_t *addr_array);
Wolfgang Betz 132:51056160fa4a 842
Wolfgang Betz 132:51056160fa4a 843 /**
Wolfgang Betz 132:51056160fa4a 844 * @brief Start the direct connection establishment procedure.
Wolfgang Betz 132:51056160fa4a 845 * @note A LE_Create_Connection call will be made to the controller by GAP with the initiator filter
Wolfgang Betz 132:51056160fa4a 846 * policy set to “ignore whitelist and process connectable advertising packets only for the
Wolfgang Betz 132:51056160fa4a 847 * specified device”. The procedure can be terminated explicitly by the upper layer by issuing
Wolfgang Betz 132:51056160fa4a 848 * the command aci_gap_terminate_gap_procedure(). When a command is issued to terminate the
Wolfgang Betz 132:51056160fa4a 849 * procedure by upper layer, a LE_Create_Connection_Cancel call will be made to the controller
Wolfgang Betz 132:51056160fa4a 850 * by GAP.
Wolfgang Betz 132:51056160fa4a 851 * On termination of the procedure, a @ref EVT_LE_CONN_COMPLETE event is returned. The procedure can
Wolfgang Betz 132:51056160fa4a 852 * be explicitly terminated by the upper layer by issuing the command
Wolfgang Betz 132:51056160fa4a 853 * aci_gap_terminate_gap_procedure() with the procedure_code set to @ref GAP_DIRECT_CONNECTION_ESTABLISHMENT_PROC.
Wolfgang Betz 132:51056160fa4a 854 * @param scanInterval Time interval from when the Controller started its last LE scan until it begins
Wolfgang Betz 132:51056160fa4a 855 * the subsequent LE scan. The scan interval should be a number in the range
Wolfgang Betz 132:51056160fa4a 856 * 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec.
Wolfgang Betz 132:51056160fa4a 857 * For a number N, Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 858 * @param scanWindow Amount of time for the duration of the LE scan. Scan_Window shall be less than
Wolfgang Betz 132:51056160fa4a 859 * or equal to Scan_Interval. The scan window should be a number in the range
Wolfgang Betz 132:51056160fa4a 860 * 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec.
Wolfgang Betz 132:51056160fa4a 861 * For a number N, Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 862 * @param peer_bdaddr_type Type of the peer address (@ref PUBLIC_ADDR, @ref STATIC_RANDOM_ADDR).
Wolfgang Betz 132:51056160fa4a 863 * @param peer_bdaddr Address of the peer device with which a connection has to be established.
Wolfgang Betz 132:51056160fa4a 864 * @param own_bdaddr_type Type of our address used during advertising (PUBLIC_ADDR,STATIC_RANDOM_ADDR).
Wolfgang Betz 132:51056160fa4a 865 * @param conn_min_interval Minimum value for the connection event interval. This shall be less than or
Wolfgang Betz 132:51056160fa4a 866 * equal to Conn_Interval_Max.\n
Wolfgang Betz 132:51056160fa4a 867 * Range: 0x0006 to 0x0C80\n
Wolfgang Betz 132:51056160fa4a 868 * Time = N x 1.25 msec\n
Wolfgang Betz 132:51056160fa4a 869 * Time Range: 7.5 msec to 4 seconds
Wolfgang Betz 132:51056160fa4a 870 * @param conn_max_interval Maximum value for the connection event interval. This shall be greater than or
Wolfgang Betz 132:51056160fa4a 871 * equal to Conn_Interval_Min.\n
Wolfgang Betz 132:51056160fa4a 872 * Range: 0x0006 to 0x0C80\n
Wolfgang Betz 132:51056160fa4a 873 * Time = N x 1.25 msec\n
Wolfgang Betz 132:51056160fa4a 874 * Time Range: 7.5 msec to 4 seconds
Wolfgang Betz 132:51056160fa4a 875 * @param conn_latency Slave latency for the connection in number of connection events.\n
Wolfgang Betz 132:51056160fa4a 876 * Range: 0x0000 to 0x01F4
Wolfgang Betz 132:51056160fa4a 877 * @param supervision_timeout Supervision timeout for the LE Link.\n
Wolfgang Betz 132:51056160fa4a 878 * Range: 0x000A to 0x0C80\n
Wolfgang Betz 132:51056160fa4a 879 * Time = N x 10 msec\n
Wolfgang Betz 132:51056160fa4a 880 * Time Range: 100 msec to 32 seconds
Wolfgang Betz 132:51056160fa4a 881 * @param min_conn_length Minimum length of connection needed for the LE connection.\n
Wolfgang Betz 132:51056160fa4a 882 * Range: 0x0000 - 0xFFFF\n
Wolfgang Betz 132:51056160fa4a 883 * Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 884 * @param max_conn_length Maximum length of connection needed for the LE connection.\n
Wolfgang Betz 132:51056160fa4a 885 * Range: 0x0000 - 0xFFFF\n
Wolfgang Betz 132:51056160fa4a 886 * Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 887 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 888 */
Wolfgang Betz 132:51056160fa4a 889 tBleStatus aci_gap_create_connection(uint16_t scanInterval, uint16_t scanWindow,
Wolfgang Betz 132:51056160fa4a 890 uint8_t peer_bdaddr_type, tBDAddr peer_bdaddr,
Wolfgang Betz 132:51056160fa4a 891 uint8_t own_bdaddr_type, uint16_t conn_min_interval,
Wolfgang Betz 132:51056160fa4a 892 uint16_t conn_max_interval, uint16_t conn_latency,
Wolfgang Betz 132:51056160fa4a 893 uint16_t supervision_timeout, uint16_t min_conn_length,
Wolfgang Betz 132:51056160fa4a 894 uint16_t max_conn_length);
Wolfgang Betz 132:51056160fa4a 895
Wolfgang Betz 132:51056160fa4a 896 /**
Wolfgang Betz 132:51056160fa4a 897 * @brief Terminate the specified GATT procedure. @ref EVT_BLUE_GAP_PROCEDURE_COMPLETE event is
Wolfgang Betz 132:51056160fa4a 898 * returned with the procedure code set to the corresponding procedure.
Wolfgang Betz 132:51056160fa4a 899 * @param procedure_code One of the procedure codes (@ref gap_procedure_codes "GAP procedure codes").
Wolfgang Betz 132:51056160fa4a 900 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 901 */
Wolfgang Betz 132:51056160fa4a 902 tBleStatus aci_gap_terminate_gap_procedure(uint8_t procedure_code);
Wolfgang Betz 132:51056160fa4a 903
Wolfgang Betz 132:51056160fa4a 904 /**
Wolfgang Betz 132:51056160fa4a 905 * @brief Start the connection parameter update procedure.
Wolfgang Betz 132:51056160fa4a 906 * @note Allowed by the Central to update the connection parameter of the specified connection.
Wolfgang Betz 132:51056160fa4a 907 * A Link Layer Connection Update procedure is started on the controller.
Wolfgang Betz 132:51056160fa4a 908 * On completion of the procedure, a @ref EVT_LE_CONN_UPDATE_COMPLETE event is returned to
Wolfgang Betz 132:51056160fa4a 909 * the upper layer.
Wolfgang Betz 132:51056160fa4a 910 * @param conn_handle Handle of the connection for which the update procedure has to be started.
Wolfgang Betz 132:51056160fa4a 911 * @param conn_min_interval Minimum value for the connection event interval. This shall be less than or
Wolfgang Betz 132:51056160fa4a 912 * equal to Conn_Interval_Max.\n
Wolfgang Betz 132:51056160fa4a 913 * Range: 0x0006 to 0x0C80\n
Wolfgang Betz 132:51056160fa4a 914 * Time = N x 1.25 msec\n
Wolfgang Betz 132:51056160fa4a 915 * Time Range: 7.5 msec to 4 seconds
Wolfgang Betz 132:51056160fa4a 916 * @param conn_max_interval Maximum value for the connection event interval. This shall be greater than or
Wolfgang Betz 132:51056160fa4a 917 * equal to Conn_Interval_Min.\n
Wolfgang Betz 132:51056160fa4a 918 * Range: 0x0006 to 0x0C80\n
Wolfgang Betz 132:51056160fa4a 919 * Time = N x 1.25 msec\n
Wolfgang Betz 132:51056160fa4a 920 * Time Range: 7.5 msec to 4 seconds
Wolfgang Betz 132:51056160fa4a 921 * @param conn_latency Slave latency for the connection in number of connection events.\n
Wolfgang Betz 132:51056160fa4a 922 * Range: 0x0000 to 0x01F4
Wolfgang Betz 132:51056160fa4a 923 * @param supervision_timeout Supervision timeout for the LE Link.\n
Wolfgang Betz 132:51056160fa4a 924 * Range: 0x000A to 0x0C80\n
Wolfgang Betz 132:51056160fa4a 925 * Time = N x 10 msec\n
Wolfgang Betz 132:51056160fa4a 926 * Time Range: 100 msec to 32 seconds
Wolfgang Betz 132:51056160fa4a 927 * @param min_conn_length Minimum length of connection needed for the LE connection.\n
Wolfgang Betz 132:51056160fa4a 928 * Range: 0x0000 - 0xFFFF\n
Wolfgang Betz 132:51056160fa4a 929 * Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 930 * @param max_conn_length Maximum length of connection needed for the LE connection.\n
Wolfgang Betz 132:51056160fa4a 931 * Range: 0x0000 - 0xFFFF\n
Wolfgang Betz 132:51056160fa4a 932 * Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 933 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 934 */
Wolfgang Betz 132:51056160fa4a 935 tBleStatus aci_gap_start_connection_update(uint16_t conn_handle, uint16_t conn_min_interval,
Wolfgang Betz 132:51056160fa4a 936 uint16_t conn_max_interval, uint16_t conn_latency,
Wolfgang Betz 132:51056160fa4a 937 uint16_t supervision_timeout, uint16_t min_conn_length,
Wolfgang Betz 132:51056160fa4a 938 uint16_t max_conn_length);
Wolfgang Betz 132:51056160fa4a 939
Wolfgang Betz 132:51056160fa4a 940 /**
Wolfgang Betz 132:51056160fa4a 941 * @brief Send a pairing request.
Wolfgang Betz 132:51056160fa4a 942 * @note Send the SM pairing request to start a pairing process from a Central. The authentication
Wolfgang Betz 132:51056160fa4a 943 * requirements and IO capabilities should be set before issuing this command using
Wolfgang Betz 132:51056160fa4a 944 * aci_gap_set_io_capability() and aci_gap_set_auth_requirement().
Wolfgang Betz 132:51056160fa4a 945 * A @ref EVT_BLUE_GAP_PAIRING_CMPLT event is returned after the pairing process is completed.
Wolfgang Betz 132:51056160fa4a 946 * @param conn_handle Handle of the connection for which the pairing request has to be sent.
Wolfgang Betz 132:51056160fa4a 947 * @param force_rebond @arg 0x00: Pairing request is sent only if the device has not previously bonded
Wolfgang Betz 132:51056160fa4a 948 * @arg 0x01: Pairing request will be sent even if the device was previously bonded
Wolfgang Betz 132:51056160fa4a 949 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 950 */
Wolfgang Betz 132:51056160fa4a 951 tBleStatus aci_gap_send_pairing_request(uint16_t conn_handle, uint8_t force_rebond);
Wolfgang Betz 132:51056160fa4a 952
Wolfgang Betz 132:51056160fa4a 953 /**
Wolfgang Betz 132:51056160fa4a 954 * @brief Resolve a private address.
Wolfgang Betz 132:51056160fa4a 955 * @note This command tries to resolve the address provided with the IRKs present in its database. If
Wolfgang Betz 132:51056160fa4a 956 * the address is resolved successfully with any one of the IRKs present in the database, it
Wolfgang Betz 132:51056160fa4a 957 * returns success.
Wolfgang Betz 132:51056160fa4a 958 * @param address Address to be resolved.
Wolfgang Betz 132:51056160fa4a 959 * @param[in] actual_address The public or static random address of the peer device, distributed during pairing phase.
Wolfgang Betz 132:51056160fa4a 960 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 961 */
Wolfgang Betz 132:51056160fa4a 962 tBleStatus aci_gap_resolve_private_address_IDB05A1(const tBDAddr private_address, tBDAddr actual_address);
Wolfgang Betz 132:51056160fa4a 963
Wolfgang Betz 132:51056160fa4a 964 /**
Wolfgang Betz 132:51056160fa4a 965 * @brief Resolve a private address.
Wolfgang Betz 132:51056160fa4a 966 * @note This command tries to resolve the address provided with the IRKs present in its database. If
Wolfgang Betz 132:51056160fa4a 967 * the address is resolved successfully with any one of the IRKs present in the database, it
Wolfgang Betz 132:51056160fa4a 968 * returns success.
Wolfgang Betz 132:51056160fa4a 969 * @param address Address to be resolved.
Wolfgang Betz 132:51056160fa4a 970 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 971 */
Wolfgang Betz 132:51056160fa4a 972 tBleStatus aci_gap_resolve_private_address_IDB04A1(const tBDAddr private_address);
Wolfgang Betz 132:51056160fa4a 973
Wolfgang Betz 132:51056160fa4a 974 /**
Wolfgang Betz 132:51056160fa4a 975 * @brief This command gets the list of bonded devices.
Wolfgang Betz 132:51056160fa4a 976 * @note It returns the number of addresses and the corresponding address types and values.
Wolfgang Betz 132:51056160fa4a 977 * Example:
Wolfgang Betz 132:51056160fa4a 978 * @code
Wolfgang Betz 132:51056160fa4a 979 * tBleStatus ret;
Wolfgang Betz 132:51056160fa4a 980 * uint8_t num_devices = 0;
Wolfgang Betz 132:51056160fa4a 981 * uint8_t device_list[12*7];
Wolfgang Betz 132:51056160fa4a 982 * ret = aci_gap_get_bonded_devices(&num_devices, device_list, sizeof(device_list));
Wolfgang Betz 132:51056160fa4a 983 * for(int i = 0; i < num_devices; i+=7){
Wolfgang Betz 132:51056160fa4a 984 * uint8_t addr_type = device_list[i];
Wolfgang Betz 132:51056160fa4a 985 * uint8_t addr = device_list[i+1];
Wolfgang Betz 132:51056160fa4a 986 * printf("Type: %d, Addr: %02X%02X%02X%02X%02X%02X\n",addr_type,addr[5],addr[4],addr[3],addr[2],addr[1],addr[0]);
Wolfgang Betz 132:51056160fa4a 987 * }
Wolfgang Betz 132:51056160fa4a 988 * @endcode
Wolfgang Betz 132:51056160fa4a 989 *
Wolfgang Betz 132:51056160fa4a 990 * @param[in] num_devices The number of bonded devices.
Wolfgang Betz 132:51056160fa4a 991 * @param[in] device_list List of addresses. It contains a sequence of [address type, address] pairs, where address
Wolfgang Betz 132:51056160fa4a 992 * type can be @ref PUBLIC_ADDR or @arg @ref STATIC_RANDOM_ADDR.
Wolfgang Betz 132:51056160fa4a 993 * @param device_list_size Maximum size of the device_list buffer used to return the device list.
Wolfgang Betz 132:51056160fa4a 994 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 995 */
Wolfgang Betz 132:51056160fa4a 996 tBleStatus aci_gap_get_bonded_devices(uint8_t *num_devices, uint8_t *device_list, uint8_t device_list_size);
Wolfgang Betz 132:51056160fa4a 997
Wolfgang Betz 132:51056160fa4a 998 /**
Wolfgang Betz 132:51056160fa4a 999 * @brief Puts the device into broadcast mode
Wolfgang Betz 132:51056160fa4a 1000 * @note A privacy enabled device uses either a resolvable private address or a non-resolvable private address
Wolfgang Betz 132:51056160fa4a 1001 * as specified in the own_addr_type parameter of the command.
Wolfgang Betz 132:51056160fa4a 1002 * @param adv_interv_min Minimum advertising interval.
Wolfgang Betz 132:51056160fa4a 1003 * Range: 0x00A0 to 0x4000
Wolfgang Betz 132:51056160fa4a 1004 * Time = N * 0.625 msec
Wolfgang Betz 132:51056160fa4a 1005 * Time Range: 100 ms to 10.24 sec
Wolfgang Betz 132:51056160fa4a 1006 * @param adv_interv_max Maximum advertising interval.
Wolfgang Betz 132:51056160fa4a 1007 * Range: 0x00A0 to 0x4000
Wolfgang Betz 132:51056160fa4a 1008 * Time = N * 0.625 msec
Wolfgang Betz 132:51056160fa4a 1009 * Time Range: 100 ms to 10.24 sec
Wolfgang Betz 132:51056160fa4a 1010 * @param adv_type One of the allowed advertising types:
Wolfgang Betz 132:51056160fa4a 1011 * @arg @ref ADV_SCAN_IND Scannable undirected advertising
Wolfgang Betz 132:51056160fa4a 1012 * @arg @ref ADV_NONCONN_IND Non connectable undirected advertising
Wolfgang Betz 132:51056160fa4a 1013 * @param own_address_type If Privacy is disabled, the broadcaster address can be
Wolfgang Betz 132:51056160fa4a 1014 * @arg @ref PUBLIC_ADDR.
Wolfgang Betz 132:51056160fa4a 1015 * @arg @ref STATIC_RANDOM_ADDR.
Wolfgang Betz 132:51056160fa4a 1016 * If Privacy is enabled, then the broadcaster address can be
Wolfgang Betz 132:51056160fa4a 1017 * @arg @ref RESOLVABLE_PRIVATE_ADDR
Wolfgang Betz 132:51056160fa4a 1018 * @arg @ref NON_RESOLVABLE_PRIVATE_ADDR
Wolfgang Betz 132:51056160fa4a 1019 * @param adv_data_length Length of the advertising data in the advertising packet
Wolfgang Betz 132:51056160fa4a 1020 * @param adv_data Advertising data used by the device while advertising
Wolfgang Betz 132:51056160fa4a 1021 * @param num_whitelist_entries Number of devices to be added to whitelist
Wolfgang Betz 132:51056160fa4a 1022 * @param addr_array It will contain the addresses that have to be added into the whitelist. The
Wolfgang Betz 132:51056160fa4a 1023 * format of the addr_array should be: address type followed by address.
Wolfgang Betz 132:51056160fa4a 1024 * Example:
Wolfgang Betz 132:51056160fa4a 1025 * @code
Wolfgang Betz 132:51056160fa4a 1026 * uint8_t addr_array[] = {PUBLIC_ADDR,0x01,0x00,0x00,0xe1,0x80,0x02,
Wolfgang Betz 132:51056160fa4a 1027 * PUBLIC_ADDR,0x02,0x00,0x00,0xe1,0x80,0x02};
Wolfgang Betz 132:51056160fa4a 1028 * @endcode
Wolfgang Betz 132:51056160fa4a 1029 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 1030 */
Wolfgang Betz 132:51056160fa4a 1031 tBleStatus aci_gap_set_broadcast_mode_IDB05A1(uint16_t adv_interv_min, uint16_t adv_interv_max, uint8_t adv_type,
Wolfgang Betz 132:51056160fa4a 1032 uint8_t own_addr_type, uint8_t adv_data_length, const uint8_t *adv_data, uint8_t num_whitelist_entries,
Wolfgang Betz 132:51056160fa4a 1033 const uint8_t *addr_array);
Wolfgang Betz 132:51056160fa4a 1034
Wolfgang Betz 132:51056160fa4a 1035 /**
Wolfgang Betz 132:51056160fa4a 1036 * @brief Starts an observation procedure, when the device is in Observer role.
Wolfgang Betz 132:51056160fa4a 1037 * @note The host enables scanning in the controller. The advertising reports are sent to the upper layer
Wolfgang Betz 132:51056160fa4a 1038 * using standard @ref EVT_LE_ADVERTISING_REPORT subevent in @ref EVT_LE_META_EVENT. See Bluetooth
Wolfgang Betz 132:51056160fa4a 1039 * Core v4.0, Vol. 2, part E, Ch. 7.7.65.2, LE Advertising Report Event.
Wolfgang Betz 132:51056160fa4a 1040 * @param scan_interval Time interval from when the Controller started its last LE scan until it begins the subsequent LE scan.
Wolfgang Betz 132:51056160fa4a 1041 * The scan interval should be a number in the range 0x0004 to 0x4000. This corresponds to a time range from 2.5 msec
Wolfgang Betz 132:51056160fa4a 1042 * to 10240 msec. For a number N, Time = N * 0.625 msec.
Wolfgang Betz 132:51056160fa4a 1043 * @param scan_window Amount of time for the duration of the LE scan. scan_window shall be less than or equal to scan_interval.
Wolfgang Betz 132:51056160fa4a 1044 * The scan window should be a number in the range 0x0004 to 0x4000. This corresponds to a time range from 2.5 msec
Wolfgang Betz 132:51056160fa4a 1045 * to 10240 msec. For a number N, Time = N * 0.625 msec.
Wolfgang Betz 132:51056160fa4a 1046 * @param scan_type Passive or active scanning (@ref PASSIVE_SCAN, @ref ACTIVE_SCAN)
Wolfgang Betz 132:51056160fa4a 1047 * @param own_address_type If Privacy is disabled, then the scanner address can be
Wolfgang Betz 132:51056160fa4a 1048 * @arg @ref PUBLIC_ADDR.
Wolfgang Betz 132:51056160fa4a 1049 * @arg @ref STATIC_RANDOM_ADDR.
Wolfgang Betz 132:51056160fa4a 1050 * If Privacy is enabled, then the scanner address can be
Wolfgang Betz 132:51056160fa4a 1051 * @arg @ref RESOLVABLE_PRIVATE_ADDR
Wolfgang Betz 132:51056160fa4a 1052 * @arg @ref NON_RESOLVABLE_PRIVATE_ADDR
Wolfgang Betz 132:51056160fa4a 1053 * @param filter_duplicates Duplicate filtering enabled or not.
Wolfgang Betz 132:51056160fa4a 1054 * @arg 0x00: Do not filter the duplicates
Wolfgang Betz 132:51056160fa4a 1055 * @arg 0x01: Filter duplicates
Wolfgang Betz 132:51056160fa4a 1056 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 1057 */
Wolfgang Betz 132:51056160fa4a 1058 tBleStatus aci_gap_start_observation_procedure_IDB05A1(uint16_t scan_interval, uint16_t scan_window, uint8_t scan_type,
Wolfgang Betz 132:51056160fa4a 1059 uint8_t own_address_type, uint8_t filter_duplicates);
Wolfgang Betz 132:51056160fa4a 1060
Wolfgang Betz 132:51056160fa4a 1061 /**
Wolfgang Betz 132:51056160fa4a 1062 * @brief The command finds whether a device is bonded.
Wolfgang Betz 132:51056160fa4a 1063 * @note If the device is using a resolvable private address and it has been bonded, then the command will return
Wolfgang Betz 132:51056160fa4a 1064 * BLE_STATUS_SUCCESS.
Wolfgang Betz 132:51056160fa4a 1065 * @param peer_address_type The address type of the peer device
Wolfgang Betz 132:51056160fa4a 1066 * @arg @ref PUBLIC_ADDR.
Wolfgang Betz 132:51056160fa4a 1067 * @arg @ref RANDOM_ADDR.
Wolfgang Betz 132:51056160fa4a 1068 * @param peer_address Address used by the peer device while advertising.
Wolfgang Betz 132:51056160fa4a 1069 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 1070 */
Wolfgang Betz 132:51056160fa4a 1071 tBleStatus aci_gap_is_device_bonded_IDB05A1(uint8_t peer_address_type, const tBDAddr peer_address);
Wolfgang Betz 132:51056160fa4a 1072
Wolfgang Betz 132:51056160fa4a 1073
Wolfgang Betz 132:51056160fa4a 1074 /**
Wolfgang Betz 132:51056160fa4a 1075 * @}
Wolfgang Betz 132:51056160fa4a 1076 */
Wolfgang Betz 132:51056160fa4a 1077
Wolfgang Betz 132:51056160fa4a 1078 /**
Wolfgang Betz 132:51056160fa4a 1079 * @defgroup GAP_Events GAP events
Wolfgang Betz 132:51056160fa4a 1080 * @{
Wolfgang Betz 132:51056160fa4a 1081 */
Wolfgang Betz 132:51056160fa4a 1082
Wolfgang Betz 132:51056160fa4a 1083 /**
Wolfgang Betz 132:51056160fa4a 1084 * This event is generated by the controller when the limited discoverable
Wolfgang Betz 132:51056160fa4a 1085 * mode ends due to timeout (180 seconds). No parameters in the event.
Wolfgang Betz 132:51056160fa4a 1086 */
Wolfgang Betz 132:51056160fa4a 1087 #define EVT_BLUE_GAP_LIMITED_DISCOVERABLE (0x0400)
Wolfgang Betz 132:51056160fa4a 1088
Wolfgang Betz 132:51056160fa4a 1089
Wolfgang Betz 132:51056160fa4a 1090 /**
Wolfgang Betz 132:51056160fa4a 1091 * This event is generated when the pairing process has completed successfully
Wolfgang Betz 132:51056160fa4a 1092 * or a pairing procedure timeout has occurred or the pairing has failed.
Wolfgang Betz 132:51056160fa4a 1093 * This is to notify the application that we have paired with a remote device
Wolfgang Betz 132:51056160fa4a 1094 * so that it can take further actions or to notify that a timeout has occurred
Wolfgang Betz 132:51056160fa4a 1095 * so that the upper layer can decide to disconnect the link. See @ref _evt_gap_pairing_cmplt.
Wolfgang Betz 132:51056160fa4a 1096 */
Wolfgang Betz 132:51056160fa4a 1097 #define EVT_BLUE_GAP_PAIRING_CMPLT (0x0401)
Wolfgang Betz 132:51056160fa4a 1098 typedef __packed struct _evt_gap_pairing_cmplt{
Wolfgang Betz 132:51056160fa4a 1099 uint16_t conn_handle; /**< Connection handle on which the pairing procedure completed */
Wolfgang Betz 132:51056160fa4a 1100 /**
Wolfgang Betz 132:51056160fa4a 1101 * 0x00: Pairing Success. Pairing with a remote device was successful\n
Wolfgang Betz 132:51056160fa4a 1102 * 0x01: Pairing Timeout. The SMP timeout has elapsed and no further SMP commands will be processed until reconnection\n
Wolfgang Betz 132:51056160fa4a 1103 * 0x02: Pairing Failed. The pairing failed with the remote device.
Wolfgang Betz 132:51056160fa4a 1104 */
Wolfgang Betz 132:51056160fa4a 1105 uint8_t status;
Wolfgang Betz 132:51056160fa4a 1106 } PACKED evt_gap_pairing_cmplt;
Wolfgang Betz 132:51056160fa4a 1107
Wolfgang Betz 132:51056160fa4a 1108
Wolfgang Betz 132:51056160fa4a 1109 /**
Wolfgang Betz 132:51056160fa4a 1110 * This event is generated by the Security manager to the application when a pass key is required for pairing.
Wolfgang Betz 132:51056160fa4a 1111 * When this event is received, the application has to respond with the aci_gap_pass_key_response() command.
Wolfgang Betz 132:51056160fa4a 1112 * See @ref _evt_gap_pass_key_req.
Wolfgang Betz 132:51056160fa4a 1113 */
Wolfgang Betz 132:51056160fa4a 1114 #define EVT_BLUE_GAP_PASS_KEY_REQUEST (0x0402)
Wolfgang Betz 132:51056160fa4a 1115 typedef __packed struct _evt_gap_pass_key_req{
Wolfgang Betz 132:51056160fa4a 1116 uint16_t conn_handle; /**< Connection handle for which the passkey has been requested. */
Wolfgang Betz 132:51056160fa4a 1117 } PACKED evt_gap_pass_key_req;
Wolfgang Betz 132:51056160fa4a 1118
Wolfgang Betz 132:51056160fa4a 1119
Wolfgang Betz 132:51056160fa4a 1120 /**
Wolfgang Betz 132:51056160fa4a 1121 * This event is generated by the Security manager to the application when the application
Wolfgang Betz 132:51056160fa4a 1122 * has set that authorization is required for reading/writing of attributes. This event will
Wolfgang Betz 132:51056160fa4a 1123 * be generated as soon as the pairing is complete. When this event is received,
Wolfgang Betz 132:51056160fa4a 1124 * aci_gap_authorization_response() command should be used by the application.
Wolfgang Betz 132:51056160fa4a 1125 * See @ref _evt_gap_author_req.
Wolfgang Betz 132:51056160fa4a 1126 */
Wolfgang Betz 132:51056160fa4a 1127 #define EVT_BLUE_GAP_AUTHORIZATION_REQUEST (0x0403)
Wolfgang Betz 132:51056160fa4a 1128 typedef __packed struct _evt_gap_author_req{
Wolfgang Betz 132:51056160fa4a 1129 uint16_t conn_handle; /**< Connection handle for which authorization has been requested. */
Wolfgang Betz 132:51056160fa4a 1130 } PACKED evt_gap_author_req;
Wolfgang Betz 132:51056160fa4a 1131
Wolfgang Betz 132:51056160fa4a 1132 /**
Wolfgang Betz 132:51056160fa4a 1133 * This event is generated when the slave security request is successfully sent to the master.
Wolfgang Betz 132:51056160fa4a 1134 * No parameters for this event.
Wolfgang Betz 132:51056160fa4a 1135 */
Wolfgang Betz 132:51056160fa4a 1136 #define EVT_BLUE_GAP_SLAVE_SECURITY_INITIATED (0X0404)
Wolfgang Betz 132:51056160fa4a 1137
Wolfgang Betz 132:51056160fa4a 1138 /**
Wolfgang Betz 132:51056160fa4a 1139 * This event is generated when a pairing request is issued in response to a slave security
Wolfgang Betz 132:51056160fa4a 1140 * request from a master which has previously bonded with the slave. When this event is received,
Wolfgang Betz 132:51056160fa4a 1141 * the upper layer has to issue the command aci_gap_allow_rebond() in order to allow the slave
Wolfgang Betz 132:51056160fa4a 1142 * to continue the pairing process with the master. No parameters for this event
Wolfgang Betz 132:51056160fa4a 1143 */
Wolfgang Betz 132:51056160fa4a 1144 #define EVT_BLUE_GAP_BOND_LOST (0X0405)
Wolfgang Betz 132:51056160fa4a 1145
Wolfgang Betz 132:51056160fa4a 1146 /**
Wolfgang Betz 132:51056160fa4a 1147 * The event is given by the GAP layer to the upper layers when a device is discovered during scanning
Wolfgang Betz 132:51056160fa4a 1148 * as a consequence of one of the GAP procedures started by the upper layers. See @ref _evt_gap_device_found.
Wolfgang Betz 132:51056160fa4a 1149 */
Wolfgang Betz 132:51056160fa4a 1150 #define EVT_BLUE_GAP_DEVICE_FOUND (0x0406)
Wolfgang Betz 132:51056160fa4a 1151 typedef __packed struct _evt_gap_device_found{
Wolfgang Betz 132:51056160fa4a 1152 uint8_t evt_type; /**< Type of event (@ref ADV_IND, @ref ADV_DIRECT_IND, @ref ADV_SCAN_IND, @ref ADV_NONCONN_IND, @ref SCAN_RSP) */
Wolfgang Betz 132:51056160fa4a 1153 uint8_t bdaddr_type; /**< Type of the peer address (@ref PUBLIC_ADDR, @ref RANDOM_ADDR). */
Wolfgang Betz 132:51056160fa4a 1154 tBDAddr bdaddr; /**< Address of the peer device found during scanning. */
Wolfgang Betz 132:51056160fa4a 1155 uint8_t data_length; /**< Length of advertising or scan response data. */
Wolfgang Betz 132:51056160fa4a 1156 uint8_t data_RSSI[VARIABLE_SIZE]; /**< Advertising or scan response data + RSSI. RSSI is last octect (signed integer). */
Wolfgang Betz 132:51056160fa4a 1157 } PACKED evt_gap_device_found;
Wolfgang Betz 132:51056160fa4a 1158
Wolfgang Betz 132:51056160fa4a 1159 /**
Wolfgang Betz 132:51056160fa4a 1160 * This event is sent by the GAP to the upper layers when a procedure previously started has been terminated
Wolfgang Betz 132:51056160fa4a 1161 * by the upper layer or has completed for any other reason. See @ref _evt_gap_procedure_complete.
Wolfgang Betz 132:51056160fa4a 1162 */
Wolfgang Betz 132:51056160fa4a 1163 #define EVT_BLUE_GAP_PROCEDURE_COMPLETE (0x0407)
Wolfgang Betz 132:51056160fa4a 1164 typedef __packed struct _evt_gap_procedure_complete{
Wolfgang Betz 132:51056160fa4a 1165 uint8_t procedure_code; /**< Terminated procedure. See @ref gap_procedure_codes "GAP procedure codes". */
Wolfgang Betz 132:51056160fa4a 1166 /**
Wolfgang Betz 132:51056160fa4a 1167 * @ref BLE_STATUS_SUCCESS, @ref BLE_STATUS_FAILED or @ref ERR_AUTH_FAILURE (procedure failed
Wolfgang Betz 132:51056160fa4a 1168 * due to authentication requirements).
Wolfgang Betz 132:51056160fa4a 1169 */
Wolfgang Betz 132:51056160fa4a 1170 uint8_t status;
Wolfgang Betz 132:51056160fa4a 1171 /**
Wolfgang Betz 132:51056160fa4a 1172 * Procedure specific data.\n
Wolfgang Betz 132:51056160fa4a 1173 * @li For Name Discovery Procedure:\n
Wolfgang Betz 132:51056160fa4a 1174 * the name of the peer device if the procedure completed successfully.
Wolfgang Betz 132:51056160fa4a 1175 * @li For General Connection Establishment Procedure:\n
Wolfgang Betz 132:51056160fa4a 1176 * The reconnection address written to the peripheral device if the peripheral is privacy enabled
Wolfgang Betz 132:51056160fa4a 1177 */
Wolfgang Betz 132:51056160fa4a 1178 uint8_t data[VARIABLE_SIZE];
Wolfgang Betz 132:51056160fa4a 1179 } PACKED evt_gap_procedure_complete;
Wolfgang Betz 132:51056160fa4a 1180
Wolfgang Betz 132:51056160fa4a 1181 /**
Wolfgang Betz 132:51056160fa4a 1182 * This event is sent only by a privacy enabled Peripheral. The event is sent to the upper layers when the peripheral
Wolfgang Betz 132:51056160fa4a 1183 * is not able to resolve the private address of the peer device after connecting to it.
Wolfgang Betz 132:51056160fa4a 1184 */
Wolfgang Betz 132:51056160fa4a 1185 #define EVT_BLUE_GAP_ADDR_NOT_RESOLVED_IDB05A1 (0x0408)
Wolfgang Betz 132:51056160fa4a 1186 typedef __packed struct _evt_gap_addr_not_resolved_IDB05A1{
Wolfgang Betz 132:51056160fa4a 1187 uint16_t conn_handle; /**< Connection handle for which the private address could not be resolved with any of the stored IRK's. */
Wolfgang Betz 132:51056160fa4a 1188 } PACKED evt_gap_addr_not_resolved_IDB05A1;
Wolfgang Betz 132:51056160fa4a 1189 /**
Wolfgang Betz 132:51056160fa4a 1190 * This event is raised when the reconnection address is generated during the general connection
Wolfgang Betz 132:51056160fa4a 1191 * establishment procedure. The same address is set into the peer device also as a part of the general
Wolfgang Betz 132:51056160fa4a 1192 * connection establishment procedure. In order to make use of the reconnection address the next time
Wolfgang Betz 132:51056160fa4a 1193 * while connecting to the bonded peripheral, the application needs to use this reconnection address
Wolfgang Betz 132:51056160fa4a 1194 * as its own address as well as the peer address to which it wants to connect. See aci_gap_start_general_conn_establish_proc()
Wolfgang Betz 132:51056160fa4a 1195 * and aci_gap_start_auto_conn_establish_proc().
Wolfgang Betz 132:51056160fa4a 1196 */
Wolfgang Betz 132:51056160fa4a 1197 #define EVT_BLUE_GAP_RECONNECTION_ADDRESS_IDB04A1 (0x0408)
Wolfgang Betz 132:51056160fa4a 1198 typedef __packed struct _evt_gap_reconnection_addr_IDB04A1{
Wolfgang Betz 132:51056160fa4a 1199 uint8_t reconnection_address[6]; /**< 6 bytes of reconnection address that has been generated */
Wolfgang Betz 132:51056160fa4a 1200 } PACKED evt_gap_reconnection_addr_IDB04A1;
Wolfgang Betz 132:51056160fa4a 1201
Wolfgang Betz 132:51056160fa4a 1202 /**
Wolfgang Betz 132:51056160fa4a 1203 * @}
Wolfgang Betz 132:51056160fa4a 1204 */
Wolfgang Betz 132:51056160fa4a 1205
Wolfgang Betz 132:51056160fa4a 1206 /**
Wolfgang Betz 132:51056160fa4a 1207 * @}
Wolfgang Betz 132:51056160fa4a 1208 */
Wolfgang Betz 132:51056160fa4a 1209
Wolfgang Betz 132:51056160fa4a 1210
Wolfgang Betz 132:51056160fa4a 1211 #endif /* __BLUENRG_GAP_ACI_H__ */