45 #define INVALID_CONNHANDLE 0xFFFF 46 #define LOOPBACK_CONNHANDLE 0xFFFE 52 #define LINK_NOT_CONNECTED 0x00 53 #define LINK_CONNECTED 0x01 54 #define LINK_AUTHENTICATED 0x02 55 #define LINK_BOUND 0x04 56 #define LINK_ENCRYPTED 0x10 57 #define LINK_SECURE_CONNECTIONS 0x20 58 #define LINK_IN_UPDATE 0x40 59 #define LINK_PAIR_TIMEOUT 0x80 62 // Link Database Status callback changeTypes 63 #define LINKDB_STATUS_UPDATE_NEW 0 64 #define LINKDB_STATUS_UPDATE_REMOVED 1 65 #define LINKDB_STATUS_UPDATE_STATEFLAGS 2 68 #define LINKDB_ERR_INSUFFICIENT_AUTHEN 0x05 69 #define LINBDB_ERR_INSUFFICIENT_KEYSIZE 0x0c 70 #define LINKDB_ERR_INSUFFICIENT_ENCRYPTION 0x0f 73 // Secure Connection Only Mode Encryption Key Size 74 #define SCOM_ENCRYPT_KEY_SIZE 16 139 typedef void (*
pfnLinkDBCB_t)( uint16 connectionHandle, uint8 changeType );
152 extern uint8 linkDBNumConns;
198 extern uint8
linkDB_Add( uint8 taskID, uint16 connectionHandle,
199 uint8 stateFlags, uint8 addrType, uint8 *pAddr,
200 uint8 *pAddrPriv, uint8 connRole, uint16 connInterval,
226 extern uint8
linkDB_Update( uint16 connectionHandle, uint8 newState,
264 extern uint16
linkDB_MTU( uint16 connectionHandle );
311 extern uint8
linkDB_State( uint16 connectionHandle, uint8 state );
326 extern uint8
linkDB_Authen( uint16 connectionHandle, uint8 keySize,
327 uint8 mitmRequired );
337 extern uint8
linkDB_Role( uint16 connectionHandle );
368 #define linkDB_Up( connectionHandle ) linkDB_State( (connectionHandle), LINK_CONNECTED ) 378 #define linkDB_Encrypted( connectionHandle ) linkDB_State( (connectionHandle), LINK_ENCRYPTED ) 388 #define linkDB_Authenticated( connectionHandle ) linkDB_State( (connectionHandle), LINK_AUTHENTICATED ) 398 #define linkDB_Bonded( connectionHandle ) linkDB_State( (connectionHandle), LINK_BOUND ) uint8 connRole
Connection formed as Master or Slave.
Definition: linkdb.h:114
uint16 connInterval
The connection's interval (n * 1.23 ms)
Definition: linkdb.h:115
#define B_RANDOM_NUM_SIZE
BLE Random Number Size.
Definition: bcomdef.h:130
uint32 signCounter
Sign Counter.
Definition: linkdb.h:89
encParams_t * pEncParams
pointer to LTK, ediv, rand. if needed.
Definition: linkdb.h:118
uint8 addrType
Address type of connected device.
Definition: linkdb.h:127
uint16 linkDB_MTU(uint16 connectionHandle)
This function is used to get the MTU size of a link.
void linkDB_SecurityModeSCOnly(uint8 state)
Set a device into Secure Connection Only Mode.
uint8 linkDB_Update(uint16 connectionHandle, uint8 newState, uint8 add)
Update the stateFlags of a link record.
uint8 linkDB_Add(uint8 taskID, uint16 connectionHandle, uint8 stateFlags, uint8 addrType, uint8 *pAddr, uint8 *pAddrPriv, uint8 connRole, uint16 connInterval, uint16 MTU)
Adds a record to the link database.
linkDBItem_t * linkDB_FindFirst(uint8 taskID)
Find the first link that matches the taskID.
uint8 linkDB_Authen(uint16 connectionHandle, uint8 keySize, uint8 mitmRequired)
Check to see if the physical link is encrypted and authenticated.
uint8 linkDB_Remove(uint16 connectionHandle)
Remove a record from the link database.
uint8 linkDB_Register(pfnLinkDBCB_t pFunc)
Register with linkDB.
SRK and Sign Counter.
Definition: linkdb.h:86
Encryption Params.
Definition: linkdb.h:95
void(* pfnLinkDBCB_t)(uint16 connectionHandle, uint8 changeType)
function pointer used to register for a status callback
Definition: linkdb.h:140
void(* pfnPerformFuncCB_t)(linkDBItem_t *pLinkItem)
function pointer used to perform specialized link database searches
Definition: linkdb.h:143
void linkDB_PerformFunc(pfnPerformFuncCB_t cb)
Perform a function of each connection in the link database.
uint16 connInterval
The connection's interval (n * 1.23 ms)
Definition: linkdb.h:131
uint8 stateFlags
LINK_CONNECTED, LINK_AUTHENTICATED...
Definition: linkdb.h:110
uint8 linkDB_NumActive(void)
Return the number of active connections.
uint8 stateFlags
LINK_CONNECTED, LINK_AUTHENTICATED...
Definition: linkdb.h:126
uint16 connectionHandle
Controller connection handle.
Definition: linkdb.h:109
uint8 taskID
Application that controls the link.
Definition: linkdb.h:108
linkDB item
Definition: linkdb.h:106
NODOC void linkDB_Init(void)
Initialize the Link Database.
uint16 MTU
The connection's MTU size.
Definition: linkdb.h:132
linkDBItem_t * linkDB_Find(uint16 connectionHandle)
Find the link.
uint8 linkDB_State(uint16 connectionHandle, uint8 state)
Check to see if a physical link is in a specific state.
#define B_ADDR_LEN
Default Public and Random Address Length.
Definition: bcomdef.h:112
uint16 MTU
The connection's MTU size.
Definition: linkdb.h:116
uint16 div
Diversifier.
Definition: linkdb.h:98
uint8 linkDB_GetInfo(uint16 connectionHandle, linkDBInfo_t *pInfo)
Get information about a link.
uint8 addrType
Address type of connected device.
Definition: linkdb.h:111
linkSec_t sec
Connection Security related items.
Definition: linkdb.h:117
linkDB info
Definition: linkdb.h:124
uint8 linkDB_UpdateMTU(uint16 connectionHandle, uint16 newMtu)
update the MTU size of a link or record.
#define KEYLEN
Default key length.
Definition: bcomdef.h:115
uint8 connRole
Connection formed as Master or Slave.
Definition: linkdb.h:130
uint8 linkDB_NumConns(void)
return the maximum number of connections supported.
uint8 keySize
LTK Key Size.
Definition: linkdb.h:100
uint8 linkDB_Role(uint16 connectionHandle)
Get the role of a physical link.