Mistake on this page? Email us
dm_api.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Device Manager subsystem API.
6  *
7  * Copyright (c) 2016-2019 Arm Ltd. All Rights Reserved.
8  * Arm Ltd. confidential and proprietary.
9  *
10  * IMPORTANT. Your use of this file is governed by a Software License Agreement
11  * ("Agreement") that must be accepted in order to download or otherwise receive a
12  * copy of this file. You may not use or copy this file for any purpose other than
13  * as described in the Agreement. If you do not agree to all of the terms of the
14  * Agreement do not use this file and delete all copies in your possession or control;
15  * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior
16  * to any use, copying or further distribution of this software.
17  */
18 /*************************************************************************************************/
19 #ifndef DM_API_H
20 #define DM_API_H
21 
22 #include "hci_api.h"
23 #include "cfg_stack.h"
24 #include "smp_defs.h"
25 #include "sec_api.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 /*! \addtogroup STACK_DM_API
32  * \{ */
33 
34 /**************************************************************************************************
35  Macros
36 **************************************************************************************************/
37 
38 /** \name GAP Device Role
39  * Connectable GAP Roles.
40  */
41 /**@{*/
42 #define DM_ROLE_MASTER HCI_ROLE_MASTER /*!< \brief Role is master */
43 #define DM_ROLE_SLAVE HCI_ROLE_SLAVE /*!< \brief Role is slave */
44 /**@}*/
45 
46 /** \name GAP Discovery Mode
47  * When setup as a discoverable device, these are the possible modes of discovery.
48  */
49 /**@{*/
50 #define DM_DISC_MODE_NONE 0 /*!< \brief GAP non-discoverable */
51 #define DM_DISC_MODE_LIMITED 1 /*!< \brief GAP limited discoverable mode */
52 #define DM_DISC_MODE_GENERAL 2 /*!< \brief GAP general discoverable mode */
53 /**@}*/
54 
55 /** \name GAP Advertising Type
56  * Type of connectable or disconverable advertising to perform.
57  */
58 /**@{*/
59 #define DM_ADV_CONN_UNDIRECT 0 /*!< \brief Connectable and scannable undirected advertising */
60 #define DM_ADV_CONN_DIRECT 1 /*!< \brief Connectable directed advertising */
61 #define DM_ADV_SCAN_UNDIRECT 2 /*!< \brief Scannable undirected advertising */
62 #define DM_ADV_NONCONN_UNDIRECT 3 /*!< \brief Non-connectable and non-scannable undirected advertising */
63 #define DM_ADV_CONN_DIRECT_LO_DUTY 4 /*!< \brief Connectable directed low duty cycle advertising */
64 /**@}*/
65 
66 /** \name GAP AE Advertising Types
67  * Advertising extension types - AE only.
68  */
69 /**@{*/
70 #define DM_EXT_ADV_CONN_UNDIRECT 5 /*!< \brief Connectable undirected advertising */
71 #define DM_EXT_ADV_NONCONN_DIRECT 6 /*!< \brief Non-connectable and non-scannable directed advertising */
72 #define DM_EXT_ADV_SCAN_DIRECT 7 /*!< \brief Scannable directed advertising */
73 #define DM_ADV_NONE 255 /*!< \brief For internal use only */
74 /**@}*/
75 
76 /** \name GAP Advertising Report Type
77  * Type of an advertising report observed while scanning.
78  */
79 /**@{*/
80 #define DM_RPT_CONN_UNDIRECT 0 /*!< \brief Connectable and scannable undirected advertising */
81 #define DM_RPT_CONN_DIRECT 1 /*!< \brief Connectable directed advertising */
82 #define DM_RPT_SCAN_UNDIRECT 2 /*!< \brief Scannable undirected advertising */
83 #define DM_RPT_NONCONN_UNDIRECT 3 /*!< \brief Non-connectable undirected advertising */
84 #define DM_RPT_SCAN_RESPONSE 4 /*!< \brief Scan response */
85 /**@}*/
86 
87 /** \name GAP Advertising Data Location
88  * Whether data is located in the advertising data or in the scan response data
89  */
90 /**@{*/
91 #define DM_DATA_LOC_ADV 0 /*!< \brief Locate data in the advertising data */
92 #define DM_DATA_LOC_SCAN 1 /*!< \brief Locate data in the scan response data */
93 /**@}*/
94 
95 /** \name GAP Scan Type
96  * When setup as a connectable or observer device, this is the type of scanning to perform.
97  */
98 /**@{*/
99 #define DM_SCAN_TYPE_PASSIVE 0 /*!< \brief Passive scan */
100 #define DM_SCAN_TYPE_ACTIVE 1 /*!< \brief Active scan */
101 /**@}*/
102 
103 /** \name GAP Advertising Channel Map
104  * Advertising channel map codes
105  */
106 /**@{*/
107 #define DM_ADV_CHAN_37 HCI_ADV_CHAN_37 /*!< \brief Advertising channel 37 */
108 #define DM_ADV_CHAN_38 HCI_ADV_CHAN_38 /*!< \brief Advertising channel 38 */
109 #define DM_ADV_CHAN_39 HCI_ADV_CHAN_39 /*!< \brief Advertising channel 39 */
110 /*! \brief All advertising channels */
111 #define DM_ADV_CHAN_ALL (HCI_ADV_CHAN_37 | HCI_ADV_CHAN_38 | HCI_ADV_CHAN_39)
112 /**@}*/
113 
114 /** \name DM Client IDs
115  * The client ID parameter to function DmConnRegister()
116  */
117 /**@{*/
118 #define DM_CLIENT_ID_ATT 0 /*!< \brief Identifier for attribute protocol, for internal use only */
119 #define DM_CLIENT_ID_SMP 1 /*!< \brief Identifier for security manager protocol, for internal use only */
120 #define DM_CLIENT_ID_DM 2 /*!< \brief Identifier for device manager, for internal use only */
121 #define DM_CLIENT_ID_APP 3 /*!< \brief Identifier for the application */
122 #define DM_CLIENT_ID_L2C 4 /*!< \brief Identifier for L2CAP */
123 #define DM_CLIENT_ID_MAX 5 /*!< \brief For internal use only */
124 /**@}*/
125 
126 /** \name DM Unknown IDs
127  * Values for unknown or unspecificed device identifiers.
128  */
129 /**@{*/
130 /*! \brief Unknown connection ID or other error */
131 #define DM_CONN_ID_NONE 0
132 
133 /*! \brief Unknown sync ID or other error */
134 #define DM_SYNC_ID_NONE 0
135 /**@}*/
136 
137 /** \name GAP Address Type
138  * The address type to use over the air or that is associated with a received address.
139  */
140 /**@{*/
141 #define DM_ADDR_PUBLIC 0x00 /*!< \brief Public device address */
142 #define DM_ADDR_RANDOM 0x01 /*!< \brief Random device address */
143 #define DM_ADDR_PUBLIC_IDENTITY 0x02 /*!< \brief Public identity address (corresponds to resolved private address) */
144 #define DM_ADDR_RANDOM_IDENTITY 0x03 /*!< \brief Random (static) identity address (corresponds to resolved private address) */
145 #define DM_ADDR_RANDOM_UNRESOLVED 0xFE /*!< \brief Random device address (Controller unable to resolve) */
146 #define DM_ADDR_NONE 0xFF /*!< \brief No address provided (anonymous) */
147 /**@}*/
148 
149 /** \name GAP Advertising Data Types
150  * Advertising data types flags.
151  */
152 /**@{*/
153 #define DM_ADV_TYPE_FLAGS 0x01 /*!< \brief Flag bits */
154 #define DM_ADV_TYPE_16_UUID_PART 0x02 /*!< \brief Partial list of 16 bit UUIDs */
155 #define DM_ADV_TYPE_16_UUID 0x03 /*!< \brief Complete list of 16 bit UUIDs */
156 #define DM_ADV_TYPE_32_UUID_PART 0x04 /*!< \brief Partial list of 32 bit UUIDs */
157 #define DM_ADV_TYPE_32_UUID 0x05 /*!< \brief Complete list of 32 bit UUIDs */
158 #define DM_ADV_TYPE_128_UUID_PART 0x06 /*!< \brief Partial list of 128 bit UUIDs */
159 #define DM_ADV_TYPE_128_UUID 0x07 /*!< \brief Complete list of 128 bit UUIDs */
160 #define DM_ADV_TYPE_SHORT_NAME 0x08 /*!< \brief Shortened local name */
161 #define DM_ADV_TYPE_LOCAL_NAME 0x09 /*!< \brief Complete local name */
162 #define DM_ADV_TYPE_TX_POWER 0x0A /*!< \brief TX power level */
163 #define DM_ADV_TYPE_SM_TK_VALUE 0x10 /*!< \brief Security manager TK value */
164 #define DM_ADV_TYPE_SM_OOB_FLAGS 0x11 /*!< \brief Security manager OOB flags */
165 #define DM_ADV_TYPE_CONN_INTERVAL 0x12 /*!< \brief Slave preferred connection interval */
166 #define DM_ADV_TYPE_SIGNED_DATA 0x13 /*!< \brief Signed data */
167 #define DM_ADV_TYPE_16_SOLICIT 0x14 /*!< \brief Service soliticiation list of 16 bit UUIDs */
168 #define DM_ADV_TYPE_128_SOLICIT 0x15 /*!< \brief Service soliticiation list of 128 bit UUIDs */
169 #define DM_ADV_TYPE_SERVICE_DATA 0x16 /*!< \brief Service data - 16-bit UUID */
170 #define DM_ADV_TYPE_PUBLIC_TARGET 0x17 /*!< \brief Public target address */
171 #define DM_ADV_TYPE_RANDOM_TARGET 0x18 /*!< \brief Random target address */
172 #define DM_ADV_TYPE_APPEARANCE 0x19 /*!< \brief Device appearance */
173 #define DM_ADV_TYPE_ADV_INTERVAL 0x1A /*!< \brief Advertising interval */
174 #define DM_ADV_TYPE_BD_ADDR 0x1B /*!< \brief LE Bluetooth device address */
175 #define DM_ADV_TYPE_ROLE 0x1C /*!< \brief LE role */
176 #define DM_ADV_TYPE_32_SOLICIT 0x1F /*!< \brief Service soliticiation list of 32 bit UUIDs */
177 #define DM_ADV_TYPE_SVC_DATA_32 0x20 /*!< \brief Service data - 32-bit UUID */
178 #define DM_ADV_TYPE_SVC_DATA_128 0x21 /*!< \brief Service data - 128-bit UUID */
179 #define DM_ADV_TYPE_LESC_CONFIRM 0x22 /*!< \brief LE Secure Connections confirm value */
180 #define DM_ADV_TYPE_LESC_RANDOM 0x23 /*!< \brief LE Secure Connections random value */
181 #define DM_ADV_TYPE_URI 0x24 /*!< \brief URI */
182 #define DM_ADV_TYPE_MANUFACTURER 0xFF /*!< \brief Manufacturer specific data */
183 /**@}*/
184 
185 /** \name GAP Advertising Data Flag Advertising Type
186  * Bit mask for Advertising Type flag in advertising data.
187  */
188 /**@{*/
189 #define DM_FLAG_LE_LIMITED_DISC 0x01 /*!< \brief Limited discoverable flag */
190 #define DM_FLAG_LE_GENERAL_DISC 0x02 /*!< \brief General discoverable flag */
191 #define DM_FLAG_LE_BREDR_NOT_SUP 0x04 /*!< \brief BR/EDR not supported flag */
192 /**@}*/
193 
194 /** \name GAP Advertising Data Element Indexes
195  * Advertising data element indexes.
196  */
197 /**@{*/
198 #define DM_AD_LEN_IDX 0 /*!< \brief Advertising data element len */
199 #define DM_AD_TYPE_IDX 1 /*!< \brief Advertising data element type */
200 #define DM_AD_DATA_IDX 2 /*!< \brief Advertising data element data */
201 /**@}*/
202 
203 /** \name GAP Advertising URI
204  * Advertising URI Scheme
205  */
206 /**@{*/
207 #define DM_URI_SCHEME_HTTP 0x16 /*!< \brief URI HTTP Scheme */
208 #define DM_URI_SCHEME_HTTPS 0x17 /*!< \brief URI HTTPS Scheme */
209 /**@}*/
210 
211 /** \name GAP Timeouts
212  * Timeouts defined by the GAP specification; in units of milliseconds.
213  */
214 /**@{*/
215 #define DM_GAP_LIM_ADV_TIMEOUT 180000 /*!< \brief Maximum advertising duration in limited discoverable mode */
216 #define DM_GAP_GEN_DISC_SCAN_MIN 10240 /*!< \brief Minimum scan duration for general discovery */
217 #define DM_GAP_LIM_DISC_SCAN_MIN 10240 /*!< \brief Minimum scan duration for limited discovery */
218 #define DM_GAP_CONN_PARAM_TIMEOUT 30000 /*!< \brief Connection parameter update timeout */
219 #define DM_GAP_SCAN_FAST_PERIOD 30720 /*!< \brief Minimum time to perform scanning when user initiated */
220 #define DM_GAP_ADV_FAST_PERIOD 30000 /*!< \brief Minimum time to perform advertising when user initiated */
221 /**@}*/
222 
223 /** \name GAP 1M PHY Timing
224  * Advertising, scanning, and connection parameters defined in the GAP specification for the LE 1M PHY.
225  * In units of 625 microseconds.
226  */
227 /**@{*/
228 #define DM_GAP_SCAN_FAST_INT_MIN 48 /*!< \brief Minimum scan interval when user initiated */
229 #define DM_GAP_SCAN_FAST_INT_MAX 96 /*!< \brief Maximum scan interval when user initiated */
230 #define DM_GAP_SCAN_FAST_WINDOW 48 /*!< \brief Scan window when user initiated */
231 #define DM_GAP_SCAN_SLOW_INT_1 2048 /*!< \brief Scan interval 1 when background scannning */
232 #define DM_GAP_SCAN_SLOW_WINDOW_1 18 /*!< \brief Scan window 1 when background scanning */
233 #define DM_GAP_SCAN_SLOW_INT_2 4096 /*!< \brief Scan interval 2 when background scannning */
234 #define DM_GAP_SCAN_SLOW_WINDOW_2 36 /*!< \brief Scan window 2 when background scanning */
235 #define DM_GAP_ADV_FAST_INT_MIN_1 48 /*!< \brief Minimum advertising interval 1 when user initiated */
236 #define DM_GAP_ADV_FAST_INT_MAX_1 96 /*!< \brief Maximum advertising interval 1 when user initiated */
237 #define DM_GAP_ADV_FAST_INT_MIN_2 160 /*!< \brief Minimum advertising interval 2 when user initiated */
238 #define DM_GAP_ADV_FAST_INT_MAX_2 240 /*!< \brief Maximum advertising interval 2 when user initiated */
239 #define DM_GAP_ADV_SLOW_INT_MIN 1600 /*!< \brief Minimum advertising interval when background advertising */
240 #define DM_GAP_ADV_SLOW_INT_MAX 1920 /*!< \brief Maximum advertising interval when background advertising */
241 /**@}*/
242 
243 /** \name GAP Coded PHY Timing
244  * Advertising, scanning, and connection parameters defined in the GAP specification for the LE Coded PHY.
245  * In units of 625 microseconds.
246  */
247 /**@{*/
248 #define DM_GAP_SCAN_CODED_FAST_INT_MIN 144 /*!< \brief Minimum scan interval when user initiated on LE Coded PHY */
249 #define DM_GAP_SCAN_CODED_FAST_INT_MAX 288 /*!< \brief Maximum scan interval when user initiated on LE Coded PHY */
250 #define DM_GAP_SCAN_CODED_FAST_WINDOW 144 /*!< \brief Scan window when user initiated on LE Coded PHY */
251 #define DM_GAP_SCAN_CODED_SLOW_INT_1 6144 /*!< \brief Scan interval 1 when background scannning on LE Coded PHY */
252 #define DM_GAP_SCAN_CODED_SLOW_WINDOW_1 54 /*!< \brief Scan window 1 when background scanning on LE Coded PHY */
253 #define DM_GAP_SCAN_CODED_SLOW_INT_2 12288 /*!< \brief Scan interval 2 when background scannning on LE Coded PHY */
254 #define DM_GAP_SCAN_CODED_SLOW_WINDOW_2 108 /*!< \brief Scan window 2 when background scanning on LE Coded PHY */
255 #define DM_GAP_ADV_CODED_FAST_INT_MIN_1 144 /*!< \brief Minimum advertising interval 1 when user initiated on LE Coded PHY */
256 #define DM_GAP_ADV_CODED_FAST_INT_MAX_1 288 /*!< \brief Maximum advertising interval 1 when user initiated on LE Coded PHY */
257 #define DM_GAP_ADV_CODED_FAST_INT_MIN_2 480 /*!< \brief Minimum advertising interval 2 when user initiated on LE Coded PHY */
258 #define DM_GAP_ADV_CODED_FAST_INT_MAX_2 720 /*!< \brief Maximum advertising interval 2 when user initiated on LE Coded PHY */
259 #define DM_GAP_ADV_CODED_SLOW_INT_MIN 4800 /*!< \brief Minimum advertising interval when background advertising on LE Coded PHY */
260 #define DM_GAP_ADV_CODED_SLOW_INT_MAX 5760 /*!< \brief Maximum advertising interval when background advertising on LE Coded PHY */
261 /**@}*/
262 
263 /** \name GAP Connection Slave Latency
264  *
265  */
266 /**@{*/
267 /*! \brief GAP connection establishment slaves latency */
268 #define DM_GAP_CONN_EST_LATENCY 0
269 /**@}*/
270 
271 /** \name GAP Connection Interval
272  * GAP connection interval in 1.25ms units.
273  */
274 /**@{*/
275 #define DM_GAP_INITIAL_CONN_INT_MIN 24 /*!< \brief Minimum initial connection interval */
276 #define DM_GAP_INITIAL_CONN_INT_MAX 40 /*!< \brief Maximum initial connection interval */
277 /**@}*/
278 
279 /** \name GAP Connection Event Lengths
280  * GAP connection establishment minimum and maximum connection event lengths.
281  */
282 /**@{*/
283 #define DM_GAP_CONN_EST_MIN_CE_LEN 0 /*!< \brief Connection establishment minimum event length */
284 #define DM_GAP_CONN_EST_MAX_CE_LEN 0 /*!< \brief Connection establishment maximum event length */
285 /**@}*/
286 
287 /** \name GAP Peripheral Privacy Characteristic Values
288  *
289  */
290 /**@{*/
291 #define DM_GAP_PRIV_DISABLED 0 /*!< \brief Privacy Disabled */
292 #define DM_GAP_PRIV_ENABLED 1 /*!< \brief Privacy Enabled */
293 /**@}*/
294 
295 /** \name GAP Connection Supervision Timeout
296  * Connection supervision timeout, in 10ms units
297  */
298 /**@{*/
299 /*! \brief Connection establishment supervision timeout default, in 10ms units */
300 #define DM_DEFAULT_EST_SUP_TIMEOUT 2000
301 /**@}*/
302 
303 /** \name GAP Security Pairing Authentication Requirements
304  * Pairing authentication/security properties bit mask.
305  */
306 /**@{*/
307 #define DM_AUTH_BOND_FLAG SMP_AUTH_BOND_FLAG /*!< \brief Bonding requested */
308 #define DM_AUTH_MITM_FLAG SMP_AUTH_MITM_FLAG /*!< \brief MITM (authenticated pairing) requested */
309 #define DM_AUTH_SC_FLAG SMP_AUTH_SC_FLAG /*!< \brief LE Secure Connections requested */
310 #define DM_AUTH_KP_FLAG SMP_AUTH_KP_FLAG /*!< \brief Keypress notifications requested */
311 /**@}*/
312 
313 /** \name GAP Key Distribution Flags
314  * Key distribution bit mask
315  */
316 /**@{*/
317 #define DM_KEY_DIST_LTK SMP_KEY_DIST_ENC /*!< \brief Distribute LTK used for encryption */
318 #define DM_KEY_DIST_IRK SMP_KEY_DIST_ID /*!< \brief Distribute IRK used for privacy */
319 #define DM_KEY_DIST_CSRK SMP_KEY_DIST_SIGN /*!< \brief Distribute CSRK used for signed data */
320 /**@}*/
321 
322 /** \name DM Security Key Indication Types
323  * Type of key used in \ref DM_SEC_KEY_IND.
324  */
325 /**@{*/
326 #define DM_KEY_LOCAL_LTK 0x01 /*!< \brief LTK generated locally for this device */
327 #define DM_KEY_PEER_LTK 0x02 /*!< \brief LTK received from peer device */
328 #define DM_KEY_IRK 0x04 /*!< \brief IRK and identity info of peer device */
329 #define DM_KEY_CSRK 0x08 /*!< \brief CSRK of peer device */
330 /**@}*/
331 
332 /*! \brief Base value for HCI error status values for \ref DM_SEC_PAIR_CMPL_IND */
333 #define DM_SEC_HCI_ERR_BASE 0x20
334 
335 /** \name GAP Security Level
336  * GAP Mode 1 Security Levels
337  */
338 /**@{*/
339 #define DM_SEC_LEVEL_NONE 0 /*!< \brief Connection has no security */
340 #define DM_SEC_LEVEL_ENC 1 /*!< \brief Connection is encrypted with unauthenticated key */
341 #define DM_SEC_LEVEL_ENC_AUTH 2 /*!< \brief Connection is encrypted with authenticated key */
342 #define DM_SEC_LEVEL_ENC_LESC 3 /*!< \brief Connection is encrypted with LE Secure Connections */
343 /**@}*/
344 
345 /** \name GAP Random Address Types
346  * Random address type masks.
347  */
348 /**@{*/
349 #define DM_RAND_ADDR_STATIC 0xC0 /*!< \brief Static address */
350 #define DM_RAND_ADDR_RESOLV 0x40 /*!< \brief Resolvable private address */
351 #define DM_RAND_ADDR_NONRESOLV 0x00 /*!< \brief Non-resolvable private address */
352 /**@}*/
353 
354 /** \name GAP Random Address Macros
355  * Macros for identifying address type.
356  */
357 /**@{*/
358 /*! \brief Get the type of random address */
359 #define DM_RAND_ADDR_GET(addr) ((addr)[5] & 0xC0)
360 
361 /*! \brief Set the type of random address */
362 #define DM_RAND_ADDR_SET(addr, type) {(addr)[5] = ((addr)[5] & 0x3F) | (type);}
363 
364 /*! \brief Check for Static Address */
365 #define DM_RAND_ADDR_SA(addr, type) (((type) == DM_ADDR_RANDOM) && \
366  (DM_RAND_ADDR_GET((addr)) == DM_RAND_ADDR_STATIC))
367 
368 /*! \brief Check for Resolvable Private Address */
369 #define DM_RAND_ADDR_RPA(addr, type) (((type) == DM_ADDR_RANDOM) && \
370  (DM_RAND_ADDR_GET((addr)) == DM_RAND_ADDR_RESOLV))
371 /**@}*/
372 
373 /** \name GAP Privacy Mode
374  * Privacy Mode of this device in regards to a peer device.
375  */
376 /**@{*/
377 #define DM_PRIV_MODE_NETWORK 0x00 /*!< \brief Network privacy mode (default). */
378 #define DM_PRIV_MODE_DEVICE 0x01 /*!< \brief Device privacy mode. */
379 /**@}*/
380 
381 /** \name DM Internal State
382  * Connection busy or idle state
383  */
384 /**@{*/
385 #define DM_CONN_IDLE 0 /*!< \brief Connection is idle. */
386 #define DM_CONN_BUSY 1 /*!< \brief Connection is busy. */
387 /**@}*/
388 
389 /** \name DM Internal State Flags
390  * Connection busy/idle state bitmask.
391  */
392 /**@{*/
393 #define DM_IDLE_SMP_PAIR 0x0001 /*!< \brief SMP pairing in progress */
394 #define DM_IDLE_DM_ENC 0x0002 /*!< \brief DM Encryption setup in progress */
395 #define DM_IDLE_ATTS_DISC 0x0004 /*!< \brief ATTS service discovery in progress */
396 #define DM_IDLE_APP_DISC 0x0008 /*!< \brief App framework service discovery in progress */
397 #define DM_IDLE_USER_1 0x0010 /*!< \brief For use by user application */
398 #define DM_IDLE_USER_2 0x0020 /*!< \brief For use by user application */
399 #define DM_IDLE_USER_3 0x0040 /*!< \brief For use by user application */
400 #define DM_IDLE_USER_4 0x0080 /*!< \brief For use by user application */
401 /**@}*/
402 
403 /** \name GAP Filter Policy Modes
404  * Filter policy modes.
405  */
406 /**@{*/
407 #define DM_FILT_POLICY_MODE_ADV 0 /*!< \brief Advertising filter policy mode */
408 #define DM_FILT_POLICY_MODE_SCAN 1 /*!< \brief Scanning filter policy mode */
409 #define DM_FILT_POLICY_MODE_INIT 2 /*!< \brief Initiator filter policy mode */
410 #define DM_FILT_POLICY_MODE_SYNC 3 /*!< \brief Synchronization filter policy mode */
411 /**@}*/
412 
413 /** \name DM Proprietary Error Codes
414  * Internal error codes not sent in any PDU.
415  */
416 /**@{*/
417 #define DM_ERR_SMP_RX_PDU_LEN_EXCEEDED 0x01 /*!< \brief LESC key length exceeded maximum RX PDU length */
418 #define DM_ERR_ATT_RX_PDU_LEN_EXCEEDED 0x02 /*!< \brief Configured ATT MTU exceeded maximum RX PDU length */
419 #define DM_ERR_L2C_RX_PDU_LEN_EXCEEDED 0x03 /*!< \brief Registered COC MPS exceeded maximum RX PDU length */
420 /**@}*/
421 
422 /** \name DM Legacy Advertising Handle
423  * Default handle for legacy advertising when using legacy HCI interface. In this case only one advertising
424  * set is allowed so all activity uses the same handle.
425  */
426 /**@{*/
427 /*! \brief Default Advertising handle for legacy advertising */
428 #define DM_ADV_HANDLE_DEFAULT 0
429 /**@}*/
430 
431 /** \name DM Callback Events
432  * Events handled by the DM state machine.
433  */
434 /**@{*/
435 #define DM_CBACK_START 0x20 /*!< \brief DM callback event starting value */
436 
437 /*! \brief DM callback events */
438 enum
439 {
440  DM_RESET_CMPL_IND = DM_CBACK_START, /*!< \brief Reset complete */
441  DM_ADV_START_IND, /*!< \brief Advertising started */
442  DM_ADV_STOP_IND, /*!< \brief Advertising stopped */
443  DM_ADV_NEW_ADDR_IND, /*!< \brief New resolvable address has been generated */
444  DM_SCAN_START_IND, /*!< \brief Scanning started */
445  DM_SCAN_STOP_IND, /*!< \brief Scanning stopped */
446  DM_SCAN_REPORT_IND, /*!< \brief Scan data received from peer device */
447  DM_CONN_OPEN_IND, /*!< \brief Connection opened */
448  DM_CONN_CLOSE_IND, /*!< \brief Connection closed */
449  DM_CONN_UPDATE_IND, /*!< \brief Connection update complete */
450  DM_SEC_PAIR_CMPL_IND, /*!< \brief Pairing completed successfully */
451  DM_SEC_PAIR_FAIL_IND, /*!< \brief Pairing failed or other security failure */
452  DM_SEC_ENCRYPT_IND, /*!< \brief Connection encrypted */
453  DM_SEC_ENCRYPT_FAIL_IND, /*!< \brief Encryption failed */
454  DM_SEC_AUTH_REQ_IND, /*!< \brief PIN or OOB data requested for pairing */
455  DM_SEC_KEY_IND, /*!< \brief Security key indication */
456  DM_SEC_LTK_REQ_IND, /*!< \brief LTK requested for encyption */
457  DM_SEC_PAIR_IND, /*!< \brief Incoming pairing request from master */
458  DM_SEC_SLAVE_REQ_IND, /*!< \brief Incoming security request from slave */
459  DM_SEC_CALC_OOB_IND, /*!< \brief Result of OOB Confirm Calculation Generation */
460  DM_SEC_ECC_KEY_IND, /*!< \brief Result of ECC Key Generation */
461  DM_SEC_COMPARE_IND, /*!< \brief Result of Just Works/Numeric Comparison Compare Value Calculation */
462  DM_SEC_KEYPRESS_IND, /*!< \brief Keypress indication from peer in passkey security */
463  DM_PRIV_RESOLVED_ADDR_IND, /*!< \brief Private address resolved */
464  DM_PRIV_GENERATE_ADDR_IND, /*!< \brief Private resolvable address generated */
465  DM_CONN_READ_RSSI_IND, /*!< \brief Connection RSSI read */
466  DM_PRIV_ADD_DEV_TO_RES_LIST_IND, /*!< \brief Device added to resolving list */
467  DM_PRIV_REM_DEV_FROM_RES_LIST_IND, /*!< \brief Device removed from resolving list */
468  DM_PRIV_CLEAR_RES_LIST_IND, /*!< \brief Resolving list cleared */
469  DM_PRIV_READ_PEER_RES_ADDR_IND, /*!< \brief Peer resolving address read */
470  DM_PRIV_READ_LOCAL_RES_ADDR_IND, /*!< \brief Local resolving address read */
471  DM_PRIV_SET_ADDR_RES_ENABLE_IND, /*!< \brief Address resolving enable set */
472  DM_REM_CONN_PARAM_REQ_IND, /*!< \brief Remote connection parameter requested */
473  DM_CONN_DATA_LEN_CHANGE_IND, /*!< \brief Data length changed */
474  DM_CONN_WRITE_AUTH_TO_IND, /*!< \brief Write authenticated payload complete */
475  DM_CONN_AUTH_TO_EXPIRED_IND, /*!< \brief Authenticated payload timeout expired */
476  DM_PHY_READ_IND, /*!< \brief Read PHY */
477  DM_PHY_SET_DEF_IND, /*!< \brief Set default PHY */
478  DM_PHY_UPDATE_IND, /*!< \brief PHY update */
479  DM_ADV_SET_START_IND, /*!< \brief Advertising set(s) started */
480  DM_ADV_SET_STOP_IND, /*!< \brief Advertising set(s) stopped */
481  DM_SCAN_REQ_RCVD_IND, /*!< \brief Scan request received */
482  DM_EXT_SCAN_START_IND, /*!< \brief Extended scanning started */
483  DM_EXT_SCAN_STOP_IND, /*!< \brief Extended scanning stopped */
484  DM_EXT_SCAN_REPORT_IND, /*!< \brief Extended scan data received from peer device */
485  DM_PER_ADV_SET_START_IND, /*!< \brief Periodic advertising set started */
486  DM_PER_ADV_SET_STOP_IND, /*!< \brief Periodic advertising set stopped */
487  DM_PER_ADV_SYNC_EST_IND, /*!< \brief Periodic advertising sync established */
488  DM_PER_ADV_SYNC_EST_FAIL_IND, /*!< \brief Periodic advertising sync establishment failed */
489  DM_PER_ADV_SYNC_LOST_IND, /*!< \brief Periodic advertising sync lost */
490  DM_PER_ADV_SYNC_TRSF_EST_IND, /*!< \brief Periodic advertising sync transfer established */
491  DM_PER_ADV_SYNC_TRSF_EST_FAIL_IND, /*!< \brief Periodic advertising sync transfer establishment failed */
492  DM_PER_ADV_SYNC_TRSF_IND, /*!< \brief Periodic advertising sync info transferred */
493  DM_PER_ADV_SET_INFO_TRSF_IND, /*!< \brief Periodic advertising set sync info transferred */
494  DM_PER_ADV_REPORT_IND, /*!< \brief Periodic advertising data received from peer device */
495  DM_REMOTE_FEATURES_IND, /*!< \brief Remote features from peer device */
496  DM_READ_REMOTE_VER_INFO_IND, /*!< \brief Remote LL version information read */
497  DM_CONN_IQ_REPORT_IND, /*!< \brief IQ samples from CTE of received packet from peer device */
498  DM_CTE_REQ_FAIL_IND, /*!< \brief CTE request failed */
499  DM_CONN_CTE_RX_SAMPLE_START_IND, /*!< \brief Sampling received CTE started */
500  DM_CONN_CTE_RX_SAMPLE_STOP_IND, /*!< \brief Sampling received CTE stopped */
501  DM_CONN_CTE_TX_CFG_IND, /*!< \brief Connection CTE transmit parameters configured */
502  DM_CONN_CTE_REQ_START_IND, /*!< \brief Initiating connection CTE request started */
503  DM_CONN_CTE_REQ_STOP_IND, /*!< \brief Initiating connection CTE request stopped */
504  DM_CONN_CTE_RSP_START_IND, /*!< \brief Responding to connection CTE request started */
505  DM_CONN_CTE_RSP_STOP_IND, /*!< \brief Responding to connection CTE request stopped */
506  DM_READ_ANTENNA_INFO_IND, /*!< \brief Antenna information read */
507  DM_L2C_CMD_REJ_IND, /*!< \brief L2CAP Command Reject */
508  DM_ERROR_IND, /*!< \brief General error */
509  DM_HW_ERROR_IND, /*!< \brief Hardware error */
510  DM_VENDOR_SPEC_IND /*!< \brief Vendor specific event */
511 };
512 
513 #define DM_CBACK_END DM_VENDOR_SPEC_IND /*!< \brief DM callback event ending value */
514 /**@}*/
515 
516 /**************************************************************************************************
517  Data Types
518 **************************************************************************************************/
519 
520 /*! \brief Connection identifier. */
521 typedef uint8_t dmConnId_t;
522 
523 /*! \brief Synchronization identifier. */
524 typedef uint8_t dmSyncId_t;
525 
526 /*! \brief Configuration structure. */
527 typedef struct
528 {
529  uint8_t dummy; /*!< \brief Placeholder variable. */
530 } dmCfg_t;
531 
532 /*! \brief LTK data type. */
533 typedef struct
534 {
535  uint8_t key[SMP_KEY_LEN]; /*!< \brief LTK */
536  uint8_t rand[SMP_RAND8_LEN]; /*!< \brief Rand */
537  uint16_t ediv; /*!< \brief EDIV */
538 } dmSecLtk_t;
539 
540 /*! \brief IRK data type. */
541 typedef struct
542 {
543  uint8_t key[SMP_KEY_LEN]; /*!< \brief IRK */
544  bdAddr_t bdAddr; /*!< \brief BD Address */
545  uint8_t addrType; /*!< \brief Address Type */
546 } dmSecIrk_t;
547 
548 /*! \brief CSRK data type. */
549 typedef struct
550 {
551  uint8_t key[SMP_KEY_LEN]; /*!< \brief CSRK */
552 } dmSecCsrk_t;
553 
554 /*! \brief Union of key types. */
555 typedef union
556 {
557  dmSecLtk_t ltk; /*!< \brief LTK */
558  dmSecIrk_t irk; /*!< \brief IRK */
559  dmSecCsrk_t csrk; /*!< \brief CSRK */
560 } dmSecKey_t;
561 
562 /*! \brief Data type for \ref DM_SEC_PAIR_CMPL_IND. */
563 typedef struct
564 {
565  wsfMsgHdr_t hdr; /*!< \brief Header */
566  uint8_t auth; /*!< \brief Authentication and bonding flags */
568 
569 /*! \brief Data type for \ref DM_SEC_ENCRYPT_IND. */
570 typedef struct
571 {
572  wsfMsgHdr_t hdr; /*!< \brief Header */
573  bool_t usingLtk; /*!< \brief TRUE if connection encrypted with LTK */
575 
576 /*! \brief Data type for \ref DM_SEC_AUTH_REQ_IND. */
577 typedef struct
578 {
579  wsfMsgHdr_t hdr; /*!< \brief Header */
580  bool_t oob; /*!< \brief Out-of-band data requested */
581  bool_t display; /*!< \brief TRUE if pin is to be displayed */
583 
584 /*! \brief Data type for \ref DM_SEC_PAIR_IND. */
585 typedef struct
586 {
587  wsfMsgHdr_t hdr; /*!< \brief Header */
588  uint8_t auth; /*!< \brief Authentication and bonding flags */
589  bool_t oob; /*!< \brief Out-of-band pairing data present or not present */
590  uint8_t iKeyDist; /*!< \brief Initiator key distribution flags */
591  uint8_t rKeyDist; /*!< \brief Responder key distribution flags */
593 
594 /*! \brief Data type for \ref DM_SEC_SLAVE_REQ_IND. */
595 typedef struct
596 {
597  wsfMsgHdr_t hdr; /*!< \brief Header */
598  uint8_t auth; /*!< \brief Authentication and bonding flags */
600 
601 /*! \brief Data type for \ref DM_SEC_KEY_IND. */
602 typedef struct
603 {
604  wsfMsgHdr_t hdr; /*!< \brief Header */
605  dmSecKey_t keyData; /*!< \brief Key data */
606  uint8_t type; /*!< \brief Key type */
607  uint8_t secLevel; /*!< \brief Security level of pairing when key was exchanged */
608  uint8_t encKeyLen; /*!< \brief Length of encryption key used when data was transferred */
610 
611 /*! \brief Data type for \ref DM_SEC_COMPARE_IND. */
612 typedef struct
613 {
614  wsfMsgHdr_t hdr; /*!< \brief Header */
615  uint8_t confirm[SMP_CONFIRM_LEN]; /*!< \brief Confirm value */
617 
618 /*! \brief Data type for \ref DM_SEC_KEYPRESS_IND. */
619 typedef struct
620 {
621  wsfMsgHdr_t hdr; /*!< \brief Header */
622  uint8_t notificationType; /*!< \brief Type of keypress notification */
624 
625 /*! \brief Data type for \ref DM_PRIV_GENERATE_ADDR_IND. */
626 typedef struct
627 {
628  wsfMsgHdr_t hdr; /*!< \brief Header */
629  bdAddr_t addr; /*!< \brief Resolvable private address */
631 
632 /*! \brief Data type for \ref DM_SEC_CALC_OOB_IND. */
633 typedef struct
634 {
635  wsfMsgHdr_t hdr; /*!< \brief Header */
636  uint8_t confirm[SMP_CONFIRM_LEN]; /*!< \brief Local confirm value */
637  uint8_t random[SMP_RAND_LEN]; /*!< \brief Local random value */
639 
640 /*! \brief Data type for \ref DM_ADV_NEW_ADDR_IND. */
641 typedef struct
642 {
643  wsfMsgHdr_t hdr; /*!< \brief Header */
644  bdAddr_t addr; /*!< \brief New resolvable private address */
645  bool_t firstTime; /*!< \brief TRUE when address is generated for the first time */
647 
648 /*! \brief Data structure for \ref DM_ADV_SET_START_IND. */
649 typedef struct
650 {
651  wsfMsgHdr_t hdr; /*!< \brief Header */
652  uint8_t numSets; /*!< \brief Number of advertising sets */
653  uint8_t advHandle[DM_NUM_ADV_SETS];/*!< \brief Advertising handle array */
655 
656 /*! \brief Data structure for \ref DM_PER_ADV_SET_START_IND. */
657 typedef struct
658 {
659  wsfMsgHdr_t hdr; /*!< \brief Header */
660  uint8_t advHandle; /*!< \brief Advertising handle */
662 
663 /*! \brief Data structure for \ref DM_PER_ADV_SET_STOP_IND. */
664 typedef struct
665 {
666  wsfMsgHdr_t hdr; /*!< \brief Header */
667  uint8_t advHandle; /*!< \brief Advertising handle */
669 
670 /*! \brief Data structure for \ref DM_L2C_CMD_REJ_IND. */
671 typedef struct
672 {
673  wsfMsgHdr_t hdr; /*!< \brief Header */
674  uint16_t reason; /*!< \brief Rejection reason */
675  uint16_t handle; /*!< \brief Connection handle */
677 
678 /*! \brief Union of DM callback event data types.
679  *
680  * \note the following events use only the common \ref wsfMsgHdr_t header:
681  * \ref DM_RESET_CMPL_IND,
682  * \ref DM_ADV_START_IND,
683  * \ref DM_ADV_STOP_IND,
684  * \ref DM_SCAN_START_IND,
685  * \ref DM_SCAN_STOP_IND,
686  * \ref DM_SEC_PAIR_FAIL_IND,
687  * \ref DM_SEC_ENCRYPT_FAIL_IND,
688  * \ref DM_PRIV_RESOLVED_ADDR_IND,
689  * \ref DM_EXT_SCAN_START_IND,
690  * \ref DM_EXT_SCAN_STOP_IND,
691  * \ref DM_ERROR_IND
692  */
693 typedef union
694 {
695  wsfMsgHdr_t hdr; /*!< \brief Common header */
696  /* common header used by DM_RESET_CMPL_IND */
697  /* common header used by DM_ADV_START_IND */
698  /* common header used by DM_ADV_STOP_IND */
699  dmAdvNewAddrIndEvt_t advNewAddr; /*!< \brief handles \ref DM_ADV_NEW_ADDR_IND */
700  /* common header used by DM_SCAN_START_IND */
701  /* common header used by DM_SCAN_STOP_IND */
702  hciLeAdvReportEvt_t scanReport; /*!< \brief handles \ref DM_SCAN_REPORT_IND */
703  hciLeConnCmplEvt_t connOpen; /*!< \brief handles \ref DM_CONN_OPEN_IND */
704  hciDisconnectCmplEvt_t connClose; /*!< \brief handles \ref DM_CONN_CLOSE_IND */
705  hciLeConnUpdateCmplEvt_t connUpdate; /*!< \brief handles \ref DM_CONN_UPDATE_IND */
706  dmSecPairCmplIndEvt_t pairCmpl; /*!< \brief handles \ref DM_SEC_PAIR_CMPL_IND */
707  /* common header used by DM_SEC_PAIR_FAIL_IND */
708  dmSecEncryptIndEvt_t encryptInd; /*!< \brief handles \ref DM_SEC_ENCRYPT_IND */
709  /* common header used by DM_SEC_ENCRYPT_FAIL_IND */
710  dmSecAuthReqIndEvt_t authReq; /*!< \brief handles \ref DM_SEC_AUTH_REQ_IND */
711  dmSecKeyIndEvt_t keyInd; /*!< \brief handles \ref DM_SEC_KEY_IND */
712  hciLeLtkReqEvt_t ltkReqInd; /*!< \brief handles \ref DM_SEC_LTK_REQ_IND */
713  dmSecPairIndEvt_t pairInd; /*!< \brief handles \ref DM_SEC_PAIR_IND */
714  dmSecSlaveIndEvt_t slaveInd; /*!< \brief handles \ref DM_SEC_SLAVE_REQ_IND */
715  dmSecOobCalcIndEvt_t oobCalcInd; /*!< \brief handles \ref DM_SEC_CALC_OOB_IND */
716  secEccMsg_t eccMsg; /*!< \brief handles \ref DM_SEC_ECC_KEY_IND */
717  dmSecCnfIndEvt_t cnfInd; /*!< \brief handles \ref DM_SEC_COMPARE_IND */
718  dmSecKeypressIndEvt_t keypressInd; /*!< \brief handles \ref DM_SEC_KEYPRESS_IND */
719  /* common header used by DM_PRIV_RESOLVED_ADDR_IND */
720  dmPrivGenAddrIndEvt_t genAddr; /*!< \brief handles \ref DM_PRIV_GENERATE_ADDR_IND */
721  hciReadRssiCmdCmplEvt_t readRssi; /*!< \brief handles \ref DM_CONN_READ_RSSI_IND */
722  hciLeAddDevToResListCmdCmplEvt_t addDevToResList; /*!< \brief handles \ref DM_PRIV_ADD_DEV_TO_RES_LIST_IND */
723  hciLeRemDevFromResListCmdCmplEvt_t remDevFromResList; /*!< \brief handles \ref DM_PRIV_REM_DEV_FROM_RES_LIST_IND */
724  hciLeClearResListCmdCmplEvt_t clearResList; /*!< \brief handles \ref DM_PRIV_CLEAR_RES_LIST_IND */
725  hciLeReadPeerResAddrCmdCmplEvt_t readPeerResAddr; /*!< \brief handles \ref DM_PRIV_READ_PEER_RES_ADDR_IND */
726  hciLeReadLocalResAddrCmdCmplEvt_t readLocalResAddr; /*!< \brief handles \ref DM_PRIV_READ_LOCAL_RES_ADDR_IND */
727  hciLeSetAddrResEnableCmdCmplEvt_t setAddrResEnable; /*!< \brief handles \ref DM_PRIV_SET_ADDR_RES_ENABLE_IND */
728  hciLeRemConnParamReqEvt_t remConnParamReq; /*!< \brief handles \ref DM_REM_CONN_PARAM_REQ_IND */
729  hciLeDataLenChangeEvt_t dataLenChange; /*!< \brief handles \ref DM_CONN_DATA_LEN_CHANGE_IND */
730  hciWriteAuthPayloadToCmdCmplEvt_t writeAuthTo; /*!< \brief handles \ref DM_CONN_WRITE_AUTH_TO_IND */
731  hciAuthPayloadToExpiredEvt_t authToExpired; /*!< \brief handles \ref DM_CONN_AUTH_TO_EXPIRED_IND */
732  hciLeReadPhyCmdCmplEvt_t readPhy; /*!< \brief handles \ref DM_PHY_READ_IND */
733  hciLeSetDefPhyCmdCmplEvt_t setDefPhy; /*!< \brief handles \ref DM_PHY_SET_DEF_IND */
734  hciLePhyUpdateEvt_t phyUpdate; /*!< \brief handles \ref DM_PHY_UPDATE_IND */
735  dmAdvSetStartEvt_t advSetStart; /*!< \brief handles \ref DM_ADV_SET_START_IND */
736  hciLeAdvSetTermEvt_t advSetStop; /*!< \brief handles \ref DM_ADV_SET_STOP_IND */
737  hciLeScanReqRcvdEvt_t scanReqRcvd; /*!< \brief handles \ref DM_SCAN_REQ_RCVD_IND */
738  /* common header used by DM_EXT_SCAN_START_IND */
739  /* common header used by DM_EXT_SCAN_STOP_IND */
740  hciLeExtAdvReportEvt_t extScanReport; /*!< \brief handles \ref DM_EXT_SCAN_REPORT_IND */
741  dmPerAdvSetStartEvt_t perAdvSetStart; /*!< \brief handles \ref DM_PER_ADV_SET_START_IND */
742  dmPerAdvSetStopEvt_t perAdvSetStop; /*!< \brief handles \ref DM_PER_ADV_SET_STOP_IND */
743  hciLePerAdvSyncEstEvt_t perAdvSyncEst; /*!< \brief handles \ref DM_PER_ADV_SYNC_EST_IND */
744  hciLePerAdvSyncEstEvt_t perAdvSyncEstFail; /*!< \brief handles \ref DM_PER_ADV_SYNC_EST_FAIL_IND */
745  hciLePerAdvSyncLostEvt_t perAdvSyncLost; /*!< \brief handles \ref DM_PER_ADV_SYNC_LOST_IND */
746  HciLePerAdvSyncTrsfRcvdEvt_t perAdvSyncTrsfEst; /*!< \brief handles \ref DM_PER_ADV_SYNC_TRSF_EST_IND */
747  HciLePerAdvSyncTrsfRcvdEvt_t perAdvSyncTrsEstFail; /*!< \brief handles \ref DM_PER_ADV_SYNC_TRSF_EST_FAIL_IND */
748  hciLePerAdvSyncTrsfCmdCmplEvt_t perAdvSyncTrsf; /*!< \brief handles \ref DM_PER_ADV_SYNC_TRSF_IND */
749  hciLePerAdvSetInfoTrsfCmdCmplEvt_t perAdvSetInfoTrsf; /*!< \brief handles \ref DM_PER_ADV_SET_INFO_TRSF_IND */
750  hciLePerAdvReportEvt_t perAdvReport; /*!< \brief handles \ref DM_PER_ADV_REPORT_IND */
751  hciLeReadRemoteFeatCmplEvt_t readRemoteFeat; /*!< \brief handles \ref DM_REMOTE_FEATURES_IND */
752  hciReadRemoteVerInfoCmplEvt_t readRemVerInfo; /*!< \brief handles \ref DM_READ_REMOTE_VER_INFO_IND */
753  hciLeConnIQReportEvt_t connIQReport; /*!< \brief handles \ref DM_CONN_IQ_REPORT_IND */
754  hciLeCteReqFailedEvt_t cteReqFail; /*!< \brief handles \ref DM_CTE_REQ_FAIL_IND */
755  hciLeSetConnCteRxParamsCmdCmplEvt_t connCteRxSampleStart; /*!< \brief handles \ref DM_CONN_CTE_RX_SAMPLE_START_IND */
756  hciLeSetConnCteRxParamsCmdCmplEvt_t connCteRxSampleStop; /*!< \brief handles \ref DM_CONN_CTE_RX_SAMPLE_STOP_IND */
757  hciLeSetConnCteTxParamsCmdCmplEvt_t connCteTxCfg; /*!< \brief handles \ref DM_CONN_CTE_TX_CFG_IND */
758  hciLeConnCteReqEnableCmdCmplEvt_t connCteReqStart; /*!< \brief handles \ref DM_CONN_CTE_REQ_START_IND */
759  hciLeConnCteReqEnableCmdCmplEvt_t connCteReqStop; /*!< \brief handles \ref DM_CONN_CTE_REQ_STOP_IND */
760  hciLeConnCteRspEnableCmdCmplEvt_t connCteRspStart; /*!< \brief handles \ref DM_CONN_CTE_RSP_START_IND */
761  hciLeConnCteRspEnableCmdCmplEvt_t connCteRspStop; /*!< \brief handles \ref DM_CONN_CTE_RSP_STOP_IND */
762  hciLeReadAntennaInfoCmdCmplEvt_t readAntennaInfo; /*!< \brief handles \ref DM_READ_ANTENNA_INFO_IND */
763  dmL2cCmdRejEvt_t l2cCmdRej; /*!< \brief handles \ref DM_L2C_CMD_REJ_IND */
764  /* common header used by DM_ERROR_IND */
765  hciHwErrorEvt_t hwError; /*!< \brief handles \ref DM_HW_ERROR_IND */
766  hciVendorSpecEvt_t vendorSpec; /*!< \brief handles \ref DM_VENDOR_SPEC_IND */
767 } dmEvt_t;
768 
769 /*! \brief Data type for DmSecSetOob(). */
770 typedef struct
771 {
772  uint8_t localRandom[SMP_RAND_LEN]; /*!< \brief Random value of the local device */
773  uint8_t localConfirm[SMP_CONFIRM_LEN]; /*!< \brief Confirm value of the local device */
774  uint8_t peerRandom[SMP_RAND_LEN]; /*!< \brief Random value of the peer device */
775  uint8_t peerConfirm[SMP_CONFIRM_LEN]; /*!< \brief Confirm value of the peer device */
777 
778 /*! \brief Callback type. */
779 typedef void (*dmCback_t)(dmEvt_t *pDmEvt);
780 
781 /**************************************************************************************************
782  Function Declarations
783 **************************************************************************************************/
784 
785 /** \name DM App Callback Registration
786  *
787  */
788 /**@{*/
789 /*************************************************************************************************/
790 /*!
791  * \brief Register a callback with DM for scan and advertising events.
792  *
793  * \param cback Client callback function.
794  *
795  * \return None.
796  */
797 /*************************************************************************************************/
798 void DmRegister(dmCback_t cback);
799 
800 /**@}*/
801 
802 /** \name DM Advertising Functions
803  * Functions used to control Legacy and Extended Advertising.
804  */
805 /**@{*/
806 
807 /*************************************************************************************************/
808 /*!
809  * \brief Find an advertising data element in the given advertising or scan response data.
810  *
811  * \param adType Advertising data element type to find.
812  * \param dataLen Data length.
813  * \param pData Pointer to advertising or scan response data.
814  *
815  * \return Pointer to the advertising data element byte array or NULL if not found.
816  */
817 /*************************************************************************************************/
818 uint8_t *DmFindAdType(uint8_t adType, uint16_t dataLen, uint8_t *pData);
819 
820 /*************************************************************************************************/
821 /*!
822  * \brief Initialize DM legacy advertising.
823  *
824  * \return None.
825  */
826 /*************************************************************************************************/
827 void DmAdvInit(void);
828 
829 /*************************************************************************************************/
830 /*!
831  * \brief Initialize DM extended advertising.
832  *
833  * \return None.
834  */
835 /*************************************************************************************************/
836 void DmExtAdvInit(void);
837 
838 /*************************************************************************************************/
839 /*!
840  * \brief Whether DM advertising is in legacy mode.
841  *
842  * \return TRUE if DM advertising is in legacy mode. FALSE, otherwise.
843  */
844 /*************************************************************************************************/
845 bool_t DmAdvModeLeg(void);
846 
847 /*************************************************************************************************/
848 /*!
849  * \brief Whether DM advertising is in extended mode.
850  *
851  * \return TRUE if DM advertising is in extended mode. FALSE, otherwise.
852  */
853 /*************************************************************************************************/
854 bool_t DmAdvModeExt(void);
855 
856 /*************************************************************************************************/
857 /*!
858  * \brief Set the advertising parameters using the given advertising type, and peer address.
859  *
860  * \param advHandle Advertising handle.
861  * \param advType Advertising type.
862  * \param peerAddrType Peer address type.
863  * \param pPeerAddr Peer address.
864  *
865  * \return None.
866  */
867 /*************************************************************************************************/
868 void DmAdvConfig(uint8_t advHandle, uint8_t advType, uint8_t peerAddrType, uint8_t *pPeerAddr);
869 
870 /*************************************************************************************************/
871 /*!
872  * \brief Set the advertising or scan response data to the given data.
873  *
874  * \param advHandle Advertising handle.
875  * \param op Data operation.
876  * \param location Data location.
877  * \param len Length of the data. Maximum length is 236 bytes.
878  * \param pData Pointer to the data.
879  *
880  * \return None.
881  */
882 /*************************************************************************************************/
883 void DmAdvSetData(uint8_t advHandle, uint8_t op, uint8_t location, uint8_t len, uint8_t *pData);
884 
885 /*************************************************************************************************/
886 /*!
887  * \brief Start advertising using the given advertising set and duration.
888  *
889  * \param numSets Number of advertising sets to enable.
890  * \param pAdvHandles Advertising handles array.
891  * \param pDuration Advertising duration (in milliseconds) array.
892  * \param pMaxEaEvents Maximum number of extended advertising events array.
893  *
894  * \return None.
895  */
896 /*************************************************************************************************/
897 void DmAdvStart(uint8_t numSets, uint8_t *pAdvHandles, uint16_t *pDuration, uint8_t *pMaxEaEvents);
898 
899 /*************************************************************************************************/
900 /*!
901  * \brief Stop advertising for the given advertising set. If the number of sets is set to 0
902  * then all advertising sets are disabled.
903  *
904  * \param numSets Number of advertising sets to disable.
905  * \param pAdvHandles Advertising handles array.
906  *
907  * \return None.
908  */
909 /*************************************************************************************************/
910 void DmAdvStop(uint8_t numSets, uint8_t *pAdvHandles);
911 
912 /*************************************************************************************************/
913 /*!
914  * \brief Remove an advertising set.
915  *
916  * \param advHandle Advertising handle.
917  *
918  * \return None.
919  */
920 /*************************************************************************************************/
921 void DmAdvRemoveAdvSet(uint8_t advHandle);
922 
923 /*************************************************************************************************/
924 /*!
925  * \brief Clear advertising sets.
926  *
927  * \return None.
928  */
929 /*************************************************************************************************/
930 void DmAdvClearAdvSets(void);
931 
932 /*************************************************************************************************/
933 /*!
934  * \brief Set the random device address for a given advertising set.
935  *
936  * \param advHandle Advertising handle.
937  * \param pAddr Random device address.
938  *
939  * \return None.
940  */
941 /*************************************************************************************************/
942 void DmAdvSetRandAddr(uint8_t advHandle, const uint8_t *pAddr);
943 
944 /*************************************************************************************************/
945 /*!
946  * \brief Set the minimum and maximum advertising intervals.
947  *
948  * \param advHandle Advertising handle.
949  * \param intervalMin Minimum advertising interval.
950  * \param intervalMax Maximum advertising interval.
951  *
952  * \return None.
953  */
954 /*************************************************************************************************/
955 void DmAdvSetInterval(uint8_t advHandle, uint16_t intervalMin, uint16_t intervalMax);
956 
957 /*************************************************************************************************/
958 /*!
959  * \brief Include or exclude certain channels from the advertising channel map.
960  *
961  * \param advHandle Advertising handle.
962  * \param channelMap Advertising channel map.
963  *
964  * \return None.
965  */
966 /*************************************************************************************************/
967 void DmAdvSetChannelMap(uint8_t advHandle, uint8_t channelMap);
968 
969 /*************************************************************************************************/
970 /*!
971  * \brief Set the local address type used while advertising. This function can be used to
972  * configure advertising to use a random address.
973  *
974  * \param addrType Address type.
975  *
976  * \return None.
977  */
978 /*************************************************************************************************/
979 void DmAdvSetAddrType(uint8_t addrType);
980 
981 /*************************************************************************************************/
982 /*!
983  * \brief Set the value of an advertising data element in the given advertising or
984  * scan response data. If the element already exists in the data then it is replaced
985  * with the new value. If the element does not exist in the data it is appended
986  * to it, space permitting.
987  *
988  * \param adType Advertising data element type.
989  * \param len Length of the value. Maximum length is 29 bytes.
990  * \param pValue Pointer to the value.
991  * \param pAdvDataLen Advertising or scan response data length. The new length is returned
992  * in this parameter.
993  * \param pAdvData Pointer to advertising or scan response data.
994  * \param advDataBufLen Length of the advertising or scan response data buffer maintained by
995  * Application.
996  *
997  * \return TRUE if the element was successfully added to the data, FALSE otherwise.
998  */
999 /*************************************************************************************************/
1000 bool_t DmAdvSetAdValue(uint8_t adType, uint8_t len, uint8_t *pValue, uint16_t *pAdvDataLen,
1001  uint8_t *pAdvData, uint16_t advDataBufLen);
1002 
1003 /*************************************************************************************************/
1004 /*!
1005  * \brief Set the device name in the given advertising or scan response data. If the
1006  * name can only fit in the data if it is shortened, the name is shortened
1007  * and the AD type is changed to DM_ADV_TYPE_SHORT_NAME.
1008  *
1009  * \param len Length of the name. Maximum length is 29 bytes.
1010  * \param pValue Pointer to the name in UTF-8 format.
1011  * \param pAdvDataLen Advertising or scan response data length. The new length is returned
1012  * in this parameter.
1013  * \param pAdvData Pointer to advertising or scan response data.
1014  * \param advDataBufLen Length of the advertising or scan response data buffer maintained by
1015  * Application.
1016  *
1017  * \return TRUE if the element was successfully added to the data, FALSE otherwise.
1018  */
1019 /*************************************************************************************************/
1020 bool_t DmAdvSetName(uint8_t len, uint8_t *pValue, uint16_t *pAdvDataLen, uint8_t *pAdvData,
1021  uint16_t advDataBufLen);
1022 
1023 /*************************************************************************************************/
1024 /*!
1025  * \brief Initialize device privacy module.
1026  *
1027  * \return None.
1028  */
1029 /*************************************************************************************************/
1030 void DmDevPrivInit(void);
1031 
1032 /*************************************************************************************************/
1033 /*!
1034  * \brief Start using a private resolvable address.
1035  *
1036  * \param changeInterval Interval between automatic address changes, in seconds.
1037  *
1038  * \return None.
1039  */
1040 /*************************************************************************************************/
1041 void DmDevPrivStart(uint16_t changeInterval);
1042 
1043 /*************************************************************************************************/
1044 /*!
1045  * \brief Stop using a private resolvable address.
1046  *
1047  * \return None.
1048  */
1049 /*************************************************************************************************/
1050 void DmDevPrivStop(void);
1051 
1052 /*************************************************************************************************/
1053 /*!
1054  * \brief Set whether or not to use legacy advertising PDUs with extended advertising.
1055  *
1056  * \param advHandle Advertising handle.
1057  * \param useLegacyPdu Whether to use legacy advertising PDUs (default value is TRUE).
1058  *
1059  * \return None.
1060  */
1061 /*************************************************************************************************/
1062 void DmAdvUseLegacyPdu(uint8_t advHandle, bool_t useLegacyPdu);
1063 
1064 /*************************************************************************************************/
1065 /*!
1066  * \brief Set whether or not to omit advertiser's address from all PDUs (anonymous advertising).
1067  *
1068  * \param advHandle Advertising handle.
1069  * \param omitAdvAddr Whether to omit advertiser's address from all PDUs (default value is FALSE).
1070  *
1071  * \return None.
1072  */
1073 /*************************************************************************************************/
1074 void DmAdvOmitAdvAddr(uint8_t advHandle, bool_t omitAdvAddr);
1075 
1076 /*************************************************************************************************/
1077 /*!
1078  * \brief Set whether or not to include TxPower in extended header of advertising PDU.
1079  *
1080  * \param advHandle Advertising handle.
1081  * \param incTxPwr Whether to include TxPower in extended header of advertising PDU (default
1082  * value is FALSE).
1083  * \param advTxPwr Advertising tx power (127 = no preference).
1084  *
1085  * \return None.
1086  */
1087 /*************************************************************************************************/
1088 void DmAdvIncTxPwr(uint8_t advHandle, bool_t incTxPwr, int8_t advTxPwr);
1089 
1090 /*************************************************************************************************/
1091 /*!
1092  * \brief Set extended advertising PHY parameters.
1093  *
1094  * \param advHandle Advertising handle.
1095  * \param priAdvPhy Primary advertising Phy.
1096  * \param secAdvMaxSkip Maximum advertising events Controller can skip before sending AUX_ADV_IND
1097  * on secondary advertising channel (0 = AUX_ADV_IND will be sent prior to
1098  * next advertising event).
1099  * \param secAdvPhy Secondary advertising Phy.
1100  *
1101  * \return None.
1102  */
1103 /*************************************************************************************************/
1104 void DmAdvSetPhyParam(uint8_t advHandle, uint8_t priAdvPhy, uint8_t secAdvMaxSkip, uint8_t secAdvPhy);
1105 
1106 /*************************************************************************************************/
1107 /*!
1108  * \brief Set scan request notification enable.
1109  *
1110  * \param advHandle Advertising handle.
1111  * \param scanReqNotifEna Scan request notification enable.
1112  *
1113  * \return None.
1114  */
1115 /*************************************************************************************************/
1116 void DmAdvScanReqNotifEnable(uint8_t advHandle, bool_t scanReqNotifEna);
1117 
1118 /*************************************************************************************************/
1119 /*!
1120  * \brief Set fragment preference for advertising data.
1121  *
1122  * \param advHandle Advertising handle.
1123  * \param fragPref Fragment preference.
1124  *
1125  * \return None.
1126  */
1127 /*************************************************************************************************/
1128 void DmAdvSetFragPref(uint8_t advHandle, uint8_t fragPref);
1129 
1130 /*************************************************************************************************/
1131 /*!
1132  * \brief Set the advertising parameters for periodic advertising.
1133  *
1134  * \param advHandle Advertising handle.
1135  *
1136  * \return None.
1137  */
1138 /*************************************************************************************************/
1139 void DmPerAdvConfig(uint8_t advHandle);
1140 
1141 /*************************************************************************************************/
1142 /*!
1143  * \brief Set the advertising data to the given data for periodic advertising.
1144  *
1145  * \param advHandle Advertising handle.
1146  * \param op Data operation.
1147  * \param len Length of the data. Maximum length is 236 bytes.
1148  * \param pData Pointer to the data.
1149  *
1150  * \return None.
1151  */
1152 /*************************************************************************************************/
1153 void DmPerAdvSetData(uint8_t advHandle, uint8_t op, uint8_t len, uint8_t *pData);
1154 
1155 /*************************************************************************************************/
1156 /*!
1157  * \brief Start periodic advertising for the advertising set specified by the advertising handle.
1158  *
1159  * \param advHandle Advertising handle.
1160  *
1161  * \return None.
1162  */
1163 /*************************************************************************************************/
1164 void DmPerAdvStart(uint8_t advHandle);
1165 
1166 /*************************************************************************************************/
1167 /*!
1168  * \brief Stop periodic advertising for the advertising set specified by the advertising handle.
1169  *
1170  * \param advHandle Advertising handle.
1171  *
1172  * \return None.
1173  */
1174 /*************************************************************************************************/
1175 void DmPerAdvStop(uint8_t advHandle);
1176 
1177 
1178 /*************************************************************************************************/
1179 /*!
1180  * \brief Set the minimum and maximum advertising intervals for periodic advertising.
1181  *
1182  * \param advHandle Advertising handle.
1183  * \param intervalMin Minimum advertising interval.
1184  * \param intervalMax Maximum advertising interval.
1185  *
1186  * \return None.
1187  */
1188 /*************************************************************************************************/
1189 void DmPerAdvSetInterval(uint8_t advHandle, uint16_t intervalMin, uint16_t intervalMax);
1190 
1191 /*************************************************************************************************/
1192 /*!
1193  * \brief Set whether or not to include TxPower in extended header of advertising PDU for
1194  * periodic advertising.
1195  *
1196  * \param advHandle Advertising handle.
1197  * \param incTxPwr Whether to include TxPower in extended header of advertising PDU (default
1198  * value is FALSE).
1199  *
1200  * \return None.
1201  */
1202 /*************************************************************************************************/
1203 void DmPerAdvIncTxPwr(uint8_t advHandle, bool_t incTxPwr);
1204 
1205 /*************************************************************************************************/
1206 /*!
1207  * \brief Get the maximum advertising data length supported by Controller for a given advertising
1208  * type.
1209  *
1210  * \param advType Advertising type.
1211  * \param useLegacyPdu Whether to use legacy advertising PDUs with extended advertising.
1212  *
1213  * \return Maximum advertising data length.
1214  */
1215 /*************************************************************************************************/
1216 uint16_t DmExtMaxAdvDataLen(uint8_t advType, bool_t useLegacyPdu);
1217 
1218 /**@}*/
1219 
1220 /** \name DM Privacy Functions
1221  * Functions for controlling Privacy.
1222  */
1223 /**@{*/
1224 
1225 /*************************************************************************************************/
1226 /*!
1227  * \brief Initialize DM privacy module.
1228  *
1229  * \return None.
1230  */
1231 /*************************************************************************************************/
1232 void DmPrivInit(void);
1233 
1234 /*************************************************************************************************/
1235 /*!
1236  * \brief Resolve a private resolvable address. When complete the client's callback function
1237  * is called with a DM_PRIV_RESOLVED_ADDR_IND event. The client must wait to receive
1238  * this event before executing this function again.
1239  *
1240  * \param pAddr Peer device address.
1241  * \param pIrk The peer's identity resolving key.
1242  * \param param Client-defined parameter returned with callback event.
1243  *
1244  * \return None.
1245  */
1246 /*************************************************************************************************/
1247 void DmPrivResolveAddr(uint8_t *pAddr, uint8_t *pIrk, uint16_t param);
1248 
1249 /*************************************************************************************************/
1250 /*!
1251  * \brief Add device to resolving list. When complete the client's callback function
1252  * is called with a DM_PRIV_ADD_DEV_TO_RES_LIST_IND event. The client must wait
1253  * to receive this event before executing this function again.
1254  *
1255  * \param addrType Peer identity address type.
1256  * \param pIdentityAddr Peer identity address.
1257  * \param pPeerIrk The peer's identity resolving key.
1258  * \param pLocalIrk The local identity resolving key.
1259  * \param enableLlPriv Set to TRUE to enable address resolution in LL.
1260  * \param param client-defined parameter returned with callback event.
1261  *
1262  * \return None.
1263  *
1264  * \Note This command cannot be used when address resolution is enabled in the Controller and:
1265  * - Advertising (other than periodic advertising) is enabled,
1266  * - Scanning is enabled, or
1267  * - (Extended) Create connection or Create Sync command is outstanding.
1268  *
1269  * \Note If the local or peer IRK associated with the peer Identity Address is all zeros then
1270  * the Controller will use or accept the local or peer Identity Address respectively.
1271  *
1272  * \Note Parameter 'enableLlPriv' should be set to TRUE when the last device is being added
1273  * to resolving list to enable address resolution in the Controller.
1274  */
1275 /*************************************************************************************************/
1276 void DmPrivAddDevToResList(uint8_t addrType, const uint8_t *pIdentityAddr, uint8_t *pPeerIrk,
1277  uint8_t *pLocalIrk, bool_t enableLlPriv, uint16_t param);
1278 
1279 /*************************************************************************************************/
1280 /*!
1281  * \brief Remove device from resolving list. When complete the client's callback function
1282  * is called with a DM_PRIV_REM_DEV_FROM_RES_LIST_IND event. The client must wait to
1283  * receive this event before executing this function again.
1284  *
1285  * \param addrType Peer identity address type.
1286  * \param pIdentityAddr Peer identity address.
1287  * \param param client-defined parameter returned with callback event.
1288  *
1289  * \return None.
1290  *
1291  * \Note This command cannot be used when address resolution is enabled in the Controller and:
1292  * - Advertising (other than periodic advertising) is enabled,
1293  * - Scanning is enabled, or
1294  * - (Extended) Create connection or Create Sync command is outstanding.
1295  */
1296 /*************************************************************************************************/
1297 void DmPrivRemDevFromResList(uint8_t addrType, const uint8_t *pIdentityAddr, uint16_t param);
1298 
1299 /*************************************************************************************************/
1300 /*!
1301  * \brief Clear resolving list. When complete the client's callback function is called with a
1302  * DM_PRIV_CLEAR_RES_LIST_IND event. The client must wait to receive this event before
1303  * executing this function again.
1304  *
1305  * \return None.
1306  *
1307  * \Note This command cannot be used when address resolution is enabled in the Controller and:
1308  * - Advertising (other than periodic advertising) is enabled,
1309  * - Scanning is enabled, or
1310  * - (Extended) Create connection or Create Sync command is outstanding.
1311  *
1312  * \Note Address resolution in Controller will be disabled when resolving list's cleared
1313  * successfully.
1314  */
1315 /*************************************************************************************************/
1316 void DmPrivClearResList(void);
1317 
1318 /*************************************************************************************************/
1319 /*!
1320  * \brief HCI read peer resolvable address command. When complete the client's callback
1321  * function is called with a DM_PRIV_READ_PEER_RES_ADDR_IND event. The client must
1322  * wait to receive this event before executing this function again.
1323  *
1324  * \param addrType Peer identity address type.
1325  * \param pIdentityAddr Peer identity address.
1326  *
1327  * \return None.
1328  */
1329 /*************************************************************************************************/
1330 void DmPrivReadPeerResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr);
1331 
1332 /*************************************************************************************************/
1333 /*!
1334  * \brief Read local resolvable address command. When complete the client's callback
1335  * function is called with a DM_PRIV_READ_LOCAL_RES_ADDR_IND event. The client must
1336  * wait to receive this event before executing this function again.
1337  *
1338  * \param addrType Peer identity address type.
1339  * \param pIdentityAddr Peer identity address.
1340  *
1341  * \return None.
1342  */
1343 /*************************************************************************************************/
1344 void DmPrivReadLocalResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr);
1345 
1346 /*************************************************************************************************/
1347 /*!
1348  * \brief Enable or disable address resolution in LL. When complete the client's callback
1349  * function is called with a DM_PRIV_SET_ADDR_RES_ENABLE_IND event. The client must
1350  * wait to receive this event before executing this function again.
1351  *
1352  * \param enable Set to TRUE to enable address resolution or FALSE to disable it.
1353  *
1354  * \return None.
1355  *
1356  * \Note This command can be used at any time except when:
1357  * - Advertising (other than periodic advertising) is enabled,
1358  * - Scanning is enabled, or
1359  * - (Extended) Create connection or Create Sync command is outstanding.
1360  */
1361 /*************************************************************************************************/
1362 void DmPrivSetAddrResEnable(bool_t enable);
1363 
1364 /*************************************************************************************************/
1365 /*!
1366  * \brief Set resolvable private address timeout command.
1367  *
1368  * \param rpaTimeout Timeout measured in seconds.
1369  *
1370  * \return None.
1371  */
1372 /*************************************************************************************************/
1373 void DmPrivSetResolvablePrivateAddrTimeout(uint16_t rpaTimeout);
1374 
1375 /*************************************************************************************************/
1376 /*!
1377  * \brief Set privacy mode for a given entry in the resolving list.
1378  *
1379  * \param addrType Peer identity address type.
1380  * \param pIdentityAddr Peer identity address.
1381  * \param mode Privacy mode (by default, network privacy mode is used).
1382  *
1383  * \return None.
1384  *
1385  * \Note This command can be used at any time except when:
1386  * - Advertising (other than periodic advertising) is enabled,
1387  * - Scanning is enabled, or
1388  * - (Extended) Create connection or Create Sync command is outstanding.
1389  */
1390 /*************************************************************************************************/
1391 void DmPrivSetPrivacyMode(uint8_t addrType, const uint8_t *pIdentityAddr, uint8_t mode);
1392 
1393 /*************************************************************************************************/
1394 /*!
1395  * \brief Generate a Resolvable Private Address (RPA).
1396  *
1397  * \param pIrk The identity resolving key.
1398  * \param param Client-defined parameter returned with callback event.
1399  *
1400  * \return None.
1401  */
1402 /*************************************************************************************************/
1403 void DmPrivGenerateAddr(uint8_t *pIrk, uint16_t param);
1404 
1405 /*************************************************************************************************/
1406 /*!
1407  * \brief Whether LL Privacy is enabled.
1408  *
1409  * \return TRUE if LL Privacy is enabled. FALSE, otherwise.
1410  */
1411 /*************************************************************************************************/
1412 bool_t DmLlPrivEnabled(void);
1413 
1414 /**@}*/
1415 
1416 /** \name DM Scanner Functions
1417  * Functions for controlling Legacy and Extended Scanner behavior.
1418  */
1419 /**@{*/
1420 
1421 /*************************************************************************************************/
1422 /*!
1423  * \brief Initialize DM legacy scanning.
1424  *
1425  * \return None.
1426  */
1427 /*************************************************************************************************/
1428 void DmScanInit(void);
1429 
1430 /*************************************************************************************************/
1431 /*!
1432  * \brief Initialize DM extended scanning.
1433  *
1434  * \return None.
1435  */
1436 /*************************************************************************************************/
1437 void DmExtScanInit(void);
1438 
1439 /*************************************************************************************************/
1440 /*!
1441  * \brief Initialize DM Periodic Advertising Sync Transfer (PAST) module.
1442  *
1443  * \return None.
1444  */
1445 /*************************************************************************************************/
1446 void DmPastInit(void);
1447 
1448 /*************************************************************************************************/
1449 /*!
1450  * \brief Initialize DM Connection Constant Tone Extension (CTE) module.
1451  *
1452  * \return None.
1453  */
1454 /*************************************************************************************************/
1455 void DmConnCteInit(void);
1456 
1457 /*************************************************************************************************/
1458 /*!
1459  * \brief Whether DM scanning is in legacy mode.
1460  *
1461  * \return TRUE if DM scanning is in legacy mode. FALSE, otherwise.
1462  */
1463 /*************************************************************************************************/
1464 bool_t DmScanModeLeg(void);
1465 
1466 /*************************************************************************************************/
1467 /*!
1468  * \brief Whether DM scanning is in extended mode.
1469  *
1470  * \return TRUE if DM scanning is in extended mode. FALSE, otherwise.
1471  */
1472 /*************************************************************************************************/
1473 bool_t DmScanModeExt(void);
1474 
1475 /*************************************************************************************************/
1476 /*!
1477  * \brief Start scanning on the given PHYs.
1478  *
1479  * \param scanPhys Scanner PHYs.
1480  * \param mode Discoverability mode.
1481  * \param pScanType Scan type array.
1482  * \param filterDup Filter duplicates. Set to TRUE to filter duplicate responses received
1483  * from the same device. Set to FALSE to receive all responses.
1484  * \param duration The scan duration, in milliseconds. If set to zero or both duration and
1485  * period set to non-zero, scanning will continue until DmScanStop() is called.
1486  * \param period The scan period, in 1.28 sec units (only applicable to AE). If set to zero,
1487  * periodic scanning is disabled.
1488  *
1489  * \return None.
1490  */
1491  /*************************************************************************************************/
1492 void DmScanStart(uint8_t scanPhys, uint8_t mode, const uint8_t *pScanType, bool_t filterDup,
1493  uint16_t duration, uint16_t period);
1494 
1495 /*************************************************************************************************/
1496 /*!
1497  * \brief Stop scanning.
1498  *
1499  * \return None.
1500  */
1501 /*************************************************************************************************/
1502 void DmScanStop(void);
1503 
1504 /*************************************************************************************************/
1505 /*!
1506  * \brief Set the scan interval and window for the specified PHYs.
1507  *
1508  * \param scanPhys Scanning PHYs.
1509  * \param pScanInterval Scan interval array.
1510  * \param pScanWindow Scan window array.
1511  *
1512  * \return None.
1513  */
1514 /*************************************************************************************************/
1515 void DmScanSetInterval(uint8_t scanPhys, uint16_t *pScanInterval, uint16_t *pScanWindow);
1516 
1517 /*************************************************************************************************/
1518 /*!
1519  * \brief Set the local address type used while scanning. This function can be used to
1520  * configure scanning to use a random address.
1521  *
1522  * \param addrType Address type.
1523  *
1524  * \return None.
1525  */
1526 /*************************************************************************************************/
1527 void DmScanSetAddrType(uint8_t addrType);
1528 
1529 /*************************************************************************************************/
1530 /*!
1531  * \brief Synchronize with periodic advertising from the given advertiser, and start receiving
1532  * periodic advertising packets.
1533  *
1534  * Note: The synchronization filter policy is used to determine whether the periodic
1535  * advertiser list is used. If the periodic advertiser list is not used, the
1536  * advertising SID, advertiser address type, and advertiser address parameters
1537  * specify the periodic advertising device to listen to; otherwise these parameters
1538  * are ignored.
1539  *
1540  * \param advSid Advertising SID.
1541  * \param advAddrType Advertiser address type.
1542  * \param pAdvAddr Advertiser address.
1543  * \param skip Number of periodic advertising packets that can be skipped after
1544  * successful receive.
1545  * \param syncTimeout Synchronization timeout.
1546  *
1547  * \return Sync indentifier.
1548  */
1549 /*************************************************************************************************/
1550 dmSyncId_t DmSyncStart(uint8_t advSid, uint8_t advAddrType, const uint8_t *pAdvAddr, uint16_t skip,
1551  uint16_t syncTimeout);
1552 
1553 /*************************************************************************************************/
1554 /*!
1555  * \brief Stop reception of the periodic advertising identified by the given sync identifier.
1556  *
1557  * \param syncId Sync identifier.
1558  *
1559  * \return None.
1560  */
1561 /*************************************************************************************************/
1562 void DmSyncStop(dmSyncId_t syncId);
1563 
1564 /*************************************************************************************************/
1565 /*!
1566  * \brief DM enable or disable initial periodic advertisement reporting.
1567  *
1568  * \param enable TRUE to enable initial reporting, FALSE to disable initial reporting.
1569  *
1570  * \return None.
1571  */
1572 /*************************************************************************************************/
1573 void DmSyncInitialRptEnable(bool_t enable);
1574 
1575 /*************************************************************************************************/
1576 /*!
1577  * \brief Add device to periodic advertiser list.
1578  *
1579  * \param advAddrType Advertiser address type.
1580  * \param pAdvAddr Advertiser address.
1581  * \param advSid Advertising SID.
1582  *
1583  * \return None.
1584  */
1585 /*************************************************************************************************/
1586 void DmAddDeviceToPerAdvList(uint8_t advAddrType, uint8_t *pAdvAddr, uint8_t advSid);
1587 
1588 /*************************************************************************************************/
1589 /*!
1590  * \brief DM remove device from periodic advertiser list.
1591  *
1592  * \param advAddrType Advertiser address type.
1593  * \param pAdvAddr Advertiser address.
1594  * \param advSid Advertising SID.
1595  *
1596  * \return None.
1597  */
1598 /*************************************************************************************************/
1599 void DmRemoveDeviceFromPerAdvList(uint8_t advAddrType, uint8_t *pAdvAddr, uint8_t advSid);
1600 
1601 /*************************************************************************************************/
1602 /*!
1603  * \brief DM clear periodic advertiser list.
1604  *
1605  * \return None.
1606  */
1607 /*************************************************************************************************/
1608 void DmClearPerAdvList(void);
1609 
1610 /*************************************************************************************************/
1611 /*!
1612  * \brief Enable or disable reports for the periodic advertising identified by the sync id.
1613  *
1614  * \param syncId Sync identifier.
1615  * \param enable TRUE to enable reporting, FALSE to disable reporting.
1616  *
1617  * \return None.
1618  */
1619 /*************************************************************************************************/
1620 void DmPastRptRcvEnable(dmSyncId_t syncId, bool_t enable);
1621 
1622 /*************************************************************************************************/
1623 /*!
1624  * \brief Send synchronization information about the periodic advertising identified by the
1625  * sync id to a connected device.
1626  *
1627  * \param connId Connection identifier.
1628  * \param serviceData Value provided by the Host.
1629  * \param syncId Sync identifier.
1630  *
1631  * \return None.
1632  */
1633 /*************************************************************************************************/
1634 void DmPastSyncTrsf(dmConnId_t connId, uint16_t serviceData, dmSyncId_t syncId);
1635 
1636 /*************************************************************************************************/
1637 /*!
1638  * \brief Send synchronization information about the periodic advertising in an advertising
1639  * set to a connected device.
1640  *
1641  * \param connId Connection identifier.
1642  * \param serviceData Value provided by the Host.
1643  * \param advHandle Advertising handle.
1644  *
1645  * \return None.
1646  */
1647 /*************************************************************************************************/
1648 void DmPastSetInfoTrsf(dmConnId_t connId, uint16_t serviceData, uint8_t advHandle);
1649 
1650 /*************************************************************************************************/
1651 /*!
1652  * \brief Specify how the Controller should process periodic advertising synchronization
1653  * information received from the device identified by the connnection handle.
1654  *
1655  * \param connId Connection identifier.
1656  * \param mode Action to be taken when periodic advertising info is received.
1657  * \param skip Number of consecutive periodic advertising packets that the receiver
1658  * may skip after successfully receiving a periodic advertising packet.
1659  * \param syncTimeout Maximum permitted time between successful receives. If this time is
1660  * exceeded, synchronization is lost.
1661  * \param cteType Whether to only synchronize to periodic advertising with certain
1662  * types of Constant Tone Extension.
1663  *
1664  * \return None.
1665  */
1666 /*************************************************************************************************/
1667 void DmPastConfig(dmConnId_t connId, uint8_t mode, uint16_t skip, uint16_t syncTimeout,
1668  uint8_t cteType);
1669 
1670 /*************************************************************************************************/
1671 /*!
1672  * \brief Specify the initial value for the mode, skip, timeout, and Constant Tone Extension type
1673  * to be used for all subsequent connections over the LE transport.
1674  *
1675  * \param mode Action to be taken when periodic advertising info is received.
1676  * \param skip Number of consecutive periodic advertising packets that the receiver
1677  * may skip after successfully receiving a periodic advertising packet.
1678  * \param syncTimeout Maximum permitted time between successful receives. If this time is
1679  * exceeded, synchronization is lost.
1680  * \param cteType Whether to only synchronize to periodic advertising with certain
1681  * types of Constant Tone Extension.
1682  *
1683  * \return None.
1684  */
1685 /*************************************************************************************************/
1686 void DmPastDefaultConfig(uint8_t mode, uint16_t skip, uint16_t syncTimeout, uint8_t cteType);
1687 
1688 /*************************************************************************************************/
1689 /*!
1690  * \brief Enable sampling received CTE fields on the specified connection, and configure the
1691  * antenna switching pattern, and switching and sampling slot durations to be used.
1692  *
1693  * \param connId Connection identifier.
1694  * \param slotDurations Switching and sampling slot durations to be used while receiving CTE.
1695  * \param switchPatternLen Number of Antenna IDs in switching pattern.
1696  * \param pAntennaIDs List of Antenna IDs in switching pattern.
1697  *
1698  * \return None.
1699  */
1700 /*************************************************************************************************/
1701 void DmConnCteRxSampleStart(dmConnId_t connId, uint8_t slotDurations, uint8_t switchPatternLen,
1702  uint8_t *pAntennaIDs);
1703 
1704 /*************************************************************************************************/
1705 /*!
1706  * \brief Disable sampling received CTE fields on the specified connection.
1707  *
1708  * \param connId Connection identifier.
1709  *
1710  * \return None.
1711  */
1712 /*************************************************************************************************/
1713 void DmConnCteRxSampleStop(dmConnId_t connId);
1714 
1715 /*************************************************************************************************/
1716 /*!
1717  * \brief Configure the antenna switching pattern, and permitted CTE types used for transmitting
1718  * CTEs requested by the peer device on the specified connection.
1719  *
1720  * \param connId Connection identifier.
1721  * \param cteTypeBits Permitted CTE type bits used for transmitting CTEs requested by peer.
1722  * \param switchPatternLen Number of Antenna IDs in switching pattern.
1723  * \param pAntennaIDs List of Antenna IDs in switching pattern.
1724  *
1725  * \return None.
1726  */
1727 /*************************************************************************************************/
1728 void DmConnCteTxConfig(dmConnId_t connId, uint8_t cteTypeBits, uint8_t switchPatternLen,
1729  uint8_t *pAntennaIDs);
1730 
1731 /*************************************************************************************************/
1732 /*!
1733  * \brief Initiate the CTE Request procedure on the specified connection.
1734  *
1735  * \param connId Connection identifier.
1736  * \param cteReqInt CTE request interval.
1737  * \param reqCteLen Minimum length of CTE being requested in 8 us units.
1738  * \param reqCteType Requested CTE type.
1739  *
1740  * \return None.
1741  */
1742 /*************************************************************************************************/
1743 void DmConnCteReqStart(dmConnId_t connId, uint16_t cteReqInt, uint8_t reqCteLen,
1744  uint8_t reqCteType);
1745 
1746 /*************************************************************************************************/
1747 /*!
1748  * \brief Stop initiating the CTE Request procedure on the specified connection.
1749  *
1750  * \param connId Connection identifier.
1751  *
1752  * \return None.
1753  */
1754 /*************************************************************************************************/
1755 void DmConnCteReqStop(dmConnId_t connId);
1756 
1757 /*************************************************************************************************/
1758 /*!
1759  * \brief Start responding to LL_CTE_REQ PDUs with LL_CTE_RSP PDUs on the specified connection.
1760  *
1761  * \param connId Connection identifier.
1762  *
1763  * \return None.
1764  */
1765 /*************************************************************************************************/
1766 void DmConnCteRspStart(dmConnId_t connId);
1767 
1768 /*************************************************************************************************/
1769 /*!
1770  * \brief Stop responding to LL_CTE_REQ PDUs with LL_CTE_RSP PDUs on the specified connection.
1771  *
1772  * \param connId Connection identifier.
1773  *
1774  * \return None.
1775  */
1776 /*************************************************************************************************/
1777 void DmConnCteRspStop(dmConnId_t connId);
1778 
1779 /*************************************************************************************************/
1780 /*!
1781  * \brief Read the switching rates, the sampling rates, the number of antennae, and the maximum
1782  * length of a transmitted Constant Tone Extension supported by the Controller.
1783  *
1784  * \return None.
1785  *
1786  * \note The antenna info will be returned with DM indication \ref DM_READ_ANTENNA_INFO_IND.
1787  */
1788 /*************************************************************************************************/
1789 void DmReadAntennaInfo(void);
1790 
1791 /**@}*/
1792 
1793 /** \name DM Connection Functions
1794  * Functions for forming connections and managing connection behavior and parameter updates.
1795  */
1796 /**@{*/
1797 
1798 /*************************************************************************************************/
1799 /*!
1800  * \brief Initialize DM connection manager.
1801  *
1802  * \return None.
1803  */
1804 /*************************************************************************************************/
1805 void DmConnInit(void);
1806 
1807 /*************************************************************************************************/
1808 /*!
1809  * \brief Initialize DM connection manager for operation as legacy master.
1810  *
1811  * \return None.
1812  */
1813 /*************************************************************************************************/
1814 void DmConnMasterInit(void);
1815 
1816 /*************************************************************************************************/
1817 /*!
1818  * \brief Initialize DM connection manager for operation as extended master.
1819  *
1820  * \return None.
1821  */
1822 /*************************************************************************************************/
1823 void DmExtConnMasterInit(void);
1824 
1825 /*************************************************************************************************/
1826 /*!
1827  * \brief Initialize DM connection manager for operation as legacy slave.
1828  *
1829  * \return None.
1830  */
1831 /*************************************************************************************************/
1832 void DmConnSlaveInit(void);
1833 
1834 /*************************************************************************************************/
1835 /*!
1836  * \brief Initialize DM connection manager for operation as extended slave.
1837  *
1838  * \return None.
1839  */
1840 /*************************************************************************************************/
1841 void DmExtConnSlaveInit(void);
1842 
1843 /*************************************************************************************************/
1844 /*!
1845  * \brief Register with the DM connection manager.
1846  *
1847  * \param clientId The client identifier.
1848  * \param cback Client callback function.
1849  *
1850  * \return None.
1851  */
1852 /*************************************************************************************************/
1853 void DmConnRegister(uint8_t clientId, dmCback_t cback);
1854 
1855 /*************************************************************************************************/
1856 /*!
1857  * \brief Open a connection to a peer device with the given address.
1858  *
1859  * \param clientId The client identifier.
1860  * \param initPhys Initiator PHYs.
1861  * \param addrType Address type.
1862  * \param pAddr Peer device address.
1863  *
1864  * \return Connection identifier.
1865  */
1866 /*************************************************************************************************/
1867 dmConnId_t DmConnOpen(uint8_t clientId, uint8_t initPhys, uint8_t addrType, uint8_t *pAddr);
1868 
1869 /*************************************************************************************************/
1870 /*!
1871  * \brief Close the connection with the give connection identifier.
1872  *
1873  * \param clientId The client identifier.
1874  * \param connId Connection identifier.
1875  * \param reason Reason connection is being closed.
1876  *
1877  * \return None.
1878  */
1879 /*************************************************************************************************/
1880 void DmConnClose(uint8_t clientId, dmConnId_t connId, uint8_t reason);
1881 
1882 /*************************************************************************************************/
1883 /*!
1884  * \brief Accept a connection from the given peer device by initiating directed advertising.
1885  *
1886  * \param clientId The client identifier.
1887  * \param advHandle Advertising handle.
1888  * \param advType Advertising type.
1889  * \param duration Advertising duration (in ms).
1890  * \param maxEaEvents Maximum number of extended advertising events.
1891  * \param addrType Address type.
1892  * \param pAddr Peer device address.
1893  *
1894  * \return Connection identifier.
1895  */
1896 /*************************************************************************************************/
1897 dmConnId_t DmConnAccept(uint8_t clientId, uint8_t advHandle, uint8_t advType, uint16_t duration,
1898  uint8_t maxEaEvents, uint8_t addrType, uint8_t *pAddr);
1899 
1900 /*************************************************************************************************/
1901 /*!
1902  * \brief Update the connection parameters of an open connection
1903  *
1904  * \param connId Connection identifier.
1905  * \param pConnSpec Connection specification.
1906  *
1907  * \return None.
1908  */
1909 /*************************************************************************************************/
1910 void DmConnUpdate(dmConnId_t connId, hciConnSpec_t *pConnSpec);
1911 
1912 /*************************************************************************************************/
1913 /*!
1914  * \brief Set the scan interval and window for connections to be created with DmConnOpen().
1915  *
1916  * \param scanInterval The scan interval.
1917  * \param scanWindow The scan window.
1918  *
1919  * \return None.
1920  */
1921 /*************************************************************************************************/
1922 void DmConnSetScanInterval(uint16_t scanInterval, uint16_t scanWindow);
1923 
1924 /*************************************************************************************************/
1925 /*!
1926  * \brief Set the scan interval and window for extended connections to be created with
1927  * DmConnOpen().
1928  *
1929  * \param initPhys Initiator PHYs.
1930  * \param pScanInterval Scan interval array.
1931  * \param pScanWindow Scan window array.
1932  *
1933  * \return None.
1934  */
1935 /*************************************************************************************************/
1936 void DmExtConnSetScanInterval(uint8_t initPhys, uint16_t *pScanInterval, uint16_t *pScanWindow);
1937 
1938 /*************************************************************************************************/
1939 /*!
1940  * \brief Set the connection spec parameters for connections to be created with DmConnOpen().
1941  *
1942  * \param pConnSpec Connection spec parameters.
1943  *
1944  * \return None.
1945  */
1946 /*************************************************************************************************/
1947 void DmConnSetConnSpec(hciConnSpec_t *pConnSpec);
1948 
1949 /*************************************************************************************************/
1950 /*!
1951  * \brief Set the extended connection spec parameters for extended connections to be created
1952  * with DmConnOpen().
1953  *
1954  * \param initPhys The initiator PHYs.
1955  * \param pConnSpec Connection spec parameters array.
1956  *
1957  * \return None.
1958  */
1959 /*************************************************************************************************/
1960 void DmExtConnSetConnSpec(uint8_t initPhys, hciConnSpec_t *pConnSpec);
1961 
1962 /*************************************************************************************************/
1963 /*!
1964  * \brief Set the local address type used for connections created with DmConnOpen().
1965  *
1966  * \param addrType Address type.
1967  *
1968  * \return None.
1969  */
1970 /*************************************************************************************************/
1971 void DmConnSetAddrType(uint8_t addrType);
1972 
1973 /*************************************************************************************************/
1974 /*!
1975  * \brief Configure a bit in the connection idle state mask as busy or idle.
1976  *
1977  * \param connId Connection identifier.
1978  * \param idleMask Bit in the idle state mask to configure.
1979  * \param idle DM_CONN_BUSY or DM_CONN_IDLE.
1980  *
1981  * \return None.
1982  */
1983 /*************************************************************************************************/
1984 void DmConnSetIdle(dmConnId_t connId, uint16_t idleMask, uint8_t idle);
1985 
1986 /*************************************************************************************************/
1987 /*!
1988  * \brief Check if a connection is idle.
1989  *
1990  * \param connId Connection identifier.
1991  *
1992  * \return Zero if connection is idle, nonzero if busy.
1993  */
1994 /*************************************************************************************************/
1995 uint16_t DmConnCheckIdle(dmConnId_t connId);
1996 
1997 /*************************************************************************************************/
1998 /*!
1999  * \brief Read RSSI of a given connection.
2000  *
2001  * \param connId Connection identifier.
2002  *
2003  * \return None.
2004  */
2005 /*************************************************************************************************/
2006 void DmConnReadRssi(dmConnId_t connId);
2007 
2008 /*************************************************************************************************/
2009 /*!
2010  * \brief Reply to the HCI remote connection parameter request event. This command is used to
2011  * indicate that the Host has accepted the remote device's request to change connection
2012  * parameters.
2013  *
2014  * \param connId Connection identifier.
2015  * \param pConnSpec Connection specification.
2016  *
2017  * \return None.
2018  */
2019 /*************************************************************************************************/
2020 void DmRemoteConnParamReqReply(dmConnId_t connId, hciConnSpec_t *pConnSpec);
2021 
2022 /*************************************************************************************************/
2023 /*!
2024  * \brief Negative reply to the HCI remote connection parameter request event. This command
2025  * is used to indicate that the Host has rejected the remote device's request to change
2026  * connection parameters.
2027  *
2028  * \param connId Connection identifier.
2029  * \param reason Reason for rejection.
2030  *
2031  * \return None.
2032  */
2033 /*************************************************************************************************/
2034 void DmRemoteConnParamReqNegReply(dmConnId_t connId, uint8_t reason);
2035 
2036 /*************************************************************************************************/
2037 /*!
2038  * \brief Set data length for a given connection.
2039  *
2040  * \param connId Connection identifier.
2041  * \param txOctets Maximum number of payload octets for a Data PDU.
2042  * \param txTime Maximum number of microseconds for a Data PDU.
2043  *
2044  * \return None.
2045  */
2046 /*************************************************************************************************/
2047 void DmConnSetDataLen(dmConnId_t connId, uint16_t txOctets, uint16_t txTime);
2048 
2049 /*************************************************************************************************/
2050 /*!
2051  * \brief Return the connection role indicating master or slave.
2052  *
2053  * \param connId Connection identifier.
2054  *
2055  * \return Device role.
2056  */
2057 /*************************************************************************************************/
2058 uint8_t DmConnRole(dmConnId_t connId);
2059 
2060 /*************************************************************************************************/
2061 /*!
2062  * \brief Set authenticated payload timeout for a given connection.
2063  *
2064  * \param connId Connection identifier.
2065  * \param timeout Timeout period in units of 10ms.
2066  *
2067  * \return None.
2068  */
2069 /*************************************************************************************************/
2070 void DmWriteAuthPayloadTimeout(dmConnId_t connId, uint16_t timeout);
2071 
2072 /**@}*/
2073 
2074 /** \name DM PHY Control Functions
2075  * Functions for setting PHY preferences.
2076  */
2077 /**@{*/
2078 
2079 /*************************************************************************************************/
2080 /*!
2081  * \brief Set the preferred values for the transmitter PHY and receiver PHY for all subsequent
2082  * connections.
2083  *
2084  * \param allPhys All PHYs preferences.
2085  * \param txPhys Preferred transmitter PHYs.
2086  * \param rxPhys Preferred receiver PHYs.
2087  *
2088  * \return None.
2089  */
2090 /*************************************************************************************************/
2091 void DmSetDefaultPhy(uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys);
2092 
2093 /*************************************************************************************************/
2094 /*!
2095  * \brief Read the current transmitter PHY and receiver PHY for a given connection.
2096  *
2097  * \param connId Connection identifier.
2098  *
2099  * \return None.
2100  */
2101 /*************************************************************************************************/
2102 void DmReadPhy(dmConnId_t connId);
2103 
2104 /*************************************************************************************************/
2105 /*!
2106  * \brief Set the PHY preferences for a given connection.
2107  *
2108  * \param connId Connection identifier.
2109  * \param allPhys All PHYs preferences.
2110  * \param txPhys Preferred transmitter PHYs.
2111  * \param rxPhys Preferred receiver PHYs.
2112  * \param phyOptions PHY options.
2113  *
2114  * \return None.
2115  */
2116 /*************************************************************************************************/
2117 void DmSetPhy(dmConnId_t connId, uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys, uint16_t phyOptions);
2118 
2119 /*************************************************************************************************/
2120 /*!
2121 * \brief Initialize DM PHY.
2122 *
2123 * \return None.
2124 */
2125 /*************************************************************************************************/
2126 void DmPhyInit(void);
2127 
2128 /**@}*/
2129 
2130 
2131 /** \name DM Device Functions
2132  * Device control functions
2133  */
2134 /**@{*/
2135 
2136 /*************************************************************************************************/
2137 /*!
2138  * \brief Reset the device.
2139  *
2140  * \return None.
2141  */
2142 /*************************************************************************************************/
2143 void DmDevReset(void);
2144 
2145 /*************************************************************************************************/
2146 /*!
2147  * \brief Set the random address to be used by the local device.
2148  *
2149  * \param pAddr Random address.
2150  *
2151  * \return None.
2152  */
2153 /*************************************************************************************************/
2154 void DmDevSetRandAddr(uint8_t *pAddr);
2155 
2156 /*************************************************************************************************/
2157 /*!
2158  * \brief Add a peer device to the white list. Note that this function cannot be called
2159  * while advertising, scanning, or connecting with white list filtering active.
2160  *
2161  * \param addrType Address type.
2162  * \param pAddr Peer device address.
2163  *
2164  * \return None.
2165  */
2166 /*************************************************************************************************/
2167 void DmDevWhiteListAdd(uint8_t addrType, uint8_t *pAddr);
2168 
2169 /*************************************************************************************************/
2170 /*!
2171  * \brief Remove a peer device from the white list. Note that this function cannot be called
2172  * while advertising, scanning, or connecting with white list filtering active.
2173  *
2174  * \param addrType Address type.
2175  * \param pAddr Peer device address.
2176  *
2177  * \return None.
2178  */
2179 /*************************************************************************************************/
2180 void DmDevWhiteListRemove(uint8_t addrType, uint8_t *pAddr);
2181 
2182 /*************************************************************************************************/
2183 /*!
2184  * \brief Clear the white list. Note that this function cannot be called while
2185  * advertising, scanning, or connecting with white list filtering active.
2186  *
2187  * \return None.
2188  */
2189 /*************************************************************************************************/
2190 void DmDevWhiteListClear(void);
2191 
2192 /*************************************************************************************************/
2193 /*!
2194  * \brief Set the Advertising, Scanning or Initiator filter policy.
2195  *
2196  * \param mode Policy mode.
2197  * \param policy Filter policy.
2198  *
2199  * \return TRUE if the filter policy was successfully set, FALSE otherwise.
2200  */
2201 /*************************************************************************************************/
2202 bool_t DmDevSetFilterPolicy(uint8_t mode, uint8_t policy);
2203 
2204 /*************************************************************************************************/
2205 /*!
2206  * \brief Set the Advertising filter policy for the given advertising, Scanning or Initiator
2207  * filter policy.
2208  *
2209  * \param advHandle Advertising handle (only applicable to advertising).
2210  * \param mode Policy mode.
2211  * \param policy Filter policy.
2212  *
2213  * \return TRUE if the filter policy was successfully set, FALSE otherwise.
2214  */
2215 /*************************************************************************************************/
2216 bool_t DmDevSetExtFilterPolicy(uint8_t advHandle, uint8_t mode, uint8_t policy);
2217 
2218 /*************************************************************************************************/
2219 /*!
2220  * \brief Vendor-specific controller initialization function.
2221  *
2222  * \param param Vendor-specific parameter.
2223  *
2224  * \return None.
2225  */
2226 /*************************************************************************************************/
2227 void DmDevVsInit(uint8_t param);
2228 
2229 /**@}*/
2230 
2231 /** \name DM Security Functions
2232  * Functions for accessing and controlling security configuration of device.
2233  */
2234 /**@{*/
2235 
2236 /*************************************************************************************************/
2237 /*!
2238  * \brief Initialize DM security.
2239  *
2240  * \return None.
2241  */
2242 /*************************************************************************************************/
2243 void DmSecInit(void);
2244 
2245 /*************************************************************************************************/
2246 /*!
2247  * \brief Initialize DM LE Secure Connections security.
2248  *
2249  * \return None.
2250  */
2251 /*************************************************************************************************/
2252 void DmSecLescInit(void);
2253 
2254 /*************************************************************************************************/
2255 /*!
2256  * \brief This function is called by a master device to initiate pairing.
2257  *
2258  * \param connId DM connection ID.
2259  * \param oob Out-of-band pairing data present or not present.
2260  * \param auth Authentication and bonding flags.
2261  * \param iKeyDist Initiator key distribution flags.
2262  * \param rKeyDist Responder key distribution flags.
2263  *
2264  * \return None.
2265  */
2266 /*************************************************************************************************/
2267 void DmSecPairReq(dmConnId_t connId, bool_t oob, uint8_t auth, uint8_t iKeyDist, uint8_t rKeyDist);
2268 
2269 /*************************************************************************************************/
2270 /*!
2271  * \brief This function is called by a slave device to proceed with pairing after a
2272  * DM_SEC_PAIR_IND event is received.
2273  *
2274  * \param connId DM connection ID.
2275  * \param oob Out-of-band pairing data present or not present.
2276  * \param auth Authentication and bonding flags.
2277  * \param iKeyDist Initiator key distribution flags.
2278  * \param rKeyDist Responder key distribution flags.
2279  *
2280  * \return None.
2281  */
2282 /*************************************************************************************************/
2283 void DmSecPairRsp(dmConnId_t connId, bool_t oob, uint8_t auth, uint8_t iKeyDist, uint8_t rKeyDist);
2284 
2285 /*************************************************************************************************/
2286 /*!
2287  * \brief This function is called to cancel the pairing process.
2288  *
2289  * \param connId DM connection ID.
2290  * \param reason Failure reason.
2291  *
2292  * \return None.
2293  */
2294 /*************************************************************************************************/
2295 void DmSecCancelReq(dmConnId_t connId, uint8_t reason);
2296 
2297 /*************************************************************************************************/
2298 /*!
2299  * \brief This function is called in response to a DM_SEC_AUTH_REQ_IND event to provide
2300  * PIN or OOB data during pairing.
2301  *
2302  * \param connId DM connection ID.
2303  * \param authDataLen Length of PIN or OOB data.
2304  * \param pAuthData pointer to PIN or OOB data.
2305  *
2306  * \return None.
2307  */
2308 /*************************************************************************************************/
2309 void DmSecAuthRsp(dmConnId_t connId, uint8_t authDataLen, uint8_t *pAuthData);
2310 
2311 /*************************************************************************************************/
2312 /*!
2313  * \brief This function is called by a slave device to request that the master initiates
2314  * pairing or link encryption.
2315  *
2316  * \param connId DM connection ID.
2317  * \param auth Authentication flags.
2318  *
2319  * \return None.
2320  */
2321 /*************************************************************************************************/
2322 void DmSecSlaveReq(dmConnId_t connId, uint8_t auth);
2323 
2324 /*************************************************************************************************/
2325 /*!
2326  * \brief This function is called by a master device to initiate link encryption.
2327  *
2328  * \param connId DM connection ID.
2329  * \param secLevel Security level of pairing when LTK was exchanged.
2330  * \param pLtk Pointer to LTK parameter structure.
2331  *
2332  * \return None.
2333  */
2334 /*************************************************************************************************/
2335 void DmSecEncryptReq(dmConnId_t connId, uint8_t secLevel, dmSecLtk_t *pLtk);
2336 
2337 /*************************************************************************************************/
2338 /*!
2339  * \brief This function is called by a slave in response to a DM_SEC_LTK_REQ_IND event
2340  * to provide the long term key used for encryption.
2341  *
2342  * \param connId DM connection ID.
2343  * \param keyFound TRUE if key found.
2344  * \param secLevel Security level of pairing when key was exchanged.
2345  * \param pKey Pointer to the key, if found.
2346  *
2347  * \return None.
2348  */
2349 /*************************************************************************************************/
2350 void DmSecLtkRsp(dmConnId_t connId, bool_t keyFound, uint8_t secLevel, uint8_t *pKey);
2351 
2352 /*************************************************************************************************/
2353 /*!
2354  * \brief This function sets the local CSRK used by the device.
2355  *
2356  * \param pCsrk Pointer to CSRK.
2357  *
2358  * \return None.
2359  */
2360 /*************************************************************************************************/
2361 void DmSecSetLocalCsrk(uint8_t *pCsrk);
2362 
2363 /*************************************************************************************************/
2364 /*!
2365  * \brief This function sets the local IRK used by the device.
2366  *
2367  * \param pIrk Pointer to IRK.
2368  *
2369  * \return None.
2370  */
2371 /*************************************************************************************************/
2372 void DmSecSetLocalIrk(uint8_t *pIrk);
2373 
2374 /*************************************************************************************************/
2375 /*!
2376  * \brief This function generates an ECC key for use with LESC security.
2377  *
2378  * \return None.
2379  */
2380 /*************************************************************************************************/
2381 void DmSecGenerateEccKeyReq(void);
2382 
2383 /*************************************************************************************************/
2384 /*!
2385  * \brief This function sets the ECC key for use with LESC security.
2386  *
2387  * \param pKey Pointer to key.
2388  *
2389  * \return None.
2390  */
2391 /*************************************************************************************************/
2392 void DmSecSetEccKey(secEccKey_t *pKey);
2393 
2394 /*************************************************************************************************/
2395 /*!
2396  * \brief This function gets the local ECC key for use with LESC security.
2397  *
2398  * \return Pointer to local ECC key.
2399  */
2400 /*************************************************************************************************/
2402 
2403 /*************************************************************************************************/
2404 /*!
2405  * \brief This function sets the ECC key for use with LESC security to standard debug keys values.
2406  *
2407  * \return None.
2408  */
2409 /*************************************************************************************************/
2410 void DmSecSetDebugEccKey(void);
2411 
2412 /*************************************************************************************************/
2413 /*!
2414  * \brief This function configures the DM to use OOB pairing for the given connection.
2415  * The pRand and pConfirm contain the Random and Confirm values exchanged via
2416  * out of band methods.
2417  *
2418  * \param connId ID of the connection.
2419  * \param pConfig Pointer to OOB configuration.
2420  *
2421  * \return Pointer to IRK.
2422  */
2423 /*************************************************************************************************/
2424 void DmSecSetOob(dmConnId_t connId, dmSecLescOobCfg_t *pConfig);
2425 
2426 /*************************************************************************************************/
2427 /*!
2428  * \brief This function calculates the local random and confirm values used in LESC OOB pairing.
2429  * The operation's result is posted as a DM_SEC_CALC_OOB_IND event to the application's DM
2430  * callback handler. The local rand and confirm values are exchanged with the peer via
2431  * out-of-band (OOB) methods and passed into the DmSecSetOob after DM_CONN_OPEN_IND.
2432  *
2433  * \param pRand Random value used in calculation.
2434  * \param pPubKeyX X component of the local public key.
2435  *
2436  * \return None.
2437  */
2438 /*************************************************************************************************/
2439 void DmSecCalcOobReq(uint8_t *pRand, uint8_t *pPubKeyX);
2440 
2441 /*************************************************************************************************/
2442 /*!
2443  * \brief This function is called by the application in response to a DM_SEC_COMPARE_IND event.
2444  * The valid parameter indicates if the compare value of the DM_SEC_COMPARE_IND was valid.
2445  *
2446  * \param connId ID of the connection.
2447  * \param valid TRUE if compare value was valid
2448  *
2449  * \return None.
2450  */
2451 /*************************************************************************************************/
2452 void DmSecCompareRsp(dmConnId_t connId, bool_t valid);
2453 
2454 /*************************************************************************************************/
2455 /*!
2456  * \brief This function returns the 6-digit compare value for the specified 128-bit confirm value.
2457  *
2458  * \param pConfirm Pointer to 128-bit comfirm value.
2459  *
2460  * \return Six-digit compare value.
2461  */
2462 /*************************************************************************************************/
2463 uint32_t DmSecGetCompareValue(uint8_t *pConfirm);
2464 
2465 /**@}*/
2466 
2467 /** \name DM Internal Functions
2468  * Functions called internally by the stack.
2469  */
2470 /**@{*/
2471 
2472 /*************************************************************************************************/
2473 /*!
2474  * \brief Map an address type to a type used by LL.
2475  *
2476  * \param addrType Address type used by Host.
2477  *
2478  * \return Address type used by LL.
2479  */
2480 /*************************************************************************************************/
2481 uint8_t DmLlAddrType(uint8_t addrType);
2482 
2483 /*************************************************************************************************/
2484 /*!
2485  * \brief Map an address type to a type used by Host.
2486  *
2487  * \param addrType Address type used by LL.
2488  *
2489  * \return Address type used by Host.
2490  */
2491 /*************************************************************************************************/
2492 uint8_t DmHostAddrType(uint8_t addrType);
2493 
2494 /*************************************************************************************************/
2495 /*!
2496  * \brief Return size of a DM callback event.
2497  *
2498  * \param pDmEvt DM callback event.
2499  *
2500  * \return Size of DM callback event.
2501  */
2502 /*************************************************************************************************/
2503 uint16_t DmSizeOfEvt(dmEvt_t *pDmEvt);
2504 
2505 /*************************************************************************************************/
2506 /*!
2507  * \brief For internal use only. L2C calls this function to send the result of an L2CAP
2508  * connection update response to DM.
2509  *
2510  * \param handle Connection handle.
2511  * \param reason Connection update response reason code.
2512  * \return None.
2513  */
2514 /*************************************************************************************************/
2515 void DmL2cConnUpdateCnf(uint16_t handle, uint16_t reason);
2516 
2517 /*************************************************************************************************/
2518 /*!
2519  * \brief For internal use only. L2C calls this function to send the result of an L2CAP
2520  * Command Reject up to the application.
2521  *
2522  * \param handle Connection handle.
2523  * \param result Connection update result code.
2524  * \return None.
2525  */
2526 /*************************************************************************************************/
2527 void DmL2cCmdRejInd(uint16_t handle, uint16_t result);
2528 
2529 /*************************************************************************************************/
2530 /*!
2531  * \brief For internal use only. L2C calls this function when it receives a connection update
2532  * request from a peer device.
2533  *
2534  * \param identifier Identifier value.
2535  * \param handle Connection handle.
2536  * \param pConnSpec Connection spec parameters.
2537  *
2538  * \return None.
2539  */
2540 /*************************************************************************************************/
2541 void DmL2cConnUpdateInd(uint8_t identifier, uint16_t handle, hciConnSpec_t *pConnSpec);
2542 
2543 /*************************************************************************************************/
2544 /*!
2545  * \brief For internal use only. Find the connection ID with matching handle.
2546  *
2547  * \param handle Handle to find.
2548  *
2549  * \return Connection ID or DM_CONN_ID_NONE if error.
2550  */
2551 /*************************************************************************************************/
2552 dmConnId_t DmConnIdByHandle(uint16_t handle);
2553 
2554 /*************************************************************************************************/
2555 /*!
2556  * \brief For internal use only. Return TRUE if the connection is in use.
2557  *
2558  * \param connId Connection ID.
2559  *
2560  * \return TRUE if the connection is in use, FALSE otherwise.
2561  */
2562 /*************************************************************************************************/
2563 bool_t DmConnInUse(dmConnId_t connId);
2564 
2565 /*************************************************************************************************/
2566 /*!
2567  * \brief For internal use only. Return the peer address type.
2568  *
2569  * \param connId Connection ID.
2570  *
2571  * \return Peer address type.
2572  */
2573 /*************************************************************************************************/
2574 uint8_t DmConnPeerAddrType(dmConnId_t connId);
2575 
2576 /*************************************************************************************************/
2577 /*!
2578  * \brief For internal use only. Return the peer device address.
2579  *
2580  * \param connId Connection ID.
2581  *
2582  * \return Pointer to peer device address.
2583  */
2584 /*************************************************************************************************/
2585 uint8_t *DmConnPeerAddr(dmConnId_t connId);
2586 
2587 /*************************************************************************************************/
2588 /*!
2589  * \brief For internal use only. Return the local address type.
2590  *
2591  * \param connId Connection ID.
2592  *
2593  * \return Local address type.
2594  */
2595 /*************************************************************************************************/
2596 uint8_t DmConnLocalAddrType(dmConnId_t connId);
2597 
2598 /*************************************************************************************************/
2599 /*!
2600  * \brief For internal use only. Return the local address.
2601  *
2602  * \param connId Connection ID.
2603  *
2604  * \return Pointer to local address.
2605  */
2606 /*************************************************************************************************/
2607 uint8_t *DmConnLocalAddr(dmConnId_t connId);
2608 
2609 /*************************************************************************************************/
2610 /*!
2611 * \brief For internal use only. Return the peer resolvable private address (RPA).
2612 *
2613 * \param connId Connection ID.
2614 *
2615 * \return Pointer to peer RPA.
2616 */
2617 /*************************************************************************************************/
2618 uint8_t *DmConnPeerRpa(dmConnId_t connId);
2619 
2620 /*************************************************************************************************/
2621 /*!
2622 * \brief For internal use only. Return the local resolvable private address (RPA).
2623 *
2624 * \param connId Connection ID.
2625 *
2626 * \return Pointer to local RPA.
2627 */
2628 /*************************************************************************************************/
2629 uint8_t *DmConnLocalRpa(dmConnId_t connId);
2630 
2631 /*************************************************************************************************/
2632 /*!
2633  * \brief For internal use only. Return the security level of the connection.
2634  *
2635  * \param connId Connection ID.
2636  *
2637  * \return Security level of the connection.
2638  */
2639 /*************************************************************************************************/
2640 uint8_t DmConnSecLevel(dmConnId_t connId);
2641 
2642 /*************************************************************************************************/
2643 /*!
2644  * \brief For internal use only. This function is called by SMP to request encryption.
2645  *
2646  * \param connId DM connection ID.
2647  * \param secLevel Security level of pairing when key was exchanged.
2648  * \param pKey Pointer to key.
2649  *
2650  * \return None.
2651  */
2652 /*************************************************************************************************/
2653 void DmSmpEncryptReq(dmConnId_t connId, uint8_t secLevel, uint8_t *pKey);
2654 
2655 /*************************************************************************************************/
2656 /*!
2657  * \brief For internal use only. Execute DM callback from SMP procedures.
2658  *
2659  * \param pDmEvt Pointer to callback event data.
2660  *
2661  * \return None.
2662  */
2663 /*************************************************************************************************/
2664 void DmSmpCbackExec(dmEvt_t *pDmEvt);
2665 
2666 /*************************************************************************************************/
2667 /*!
2668  * \brief For internal use only. This function gets the local CSRK used by the device.
2669  *
2670  * \return Pointer to CSRK.
2671  */
2672 /*************************************************************************************************/
2673 uint8_t *DmSecGetLocalCsrk(void);
2674 
2675 /*************************************************************************************************/
2676 /*!
2677  * \brief For internal use only. This function gets the local IRK used by the device.
2678  *
2679  * \return Pointer to IRK.
2680  */
2681 /*************************************************************************************************/
2682 uint8_t *DmSecGetLocalIrk(void);
2683 
2684 /*************************************************************************************************/
2685 /*!
2686  * \brief For internal use only. Read the features of the remote device.
2687  *
2688  * \param connId Connection identifier.
2689  *
2690  * \return None.
2691  */
2692 /*************************************************************************************************/
2693 void DmReadRemoteFeatures(dmConnId_t connId);
2694 
2695 /*************************************************************************************************/
2696 /*!
2697  * \brief Read the version info of the remote device.
2698  *
2699  * \param connId Connection identifier.
2700  *
2701  * \return None.
2702  */
2703 /*************************************************************************************************/
2704 void DmReadRemoteVerInfo(dmConnId_t connId);
2705 
2706 /**@}*/
2707 
2708 /*! \} */ /* STACK_DM_API */
2709 
2710 #ifdef __cplusplus
2711 };
2712 #endif
2713 
2714 #endif /* DM_API_H */
uint8_t * DmSecGetLocalCsrk(void)
For internal use only. This function gets the local CSRK used by the device.
void DmScanStop(void)
Stop scanning.
Private resolvable address generated.
Definition: dm_api.h:464
void DmRemoveDeviceFromPerAdvList(uint8_t advAddrType, uint8_t *pAdvAddr, uint8_t advSid)
DM remove device from periodic advertiser list.
void DmPerAdvConfig(uint8_t advHandle)
Set the advertising parameters for periodic advertising.
Remote features from peer device.
Definition: dm_api.h:495
Data structure for DM_L2C_CMD_REJ_IND.
Definition: dm_api.h:671
bool_t DmDevSetFilterPolicy(uint8_t mode, uint8_t policy)
Set the Advertising, Scanning or Initiator filter policy.
LE read local resolving address command complete event.
Definition: hci_api.h:517
Extended scan data received from peer device.
Definition: dm_api.h:484
Data type for DM_SEC_PAIR_IND.
Definition: dm_api.h:585
uint8_t * DmConnPeerRpa(dmConnId_t connId)
For internal use only. Return the peer resolvable private address (RPA).
bool_t DmAdvModeExt(void)
Whether DM advertising is in extended mode.
bool_t DmAdvSetName(uint8_t len, uint8_t *pValue, uint16_t *pAdvDataLen, uint8_t *pAdvData, uint16_t advDataBufLen)
Set the device name in the given advertising or scan response data. If the name can only fit in the d...
Set default PHY.
Definition: dm_api.h:477
void DmConnUpdate(dmConnId_t connId, hciConnSpec_t *pConnSpec)
Update the connection parameters of an open connection.
uint16_t handle
Connection handle.
Definition: dm_api.h:675
Configuration structure.
Definition: dm_api.h:527
hciLeSetConnCteRxParamsCmdCmplEvt_t connCteRxSampleStop
handles DM_CONN_CTE_RX_SAMPLE_STOP_IND
Definition: dm_api.h:756
uint8_t dmConnId_t
Connection identifier.
Definition: dm_api.h:521
uint8_t secLevel
Security level of pairing when key was exchanged.
Definition: dm_api.h:607
dmConnId_t DmConnOpen(uint8_t clientId, uint8_t initPhys, uint8_t addrType, uint8_t *pAddr)
Open a connection to a peer device with the given address.
void DmExtConnMasterInit(void)
Initialize DM connection manager for operation as extended master.
void DmAdvIncTxPwr(uint8_t advHandle, bool_t incTxPwr, int8_t advTxPwr)
Set whether or not to include TxPower in extended header of advertising PDU.
hciReadRssiCmdCmplEvt_t readRssi
handles DM_CONN_READ_RSSI_IND
Definition: dm_api.h:721
wsfMsgHdr_t hdr
Common header.
Definition: dm_api.h:695
Advertising started.
Definition: dm_api.h:441
wsfMsgHdr_t hdr
Header.
Definition: dm_api.h:614
uint8_t * DmConnLocalAddr(dmConnId_t connId)
For internal use only. Return the local address.
void DmDevReset(void)
Reset the device.
ECC Security callback parameters structure.
Definition: sec_api.h:120
void DmSecCalcOobReq(uint8_t *pRand, uint8_t *pPubKeyX)
This function calculates the local random and confirm values used in LESC OOB pairing. The operation&#39;s result is posted as a DM_SEC_CALC_OOB_IND event to the application&#39;s DM callback handler. The local rand and confirm values are exchanged with the peer via out-of-band (OOB) methods and passed into the DmSecSetOob after DM_CONN_OPEN_IND.
Connection RSSI read.
Definition: dm_api.h:465
bool_t DmConnInUse(dmConnId_t connId)
For internal use only. Return TRUE if the connection is in use.
HCI subsystem API.
hciLeConnCteReqEnableCmdCmplEvt_t connCteReqStart
handles DM_CONN_CTE_REQ_START_IND
Definition: dm_api.h:758
Advertising set(s) started.
Definition: dm_api.h:479
void DmPrivClearResList(void)
Clear resolving list. When complete the client&#39;s callback function is called with a DM_PRIV_CLEAR_RES...
void DmConnSetDataLen(dmConnId_t connId, uint16_t txOctets, uint16_t txTime)
Set data length for a given connection.
wsfMsgHdr_t hdr
Header.
Definition: dm_api.h:579
void DmAdvSetFragPref(uint8_t advHandle, uint8_t fragPref)
Set fragment preference for advertising data.
void DmConnCteRxSampleStart(dmConnId_t connId, uint8_t slotDurations, uint8_t switchPatternLen, uint8_t *pAntennaIDs)
Enable sampling received CTE fields on the specified connection, and configure the antenna switching ...
LE connection complete event.
Definition: hci_api.h:122
void DmSecSetEccKey(secEccKey_t *pKey)
This function sets the ECC key for use with LESC security.
Write authenticated payload to command complete event.
Definition: hci_api.h:553
void DmDevVsInit(uint8_t param)
Vendor-specific controller initialization function.
void DmScanStart(uint8_t scanPhys, uint8_t mode, const uint8_t *pScanType, bool_t filterDup, uint16_t duration, uint16_t period)
Start scanning on the given PHYs.
LE PHY update complete event.
Definition: hci_api.h:585
hciLeConnCteRspEnableCmdCmplEvt_t connCteRspStart
handles DM_CONN_CTE_RSP_START_IND
Definition: dm_api.h:760
dmSyncId_t DmSyncStart(uint8_t advSid, uint8_t advAddrType, const uint8_t *pAdvAddr, uint16_t skip, uint16_t syncTimeout)
Synchronize with periodic advertising from the given advertiser, and start receiving periodic adverti...
void DmDevPrivInit(void)
Initialize device privacy module.
Data type for DM_SEC_COMPARE_IND.
Definition: dm_api.h:612
Pairing failed or other security failure.
Definition: dm_api.h:451
#define SMP_RAND8_LEN
Random 8-byte number length.
Definition: smp_defs.h:179
hciAuthPayloadToExpiredEvt_t authToExpired
handles DM_CONN_AUTH_TO_EXPIRED_IND
Definition: dm_api.h:731
Scan data received from peer device.
Definition: dm_api.h:446
Peer resolving address read.
Definition: dm_api.h:469
hciLeAddDevToResListCmdCmplEvt_t addDevToResList
handles DM_PRIV_ADD_DEV_TO_RES_LIST_IND
Definition: dm_api.h:722
void DmSecSlaveReq(dmConnId_t connId, uint8_t auth)
This function is called by a slave device to request that the master initiates pairing or link encryp...
wsfMsgHdr_t hdr
Header.
Definition: dm_api.h:666
bool_t DmScanModeExt(void)
Whether DM scanning is in extended mode.
CTE request failed.
Definition: dm_api.h:498
Local resolving address read.
Definition: dm_api.h:470
Data type for DM_PRIV_GENERATE_ADDR_IND.
Definition: dm_api.h:626
uint8_t * DmFindAdType(uint8_t adType, uint16_t dataLen, uint8_t *pData)
Find an advertising data element in the given advertising or scan response data.
uint16_t DmExtMaxAdvDataLen(uint8_t advType, bool_t useLegacyPdu)
Get the maximum advertising data length supported by Controller for a given advertising type...
Write authenticated payload complete.
Definition: dm_api.h:474
void DmAdvRemoveAdvSet(uint8_t advHandle)
Remove an advertising set.
wsfMsgHdr_t hdr
Header.
Definition: dm_api.h:659
void DmConnCteRspStart(dmConnId_t connId)
Start responding to LL_CTE_REQ PDUs with LL_CTE_RSP PDUs on the specified connection.
void DmSecCompareRsp(dmConnId_t connId, bool_t valid)
This function is called by the application in response to a DM_SEC_COMPARE_IND event. The valid parameter indicates if the compare value of the DM_SEC_COMPARE_IND was valid.
Responding to connection CTE request started.
Definition: dm_api.h:504
dmAdvSetStartEvt_t advSetStart
handles DM_ADV_SET_START_IND
Definition: dm_api.h:735
hciLeConnCteReqEnableCmdCmplEvt_t connCteReqStop
handles DM_CONN_CTE_REQ_STOP_IND
Definition: dm_api.h:759
void DmSyncStop(dmSyncId_t syncId)
Stop reception of the periodic advertising identified by the given sync identifier.
uint8_t auth
Authentication and bonding flags.
Definition: dm_api.h:598
hciReadRemoteVerInfoCmplEvt_t readRemVerInfo
handles DM_READ_REMOTE_VER_INFO_IND
Definition: dm_api.h:752
void DmRegister(dmCback_t cback)
Register a callback with DM for scan and advertising events.
void DmSecAuthRsp(dmConnId_t connId, uint8_t authDataLen, uint8_t *pAuthData)
This function is called in response to a DM_SEC_AUTH_REQ_IND event to provide PIN or OOB data during ...
LE periodic advertising sync transfer received.
Definition: hci_api.h:262
void DmPrivAddDevToResList(uint8_t addrType, const uint8_t *pIdentityAddr, uint8_t *pPeerIrk, uint8_t *pLocalIrk, bool_t enableLlPriv, uint16_t param)
Add device to resolving list. When complete the client&#39;s callback function is called with a DM_PRIV_A...
void DmAdvUseLegacyPdu(uint8_t advHandle, bool_t useLegacyPdu)
Set whether or not to use legacy advertising PDUs with extended advertising.
hciLeConnCmplEvt_t connOpen
handles DM_CONN_OPEN_IND
Definition: dm_api.h:703
Data type for DM_SEC_SLAVE_REQ_IND.
Definition: dm_api.h:595
void DmSecPairRsp(dmConnId_t connId, bool_t oob, uint8_t auth, uint8_t iKeyDist, uint8_t rKeyDist)
This function is called by a slave device to proceed with pairing after a DM_SEC_PAIR_IND event is re...
Data type for DmSecSetOob().
Definition: dm_api.h:770
Hardware error event.
Definition: hci_api.h:397
void DmPastRptRcvEnable(dmSyncId_t syncId, bool_t enable)
Enable or disable reports for the periodic advertising identified by the sync id. ...
LE add device to resolving list command complete event.
Definition: hci_api.h:532
void DmConnCteRxSampleStop(dmConnId_t connId)
Disable sampling received CTE fields on the specified connection.
dmSecKeypressIndEvt_t keypressInd
handles DM_SEC_KEYPRESS_IND
Definition: dm_api.h:718
uint8_t addrType
Address Type.
Definition: dm_api.h:545
uint16_t DmSizeOfEvt(dmEvt_t *pDmEvt)
Return size of a DM callback event.
wsfMsgHdr_t hdr
Header.
Definition: dm_api.h:565
LE CTE request failed event.
Definition: hci_api.h:629
void DmAdvSetInterval(uint8_t advHandle, uint16_t intervalMin, uint16_t intervalMax)
Set the minimum and maximum advertising intervals.
void DmReadAntennaInfo(void)
Read the switching rates, the sampling rates, the number of antennae, and the maximum length of a tra...
void DmConnMasterInit(void)
Initialize DM connection manager for operation as legacy master.
Result of ECC Key Generation.
Definition: dm_api.h:460
uint8_t * DmSecGetLocalIrk(void)
For internal use only. This function gets the local IRK used by the device.
hciLeAdvReportEvt_t scanReport
handles DM_SCAN_REPORT_IND
Definition: dm_api.h:702
hciLeRemDevFromResListCmdCmplEvt_t remDevFromResList
handles DM_PRIV_REM_DEV_FROM_RES_LIST_IND
Definition: dm_api.h:723
dmSecPairIndEvt_t pairInd
handles DM_SEC_PAIR_IND
Definition: dm_api.h:713
void DmSecPairReq(dmConnId_t connId, bool_t oob, uint8_t auth, uint8_t iKeyDist, uint8_t rKeyDist)
This function is called by a master device to initiate pairing.
dmConnId_t DmConnIdByHandle(uint16_t handle)
For internal use only. Find the connection ID with matching handle.
dmAdvNewAddrIndEvt_t advNewAddr
handles DM_ADV_NEW_ADDR_IND
Definition: dm_api.h:699
uint8_t * DmConnLocalRpa(dmConnId_t connId)
For internal use only. Return the local resolvable private address (RPA).
dmSecEncryptIndEvt_t encryptInd
handles DM_SEC_ENCRYPT_IND
Definition: dm_api.h:708
void DmPrivSetAddrResEnable(bool_t enable)
Enable or disable address resolution in LL. When complete the client&#39;s callback function is called wi...
Scanning stopped.
Definition: dm_api.h:445
secEccMsg_t eccMsg
handles DM_SEC_ECC_KEY_IND
Definition: dm_api.h:716
Extended scanning started.
Definition: dm_api.h:482
void DmPrivSetResolvablePrivateAddrTimeout(uint16_t rpaTimeout)
Set resolvable private address timeout command.
hciLeReadAntennaInfoCmdCmplEvt_t readAntennaInfo
handles DM_READ_ANTENNA_INFO_IND
Definition: dm_api.h:762
Data structure for DM_ADV_SET_START_IND.
Definition: dm_api.h:649
void DmConnSetConnSpec(hciConnSpec_t *pConnSpec)
Set the connection spec parameters for connections to be created with DmConnOpen().
void DmL2cConnUpdateInd(uint8_t identifier, uint16_t handle, hciConnSpec_t *pConnSpec)
For internal use only. L2C calls this function when it receives a connection update request from a pe...
void DmAdvConfig(uint8_t advHandle, uint8_t advType, uint8_t peerAddrType, uint8_t *pPeerAddr)
Set the advertising parameters using the given advertising type, and peer address.
LE remote connetion parameter request event.
Definition: hci_api.h:471
#define SMP_KEY_LEN
Key length.
Definition: smp_defs.h:178
void DmSecLtkRsp(dmConnId_t connId, bool_t keyFound, uint8_t secLevel, uint8_t *pKey)
This function is called by a slave in response to a DM_SEC_LTK_REQ_IND event to provide the long term...
uint16_t ediv
EDIV.
Definition: dm_api.h:537
void DmPrivResolveAddr(uint8_t *pAddr, uint8_t *pIrk, uint16_t param)
Resolve a private resolvable address. When complete the client&#39;s callback function is called with a D...
HciLePerAdvSyncTrsfRcvdEvt_t perAdvSyncTrsEstFail
handles DM_PER_ADV_SYNC_TRSF_EST_FAIL_IND
Definition: dm_api.h:747
uint32_t DmSecGetCompareValue(uint8_t *pConfirm)
This function returns the 6-digit compare value for the specified 128-bit confirm value...
void DmRemoteConnParamReqReply(dmConnId_t connId, hciConnSpec_t *pConnSpec)
Reply to the HCI remote connection parameter request event. This command is used to indicate that the...
Responding to connection CTE request stopped.
Definition: dm_api.h:505
wsfMsgHdr_t hdr
Header.
Definition: dm_api.h:621
hciVendorSpecEvt_t vendorSpec
handles DM_VENDOR_SPEC_IND
Definition: dm_api.h:766
Data type for DM_SEC_KEY_IND.
Definition: dm_api.h:602
void DmScanInit(void)
Initialize DM legacy scanning.
void DmL2cConnUpdateCnf(uint16_t handle, uint16_t reason)
For internal use only. L2C calls this function to send the result of an L2CAP connection update respo...
hciLeExtAdvReportEvt_t extScanReport
handles DM_EXT_SCAN_REPORT_IND
Definition: dm_api.h:740
void DmSecGenerateEccKeyReq(void)
This function generates an ECC key for use with LESC security.
Pairing completed successfully.
Definition: dm_api.h:450
PIN or OOB data requested for pairing.
Definition: dm_api.h:454
hciLeReadRemoteFeatCmplEvt_t readRemoteFeat
handles DM_REMOTE_FEATURES_IND
Definition: dm_api.h:751
void DmPastInit(void)
Initialize DM Periodic Advertising Sync Transfer (PAST) module.
hciLeConnUpdateCmplEvt_t connUpdate
handles DM_CONN_UPDATE_IND
Definition: dm_api.h:705
dmSecCnfIndEvt_t cnfInd
handles DM_SEC_COMPARE_IND
Definition: dm_api.h:717
Device removed from resolving list.
Definition: dm_api.h:467
wsfMsgHdr_t hdr
Header.
Definition: dm_api.h:597
hciLeScanReqRcvdEvt_t scanReqRcvd
handles DM_SCAN_REQ_RCVD_IND
Definition: dm_api.h:737
void DmSecEncryptReq(dmConnId_t connId, uint8_t secLevel, dmSecLtk_t *pLtk)
This function is called by a master device to initiate link encryption.
void DmSmpEncryptReq(dmConnId_t connId, uint8_t secLevel, uint8_t *pKey)
For internal use only. This function is called by SMP to request encryption.
Periodic advertising sync transfer establishment failed.
Definition: dm_api.h:491
Security key indication.
Definition: dm_api.h:455
bool_t DmAdvModeLeg(void)
Whether DM advertising is in legacy mode.
LE extended advertising report.
Definition: hci_api.h:184
dmConnId_t DmConnAccept(uint8_t clientId, uint8_t advHandle, uint8_t advType, uint16_t duration, uint8_t maxEaEvents, uint8_t addrType, uint8_t *pAddr)
Accept a connection from the given peer device by initiating directed advertising.
void DmExtConnSetScanInterval(uint8_t initPhys, uint16_t *pScanInterval, uint16_t *pScanWindow)
Set the scan interval and window for extended connections to be created with DmConnOpen().
bool_t DmLlPrivEnabled(void)
Whether LL Privacy is enabled.
LE periodic advertising sync transfer command complete event.
Definition: hci_api.h:595
Periodic advertising sync info transferred.
Definition: dm_api.h:492
#define SMP_CONFIRM_LEN
Confirm number length.
Definition: smp_defs.h:177
void DmAdvSetAddrType(uint8_t addrType)
Set the local address type used while advertising. This function can be used to configure advertising...
void DmAdvStart(uint8_t numSets, uint8_t *pAdvHandles, uint16_t *pDuration, uint8_t *pMaxEaEvents)
Start advertising using the given advertising set and duration.
bdAddr_t addr
Resolvable private address.
Definition: dm_api.h:629
LE set default PHY command complete event.
Definition: hci_api.h:578
dmPrivGenAddrIndEvt_t genAddr
handles DM_PRIV_GENERATE_ADDR_IND
Definition: dm_api.h:720
void DmPerAdvSetInterval(uint8_t advHandle, uint16_t intervalMin, uint16_t intervalMax)
Set the minimum and maximum advertising intervals for periodic advertising.
void DmWriteAuthPayloadTimeout(dmConnId_t connId, uint16_t timeout)
Set authenticated payload timeout for a given connection.
void DmPerAdvSetData(uint8_t advHandle, uint8_t op, uint8_t len, uint8_t *pData)
Set the advertising data to the given data for periodic advertising.
void DmSecSetOob(dmConnId_t connId, dmSecLescOobCfg_t *pConfig)
This function configures the DM to use OOB pairing for the given connection. The pRand and pConfirm c...
Result of Just Works/Numeric Comparison Compare Value Calculation.
Definition: dm_api.h:461
void DmConnCteRspStop(dmConnId_t connId)
Stop responding to LL_CTE_REQ PDUs with LL_CTE_RSP PDUs on the specified connection.
void DmDevPrivStop(void)
Stop using a private resolvable address.
bool_t firstTime
TRUE when address is generated for the first time.
Definition: dm_api.h:645
void DmSecSetLocalCsrk(uint8_t *pCsrk)
This function sets the local CSRK used by the device.
uint8_t auth
Authentication and bonding flags.
Definition: dm_api.h:566
void DmConnSlaveInit(void)
Initialize DM connection manager for operation as legacy slave.
Connection closed.
Definition: dm_api.h:448
void DmAdvInit(void)
Initialize DM legacy advertising.
void DmConnRegister(uint8_t clientId, dmCback_t cback)
Register with the DM connection manager.
hciLeRemConnParamReqEvt_t remConnParamReq
handles DM_REM_CONN_PARAM_REQ_IND
Definition: dm_api.h:728
Periodic advertising sync lost.
Definition: dm_api.h:489
Data type for DM_SEC_KEYPRESS_IND.
Definition: dm_api.h:619
void DmScanSetInterval(uint8_t scanPhys, uint16_t *pScanInterval, uint16_t *pScanWindow)
Set the scan interval and window for the specified PHYs.
uint8_t dmSyncId_t
Synchronization identifier.
Definition: dm_api.h:524
Read PHY.
Definition: dm_api.h:476
dmSecCsrk_t csrk
CSRK.
Definition: dm_api.h:559
void DmReadRemoteVerInfo(dmConnId_t connId)
Read the version info of the remote device.
uint8_t notificationType
Type of keypress notification.
Definition: dm_api.h:622
LE periodic advertising report.
Definition: hci_api.h:242
dmSecPairCmplIndEvt_t pairCmpl
handles DM_SEC_PAIR_CMPL_IND
Definition: dm_api.h:706
hciLeSetConnCteTxParamsCmdCmplEvt_t connCteTxCfg
handles DM_CONN_CTE_TX_CFG_IND
Definition: dm_api.h:757
void DmSetDefaultPhy(uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys)
Set the preferred values for the transmitter PHY and receiver PHY for all subsequent connections...
Read RSSI command complete event.
Definition: hci_api.h:286
void DmExtAdvInit(void)
Initialize DM extended advertising.
uint8_t encKeyLen
Length of encryption key used when data was transferred.
Definition: dm_api.h:608
Union of DM callback event data types.
Definition: dm_api.h:693
Initiating connection CTE request stopped.
Definition: dm_api.h:503
Initiating connection CTE request started.
Definition: dm_api.h:502
void DmConnCteInit(void)
Initialize DM Connection Constant Tone Extension (CTE) module.
hciDisconnectCmplEvt_t connClose
handles DM_CONN_CLOSE_IND
Definition: dm_api.h:704
Data type for DM_SEC_PAIR_CMPL_IND.
Definition: dm_api.h:563
Data type for DM_SEC_CALC_OOB_IND.
Definition: dm_api.h:633
void DmAdvSetChannelMap(uint8_t advHandle, uint8_t channelMap)
Include or exclude certain channels from the advertising channel map.
void DmAdvSetData(uint8_t advHandle, uint8_t op, uint8_t location, uint8_t len, uint8_t *pData)
Set the advertising or scan response data to the given data.
Authenticated payload to expire event.
Definition: hci_api.h:561
ECC Security public/private key pair.
Definition: sec_api.h:105
Connection CTE transmit parameters configured.
Definition: dm_api.h:501
uint8_t DmConnSecLevel(dmConnId_t connId)
For internal use only. Return the security level of the connection.
hciLePerAdvSyncTrsfCmdCmplEvt_t perAdvSyncTrsf
handles DM_PER_ADV_SYNC_TRSF_IND
Definition: dm_api.h:748
hciLePerAdvSyncEstEvt_t perAdvSyncEst
handles DM_PER_ADV_SYNC_EST_IND
Definition: dm_api.h:743
dmSecOobCalcIndEvt_t oobCalcInd
handles DM_SEC_CALC_OOB_IND
Definition: dm_api.h:715
void DmReadRemoteFeatures(dmConnId_t connId)
For internal use only. Read the features of the remote device.
dmSecKey_t keyData
Key data.
Definition: dm_api.h:605
void DmDevWhiteListRemove(uint8_t addrType, uint8_t *pAddr)
Remove a peer device from the white list. Note that this function cannot be called while advertising...
uint8_t advHandle
Advertising handle.
Definition: dm_api.h:660
hciWriteAuthPayloadToCmdCmplEvt_t writeAuthTo
handles DM_CONN_WRITE_AUTH_TO_IND
Definition: dm_api.h:730
void DmSecSetDebugEccKey(void)
This function sets the ECC key for use with LESC security to standard debug keys values.
New resolvable address has been generated.
Definition: dm_api.h:443
Read remote version information complete event.
Definition: hci_api.h:313
void DmPastSetInfoTrsf(dmConnId_t connId, uint16_t serviceData, uint8_t advHandle)
Send synchronization information about the periodic advertising in an advertising set to a connected ...
bdAddr_t addr
New resolvable private address.
Definition: dm_api.h:644
void DmPrivSetPrivacyMode(uint8_t addrType, const uint8_t *pIdentityAddr, uint8_t mode)
Set privacy mode for a given entry in the resolving list.
hciLeCteReqFailedEvt_t cteReqFail
handles DM_CTE_REQ_FAIL_IND
Definition: dm_api.h:754
void DmPerAdvStop(uint8_t advHandle)
Stop periodic advertising for the advertising set specified by the advertising handle.
IRK data type.
Definition: dm_api.h:541
Connection specification type.
Definition: hci_api.h:762
void DmSecInit(void)
Initialize DM security.
LE connection update complete event.
Definition: hci_api.h:150
void DmConnClose(uint8_t clientId, dmConnId_t connId, uint8_t reason)
Close the connection with the give connection identifier.
uint16_t DmConnCheckIdle(dmConnId_t connId)
Check if a connection is idle.
bool_t DmDevSetExtFilterPolicy(uint8_t advHandle, uint8_t mode, uint8_t policy)
Set the Advertising filter policy for the given advertising, Scanning or Initiator filter policy...
hciLeReadLocalResAddrCmdCmplEvt_t readLocalResAddr
handles DM_PRIV_READ_LOCAL_RES_ADDR_IND
Definition: dm_api.h:726
void DmPastSyncTrsf(dmConnId_t connId, uint16_t serviceData, dmSyncId_t syncId)
Send synchronization information about the periodic advertising identified by the sync id to a connec...
hciLePerAdvSyncEstEvt_t perAdvSyncEstFail
handles DM_PER_ADV_SYNC_EST_FAIL_IND
Definition: dm_api.h:744
uint8_t * DmConnPeerAddr(dmConnId_t connId)
For internal use only. Return the peer device address.
Keypress indication from peer in passkey security.
Definition: dm_api.h:462
#define SMP_RAND_LEN
Random number length.
Definition: smp_defs.h:176
Periodic advertising set stopped.
Definition: dm_api.h:486
void DmConnSetScanInterval(uint16_t scanInterval, uint16_t scanWindow)
Set the scan interval and window for connections to be created with DmConnOpen(). ...
LE connection IQ report.
Definition: hci_api.h:611
void DmReadPhy(dmConnId_t connId)
Read the current transmitter PHY and receiver PHY for a given connection.
void DmPrivReadLocalResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr)
Read local resolvable address command. When complete the client&#39;s callback function is called with a ...
Sampling received CTE stopped.
Definition: dm_api.h:500
void DmPrivGenerateAddr(uint8_t *pIrk, uint16_t param)
Generate a Resolvable Private Address (RPA).
Sampling received CTE started.
Definition: dm_api.h:499
void DmDevPrivStart(uint16_t changeInterval)
Start using a private resolvable address.
wsfMsgHdr_t hdr
Header.
Definition: dm_api.h:587
Periodic advertising sync established.
Definition: dm_api.h:487
LE set connection CTE transmit parameters command complete event.
Definition: hci_api.h:645
LE clear resolving list command complete event.
Definition: hci_api.h:546
LE data length change event.
Definition: hci_api.h:482
LTK requested for encyption.
Definition: dm_api.h:456
wsfMsgHdr_t hdr
Header.
Definition: dm_api.h:651
hciLeAdvSetTermEvt_t advSetStop
handles DM_ADV_SET_STOP_IND
Definition: dm_api.h:736
hciLeLtkReqEvt_t ltkReqInd
handles DM_SEC_LTK_REQ_IND
Definition: dm_api.h:712
uint8_t auth
Authentication and bonding flags.
Definition: dm_api.h:588
uint8_t DmLlAddrType(uint8_t addrType)
Map an address type to a type used by LL.
void(* dmCback_t)(dmEvt_t *pDmEvt)
Callback type.
Definition: dm_api.h:779
wsfMsgHdr_t hdr
Header.
Definition: dm_api.h:673
LE LTK request event.
Definition: hci_api.h:366
hciLeSetDefPhyCmdCmplEvt_t setDefPhy
handles DM_PHY_SET_DEF_IND
Definition: dm_api.h:733
Security manager constants and definitions from the Bluetooth specification.
LE read antenna information command complete event.
Definition: hci_api.h:669
Antenna information read.
Definition: dm_api.h:506
void DmAdvOmitAdvAddr(uint8_t advHandle, bool_t omitAdvAddr)
Set whether or not to omit advertiser&#39;s address from all PDUs (anonymous advertising).
Data length changed.
Definition: dm_api.h:473
Periodic advertising sync establishment failed.
Definition: dm_api.h:488
dmPerAdvSetStopEvt_t perAdvSetStop
handles DM_PER_ADV_SET_STOP_IND
Definition: dm_api.h:742
uint8_t iKeyDist
Initiator key distribution flags.
Definition: dm_api.h:590
dmSecSlaveIndEvt_t slaveInd
handles DM_SEC_SLAVE_REQ_IND
Definition: dm_api.h:714
bool_t DmScanModeLeg(void)
Whether DM scanning is in legacy mode.
bool_t DmAdvSetAdValue(uint8_t adType, uint8_t len, uint8_t *pValue, uint16_t *pAdvDataLen, uint8_t *pAdvData, uint16_t advDataBufLen)
Set the value of an advertising data element in the given advertising or scan response data...
bool_t oob
Out-of-band data requested.
Definition: dm_api.h:580
hciLePerAdvReportEvt_t perAdvReport
handles DM_PER_ADV_REPORT_IND
Definition: dm_api.h:750
Vendor specific event.
Definition: dm_api.h:510
void DmDevSetRandAddr(uint8_t *pAddr)
Set the random address to be used by the local device.
LE read PHY command complete event.
Definition: hci_api.h:568
wsfMsgHdr_t hdr
Header.
Definition: dm_api.h:572
void DmAdvSetRandAddr(uint8_t advHandle, const uint8_t *pAddr)
Set the random device address for a given advertising set.
Data structure for DM_PER_ADV_SET_START_IND.
Definition: dm_api.h:657
General error.
Definition: dm_api.h:508
void DmConnSetAddrType(uint8_t addrType)
Set the local address type used for connections created with DmConnOpen().
dmSecKeyIndEvt_t keyInd
handles DM_SEC_KEY_IND
Definition: dm_api.h:711
void DmPerAdvIncTxPwr(uint8_t advHandle, bool_t incTxPwr)
Set whether or not to include TxPower in extended header of advertising PDU for periodic advertising...
Data structure for DM_PER_ADV_SET_STOP_IND.
Definition: dm_api.h:664
Reset complete.
Definition: dm_api.h:440
dmSecAuthReqIndEvt_t authReq
handles DM_SEC_AUTH_REQ_IND
Definition: dm_api.h:710
uint8_t type
Key type.
Definition: dm_api.h:606
wsfMsgHdr_t hdr
Header.
Definition: dm_api.h:628
dmL2cCmdRejEvt_t l2cCmdRej
handles DM_L2C_CMD_REJ_IND
Definition: dm_api.h:763
LE set address resolving enable command complete event.
Definition: hci_api.h:525
Device added to resolving list.
Definition: dm_api.h:466
uint8_t numSets
Number of advertising sets.
Definition: dm_api.h:652
Extended scanning stopped.
Definition: dm_api.h:483
bool_t oob
Out-of-band pairing data present or not present.
Definition: dm_api.h:589
Periodic advertising set sync info transferred.
Definition: dm_api.h:493
LE read peer resolving address command complete event.
Definition: hci_api.h:509
Scanning started.
Definition: dm_api.h:444
LE set connection CTE receive parameters command complete event.
Definition: hci_api.h:637
void DmAdvClearAdvSets(void)
Clear advertising sets.
void DmScanSetAddrType(uint8_t addrType)
Set the local address type used while scanning. This function can be used to configure scanning to us...
dmSecLtk_t ltk
LTK.
Definition: dm_api.h:557
LE set periodic advertising set info transfer command complete event.
Definition: hci_api.h:603
Scan request received.
Definition: dm_api.h:481
Result of OOB Confirm Calculation Generation.
Definition: dm_api.h:459
void DmSetPhy(dmConnId_t connId, uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys, uint16_t phyOptions)
Set the PHY preferences for a given connection.
void DmClearPerAdvList(void)
DM clear periodic advertiser list.
void DmPrivInit(void)
Initialize DM privacy module.
hciLeConnIQReportEvt_t connIQReport
handles DM_CONN_IQ_REPORT_IND
Definition: dm_api.h:753
void DmConnCteReqStart(dmConnId_t connId, uint16_t cteReqInt, uint8_t reqCteLen, uint8_t reqCteType)
Initiate the CTE Request procedure on the specified connection.
uint8_t DmConnRole(dmConnId_t connId)
Return the connection role indicating master or slave.
void DmAdvScanReqNotifEnable(uint8_t advHandle, bool_t scanReqNotifEna)
Set scan request notification enable.
Connection opened.
Definition: dm_api.h:447
Hardware error.
Definition: dm_api.h:509
LTK data type.
Definition: dm_api.h:533
Data type for DM_ADV_NEW_ADDR_IND.
Definition: dm_api.h:641
LE scan request received.
Definition: hci_api.h:219
LE remove device from resolving list command complete event.
Definition: hci_api.h:539
Data type for DM_SEC_ENCRYPT_IND.
Definition: dm_api.h:570
bool_t usingLtk
TRUE if connection encrypted with LTK.
Definition: dm_api.h:573
uint8_t DmConnPeerAddrType(dmConnId_t connId)
For internal use only. Return the peer address type.
LE advertising report event.
Definition: hci_api.h:168
void DmDevWhiteListAdd(uint8_t addrType, uint8_t *pAddr)
Add a peer device to the white list. Note that this function cannot be called while advertising...
void DmConnInit(void)
Initialize DM connection manager.
void DmExtConnSetConnSpec(uint8_t initPhys, hciConnSpec_t *pConnSpec)
Set the extended connection spec parameters for extended connections to be created with DmConnOpen()...
Incoming pairing request from master.
Definition: dm_api.h:457
void DmConnCteReqStop(dmConnId_t connId)
Stop initiating the CTE Request procedure on the specified connection.
#define DM_CBACK_START
DM callback event starting value.
Definition: dm_api.h:435
void DmConnSetIdle(dmConnId_t connId, uint16_t idleMask, uint8_t idle)
Configure a bit in the connection idle state mask as busy or idle.
Private address resolved.
Definition: dm_api.h:463
void DmSecSetLocalIrk(uint8_t *pIrk)
This function sets the local IRK used by the device.
void DmPrivReadPeerResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr)
HCI read peer resolvable address command. When complete the client&#39;s callback function is called with...
Vendor specific event.
Definition: hci_api.h:390
Data type for DM_SEC_AUTH_REQ_IND.
Definition: dm_api.h:577
Address resolving enable set.
Definition: dm_api.h:471
LE connection CTE response enable command complete event.
Definition: hci_api.h:661
hciLeReadPeerResAddrCmdCmplEvt_t readPeerResAddr
handles DM_PRIV_READ_PEER_RES_ADDR_IND
Definition: dm_api.h:725
Disconnect complete event.
Definition: hci_api.h:141
bool_t display
TRUE if pin is to be displayed.
Definition: dm_api.h:581
dmSecIrk_t irk
IRK.
Definition: dm_api.h:558
Periodic advertising data received from peer device.
Definition: dm_api.h:494
uint8_t advHandle
Advertising handle.
Definition: dm_api.h:667
CSRK data type.
Definition: dm_api.h:549
LE connection CTE request enable command complete event.
Definition: hci_api.h:653
void DmDevWhiteListClear(void)
Clear the white list. Note that this function cannot be called while advertising, scanning...
wsfMsgHdr_t hdr
Header.
Definition: dm_api.h:635
void DmPerAdvStart(uint8_t advHandle)
Start periodic advertising for the advertising set specified by the advertising handle.
secEccKey_t * DmSecGetEccKey(void)
This function gets the local ECC key for use with LESC security.
void DmAdvSetPhyParam(uint8_t advHandle, uint8_t priAdvPhy, uint8_t secAdvMaxSkip, uint8_t secAdvPhy)
Set extended advertising PHY parameters.
LE read remote features complete event.
Definition: hci_api.h:324
wsfMsgHdr_t hdr
Header.
Definition: dm_api.h:604
hciLePerAdvSyncLostEvt_t perAdvSyncLost
handles DM_PER_ADV_SYNC_LOST_IND
Definition: dm_api.h:745
Remote LL version information read.
Definition: dm_api.h:496
hciLeClearResListCmdCmplEvt_t clearResList
handles DM_PRIV_CLEAR_RES_LIST_IND
Definition: dm_api.h:724
uint8_t DmHostAddrType(uint8_t addrType)
Map an address type to a type used by Host.
void DmAdvStop(uint8_t numSets, uint8_t *pAdvHandles)
Stop advertising for the given advertising set. If the number of sets is set to 0 then all advertisin...
void DmExtConnSlaveInit(void)
Initialize DM connection manager for operation as extended slave.
LE periodic advertising sync established.
Definition: hci_api.h:228
void DmAddDeviceToPerAdvList(uint8_t advAddrType, uint8_t *pAdvAddr, uint8_t advSid)
Add device to periodic advertiser list.
Authenticated payload timeout expired.
Definition: dm_api.h:475
hciLePhyUpdateEvt_t phyUpdate
handles DM_PHY_UPDATE_IND
Definition: dm_api.h:734
void DmPastDefaultConfig(uint8_t mode, uint16_t skip, uint16_t syncTimeout, uint8_t cteType)
Specify the initial value for the mode, skip, timeout, and Constant Tone Extension type to be used fo...
Union of key types.
Definition: dm_api.h:555
Connection update complete.
Definition: dm_api.h:449
void DmSecCancelReq(dmConnId_t connId, uint8_t reason)
This function is called to cancel the pairing process.
void DmConnCteTxConfig(dmConnId_t connId, uint8_t cteTypeBits, uint8_t switchPatternLen, uint8_t *pAntennaIDs)
Configure the antenna switching pattern, and permitted CTE types used for transmitting CTEs requested...
void DmSecLescInit(void)
Initialize DM LE Secure Connections security.
dmPerAdvSetStartEvt_t perAdvSetStart
handles DM_PER_ADV_SET_START_IND
Definition: dm_api.h:741
void DmSmpCbackExec(dmEvt_t *pDmEvt)
For internal use only. Execute DM callback from SMP procedures.
bdAddr_t bdAddr
BD Address.
Definition: dm_api.h:544
hciLeConnCteRspEnableCmdCmplEvt_t connCteRspStop
handles DM_CONN_CTE_RSP_STOP_IND
Definition: dm_api.h:761
hciLeDataLenChangeEvt_t dataLenChange
handles DM_CONN_DATA_LEN_CHANGE_IND
Definition: dm_api.h:729
uint8_t rKeyDist
Responder key distribution flags.
Definition: dm_api.h:591
hciHwErrorEvt_t hwError
handles DM_HW_ERROR_IND
Definition: dm_api.h:765
wsfMsgHdr_t hdr
Header.
Definition: dm_api.h:643
Resolving list cleared.
Definition: dm_api.h:468
Periodic advertising set started.
Definition: dm_api.h:485
Remote connection parameter requested.
Definition: dm_api.h:472
PHY update.
Definition: dm_api.h:478
void DmPrivRemDevFromResList(uint8_t addrType, const uint8_t *pIdentityAddr, uint16_t param)
Remove device from resolving list. When complete the client&#39;s callback function is called with a DM_P...
hciLeSetAddrResEnableCmdCmplEvt_t setAddrResEnable
handles DM_PRIV_SET_ADDR_RES_ENABLE_IND
Definition: dm_api.h:727
hciLeSetConnCteRxParamsCmdCmplEvt_t connCteRxSampleStart
handles DM_CONN_CTE_RX_SAMPLE_START_IND
Definition: dm_api.h:755
AES and random number security service API.
void DmRemoteConnParamReqNegReply(dmConnId_t connId, uint8_t reason)
Negative reply to the HCI remote connection parameter request event. This command is used to indicate...
void DmL2cCmdRejInd(uint16_t handle, uint16_t result)
For internal use only. L2C calls this function to send the result of an L2CAP Command Reject up to th...
Advertising stopped.
Definition: dm_api.h:442
Periodic advertising sync transfer established.
Definition: dm_api.h:490
void DmExtScanInit(void)
Initialize DM extended scanning.
Connection encrypted.
Definition: dm_api.h:452
hciLePerAdvSetInfoTrsfCmdCmplEvt_t perAdvSetInfoTrsf
handles DM_PER_ADV_SET_INFO_TRSF_IND
Definition: dm_api.h:749
void DmPhyInit(void)
Initialize DM PHY.
hciLeReadPhyCmdCmplEvt_t readPhy
handles DM_PHY_READ_IND
Definition: dm_api.h:732
uint8_t dummy
Placeholder variable.
Definition: dm_api.h:529
void DmPastConfig(dmConnId_t connId, uint8_t mode, uint16_t skip, uint16_t syncTimeout, uint8_t cteType)
Specify how the Controller should process periodic advertising synchronization information received f...
L2CAP Command Reject.
Definition: dm_api.h:507
Incoming security request from slave.
Definition: dm_api.h:458
void DmSyncInitialRptEnable(bool_t enable)
DM enable or disable initial periodic advertisement reporting.
LE advertising set terminated.
Definition: hci_api.h:209
LE periodic advertising synch lost.
Definition: hci_api.h:255
uint16_t reason
Rejection reason.
Definition: dm_api.h:674
Advertising set(s) stopped.
Definition: dm_api.h:480
IQ samples from CTE of received packet from peer device.
Definition: dm_api.h:497
void DmConnReadRssi(dmConnId_t connId)
Read RSSI of a given connection.
uint8_t DmConnLocalAddrType(dmConnId_t connId)
For internal use only. Return the local address type.
Encryption failed.
Definition: dm_api.h:453
HciLePerAdvSyncTrsfRcvdEvt_t perAdvSyncTrsfEst
handles DM_PER_ADV_SYNC_TRSF_EST_IND
Definition: dm_api.h:746
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.