![]() |
Cordio Stack and Cordio Profiles
r2p3-02rel0
|
Content | |
Application Framework Main API | |
Macros | |
#define | APP_DB_HDL_NONE NULL |
No device database record handle. | |
Typedefs | |
typedef void * | appDbHdl_t |
Device database record handle type. | |
App Configuration | |
#define | APP_DB_NUM_RECS 3 |
Number of application database device records. | |
#define | APP_DB_NUM_CCCD 10 |
Number of client characteristic configuration descriptor handles per record. | |
#define | APP_DB_HDL_LIST_LEN 20 |
Number of ATT client cached handles per record. | |
App Database | |
void | AppDbInit (void) |
Initialize the device database. More... | |
appDbHdl_t | AppDbNewRecord (uint8_t addrType, uint8_t *pAddr) |
Create a new device database record. More... | |
appDbHdl_t | AppDbGetNextRecord (appDbHdl_t hdl) |
Get next device database record for a given database record. For the first database record, the function should be called with 'hdl' set to 'APP_DB_HDL_NONE'. More... | |
void | AppDbDeleteRecord (appDbHdl_t hdl) |
Delete a new device database record. More... | |
void | AppDbValidateRecord (appDbHdl_t hdl, uint8_t keyMask) |
Validate a new device database record. This function is called when pairing is successful and the devices are bonded. More... | |
void | AppDbCheckValidRecord (appDbHdl_t hdl) |
Check if a record has been validated. If it has not, delete it. This function is typically called when the connection is closed. More... | |
bool_t | AppDbRecordInUse (appDbHdl_t hdl) |
Check if a database record is in use. More... | |
bool_t | AppDbCheckBonded (void) |
Check if there is a stored bond with any device. More... | |
void | AppDbDeleteAllRecords (void) |
Delete all database records. More... | |
appDbHdl_t | AppDbFindByAddr (uint8_t addrType, uint8_t *pAddr) |
Find a device database record by peer address. More... | |
appDbHdl_t | AppDbFindByLtkReq (uint16_t encDiversifier, uint8_t *pRandNum) |
Find a device database record from data in an LTK request. More... | |
appDbHdl_t | AppDbGetHdl (dmConnId_t connId) |
Get the device database record handle associated with an open connection. More... | |
dmSecKey_t * | AppDbGetKey (appDbHdl_t hdl, uint8_t type, uint8_t *pSecLevel) |
Get a key from a device database record. More... | |
void | AppDbSetKey (appDbHdl_t hdl, dmSecKeyIndEvt_t *pKey) |
Set a key in a device database record. More... | |
uint16_t * | AppDbGetCccTbl (appDbHdl_t hdl) |
Get the client characteristic configuration descriptor table. More... | |
void | AppDbSetCccTblValue (appDbHdl_t hdl, uint16_t idx, uint16_t value) |
Set a value in the client characteristic configuration table. More... | |
uint8_t | AppDbGetDiscStatus (appDbHdl_t hdl) |
Get the discovery status. More... | |
void | AppDbSetDiscStatus (appDbHdl_t hdl, uint8_t status) |
Set the discovery status. More... | |
uint16_t * | AppDbGetHdlList (appDbHdl_t hdl) |
Get the cached handle list. More... | |
void | AppDbSetHdlList (appDbHdl_t hdl, uint16_t *pHdlList) |
Set the cached handle list. More... | |
char * | AppDbGetDevName (uint8_t *pLen) |
Get the device name. More... | |
void | AppDbSetDevName (uint8_t len, char *pStr) |
Set the device name. More... | |
bool_t | AppDbGetPeerAddrRes (appDbHdl_t hdl) |
Get address resolution attribute value read from a peer device. More... | |
void | AppDbSetPeerAddrRes (appDbHdl_t hdl, uint8_t addrRes) |
Set address resolution attribute value for a peer device. More... | |
uint32_t | AppDbGetPeerSignCounter (appDbHdl_t hdl) |
Get sign counter for a peer device. More... | |
void | AppDbSetPeerSignCounter (appDbHdl_t hdl, uint32_t signCounter) |
Set sign counter for a peer device. More... | |
bool_t | AppDbGetPeerAddedToRl (appDbHdl_t hdl) |
Get the peer device added to resolving list flag value. More... | |
void | AppDbSetPeerAddedToRl (appDbHdl_t hdl, bool_t peerAddedToRl) |
Set the peer device added to resolving list flag to a given value. More... | |
bool_t | AppDbGetPeerRpao (appDbHdl_t hdl) |
Get resolvable private address only attribute present flag for a peer device. More... | |
void | AppDbSetPeerRpao (appDbHdl_t hdl, bool_t peerRpao) |
Set resolvable private address only attribute present flag for a peer device. More... | |
void AppDbInit | ( | void | ) |
Initialize the device database.
appDbHdl_t AppDbNewRecord | ( | uint8_t | addrType, |
uint8_t * | pAddr | ||
) |
Create a new device database record.
addrType | Address type. |
pAddr | Peer device address. |
appDbHdl_t AppDbGetNextRecord | ( | appDbHdl_t | hdl | ) |
Get next device database record for a given database record. For the first database record, the function should be called with 'hdl' set to 'APP_DB_HDL_NONE'.
hdl | Database record handle. |
void AppDbDeleteRecord | ( | appDbHdl_t | hdl | ) |
Delete a new device database record.
hdl | Database record handle. |
void AppDbValidateRecord | ( | appDbHdl_t | hdl, |
uint8_t | keyMask | ||
) |
Validate a new device database record. This function is called when pairing is successful and the devices are bonded.
hdl | Database record handle. |
keyMask | Bitmask of keys to validate. |
void AppDbCheckValidRecord | ( | appDbHdl_t | hdl | ) |
Check if a record has been validated. If it has not, delete it. This function is typically called when the connection is closed.
hdl | Database record handle. |
bool_t AppDbRecordInUse | ( | appDbHdl_t | hdl | ) |
Check if a database record is in use.
hdl | Database record handle. |
bool_t AppDbCheckBonded | ( | void | ) |
Check if there is a stored bond with any device.
void AppDbDeleteAllRecords | ( | void | ) |
Delete all database records.
appDbHdl_t AppDbFindByAddr | ( | uint8_t | addrType, |
uint8_t * | pAddr | ||
) |
Find a device database record by peer address.
addrType | Address type. |
pAddr | Peer device address. |
appDbHdl_t AppDbFindByLtkReq | ( | uint16_t | encDiversifier, |
uint8_t * | pRandNum | ||
) |
Find a device database record from data in an LTK request.
encDiversifier | Encryption diversifier associated with key. |
pRandNum | Pointer to random number associated with key. |
appDbHdl_t AppDbGetHdl | ( | dmConnId_t | connId | ) |
Get the device database record handle associated with an open connection.
connId | Connection identifier. |
dmSecKey_t* AppDbGetKey | ( | appDbHdl_t | hdl, |
uint8_t | type, | ||
uint8_t * | pSecLevel | ||
) |
Get a key from a device database record.
hdl | Database record handle. |
type | Type of key to get. |
pSecLevel | If the key is valid, returns the security level of the key. |
void AppDbSetKey | ( | appDbHdl_t | hdl, |
dmSecKeyIndEvt_t * | pKey | ||
) |
Set a key in a device database record.
hdl | Database record handle. |
pKey | Key data. |
uint16_t* AppDbGetCccTbl | ( | appDbHdl_t | hdl | ) |
Get the client characteristic configuration descriptor table.
hdl | Database record handle. |
void AppDbSetCccTblValue | ( | appDbHdl_t | hdl, |
uint16_t | idx, | ||
uint16_t | value | ||
) |
Set a value in the client characteristic configuration table.
hdl | Database record handle. |
idx | Table index. |
value | Client characteristic configuration value. |
uint8_t AppDbGetDiscStatus | ( | appDbHdl_t | hdl | ) |
Get the discovery status.
hdl | Database record handle. |
void AppDbSetDiscStatus | ( | appDbHdl_t | hdl, |
uint8_t | status | ||
) |
Set the discovery status.
hdl | Database record handle. |
status | Discovery status. |
uint16_t* AppDbGetHdlList | ( | appDbHdl_t | hdl | ) |
Get the cached handle list.
hdl | Database record handle. |
void AppDbSetHdlList | ( | appDbHdl_t | hdl, |
uint16_t * | pHdlList | ||
) |
Set the cached handle list.
hdl | Database record handle. |
pHdlList | Pointer to handle list. |
char* AppDbGetDevName | ( | uint8_t * | pLen | ) |
Get the device name.
pLen | Returned device name length. |
void AppDbSetDevName | ( | uint8_t | len, |
char * | pStr | ||
) |
Set the device name.
len | Device name length. |
pStr | UTF-8 string containing the device name. |
bool_t AppDbGetPeerAddrRes | ( | appDbHdl_t | hdl | ) |
Get address resolution attribute value read from a peer device.
hdl | Database record handle. |
void AppDbSetPeerAddrRes | ( | appDbHdl_t | hdl, |
uint8_t | addrRes | ||
) |
Set address resolution attribute value for a peer device.
hdl | Database record handle. |
addrRes | Peer address resolution attribue value. |
uint32_t AppDbGetPeerSignCounter | ( | appDbHdl_t | hdl | ) |
Get sign counter for a peer device.
hdl | Database record handle. |
void AppDbSetPeerSignCounter | ( | appDbHdl_t | hdl, |
uint32_t | signCounter | ||
) |
Set sign counter for a peer device.
hdl | Database record handle. |
signCounter | Sign counter for peer device. |
bool_t AppDbGetPeerAddedToRl | ( | appDbHdl_t | hdl | ) |
Get the peer device added to resolving list flag value.
hdl | Database record handle. |
void AppDbSetPeerAddedToRl | ( | appDbHdl_t | hdl, |
bool_t | peerAddedToRl | ||
) |
Set the peer device added to resolving list flag to a given value.
hdl | Database record handle. |
peerAddedToRl | Peer device added to resolving list flag value. |
bool_t AppDbGetPeerRpao | ( | appDbHdl_t | hdl | ) |
Get resolvable private address only attribute present flag for a peer device.
hdl | Database record handle. |
void AppDbSetPeerRpao | ( | appDbHdl_t | hdl, |
bool_t | peerRpao | ||
) |
Set resolvable private address only attribute present flag for a peer device.
hdl | Database record handle. |
peerRpao | Resolvable private address only attribute present flag. |