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 61 // Link Database Status callback changeTypes 62 #define LINKDB_STATUS_UPDATE_NEW 0 63 #define LINKDB_STATUS_UPDATE_REMOVED 1 64 #define LINKDB_STATUS_UPDATE_STATEFLAGS 2 67 #define LINKDB_ERR_INSUFFICIENT_AUTHEN 0x05 68 #define LINBDB_ERR_INSUFFICIENT_KEYSIZE 0x0c 69 #define LINKDB_ERR_INSUFFICIENT_ENCRYPTION 0x0f 135 typedef void (*
pfnLinkDBCB_t)( uint16 connectionHandle, uint8 changeType );
148 extern uint8 linkDBNumConns;
194 extern uint8
linkDB_Add( uint8 taskID, uint16 connectionHandle,
195 uint8 stateFlags, uint8 addrType, uint8 *pAddr,
196 uint8 *pAddrPriv, uint8 connRole, uint16 connInterval,
222 extern uint8
linkDB_Update( uint16 connectionHandle, uint8 newState,
260 extern uint16
linkDB_MTU( uint16 connectionHandle );
307 extern uint8
linkDB_State( uint16 connectionHandle, uint8 state );
322 extern uint8
linkDB_Authen( uint16 connectionHandle, uint8 keySize,
323 uint8 mitmRequired );
333 extern uint8
linkDB_Role( uint16 connectionHandle );
364 #define linkDB_Up( connectionHandle ) linkDB_State( (connectionHandle), LINK_CONNECTED ) 374 #define linkDB_Encrypted( connectionHandle ) linkDB_State( (connectionHandle), LINK_ENCRYPTED ) 384 #define linkDB_Authenticated( connectionHandle ) linkDB_State( (connectionHandle), LINK_AUTHENTICATED ) 394 #define linkDB_Bonded( connectionHandle ) linkDB_State( (connectionHandle), LINK_BOUND ) uint8 connRole
Connection formed as Master or Slave.
Definition: linkdb.h:110
uint16 connInterval
The connection's interval (n * 1.23 ms)
Definition: linkdb.h:111
#define B_RANDOM_NUM_SIZE
BLE Random Number Size.
Definition: bcomdef.h:130
uint32 signCounter
Sign Counter.
Definition: linkdb.h:85
encParams_t * pEncParams
pointer to LTK, ediv, rand. if needed.
Definition: linkdb.h:114
uint8 addrType
Address type of connected device.
Definition: linkdb.h:123
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:82
Encryption Params.
Definition: linkdb.h:91
void(* pfnLinkDBCB_t)(uint16 connectionHandle, uint8 changeType)
function pointer used to register for a status callback
Definition: linkdb.h:136
void(* pfnPerformFuncCB_t)(linkDBItem_t *pLinkItem)
function pointer used to perform specialized link database searches
Definition: linkdb.h:139
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:127
uint8 stateFlags
LINK_CONNECTED, LINK_AUTHENTICATED...
Definition: linkdb.h:106
uint8 linkDB_NumActive(void)
Return the number of active connections.
uint8 stateFlags
LINK_CONNECTED, LINK_AUTHENTICATED...
Definition: linkdb.h:122
uint16 connectionHandle
Controller connection handle.
Definition: linkdb.h:105
uint8 taskID
Application that controls the link.
Definition: linkdb.h:104
linkDB item
Definition: linkdb.h:102
NODOC void linkDB_Init(void)
Initialize the Link Database.
uint16 MTU
The connection's MTU size.
Definition: linkdb.h:128
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:112
uint16 div
Diversifier.
Definition: linkdb.h:94
uint8 linkDB_GetInfo(uint16 connectionHandle, linkDBInfo_t *pInfo)
Get information about a link.
uint8 addrType
Address type of connected device.
Definition: linkdb.h:107
linkSec_t sec
Connection Security related items.
Definition: linkdb.h:113
linkDB info
Definition: linkdb.h:120
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:126
uint8 linkDB_NumConns(void)
return the maximum number of connections supported.
uint8 keySize
LTK Key Size.
Definition: linkdb.h:96
uint8 linkDB_Role(uint16 connectionHandle)
Get the role of a physical link.