BLE-Stack APIs  3.00.00
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gatt.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2016, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 /*!*****************************************************************************
33  * @addtogroup ATT_GATT
34  * @{
35  * @file gatt.h
36  * @brief GATT layer interface
37  */
38 
39 #ifndef GATT_H
40 #define GATT_H
41 
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46 
47 /*********************************************************************
48  * INCLUDES
49  */
50 #include "bcomdef.h"
51 #include "osal.h"
52 
53 #include "att.h"
54 
55 /*********************************************************************
56  * CONSTANTS
57  */
58 
64 #define GATT_PERMIT_READ 0x01
65 #define GATT_PERMIT_WRITE 0x02
66 #define GATT_PERMIT_AUTHEN_READ 0x04
67 #define GATT_PERMIT_AUTHEN_WRITE 0x08
68 #define GATT_PERMIT_AUTHOR_READ 0x10
69 #define GATT_PERMIT_AUTHOR_WRITE 0x20
70 #define GATT_PERMIT_ENCRYPT_READ 0x40
71 #define GATT_PERMIT_ENCRYPT_WRITE 0x80
72 
74 #if !defined( GATT_MAX_NUM_PREPARE_WRITES )
75  #define GATT_MAX_NUM_PREPARE_WRITES 5
76 #endif
77 
81 #define GATT_MIN_ENCRYPT_KEY_SIZE 7
82 #define GATT_MAX_ENCRYPT_KEY_SIZE 16
83 
85 #define GATT_MAX_ATTR_SIZE 512
86 
87 #define GATT_BASE_METHOD 0x40
88 
89 #define GATT_INVALID_HANDLE 0x0000
90 #define GATT_MIN_HANDLE 0x0001
91 #define GATT_MAX_HANDLE 0xFFFF
92 
93 #define GATT_ATTR_HANDLE_SIZE 0x02
94 
95 #define GATT_MAX_MTU 0xFFFF
96 
97  // end of ATT_GATT_Constants
98 
99 /*********************************************************************
100  * VARIABLES
101  */
102 
103 /*********************************************************************
104  * MACROS
105  */
106 
108 
109 // Attribute Access Permissions
110 #define gattPermitRead( a ) ( (a) & GATT_PERMIT_READ )
111 #define gattPermitWrite( a ) ( (a) & GATT_PERMIT_WRITE )
112 #define gattPermitEncryptRead( a ) ( (a) & GATT_PERMIT_ENCRYPT_READ )
113 #define gattPermitEncryptWrite( a ) ( (a) & GATT_PERMIT_ENCRYPT_WRITE )
114 #define gattPermitAuthorRead( a ) ( (a) & GATT_PERMIT_AUTHOR_READ )
115 #define gattPermitAuthorWrite( a ) ( (a) & GATT_PERMIT_AUTHOR_WRITE )
116 #define gattPermitAuthenRead( a ) ( (a) & GATT_PERMIT_AUTHEN_READ )
117 #define gattPermitAuthenWrite( a ) ( (a) & GATT_PERMIT_AUTHEN_WRITE )
118 
119 // Check for different UUID types
120 #define gattPrimaryServiceType( t ) ( MAP_ATT_CompareUUID( primaryServiceUUID, ATT_BT_UUID_SIZE, \
121  (t).uuid, (t).len ) )
122 #define gattSecondaryServiceType( t ) ( MAP_ATT_CompareUUID( secondaryServiceUUID, ATT_BT_UUID_SIZE, \
123  (t).uuid, (t).len ) )
124 #define gattCharacterType( t ) ( MAP_ATT_CompareUUID( characterUUID, ATT_BT_UUID_SIZE, \
125  (t).uuid, (t).len ) )
126 #define gattIncludeType( t ) ( MAP_ATT_CompareUUID( includeUUID, ATT_BT_UUID_SIZE, \
127  (t).uuid, (t).len ) )
128 #define gattServiceType( t ) ( gattPrimaryServiceType( (t) ) || \
129  gattSecondaryServiceType( (t) ) )
130 
132 
133 /*********************************************************************
134  * TYPEDEFS
135  */
136  // end of ATT_GATT
138 
144 typedef struct
146 {
147  uint16 startHandle;
148  uint16 endHandle;
151 
153 typedef struct
154 {
158 
160 typedef struct
161 {
162  uint8 reliable;
164  uint16 lastOffset;
166 
168 typedef struct
169 {
170  uint8 reliable;
172  uint8 numReqs;
173  uint8 index;
174  uint8 flags;
177 
185 typedef union
186 {
187  // Request messages
203 
204  // Response messages
215 
216  // Indication and Notification messages
219 
220  // Locally-generated event messages
223 } gattMsg_t;
224 
231 typedef struct
232 {
234  uint16 connHandle;
235  uint8 method;
238  // end of ATT_GATT_events
240 
246 typedef struct
248 {
249  uint8 len;
250  const uint8 *uuid;
252 
260 typedef struct attAttribute_t
261 {
263  uint8 permissions;
264  uint16 handle;
265  uint8* const pValue;
269 
271 typedef struct
272 {
273  uint16 numAttrs;
274  uint8 encKeySize;
276 } gattService_t;
277  // end of ATT_GATT_Structs
279 
280 /*********************************************************************
281  * VARIABLES
282  */
283 
285 extern uint8 gattNumConns;
287 
293 /*********************************************************************
294  * API FUNCTIONS
295  */
296 
297 /*-------------------------------------------------------------------
298  * GATT Client Public APIs
299  */
300 
309 extern bStatus_t GATT_InitClient( void );
310 
319 extern void GATT_RegisterForInd( uint8 taskId );
320 
336 extern bStatus_t GATT_PrepareWriteReq( uint16 connHandle, attPrepareWriteReq_t *pReq, uint8 taskId );
337 
356 extern bStatus_t GATT_ExecuteWriteReq( uint16 connHandle, attExecuteWriteReq_t *pReq, uint8 taskId );
357 
358 /*-------------------------------------------------------------------
359  * GATT Server Public APIs
360  */
361 
371 extern bStatus_t GATT_InitServer( void );
372 
400 extern bStatus_t GATT_RegisterService( gattService_t *pService );
401 
414 extern bStatus_t GATT_DeregisterService( uint16 handle, gattService_t *pService );
415 
421 extern void GATT_RegisterForReq( uint8 taskId );
422 
436 extern bStatus_t GATT_VerifyReadPermissions( uint16 connHandle, uint8 permissions, uint16 service );
437 
452 extern bStatus_t GATT_VerifyWritePermissions( uint16 connHandle, uint8 permissions,
453  uint16 service, attWriteReq_t *pReq );
454 
468 extern uint8 GATT_ServiceChangedInd( uint16 connHandle, uint8 taskId );
469 
482 extern gattAttribute_t *GATT_FindHandleUUID( uint16 startHandle, uint16 endHandle, const uint8 *pUUID,
483  uint16 len, uint16 *pHandle );
493 extern gattAttribute_t *GATT_FindHandle( uint16 handle, uint16 *pHandle );
494 
506 extern gattAttribute_t *GATT_FindNextAttr( gattAttribute_t *pAttr, uint16 endHandle,
507  uint16 service, uint16 *pLastHandle );
508 
516 extern uint16 GATT_ServiceNumAttrs( uint16 handle );
517 
526 extern uint8 GATT_ServiceEncKeySize( uint16 handle );
527 
543 extern bStatus_t GATT_SendRsp( uint16 connHandle, uint8 method, gattMsg_t *pRsp );
544 
545 /*-------------------------------------------------------------------
546  * GATT Server Sub-Procedure APIs
547  */
548 
583 extern bStatus_t GATT_Indication( uint16 connHandle, attHandleValueInd_t *pInd,
584  uint8 authenticated, uint8 taskId );
585 
616 extern bStatus_t GATT_Notification( uint16 connHandle, attHandleValueNoti_t *pNoti,
617  uint8 authenticated );
618 
619 /*-------------------------------------------------------------------
620  * GATT Client Sub-Procedure APIs
621  */
622 
654 extern bStatus_t GATT_ExchangeMTU( uint16 connHandle, attExchangeMTUReq_t *pReq, uint8 taskId );
655 
689 extern bStatus_t GATT_DiscAllPrimaryServices( uint16 connHandle, uint8 taskId );
690 
730 extern bStatus_t GATT_DiscPrimaryServiceByUUID( uint16 connHandle, uint8 *pUUID,
731  uint8 len, uint8 taskId );
767 extern bStatus_t GATT_FindIncludedServices( uint16 connHandle, uint16 startHandle,
768  uint16 endHandle, uint8 taskId );
806 extern bStatus_t GATT_DiscAllChars( uint16 connHandle, uint16 startHandle,
807  uint16 endHandle, uint8 taskId );
845 extern bStatus_t GATT_DiscCharsByUUID( uint16 connHandle, attReadByTypeReq_t *pReq, uint8 taskId );
846 
884 extern bStatus_t GATT_DiscAllCharDescs( uint16 connHandle, uint16 startHandle,
885  uint16 endHandle, uint8 taskId );
926 extern bStatus_t GATT_ReadCharValue( uint16 connHandle, attReadReq_t *pReq, uint8 taskId );
927 
964 extern bStatus_t GATT_ReadUsingCharUUID( uint16 connHandle, attReadByTypeReq_t *pReq, uint8 taskId );
997 extern bStatus_t GATT_ReadLongCharValue( uint16 connHandle, attReadBlobReq_t *pReq, uint8 taskId );
998 
1033 extern bStatus_t GATT_ReadMultiCharValues( uint16 connHandle, attReadMultiReq_t *pReq, uint8 taskId );
1034 
1068 extern bStatus_t GATT_WriteNoRsp( uint16 connHandle, attWriteReq_t *pReq );
1069 
1108 extern bStatus_t GATT_SignedWriteNoRsp( uint16 connHandle, attWriteReq_t *pReq );
1109 
1147 extern bStatus_t GATT_WriteCharValue( uint16 connHandle, attWriteReq_t *pReq, uint8 taskId );
1148 
1186 extern bStatus_t GATT_WriteLongCharValue( uint16 connHandle, attPrepareWriteReq_t *pReq, uint8 taskId );
1187 
1234 extern bStatus_t GATT_ReliableWrites( uint16 connHandle, attPrepareWriteReq_t *pReqs,
1235  uint8 numReqs, uint8 flags, uint8 taskId );
1268 extern bStatus_t GATT_ReadCharDesc( uint16 connHandle, attReadReq_t *pReq, uint8 taskId );
1269 
1306 extern bStatus_t GATT_ReadLongCharDesc( uint16 connHandle, attReadBlobReq_t *pReq, uint8 taskId );
1307 
1342 extern bStatus_t GATT_WriteCharDesc( uint16 connHandle, attWriteReq_t *pReq, uint8 taskId );
1343 
1382 extern bStatus_t GATT_WriteLongCharDesc( uint16 connHandle, attPrepareWriteReq_t *pReq, uint8 taskId );
1383 
1384 /*-------------------------------------------------------------------
1385  * GATT Client and Server Common APIs
1386  */
1387 
1402 extern void GATT_RegisterForMsgs( uint8 taskID );
1403 
1416 extern bStatus_t GATT_NotifyEvent( uint16 connHandle, uint8 status, uint8 method, gattMsg_t *pMsg );
1417 
1424 extern void GATT_UpdateMTU( uint16 connHandle, uint16 mtuSize );
1425 
1426 /*-------------------------------------------------------------------
1427  * GATT Buffer Management APIs
1428  */
1429 
1445 extern void *GATT_bm_alloc( uint16 connHandle, uint8 opcode, uint16 size, uint16 *pSizeAlloc );
1446 
1453 extern void GATT_bm_free( gattMsg_t *pMsg, uint8 opcode );
1454 
1456 
1457 /*-------------------------------------------------------------------
1458  * GATT Flow Control APIs
1459  */
1460 
1474 extern void GATT_SetHostToAppFlowCtrl( uint16 heapSize, uint8 flowCtrlMode );
1475 
1484 extern void GATT_AppCompletedMsg( gattMsgEvent_t *pMsg );
1485 
1486 /*-------------------------------------------------------------------
1487  * Internal API - This function is only called from GATT Qualification modules.
1488  */
1489 
1497 extern void GATT_SetNextHandle( uint16 handle );
1498 
1506 extern uint16 GATT_GetNextHandle( void );
1507 
1508 /*-------------------------------------------------------------------
1509  * TASK API - These functions must only be called by OSAL.
1510  */
1511 
1521 extern void GATT_Init( uint8 taskId );
1522 
1533 extern uint16 GATT_ProcessEvent( uint8 taskId, uint16 events );
1534 
1536 
1537 /*********************************************************************
1538 *********************************************************************/
1539 
1540 #ifdef __cplusplus
1541 }
1542 #endif
1543 
1544 #endif /* GATT_H */
1545  // end of ATT_GATT
GATT Read By Type Request format.
Definition: gatt.h:153
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:195
gattAttrType_t type
Attribute type (2 or 16 octet UUIDs)
Definition: gatt.h:262
Exchange MTU Response format.
Definition: att.h:346
uint8 index
Index of last Prepare Write Request sent.
Definition: gatt.h:173
Read Request.
Definition: att.h:450
attHandleValueNoti_t handleValueNoti
ATT Handle Value Notification.
Definition: gatt.h:217
Find Information Response format.
Definition: att.h:381
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:206
attFindByTypeValueReq_t findByTypeValueReq
ATT Find By Type Value Request.
Definition: gatt.h:190
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:171
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:168
Find Information Request format.
Definition: att.h:356
Read Response.
Definition: att.h:460
uint8 encKeySize
Minimum encryption key size required by service (7-16 bytes)
Definition: gatt.h:274
GATT Attribute Type format.
Definition: gatt.h:247
GATT Write Long Request format. Do not change the order of the members.
Definition: gatt.h:160
void GATT_RegisterForReq(uint8 taskId)
Register to receive incoming ATT Requests.
uint16 handle
Attribute handle - assigned internally by attribute server.
Definition: gatt.h:264
bStatus_t GATT_DiscAllPrimaryServices(uint16 connHandle, uint8 taskId)
Discovery All Primary Services.
Error Response format.
Definition: att.h:324
attPrepareWriteReq_t prepareWriteReq
ATT Prepare Write Request.
Definition: gatt.h:197
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:212
attReadBlobRsp_t readBlobRsp
ATT Read Blob Response.
Definition: gatt.h:211
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:214
Find By Type Value Request format.
Definition: att.h:393
const uint8 * uuid
Pointer to UUID.
Definition: gatt.h:250
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:207
uint16 endHandle
Last requested handle number.
Definition: gatt.h:148
gattReadByTypeReq_t gattReadByTypeReq
GATT Read By Type Request.
Definition: gatt.h:200
Write Request format.
Definition: att.h:539
uint16 lastOffset
Offset of last Prepare Write Request sent.
Definition: gatt.h:164
bStatus_t GATT_ReadCharValue(uint16 connHandle, attReadReq_t *pReq, uint8 taskId)
Read Characteristic Value.
attReadBlobReq_t readBlobReq
ATT Read Blob Request.
Definition: gatt.h:193
uint8 reliable
Whether reliable writes requested (always FALSE for Write Long)
Definition: gatt.h:162
attExchangeMTUReq_t exchangeMTUReq
ATT Exchange MTU Request.
Definition: gatt.h:188
uint16 connHandle
Connection message was received on.
Definition: gatt.h:234
attReadReq_t readReq
ATT Read Request.
Definition: gatt.h:192
attReadByTypeReq_t readByTypeReq
ATT Read By Type Request.
Definition: gatt.h:191
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:185
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:172
attFindInfoReq_t findInfoReq
ATT Find Information Request.
Definition: gatt.h:189
Read By Group Type Response format.
Definition: att.h:527
attErrorRsp_t errorRsp
ATT Error Response.
Definition: gatt.h:205
ATT MTU Updated Event message format.
Definition: att.h:642
attWriteReq_t writeReq
ATT Write Request.
Definition: gatt.h:196
bStatus_t GATT_InitClient(void)
Initialize the Generic Attribute Profile Client.
uint16 startHandle
First requested handle number (must be first field)
Definition: gatt.h:147
attHandleValueInd_t handleValueInd
Att Handle Value Indication.
Definition: gatt.h:218
gattAttribute_t * attrs
Array of attribute records;.
Definition: gatt.h:275
uint8 GATT_ServiceChangedInd(uint16 connHandle, uint8 taskId)
Send out a Service Changed Indication.
Attribute Type format (2 or 16 octet UUID).
Definition: att.h:302
Read Multiple Response format.
Definition: att.h:504
Read Blob Response format.
Definition: att.h:482
attAttrType_t value
Primary service UUID value (2 or 16 octets)
Definition: gatt.h:149
GATT Find By Type Value Request format.
Definition: gatt.h:145
uint8 discCharsByUUID
Whether this is a GATT Discover Characteristics by UUID sub-procedure.
Definition: gatt.h:155
attExecuteWriteReq_t executeWriteReq
ATT Execute Write Request.
Definition: gatt.h:198
uint8 *const pValue
Definition: gatt.h:265
bStatus_t GATT_Notification(uint16 connHandle, attHandleValueNoti_t *pNoti, uint8 authenticated)
Send a GATT Notification.
Read Blob Request format.
Definition: att.h:471
gattFindByTypeValueReq_t gattFindByTypeValueReq
GATT Find By Type Value Request.
Definition: gatt.h:199
Find By Type Value Response format.
Definition: att.h:414
ATT Flow Control Violated Event message format.
Definition: att.h:626
uint8 permissions
Attribute permissions.
Definition: gatt.h:263
Read By Type Request format.
Definition: att.h:425
Read Multiple Request format.
Definition: att.h:493
bStatus_t GATT_ReadLongCharDesc(uint16 connHandle, attReadBlobReq_t *pReq, uint8 taskId)
Read Long Characteristic Descriptor.
bStatus_t GATT_ExchangeMTU(uint16 connHandle, attExchangeMTUReq_t *pReq, uint8 taskId)
Exchange MTU Request.
Handle Value Indication format.
Definition: att.h:602
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:236
attReadByGrpTypeRsp_t readByGrpTypeRsp
ATT Read By Group Type Response.
Definition: gatt.h:213
Type definitions and macros for BLE stack.
Handle Value Notification format.
Definition: att.h:590
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:209
uint8 flags
Definition: gatt.h:174
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:110
attFindByTypeValueRsp_t findByTypeValueRsp
ATT Find By Type Value Response.
Definition: gatt.h:208
uint8 reliable
Whether reliable writes requested (always TRUE for Reliable Writes)
Definition: gatt.h:170
void GATT_RegisterForMsgs(uint8 taskID)
GATT Register for Messages.
attReadMultiReq_t readMultiReq
ATT Read Multiple Request.
Definition: gatt.h:194
attFlowCtrlViolatedEvt_t flowCtrlEvt
ATT Flow Control Violated Event.
Definition: gatt.h:221
Exchange MTU Request format.
Definition: att.h:336
bStatus_t GATT_ReadCharDesc(uint16 connHandle, attReadReq_t *pReq, uint8 taskId)
Read Characteristic Descriptor.
attPrepareWriteReq_t req
ATT Prepare Write Request.
Definition: gatt.h:163
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...
bStatus_t GATT_VerifyReadPermissions(uint16 connHandle, uint8 permissions, uint16 service)
Verify the permissions of an attribute for reading.
GATT GATT_MSG_EVENT message format.
Definition: gatt.h:231
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:271
Read By Group Type Request format.
Definition: att.h:515
gattWriteLongReq_t gattWriteLongReq
GATT Long Write Request.
Definition: gatt.h:201
GATT Attribute format.
Definition: gatt.h:260
Status_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:243
void GATT_bm_free(gattMsg_t *pMsg, uint8 opcode)
GATT implementation of the de-allocator functionality.
Read By Type Response format.
Definition: att.h:437
osal_event_hdr_t hdr
GATT_MSG_EVENT and status.
Definition: gatt.h:233
Prepare Write Response format.
Definition: att.h:566
Prepare Write Request format.
Definition: att.h:553
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:235
uint8 len
Length of UUID (2 or 6)
Definition: gatt.h:249
bStatus_t GATT_VerifyWritePermissions(uint16 connHandle, uint8 permissions, uint16 service, attWriteReq_t *pReq)
Verify the permissions of an attribute for writing.
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:273
attMtuUpdatedEvt_t mtuEvt
ATT MTU Updated Event.
Definition: gatt.h:222
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:202
Execute Write Request format.
Definition: att.h:579
attReadByTypeReq_t req
Read By Type Request.
Definition: gatt.h:156
bStatus_t GATT_ReadMultiCharValues(uint16 connHandle, attReadMultiReq_t *pReq, uint8 taskId)
Read Multiple Characteristic Values.
attReadRsp_t readRsp
ATT Read Response.
Definition: gatt.h:210
void GATT_UpdateMTU(uint16 connHandle, uint16 mtuSize)
Update ATT_MTU size for a given connection.
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 2016, Texas Instruments Incorporated