TI BLE-Stack for Bluetooth 4.2 API Documentation  3.01.00.07
Modules | Files | Macros | Functions
LinkDB

This module implements the Link Database Module. More...

Modules

 
 
 

Files

file  linkdb.h
 LinkDB layer interface.
 

Macros

#define linkDB_Authenticated(connectionHandle)   linkDB_State( (connectionHandle), LINK_AUTHENTICATED )
 Check to see if the physical link is authenticated. More...
 
#define linkDB_Bonded(connectionHandle)   linkDB_State( (connectionHandle), LINK_BOUND )
 Check to see if the physical link is bonded. More...
 
#define linkDB_Encrypted(connectionHandle)   linkDB_State( (connectionHandle), LINK_ENCRYPTED )
 Check to see if the physical link is encrypted. More...
 
#define linkDB_Up(connectionHandle)   linkDB_State( (connectionHandle), LINK_CONNECTED )
 Check to see if a physical link is up (connected). More...
 

Functions

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. More...
 
uint8 linkDB_Authen (uint16 connectionHandle, uint8 keySize, uint8 mitmRequired)
 Check to see if the physical link is encrypted and authenticated. More...
 
linkDBItem_tlinkDB_Find (uint16 connectionHandle)
 Find the link. More...
 
linkDBItem_tlinkDB_FindFirst (uint8 taskID)
 Find the first link that matches the taskID. More...
 
uint8 linkDB_GetInfo (uint16 connectionHandle, linkDBInfo_t *pInfo)
 Get information about a link. More...
 
NODOC void linkDB_Init (void)
 Initialize the Link Database.
 
uint16 linkDB_MTU (uint16 connectionHandle)
 This function is used to get the MTU size of a link. More...
 
uint8 linkDB_NumActive (void)
 Return the number of active connections. More...
 
uint8 linkDB_NumConns (void)
 return the maximum number of connections supported. More...
 
void linkDB_PerformFunc (pfnPerformFuncCB_t cb)
 Perform a function of each connection in the link database. More...
 
uint8 linkDB_Register (pfnLinkDBCB_t pFunc)
 Register with linkDB. More...
 
uint8 linkDB_Remove (uint16 connectionHandle)
 Remove a record from the link database. More...
 
uint8 linkDB_Role (uint16 connectionHandle)
 Get the role of a physical link. More...
 
void linkDB_SecurityModeSCOnly (uint8 state)
 Set a device into Secure Connection Only Mode. More...
 
uint8 linkDB_State (uint16 connectionHandle, uint8 state)
 Check to see if a physical link is in a specific state. More...
 
uint8 linkDB_Update (uint16 connectionHandle, uint8 newState, uint8 add)
 Update the stateFlags of a link record. More...
 
uint8 linkDB_UpdateMTU (uint16 connectionHandle, uint16 newMtu)
 update the MTU size of a link or record. More...
 

Detailed Description

This module implements the Link Database Module.

Macro Definition Documentation

§ linkDB_Authenticated

#define linkDB_Authenticated (   connectionHandle)    linkDB_State( (connectionHandle), LINK_AUTHENTICATED )

Check to see if the physical link is authenticated.

Parameters
connectionHandle- controller link connection handle.
Returns
TRUE if the link is authenticated
FALSE, otherwise.

§ linkDB_Bonded

#define linkDB_Bonded (   connectionHandle)    linkDB_State( (connectionHandle), LINK_BOUND )

Check to see if the physical link is bonded.

Parameters
connectionHandle- controller link connection handle.
Returns
TRUE if the link is bonded
FALSE, otherwise.

§ linkDB_Encrypted

#define linkDB_Encrypted (   connectionHandle)    linkDB_State( (connectionHandle), LINK_ENCRYPTED )

Check to see if the physical link is encrypted.

Parameters
connectionHandle- controller link connection handle.
Returns
TRUE if the link is encrypted
FALSE, otherwise.

§ linkDB_Up

#define linkDB_Up (   connectionHandle)    linkDB_State( (connectionHandle), LINK_CONNECTED )

Check to see if a physical link is up (connected).

Parameters
connectionHandle- controller link connection handle.
Returns
TRUE if the link is up
FALSE, otherwise.

Function Documentation

§ linkDB_Add()

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.

Parameters
taskID- Application task ID
connectionHandle- new record connection handle
stateFlags- LinkDB Connection State Flags
addrType- Device Address Type
pAddr- new address
pAddrPriv- private address (only if addrType is 0x02 or 0x03)
connRole- GAP Profile Roles
connInterval- connection's communications interval (n * 1.23 ms)
MTU- connection's MTU size
Returns
SUCCESS if successful
bleIncorrectMode - hasn't been initialized.
bleNoResources - table full
bleAlreadyInRequestedMode - already exist connectionHandle

§ linkDB_Authen()

uint8 linkDB_Authen ( uint16  connectionHandle,
uint8  keySize,
uint8  mitmRequired 
)

Check to see if the physical link is encrypted and authenticated.

Parameters
connectionHandle- controller link connection handle.
keySize- size of encryption keys.
mitmRequired- TRUE (yes) or FALSE (no).
Returns
SUCCESS if the link is authenticated
bleNotConnected - connection handle is invalid
LINKDB_ERR_INSUFFICIENT_AUTHEN - link is not encrypted
LINBDB_ERR_INSUFFICIENT_KEYSIZE - key size encrypted is not large enough
LINKDB_ERR_INSUFFICIENT_ENCRYPTION - link is encrypted, but not authenticated

§ linkDB_Find()

linkDBItem_t* linkDB_Find ( uint16  connectionHandle)

Find the link.

Uses the connection handle to search the link database.

Parameters
connectionHandle- controller link connection handle.
Returns
a pointer to the found link item
NULL if not found

§ linkDB_FindFirst()

linkDBItem_t* linkDB_FindFirst ( uint8  taskID)

Find the first link that matches the taskID.

Parameters
taskID- taskID of app
Returns
a pointer to the found link item
NULL if not found

§ linkDB_GetInfo()

uint8 linkDB_GetInfo ( uint16  connectionHandle,
linkDBInfo_t pInfo 
)

Get information about a link.

Copies relevant link info into pInfo. Uses the connection handle to search the link database.

Parameters
connectionHandle- controller link connection handle.
pInfo- address of link info item to copy information
Returns
SUCCESS if connection found else FAILURE

§ linkDB_MTU()

uint16 linkDB_MTU ( uint16  connectionHandle)

This function is used to get the MTU size of a link.

Parameters
connectionHandle- controller link connection handle.
Returns
link MTU size

§ linkDB_NumActive()

uint8 linkDB_NumActive ( void  )

Return the number of active connections.

Returns
the number of active connections

§ linkDB_NumConns()

uint8 linkDB_NumConns ( void  )

return the maximum number of connections supported.

Returns
the number of connections supported

§ linkDB_PerformFunc()

void linkDB_PerformFunc ( pfnPerformFuncCB_t  cb)

Perform a function of each connection in the link database.

Parameters
cb- connection callback function.

§ linkDB_Register()

uint8 linkDB_Register ( pfnLinkDBCB_t  pFunc)

Register with linkDB.

Register with this function to receive a callback when status changes on a connection. If the stateflag == 0, then the connection has been disconnected.

Parameters
pFunc- function pointer to callback function
Returns
SUCCESS if successful
bleMemAllocError if no table space available

§ linkDB_Remove()

uint8 linkDB_Remove ( uint16  connectionHandle)

Remove a record from the link database.

Parameters
connectionHandle- new record connection handle
Returns
SUCCESS if successful
INVALIDPARAMETER - connectionHandle not found.

§ linkDB_Role()

uint8 linkDB_Role ( uint16  connectionHandle)

Get the role of a physical link.

Parameters
connectionHandle- controller link connection handle.
Returns
GAP Profile Roles
0 - unknown

§ linkDB_SecurityModeSCOnly()

void linkDB_SecurityModeSCOnly ( uint8  state)

Set a device into Secure Connection Only Mode.

Parameters
state- TRUE for Secure Connections Only Mode.
FALSE to disable Secure Connections Only Mode.

§ linkDB_State()

uint8 linkDB_State ( uint16  connectionHandle,
uint8  state 
)

Check to see if a physical link is in a specific state.

Parameters
connectionHandle- controller link connection handle.
state- LinkDB Connection State Flags state to look for.
Returns
TRUE if the link is found and state is set in state flags.
FALSE, otherwise.

§ linkDB_Update()

uint8 linkDB_Update ( uint16  connectionHandle,
uint8  newState,
uint8  add 
)

Update the stateFlags of a link record.

Parameters
connectionHandle- maximum number of connections.
newState- LinkDB Connection State Flags. This value is OR'd in to this field.
add- TRUE to set state into flags, FALSE to remove.
Returns
SUCCESS if successful
bleNoResources - connectionHandle not found.

§ linkDB_UpdateMTU()

uint8 linkDB_UpdateMTU ( uint16  connectionHandle,
uint16  newMtu 
)

update the MTU size of a link or record.

Parameters
connectionHandle- controller link connection handle.
newMtu- new MTU size.
Returns
SUCCESS or failure
Copyright 2017, Texas Instruments Incorporated