TI BLE-Stack for Bluetooth 4.2 API Documentation  3.01.00.07
Typedefs
GATT Server App Callbacks

Typedefs

typedef bStatus_t(* pfnGATTAuthorizeAttrCB_t) (uint16 connHandle, gattAttribute_t *pAttr, uint8 opcode)
 Callback function prototype to authorize a Read or Write operation on a given attribute. More...
 
typedef bStatus_t(* pfnGATTReadAttrCB_t) (uint16 connHandle, gattAttribute_t *pAttr, uint8 *pValue, uint16 *pLen, uint16 offset, uint16 maxLen, uint8 method)
 Callback function prototype to read an attribute value. More...
 
typedef bStatus_t(* pfnGATTWriteAttrCB_t) (uint16 connHandle, gattAttribute_t *pAttr, uint8 *pValue, uint16 len, uint16 offset, uint8 method)
 Callback function prototype to write an attribute value. More...
 

Detailed Description

Typedef Documentation

§ pfnGATTAuthorizeAttrCB_t

typedef bStatus_t(* pfnGATTAuthorizeAttrCB_t) (uint16 connHandle, gattAttribute_t *pAttr, uint8 opcode)

Callback function prototype to authorize a Read or Write operation on a given attribute.

Parameters
connHandle- connection request was received on
pAttr- pointer to attribute
opcode- request opcode (ATT_READ_REQ or ATT_WRITE_REQ)
Returns
SUCCESS : Operation authorized.
ATT_ERR_INSUFFICIENT_AUTHOR

§ pfnGATTReadAttrCB_t

typedef bStatus_t(* pfnGATTReadAttrCB_t) (uint16 connHandle, gattAttribute_t *pAttr, uint8 *pValue, uint16 *pLen, uint16 offset, uint16 maxLen, uint8 method)

Callback function prototype to read an attribute value.

Note
blePending can be returned ONLY for the following read operations:
If blePending is returned then it's the responsibility of the application to respond to ATT_READ_REQ and ATT_READ_BLOB_REQ message with ATT_READ_RSP and ATT_READ_BLOB_RSP message respectively.
Payload 'pValue' used with ATT_READ_RSP and ATT_READ_BLOB_RSP must be allocated using GATT_bm_alloc().
Parameters
connHandle- connection request was received on
pAttr- pointer to attribute
pValue- pointer to data to be read (to be returned)
pLen- length of data (to be returned)
offset- offset of the first octet to be read
maxLen- maximum length of data to be read
method- type of read message
Returns
SUCCESS : Read was successfully
blePending : A response is pending for client.
Error, otherwise: ATT Error Codes.

§ pfnGATTWriteAttrCB_t

typedef bStatus_t(* pfnGATTWriteAttrCB_t) (uint16 connHandle, gattAttribute_t *pAttr, uint8 *pValue, uint16 len, uint16 offset, uint8 method)

Callback function prototype to write an attribute value.

Note
blePending can be returned ONLY for the following write operations:
If blePending is returned then it's the responsibility of the application to:
  1. respond to ATT_WRITE_REQ and ATT_EXECUTE_WRITE_REQ message with ATT_WRITE_RSP and ATT_EXECUTE_WRITE_RSP message respectively
  2. free each request payload 'pValue' using BM_free().
ATT_WRITE_CMD does NOT require a response message.
Parameters
connHandle- connection request was received on
pAttr- pointer to attribute
pValue- pointer to data to be written
pLen- length of data
offset- offset of the first octet to be written
method- type of write message
Returns
SUCCESS : Write was successfully.
blePending : A response is pending for this client.
Error, otherwise: ATT Error Codes.
Copyright 2017, Texas Instruments Incorporated