Cordio Stack and Cordio Profiles  r2p3-02rel0

Data Structures

struct  appAdvCfg_t
 Configurable parameters for advertising. More...
 
struct  appExtAdvCfg_t
 Configurable parameters for extended and periodic advertising. More...
 
struct  appSlaveCfg_t
 Configurable parameters for slave. More...
 
struct  appMasterCfg_t
 Configurable parameters for master. More...
 
struct  appExtMasterCfg_t
 Configurable parameters for extended master. More...
 
struct  appSecCfg_t
 Configurable parameters for security. More...
 
struct  appUpdateCfg_t
 Configurable parameters for connection parameter update. More...
 
struct  appReqActCfg_t
 Configurable parameters for incoming request actions. More...
 
struct  appDiscCfg_t
 Configurable parameters for service and characteristic discovery. More...
 
struct  appCfg_t
 Configurable parameters for application. More...
 
struct  appDevInfo_t
 Device information data type. More...
 

Macros

#define APP_ADV_NUM_CFG   APP_ADV_STOPPED
 Number of advertising configurations.
 
#define APP_RESOLVE_ADV_RPA   0
 Resolving the advertiser's RPA (AdvA)
 
#define APP_RESOLVE_DIRECT_RPA   1
 Resolving RPA the directed advertisement is being directed to (InitA)
 
#define APP_SCAN_RESULT_MAX   10
 Number of scan results to store (used only when operating as master)
 

Typedefs

typedef void(* appDiscCback_t) (dmConnId_t connId, uint8_t status)
 Service discovery and configuration callback. More...
 

Enumerations

enum  {
  APP_ADV_STATE1,
  APP_ADV_STATE2,
  APP_ADV_STATE3,
  APP_ADV_STOPPED
}
 Advertising states. More...
 
enum  {
  APP_ADV_DATA_CONNECTABLE,
  APP_SCAN_DATA_CONNECTABLE,
  APP_ADV_DATA_DISCOVERABLE,
  APP_SCAN_DATA_DISCOVERABLE,
  APP_NUM_DATA_LOCATIONS
}
 Advertising and scan data storage locations. More...
 
enum  {
  APP_DISC_INIT,
  APP_DISC_SEC_REQUIRED,
  APP_DISC_START,
  APP_DISC_CMPL,
  APP_DISC_FAILED,
  APP_DISC_CFG_START,
  APP_DISC_CFG_CONN_START,
  APP_DISC_CFG_CMPL
}
 Service discovery and configuration client status. More...
 
enum  {
  APP_ACT_ACCEPT,
  APP_ACT_REJECT,
  APP_ACT_NONE
}
 Actions for incoming requests. More...
 

Variables

appAdvCfg_tpAppAdvCfg
 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.
 
appExtAdvCfg_tpAppExtAdvCfg
 This is a pointer to the extended advertising configurable parameters used by the application. If extended advertising is used, the application must set this variable during system initialization.
 
appSlaveCfg_tpAppSlaveCfg
 This is a pointer to the slave configurable parameters used by the application. If slave mode is used, the application must set this variable during system initialization.
 
appMasterCfg_tpAppMasterCfg
 This is a pointer to the master configurable parameters used by the application. If master mode is used, the application must set this variable during system initialization.
 
appExtMasterCfg_tpAppExtMasterCfg
 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.
 
appSecCfg_tpAppSecCfg
 This is a pointer to the security-related configurable parameters used by the application. The application must set this variable during system initialization.
 
appUpdateCfg_tpAppUpdateCfg
 This is a pointer to the connection parameter update parameters used by the application. The application must set this variable during system initialization.
 
appDiscCfg_tpAppDiscCfg
 This is a pointer to the discovery parameters used by the application. The application must set this variable during system initialization.
 
appCfg_tpAppCfg
 This is a pointer to the application parameters used by the application. The application must set this variable during system initialization.
 
appReqActCfg_tpAppMasterReqActCfg
 This is a pointer to the master incoming request actions used by the application. The application must set this variable during system initialization.
 
appReqActCfg_tpAppSlaveReqActCfg
 This is a pointer to the master incoming request actions used by the application. The application must set this variable during system initialization.
 

App Advertising Mode

Discoverable/connectable mode used by function AppAdvStart.

#define APP_MODE_CONNECTABLE   0
 Connectable mode.
 
#define APP_MODE_DISCOVERABLE   1
 Discoverable mode.
 
#define APP_MODE_AUTO_INIT   2
 Automatically configure mode based on bonding info.
 
#define APP_MODE_NONE   255
 For internal use only.
 
#define APP_NUM_MODES   2
 Number of Discoverable/connectable modes.
 

App Initialization Functions

Application role initialization.

void AppSlaveInit (void)
 Initialize the App Framework for operation as a Bluetooth LE slave. More...
 
void AppMasterInit (void)
 Initialize the App Framework for operation as a Bluetooth LE master. More...
 

App Advertising Functions

Configure and send legacy, extended and periodic advertisments.

void AppSetAdvType (uint8_t advType)
 Set advertising type. More...
 
void AppSetAdvPeerAddr (uint8_t peerAddrType, uint8_t *pPeerAddr)
 Set advertising peer address and its type. More...
 
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 discoverable modes. The application must allocate and maintain the memory pointed to by pData while the device is advertising. More...
 
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. More...
 
void AppAdvStart (uint8_t mode)
 Start advertising using the parameters for the given mode. More...
 
void AppAdvStop (void)
 Stop advertising. The device will no longer be connectable or discoverable. More...
 
dmConnId_t AppConnAccept (uint8_t advType, uint8_t addrType, uint8_t *pAddr)
 Accept a connection to a peer device with the given address. More...
 
bool_t AppSlaveIsAdvertising (void)
 Check if the local device's currently advertising. More...
 
void AppExtSetAdvPeerAddr (uint8_t advHandle, uint8_t peerAddrType, uint8_t *pPeerAddr)
 Set advertising peer address and its type for the given advertising set. More...
 
void AppExtAdvSetData (uint8_t advHandle, uint8_t location, uint16_t len, uint8_t *pData, uint16_t bufLen)
 Set extended advertising data. More...
 
void AppExtAdvStart (uint8_t numSets, uint8_t *pAdvHandles, uint8_t mode)
 Start extended advertising using the parameters for the given mode. More...
 
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. More...
 
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. 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. More...
 
void AppExtSetAdvType (uint8_t advHandle, uint8_t advType)
 Set extended advertising type. More...
 
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. More...
 
void AppPerAdvSetData (uint8_t advHandle, uint16_t len, uint8_t *pData, uint16_t bufLen)
 Set periodic advertising data. More...
 
void AppPerAdvStart (uint8_t advHandle)
 Start periodic advertising for the given advertising handle. More...
 
void AppPerAdvStop (uint8_t advHandle)
 Stop periodic advertising for the given advertising handle. More...
 
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 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. More...
 

App Scan Functions

configure and enable legacy and extended scanning and periodic synch.

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. More...
 
void AppScanStop (void)
 Stop scanning. More...
 
void AppMasterResolveAddr (dmEvt_t *pMsg, appDbHdl_t dbHdl, uint8_t resolveType)
 Resolve the advertiser's RPA (AdvA) or the initiator's RPA (InitA) of a directed advertisement report. If the addresses resolved then a connection will be initiated. More...
 
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, scan type, duration, and period. More...
 
void AppExtScanStop (void)
 Stop scanning. More...
 
appDevInfo_tAppScanGetResult (uint8_t idx)
 Get a stored scan result from the scan result list. The first result is at index zero. More...
 
uint8_t AppScanGetNumResults (void)
 Get the number of stored scan results. More...
 
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 advertising packets. More...
 
void AppSyncStop (dmSyncId_t syncId)
 Stop reception of the periodic advertising identified by the given sync identifier. More...
 

App Connection Functions

Initiate and update connections

dmConnId_t AppConnOpen (uint8_t addrType, uint8_t *pAddr, appDbHdl_t dbHdl)
 Open a connection to a peer device with the given address. More...
 
void AppConnClose (dmConnId_t connId)
 Close a connection with the given connection identifier. More...
 
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. More...
 
dmConnId_t AppConnIsOpen (void)
 Check if a connection is open. More...
 
uint8_t AppConnOpenList (dmConnId_t *pConnIdList)
 Gets a list of connection identifiers of open connections. More...
 

App Security and Bonding Functions

Security and Bonding functions for configuration and interaction with Security Manager Protocol (SMP) Pairing procedures.

void AppSetBondable (bool_t bondable)
 Set the bondable mode of the device. More...
 
void AppMasterSecurityReq (dmConnId_t connId)
 Initiate security as a master device. If there is a stored encryption key for the peer device this function will initiate encryption, otherwise it will initiate pairing. More...
 
void AppSlaveSecurityReq (dmConnId_t connId)
 Initiate a request for security as a slave device. This function will send a message to the master peer device requesting security. The master device should either initiate encryption or pairing. More...
 
void AppHandlePasskey (dmSecAuthReqIndEvt_t *pAuthReq)
 Handle a passkey request during pairing. If the passkey is to be displayed, a random passkey is generated and displayed. If the passkey is to be entered the user is prompted to enter the passkey. More...
 
void AppHandleNumericComparison (dmSecCnfIndEvt_t *pCnfInd)
 Handle a numeric comparison indication during pairing. The confirmation value is displayed and the user is prompted to verify that the local and peer confirmation values match. More...
 

App Event Processing

Process received messages for which there is a general process.

void AppSlaveProcDmMsg (dmEvt_t *pMsg)
 Process connection-related DM messages for a slave. This function should be called from the application's event handler. More...
 
void AppSlaveSecProcDmMsg (dmEvt_t *pMsg)
 Process security-related DM messages for a slave. This function should be called from the application's event handler. More...
 
void AppMasterProcDmMsg (dmEvt_t *pMsg)
 Process connection-related DM messages for a master. This function should be called from the application's event handler. More...
 
void AppMasterSecProcDmMsg (dmEvt_t *pMsg)
 Process security-related DM messages for a master. This function should be called from the application's event handler. More...
 
void AppServerConnCback (dmEvt_t *pDmEvt)
 ATT connection callback for app framework. This function is used when the application is operating as an ATT server and it uses notifications or indications. This function can be called by the application's ATT connection callback or it can be installed as the ATT connection callback. More...
 

APP Service Discovery

GATT Service Discovery initialization, configuration and execution.

void AppDiscInit (void)
 Initialize app framework discovery. More...
 
void AppDiscRegister (appDiscCback_t cback)
 Register a callback function to service discovery status. More...
 
void AppDiscSetHdlList (dmConnId_t connId, uint8_t hdlListLen, uint16_t *pHdlList)
 Set the discovery cached handle list for a given connection. More...
 
void AppDiscComplete (dmConnId_t connId, uint8_t status)
 Service discovery or configuration procedure complete. More...
 
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. More...
 
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. More...
 
void AppDiscServiceChanged (attEvt_t *pMsg)
 Perform the GATT service changed procedure. This function is called when an indication is received containing the GATT service changed characteristic. This function may initialize the discovery state and initiate service discovery and configuration. More...
 
void AppDiscProcDmMsg (dmEvt_t *pMsg)
 Process discovery-related DM messages. This function should be called from the application's event handler. More...
 
void AppDiscProcAttMsg (attEvt_t *pMsg)
 Process discovery-related ATT messages. This function should be called from the application's event handler. More...
 

App Privacy Functions

Maintain privacy information about known peer devices.

void AppAddDevToResList (dmEvt_t *pMsg, dmConnId_t connId)
 Add device to resolving list. More...
 
void AppUpdatePrivacyMode (appDbHdl_t hdl)
 Update privacy mode for a given peer device. More...
 

Description

Typedef Documentation

typedef void(* appDiscCback_t) (dmConnId_t connId, uint8_t status)

Service discovery and configuration callback.

Parameters
connIdConnection identifier.
statusService or configuration status.
Returns
None.

Definition at line 216 of file app_api.h.

Enumeration Type Documentation

anonymous enum

Advertising states.

Enumerator
APP_ADV_STATE1 

Advertising state 1.

APP_ADV_STATE2 

Advertising state 2.

APP_ADV_STATE3 

Advertising state 3.

APP_ADV_STOPPED 

Advertising stopped.

Definition at line 52 of file app_api.h.

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 };
Advertising state 3.
Definition: app_api.h:56
Advertising stopped.
Definition: app_api.h:57
Advertising state 1.
Definition: app_api.h:54
Advertising state 2.
Definition: app_api.h:55
anonymous enum

Advertising and scan data storage locations.

Enumerator
APP_ADV_DATA_CONNECTABLE 

Advertising data for connectable mode.

APP_SCAN_DATA_CONNECTABLE 

Scan data for connectable mode.

APP_ADV_DATA_DISCOVERABLE 

Advertising data for discoverable mode.

APP_SCAN_DATA_DISCOVERABLE 

Scan data for discoverable mode.

APP_NUM_DATA_LOCATIONS 

number of data storage locations.

Definition at line 61 of file app_api.h.

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 };
Scan data for connectable mode.
Definition: app_api.h:64
number of data storage locations.
Definition: app_api.h:67
Advertising data for connectable mode.
Definition: app_api.h:63
Advertising data for discoverable mode.
Definition: app_api.h:65
Scan data for discoverable mode.
Definition: app_api.h:66
anonymous enum

Service discovery and configuration client status.

Enumerator
APP_DISC_INIT 

No discovery or configuration complete.

APP_DISC_SEC_REQUIRED 

Security required to complete configuration.

APP_DISC_START 

Service discovery started.

APP_DISC_CMPL 

Service discovery complete.

APP_DISC_FAILED 

Service discovery failed.

APP_DISC_CFG_START 

Service configuration started.

APP_DISC_CFG_CONN_START 

Configuration for connection setup started.

APP_DISC_CFG_CMPL 

Service configuration complete.

Definition at line 74 of file app_api.h.

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 };
Service discovery started.
Definition: app_api.h:78
Service discovery complete.
Definition: app_api.h:79
Security required to complete configuration.
Definition: app_api.h:77
Configuration for connection setup started.
Definition: app_api.h:82
Service configuration started.
Definition: app_api.h:81
No discovery or configuration complete.
Definition: app_api.h:76
Service configuration complete.
Definition: app_api.h:83
Service discovery failed.
Definition: app_api.h:80
anonymous enum

Actions for incoming requests.

Enumerator
APP_ACT_ACCEPT 

Accept incoming request.

APP_ACT_REJECT 

Reject incoming request.

APP_ACT_NONE 

Do nothing - app will handle incoming request.

Definition at line 87 of file app_api.h.

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 };
Reject incoming request.
Definition: app_api.h:90
Do nothing - app will handle incoming request.
Definition: app_api.h:91
Accept incoming request.
Definition: app_api.h:89

Function Documentation

void AppSlaveInit ( void  )

Initialize the App Framework for operation as a Bluetooth LE slave.

Returns
None.
void AppMasterInit ( void  )

Initialize the App Framework for operation as a Bluetooth LE master.

Returns
None.
void AppSetAdvType ( uint8_t  advType)

Set advertising type.

Parameters
advTypeAdvertising type.
Returns
None.
void AppSetAdvPeerAddr ( uint8_t  peerAddrType,
uint8_t pPeerAddr 
)

Set advertising peer address and its type.

Parameters
peerAddrTypePeer address type.
pPeerAddrPeer address.
Returns
None.
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 discoverable modes. The application must allocate and maintain the memory pointed to by pData while the device is advertising.

Parameters
locationData location.
lenLength of the data. Maximum length is 31 bytes.
pDataPointer to the data.
Returns
None.
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.

There is special handling for the device name (AD type DM_ADV_TYPE_LOCAL_NAME). If the name can only fit in the data if it is shortened, the name is shortened and the AD type is changed to DM_ADV_TYPE_SHORT_NAME.

Parameters
locationData location.
adTypeAdvertising data element type.
lenLength of the value. Maximum length is 29 bytes.
pValuePointer to the value.
Returns
TRUE if the element was successfully added to the data, FALSE otherwise.
void AppAdvStart ( uint8_t  mode)

Start advertising using the parameters for the given mode.

Parameters
modeDiscoverable/connectable mode.
Returns
None.
void AppAdvStop ( void  )

Stop advertising. The device will no longer be connectable or discoverable.

Returns
None.
dmConnId_t AppConnAccept ( uint8_t  advType,
uint8_t  addrType,
uint8_t pAddr 
)

Accept a connection to a peer device with the given address.

Parameters
advTypeAdvertising type.
addrTypeAddress type.
pAddrPeer device address.
Returns
Connection identifier.
bool_t AppSlaveIsAdvertising ( void  )

Check if the local device's currently advertising.

Returns
TRUE if device's advertising. FALSE, otherwise.
void AppExtSetAdvPeerAddr ( uint8_t  advHandle,
uint8_t  peerAddrType,
uint8_t pPeerAddr 
)

Set advertising peer address and its type for the given advertising set.

Parameters
advHandleAdvertising handle.
peerAddrTypePeer address type.
pPeerAddrPeer address.
Returns
None.
void AppExtAdvSetData ( uint8_t  advHandle,
uint8_t  location,
uint16_t  len,
uint8_t pData,
uint16_t  bufLen 
)

Set extended advertising data.

Parameters
advHandleAdvertising handle.
locationData location.
lenLength of the data. Maximum length is 31 bytes if advertising set uses legacy advertising PDUs with extended advertising.
pDataPointer to the data.
bufLenLength of the data buffer maintained by Application. Minimum length is 31 bytes.
Returns
None.
void AppExtAdvStart ( uint8_t  numSets,
uint8_t pAdvHandles,
uint8_t  mode 
)

Start extended advertising using the parameters for the given mode.

Parameters
numSetsNumber of advertising sets.
pAdvHandlesAdvertising handles array.
modeDiscoverable/connectable mode.
Returns
None.
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.

Parameters
numSetsNumber of advertising sets.
pAdvHandlesAdvertising handle.
Returns
None.
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. 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.

There is special handling for the device name (AD type DM_ADV_TYPE_LOCAL_NAME). If the name can only fit in the data if it is shortened, the name is shortened and the AD type is changed to DM_ADV_TYPE_SHORT_NAME.

Parameters
advHandleAdvertising handle.
locationData location.
adTypeAdvertising data element type.
lenLength of the value. Maximum length is 31 bytes if advertising set uses legacy advertising PDUs with extended advertising.
pValuePointer to the value.
Returns
TRUE if the element was successfully added to the data, FALSE otherwise.
void AppExtSetAdvType ( uint8_t  advHandle,
uint8_t  advType 
)

Set extended advertising type.

Parameters
advHandleAdvertising handle.
advTypeAdvertising type.
Returns
None.
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.

Parameters
advHandleAdvertising handle.
advTypeAdvertising type.
addrTypeAddress type.
pAddrPeer device address.
Returns
Connection identifier.
void AppPerAdvSetData ( uint8_t  advHandle,
uint16_t  len,
uint8_t pData,
uint16_t  bufLen 
)

Set periodic advertising data.

Parameters
advHandleAdvertising handle.
lenLength of the data.
pDataPointer to the data.
bufLenLength of the data buffer maintained by Application. Minimum length is 31 bytes.
Returns
None.
void AppPerAdvStart ( uint8_t  advHandle)

Start periodic advertising for the given advertising handle.

Parameters
advHandleAdvertising handle.
Returns
None.
void AppPerAdvStop ( uint8_t  advHandle)

Stop periodic advertising for the given advertising handle.

Parameters
advHandleAdvertising handle.
Returns
None.
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 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.

There is special handling for the device name (AD type DM_ADV_TYPE_LOCAL_NAME). If the name can only fit in the data if it is shortened, the name is shortened and the AD type is changed to DM_ADV_TYPE_SHORT_NAME.

Parameters
advHandleAdvertising handle.
adTypeAdvertising data element type.
lenLength of the value. Maximum length is 31 bytes if advertising set uses legacy advertising PDUs with extended advertising.
pValuePointer to the value.
Returns
TRUE if the element was successfully added to the data, FALSE otherwise.
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.

Parameters
modeDiscoverability mode.
scanTypeScan type.
durationThe scan duration, in milliseconds. If set to zero, scanning will continue until AppScanStop() is called.
Returns
None.
void AppScanStop ( void  )

Stop scanning.

Returns
None.
void AppMasterResolveAddr ( dmEvt_t pMsg,
appDbHdl_t  dbHdl,
uint8_t  resolveType 
)

Resolve the advertiser's RPA (AdvA) or the initiator's RPA (InitA) of a directed advertisement report. If the addresses resolved then a connection will be initiated.

Parameters
pMsgPointer to DM callback event message.
dbHdlDatabase record handle.
resolveTypeWhich address in advertising report to be resolved.
Returns
None.
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, scan type, duration, and period.

Parameters
scanPhysScanner PHYs.
modeDiscoverability mode.
pScanTypeScan type array.
durationThe scan duration, in milliseconds. If set to zero or both duration and period set to non-zero, scanning will continue until DmExtScanStop() is called.
periodThe scan period, in 1.28 sec units. Set to zero to disable periodic scanning.
Returns
None.
void AppExtScanStop ( void  )

Stop scanning.

Returns
None.
appDevInfo_t* AppScanGetResult ( uint8_t  idx)

Get a stored scan result from the scan result list. The first result is at index zero.

Parameters
idxIndex of result in scan result list.
Returns
Pointer to scan result device info or NULL if index contains no result.
uint8_t AppScanGetNumResults ( void  )

Get the number of stored scan results.

Returns
Number of stored scan results.
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 advertising packets.

Parameters
advSidAdvertising SID.
advAddrTypeAdvertiser address type.
pAdvAddrAdvertiser address.
skipNumber of periodic advertising packets that can be skipped after successful receive.
syncTimeoutSynchronization timeout.
Returns
Sync identifier.
void AppSyncStop ( dmSyncId_t  syncId)

Stop reception of the periodic advertising identified by the given sync identifier.

Parameters
syncIdSync identifier.
Returns
None.
dmConnId_t AppConnOpen ( uint8_t  addrType,
uint8_t pAddr,
appDbHdl_t  dbHdl 
)

Open a connection to a peer device with the given address.

Parameters
addrTypeAddress type.
pAddrPeer device address.
dbHdlDevice database handle.
Returns
Connection identifier.
void AppConnClose ( dmConnId_t  connId)

Close a connection with the given connection identifier.

Parameters
connIdConnection identifier.
Returns
None.
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.

Parameters
initPhysInitiator PHYs.
addrTypeAddress type.
pAddrPeer device address.
dbHdlDevice database handle.
Returns
Connection identifier.
dmConnId_t AppConnIsOpen ( void  )

Check if a connection is open.

Returns
Connection ID of open connection or DM_CONN_ID_NONE if no open connections.
uint8_t AppConnOpenList ( dmConnId_t pConnIdList)

Gets a list of connection identifiers of open connections.

Parameters
pConnIdListBuffer to hold connection IDs (must be DM_CONN_MAX bytes).
Returns
Number of open connections.
void AppSetBondable ( bool_t  bondable)

Set the bondable mode of the device.

Parameters
bondableTRUE to set device to bondable, FALSE to set to non-bondable.
Returns
None.
void AppMasterSecurityReq ( dmConnId_t  connId)

Initiate security as a master device. If there is a stored encryption key for the peer device this function will initiate encryption, otherwise it will initiate pairing.

Parameters
connIdConnection identifier.
Returns
None.
void AppSlaveSecurityReq ( dmConnId_t  connId)

Initiate a request for security as a slave device. This function will send a message to the master peer device requesting security. The master device should either initiate encryption or pairing.

Parameters
connIdConnection identifier.
Returns
None.
void AppHandlePasskey ( dmSecAuthReqIndEvt_t pAuthReq)

Handle a passkey request during pairing. If the passkey is to be displayed, a random passkey is generated and displayed. If the passkey is to be entered the user is prompted to enter the passkey.

Parameters
pAuthReqDM authentication requested event structure.
Returns
None.
void AppHandleNumericComparison ( dmSecCnfIndEvt_t pCnfInd)

Handle a numeric comparison indication during pairing. The confirmation value is displayed and the user is prompted to verify that the local and peer confirmation values match.

Parameters
pCnfIndDM confirmation indication event structure.
Returns
None.
void AppSlaveProcDmMsg ( dmEvt_t pMsg)

Process connection-related DM messages for a slave. This function should be called from the application's event handler.

Parameters
pMsgPointer to DM callback event message.
Returns
None.
void AppSlaveSecProcDmMsg ( dmEvt_t pMsg)

Process security-related DM messages for a slave. This function should be called from the application's event handler.

Parameters
pMsgPointer to DM callback event message.
Returns
None.
void AppMasterProcDmMsg ( dmEvt_t pMsg)

Process connection-related DM messages for a master. This function should be called from the application's event handler.

Parameters
pMsgPointer to DM callback event message.
Returns
None.
void AppMasterSecProcDmMsg ( dmEvt_t pMsg)

Process security-related DM messages for a master. This function should be called from the application's event handler.

Parameters
pMsgPointer to DM callback event message.
Returns
None.
void AppServerConnCback ( dmEvt_t pDmEvt)

ATT connection callback for app framework. This function is used when the application is operating as an ATT server and it uses notifications or indications. This function can be called by the application's ATT connection callback or it can be installed as the ATT connection callback.

Parameters
pDmEvtDM callback event.
Returns
None.
void AppDiscInit ( void  )

Initialize app framework discovery.

Returns
None.
void AppDiscRegister ( appDiscCback_t  cback)

Register a callback function to service discovery status.

Parameters
cbackApplication service discovery callback function.
Returns
None.
void AppDiscSetHdlList ( dmConnId_t  connId,
uint8_t  hdlListLen,
uint16_t pHdlList 
)

Set the discovery cached handle list for a given connection.

Parameters
connIdConnection identifier.
hdlListLenLength of characteristic and handle lists.
pHdlListCharacteristic handle list.
Returns
None.
void AppDiscComplete ( dmConnId_t  connId,
uint8_t  status 
)

Service discovery or configuration procedure complete.

Parameters
connIdConnection identifier.
statusService or configuration status.
Returns
None.
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.

Parameters
connIdConnection identifier.
uuidLenLength of service UUID (2 or 16).
pUuidPointer to service UUID.
listLenLength of characteristic and handle lists.
pCharListCharacterisic list for discovery.
pHdlListCharacteristic handle list.
Returns
None.
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.

Parameters
connIdConnection identifier.
statusAPP_DISC_CFG_START or APP_DISC_CFG_CONN_START.
cfgListLenLength of characteristic configuration list.
pCfgListCharacteristic configuration list.
hdlListLenLength of characteristic handle list.
pHdlListCharacteristic handle list.
Returns
None.
void AppDiscServiceChanged ( attEvt_t pMsg)

Perform the GATT service changed procedure. This function is called when an indication is received containing the GATT service changed characteristic. This function may initialize the discovery state and initiate service discovery and configuration.

Parameters
pMsgPointer to ATT callback event message containing received indication.
Returns
None.
void AppDiscProcDmMsg ( dmEvt_t pMsg)

Process discovery-related DM messages. This function should be called from the application's event handler.

Parameters
pMsgPointer to DM callback event message.
Returns
None.
void AppDiscProcAttMsg ( attEvt_t pMsg)

Process discovery-related ATT messages. This function should be called from the application's event handler.

Parameters
pMsgPointer to ATT callback event message.
Returns
None.
void AppAddDevToResList ( dmEvt_t pMsg,
dmConnId_t  connId 
)

Add device to resolving list.

Parameters
pMsgPointer to DM callback event message.
connIdConnection identifier.
Returns
None.
void AppUpdatePrivacyMode ( appDbHdl_t  hdl)

Update privacy mode for a given peer device.

Parameters
hdlDatabase record handle.
Returns
None.