Cordio Stack and Cordio Profiles  r2p3-02rel0
app_api.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Application framework API.
6  *
7  * Copyright (c) 2011-2018 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 APP_API_H
20 #define APP_API_H
21 
22 #include "wsf_os.h"
23 #include "dm_api.h"
24 #include "att_api.h"
25 #include "app_db.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 /*! \addtogroup APP_FRAMEWORK_API
32  * \{ */
33 
34 /**************************************************************************************************
35  Macros
36 **************************************************************************************************/
37 
38 /** \name App Advertising Mode
39  * Discoverable/connectable mode used by function \ref AppAdvStart.
40  */
41 /**@{*/
42 #define APP_MODE_CONNECTABLE 0 /*!< \brief Connectable mode */
43 #define APP_MODE_DISCOVERABLE 1 /*!< \brief Discoverable mode */
44 #define APP_MODE_AUTO_INIT 2 /*!< \brief Automatically configure mode based on bonding info */
45 #define APP_MODE_NONE 255 /*!< \brief For internal use only */
46 
47 /*! \brief Number of Discoverable/connectable modes */
48 #define APP_NUM_MODES 2
49 /**@}*/
50 
51 /*! \brief Advertising states */
52 enum
53 {
54  APP_ADV_STATE1, /*!< \brief Advertising state 1 */
55  APP_ADV_STATE2, /*!< \brief Advertising state 2 */
56  APP_ADV_STATE3, /*!< \brief Advertising state 3 */
57  APP_ADV_STOPPED /*!< \brief Advertising stopped */
58 };
59 
60 /*! \brief Advertising and scan data storage locations */
61 enum
62 {
63  APP_ADV_DATA_CONNECTABLE, /*!< \brief Advertising data for connectable mode */
64  APP_SCAN_DATA_CONNECTABLE, /*!< \brief Scan data for connectable mode */
65  APP_ADV_DATA_DISCOVERABLE, /*!< \brief Advertising data for discoverable mode */
66  APP_SCAN_DATA_DISCOVERABLE, /*!< \brief Scan data for discoverable mode */
67  APP_NUM_DATA_LOCATIONS /*!< \brief number of data storage locations. */
68 };
69 
70 /*! \brief Number of advertising configurations */
71 #define APP_ADV_NUM_CFG APP_ADV_STOPPED
72 
73 /*! \brief Service discovery and configuration client status */
74 enum
75 {
76  APP_DISC_INIT, /*!< \brief No discovery or configuration complete */
77  APP_DISC_SEC_REQUIRED, /*!< \brief Security required to complete configuration */
78  APP_DISC_START, /*!< \brief Service discovery started */
79  APP_DISC_CMPL, /*!< \brief Service discovery complete */
80  APP_DISC_FAILED, /*!< \brief Service discovery failed */
81  APP_DISC_CFG_START, /*!< \brief Service configuration started */
82  APP_DISC_CFG_CONN_START, /*!< \brief Configuration for connection setup started */
83  APP_DISC_CFG_CMPL, /*!< \brief Service configuration complete */
84 };
85 
86 /*! \brief Actions for incoming requests */
87 enum
88 {
89  APP_ACT_ACCEPT, /*!< \brief Accept incoming request */
90  APP_ACT_REJECT, /*!< \brief Reject incoming request */
91  APP_ACT_NONE /*!< \brief Do nothing - app will handle incoming request */
92 };
93 
94 #define APP_RESOLVE_ADV_RPA 0 /*!< \brief Resolving the advertiser's RPA (AdvA) */
95 #define APP_RESOLVE_DIRECT_RPA 1 /*!< \brief Resolving RPA the directed advertisement is being
96  directed to (InitA) */
97 
98 /**************************************************************************************************
99  Data Types
100 **************************************************************************************************/
101 
102 /*! \brief Configurable parameters for advertising */
103 typedef struct
104 {
105  uint16_t advDuration[APP_ADV_NUM_CFG]; /*!< \brief Advertising durations in ms */
106  uint16_t advInterval[APP_ADV_NUM_CFG]; /*!< \brief Advertising intervals in 0.625 ms units (20 ms to 10.24 s). */
108 
109 /*! \brief Configurable parameters for extended and periodic advertising */
110 typedef struct
111 {
112  uint16_t advDuration[DM_NUM_ADV_SETS]; /*!< \brief Advertising durations for extended advertising in ms */
113  uint16_t advInterval[DM_NUM_ADV_SETS]; /*!< \brief Advertising intervals for extended advertising in 0.625
114  ms units (20 ms to 10.24 s). */
115  uint8_t maxEaEvents[DM_NUM_ADV_SETS]; /*!< \brief Maximum number of extended advertising events Controller
116  will send prior to terminating extended advertising */
117  bool_t useLegacyPdu[DM_NUM_ADV_SETS]; /*!< \brief Whether to use legacy advertising PDUs with extended
118  advertising. If set to TRUE then length of advertising
119  data cannot exceed 31 octets. */
120  uint16_t perAdvInterval[DM_NUM_ADV_SETS]; /*!< \brief Advertising intervals for periodic advertising in 1.25
121  ms units (7.5 ms to 81.91875 s). */
123 
124 /*! \brief Configurable parameters for slave */
125 typedef struct
126 {
127  uint8_t connMax; /*!< \brief Maximum connections */
129 
130 /*! \brief Configurable parameters for master */
131 typedef struct
132 {
133  uint16_t scanInterval; /*!< \brief The scan interval, in 0.625 ms units */
134  uint16_t scanWindow; /*!< \brief The scan window, in 0.625 ms units. Must be
135  less than or equal to scan interval. */
136  uint16_t scanDuration; /*!< \brief The scan duration in ms. Set to zero to scan
137  until stopped. */
138  uint8_t discMode; /*!< \brief The GAP discovery mode (general, limited, or none) */
139  uint8_t scanType; /*!< \brief The scan type (active or passive) */
141 
142 /*! \brief Configurable parameters for extended master */
143 typedef struct
144 {
145  uint16_t scanInterval[DM_NUM_PHYS]; /*!< \brief The scan interval, in 0.625 ms units */
146  uint16_t scanWindow[DM_NUM_PHYS]; /*!< \brief The scan window, in 0.625 ms units. Must be
147  less than or equal to scan interval. */
148  uint16_t scanDuration; /*!< \brief The scan duration in ms. Set to zero or both duration
149  and period to non-zero to scan until stopped. */
150  uint16_t scanPeriod; /*!< \brief The scan period, in 1.28 sec units. Set to zero to
151  disable periodic scanning. */
152  uint8_t discMode; /*!< \brief The GAP discovery mode (general, limited, or none) */
153  uint8_t scanType[DM_NUM_PHYS]; /*!< \brief The scan type (active or passive) */
155 
156 /*! \brief Configurable parameters for security */
157 typedef struct
158 {
159  uint8_t auth; /*!< \brief Authentication and bonding flags */
160  uint8_t iKeyDist; /*!< \brief Initiator key distribution flags */
161  uint8_t rKeyDist; /*!< \brief Responder key distribution flags */
162  bool_t oob; /*!< \brief TRUE if Out-of-band pairing data is present */
163  bool_t initiateSec; /*!< \brief TRUE to initiate security upon connection */
165 
166 /*! \brief Configurable parameters for connection parameter update */
167 typedef struct
168 {
169  wsfTimerTicks_t idlePeriod; /*!< \brief Connection idle period in ms before attempting
170  connection parameter update; set to zero to disable */
171  uint16_t connIntervalMin; /*!< \brief Minimum connection interval in 1.25ms units */
172  uint16_t connIntervalMax; /*!< \brief Maximum connection interval in 1.25ms units */
173  uint16_t connLatency; /*!< \brief Connection latency */
174  uint16_t supTimeout; /*!< \brief Supervision timeout in 10ms units */
175  uint8_t maxAttempts; /*!< \brief Number of update attempts before giving up */
177 
178 /*! \brief Configurable parameters for incoming request actions */
179 typedef struct
180 {
181  uint8_t remConnParamReqAct; /*!< \brief Action for the remote connection parameter request */
183 
184 /*! \brief Configurable parameters for service and characteristic discovery */
185 typedef struct
186 {
187  bool_t waitForSec; /*!< \brief TRUE to wait for a secure connection before initiating
188  discovery */
189 } appDiscCfg_t;
190 
191 /*! \brief Configurable parameters for application */
192 typedef struct
193 {
194  bool_t abortDisc; /*!< \brief TRUE to abort service discovery if service not found */
195  bool_t disconnect; /*!< \brief TRUE to disconnect if ATT transaction times out */
197 
198 /*! \brief Device information data type */
199 typedef struct
200 {
201  bdAddr_t addr; /*!< \brief Peer device address */
202  uint8_t addrType; /*!< \brief Peer address type */
203  uint8_t directAddrType; /*!< \brief Address directed advertisement is addressed to */
204  bdAddr_t directAddr; /*!< \brief Type of address directed advertisement is addressed to */
206 
207 /*!
208  * \brief Service discovery and configuration callback.
209  *
210  * \param connId Connection identifier.
211  * \param status Service or configuration status.
212  *
213  * \return None.
214  */
215 typedef void (*appDiscCback_t)(dmConnId_t connId, uint8_t status);
217 /**************************************************************************************************
218  Global Variables
219 **************************************************************************************************/
220 
221 /*! \brief This is a pointer to the advertising configurable parameters used by the application.
222  * If advertising is used, the application must set this variable during system initialization.
223  */
224 extern appAdvCfg_t *pAppAdvCfg;
225 
226 /*! \brief This is a pointer to the extended advertising configurable parameters used by the
227  * application. If extended advertising is used, the application must set this variable during
228  * system initialization.
229  */
231 
232 /*! \brief This is a pointer to the slave configurable parameters used by the application.
233  * If slave mode is used, the application must set this variable during system initialization.
234  */
236 
237 /*! \brief This is a pointer to the master configurable parameters used by the application.
238  * If master mode is used, the application must set this variable during system initialization.
239  */
241 
242 /*! \brief This is a pointer to the extended master configurable parameters used by the application.
243  * If master mode is used, the application must set this variable during system initialization.
244  */
246 
247 /*! \brief This is a pointer to the security-related configurable parameters used by the application.
248  * The application must set this variable during system initialization.
249  */
250 extern appSecCfg_t *pAppSecCfg;
251 
252 /*! \brief This is a pointer to the connection parameter update parameters used by the application.
253  * The application must set this variable during system initialization.
254  */
256 
257 /*! \brief This is a pointer to the discovery parameters used by the application. The application
258  * must set this variable during system initialization.
259  */
260 extern appDiscCfg_t *pAppDiscCfg;
261 
262 /*! \brief This is a pointer to the application parameters used by the application. The application
263  * must set this variable during system initialization.
264  */
265 extern appCfg_t *pAppCfg;
266 
267 /*! \brief This is a pointer to the master incoming request actions used by the application. The
268  * application must set this variable during system initialization.
269  */
271 
272 /*! \brief This is a pointer to the master incoming request actions used by the application.
273  * The application must set this variable during system initialization.
274  */
276 
277 /**************************************************************************************************
278  Function Declarations
279 **************************************************************************************************/
280 
281 /** \name App Initialization Functions
282  * Application role initialization.
283  */
284 /**@{*/
285 
286 /*************************************************************************************************/
287 /*!
288  * \brief Initialize the App Framework for operation as a Bluetooth LE slave.
289  *
290  * \return None.
291  */
292 /*************************************************************************************************/
293 void AppSlaveInit(void);
294 
295 /*************************************************************************************************/
296 /*!
297  * \brief Initialize the App Framework for operation as a Bluetooth LE master.
298  *
299  * \return None.
300  */
301 /*************************************************************************************************/
302 void AppMasterInit(void);
303 
304 /**@}*/
305 
306 /** \name App Advertising Functions
307  * Configure and send legacy, extended and periodic advertisments.
308  */
309 /**@{*/
310 
311 /*************************************************************************************************/
312 /*!
313  * \brief Set advertising type.
314  *
315  * \param advType Advertising type.
316  *
317  * \return None.
318  */
319 /*************************************************************************************************/
320 void AppSetAdvType(uint8_t advType);
321 
322 /*************************************************************************************************/
323 /*!
324  * \brief Set advertising peer address and its type.
325  *
326  * \param peerAddrType Peer address type.
327  * \param pPeerAddr Peer address.
328  *
329  * \return None.
330  */
331 /*************************************************************************************************/
332 void AppSetAdvPeerAddr(uint8_t peerAddrType, uint8_t *pPeerAddr);
333 
334 /*************************************************************************************************/
335 /*!
336  * \brief Set advertising or scan data. Separate advertising and scan data can be set for
337  * connectable and discoverable modes. The application must allocate and maintain
338  * the memory pointed to by pData while the device is advertising.
339  *
340  * \param location Data location.
341  * \param len Length of the data. Maximum length is 31 bytes.
342  * \param pData Pointer to the data.
343  *
344  * \return None.
345  */
346 /*************************************************************************************************/
347 void AppAdvSetData(uint8_t location, uint8_t len, uint8_t *pData);
348 
349 /*************************************************************************************************/
350 /*!
351  * \brief Set the value of an advertising data element in the advertising or scan
352  * response data. If the element already exists in the data then it is replaced
353  * with the new value. If the element does not exist in the data it is appended
354  * to it, space permitting.
355  *
356  * There is special handling for the device name (AD type DM_ADV_TYPE_LOCAL_NAME).
357  * If the name can only fit in the data if it is shortened, the name is shortened
358  * and the AD type is changed to DM_ADV_TYPE_SHORT_NAME.
359  *
360  * \param location Data location.
361  * \param adType Advertising data element type.
362  * \param len Length of the value. Maximum length is 29 bytes.
363  * \param pValue Pointer to the value.
364  *
365  * \return TRUE if the element was successfully added to the data, FALSE otherwise.
366  */
367 /*************************************************************************************************/
368 bool_t AppAdvSetAdValue(uint8_t location, uint8_t adType, uint8_t len, uint8_t *pValue);
369 
370 /*************************************************************************************************/
371 /*!
372  * \brief Start advertising using the parameters for the given mode.
373  *
374  * \param mode Discoverable/connectable mode.
375  *
376  * \return None.
377  */
378 /*************************************************************************************************/
379 void AppAdvStart(uint8_t mode);
380 
381 /*************************************************************************************************/
382 /*!
383  * \brief Stop advertising. The device will no longer be connectable or discoverable.
384  *
385  * \return None.
386  */
387 /*************************************************************************************************/
388 void AppAdvStop(void);
389 
390 /*************************************************************************************************/
391 /*!
392  * \brief Accept a connection to a peer device with the given address.
393  *
394  * \param advType Advertising type.
395  * \param addrType Address type.
396  * \param pAddr Peer device address.
397  *
398  * \return Connection identifier.
399  */
400  /*************************************************************************************************/
401 dmConnId_t AppConnAccept(uint8_t advType, uint8_t addrType, uint8_t *pAddr);
402 
403 /*************************************************************************************************/
404 /*!
405  * \brief Check if the local device's currently advertising.
406  *
407  * \return TRUE if device's advertising. FALSE, otherwise.
408  */
409 /*************************************************************************************************/
411 
412 /*************************************************************************************************/
413 /*!
414  * \brief Set advertising peer address and its type for the given advertising set.
415  *
416  * \param advHandle Advertising handle.
417  * \param peerAddrType Peer address type.
418  * \param pPeerAddr Peer address.
419  *
420  * \return None.
421  */
422 /*************************************************************************************************/
423 void AppExtSetAdvPeerAddr(uint8_t advHandle, uint8_t peerAddrType, uint8_t *pPeerAddr);
424 
425 /*************************************************************************************************/
426 /*!
427  * \brief Set extended advertising data.
428  *
429  * \param advHandle Advertising handle.
430  * \param location Data location.
431  * \param len Length of the data. Maximum length is 31 bytes if advertising set uses
432  * legacy advertising PDUs with extended advertising.
433  * \param pData Pointer to the data.
434  * \param bufLen Length of the data buffer maintained by Application. Minimum length is
435  * 31 bytes.
436  *
437  * \return None.
438  */
439 /*************************************************************************************************/
440 void AppExtAdvSetData(uint8_t advHandle, uint8_t location, uint16_t len, uint8_t *pData, uint16_t bufLen);
441 
442 /*************************************************************************************************/
443 /*!
444  * \brief Start extended advertising using the parameters for the given mode.
445  *
446  * \param numSets Number of advertising sets.
447  * \param pAdvHandles Advertising handles array.
448  * \param mode Discoverable/connectable mode.
449  *
450  * \return None.
451  */
452 /*************************************************************************************************/
453 void AppExtAdvStart(uint8_t numSets, uint8_t *pAdvHandles, uint8_t mode);
454 
455 /*************************************************************************************************/
456 /*!
457  * \brief Stop extended advertising. If the number of sets is set to 0 then all advertising
458  * sets are disabled.
459  *
460  * \param numSets Number of advertising sets.
461  * \param pAdvHandles Advertising handle.
462  *
463  * \return None.
464  */
465 /*************************************************************************************************/
466 void AppExtAdvStop(uint8_t numSets, uint8_t *pAdvHandles);
467 
468 /*************************************************************************************************/
469 /*!
470  * \brief Set the value of an advertising data element in the extended advertising or scan
471  * response data. If the element already exists in the data then it is replaced
472  * with the new value. If the element does not exist in the data it is appended
473  * to it, space permitting.
474  *
475  * There is special handling for the device name (AD type DM_ADV_TYPE_LOCAL_NAME).
476  * If the name can only fit in the data if it is shortened, the name is shortened
477  * and the AD type is changed to DM_ADV_TYPE_SHORT_NAME.
478  *
479  * \param advHandle Advertising handle.
480  * \param location Data location.
481  * \param adType Advertising data element type.
482  * \param len Length of the value. Maximum length is 31 bytes if advertising set uses
483  * legacy advertising PDUs with extended advertising.
484  * \param pValue Pointer to the value.
485  *
486  * \return TRUE if the element was successfully added to the data, FALSE otherwise.
487  */
488 /*************************************************************************************************/
489 bool_t AppExtAdvSetAdValue(uint8_t advHandle, uint8_t location, uint8_t adType, uint8_t len,
490  uint8_t *pValue);
491 
492 /*************************************************************************************************/
493 /*!
494  * \brief Set extended advertising type.
495  *
496  * \param advHandle Advertising handle.
497  * \param advType Advertising type.
498  *
499  * \return None.
500  */
501 /*************************************************************************************************/
502 void AppExtSetAdvType(uint8_t advHandle, uint8_t advType);
503 
504 /*************************************************************************************************/
505 /*!
506  * \brief Accept a connection to a peer device with the given address using a given advertising
507  * set.
508  *
509  * \param advHandle Advertising handle.
510  * \param advType Advertising type.
511  * \param addrType Address type.
512  * \param pAddr Peer device address.
513  *
514  * \return Connection identifier.
515  */
516  /*************************************************************************************************/
517 dmConnId_t AppExtConnAccept(uint8_t advHandle, uint8_t advType, uint8_t addrType, uint8_t *pAddr);
518 
519 /*************************************************************************************************/
520 /*!
521  * \brief Set periodic advertising data.
522  *
523  * \param advHandle Advertising handle.
524  * \param len Length of the data.
525  * \param pData Pointer to the data.
526  * \param bufLen Length of the data buffer maintained by Application. Minimum length is
527  * 31 bytes.
528  *
529  * \return None.
530  */
531 /*************************************************************************************************/
532 void AppPerAdvSetData(uint8_t advHandle, uint16_t len, uint8_t *pData, uint16_t bufLen);
533 
534 /*************************************************************************************************/
535 /*!
536  * \brief Start periodic advertising for the given advertising handle.
537  *
538  * \param advHandle Advertising handle.
539  *
540  * \return None.
541  */
542 /*************************************************************************************************/
543 void AppPerAdvStart(uint8_t advHandle);
544 
545 /*************************************************************************************************/
546 /*!
547  * \brief Stop periodic advertising for the given advertising handle.
548  *
549  * \param advHandle Advertising handle.
550  *
551  * \return None.
552  */
553 /*************************************************************************************************/
554 void AppPerAdvStop(uint8_t advHandle);
555 
556 /*************************************************************************************************/
557 /*!
558  * \brief Set the value of an advertising data element in the periodic advertising data.
559  * If the element already exists in the data then it is replaced with the new value.
560  * If the element does not exist in the data it is appended to it, space permitting.
561  *
562  * There is special handling for the device name (AD type DM_ADV_TYPE_LOCAL_NAME).
563  * If the name can only fit in the data if it is shortened, the name is shortened
564  * and the AD type is changed to DM_ADV_TYPE_SHORT_NAME.
565  *
566  * \param advHandle Advertising handle.
567  * \param adType Advertising data element type.
568  * \param len Length of the value. Maximum length is 31 bytes if advertising set uses
569  * legacy advertising PDUs with extended advertising.
570  * \param pValue Pointer to the value.
571  *
572  * \return TRUE if the element was successfully added to the data, FALSE otherwise.
573  */
574 /*************************************************************************************************/
575 bool_t AppPerAdvSetAdValue(uint8_t advHandle, uint8_t adType, uint8_t len, uint8_t *pValue);
576 
577 /**@}*/
578 
579 /** \name App Scan Functions
580  * configure and enable legacy and extended scanning and periodic synch.
581  */
582 /**@{*/
583 
584 /*************************************************************************************************/
585 /*!
586  * \brief Start scanning. A scan is performed using the given discoverability mode,
587  * scan type, and duration.
588  *
589  * \param mode Discoverability mode.
590  * \param scanType Scan type.
591  * \param duration The scan duration, in milliseconds. If set to zero, scanning will
592  * continue until AppScanStop() is called.
593  *
594  * \return None.
595  */
596 /*************************************************************************************************/
597 void AppScanStart(uint8_t mode, uint8_t scanType, uint16_t duration);
598 
599 /*************************************************************************************************/
600 /*!
601  * \brief Stop scanning.
602  *
603  * \return None.
604  */
605 /*************************************************************************************************/
606 void AppScanStop(void);
607 
608 /*************************************************************************************************/
609 /*!
610 * \brief Resolve the advertiser's RPA (AdvA) or the initiator's RPA (InitA) of a directed
611 * advertisement report. If the addresses resolved then a connection will be initiated.
612 *
613 * \param pMsg Pointer to DM callback event message.
614 * \param dbHdl Database record handle.
615 * \param resolveType Which address in advertising report to be resolved.
616 *
617 * \return None.
618 */
619 /*************************************************************************************************/
620 void AppMasterResolveAddr(dmEvt_t *pMsg, appDbHdl_t dbHdl, uint8_t resolveType);
621 
622 /*************************************************************************************************/
623 /*!
624  * \brief Start scanning. A scan is performed using the given scanner PHYs, discoverability
625  * mode, scan type, duration, and period.
626  *
627  * \param scanPhys Scanner PHYs.
628  * \param mode Discoverability mode.
629  * \param pScanType Scan type array.
630  * \param duration The scan duration, in milliseconds. If set to zero or both duration and
631  * period set to non-zero, scanning will continue until DmExtScanStop() is
632  * called.
633  * \param period The scan period, in 1.28 sec units. Set to zero to disable periodic scanning.
634  *
635  * \return None.
636  */
637 /*************************************************************************************************/
638 void AppExtScanStart(uint8_t scanPhys, uint8_t mode, const uint8_t *pScanType, uint16_t duration,
639  uint16_t period);
640 
641 /*************************************************************************************************/
642 /*!
643  * \brief Stop scanning.
644  *
645  * \return None.
646  */
647 /*************************************************************************************************/
648 void AppExtScanStop(void);
649 
650 /*************************************************************************************************/
651 /*!
652  * \brief Get a stored scan result from the scan result list. The first result is at
653  * index zero.
654  *
655  * \param idx Index of result in scan result list.
656  *
657  * \return Pointer to scan result device info or NULL if index contains no result.
658  */
659 /*************************************************************************************************/
661 
662 /*************************************************************************************************/
663 /*!
664  * \brief Get the number of stored scan results.
665  *
666  * \return Number of stored scan results.
667  */
668 /*************************************************************************************************/
670 
671 /*************************************************************************************************/
672 /*!
673  * \brief Synchronize with periodic advertising from the given advertiser, and start receiving
674  * periodic advertising packets.
675  *
676  * \param advSid Advertising SID.
677  * \param advAddrType Advertiser address type.
678  * \param pAdvAddr Advertiser address.
679  * \param skip Number of periodic advertising packets that can be skipped after
680  * successful receive.
681  * \param syncTimeout Synchronization timeout.
682  *
683  * \return Sync identifier.
684  */
685 /*************************************************************************************************/
686 dmSyncId_t AppSyncStart(uint8_t advSid, uint8_t advAddrType, const uint8_t *pAdvAddr, uint16_t skip,
687  uint16_t syncTimeout);
688 
689 /*************************************************************************************************/
690 /*!
691  * \brief Stop reception of the periodic advertising identified by the given sync identifier.
692  *
693  * \param syncId Sync identifier.
694  *
695  * \return None.
696  */
697 /*************************************************************************************************/
698 void AppSyncStop(dmSyncId_t syncId);
699 
700 /**@}*/
701 
702 /** \name App Connection Functions
703  * Initiate and update connections
704  */
705 /**@{*/
706 
707 /*************************************************************************************************/
708 /*!
709 * \brief Open a connection to a peer device with the given address.
710 *
711 * \param addrType Address type.
712 * \param pAddr Peer device address.
713 * \param dbHdl Device database handle.
714 *
715 * \return Connection identifier.
716 */
717 /*************************************************************************************************/
718 dmConnId_t AppConnOpen(uint8_t addrType, uint8_t *pAddr, appDbHdl_t dbHdl);
719 
720 /*************************************************************************************************/
721 /*!
722  * \brief Close a connection with the given connection identifier.
723  *
724  * \param connId Connection identifier.
725  *
726  * \return None.
727  */
728 /*************************************************************************************************/
729 void AppConnClose(dmConnId_t connId);
730 
731 /*************************************************************************************************/
732 /*!
733  * \brief Open a connection to a peer device with the given address.
734  *
735  * \param initPhys Initiator PHYs.
736  * \param addrType Address type.
737  * \param pAddr Peer device address.
738  * \param dbHdl Device database handle.
739  *
740  * \return Connection identifier.
741  */
742 /*************************************************************************************************/
743 dmConnId_t AppExtConnOpen(uint8_t initPhys, uint8_t addrType, uint8_t *pAddr, appDbHdl_t dbHdl);
744 
745 /*************************************************************************************************/
746 /*!
747  * \brief Check if a connection is open.
748  *
749  * \return Connection ID of open connection or DM_CONN_ID_NONE if no open connections.
750  */
751 /*************************************************************************************************/
753 
754 /*************************************************************************************************/
755 /*!
756  * \brief Gets a list of connection identifiers of open connections.
757  *
758  * \param pConnIdList Buffer to hold connection IDs (must be DM_CONN_MAX bytes).
759  *
760  * \return Number of open connections.
761  *
762  */
763 /*************************************************************************************************/
764 uint8_t AppConnOpenList(dmConnId_t *pConnIdList);
765 
766 /**@}*/
767 
768 /** \name App Security and Bonding Functions
769  * Security and Bonding functions for configuration and interaction with \ref STACK_SMP Pairing
770  * procedures.
771  */
772 /**@{*/
773 
774 /*************************************************************************************************/
775 /*!
776  * \brief Set the bondable mode of the device.
777  *
778  * \param bondable TRUE to set device to bondable, FALSE to set to non-bondable.
779  *
780  * \return None.
781  */
782 /*************************************************************************************************/
783 void AppSetBondable(bool_t bondable);
784 
785 /*************************************************************************************************/
786 /*!
787  * \brief Initiate security as a master device. If there is a stored encryption key
788  * for the peer device this function will initiate encryption, otherwise it will
789  * initiate pairing.
790  *
791  * \param connId Connection identifier.
792  *
793  * \return None.
794  */
795 /*************************************************************************************************/
796 void AppMasterSecurityReq(dmConnId_t connId);
797 
798 /*************************************************************************************************/
799 /*!
800  * \brief Initiate a request for security as a slave device. This function will send a
801  * message to the master peer device requesting security. The master device should
802  * either initiate encryption or pairing.
803  *
804  * \param connId Connection identifier.
805  *
806  * \return None.
807  */
808 /*************************************************************************************************/
809 void AppSlaveSecurityReq(dmConnId_t connId);
810 
811 /*************************************************************************************************/
812 /*!
813  * \brief Handle a passkey request during pairing. If the passkey is to be displayed, a
814  * random passkey is generated and displayed. If the passkey is to be entered
815  * the user is prompted to enter the passkey.
816  *
817  * \param pAuthReq DM authentication requested event structure.
818  *
819  * \return None.
820  */
821 /*************************************************************************************************/
822 void AppHandlePasskey(dmSecAuthReqIndEvt_t *pAuthReq);
823 
824 /*************************************************************************************************/
825 /*!
826  * \brief Handle a numeric comparison indication during pairing. The confirmation value is
827  * displayed and the user is prompted to verify that the local and peer confirmation
828  * values match.
829  *
830  * \param pCnfInd DM confirmation indication event structure.
831  *
832  * \return None.
833  */
834 /*************************************************************************************************/
836 
837 /**@}*/
838 
839 /** \name App Event Processing
840  * Process received messages for which there is a general process.
841  */
842 /**@{*/
843 
844 /*************************************************************************************************/
845 /*!
846  * \brief Process connection-related DM messages for a slave. This function should be called
847  * from the application's event handler.
848  *
849  * \param pMsg Pointer to DM callback event message.
850  *
851  * \return None.
852  */
853 /*************************************************************************************************/
854 void AppSlaveProcDmMsg(dmEvt_t *pMsg);
855 
856 /*************************************************************************************************/
857 /*!
858  * \brief Process security-related DM messages for a slave. This function should be called
859  * from the application's event handler.
860  *
861  * \param pMsg Pointer to DM callback event message.
862  *
863  * \return None.
864  */
865 /*************************************************************************************************/
866 void AppSlaveSecProcDmMsg(dmEvt_t *pMsg);
867 
868 /*************************************************************************************************/
869 /*!
870  * \brief Process connection-related DM messages for a master. This function should be called
871  * from the application's event handler.
872  *
873  * \param pMsg Pointer to DM callback event message.
874  *
875  * \return None.
876  */
877 /*************************************************************************************************/
878 void AppMasterProcDmMsg(dmEvt_t *pMsg);
879 
880 /*************************************************************************************************/
881 /*!
882  * \brief Process security-related DM messages for a master. This function should be called
883  * from the application's event handler.
884  *
885  * \param pMsg Pointer to DM callback event message.
886  *
887  * \return None.
888  */
889 /*************************************************************************************************/
890 void AppMasterSecProcDmMsg(dmEvt_t *pMsg);
891 
892 /*************************************************************************************************/
893 /*!
894  * \brief ATT connection callback for app framework. This function is used when the application
895  * is operating as an ATT server and it uses notifications or indications. This
896  * function can be called by the application's ATT connection callback or it can be
897  * installed as the ATT connection callback.
898  *
899  * \param pDmEvt DM callback event.
900  *
901  * \return None.
902  */
903 /*************************************************************************************************/
904 void AppServerConnCback(dmEvt_t *pDmEvt);
905 
906 /**@}*/
907 
908 /** \name APP Service Discovery
909  * GATT Service Discovery initialization, configuration and execution.
910  */
911 /**@{*/
912 
913 /*************************************************************************************************/
914 /*!
915  * \brief Initialize app framework discovery.
916  *
917  * \return None.
918  */
919 /*************************************************************************************************/
920 void AppDiscInit(void);
921 
922 /*************************************************************************************************/
923 /*!
924  * \brief Register a callback function to service discovery status.
925  *
926  * \param cback Application service discovery callback function.
927  *
928  * \return None.
929  */
930 /*************************************************************************************************/
931 void AppDiscRegister(appDiscCback_t cback);
932 
933 /*************************************************************************************************/
934 /*!
935  * \brief Set the discovery cached handle list for a given connection.
936  *
937  * \param connId Connection identifier.
938  * \param hdlListLen Length of characteristic and handle lists.
939  * \param pHdlList Characteristic handle list.
940  *
941  * \return None.
942  */
943 /*************************************************************************************************/
944 void AppDiscSetHdlList(dmConnId_t connId, uint8_t hdlListLen, uint16_t *pHdlList);
945 
946 /*************************************************************************************************/
947 /*!
948  * \brief Service discovery or configuration procedure complete.
949  *
950  * \param connId Connection identifier.
951  * \param status Service or configuration status.
952  *
953  * \return None.
954  */
955 /*************************************************************************************************/
956 void AppDiscComplete(dmConnId_t connId, uint8_t status);
957 
958 /*************************************************************************************************/
959 /*!
960  * \brief Perform service and characteristic discovery for a given service.
961  *
962  * \param connId Connection identifier.
963  * \param uuidLen Length of service UUID (2 or 16).
964  * \param pUuid Pointer to service UUID.
965  * \param listLen Length of characteristic and handle lists.
966  * \param pCharList Characterisic list for discovery.
967  * \param pHdlList Characteristic handle list.
968  *
969  * \return None.
970  */
971 /*************************************************************************************************/
972 void AppDiscFindService(dmConnId_t connId, uint8_t uuidLen, uint8_t *pUuid, uint8_t listLen,
973  attcDiscChar_t **pCharList, uint16_t *pHdlList);
974 
975 /*************************************************************************************************/
976 /*!
977  * \brief Configure characteristics for discovered services.
978  *
979  * \param connId Connection identifier.
980  * \param status APP_DISC_CFG_START or APP_DISC_CFG_CONN_START.
981  * \param cfgListLen Length of characteristic configuration list.
982  * \param pCfgList Characteristic configuration list.
983  * \param hdlListLen Length of characteristic handle list.
984  * \param pHdlList Characteristic handle list.
985  *
986  * \return None.
987  */
988 /*************************************************************************************************/
989 void AppDiscConfigure(dmConnId_t connId, uint8_t status, uint8_t cfgListLen,
990  attcDiscCfg_t *pCfgList, uint8_t hdlListLen, uint16_t *pHdlList);
991 
992 /*************************************************************************************************/
993 /*!
994  * \brief Perform the GATT service changed procedure. This function is called when an
995  * indication is received containing the GATT service changed characteristic. This
996  * function may initialize the discovery state and initiate service discovery
997  * and configuration.
998  *
999  * \param pMsg Pointer to ATT callback event message containing received indication.
1000  *
1001  * \return None.
1002  */
1003 /*************************************************************************************************/
1004 void AppDiscServiceChanged(attEvt_t *pMsg);
1005 
1006 /*************************************************************************************************/
1007 /*!
1008  * \brief Process discovery-related DM messages. This function should be called
1009  * from the application's event handler.
1010  *
1011  * \param pMsg Pointer to DM callback event message.
1012  *
1013  * \return None.
1014  */
1015 /*************************************************************************************************/
1016 void AppDiscProcDmMsg(dmEvt_t *pMsg);
1017 
1018 /*************************************************************************************************/
1019 /*!
1020  * \brief Process discovery-related ATT messages. This function should be called
1021  * from the application's event handler.
1022  *
1023  * \param pMsg Pointer to ATT callback event message.
1024  *
1025  * \return None.
1026  */
1027 /*************************************************************************************************/
1028 void AppDiscProcAttMsg(attEvt_t *pMsg);
1029 
1030 /**@}*/
1031 
1032 /** \name App Privacy Functions
1033  * Maintain privacy information about known peer devices.
1034  */
1035 /**@{*/
1036 /*************************************************************************************************/
1037 /*!
1038 * \brief Add device to resolving list.
1039 *
1040 * \param pMsg Pointer to DM callback event message.
1041 * \param connId Connection identifier.
1042 *
1043 * \return None.
1044 */
1045 /*************************************************************************************************/
1046 void AppAddDevToResList(dmEvt_t *pMsg, dmConnId_t connId);
1047 
1048 /*************************************************************************************************/
1049 /*!
1050  * \brief Update privacy mode for a given peer device.
1051  *
1052  * \param hdl Database record handle.
1053  *
1054  * \return None.
1055  */
1056 /*************************************************************************************************/
1058 
1059 /**!@}*/
1060 
1061 /*! \} */ /* APP_FRAMEWORK_API */
1062 
1063 
1064 /*! \addtogroup STACK_EVENT
1065  * \{ */
1066 
1067 /** \name App Event Handling
1068  * Message passing interface to App Framework from other tasks through WSF.
1069  */
1070 /**@{*/
1071 
1072 /*************************************************************************************************/
1073 /*!
1074  * \brief App framework handler init function called during system initialization.
1075  *
1076  * \param handlerId WSF handler ID for App.
1077  *
1078  * \return None.
1079  */
1080 /*************************************************************************************************/
1081 void AppHandlerInit(wsfHandlerId_t handlerId);
1082 
1083 /*************************************************************************************************/
1084 /*!
1085  * \brief WSF event handler for app framework.
1086  *
1087  * \param event WSF event mask.
1088  * \param pMsg WSF message.
1089  *
1090  * \return None.
1091  */
1092 /*************************************************************************************************/
1093 void AppHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg);
1094 
1095 /**@}*/
1096 
1097 /*! \} */ /* STACK_EVENT */
1098 
1099 
1100 #ifdef __cplusplus
1101 };
1102 #endif
1103 
1104 #endif /* APP_API_H */
Advertising state 3.
Definition: app_api.h:56
Service discovery started.
Definition: app_api.h:78
void AppHandleNumericComparison(dmSecCnfIndEvt_t *pCnfInd)
Handle a numeric comparison indication during pairing. The confirmation value is displayed and the us...
uint8_t wsfEventMask_t
Event handler event mask data type.
Definition: wsf_os.h:77
Service discovery complete.
Definition: app_api.h:79
uint8_t dmConnId_t
Connection identifier.
Definition: dm_api.h:501
Configurable parameters for security.
Definition: app_api.h:158
Advertising stopped.
Definition: app_api.h:57
void AppServerConnCback(dmEvt_t *pDmEvt)
ATT connection callback for app framework. This function is used when the application is operating as...
Scan data for connectable mode.
Definition: app_api.h:64
appMasterCfg_t * pAppMasterCfg
This is a pointer to the master configurable parameters used by the application. If master mode is us...
void * appDbHdl_t
Device database record handle type.
Definition: app_db.h:44
ATT callback event.
Definition: att_api.h:154
dmConnId_t AppConnAccept(uint8_t advType, uint8_t addrType, uint8_t *pAddr)
Accept a connection to a peer device with the given address.
void AppExtAdvStart(uint8_t numSets, uint8_t *pAdvHandles, uint8_t mode)
Start extended advertising using the parameters for the given mode.
appDevInfo_t * AppScanGetResult(uint8_t idx)
Get a stored scan result from the scan result list. The first result is at index zero.
void AppScanStart(uint8_t mode, uint8_t scanType, uint16_t duration)
Start scanning. A scan is performed using the given discoverability mode, scan type, and duration.
Data type for DM_SEC_COMPARE_IND.
Definition: dm_api.h:592
void AppExtScanStart(uint8_t scanPhys, uint8_t mode, const uint8_t *pScanType, uint16_t duration, uint16_t period)
Start scanning. A scan is performed using the given scanner PHYs, discoverability mode...
void AppMasterSecProcDmMsg(dmEvt_t *pMsg)
Process security-related DM messages for a master. This function should be called from the applicatio...
void AppPerAdvSetData(uint8_t advHandle, uint16_t len, uint8_t *pData, uint16_t bufLen)
Set periodic advertising data.
void AppConnClose(dmConnId_t connId)
Close a connection with the given connection identifier.
uint8_t bool_t
Boolean data type.
Definition: wsf_types.h:78
void AppHandlerInit(wsfHandlerId_t handlerId)
App framework handler init function called during system initialization.
appSlaveCfg_t * pAppSlaveCfg
This is a pointer to the slave configurable parameters used by the application. If slave mode is used...
void AppExtSetAdvPeerAddr(uint8_t advHandle, uint8_t peerAddrType, uint8_t *pPeerAddr)
Set advertising peer address and its type for the given advertising set.
appReqActCfg_t * pAppSlaveReqActCfg
This is a pointer to the master incoming request actions used by the application. The application mus...
Reject incoming request.
Definition: app_api.h:90
void AppHandlePasskey(dmSecAuthReqIndEvt_t *pAuthReq)
Handle a passkey request during pairing. If the passkey is to be displayed, a random passkey is gener...
ATT client structure for characteristic and descriptor discovery.
Definition: att_api.h:302
void AppSlaveInit(void)
Initialize the App Framework for operation as a Bluetooth LE slave.
appReqActCfg_t * pAppMasterReqActCfg
This is a pointer to the master incoming request actions used by the application. The application mus...
Device information data type.
Definition: app_api.h:200
dmSyncId_t AppSyncStart(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...
dmConnId_t AppConnOpen(uint8_t addrType, uint8_t *pAddr, appDbHdl_t dbHdl)
Open a connection to a peer device with the given address.
void AppDiscRegister(appDiscCback_t cback)
Register a callback function to service discovery status.
appCfg_t * pAppCfg
This is a pointer to the application parameters used by the application. The application must set thi...
void AppAdvSetData(uint8_t location, uint8_t len, uint8_t *pData)
Set advertising or scan data. Separate advertising and scan data can be set for connectable and disco...
void AppExtScanStop(void)
Stop scanning.
void AppDiscServiceChanged(attEvt_t *pMsg)
Perform the GATT service changed procedure. This function is called when an indication is received co...
Advertising state 1.
Definition: app_api.h:54
uint8_t AppScanGetNumResults(void)
Get the number of stored scan results.
appExtAdvCfg_t * pAppExtAdvCfg
This is a pointer to the extended advertising configurable parameters used by the application...
Security required to complete configuration.
Definition: app_api.h:77
void AppDiscProcDmMsg(dmEvt_t *pMsg)
Process discovery-related DM messages. This function should be called from the application&#39;s event ha...
Configurable parameters for service and characteristic discovery.
Definition: app_api.h:186
void AppMasterSecurityReq(dmConnId_t connId)
Initiate security as a master device. If there is a stored encryption key for the peer device this fu...
Do nothing - app will handle incoming request.
Definition: app_api.h:91
Configurable parameters for master.
Definition: app_api.h:132
bool_t AppExtAdvSetAdValue(uint8_t advHandle, uint8_t location, uint8_t adType, uint8_t len, uint8_t *pValue)
Set the value of an advertising data element in the extended advertising or scan response data...
number of data storage locations.
Definition: app_api.h:67
Configuration for connection setup started.
Definition: app_api.h:82
Configurable parameters for advertising.
Definition: app_api.h:104
appExtMasterCfg_t * pAppExtMasterCfg
This is a pointer to the extended master configurable parameters used by the application. If master mode is used, the application must set this variable during system initialization.
uint8_t dmSyncId_t
Synchronization identifier.
Definition: dm_api.h:504
dmConnId_t AppExtConnOpen(uint8_t initPhys, uint8_t addrType, uint8_t *pAddr, appDbHdl_t dbHdl)
Open a connection to a peer device with the given address.
Service configuration started.
Definition: app_api.h:81
bool_t AppPerAdvSetAdValue(uint8_t advHandle, uint8_t adType, uint8_t len, uint8_t *pValue)
Set the value of an advertising data element in the periodic advertising data. If the element already...
Union of DM callback event data types.
Definition: dm_api.h:658
Configurable parameters for application.
Definition: app_api.h:193
Advertising data for connectable mode.
Definition: app_api.h:63
void AppMasterProcDmMsg(dmEvt_t *pMsg)
Process connection-related DM messages for a master. This function should be called from the applicat...
void AppDiscFindService(dmConnId_t connId, uint8_t uuidLen, uint8_t *pUuid, uint8_t listLen, attcDiscChar_t **pCharList, uint16_t *pHdlList)
Perform service and characteristic discovery for a given service.
void AppSetAdvType(uint8_t advType)
Set advertising type.
dmConnId_t AppExtConnAccept(uint8_t advHandle, uint8_t advType, uint8_t addrType, uint8_t *pAddr)
Accept a connection to a peer device with the given address using a given advertising set...
void AppAdvStart(uint8_t mode)
Start advertising using the parameters for the given mode.
Advertising data for discoverable mode.
Definition: app_api.h:65
void AppAddDevToResList(dmEvt_t *pMsg, dmConnId_t connId)
Add device to resolving list.
appSecCfg_t * pAppSecCfg
This is a pointer to the security-related configurable parameters used by the application. The application must set this variable during system initialization.
void AppDiscInit(void)
Initialize app framework discovery.
void AppDiscConfigure(dmConnId_t connId, uint8_t status, uint8_t cfgListLen, attcDiscCfg_t *pCfgList, uint8_t hdlListLen, uint16_t *pHdlList)
Configure characteristics for discovered services.
Application framework device database.
void AppDiscSetHdlList(dmConnId_t connId, uint8_t hdlListLen, uint16_t *pHdlList)
Set the discovery cached handle list for a given connection.
void AppExtAdvSetData(uint8_t advHandle, uint8_t location, uint16_t len, uint8_t *pData, uint16_t bufLen)
Set extended advertising data.
#define DM_NUM_ADV_SETS
Number of supported advertising sets: must be set to 1 for legacy advertising.
Definition: cfg_stack.h:84
void AppScanStop(void)
Stop scanning.
uint8_t wsfHandlerId_t
Event handler ID data type.
Definition: wsf_os.h:74
#define APP_ADV_NUM_CFG
Number of advertising configurations.
Definition: app_api.h:71
void AppDiscComplete(dmConnId_t connId, uint8_t status)
Service discovery or configuration procedure complete.
Configurable parameters for extended and periodic advertising.
Definition: app_api.h:111
Scan data for discoverable mode.
Definition: app_api.h:66
No discovery or configuration complete.
Definition: app_api.h:76
void AppSlaveSecurityReq(dmConnId_t connId)
Initiate a request for security as a slave device. This function will send a message to the master pe...
void AppHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg)
WSF event handler for app framework.
uint8_t bdAddr_t[BDA_ADDR_LEN]
BD address data type.
Definition: bda.h:62
void AppSetBondable(bool_t bondable)
Set the bondable mode of the device.
Advertising state 2.
Definition: app_api.h:55
bool_t AppSlaveIsAdvertising(void)
Check if the local device&#39;s currently advertising.
Device Manager subsystem API.
Accept incoming request.
Definition: app_api.h:89
dmConnId_t AppConnIsOpen(void)
Check if a connection is open.
appAdvCfg_t * pAppAdvCfg
This is a pointer to the advertising configurable parameters used by the application. If advertising is used, the application must set this variable during system initialization.
void AppUpdatePrivacyMode(appDbHdl_t hdl)
Update privacy mode for a given peer device.
void AppSetAdvPeerAddr(uint8_t peerAddrType, uint8_t *pPeerAddr)
Set advertising peer address and its type.
void AppExtAdvStop(uint8_t numSets, uint8_t *pAdvHandles)
Stop extended advertising. If the number of sets is set to 0 then all advertising sets are disabled...
Configurable parameters for connection parameter update.
Definition: app_api.h:168
unsigned short uint16_t
Unsigned 16-bit value.
Definition: wsf_types.h:67
Data type for DM_SEC_AUTH_REQ_IND.
Definition: dm_api.h:557
void AppExtSetAdvType(uint8_t advHandle, uint8_t advType)
Set extended advertising type.
Configurable parameters for extended master.
Definition: app_api.h:144
Service configuration complete.
Definition: app_api.h:83
void AppSyncStop(dmSyncId_t syncId)
Stop reception of the periodic advertising identified by the given sync identifier.
void AppSlaveProcDmMsg(dmEvt_t *pMsg)
Process connection-related DM messages for a slave. This function should be called from the applicati...
void AppSlaveSecProcDmMsg(dmEvt_t *pMsg)
Process security-related DM messages for a slave. This function should be called from the application...
void(* appDiscCback_t)(dmConnId_t connId, uint8_t status)
Service discovery and configuration callback.
Definition: app_api.h:216
appDiscCfg_t * pAppDiscCfg
This is a pointer to the discovery parameters used by the application. The application must set this ...
uint32_t wsfTimerTicks_t
Timer ticks data type.
Definition: wsf_timer.h:45
ATT client structure for characteristic and descriptor configuration.
Definition: att_api.h:309
Configurable parameters for incoming request actions.
Definition: app_api.h:180
void AppMasterResolveAddr(dmEvt_t *pMsg, appDbHdl_t dbHdl, uint8_t resolveType)
Resolve the advertiser&#39;s RPA (AdvA) or the initiator&#39;s RPA (InitA) of a directed advertisement report...
void AppMasterInit(void)
Initialize the App Framework for operation as a Bluetooth LE master.
void AppDiscProcAttMsg(attEvt_t *pMsg)
Process discovery-related ATT messages. This function should be called from the application&#39;s event h...
Attribute protocol client and server API.
uint8_t AppConnOpenList(dmConnId_t *pConnIdList)
Gets a list of connection identifiers of open connections.
appUpdateCfg_t * pAppUpdateCfg
This is a pointer to the connection parameter update parameters used by the application. The application must set this variable during system initialization.
Software foundation OS API.
Common message structure passed to event handler.
Definition: wsf_os.h:97
Configurable parameters for slave.
Definition: app_api.h:126
Service discovery failed.
Definition: app_api.h:80
void AppPerAdvStop(uint8_t advHandle)
Stop periodic advertising for the given advertising handle.
#define DM_NUM_PHYS
Number of scanner and initiator PHYs (LE 1M, LE 2M and LE Coded): must be set to 1 for legacy scanner...
Definition: cfg_stack.h:90
unsigned char uint8_t
Unsigned 8-bit value.
Definition: wsf_types.h:63
void AppAdvStop(void)
Stop advertising. The device will no longer be connectable or discoverable.
bool_t AppAdvSetAdValue(uint8_t location, uint8_t adType, uint8_t len, uint8_t *pValue)
Set the value of an advertising data element in the advertising or scan response data. If the element already exists in the data then it is replaced with the new value. If the element does not exist in the data it is appended to it, space permitting.
void AppPerAdvStart(uint8_t advHandle)
Start periodic advertising for the given advertising handle.