38 #define INVALID_CONNHANDLE 0xFFFF // Invalid connection handle, used for no connection handle 39 #define LOOPBACK_CONNHANDLE 0xFFFE // Loopback connection handle, used to loopback a message 42 #define LINK_NOT_CONNECTED 0x00 // Link isn't connected 43 #define LINK_CONNECTED 0x01 // Link is connected 44 #define LINK_AUTHENTICATED 0x02 // Link is authenticated 45 #define LINK_BOUND 0x04 // Link is bonded 46 #define LINK_ENCRYPTED 0x10 // Link is encrypted 47 #define LINK_SECURE_CONNECTIONS 0x20 // Link uses Secure Connections 48 #define LINK_IN_UPDATE 0x40 // Link is in update procedure 51 #define LINKDB_STATUS_UPDATE_NEW 0 // New connection created 52 #define LINKDB_STATUS_UPDATE_REMOVED 1 // Connection was removed 53 #define LINKDB_STATUS_UPDATE_STATEFLAGS 2 // Connection state flag changed 56 #define LINKDB_ERR_INSUFFICIENT_AUTHEN 0x05 // Link isn't even encrypted 57 #define LINBDB_ERR_INSUFFICIENT_KEYSIZE 0x0c // Link is encrypted but the key size is too small 58 #define LINKDB_ERR_INSUFFICIENT_ENCRYPTION 0x0f // Link is encrypted but it's not authenticated 81 uint16 connectionHandle;
105 typedef void (*pfnLinkDBCB_t)( uint16 connectionHandle, uint8 changeType );
108 typedef void (*pfnPerformFuncCB_t)(
linkDBItem_t *pLinkItem );
114 extern uint8 linkDBNumConns;
122 extern void linkDB_Init(
void );
128 extern uint8 linkDB_Register( pfnLinkDBCB_t pFunc );
133 extern uint8 linkDB_Add( uint8 taskID, uint16 connectionHandle,
134 uint8 stateFlags, uint8 addrType, uint8 *pAddr,
135 uint8 *pAddrPriv, uint8 connRole, uint16 connInterval,
141 extern uint8 linkDB_Remove( uint16 connectionHandle );
147 extern uint8 linkDB_Update( uint16 connectionHandle, uint8 newState,
153 extern uint8 linkDB_NumActive(
void );
158 extern uint8 linkDB_NumConns(
void );
164 extern uint8 linkDB_UpdateMTU( uint16 connectionHandle, uint16 newMtu );
170 extern uint16 linkDB_MTU( uint16 connectionHandle );
176 extern uint8 linkDB_GetInfo( uint16 connectionHandle,
linkDBInfo_t * pInfo );
183 extern linkDBItem_t *linkDB_Find( uint16 connectionHandle );
197 extern uint8 linkDB_State( uint16 connectionHandle, uint8 state );
207 extern uint8 linkDB_Authen( uint16 connectionHandle, uint8 keySize,
208 uint8 mitmRequired );
215 extern uint8 linkDB_Role( uint16 connectionHandle );
220 extern void linkDB_PerformFunc( pfnPerformFuncCB_t cb );
227 extern void linkDB_SecurityModeSCOnly( uint8 state );
241 #define linkDB_Up( connectionHandle ) linkDB_State( (connectionHandle), LINK_CONNECTED ) 249 #define linkDB_Encrypted( connectionHandle ) linkDB_State( (connectionHandle), LINK_ENCRYPTED ) 257 #define linkDB_Authenticated( connectionHandle ) linkDB_State( (connectionHandle), LINK_AUTHENTICATED ) 265 #define linkDB_Bonded( connectionHandle ) linkDB_State( (connectionHandle), LINK_BOUND )
#define B_ADDR_LEN
Default Public and Random Address Length.
Definition: bcomdef.h:114
#define KEYLEN
Default key length.
Definition: bcomdef.h:117
#define B_RANDOM_NUM_SIZE
BLE Random Number Size.
Definition: bcomdef.h:132