TI BLE5-Stack API Documentation  9.11.01
gatt.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 
20 #ifndef GATT_H
21 #define GATT_H
22 
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27 
28 /*********************************************************************
29  * INCLUDES
30  */
33 #include "ti/ble/host/att/att.h"
34 
35 /*********************************************************************
36  * CONSTANTS
37  */
38 
44 #define GATT_PERMIT_READ 0x01
45 #define GATT_PERMIT_WRITE 0x02
46 #define GATT_PERMIT_AUTHEN_READ 0x04
47 #define GATT_PERMIT_AUTHEN_WRITE 0x08
48 #define GATT_PERMIT_AUTHOR_READ 0x10
49 #define GATT_PERMIT_AUTHOR_WRITE 0x20
50 #define GATT_PERMIT_ENCRYPT_READ 0x40
51 #define GATT_PERMIT_ENCRYPT_WRITE 0x80
52 
54 #if !defined( GATT_MAX_NUM_PREPARE_WRITES )
55  #define GATT_MAX_NUM_PREPARE_WRITES 5
56 #endif
57 
62 #define GATT_MIN_ENCRYPT_KEY_SIZE 7
63 #define GATT_MAX_ENCRYPT_KEY_SIZE 16
64 
66 #define GATT_MAX_ATTR_SIZE 512
67 
68 #define GATT_BASE_METHOD 0x40
69 
70 #define GATT_INVALID_HANDLE 0x0000
71 #define GATT_MIN_HANDLE 0x0001
72 #define GATT_MAX_HANDLE 0xFFFF
73 
74 #define GATT_ATTR_HANDLE_SIZE 0x02
75 
76 #define GATT_MAX_MTU 0xFFFF
77  // end of ATT_GATT_Constants
78 
81 #define GATT_SERVER_NOT_FOUND 0xFF
82 
84 /*********************************************************************
85  * VARIABLES
86  */
87 
88 /*********************************************************************
89  * MACROS
90  */
91 
93 
94 // Attribute Access Permissions
95 #define gattPermitRead( a ) ( (a) & GATT_PERMIT_READ )
96 #define gattPermitWrite( a ) ( (a) & GATT_PERMIT_WRITE )
97 #define gattPermitEncryptRead( a ) ( (a) & GATT_PERMIT_ENCRYPT_READ )
98 #define gattPermitEncryptWrite( a ) ( (a) & GATT_PERMIT_ENCRYPT_WRITE )
99 #define gattPermitAuthorRead( a ) ( (a) & GATT_PERMIT_AUTHOR_READ )
100 #define gattPermitAuthorWrite( a ) ( (a) & GATT_PERMIT_AUTHOR_WRITE )
101 #define gattPermitAuthenRead( a ) ( (a) & GATT_PERMIT_AUTHEN_READ )
102 #define gattPermitAuthenWrite( a ) ( (a) & GATT_PERMIT_AUTHEN_WRITE )
103 
104 // Check for different UUID types
105 #define gattPrimaryServiceType( t ) ( MAP_ATT_CompareUUID( primaryServiceUUID, ATT_BT_UUID_SIZE, \
106  (t).uuid, (t).len ) )
107 #define gattSecondaryServiceType( t ) ( MAP_ATT_CompareUUID( secondaryServiceUUID, ATT_BT_UUID_SIZE, \
108  (t).uuid, (t).len ) )
109 #define gattCharacterType( t ) ( MAP_ATT_CompareUUID( characterUUID, ATT_BT_UUID_SIZE, \
110  (t).uuid, (t).len ) )
111 #define gattIncludeType( t ) ( MAP_ATT_CompareUUID( includeUUID, ATT_BT_UUID_SIZE, \
112  (t).uuid, (t).len ) )
113 #define gattServiceType( t ) ( gattPrimaryServiceType( (t) ) || \
114  gattSecondaryServiceType( (t) ) )
115 
117 
118 /*********************************************************************
119  * TYPEDEFS
120  */
121  // end of ATT_GATT
123 
129 typedef struct
131 {
132  uint16 startHandle;
133  uint16 endHandle;
136 
138 typedef struct
139 {
143 
145 typedef struct
146 {
147  uint8 reliable;
149  uint16 lastOffset;
151 
153 typedef struct
154 {
155  uint8 reliable;
157  uint8 numReqs;
158  uint8 index;
159  uint8 flags;
162 
170 typedef union
171 {
172  // Request messages
188 
189  // Response messages
200 
201  // Indication and Notification messages
204 
205  // Locally-generated event messages
208 } gattMsg_t;
209 
216 typedef struct
217 {
219  uint16 connHandle;
220  uint8 method;
223  // end of ATT_GATT_events
225 
231 typedef struct
233 {
234  uint8 len;
235  const uint8 *uuid;
237 
245 typedef struct attAttribute_t
246 {
248  uint8 permissions;
249  uint16 handle;
250  uint8* const pValue;
254 
256 typedef struct
257 {
258  uint16 numAttrs;
259  uint8 encKeySize;
261 } gattService_t;
262 
263 /*
264 * @brief GATT security Callbacks
265 *
266 * @note
267 * This callback it used to return the security level required based on a
268 * the security flags saved in the previous bond
269 * IMPORTANT: This is called from the stack. Do not call to a stack APIs from
270 * this function
271 *
272 * @param connHandle - Connection Handle
273 * @param pMitmReq - Pointer that will store TRUE if authentication (MITM protection)
274 * is required
275 * @param pKeySize - Pointer that will store the key size required
276 *
277 * @return SUCCESS - A bond was found and data restored correctly
278 */
279 typedef bStatus_t (*pfnGATTBondInfoCB_t)(uint16_t connHandle, uint8_t *pMitmReq, uint8_t *pKeySize);
280 
281 /*
282 * @brief GATT security Callbacks
283 *
284 * @note
285 * This callback will trigger an encryption process with a bonded device
286 * IMPORTANT: This is called from the stack. Do not call to a stack APIs from
287 * this function
288 *
289 * @param connHandle - Connection Handle
290 *
291 * @return SUCCESS - A bond was found and the encryption process started
292 */
293 typedef bStatus_t (*pfnGATTStartEncCB_t)(uint16_t connHandle);
294 
300 typedef struct
301 {
305 
309 typedef struct
310 {
311  uint16_t handle;
312  uint8_t value;
313 } cccValues_t;
315  // end of ATT_GATT_Structs
317 
318 /*********************************************************************
319  * VARIABLES
320  */
321 
323 extern uint8 gattNumConns;
325 
331 /*********************************************************************
332  * API FUNCTIONS
333  */
334 
335 /*-------------------------------------------------------------------
336  * GATT Client Public APIs
337  */
338 
347 extern bStatus_t GATT_InitClient( void );
348 
357 extern void GATT_RegisterForInd( uint8 taskId );
358 
359 /******************************************************************************
360  * @fn GATT_RegisterClientSecurityCBs
361  *
362  * @brief Saves the Security related callbacks
363  *
364  * @param pClientCbs - Pointer to two functions needed for checking the security
365  * flags for a bonded device and to a function that starts
366  * encryption
367  *
368  * @return void
369  */
370 extern void GATT_RegisterClientSecurityCBs( gattClientSecCBs_t *pClientCallbacks );
371 
387 extern bStatus_t GATT_PrepareWriteReq( uint16 connHandle, attPrepareWriteReq_t *pReq, uint8 taskId );
388 
407 extern bStatus_t GATT_ExecuteWriteReq( uint16 connHandle, attExecuteWriteReq_t *pReq, uint8 taskId );
408 
409 /*-------------------------------------------------------------------
410  * GATT Server Public APIs
411  */
412 
422 extern bStatus_t GATT_InitServer( void );
423 
451 extern bStatus_t GATT_RegisterService( gattService_t *pService );
452 
465 extern bStatus_t GATT_DeregisterService( uint16 handle, gattService_t *pService );
466 
472 extern void GATT_RegisterForReq( uint8 taskId );
473 
487 extern bStatus_t GATT_VerifyReadPermissions( uint16 connHandle, gattAttribute_t *pAttr,
488  uint16 service);
489 
504 extern bStatus_t GATT_VerifyWritePermissions( uint16 connHandle, gattAttribute_t *pAttr,
505  uint16 service, attWriteReq_t *pReq );
506 
520 extern uint8 GATT_ServiceChangedInd( uint16 connHandle, uint8 taskId );
521 
534 extern gattAttribute_t *GATT_FindHandleUUID( uint16 startHandle, uint16 endHandle, const uint8 *pUUID,
535  uint16 len, uint16 *pHandle );
545 extern gattAttribute_t *GATT_FindHandle( uint16 handle, uint16 *pHandle );
546 
558 extern gattAttribute_t *GATT_FindNextAttr( gattAttribute_t *pAttr, uint16 endHandle,
559  uint16 service, uint16 *pLastHandle );
560 
568 extern uint16 GATT_ServiceNumAttrs( uint16 handle );
569 
578 extern uint8 GATT_ServiceEncKeySize( uint16 handle );
579 
595 extern bStatus_t GATT_SendRsp( uint16 connHandle, uint8 method, gattMsg_t *pRsp );
596 
597 /*-------------------------------------------------------------------
598  * GATT Server Sub-Procedure APIs
599  */
600 
646 extern bStatus_t GATT_Indication( uint16 connHandle, attHandleValueInd_t *pInd,
647  uint8 authenticated, uint8 taskId );
648 
688 extern bStatus_t GATT_Notification( uint16 connHandle, attHandleValueNoti_t *pNoti,
689  uint8 authenticated );
690 
691 /*-------------------------------------------------------------------
692  * GATT Client Sub-Procedure APIs
693  */
694 
726 extern bStatus_t GATT_ExchangeMTU( uint16 connHandle, attExchangeMTUReq_t *pReq, uint8 taskId );
727 
761 extern bStatus_t GATT_DiscAllPrimaryServices( uint16 connHandle, uint8 taskId );
762 
802 extern bStatus_t GATT_DiscPrimaryServiceByUUID( uint16 connHandle, uint8 *pUUID,
803  uint8 len, uint8 taskId );
839 extern bStatus_t GATT_FindIncludedServices( uint16 connHandle, uint16 startHandle,
840  uint16 endHandle, uint8 taskId );
878 extern bStatus_t GATT_DiscAllChars( uint16 connHandle, uint16 startHandle,
879  uint16 endHandle, uint8 taskId );
917 extern bStatus_t GATT_DiscCharsByUUID( uint16 connHandle, attReadByTypeReq_t *pReq, uint8 taskId );
918 
956 extern bStatus_t GATT_DiscAllCharDescs( uint16 connHandle, uint16 startHandle,
957  uint16 endHandle, uint8 taskId );
998 extern bStatus_t GATT_ReadCharValue( uint16 connHandle, attReadReq_t *pReq, uint8 taskId );
999 
1036 extern bStatus_t GATT_ReadUsingCharUUID( uint16 connHandle, attReadByTypeReq_t *pReq, uint8 taskId );
1069 extern bStatus_t GATT_ReadLongCharValue( uint16 connHandle, attReadBlobReq_t *pReq, uint8 taskId );
1070 
1105 extern bStatus_t GATT_ReadMultiCharValues( uint16 connHandle, attReadMultiReq_t *pReq, uint8 taskId );
1106 
1147 extern bStatus_t GATT_WriteNoRsp( uint16 connHandle, attWriteReq_t *pReq );
1148 
1194 extern bStatus_t GATT_SignedWriteNoRsp( uint16 connHandle, attWriteReq_t *pReq );
1195 
1240 extern bStatus_t GATT_WriteCharValue( uint16 connHandle, attWriteReq_t *pReq, uint8 taskId );
1241 
1284 extern bStatus_t GATT_WriteLongCharValue( uint16 connHandle, attPrepareWriteReq_t *pReq, uint8 taskId );
1285 
1337 extern bStatus_t GATT_ReliableWrites( uint16 connHandle, attPrepareWriteReq_t *pReqs,
1338  uint8 numReqs, uint8 flags, uint8 taskId );
1371 extern bStatus_t GATT_ReadCharDesc( uint16 connHandle, attReadReq_t *pReq, uint8 taskId );
1372 
1409 extern bStatus_t GATT_ReadLongCharDesc( uint16 connHandle, attReadBlobReq_t *pReq, uint8 taskId );
1410 
1452 extern bStatus_t GATT_WriteCharDesc( uint16 connHandle, attWriteReq_t *pReq, uint8 taskId );
1453 
1496 extern bStatus_t GATT_WriteLongCharDesc( uint16 connHandle, attPrepareWriteReq_t *pReq, uint8 taskId );
1497 
1498 /******************************************************************************
1499  * @fn GATT_SetNextHandle
1500  *
1501  * @brief Set the next available attribute handle.
1502  *
1503  * @param handle - next attribute handle.
1504  *
1505  * @return void
1506  */
1507 extern void GATT_SetNextHandle( uint16 handle );
1508 
1509 /******************************************************************************
1510  * @fn GATT_GetNumIndNotiHandles
1511  *
1512  * @brief Return the number of attributes that has GATT_CLIENT_CHAR_CFG_UUID
1513  *
1514  * @param None
1515  *
1516  * @return number of attributes
1517  */
1518 uint16_t GATT_GetNumIndNotiHandles(uint16_t minHandle, uint16_t maxHandle);
1519 
1520 /*******************************************************************************
1521  * @fn GATT_SetIndNotiRegData
1522  *
1523  * @brief This function fill a given buffer with the handles and values of characteristic
1524  * with GATT_CLIENT_CHAR_CFG_UUID
1525  *
1526  * @param connHandle - Connection Handle
1527  * @param minHandle - Minimum ATT handle
1528  * @param maxHandle - Maximum ATT handle
1529  * @param numAtts - Number of attributes
1530  * @param pBuf - Pointer to the data sturcture
1531  *
1532  * @return @ref SUCCESS
1533  * @ref FAILURE
1534  */
1535 uint8_t GATT_SetIndNotiRegData(uint16_t connHandle,
1536  uint16_t minHandle,
1537  uint16_t maxHandle,
1538  uint16_t numAtts,
1539  cccValues_t *pCccData);
1540 
1541 /*******************************************************************************
1542  * @fn GATT_GetServerPendingReq
1543  *
1544  * @brief This function returns the server pending request value
1545  *
1546  * @param connHandle - Connection Handle
1547  *
1548  * @return If server founding it's pending request value. Else, GATT_SERVER_NOT_FOUND
1549  */
1550 uint8_t GATT_GetServerPendingReq(uint16_t connHandle);
1551 
1552 /*-------------------------------------------------------------------
1553  * GATT Client and Server Common APIs
1554  */
1555 
1570 extern void GATT_RegisterForMsgs( uint8 taskID );
1571 
1584 extern bStatus_t GATT_NotifyEvent( uint16 connHandle, uint8 status, uint8 method, gattMsg_t *pMsg );
1585 
1602 extern bStatus_t GATT_UpdateMTU( uint16 connHandle, uint16 mtuSize );
1603 
1604 /*-------------------------------------------------------------------
1605  * GATT Buffer Management APIs
1606  */
1607 
1623 extern void *GATT_bm_alloc( uint16 connHandle, uint8 opcode, uint16 size, uint16 *pSizeAlloc );
1624 
1631 extern void GATT_bm_free( gattMsg_t *pMsg, uint8 opcode );
1632 
1634 
1635 /*-------------------------------------------------------------------
1636  * GATT Flow Control APIs
1637  */
1638 
1652 extern void GATT_SetHostToAppFlowCtrl( uint16 heapSize, uint8 flowCtrlMode );
1653 
1662 extern void GATT_AppCompletedMsg( gattMsgEvent_t *pMsg );
1663 
1664 /*-------------------------------------------------------------------
1665  * Internal API - This function is only called from GATT Qualification modules.
1666  */
1674 extern uint16 GATT_GetNextHandle( void );
1675 
1676 /*-------------------------------------------------------------------
1677  * Internal API - This function is called by OSAL tasks.
1678  */
1679 
1698 extern bStatus_t GATT_RequestNextTransaction( uint16 connHandle, uint8 taskId );
1699 
1700 /*-------------------------------------------------------------------
1701  * TASK API - These functions must only be called by OSAL.
1702  */
1703 
1713 extern void GATT_Init( uint8 taskId );
1714 
1725 extern uint32 GATT_ProcessEvent( uint8 taskId, uint32 events );
1726 
1728 
1729 /*********************************************************************
1730 *********************************************************************/
1731 
1732 #ifdef __cplusplus
1733 }
1734 #endif
1735 
1736 #endif /* GATT_H */
1737  // end of ATT_GATT
GATT Read By Type Request format.
Definition: gatt.h:138
bStatus_t GATT_UpdateMTU(uint16 connHandle, uint16 mtuSize)
This API allows the software components in the Z-Stack to be written independently of the specifics o...
attReadByGrpTypeReq_t readByGrpTypeReq
ATT Read By Group Type Request.
Definition: gatt.h:180
gattAttrType_t type
Attribute type (2 or 16 octet UUIDs)
Definition: gatt.h:247
Exchange MTU Response format.
Definition: att.h:359
uint8 index
Index of last Prepare Write Request sent.
Definition: gatt.h:158
Read Request.
Definition: att.h:463
pfnGATTBondInfoCB_t pfnBondInfoCB
callback function pointer
Definition: gatt.h:302
void GATT_RegisterClientSecurityCBs(gattClientSecCBs_t *pClientCallbacks)
attHandleValueNoti_t handleValueNoti
ATT Handle Value Notification.
Definition: gatt.h:202
Find Information Response format.
Definition: att.h:394
bStatus_t GATT_NotifyEvent(uint16 connHandle, uint8 status, uint8 method, gattMsg_t *pMsg)
Send an event to upper layer application/protocol.
attExchangeMTURsp_t exchangeMTURsp
ATT Exchange MTU Response.
Definition: gatt.h:191
attFindByTypeValueReq_t findByTypeValueReq
ATT Find By Type Value Request.
Definition: gatt.h:175
uint16 GATT_ServiceNumAttrs(uint16 handle)
Get the number of attributes for a given service.
attPrepareWriteReq_t * pReqs
Array of Prepare Write Requests (must be allocated)
Definition: gatt.h:156
bStatus_t(* pfnGATTBondInfoCB_t)(uint16_t connHandle, uint8_t *pMitmReq, uint8_t *pKeySize)
Definition: gatt.h:279
struct attAttribute_t gattAttribute_t
GATT Attribute format.
uint8 GATT_ServiceEncKeySize(uint16 handle)
Get the minimum encryption key size required by a given service.
GATT Reliable Writes Request format. Do not change the order of the members.
Definition: gatt.h:153
Find Information Request format.
Definition: att.h:369
Read Response.
Definition: att.h:473
uint8 encKeySize
Minimum encryption key size required by service (7-16 bytes)
Definition: gatt.h:259
GATT Attribute Type format.
Definition: gatt.h:232
GATT Write Long Request format. Do not change the order of the members.
Definition: gatt.h:145
bStatus_t GATT_VerifyWritePermissions(uint16 connHandle, gattAttribute_t *pAttr, uint16 service, attWriteReq_t *pReq)
Verify the permissions of an attribute for writing.
void GATT_RegisterForReq(uint8 taskId)
Register to receive incoming ATT Requests.
uint16 handle
Attribute handle - assigned internally by attribute server.
Definition: gatt.h:249
bStatus_t GATT_DiscAllPrimaryServices(uint16 connHandle, uint8 taskId)
Discovery All Primary Services.
Error Response format.
Definition: att.h:337
attPrepareWriteReq_t prepareWriteReq
ATT Prepare Write Request.
Definition: gatt.h:182
bStatus_t GATT_ReliableWrites(uint16 connHandle, attPrepareWriteReq_t *pReqs, uint8 numReqs, uint8 flags, uint8 taskId)
Do a Reliable Write.
attReadMultiRsp_t readMultiRsp
ATT Read Multiple Response.
Definition: gatt.h:197
attReadBlobRsp_t readBlobRsp
ATT Read Blob Response.
Definition: gatt.h:196
bStatus_t GATT_Indication(uint16 connHandle, attHandleValueInd_t *pInd, uint8 authenticated, uint8 taskId)
Send a GATT Indication.
attPrepareWriteRsp_t prepareWriteRsp
ATT Prepare Write Response.
Definition: gatt.h:199
Find By Type Value Request format.
Definition: att.h:406
const uint8 * uuid
Pointer to UUID.
Definition: gatt.h:235
bStatus_t GATT_ReadUsingCharUUID(uint16 connHandle, attReadByTypeReq_t *pReq, uint8 taskId)
Read Using Characteristic UUID.
bStatus_t GATT_WriteLongCharValue(uint16 connHandle, attPrepareWriteReq_t *pReq, uint8 taskId)
Write Long Characteristic Value.
attFindInfoRsp_t findInfoRsp
ATT Find Information Response.
Definition: gatt.h:192
uint16 endHandle
Last requested handle number.
Definition: gatt.h:133
void GATT_SetNextHandle(uint16 handle)
gattReadByTypeReq_t gattReadByTypeReq
GATT Read By Type Request.
Definition: gatt.h:185
Write Request format.
Definition: att.h:552
uint16 lastOffset
Offset of last Prepare Write Request sent.
Definition: gatt.h:149
bStatus_t GATT_ReadCharValue(uint16 connHandle, attReadReq_t *pReq, uint8 taskId)
Read Characteristic Value.
attReadBlobReq_t readBlobReq
ATT Read Blob Request.
Definition: gatt.h:178
uint8_t GATT_GetServerPendingReq(uint16_t connHandle)
uint8 reliable
Whether reliable writes requested (always FALSE for Write Long)
Definition: gatt.h:147
attExchangeMTUReq_t exchangeMTUReq
ATT Exchange MTU Request.
Definition: gatt.h:173
uint16 connHandle
Connection message was received on.
Definition: gatt.h:219
attReadReq_t readReq
ATT Read Request.
Definition: gatt.h:177
attReadByTypeReq_t readByTypeReq
ATT Read By Type Request.
Definition: gatt.h:176
CCC Data structure.
Definition: gatt.h:309
bStatus_t GATT_ExecuteWriteReq(uint16 connHandle, attExecuteWriteReq_t *pReq, uint8 taskId)
ATT_ExecuteWriteReq
bStatus_t GATT_SignedWriteNoRsp(uint16 connHandle, attWriteReq_t *pReq)
Signed Write No Response.
bStatus_t GATT_SendRsp(uint16 connHandle, uint8 method, gattMsg_t *pRsp)
Send an ATT Response message out.
GATT Message format.
Definition: gatt.h:170
uint16_t handle
Attribute handle.
Definition: gatt.h:311
bStatus_t GATT_DiscAllCharDescs(uint16 connHandle, uint16 startHandle, uint16 endHandle, uint8 taskId)
Discovery All Characteristic Descriptors.
uint8 numReqs
Number of Prepare Write Requests.
Definition: gatt.h:157
attFindInfoReq_t findInfoReq
ATT Find Information Request.
Definition: gatt.h:174
Read By Group Type Response format.
Definition: att.h:540
attErrorRsp_t errorRsp
ATT Error Response.
Definition: gatt.h:190
ATT MTU Updated Event message format.
Definition: att.h:655
uint8_t value
Definition: gatt.h:312
attWriteReq_t writeReq
ATT Write Request.
Definition: gatt.h:181
bStatus_t GATT_InitClient(void)
Initialize the Generic Attribute Profile Client.
uint16 startHandle
First requested handle number (must be first field)
Definition: gatt.h:132
attHandleValueInd_t handleValueInd
ATT Handle Value Indication.
Definition: gatt.h:203
gattAttribute_t * attrs
Array of attribute records;.
Definition: gatt.h:260
uint8 GATT_ServiceChangedInd(uint16 connHandle, uint8 taskId)
Send out a Service Changed Indication.
Attribute Type format (2 or 16 octet UUID).
Definition: att.h:314
Read Multiple Response format.
Definition: att.h:517
Read Blob Response format.
Definition: att.h:495
attAttrType_t value
Primary service UUID value (2 or 16 octets)
Definition: gatt.h:134
GATT Find By Type Value Request format.
Definition: gatt.h:130
uint8 discCharsByUUID
Whether this is a GATT Discover Characteristics by UUID sub-procedure.
Definition: gatt.h:140
attExecuteWriteReq_t executeWriteReq
ATT Execute Write Request.
Definition: gatt.h:183
bStatus_t GATT_VerifyReadPermissions(uint16 connHandle, gattAttribute_t *pAttr, uint16 service)
Verify the permissions of an attribute for reading.
uint8 *const pValue
Definition: gatt.h:250
bStatus_t GATT_Notification(uint16 connHandle, attHandleValueNoti_t *pNoti, uint8 authenticated)
Send a GATT Notification.
Read Blob Request format.
Definition: att.h:484
gattFindByTypeValueReq_t gattFindByTypeValueReq
GATT Find By Type Value Request.
Definition: gatt.h:184
Find By Type Value Response format.
Definition: att.h:427
ATT Flow Control Violated Event message format.
Definition: att.h:639
uint8 permissions
Attribute permissions.
Definition: gatt.h:248
Read By Type Request format.
Definition: att.h:438
uint8_t GATT_SetIndNotiRegData(uint16_t connHandle, uint16_t minHandle, uint16_t maxHandle, uint16_t numAtts, cccValues_t *pCccData)
Read Multiple Request format.
Definition: att.h:506
bStatus_t GATT_ReadLongCharDesc(uint16 connHandle, attReadBlobReq_t *pReq, uint8 taskId)
Read Long Characteristic Descriptor.
GATT Structure for client security callbacks.
Definition: gatt.h:300
bStatus_t GATT_ExchangeMTU(uint16 connHandle, attExchangeMTUReq_t *pReq, uint8 taskId)
Exchange MTU Request.
Handle Value Indication format.
Definition: att.h:615
bStatus_t GATT_PrepareWriteReq(uint16 connHandle, attPrepareWriteReq_t *pReq, uint8 taskId)
Request the server to prepare to write the value of an attribute.
bStatus_t GATT_WriteNoRsp(uint16 connHandle, attWriteReq_t *pReq)
Write No Response.
gattMsg_t msg
Attribute protocol/profile message.
Definition: gatt.h:221
attReadByGrpTypeRsp_t readByGrpTypeRsp
ATT Read By Group Type Response.
Definition: gatt.h:198
Type definitions and macros for BLE stack.
Handle Value Notification format.
Definition: att.h:603
bStatus_t GATT_WriteCharValue(uint16 connHandle, attWriteReq_t *pReq, uint8 taskId)
Write Characteristic Value.
attReadByTypeRsp_t readByTypeRsp
ATT Read By Type Response.
Definition: gatt.h:194
uint8 flags
Definition: gatt.h:159
pfnGATTStartEncCB_t pfnStartEncCB
callback function pointer
Definition: gatt.h:303
bStatus_t GATT_WriteLongCharDesc(uint16 connHandle, attPrepareWriteReq_t *pReq, uint8 taskId)
Write Long Characteristic Descriptor.
bStatus_t GATT_DiscPrimaryServiceByUUID(uint16 connHandle, uint8 *pUUID, uint8 len, uint8 taskId)
Discovery Primary Service by UUID.
OSAL Event Header.
Definition: osal.h:124
attFindByTypeValueRsp_t findByTypeValueRsp
ATT Find By Type Value Response.
Definition: gatt.h:193
uint8 reliable
Whether reliable writes requested (always TRUE for Reliable Writes)
Definition: gatt.h:155
void GATT_RegisterForMsgs(uint8 taskID)
GATT Register for Messages.
attReadMultiReq_t readMultiReq
ATT Read Multiple Request.
Definition: gatt.h:179
attFlowCtrlViolatedEvt_t flowCtrlEvt
ATT Flow Control Violated Event.
Definition: gatt.h:206
Exchange MTU Request format.
Definition: att.h:349
bStatus_t GATT_ReadCharDesc(uint16 connHandle, attReadReq_t *pReq, uint8 taskId)
Read Characteristic Descriptor.
attPrepareWriteReq_t req
ATT Prepare Write Request.
Definition: gatt.h:148
bStatus_t GATT_DiscCharsByUUID(uint16 connHandle, attReadByTypeReq_t *pReq, uint8 taskId)
Discovery Characteristics by UUID.
bStatus_t GATT_FindIncludedServices(uint16 connHandle, uint16 startHandle, uint16 endHandle, uint8 taskId)
This sub-procedure is used by a client to find include service declarations within a service definiti...
uint16_t GATT_GetNumIndNotiHandles(uint16_t minHandle, uint16_t maxHandle)
GATT GATT_MSG_EVENT message format.
Definition: gatt.h:216
bStatus_t GATT_InitServer(void)
Initialize the Generic Attribute Profile Server.
bStatus_t GATT_RegisterService(gattService_t *pService)
Register a service attribute list with the GATT Server.
GATT Service format.
Definition: gatt.h:256
Read By Group Type Request format.
Definition: att.h:528
gattWriteLongReq_t gattWriteLongReq
GATT Long Write Request.
Definition: gatt.h:186
GATT Attribute format.
Definition: gatt.h:245
void GATT_bm_free(gattMsg_t *pMsg, uint8 opcode)
GATT implementation of the de-allocator functionality.
Read By Type Response format.
Definition: att.h:450
osal_event_hdr_t hdr
GATT_MSG_EVENT and status.
Definition: gatt.h:218
Prepare Write Response format.
Definition: att.h:579
Prepare Write Request format.
Definition: att.h:566
ATT layer interface.
bStatus_t GATT_WriteCharDesc(uint16 connHandle, attWriteReq_t *pReq, uint8 taskId)
Write Characteristic Descriptor.
bStatus_t GATT_ReadLongCharValue(uint16 connHandle, attReadBlobReq_t *pReq, uint8 taskId)
Read Long Characteristic Value.
bStatus_t GATT_DeregisterService(uint16 handle, gattService_t *pService)
Deregister a service attribute list with the GATT Server.
gattAttribute_t * GATT_FindHandle(uint16 handle, uint16 *pHandle)
Find the attribute record for a given handle.
gattAttribute_t * GATT_FindHandleUUID(uint16 startHandle, uint16 endHandle, const uint8 *pUUID, uint16 len, uint16 *pHandle)
Find the attribute record for a given handle and UUID.
uint8_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:246
uint8 method
Type of message.
Definition: gatt.h:220
uint8 len
Length of UUID (2 or 16)
Definition: gatt.h:234
gattAttribute_t * GATT_FindNextAttr(gattAttribute_t *pAttr, uint16 endHandle, uint16 service, uint16 *pLastHandle)
Find the next attribute of the same type for a given attribute.
uint16 numAttrs
Number of attributes in attrs.
Definition: gatt.h:258
bStatus_t(* pfnGATTStartEncCB_t)(uint16_t connHandle)
Definition: gatt.h:293
attMtuUpdatedEvt_t mtuEvt
ATT MTU Updated Event.
Definition: gatt.h:207
void * GATT_bm_alloc(uint16 connHandle, uint8 opcode, uint16 size, uint16 *pSizeAlloc)
GATT implementation of the allocator functionality.
gattReliableWritesReq_t gattReliableWritesReq
GATT Reliable Writes Request.
Definition: gatt.h:187
Execute Write Request format.
Definition: att.h:592
attReadByTypeReq_t req
Read By Type Request.
Definition: gatt.h:141
bStatus_t GATT_ReadMultiCharValues(uint16 connHandle, attReadMultiReq_t *pReq, uint8 taskId)
Read Multiple Characteristic Values.
attReadRsp_t readRsp
ATT Read Response.
Definition: gatt.h:195
bStatus_t GATT_DiscAllChars(uint16 connHandle, uint16 startHandle, uint16 endHandle, uint8 taskId)
Discover all Characteristics.
void GATT_RegisterForInd(uint8 taskId)
Register to receive incoming ATT Indications or Notifications of attribute values.
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale