TI BLE5-Stack API Documentation  2.02.06.00
linkdb.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Group: WCS, BTS
4  $Target Device: DEVICES $
5 
6  ******************************************************************************
7  $License: TI_TEXT 2009 $
8  ******************************************************************************
9  $Release Name: PACKAGE NAME $
10  $Release Date: PACKAGE RELEASE DATE $
11  *****************************************************************************/
12 
21 #ifndef LINKDB_H
22 #define LINKDB_H
23 
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28 
29 /*********************************************************************
30  * INCLUDES
31  */
32 
33 #include "ll_common.h"
34 
35 /*********************************************************************
36  * MACROS
37  */
38 
47 #define linkDB_Up( connectionHandle ) ( LL_ConnActive( connectionHandle ) == LL_STATUS_SUCCESS ? TRUE : FALSE )
48 
57 #define linkDB_Encrypted( connectionHandle ) linkDB_State( (connectionHandle), LINK_ENCRYPTED )
58 
67 #define linkDB_Authenticated( connectionHandle ) linkDB_State( (connectionHandle), LINK_AUTHENTICATED )
68 
77 #define linkDB_Bonded( connectionHandle ) linkDB_State( (connectionHandle), LINK_BOUND )
78 
79 /*********************************************************************
80  * CONSTANTS
81  */
82 
94 #define LINKDB_CONNHANDLE_ALL LL_CONNHANDLE_ALL
96 #define LINKDB_CONNHANDLE_LOOPBACK LL_CONNHANDLE_LOOPBACK
98 #define LINKDB_CONNHANDLE_INVALID LL_CONNHANDLE_INVALID
100 
106 #define LINK_NOT_CONNECTED 0x00
107 #define LINK_CONNECTED 0x01
108 #define LINK_AUTHENTICATED 0x02
109 #define LINK_BOUND 0x04
110 #define LINK_ENCRYPTED 0x10
111 #define LINK_SECURE_CONNECTIONS 0x20
112 #define LINK_IN_UPDATE 0x40
113 #define LINK_PAIR_TIMEOUT 0x80
114 
120 #define LINKDB_ERR_INSUFFICIENT_AUTHEN 0x05
121 #define LINBDB_ERR_INSUFFICIENT_KEYSIZE 0x0c
122 #define LINKDB_ERR_INSUFFICIENT_ENCRYPTION 0x0f
123 
128 /*********************************************************************
129  * STRUCTURES
130  */
131 
139 typedef struct
141 {
142  uint8 stateFlags;
143  uint8 addrType;
144  uint8 addr[B_ADDR_LEN];
145  uint8 addrPriv[B_ADDR_LEN];
146  uint8 connRole;
147  uint16 connInterval;
148  uint16 MTU;
149  uint16 connTimeout;
150  uint16 connLatency;
151 } linkDBInfo_t;
152 
155 /*********************************************************************
156  * PUBLIC FUNCTIONS
157  */
158 
164 extern uint8 linkDB_NumActive( void );
165 
171 extern uint8 linkDB_NumConns( void );
172 
185  extern uint8 linkDB_GetInfo( uint16 connectionHandle, linkDBInfo_t *pInfo );
186 
196  extern uint8 linkDB_State( uint16 connectionHandle, uint8 state );
197 
198 /*********************************************************************
199 *********************************************************************/
200 
201 #ifdef __cplusplus
202 }
203 #endif
204 
205 #endif /* LINKDB_H */
206 
#define B_ADDR_LEN
Default Public and Random Address Length.
Definition: bcomdef.h:108
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale