TI BLE5-Stack API Documentation  2.02.07.00
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  */
31 #include "bcomdef.h"
32 #include "osal.h"
33 
34 #include "att.h"
35 
36 /*********************************************************************
37  * CONSTANTS
38  */
39 
45 #define GATT_PERMIT_READ 0x01
46 #define GATT_PERMIT_WRITE 0x02
47 #define GATT_PERMIT_AUTHEN_READ 0x04
48 #define GATT_PERMIT_AUTHEN_WRITE 0x08
49 #define GATT_PERMIT_AUTHOR_READ 0x10
50 #define GATT_PERMIT_AUTHOR_WRITE 0x20
51 #define GATT_PERMIT_ENCRYPT_READ 0x40
52 #define GATT_PERMIT_ENCRYPT_WRITE 0x80
53 
55 #if !defined( GATT_MAX_NUM_PREPARE_WRITES )
56  #define GATT_MAX_NUM_PREPARE_WRITES 5
57 #endif
58 
63 #define GATT_MIN_ENCRYPT_KEY_SIZE 7
64 #define GATT_MAX_ENCRYPT_KEY_SIZE 16
65 
67 #define GATT_MAX_ATTR_SIZE 512
68 
69 #define GATT_BASE_METHOD 0x40
70 
71 #define GATT_INVALID_HANDLE 0x0000
72 #define GATT_MIN_HANDLE 0x0001
73 #define GATT_MAX_HANDLE 0xFFFF
74 
75 #define GATT_ATTR_HANDLE_SIZE 0x02
76 
77 #define GATT_MAX_MTU 0xFFFF
78  // end of ATT_GATT_Constants
79 
80 /*********************************************************************
81  * VARIABLES
82  */
83 
84 /*********************************************************************
85  * MACROS
86  */
87 
89 
90 // Attribute Access Permissions
91 #define gattPermitRead( a ) ( (a) & GATT_PERMIT_READ )
92 #define gattPermitWrite( a ) ( (a) & GATT_PERMIT_WRITE )
93 #define gattPermitEncryptRead( a ) ( (a) & GATT_PERMIT_ENCRYPT_READ )
94 #define gattPermitEncryptWrite( a ) ( (a) & GATT_PERMIT_ENCRYPT_WRITE )
95 #define gattPermitAuthorRead( a ) ( (a) & GATT_PERMIT_AUTHOR_READ )
96 #define gattPermitAuthorWrite( a ) ( (a) & GATT_PERMIT_AUTHOR_WRITE )
97 #define gattPermitAuthenRead( a ) ( (a) & GATT_PERMIT_AUTHEN_READ )
98 #define gattPermitAuthenWrite( a ) ( (a) & GATT_PERMIT_AUTHEN_WRITE )
99 
100 // Check for different UUID types
101 #define gattPrimaryServiceType( t ) ( MAP_ATT_CompareUUID( primaryServiceUUID, ATT_BT_UUID_SIZE, \
102  (t).uuid, (t).len ) )
103 #define gattSecondaryServiceType( t ) ( MAP_ATT_CompareUUID( secondaryServiceUUID, ATT_BT_UUID_SIZE, \
104  (t).uuid, (t).len ) )
105 #define gattCharacterType( t ) ( MAP_ATT_CompareUUID( characterUUID, ATT_BT_UUID_SIZE, \
106  (t).uuid, (t).len ) )
107 #define gattIncludeType( t ) ( MAP_ATT_CompareUUID( includeUUID, ATT_BT_UUID_SIZE, \
108  (t).uuid, (t).len ) )
109 #define gattServiceType( t ) ( gattPrimaryServiceType( (t) ) || \
110  gattSecondaryServiceType( (t) ) )
111 
113 
114 /*********************************************************************
115  * TYPEDEFS
116  */
117  // end of ATT_GATT
119 
125 typedef struct
127 {
128  uint16 startHandle;
129  uint16 endHandle;
132 
134 typedef struct
135 {
139 
141 typedef struct
142 {
143  uint8 reliable;
145  uint16 lastOffset;
147 
149 typedef struct
150 {
151  uint8 reliable;
153  uint8 numReqs;
154  uint8 index;
155  uint8 flags;
158 
166 typedef union
167 {
168  // Request messages
184 
185  // Response messages
196 
197  // Indication and Notification messages
200 
201  // Locally-generated event messages
204 } gattMsg_t;
205 
212 typedef struct
213 {
215  uint16 connHandle;
216  uint8 method;
219  // end of ATT_GATT_events
221 
227 typedef struct
229 {
230  uint8 len;
231  const uint8 *uuid;
233 
241 typedef struct attAttribute_t
242 {
244  uint8 permissions;
245  uint16 handle;
246  uint8* const pValue;
250 
252 typedef struct
253 {
254  uint16 numAttrs;
255  uint8 encKeySize;
257 } gattService_t;
258 
259 /*
260 * @brief GATT security Callbacks
261 *
262 * @note
263 * This callback it used to return the security level required based on a
264 * the security flags saved in the previous bond
265 * IMPORTANT: This is called from the stack. Do not call to a stack APIs from
266 * this function
267 *
268 * @param connHandle - Connection Handle
269 * @param pMitmReq - Pointer that will store TRUE if authentication (MITM protection)
270 * is required
271 * @param pKeySize - Pointer that will store the key size required
272 *
273 * @return SUCCESS - A bond was found and data restored correctly
274 */
275 typedef bStatus_t (*pfnGATTBondInfoCB_t)(uint16_t connHandle, uint8_t *pMitmReq, uint8_t *pKeySize);
276 
277 /*
278 * @brief GATT security Callbacks
279 *
280 * @note
281 * This callback will trigger an encryption process with a bonded device
282 * IMPORTANT: This is called from the stack. Do not call to a stack APIs from
283 * this function
284 *
285 * @param connHandle - Connection Handle
286 *
287 * @return SUCCESS - A bond was found and the encryption process started
288 */
289 typedef bStatus_t (*pfnGATTStartEncCB_t)(uint16_t connHandle);
290 
296 typedef struct
297 {
298  pfnGATTBondInfoCB_t pfnBondInfoCB;
299  pfnGATTStartEncCB_t pfnStartEncCB;
301  // end of ATT_GATT_Structs
303 
304 /*********************************************************************
305  * VARIABLES
306  */
307 
309 extern uint8 gattNumConns;
311 
317 /*********************************************************************
318  * API FUNCTIONS
319  */
320 
321 /*-------------------------------------------------------------------
322  * GATT Client Public APIs
323  */
324 
333 extern bStatus_t GATT_InitClient( void );
334 
343 extern void GATT_RegisterForInd( uint8 taskId );
344 
345 /******************************************************************************
346  * @fn GATT_RegisterClientSecurityCBs
347  *
348  * @brief Saves the Security related callbacks
349  *
350  * @param pClientCbs - Pointer to two functions needed for checking the security
351  * flags for a bonded device and to a function that starts
352  * encryption
353  *
354  * @return void
355  */
356 extern void GATT_RegisterClientSecurityCBs( gattClientSecCBs_t *pClientCallbacks );
357 
373 extern bStatus_t GATT_PrepareWriteReq( uint16 connHandle, attPrepareWriteReq_t *pReq, uint8 taskId );
374 
393 extern bStatus_t GATT_ExecuteWriteReq( uint16 connHandle, attExecuteWriteReq_t *pReq, uint8 taskId );
394 
395 /*-------------------------------------------------------------------
396  * GATT Server Public APIs
397  */
398 
408 extern bStatus_t GATT_InitServer( void );
409 
437 extern bStatus_t GATT_RegisterService( gattService_t *pService );
438 
451 extern bStatus_t GATT_DeregisterService( uint16 handle, gattService_t *pService );
452 
458 extern void GATT_RegisterForReq( uint8 taskId );
459 
473 extern bStatus_t GATT_VerifyReadPermissions( uint16 connHandle, gattAttribute_t *pAttr,
474  uint16 service);
475 
490 extern bStatus_t GATT_VerifyWritePermissions( uint16 connHandle, gattAttribute_t *pAttr,
491  uint16 service, attWriteReq_t *pReq );
492 
506 extern uint8 GATT_ServiceChangedInd( uint16 connHandle, uint8 taskId );
507 
520 extern gattAttribute_t *GATT_FindHandleUUID( uint16 startHandle, uint16 endHandle, const uint8 *pUUID,
521  uint16 len, uint16 *pHandle );
531 extern gattAttribute_t *GATT_FindHandle( uint16 handle, uint16 *pHandle );
532 
544 extern gattAttribute_t *GATT_FindNextAttr( gattAttribute_t *pAttr, uint16 endHandle,
545  uint16 service, uint16 *pLastHandle );
546 
554 extern uint16 GATT_ServiceNumAttrs( uint16 handle );
555 
564 extern uint8 GATT_ServiceEncKeySize( uint16 handle );
565 
581 extern bStatus_t GATT_SendRsp( uint16 connHandle, uint8 method, gattMsg_t *pRsp );
582 
583 /*-------------------------------------------------------------------
584  * GATT Server Sub-Procedure APIs
585  */
586 
632 extern bStatus_t GATT_Indication( uint16 connHandle, attHandleValueInd_t *pInd,
633  uint8 authenticated, uint8 taskId );
634 
674 extern bStatus_t GATT_Notification( uint16 connHandle, attHandleValueNoti_t *pNoti,
675  uint8 authenticated );
676 
677 /*-------------------------------------------------------------------
678  * GATT Client Sub-Procedure APIs
679  */
680 
712 extern bStatus_t GATT_ExchangeMTU( uint16 connHandle, attExchangeMTUReq_t *pReq, uint8 taskId );
713 
747 extern bStatus_t GATT_DiscAllPrimaryServices( uint16 connHandle, uint8 taskId );
748 
788 extern bStatus_t GATT_DiscPrimaryServiceByUUID( uint16 connHandle, uint8 *pUUID,
789  uint8 len, uint8 taskId );
825 extern bStatus_t GATT_FindIncludedServices( uint16 connHandle, uint16 startHandle,
826  uint16 endHandle, uint8 taskId );
864 extern bStatus_t GATT_DiscAllChars( uint16 connHandle, uint16 startHandle,
865  uint16 endHandle, uint8 taskId );
903 extern bStatus_t GATT_DiscCharsByUUID( uint16 connHandle, attReadByTypeReq_t *pReq, uint8 taskId );
904 
942 extern bStatus_t GATT_DiscAllCharDescs( uint16 connHandle, uint16 startHandle,
943  uint16 endHandle, uint8 taskId );
984 extern bStatus_t GATT_ReadCharValue( uint16 connHandle, attReadReq_t *pReq, uint8 taskId );
985 
1022 extern bStatus_t GATT_ReadUsingCharUUID( uint16 connHandle, attReadByTypeReq_t *pReq, uint8 taskId );
1055 extern bStatus_t GATT_ReadLongCharValue( uint16 connHandle, attReadBlobReq_t *pReq, uint8 taskId );
1056 
1091 extern bStatus_t GATT_ReadMultiCharValues( uint16 connHandle, attReadMultiReq_t *pReq, uint8 taskId );
1092 
1133 extern bStatus_t GATT_WriteNoRsp( uint16 connHandle, attWriteReq_t *pReq );
1134 
1180 extern bStatus_t GATT_SignedWriteNoRsp( uint16 connHandle, attWriteReq_t *pReq );
1181 
1226 extern bStatus_t GATT_WriteCharValue( uint16 connHandle, attWriteReq_t *pReq, uint8 taskId );
1227 
1270 extern bStatus_t GATT_WriteLongCharValue( uint16 connHandle, attPrepareWriteReq_t *pReq, uint8 taskId );
1271 
1323 extern bStatus_t GATT_ReliableWrites( uint16 connHandle, attPrepareWriteReq_t *pReqs,
1324  uint8 numReqs, uint8 flags, uint8 taskId );
1357 extern bStatus_t GATT_ReadCharDesc( uint16 connHandle, attReadReq_t *pReq, uint8 taskId );
1358 
1395 extern bStatus_t GATT_ReadLongCharDesc( uint16 connHandle, attReadBlobReq_t *pReq, uint8 taskId );
1396 
1438 extern bStatus_t GATT_WriteCharDesc( uint16 connHandle, attWriteReq_t *pReq, uint8 taskId );
1439 
1482 extern bStatus_t GATT_WriteLongCharDesc( uint16 connHandle, attPrepareWriteReq_t *pReq, uint8 taskId );
1483 
1484 /*-------------------------------------------------------------------
1485  * GATT Client and Server Common APIs
1486  */
1487 
1502 extern void GATT_RegisterForMsgs( uint8 taskID );
1503 
1516 extern bStatus_t GATT_NotifyEvent( uint16 connHandle, uint8 status, uint8 method, gattMsg_t *pMsg );
1517 
1534 extern bStatus_t GATT_UpdateMTU( uint16 connHandle, uint16 mtuSize );
1535 
1536 /*-------------------------------------------------------------------
1537  * GATT Buffer Management APIs
1538  */
1539 
1555 extern void *GATT_bm_alloc( uint16 connHandle, uint8 opcode, uint16 size, uint16 *pSizeAlloc );
1556 
1563 extern void GATT_bm_free( gattMsg_t *pMsg, uint8 opcode );
1564 
1566 
1567 /*-------------------------------------------------------------------
1568  * GATT Flow Control APIs
1569  */
1570 
1584 extern void GATT_SetHostToAppFlowCtrl( uint16 heapSize, uint8 flowCtrlMode );
1585 
1594 extern void GATT_AppCompletedMsg( gattMsgEvent_t *pMsg );
1595 
1596 /*-------------------------------------------------------------------
1597  * Internal API - This function is only called from GATT Qualification modules.
1598  */
1599 
1607 extern void GATT_SetNextHandle( uint16 handle );
1608 
1616 extern uint16 GATT_GetNextHandle( void );
1617 
1618 /*-------------------------------------------------------------------
1619  * Internal API - This function is called by OSAL tasks.
1620  */
1621 
1640 extern bStatus_t GATT_RequestNextTransaction( uint16 connHandle, uint8 taskId );
1641 
1642 /*-------------------------------------------------------------------
1643  * TASK API - These functions must only be called by OSAL.
1644  */
1645 
1655 extern void GATT_Init( uint8 taskId );
1656 
1667 extern uint16 GATT_ProcessEvent( uint8 taskId, uint16 events );
1668 
1670 
1671 /*********************************************************************
1672 *********************************************************************/
1673 
1674 #ifdef __cplusplus
1675 }
1676 #endif
1677 
1678 #endif /* GATT_H */
1679  // end of ATT_GATT
GATT Read By Type Request format.
Definition: gatt.h:134
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:176
gattAttrType_t type
Attribute type (2 or 16 octet UUIDs)
Definition: gatt.h:243
Exchange MTU Response format.
Definition: att.h:348
uint8 index
Index of last Prepare Write Request sent.
Definition: gatt.h:154
Read Request.
Definition: att.h:452
attHandleValueNoti_t handleValueNoti
ATT Handle Value Notification.
Definition: gatt.h:198
Find Information Response format.
Definition: att.h:383
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:187
attFindByTypeValueReq_t findByTypeValueReq
ATT Find By Type Value Request.
Definition: gatt.h:171
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:152
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:149
Find Information Request format.
Definition: att.h:358
Read Response.
Definition: att.h:462
uint8 encKeySize
Minimum encryption key size required by service (7-16 bytes)
Definition: gatt.h:255
GATT Attribute Type format.
Definition: gatt.h:228
GATT Write Long Request format. Do not change the order of the members.
Definition: gatt.h:141
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:245
bStatus_t GATT_DiscAllPrimaryServices(uint16 connHandle, uint8 taskId)
Discovery All Primary Services.
Error Response format.
Definition: att.h:326
attPrepareWriteReq_t prepareWriteReq
ATT Prepare Write Request.
Definition: gatt.h:178
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:193
attReadBlobRsp_t readBlobRsp
ATT Read Blob Response.
Definition: gatt.h:192
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:195
Find By Type Value Request format.
Definition: att.h:395
const uint8 * uuid
Pointer to UUID.
Definition: gatt.h:231
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:188
uint16 endHandle
Last requested handle number.
Definition: gatt.h:129
gattReadByTypeReq_t gattReadByTypeReq
GATT Read By Type Request.
Definition: gatt.h:181
Write Request format.
Definition: att.h:541
uint16 lastOffset
Offset of last Prepare Write Request sent.
Definition: gatt.h:145
bStatus_t GATT_ReadCharValue(uint16 connHandle, attReadReq_t *pReq, uint8 taskId)
Read Characteristic Value.
attReadBlobReq_t readBlobReq
ATT Read Blob Request.
Definition: gatt.h:174
uint8 reliable
Whether reliable writes requested (always FALSE for Write Long)
Definition: gatt.h:143
attExchangeMTUReq_t exchangeMTUReq
ATT Exchange MTU Request.
Definition: gatt.h:169
uint16 connHandle
Connection message was received on.
Definition: gatt.h:215
attReadReq_t readReq
ATT Read Request.
Definition: gatt.h:173
attReadByTypeReq_t readByTypeReq
ATT Read By Type Request.
Definition: gatt.h:172
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:166
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:153
attFindInfoReq_t findInfoReq
ATT Find Information Request.
Definition: gatt.h:170
Read By Group Type Response format.
Definition: att.h:529
attErrorRsp_t errorRsp
ATT Error Response.
Definition: gatt.h:186
ATT MTU Updated Event message format.
Definition: att.h:644
attWriteReq_t writeReq
ATT Write Request.
Definition: gatt.h:177
bStatus_t GATT_InitClient(void)
Initialize the Generic Attribute Profile Client.
uint16 startHandle
First requested handle number (must be first field)
Definition: gatt.h:128
attHandleValueInd_t handleValueInd
ATT Handle Value Indication.
Definition: gatt.h:199
gattAttribute_t * attrs
Array of attribute records;.
Definition: gatt.h:256
uint8 GATT_ServiceChangedInd(uint16 connHandle, uint8 taskId)
Send out a Service Changed Indication.
Attribute Type format (2 or 16 octet UUID).
Definition: att.h:303
Read Multiple Response format.
Definition: att.h:506
Read Blob Response format.
Definition: att.h:484
attAttrType_t value
Primary service UUID value (2 or 16 octets)
Definition: gatt.h:130
GATT Find By Type Value Request format.
Definition: gatt.h:126
uint8 discCharsByUUID
Whether this is a GATT Discover Characteristics by UUID sub-procedure.
Definition: gatt.h:136
attExecuteWriteReq_t executeWriteReq
ATT Execute Write Request.
Definition: gatt.h:179
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:246
bStatus_t GATT_Notification(uint16 connHandle, attHandleValueNoti_t *pNoti, uint8 authenticated)
Send a GATT Notification.
Read Blob Request format.
Definition: att.h:473
gattFindByTypeValueReq_t gattFindByTypeValueReq
GATT Find By Type Value Request.
Definition: gatt.h:180
Find By Type Value Response format.
Definition: att.h:416
ATT Flow Control Violated Event message format.
Definition: att.h:628
uint8 permissions
Attribute permissions.
Definition: gatt.h:244
Read By Type Request format.
Definition: att.h:427
Read Multiple Request format.
Definition: att.h:495
bStatus_t GATT_ReadLongCharDesc(uint16 connHandle, attReadBlobReq_t *pReq, uint8 taskId)
Read Long Characteristic Descriptor.
GATT Structure for client security callbacks.
Definition: gatt.h:296
bStatus_t GATT_ExchangeMTU(uint16 connHandle, attExchangeMTUReq_t *pReq, uint8 taskId)
Exchange MTU Request.
Handle Value Indication format.
Definition: att.h:604
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:217
attReadByGrpTypeRsp_t readByGrpTypeRsp
ATT Read By Group Type Response.
Definition: gatt.h:194
Type definitions and macros for BLE stack.
Handle Value Notification format.
Definition: att.h:592
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:190
uint8 flags
Definition: gatt.h:155
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:92
attFindByTypeValueRsp_t findByTypeValueRsp
ATT Find By Type Value Response.
Definition: gatt.h:189
uint8 reliable
Whether reliable writes requested (always TRUE for Reliable Writes)
Definition: gatt.h:151
void GATT_RegisterForMsgs(uint8 taskID)
GATT Register for Messages.
attReadMultiReq_t readMultiReq
ATT Read Multiple Request.
Definition: gatt.h:175
attFlowCtrlViolatedEvt_t flowCtrlEvt
ATT Flow Control Violated Event.
Definition: gatt.h:202
Exchange MTU Request format.
Definition: att.h:338
bStatus_t GATT_ReadCharDesc(uint16 connHandle, attReadReq_t *pReq, uint8 taskId)
Read Characteristic Descriptor.
attPrepareWriteReq_t req
ATT Prepare Write Request.
Definition: gatt.h:144
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...
GATT GATT_MSG_EVENT message format.
Definition: gatt.h:212
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:252
Read By Group Type Request format.
Definition: att.h:517
gattWriteLongReq_t gattWriteLongReq
GATT Long Write Request.
Definition: gatt.h:182
GATT Attribute format.
Definition: gatt.h:241
Status_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:251
void GATT_bm_free(gattMsg_t *pMsg, uint8 opcode)
GATT implementation of the de-allocator functionality.
Read By Type Response format.
Definition: att.h:439
osal_event_hdr_t hdr
GATT_MSG_EVENT and status.
Definition: gatt.h:214
Prepare Write Response format.
Definition: att.h:568
Prepare Write Request format.
Definition: att.h:555
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 method
Type of message.
Definition: gatt.h:216
uint8 len
Length of UUID (2 or 16)
Definition: gatt.h:230
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:254
attMtuUpdatedEvt_t mtuEvt
ATT MTU Updated Event.
Definition: gatt.h:203
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:183
Execute Write Request format.
Definition: att.h:581
attReadByTypeReq_t req
Read By Type Request.
Definition: gatt.h:137
bStatus_t GATT_ReadMultiCharValues(uint16 connHandle, attReadMultiReq_t *pReq, uint8 taskId)
Read Multiple Characteristic Values.
attReadRsp_t readRsp
ATT Read Response.
Definition: gatt.h:191
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-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale