TI BLE-Stack for Bluetooth 4.2 API Documentation  3.01.00.07
Data Structures | Macros | Functions
att.h File Reference

Detailed Description

ATT layer interface.

ATT Methods

Go to the source code of this file.

Data Structures

struct  attAttrBtType_t
 Attribute Type format (2-octet Bluetooth UUID). More...
 
struct  attAttrType_t
 Attribute Type format (2 or 16 octet UUID). More...
 
struct  attErrorRsp_t
 Error Response format. More...
 
struct  attExchangeMTUReq_t
 Exchange MTU Request format. More...
 
struct  attExchangeMTURsp_t
 Exchange MTU Response format. More...
 
struct  attExecuteWriteReq_t
 Execute Write Request format. More...
 
struct  attFindByTypeValueReq_t
 Find By Type Value Request format. More...
 
struct  attFindByTypeValueRsp_t
 Find By Type Value Response format. More...
 
struct  attFindInfoReq_t
 Find Information Request format. More...
 
struct  attFindInfoRsp_t
 Find Information Response format. More...
 
struct  attFlowCtrlViolatedEvt_t
 ATT Flow Control Violated Event message format. More...
 
struct  attHandleBtUUID_t
 Handle and its 16-bit Bluetooth UUIDs. More...
 
struct  attHandlesInfo_t
 Handles Information format. More...
 
struct  attHandleUUID_t
 Handle and its 128-bit UUID. More...
 
struct  attHandleValueInd_t
 Handle Value Indication format. More...
 
struct  attHandleValueNoti_t
 Handle Value Notification format. More...
 
union  attMsg_t
 ATT Message format. More...
 
struct  attMtuUpdatedEvt_t
 ATT MTU Updated Event message format. More...
 
struct  attPacket_t
 Attribute Protocol PDU format. More...
 
struct  attPrepareWriteReq_t
 Prepare Write Request format. More...
 
struct  attPrepareWriteRsp_t
 Prepare Write Response format. More...
 
struct  attReadBlobReq_t
 Read Blob Request format. More...
 
struct  attReadBlobRsp_t
 Read Blob Response format. More...
 
struct  attReadByGrpTypeReq_t
 Read By Group Type Request format. More...
 
struct  attReadByGrpTypeRsp_t
 Read By Group Type Response format. More...
 
struct  attReadByTypeReq_t
 Read By Type Request format. More...
 
struct  attReadByTypeRsp_t
 Read By Type Response format. More...
 
struct  attReadMultiReq_t
 Read Multiple Request format. More...
 
struct  attReadMultiRsp_t
 Read Multiple Response format. More...
 
struct  attReadReq_t
 Read Request. More...
 
struct  attReadRsp_t
 Read Response. More...
 
struct  attWriteReq_t
 Write Request format. More...
 

Macros

#define ATT_AUTHEN_SIG_FLAG_BIT   0x80
 Authentication Signature Flag (bit 7)
 
#define ATT_AUTHEN_SIG_LEN   12
 Length of Authentication Signature field.
 
#define ATT_BT_UUID_SIZE   2
 Size of 16-bit Bluetooth UUID.
 
#define ATT_CANCEL_PREPARED_WRITES   0x00
 Cancel all prepared writes.
 
#define ATT_CMD_FLAG_BIT   0x40
 Command Flag (bit 6)
 
#define ATT_ERR_ATTR_NOT_FOUND   0x0a
 No attribute found within the given attribute handle range.
 
#define ATT_ERR_ATTR_NOT_LONG   0x0b
 Attribute cannot be read or written using the Read Blob Request or Prepare Write Request.
 
#define ATT_ERR_INSUFFICIENT_AUTHEN   0x05
 The attribute requires authentication before it can be read or written.
 
#define ATT_ERR_INSUFFICIENT_AUTHOR   0x08
 The attribute requires an authorization before it can be read or written.
 
#define ATT_ERR_INSUFFICIENT_ENCRYPT   0x0f
 The attribute requires encryption before it can be read or written.
 
#define ATT_ERR_INSUFFICIENT_KEY_SIZE   0x0c
 The Encryption Key Size used for encrypting this link is insufficient.
 
#define ATT_ERR_INSUFFICIENT_RESOURCES   0x11
 Insufficient Resources to complete the request.
 
#define ATT_ERR_INVALID_HANDLE   0x01
 Attribute handle value given was not valid on this attribute server.
 
#define ATT_ERR_INVALID_OFFSET   0x07
 Offset specified was past the end of the attribute.
 
#define ATT_ERR_INVALID_PDU   0x04
 The attribute PDU was invalid.
 
#define ATT_ERR_INVALID_VALUE   0x80
 The attribute value is invalid for the operation.
 
#define ATT_ERR_INVALID_VALUE_SIZE   0x0d
 The attribute value length is invalid for the operation.
 
#define ATT_ERR_PREPARE_QUEUE_FULL   0x09
 Too many prepare writes have been queued.
 
#define ATT_ERR_READ_NOT_PERMITTED   0x02
 Attribute cannot be read.
 
#define ATT_ERR_UNLIKELY   0x0e
 The attribute request that was requested has encountered an error that was very unlikely, and therefore could not be completed as requested.
 
#define ATT_ERR_UNSUPPORTED_GRP_TYPE   0x10
 The attribute type is not a supported grouping attribute as defined by a higher layer specification.
 
#define ATT_ERR_UNSUPPORTED_REQ   0x06
 Attribute server doesn't support the request received from the attribute client.
 
#define ATT_ERR_WRITE_NOT_PERMITTED   0x03
 Attribute cannot be written.
 
#define ATT_ERROR_RSP   0x01
 ATT Error Response. This method is passed as a gattMsgEvent_t defined as attErrorRsp_t.
 
#define ATT_ERROR_RSP_SIZE   4
 Length of Error Response: Command opcode in error (1) + Attribute handle in error (2) + Status code (1)
 
#define ATT_EXCHANGE_MTU_REQ   0x02
 ATT Exchange MTU Request. This method is passed as a GATT message defined as attExchangeMTUReq_t.
 
#define ATT_EXCHANGE_MTU_REQ_SIZE   2
 Length of Exchange MTU Request: client receive MTU size (2)
 
#define ATT_EXCHANGE_MTU_RSP   0x03
 ATT Exchange MTU Response. This method is passed as a GATT message defined as attExchangeMTURsp_t.
 
#define ATT_EXCHANGE_MTU_RSP_SIZE   2
 Length of Exchange MTU Response: server receive MTU size (2)
 
#define ATT_EXECUTE_WRITE_REQ   0x18
 ATT Execute Write Request. This method is passed as a GATT message defined as attExecuteWriteReq_t.
 
#define ATT_EXECUTE_WRITE_REQ_SIZE   1
 Length of Execute Write Request: Flags (1)
 
#define ATT_EXECUTE_WRITE_RSP   0x19
 ATT Execute Write Response. This method is passed as a GATT message defines as attHandleValueNoti_t.
 
#define ATT_FIND_BY_TYPE_VALUE_REQ   0x06
 ATT Find By Type Value Request. This method is passed as a GATT message defined as attFindByTypeValueReq_t.
 
#define ATT_FIND_BY_TYPE_VALUE_REQ_FIXED_SIZE   6
 Length of Find By Type Value Request's fixed fields: Start handle (2) + End handle (2) + Type (2)
 
#define ATT_FIND_BY_TYPE_VALUE_REQ_HDR_SIZE   ( ATT_OPCODE_SIZE + ATT_FIND_BY_TYPE_VALUE_REQ_FIXED_SIZE )
 Length of Find By Type Value Request's Header.
 
#define ATT_FIND_BY_TYPE_VALUE_RSP   0x07
 ATT Find By Type Value Response. This method is passed as a GATT message defined as attFindByTypeValueRsp_t.
 
#define ATT_FIND_INFO_REQ   0x04
 ATT Find Information Request. This method is passed as a GATT message defined as attFindInfoReq_t.
 
#define ATT_FIND_INFO_REQ_FIXED_SIZE   4
 Length of Find Information Request's fixed fields: First handle number (2) + Last handle number (2)
 
#define ATT_FIND_INFO_RSP   0x05
 ATT Find Information Response. This method is passed as a GATT message defined as attFindInfoRsp_t.
 
#define ATT_FIND_INFO_RSP_FIXED_SIZE   1
 Length of Find Information Response's fixed field: Format (1)
 
#define ATT_FIND_INFO_RSP_HDR_SIZE   ( ATT_OPCODE_SIZE + ATT_FIND_INFO_RSP_FIXED_SIZE )
 Length of Find Information Response's Header.
 
#define ATT_FLOW_CTRL_VIOLATED_EVENT   0x7E
 Sent when ATT flow control is violated on a connection. This event is sent as an OSAL message defined as attFlowCtrlViolatedEvt_t.
 
#define ATT_HANDLE_BT_UUID_TYPE   0x01
 Handle and 16-bit Bluetooth UUID.
 
#define ATT_HANDLE_UUID_TYPE   0x02
 Handle and 128-bit UUID.
 
#define ATT_HANDLE_VALUE_CFM   0x1e
 ATT Handle Value Confirmation. This method is passed as a GATT message.
 
#define ATT_HANDLE_VALUE_IND   0x1d
 ATT Handle Value Indication. This method is passed as a GATT message defined as attHandleValueInd_t.
 
#define ATT_HANDLE_VALUE_IND_FIXED_SIZE   2
 Length of Handle Value Indication's fixed size: Attribute Handle (2)
 
#define ATT_HANDLE_VALUE_IND_HDR_SIZE   ( ATT_OPCODE_SIZE + ATT_HANDLE_VALUE_IND_FIXED_SIZE )
 Size of Indication header.
 
#define ATT_HANDLE_VALUE_NOTI   0x1b
 ATT Handle Value Notification. This method is passed as a GATT message defined as attErrorRsp_t.
 
#define ATT_MAX_MTU_SIZE   (255-L2CAP_HDR_SIZE)
 Maximum ATT MTU size.
 
#define ATT_METHOD_BITS   0x3f
 Method (bits 5-0)
 
#define ATT_MIN_NUM_HANDLES   2
 Minimum number of handles in a single Read Multiple Request.
 
#define ATT_MSG_TIMEOUT   30
 ATT Response or Confirmation timeout.
 
#define ATT_MTU_SIZE   L2CAP_MTU_SIZE
 Minimum ATT MTU size.
 
#define ATT_MTU_UPDATED_EVENT   0x7F
 Sent when MTU is updated for a connection. This event is sent as an OSAL message defined as attMtuUpdatedEvt_t.
 
#define ATT_OPCODE_SIZE   1
 Length of opcode field: Opcode (1)
 
#define ATT_PREPARE_WRITE_REQ   0x16
 ATT Prepare Write Request. This method is passed as a GATT message defined as attPrepareWriteReq_t.
 
#define ATT_PREPARE_WRITE_REQ_FIXED_SIZE   4
 Length of Prepare Write Request's fixed fields: Attribute Handle (2) + Value Offset (2)
 
#define ATT_PREPARE_WRITE_REQ_HDR_SIZE   ( ATT_OPCODE_SIZE + ATT_PREPARE_WRITE_REQ_FIXED_SIZE )
 Size of Prepare Write Request Header.
 
#define ATT_PREPARE_WRITE_RSP   0x17
 ATT Prepare Write Response. This method is passed as a GATT message defined as attPrepareWriteRsp_t.
 
#define ATT_PREPARE_WRITE_RSP_FIXED_SIZE   4
 Length of Prepare Write Response's fixed size: Attribute Handle (2) + Value Offset (2)
 
#define ATT_READ_BLOB_REQ   0x0c
 ATT Read Blob Request. This method is passed as a GATT message defined as attReadBlobReq_t.
 
#define ATT_READ_BLOB_REQ_SIZE   4
 Length of Read Blob Request: Attribute Handle (2) + Value Offset (2)
 
#define ATT_READ_BLOB_RSP   0x0d
 ATT Read Blob Response. This method is passed as a GATT message defined as attReadBlobRsp_t.
 
#define ATT_READ_BY_GRP_TYPE_REQ   0x10
 ATT Read By Group Type Request. This method is passed as a GATT message defined as attReadByGrpTypeReq_t.
 
#define ATT_READ_BY_GRP_TYPE_RSP   0x11
 ATT Read By Group Type Response. This method is passed as a GATT message defined as attReadByGrpTypeRsp_t.
 
#define ATT_READ_BY_GRP_TYPE_RSP_FIXED_SIZE   1
 Length of Read By Type Response's fixed fields: Length (1)
 
#define ATT_READ_BY_GRP_TYPE_RSP_HDR_SIZE   ( ATT_OPCODE_SIZE + ATT_READ_BY_GRP_TYPE_RSP_FIXED_SIZE )
 Size of Read by Group Type Response Header.
 
#define ATT_READ_BY_TYPE_REQ   0x08
 ATT Read By Type Request. This method is passed as a GATT message defined as attReadByTypeReq_t.
 
#define ATT_READ_BY_TYPE_REQ_FIXED_SIZE   4
 Length of Read By Type Request's fixed fields: First handle number (2) + Last handle number (2)
 
#define ATT_READ_BY_TYPE_REQ_HDR_SIZE   ( ATT_OPCODE_SIZE + ATT_READ_BY_TYPE_REQ_FIXED_SIZE )
 Size of Read by Type Request Header.
 
#define ATT_READ_BY_TYPE_RSP   0x09
 ATT Read By Type Response. This method is passed as a GATT message defined as attReadByTypeRsp_t.
 
#define ATT_READ_BY_TYPE_RSP_FIXED_SIZE   1
 Length of Read By Type Response's fixed fields: Length (1)
 
#define ATT_READ_BY_TYPE_RSP_HDR_SIZE   ( ATT_OPCODE_SIZE + ATT_READ_BY_TYPE_RSP_FIXED_SIZE )
 Size of Read by Type Response Header.
 
#define ATT_READ_MULTI_REQ   0x0e
 ATT Read Multiple Request. This method is passed as a GATT message defined as attReadMultiReq_t.
 
#define ATT_READ_MULTI_RSP   0x0f
 ATT Read Multiple Response. This method is passed as a GATT message defined as attReadMultiRsp_t.
 
#define ATT_READ_REQ   0x0a
 ATT Read Request. This method is passed as a GATT message defined as attReadReq_t.
 
#define ATT_READ_REQ_SIZE   2
 Length of Read Request: Attribute Handle (2)
 
#define ATT_READ_RSP   0x0b
 ATT Read Response. This method is passed as a GATT message defined as attReadRsp_t.
 
#define ATT_SIG_INVALID   0x02
 Included signature not valid.
 
#define ATT_SIG_NOT_INCLUDED   0x00
 Signature not included.
 
#define ATT_SIG_VALID   0x01
 Included signature valid.
 
#define ATT_SIGNED_WRITE_CMD   0xD2
 ATT Signed Write Command.
 
#define ATT_UUID_SIZE   16
 Size of 128-bit UUID.
 
#define ATT_WRITE_CMD   0x52
 ATT Write Command.
 
#define ATT_WRITE_COMMAND(method, cmd)   ( ( (method) == ATT_WRITE_REQ ) && ( (cmd) == TRUE ) )
 ATT Write Command.
 
#define ATT_WRITE_PREPARED_VALUES   0x01
 Immediately write all pending prepared values.
 
#define ATT_WRITE_REQ   0x12
 ATT Write Request. This method is passed as a GATT message defined as attWriteReq_t.
 
#define ATT_WRITE_REQ_FIXED_SIZE   2
 Length of Write Request's fixed field: Attribute Handle (2)
 
#define ATT_WRITE_REQ_FIXED_SIZE   2
 Length of Write Request's fixed field: Attribute Handle (2)
 
#define ATT_WRITE_REQ_HDR_SIZE   ( ATT_OPCODE_SIZE + ATT_WRITE_REQ_FIXED_SIZE )
 Size of Write Request Header.
 
#define ATT_WRITE_RSP   0x13
 ATT Write Response. This method is passed as a GATT message.
 

Functions

bStatus_t ATT_ErrorRsp (uint16 connHandle, attErrorRsp_t *pRsp)
 Send Error Response. More...
 
bStatus_t ATT_ExchangeMTUReq (uint16 connHandle, attExchangeMTUReq_t *pReq)
 Send Exchange MTU Request. More...
 
bStatus_t ATT_ExchangeMTURsp (uint16 connHandle, attExchangeMTURsp_t *pRsp)
 Send Exchange MTU Response. More...
 
bStatus_t ATT_ExecuteWriteReq (uint16 connHandle, attExecuteWriteReq_t *pReq)
 Send Execute Write Request. More...
 
bStatus_t ATT_ExecuteWriteRsp (uint16 connHandle)
 Send Execute Write Response. More...
 
bStatus_t ATT_FindByTypeValueReq (uint16 connHandle, attFindByTypeValueReq_t *pReq)
 Send Find By Type Value Request. More...
 
bStatus_t ATT_FindByTypeValueRsp (uint16 connHandle, attFindByTypeValueRsp_t *pRsp)
 Send Find By Type Value Response. More...
 
bStatus_t ATT_FindInfoReq (uint16 connHandle, attFindInfoReq_t *pReq)
 Send Find Information Request. More...
 
bStatus_t ATT_FindInfoRsp (uint16 connHandle, attFindInfoRsp_t *pRsp)
 Send Find Information Response. More...
 
uint16 ATT_GetMTU (uint16 connHandle)
 This function is used to get the MTU size of a connection. More...
 
uint16 ATT_GetParamValue (void)
 Get a ATT Parameter value. More...
 
bStatus_t ATT_HandleValueCfm (uint16 connHandle)
 Send Handle Value Confirmation. More...
 
bStatus_t ATT_HandleValueInd (uint16 connHandle, attHandleValueInd_t *pInd)
 Send Handle Value Indication. More...
 
bStatus_t ATT_HandleValueNoti (uint16 connHandle, attHandleValueNoti_t *pNoti)
 Send Handle Value Notification. More...
 
bStatus_t ATT_PrepareWriteReq (uint16 connHandle, attPrepareWriteReq_t *pReq)
 Send Prepare Write Request. More...
 
bStatus_t ATT_PrepareWriteRsp (uint16 connHandle, attPrepareWriteRsp_t *pRsp)
 Send Prepare Write Response. More...
 
bStatus_t ATT_ReadBlobReq (uint16 connHandle, attReadBlobReq_t *pReq)
 Send Read Blob Request. More...
 
bStatus_t ATT_ReadBlobRsp (uint16 connHandle, attReadBlobRsp_t *pRsp)
 Send Read Blob Response. More...
 
bStatus_t ATT_ReadByGrpTypeReq (uint16 connHandle, attReadByGrpTypeReq_t *pReq)
 Send Read By Group Type Request. More...
 
bStatus_t ATT_ReadByGrpTypeRsp (uint16 connHandle, attReadByGrpTypeRsp_t *pRsp)
 Send Read By Group Type Respond. More...
 
bStatus_t ATT_ReadByTypeReq (uint16 connHandle, attReadByTypeReq_t *pReq)
 Send Read By Type Request. More...
 
bStatus_t ATT_ReadByTypeRsp (uint16 connHandle, attReadByTypeRsp_t *pRsp)
 Send Read By Type Respond. More...
 
bStatus_t ATT_ReadMultiReq (uint16 connHandle, attReadMultiReq_t *pReq)
 Send Read Multiple Request. More...
 
bStatus_t ATT_ReadMultiRsp (uint16 connHandle, attReadMultiRsp_t *pRsp)
 Send Read Multiple Response. More...
 
bStatus_t ATT_ReadReq (uint16 connHandle, attReadReq_t *pReq)
 Send Read Request. More...
 
bStatus_t ATT_ReadRsp (uint16 connHandle, attReadRsp_t *pRsp)
 Send Read Response. More...
 
void ATT_RegisterClient (attNotifyTxCB_t pfnNotifyTx)
 Register the client's notify Tx function with the ATT layer. More...
 
void ATT_RegisterServer (attNotifyTxCB_t pfnNotifyTx)
 Register the server's notify Tx function with the ATT layer. More...
 
void ATT_SetParamValue (uint16 value)
 Set a ATT Parameter value. Use this function to change the default ATT parameter values. More...
 
uint8 ATT_UpdateMTU (uint16 connHandle, uint16 MTU)
 This function is used to update the MTU size of a connection. More...
 
bStatus_t ATT_WriteReq (uint16 connHandle, attWriteReq_t *pReq)
 Send Write Request. More...
 
bStatus_t ATT_WriteRsp (uint16 connHandle)
 Send Write Response. More...
 
Copyright 2017, Texas Instruments Incorporated