Typedefs

GATT Server App Callback API Functions

Typedefs

typedef bStatus_t(* pfnGATTReadAttrCB_t )(uint16 connHandle, gattAttribute_t *pAttr, uint8 *pValue, uint8 *pLen, uint16 offset, uint8 maxLen)
 Callback function prototype to read an attribute value.
typedef bStatus_t(* pfnGATTWriteAttrCB_t )(uint16 connHandle, gattAttribute_t *pAttr, uint8 *pValue, uint8 len, uint16 offset)
 Callback function prototype to write an attribute value.
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.

Typedef Documentation

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: Authorization required.
typedef bStatus_t(* pfnGATTReadAttrCB_t)(uint16 connHandle, gattAttribute_t *pAttr, uint8 *pValue, uint8 *pLen, uint16 offset, uint8 maxLen)

Callback function prototype to read an attribute value.

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
Returns:
SUCCESS: Read was successfully.
Error, otherwise: ref ATT_ERR_CODE_DEFINES.
typedef bStatus_t(* pfnGATTWriteAttrCB_t)(uint16 connHandle, gattAttribute_t *pAttr, uint8 *pValue, uint8 len, uint16 offset)

Callback function prototype to write an attribute value.

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
Returns:
SUCCESS: Write was successfully.
Error, otherwise: ref ATT_ERR_CODE_DEFINES.