GATT

group group_ble_common_api_gatt_definitions

Contains the GATT specific definitions and data structures used in the GATT APIs.

Typedefs

typedef uint16_t cy_ble_uuid16_t

GATT 16 Bit UUID.

typedef uint16_t cy_ble_gatt_db_attr_handle_t

GATT BD Attribute Handle Type.

typedef cy_stc_ble_gattc_read_by_group_req_t cy_stc_ble_gattc_find_info_req_t

GATT find info request parameter.

typedef cy_stc_ble_gatt_write_param_t cy_stc_ble_gattc_write_req_t

Write request parameter.

typedef cy_stc_ble_gatt_prep_write_param_t cy_stc_ble_gattc_prep_write_req_t

Prepare Write request parameter.

typedef cy_stc_ble_gattc_write_req_t cy_stc_ble_gattc_write_cmd_req_t

Write command request to be sent to Server.

typedef cy_stc_ble_gattc_write_req_t cy_stc_ble_gattc_signed_write_cmd_req_t

Signed Write command request to be sent to Server.

typedef cy_stc_ble_gattc_stop_cmd_param_t cy_stc_ble_gattc_confirmation_req_t

Signed Write command request to be sent to Server.

typedef cy_stc_ble_gattc_write_req_t cy_stc_ble_gattc_handle_value_ntf_param_t

Handle value notification data received from server.

typedef cy_stc_ble_gattc_write_req_t cy_stc_ble_gattc_handle_value_ind_param_t

GATT handle value indication parameter received from server type.

typedef cy_stc_ble_gattc_read_by_grp_rsp_param_t cy_stc_ble_gattc_read_by_type_rsp_param_t

GATT read by type response received from server.

typedef cy_stc_ble_gattc_exec_write_req_t cy_stc_ble_gattc_exec_write_rsp_t

Execute Write response parameter.

typedef cy_stc_ble_gatts_db_attr_enable_info_t cy_stc_ble_gatts_db_attr_disable_info_t

GATT database attribute disable parameters.

typedef cy_stc_ble_gatts_att_value_t cy_stc_ble_char_ext_property_t

All descriptors following a characteristic value definition must be in following order:

  1. Characteristic Extended Property (If any)

  2. Characteristic User Description (If any)

  3. Client Characteristic Configuration (If any)

  4. Server Characteristic Configuration (If any)

  5. Characteristic Presentation Format (If any)

  6. Characteristic Aggregate Format (If any)Characteristic Extended Property

typedef cy_stc_ble_gatts_att_value_t cy_stc_ble_char_user_description_t

Characteristic User Description.

typedef cy_stc_ble_gatts_att_value_t cy_stc_ble_client_char_config_t

Client Characteristic Configuration.

typedef cy_stc_ble_gatts_att_value_t cy_stc_ble_server_char_config_t

Server Characteristic Configuration.

typedef cy_stc_ble_gatts_att_value_t cy_stc_ble_char_present_fmt_t

Characteristic Presentation Format.

typedef cy_stc_ble_gatts_att_value_t cy_stc_ble_char_aggregate_fmt_t

Characteristic Aggregate Format.

typedef cy_stc_ble_gatt_write_param_t cy_stc_ble_gatts_handle_value_ntf_t

Notification parameter.

typedef cy_stc_ble_gatt_write_param_t cy_stc_ble_gatts_handle_value_ind_t

Indication parameter.

typedef cy_stc_ble_gatt_write_param_t cy_stc_ble_gatts_write_cmd_req_param_t

Write command request parameter received from Client.

typedef cy_stc_ble_gatt_write_param_t cy_stc_ble_gatts_signed_write_cmd_req_param_t

Signed Write command request parameter received from Client.

Enums

enum cy_en_ble_gatt_pdu_t

cy_en_ble_gatt_pdu_t: ATT Opcode that has resulted in the error.

Values:

enumerator CY_BLE_GATT_ERROR_RSP

Error Response PDU.

enumerator CY_BLE_GATT_XCNHG_MTU_REQ

Exchange GATT MTU Request PDU.

enumerator CY_BLE_GATT_XCHNG_MTU_RSP

Exchange GATT MTU Response PDU.

enumerator CY_BLE_GATT_FIND_INFO_REQ

Find Information Request PDU.

enumerator CY_BLE_GATT_FIND_INFO_RSP

Find Information Response PDU.

enumerator CY_BLE_GATT_FIND_BY_TYPE_VALUE_REQ

Find By Type Value Request PDU.

enumerator CY_BLE_GATT_FIND_BY_TYPE_VALUE_RSP

Find By Type Value Response PDU.

enumerator CY_BLE_GATT_READ_BY_TYPE_REQ

Read By Type Request PDU.

enumerator CY_BLE_GATT_READ_BY_TYPE_RSP

Read By Type Response PDU.

enumerator CY_BLE_GATT_READ_REQ

Read Request PDU.

enumerator CY_BLE_GATT_READ_RSP

Read Response PDU.

enumerator CY_BLE_GATT_READ_BLOB_REQ

Read Blob Request PDU.

enumerator CY_BLE_GATT_READ_BLOB_RSP

Read Blob Response PDU.

enumerator CY_BLE_GATT_READ_MULTIPLE_REQ

Read Multiple Request PDU.

enumerator CY_BLE_GATT_READ_MULTIPLE_RSP

Read Multiple Response PDU.

enumerator CY_BLE_GATT_READ_BY_GROUP_REQ

Read Group Type Request PDU.

enumerator CY_BLE_GATT_READ_BY_GROUP_RSP

Read Group Type Response PDU.

enumerator CY_BLE_GATT_WRITE_REQ

Write Request PDU.

enumerator CY_BLE_GATT_WRITE_RSP

Write Response PDU.

enumerator CY_BLE_GATT_WRITE_CMD

Write Command PDU.

enumerator CY_BLE_GATT_PREPARE_WRITE_REQ

Prepare Write Request PDU.

enumerator CY_BLE_GATT_PREPARE_WRITE_RSP

Prepare Write Response PDU.

enumerator CY_BLE_GATT_EXECUTE_WRITE_REQ

Execute Write Request PDU.

enumerator CY_BLE_GATT_EXECUTE_WRITE_RSP

Execute Write Response PDU.

enumerator CY_BLE_GATT_HANDLE_VALUE_NTF

Handle Value Notification PDU.

enumerator CY_BLE_GATT_HANDLE_VALUE_IND

Handle Value Indication PDU.

enumerator CY_BLE_GATT_HANDLE_VALUE_CNF

Handle Value Confirmation PDU.

enumerator CY_BLE_GATT_SIGNED_WRITE_CMD

Signed Write Command PDU.

enumerator CY_BLE_GATT_UNKNOWN_PDU_IND

Unknown or Unhandled PDU.

enum cy_en_ble_gatt_err_code_t

cy_en_ble_gatt_err_code_t: GATT error codes.

Values:

enumerator CY_BLE_GATT_ERR_NONE

No Error.

enumerator CY_BLE_GATT_ERR_INVALID_HANDLE

Invalid Handle error code is used when the ATT handle in the ATT request PDU is invalid.

enumerator CY_BLE_GATT_ERR_READ_NOT_PERMITTED

Read Not Permitted error code is used when reading the value of an ATT handle is not permitted on the ATT server.

enumerator CY_BLE_GATT_ERR_WRITE_NOT_PERMITTED

Write Not Permitted error code is used when writing the value of an ATT handle is not permitted on the ATT Server.

enumerator CY_BLE_GATT_ERR_INVALID_PDU

Invalid PDU error code is used when the format of the PDU sent from the ATT Client is incorrect.

enumerator CY_BLE_GATT_ERR_INSUFFICIENT_AUTHENTICATION

Insufficient Authentication error code is used when an access to a handle is attempted on a unauthenticated link but the attribute requires that the link be authenticated before a client can access it.

enumerator CY_BLE_GATT_ERR_REQUEST_NOT_SUPPORTED

Request not supported error code is used when the server does not support the processing of an ATT request sent from the client.

enumerator CY_BLE_GATT_ERR_INVALID_OFFSET

Invalid Offset error code is used when the offset sent by the client in the Read blob/Prepare Write Request is invalid with respect to the length of the value in the server.

enumerator CY_BLE_GATT_ERR_INSUFFICIENT_AUTHORIZATION

Insufficient Authorization error code is used when the ATT server does not authorize the client and hence prohibits the client from reading the handle value.

enumerator CY_BLE_GATT_ERR_PREPARE_WRITE_QUEUE_FULL

Write queue full error code is used when there is no more space left in the prepare write queue on the server to entertain any more prepare writes from a client.

enumerator CY_BLE_GATT_ERR_ATTRIBUTE_NOT_FOUND

Attribute not found error is used when the ATT server cannot find any handle that belongs to the Attribute type in the given range of handles that the client specified in its request.

This error code can be sent to the client in response to the following request PDUs - Find Information, Find by Type Value, Read by Type, and Read by Group Type requests.

enumerator CY_BLE_GATT_ERR_ATTRIBUTE_NOT_LONG

Attribute Not Long error code is used when the client tries to read or write an attribute handle’s value that cannot be read or written through Read Blob or multiple prepare write requests.

enumerator CY_BLE_GATT_ERR_INSUFFICIENT_ENC_KEY_SIZE

Insufficient encryption key size error code is used when the client tries to access an Attribute Handle’s Value for which the link must be encrypted with a key of certain minimum key size and the current link is encrypted with a key of smaller size than the minimum required.

enumerator CY_BLE_GATT_ERR_INVALID_ATTRIBUTE_LEN

Invalid Attribute length error code is used when the attribute value’s length is not correct to process the request containing the value.

enumerator CY_BLE_GATT_ERR_UNLIKELY_ERROR

Unlikely error is used when the processing of the attribute request has encountered an error that is not covered by any other error code.

enumerator CY_BLE_GATT_ERR_INSUFFICIENT_ENCRYPTION

Insufficient encryption error code is used when the client tries to read or write an attribute handle that requires the link to be encrypted and the link is currently not encrypted.

enumerator CY_BLE_GATT_ERR_UNSUPPORTED_GROUP_TYPE

Unsupported Group Type error code is used when the attribute type requested in the Read by Group Type request is not a valid grouping attribute on the server.

enumerator CY_BLE_GATT_ERR_INSUFFICIENT_RESOURCE

Insufficient Resources error code is used when the ATT server does not have enough resources such as memory, etc., to process the request from the client.

enumerator CY_BLE_GATT_ERR_HEART_RATE_CONTROL_POINT_NOT_SUPPORTED

Other ATT Error Codes - Reserved: 0x12 to 0x7F are reserved for future use.

Application Specific Error Code Range: 0x80 to 0x9F Reserved: 0xA0 to 0xDF Common Profile & Service Error Code : 0xE0 to 0xFF Heart Rate Control Point Not Supported error code is used when a unsupported code is written into Heart Rate service Control Point characteristic.

enumerator CY_BLE_GATT_ERR_USER_DATA_ACCESS_NOT_PERMITTED

The user data access is not permitted (i.e., the user has not given consent to access the data).

enumerator CY_BLE_GATT_ERR_CPS_INAPPROPRIATE_CONNECTION_PARAMETERS

The notifications of the Cycling Power Vector characteristic cannot be sent due to inappropriate connection parameters.

enumerator CY_BLE_GATT_ERR_HTS_OUT_OF_RANGE

The value is considered invalid and outside of the range allowed by the characteristic.

enumerator CY_BLE_GATTS_ERR_PROCEDURE_ALREADY_IN_PROGRESS

Procedure Already in Progress error code is used when a profile or service request cannot be serviced because an operation that has been previously triggered is still in progress.

enumerator CY_BLE_GATT_ERR_OP_CODE_NOT_SUPPORTED

The Op Code Not Supported error code is used when an unsupported Op Code is written into the Control Point characteristic.

enumerator CY_BLE_GATT_ERR_MISSING_CRC

The Missing CRC error code is used when the CRC is missing in the incoming characteristic value.

enumerator CY_BLE_GATTS_ERR_CCCD_IMPROPERLY_CONFIGURED

Client Characteristic Configuration Descriptor Improperly Configured error code is used when a Client Characteristic Configuration descriptor is not configured according to the requirements of the profile or service.

enumerator CY_BLE_GATTS_ERR_OPERATION_FAILED

The Operation Failed error code is used when the device is unable to complete a procedure for any reason.

enumerator CY_BLE_GATT_ERR_INVALID_CRC

The Invalid CRC error code is used when the CRC is invalid in the incoming characteristic value.

enumerator CY_BLE_GATTS_ERR_HPS_INVALID_REQUEST

An HTTP Control Point request cannot be serviced because content of the URI, the HTTP Headers, or the HTTP Entity Body characteristics are not set correctly.

enumerator CY_BLE_GATTS_ERR_NETWORK_NOT_AVAILABLE

Network connection not available.

enumerator CY_BLE_GATT_ERR_ANS_COMMAND_NOT_SUPPORTED

Command Not Supported is returned by the Alert Notification Server when the Client sends an incorrect value of the Command ID or Category ID of to the Alert Notification Control Point Characteristic.

enumerator CY_BLE_GATT_ERR_ANCS_UNKNOWN_COMMAND

Unknown command error code is returned by the Apple Notification Center Server when the Client sends unknown command value of the Apple Notification Center Service Control Point Characteristic.

enumerator CY_BLE_GATT_ERR_ANCS_INVALID_COMMAND

Invalid command error code is returned by the Apple Notification Center Server when the Client sends an invalid command value of the Apple Notification Center Service Control Point Characteristic.

enumerator CY_BLE_GATT_ERR_ANCS_INVALID_PARAMETER

Invalid parameter error code is returned by the Apple Notification Center Server when the Client sends an invalid parameter value of the Apple Notification Center Service Control Point Characteristic.

enumerator CY_BLE_GATT_ERR_ANCS_ACTION_FAILED

Action failed error code is returned by the Apple Notification Center Server when some Apple Notification Center Service Control Point Characteristic command processing goes wrong.

enumerator CY_BLE_GATT_ERR_CCCD_IMPROPERLY_CONFIGURED

Client Characteristic Configuration Descriptor Improperly Configured error code is used when a Client Characteristic Configuration descriptor is not configured according to the requirements of the profile or service.

enumerator CY_BLE_GATT_ERR_PROCEDURE_ALREADY_IN_PROGRESS

The Procedure Already in Progress error code is used when a profile or service request cannot be serviced because an operation that has been previously triggered is still in progress.

enumerator CY_BLE_GATT_ERR_OUT_OF_RANGE

Out of Range error code is used when an attribute value is out of range as defined by a profile or service specification.

struct cy_stc_ble_disc_srvc_info_t
#include <>

Service data received with read by group type response during discovery process.

Public Members

cy_stc_ble_gatt_attr_handle_range_t range

Handle range of the request.

uint16_t uuid

16-bit UUID

struct cy_stc_ble_disc_srvc128_info_t
#include <>

Service data received with read by group type response during discovery process including 128 bit UUID.

Public Members

cy_stc_ble_gatt_attr_handle_range_t range

Handle range of the request.

cy_ble_uuid_t uuid

128-bit UUID

struct cy_stc_ble_disc_srv_info_t
#include <>

Service data that includes data received with read by group type response and connHandle.

Public Members

cy_stc_ble_conn_handle_t connHandle

The connection handle.

cy_stc_ble_disc_srvc128_info_t *srvcInfo

Service data.

uint8_t uuidFormat

UUID Format - 16-bit (0x01) or 128-bit (0x02)

struct cy_stc_ble_disc_incl_info_t
#include <>

Included service data received with read by type response during discovery process.

Public Members

cy_stc_ble_conn_handle_t connHandle

The connection handle.

cy_ble_gatt_db_attr_handle_t inclDefHandle

Included definition handle.

cy_stc_ble_gatt_attr_handle_range_t inclHandleRange

Included declaration handle range.

cy_ble_uuid_t uuid

Included UUID.

uint8_t uuidFormat

UUID Format - 16-bit (0x01) or 128-bit (0x02)

struct cy_stc_ble_disc_char_info_t
#include <>

Characteristic data received with read by type response during discovery process.

Public Members

cy_stc_ble_conn_handle_t connHandle

The connection handle.

cy_ble_gatt_db_attr_handle_t charDeclHandle

Handle for Characteristic declaration.

uint8_t properties

Properties for Value Field.

cy_ble_gatt_db_attr_handle_t valueHandle

Handle to server database attribute value entry.

cy_ble_uuid_t uuid

Characteristic UUID.

uint8_t uuidFormat

UUID Format - 16-bit (0x01) or 128-bit (0x02)

struct cy_stc_ble_srvr_char_info_t
#include <>

Characteristic Attribute handle + properties structure.

Public Members

uint8_t properties

Properties for Value Field.

cy_ble_gatt_db_attr_handle_t valueHandle

Handle of server database attribute value entry.

struct cy_stc_ble_disc_descr_info_t
#include <>

Characteristic descriptor data received with find info response during discovery process.

Public Members

cy_stc_ble_conn_handle_t connHandle

The connection handle.

cy_ble_gatt_db_attr_handle_t descrHandle

Descriptor handle.

cy_ble_uuid_t uuid

Descriptor UUID.

uint8_t uuidFormat

UUID Format - 16-bit (0x01) or 128-bit (0x02)

struct cy_stc_ble_gatts_t
#include <>

Structure with Generic Attribute Service (GATTS) attribute handles.

Public Members

cy_ble_gatt_db_attr_handle_t serviceHandle

Service Handle.

cy_ble_gatt_db_attr_handle_t serviceChangedHandle

Handle of the Service Changed Characteristic.

cy_ble_gatt_db_attr_handle_t cccdHandle

Client Characteristic Configuration descriptor handle.

struct cy_stc_ble_disc_range_info_t
#include <>

Structure for return a possible range of the current Characteristic descriptor.

Public Members

cy_stc_ble_conn_handle_t connHandle

The connection handle.

cy_stc_ble_gatt_attr_handle_range_t range

Handle range of the request.

uint32_t srviIncIdx

A non-zero value indicates that the Characteristic index should be incremented.

struct cy_stc_ble_gattc_t
#include <>

Structure with Discovered Attributes Information of Generic Attribute Service (GATTS)

Public Members

cy_stc_ble_srvr_char_info_t serviceChanged

Handle of the Service Changed Characteristic.

cy_ble_gatt_db_attr_handle_t cccdHandle

Client Characteristic Configuration descriptor handle.

struct cy_stc_ble_uuid128_t
#include <>

GATT 128 Bit UUID type.

Public Members

uint8_t value[CY_BLE_GATT_128_BIT_UUID_SIZE]

128 Bit UUID

union cy_ble_uuid_t
#include <>

GATT UUID type.

Public Members

cy_ble_uuid16_t uuid16

16 Bit UUID

cy_stc_ble_uuid128_t uuid128

128 Bit UUID

struct cy_stc_ble_gatt_value_t
#include <>

Abstracts Variable Length Values for GATT.

Apart from data and length, actual length is needed so that the GATT can indicate to the application the actual length of data processed for a PDU.

This is used in multiple commands - see CY_BLE_GATT_READ_RSP, CY_BLE_GATT_FIND_BY_TYPE_VALUE_REQ, CY_BLE_GATT_READ_BLOB_RSP, etc.

In GATT Read Response for example, if the attribute length is 30 octets and the GATT MTU is 23 octets, then only first 22 octets can be sent by the GATT. Therefore the actual length will be 22 (GATT MTU-1). However, if the GATT MTU is configured to be 54 for example, all 30 octets can be transmitted and the actual length will be 30.

Actual length should be derived as : actualLen = minimum(length, (GATT MTU-1))

In case multiple values are being packed, the actual length processed will depend on the available GATT MTU.

Public Members

uint8_t *val

Pointer to the value to be packed.

uint16_t len

Length of the Value to be packed in bytes.

uint16_t actualLen

Output parameter indicating actual length packed and sent over the air.

Actual length can be less than or equal to the ‘len’ parameter values. Each GATT procedure defines different lengths of data that can be transmitted over the air. If the application sends more than that, not all of the data will be transmitted.

struct cy_stc_ble_gatt_handle_value_pair_t
#include <>

GATT handle - value pair type.

Public Members

cy_stc_ble_gatt_value_t value

Attribute Value.

cy_ble_gatt_db_attr_handle_t attrHandle

Attribute Handle of GATT DB.

struct cy_stc_ble_gatt_attr_handle_range_t
#include <>

GATT Attribute Handle Range type.

Public Members

cy_ble_gatt_db_attr_handle_t startHandle

Start Handle.

cy_ble_gatt_db_attr_handle_t endHandle

End Handle.

struct cy_stc_ble_gatt_xchg_mtu_param_t
#include <>

GATT MTU exchange parameter type.

Public Members

cy_stc_ble_conn_handle_t connHandle

Connection handle.

uint16_t mtu

Client/Server Rx/Tx GATT MTU Size.

struct cy_stc_ble_gatt_handle_value_offset_param_t
#include <>

GATT Handle Value Pair along with offset type.

Public Members

cy_stc_ble_gatt_handle_value_pair_t handleValuePair

Attribute Handle & Value to be Written.

uint16_t offset

Offset at which Write is to be performed.

struct cy_stc_ble_gatt_write_param_t
#include <>

Write parameter.

Public Members

cy_stc_ble_gatt_handle_value_pair_t handleValPair

handle value pair

cy_stc_ble_conn_handle_t connHandle

Connection handle.

struct cy_stc_ble_gatt_err_info_t
#include <>

Error information.

Public Members

cy_ble_gatt_db_attr_handle_t attrHandle

Attribute Handle in which error is generated.

cy_en_ble_gatt_pdu_t opCode

Opcode which has resulted in Error.

cy_en_ble_gatt_err_code_t errorCode

Error Code describing cause of error.

struct cy_stc_ble_gatt_err_param_t
#include <>

Error parameter.

Public Members

cy_stc_ble_conn_handle_t connHandle

Connection handle.

cy_stc_ble_gatt_err_info_t errInfo

Error information.

struct cy_stc_ble_gatt_prep_write_param_t
#include <>

Prepare Write parameter.

Public Members

cy_stc_ble_gatt_handle_value_offset_param_t handleValOffsetPair

handle value offset pair

cy_stc_ble_conn_handle_t connHandle

Connection handle.

struct cy_stc_ble_prepare_write_request_memory_t
#include <>

memory request parameters for prepare write request

Public Members

uint8_t *queueBuffer

buffer to which a prepared write queue request will be stored.

The buffer can be calculated as: total buffer = totalAttrValueLength

uint16_t totalAttrValueLength

length of attribute value in bytes.

This value can be the maximum attribute value length or sum of value lengths that support a long write. The value should be multiple of a 32-bit unsigned integer.

uint16_t prepareWriteQueueSize

Size of queueBuffer buffer.

The application may decide the size based on (totalAttrValueLength) /(negotiated or default MTU size - 5). In case of a reliable write, queue depth should at least be equal to number of handles that have reliable write support.

cy_stc_ble_conn_handle_t connHandle

Connection Handle.

struct cy_stc_ble_gattc_stop_cmd_param_t
#include <>

Stop command parameter.

Public Members

cy_stc_ble_conn_handle_t connHandle

Connection handle.

struct cy_stc_ble_gattc_read_by_group_req_t
#include <>

GATT Discover primary service request parameter.

Public Members

cy_stc_ble_gatt_attr_handle_range_t range

Handle Range.

cy_stc_ble_conn_handle_t connHandle

Connection handle.

struct cy_stc_ble_gattc_find_by_type_value_req_t
#include <>

GATT Discover primary service by UUID request parameter.

Public Members

cy_stc_ble_gatt_value_t value

Attribute Value to Find.

cy_stc_ble_gatt_attr_handle_range_t range

Handle Range - Start and End Handle.

cy_ble_uuid16_t uuid

16-bit UUID to Find

cy_stc_ble_conn_handle_t connHandle

Connection handle.

struct cy_stc_ble_gattc_read_by_type_req_t
#include <>

GATT read by type request parameter.

Public Members

cy_stc_ble_gatt_attr_handle_range_t range

Handle Range.

cy_ble_uuid_t uuid

GATT UUID type.

uint8_t uuidFormat

Format indicating, 16-bit or 128-bit UUIDs For 16-bit UUID format - CY_BLE_GATT_16_BIT_UUID_FORMAT (0x01) For 128-bit UUID format - CY_BLE_GATT_128_BIT_UUID_FORMAT (0x02)

cy_stc_ble_conn_handle_t connHandle

Connection handle.

struct cy_stc_ble_gattc_read_req_t
#include <>

Read request parameter.

Public Members

cy_ble_gatt_db_attr_handle_t attrHandle

Handle on which Read Blob is requested.

cy_stc_ble_conn_handle_t connHandle

Connection handle.

struct cy_stc_ble_gattc_handle_offset_pair_t
#include <>

Handle-offset pair parameter.

Public Members

cy_ble_gatt_db_attr_handle_t attrHandle

Handle on which Read Blob is requested.

uint16_t offset

Value Offset from which the Read is Requested.

struct cy_stc_ble_gattc_read_blob_req_t
#include <>

Read blob request parameter.

Public Members

cy_stc_ble_gattc_handle_offset_pair_t handleOffset

Handle-offset pair parameter.

cy_stc_ble_conn_handle_t connHandle

Connection handle.

struct cy_stc_ble_gattc_handle_list_t
#include <>

GATT handle list type.

Public Members

uint16_t *handleList

Handle list where the UUID with value indicated is found.

uint16_t listCount

Number of Handles in the list.

uint16_t actualCount

Actual Number of Handles Packed.

This is a output parameter

struct cy_stc_ble_gattc_read_mult_req_t
#include <>

Read multiple request parameter.

Public Members

cy_stc_ble_gattc_handle_list_t handleListType

GATT handle list type.

cy_stc_ble_conn_handle_t connHandle

Connection handle.

struct cy_stc_ble_gattc_reliable_write_req_t
#include <>

Prepare Write request parameter for reliable write request.

Public Members

cy_stc_ble_gatt_handle_value_offset_param_t *handleValOffsetPair

handle value offset pair

cy_stc_ble_conn_handle_t connHandle

Connection handle.

uint8_t numOfRequests

Number of requests.

That is, the count of array of structures of type ‘cy_stc_ble_gatt_handle_value_offset_param_t’. Each array element represents a value and the attribute to which the value has to be written

struct cy_stc_ble_gattc_exec_write_req_t
#include <>

Execute Write request parameter.

Public Members

cy_stc_ble_conn_handle_t connHandle

Connection handle.

uint8_t flag

Indicates whether Queued Write is to be executed (0x01) or canceled (0x00)

struct cy_stc_ble_gattc_read_rsp_param_t
#include <>

Read response parameter type received from server.

Public Members

cy_stc_ble_gatt_value_t value

Attribute Value.

cy_stc_ble_conn_handle_t connHandle

Connection handle.

struct cy_stc_ble_gattc_grp_attr_data_list_t
#include <>

Data Element for Group Response.

Public Members

uint8_t *attrValue

attribute handle value pair

uint16_t length

Length of each Attribute Data Element including the Handle Range.

uint16_t attrLen

Total Length of Attribute Data.

struct cy_stc_ble_gattc_read_by_grp_rsp_param_t
#include <>

Read By Group Response received from Server.

Public Members

cy_stc_ble_gattc_grp_attr_data_list_t attrData

Group attribute data list.

cy_stc_ble_conn_handle_t connHandle

Connection handle.

struct cy_stc_ble_gattc_find_by_type_rsp_param_t
#include <>

GATT find by type value response received from server.

Public Members

cy_stc_ble_gatt_attr_handle_range_t *range

Handle Range list.

uint8_t count

Size of list.

cy_stc_ble_conn_handle_t connHandle

Connection handle.

struct cy_stc_ble_gattc_handle_uuid_list_param_t
#include <>

GATT list of Handle UUID pair parameter type.

Public Members

uint8_t *list

Handle - UUID Pair list This is a packed byte stream, hence it needs to be unpacked and decoded.

uint16_t byteCount

Number of elements in the list in bytes.

struct cy_stc_ble_gattc_find_info_rsp_param_t
#include <>

GATT find info response received from Server.

Public Members

cy_stc_ble_gattc_handle_uuid_list_param_t handleValueList

Handle Value list.

cy_stc_ble_conn_handle_t connHandle

Connection handle.

uint8_t uuidFormat

Format indicating, 16-bit (0x01) or 128-bit (0x02) UUIDs.

struct cy_stc_ble_gattc_exec_write_rsp_param_t
#include <>

Execute Write result.

Public Members

cy_stc_ble_conn_handle_t connHandle

Connection handle.

uint8_t result

Result of the execute write request.

struct cy_stc_ble_gattc_long_procedure_end_param_t
#include <>

Long procedure end indication event parameter.

Public Members

cy_stc_ble_conn_handle_t connHandle

Connection handle.

uint8_t opcode

Result of the execute write request.

struct cy_stc_ble_gatts_att_gen_val_len_t
#include <>

Attribute value type used in GATT database.

Public Members

uint16_t actualLength

Length of attGenericVal in bytes.

void *attGenericVal

Buffer to store generic characteristic value based on length or complete UUID value if the attribute is of type 128-bit or 32-bit UUID.

struct cy_stc_ble_gatts_att_pack_val_len_t
#include <>

Attribute value type used in the GATT database.

Public Members

uint16_t maxAttrLength

Maximum length of attGenericValLen->attGenericVal in bytes.

cy_stc_ble_gatts_att_gen_val_len_t *attGenericValLen

Buffer to the store generic characteristic value based on length or complete UUID value if the attribute is of type 128-bit UUID and 32-bit UUID type.

union cy_stc_ble_gatts_att_value_t
#include <>

Attribute value type used in GATT database.

Public Members

cy_stc_ble_gatts_att_pack_val_len_t attFormatValue

Buffer containing 32-bit or 128-bit UUID values for Service and Characteristic declaration.

Attribute format structure: if entry is for characteristic value format, attFormatValue should be a pointer to a characteristic-specific structure

uint16_t attValueUuid

Attribute UUID value.

struct cy_stc_ble_gatts_db_t
#include <>

GATT database structure used in the GATT Server.

Public Members

uint16_t attHandle

Index for querying BLE GATT database.

uint16_t attType

UUID: 16-bit UUID type for an attribute entry.

For 32-bit and 128-bit UUIDs, the last 16 bits should be stored in this entry. The GATT DB access layer shall retrieve complete 128-bit UUID from the cy_ble_gatts_att_generic_val_t structure.

uint32_t permission

The permission bits are stored in a 32-bit field.

These 32-bits can be grouped in four bytes. The least significant byte is byte 0 (B0) and the most significant byte is byte 3 (B3). The bytes where the permissions have been grouped is as given below. Attribute permissions for read (B0) Attribute permissions for write (B1) Characteristic properties (B2) Implementation specific permission (B3) If permission is set to CY_BLE_GATT_DB_ATTR_CHAR_VAL_RD_EVENT, all GATT characteristic read requests will be indicated to the application using the CY_BLE_EVT_GATTS_READ_CHAR_VAL_ACCESS_REQ event.

uint16_t attEndHandle

Attribute end handle, indicating logical boundary of given attribute.

cy_stc_ble_gatts_att_value_t attValue

Attribute value format, it can be one of following: uint16_t 16bit - UUID for 16-bit service and characteristic declaration cy_ble_gatts_att_generic_val_t attFormatValue - Buffer containing 32-bit or 128-bit UUID values for service & characteristic declaration cy_ble_gatts_att_generic_val_t attFormatValue - Buffer containing generic characteristic definition value or generic descriptor values.

struct cy_stc_ble_gatts_db_info_t
#include <>

GATT database information parameters.

Public Members

const cy_stc_ble_gatts_db_t *gattDbPtr

Pointer to GATT DB.

uint16_t gattDbTotalEntries

Total number of entries in GATT DB.

uint16_t gattDbMaxValue

Maximum characteristic value length.

struct cy_stc_ble_gatts_db_attr_val_info_t
#include <>

GATT database attribute value parameters.

Public Members

cy_stc_ble_gatt_handle_value_pair_t handleValuePair

handle value pair of type cy_stc_ble_gatt_handle_value_pair_t.

‘handleValuePair.attrHandle’ is an input for which a value must be read/written. ‘handleValuePair.value.len’ is an input parameter for the length to be read/written. ‘handleValuePair.value.val’ is an input parameter for the data buffer when writing and an output parameter for the data buffer when reading. ‘handleValuePair.actualLen’ must be ignored as it is unused

uint16_t offset

Offset in bytes at which the data is written or read.

cy_stc_ble_conn_handle_t connHandle

Connection Handle.

uint8_t flags

Attribute permissions.

Allowed values are,

  • CY_BLE_GATT_DB_LOCALLY_INITIATED

  • CY_BLE_GATT_DB_PEER_INITIATED

struct cy_stc_ble_gatts_db_attr_enable_info_t
#include <>

GATT database attribute enable parameters.

Public Members

cy_ble_gatt_db_attr_handle_t attrHandle

Attribute handle.

struct cy_stc_ble_gatts_db_authorize_info_t
#include <>

GATT database authorize parameters.

Public Members

uint8_t authorize

Setting to ‘0’ turns off authorization on the entire GATT database and all attributes marked as authorize will return an authorization error.

Setting this to any non-zero value will authorize the entire GATT database and all attributes marked as authorize can be read / written based on other allowed permissions.

struct cy_stc_ble_gatts_prep_write_req_param_t
#include <>

Prepare write request parameter received from Client.

Public Members

cy_stc_ble_gatt_handle_value_offset_param_t *baseAddr

Base address of the queue containing the data.

Queue is of type cy_stc_ble_gatt_handle_value_offset_param_t. Each baseAddr[currentPrepWriteReqCount-1].handleValuePair.value.val provides the current data and baseAddr[0].handleValuePair.value.val provides the base address of the data buffer where the full value will be stored. The application can calculate the total length based on each each array element; i.e., total length of current request = baseAddr[0].handleValuePair.value.len+ ….+baseAddr[currentPrepWriteReqCount-1].handleValuePair.value.len

cy_stc_ble_conn_handle_t connHandle

Connection handle.

uint8_t currentPrepWriteReqCount

Current count of prepare requests from remote.

This parameter can be used to access the data from ‘baseAddr[]’. Array index will range from 0 to currentPrepWriteReqCount - 1

uint8_t gattErrorCode

The application provides GATT error code for the procedure.

This is an output parameter.

struct cy_stc_ble_gatts_exec_write_req_t
#include <>

Execute Write result.

Public Members

cy_stc_ble_gatt_handle_value_offset_param_t *baseAddr

Base address of the queue where data is queued.

Queue is of type cy_stc_ble_gatt_handle_value_offset_param_t. baseAddr[0].handleValuePair.value.val provides the base address of the total data stored in the prepare write queue internally by the Stack. The application can calculate the total length based on each each array element; i.e., total length = baseAddr[0].handleValuePair.value.len+ ….+baseAddr[prepWriteReqCount-1].handleValuePair.value.len

cy_stc_ble_conn_handle_t connHandle

Connection handle.

cy_ble_gatt_db_attr_handle_t attrHandle

Attribute Handle at which the error occurred.

This is an o/p param.

uint8_t prepWriteReqCount

Total count of prepare requests from remote.

This parameter can be used to access the data from ‘baseAddr[]’. The array index will range from 0 to prepWriteReqCount - 1.

uint8_t execWriteFlag

Execute write flag received from remote.

uint8_t gattErrorCode

The application-provided GATT error code for the procedure.

This is an o/p param.

struct cy_stc_ble_gatts_char_val_read_req_t
#include <>

Event parameters for characteristic read value access event generated by the BLE Stack upon an access of Characteristic value read for the characteristic definition that CY_BLE_GATT_DB_ATTR_CHAR_VAL_RD_EVENT property set.

Public Members

cy_stc_ble_conn_handle_t connHandle

Connection handle.

cy_ble_gatt_db_attr_handle_t attrHandle

Attribute Handle.

cy_en_ble_gatt_err_code_t gattErrorCode

Output Parameter: Profile/Service specific error code, profile or application need to change this to service specific error based on service/profile requirements.