Generic Attribute (GATT)

API Reference


group wicedbt_gatt

Generic Attribute (GATT) Functions.

The Generic Attribute Profile (GATT) defines a service framework which enables Bluetooth low energy applications to configure themselves as a client or server device.

The profile also provides the capability to perform discovery of services, read, write, notification and indication of characteristics defined on a server.

Service and Characteristic macros

PRIMARY_SERVICE_UUID16(handle, service)

Macro to assist 16 bit primary service declaration.

PRIMARY_SERVICE_UUID128(handle, service)

Macro to assist 128 bit primary service declaration.

SECONDARY_SERVICE_UUID16(handle, service)

Macro to assist 16 bit secondary service declaration.

SECONDARY_SERVICE_UUID128(handle, service)

Macro to assist 128 bit secondary service declaration.

INCLUDE_SERVICE_UUID16(handle, service_handle, end_group_handle, service)

Macro to assist included service declaration.

INCLUDE_SERVICE_UUID128(handle, service_handle, end_group_handle)

Macro to assist 128 bit included service declaration.

CHARACTERISTIC_UUID16(handle, handle_value, uuid, properties, permission)

Macro to assist readable 16 bit characteristic declaration.

CHARACTERISTIC_UUID128(handle, handle_value, uuid, properties, permission)

Macro to assist readable 128 bit characteristic declaration.

CHARACTERISTIC_UUID16_WRITABLE(handle, handle_value, uuid, properties, permission)

Macro to assist writable 16 bit characteristic declaration.

CHARACTERISTIC_UUID128_WRITABLE(handle, handle_value, uuid, properties, permission)

Macro to assist writable 128 bit characteristic declaration.

CHAR_DESCRIPTOR_UUID16_WRITABLE(handle, uuid, permission)

Macro to assist writable 16 bit descriptor declaration.

CHAR_DESCRIPTOR_UUID16(handle, uuid, permission)

Macro to assist readable 16 bit descriptor declaration.

CHAR_DESCRIPTOR_UUID128_WRITABLE(handle, uuid, permission)

Macro to assist writable 128 bit descriptor declaration.

CHAR_DESCRIPTOR_UUID128(handle, uuid, permission)

Macro to assist readable 128 bit descriptor declaration.

CHAR_DESCRIPTOR_EXTENDED_PROPERTIES(handle, ext_properties)

Macro to assist extended properties declaration.

Defines

GATT_BLE_DEFAULT_MTU_SIZE

Default GATT MTU size over LE link.

GATT_AUTH_SIGN_LEN

Size of the signature appended to application data in signed write cmd.

GATT_CLIENT_MAX_WRITE_SIGNED_DATA

Max size of application data allowed to be sent using the signed write cmd.

GATT_PREP_WRITE_CANCEL

See GATT_PREPARE_WRITE_CANCEL.

GATT_PREP_WRITE_EXEC

See GATT_PREPARE_WRITE_EXEC.

GATTDB_PERM_NONE

The permission bits (see Vol 3, Part F, 3.2.5)

GATTDB_PERM_VARIABLE_LENGTH

The permission bits (see Vol 3, Part F, 3.2.5)

GATTDB_PERM_READABLE

The permission bits (see Vol 3, Part F, 3.2.5)

GATTDB_PERM_WRITE_CMD

The permission bits (see Vol 3, Part F, 3.2.5)

GATTDB_PERM_WRITE_REQ

The permission bits (see Vol 3, Part F, 3.2.5)

GATTDB_PERM_AUTH_READABLE

The permission bits (see Vol 3, Part F, 3.2.5)

GATTDB_PERM_RELIABLE_WRITE

The permission bits (see Vol 3, Part F, 3.2.5)

GATTDB_PERM_AUTH_WRITABLE

The permission bits (see Vol 3, Part F, 3.2.5)

GATTDB_PERM_WRITABLE

The permission bits (see Vol 3, Part F, 3.2.5)

GATTDB_PERM_MASK

All the permission bits.

GATTDB_PERM_SERVICE_UUID_128

The permission bits (see Vol 3, Part F, 3.2.5)

GATTDB_CHAR_PROP_BROADCAST

GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)

GATTDB_CHAR_PROP_READ

GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)

GATTDB_CHAR_PROP_WRITE_NO_RESPONSE

GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)

GATTDB_CHAR_PROP_WRITE

GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)

GATTDB_CHAR_PROP_NOTIFY

GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)

GATTDB_CHAR_PROP_INDICATE

GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)

GATTDB_CHAR_PROP_AUTHD_WRITES

GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)

GATTDB_CHAR_PROP_EXTENDED

GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)

GATTDB_CHAR_EXTENDED_PROP_RELIABLE

GATT Characteristic Extended Properties (see Vol 3, Part G, 3.3.3.1)

GATTDB_CHAR_EXTENDED_PROP_WRITABLE_AUXILIARIES

GATT Characteristic Extended Properties (see Vol 3, Part G, 3.3.3.1)

BIT16_TO_8(val)

Conversion macros.

GATTDB_UUID16_SIZE

UUID lengths.

GATTDB_UUID128_SIZE

UUID lengths.

GATT_IS_CSF_FEATURE_SUPPORTED(csf, m)

macro to determine GATT Client Support features

Typedefs

typedef uint16_t wiced_bt_gatt_status_t

GATT status (see wiced_bt_gatt_status_e)

typedef uint8_t wiced_bt_gatt_opcode_t
typedef uint16_t wiced_bt_gatt_disconn_reason_t

GATT disconnection reason (see wiced_bt_gatt_disconn_reason_e)

typedef uint16_t wiced_bt_gatt_client_char_config_t

GATT client config (see wiced_bt_gatt_client_char_config_e)

typedef uint16_t wiced_bt_gatt_server_char_config_t

GATT server config (see wiced_bt_gatt_server_char_config_e)

typedef uint8_t wiced_bt_gatt_char_properties_t

GATT characteristic properties mask (see wiced_bt_gatt_char_properties_e)

typedef uint8_t wiced_bt_gatt_auth_req_t

GATT authentication requirement (see wiced_bt_gatt_auth_req_e)

typedef uint8_t wiced_bt_gatt_exec_flag_t

GATT execute flag (see wiced_bt_gatt_exec_flag_e)

typedef uint8_t wiced_bt_gatt_discovery_type_t

GATT Discovery type (see wiced_bt_gatt_discovery_type_e)

typedef uint8_t wiced_bt_gatt_optype_t

GATT Client Operation Codes.

GATT client operation type (see wiced_bt_gatt_optype_e)

typedef uint8_t wiced_bt_gatt_caching_status_t

GATT peer caching status (see wiced_bt_gatt_caching_status_e)

typedef uint8_t wiced_bt_gatt_permission_t

Attribute permission bit masks.

typedef uint8_t wiced_bt_gatt_format_t

characteristic format specifiers (see wiced_bt_gatt_format_e)

typedef uint8_t wiced_bt_gatt_csf_bits_t

GATT Client Support features.

typedef uint16_t wiced_bt_eatt_lcid_list[EATT_CHANNELS_PER_TRANSACTION]

list of EATT lcid’s

LCID: L2CAP Channel ID L2CAP channel ids are assigned by L2CAP during the channel creation process. The list is passed to the application using wiced_bt_gatt_eatt_connection_indication_event_t

typedef uint16_t wiced_bt_gatt_eatt_conn_id_list[EATT_CHANNELS_PER_TRANSACTION]

list of EATT connection id’s

Data Receive Buffer Data Receive Buffer or DRB is a memory area of type tDRB and size(channel MTU size + DRB_OVERHEAD_SIZE). The DRB buffer is allocated by the application during channel creation. The allocated DRBs are passed to the GATT layer when establishing an EATT connection. a) As a connection initiator with wiced_bt_gatt_eatt_connect b) As a connection responder with wiced_bt_gatt_eatt_connection_response_t Application has to allocate one DRB per GATT bearer of size equal to that of desired local MTU.

typedef tDRB *wiced_bt_eatt_drbs[EATT_CHANNELS_PER_TRANSACTION]

list of Data Receive Blocks

typedef void *wiced_bt_gatt_app_context_t
typedef wiced_bt_gatt_status_t wiced_bt_gatt_cback_t(wiced_bt_gatt_evt_t event, wiced_bt_gatt_event_data_t *p_event_data)

GATT event notification callback.

Callback for GATT event notifications Registered using wiced_bt_gatt_register()

Return

Status of event handling

Parameters
  • [in] event: : Event ID

  • [in] p_event_data: : Event data

typedef void (*wiced_bt_gatt_eatt_on_connect_ind_t)(wiced_bt_gatt_eatt_connection_indication_event_t *p_ind)

Function callbacks for EATT.

callback upon GATT EATT connection

typedef void (*wiced_bt_gatt_eatt_on_connect_complete_t)(wiced_bt_gatt_eatt_connection_confirmation_event_t *p_cfm)

callback upon GATT EATT connection complete

typedef void (*wiced_bt_gatt_eatt_on_reconfigure_ind_t)(uint16_t conn_id, uint16_t mtu, uint16_t mps)

callback upon GATT EATT reconnection complete

typedef void (*wiced_bt_gatt_eatt_release_drb_t)(tDRB *p_drb)

callback upon releasing the DRB

Enums

enum gatt_appearance_e

gatt_appearance_e: GATT appearance definitions.

Values:

enumerator APPEARANCE_GENERIC_PHONE
enumerator APPEARANCE_GENERIC_COMPUTER
enumerator APPEARANCE_GENERIC_WATCH
enumerator APPEARANCE_WATCH_SPORTS
enumerator APPEARANCE_GENERIC_CLOCK
enumerator APPEARANCE_GENERIC_DISPLAY
enumerator APPEARANCE_GENERIC_REMOTE_CONTROL
enumerator APPEARANCE_GENERIC_EYE_GLASSES
enumerator APPEARANCE_GENERIC_TAG
enumerator APPEARANCE_GENERIC_KEYRING
enumerator APPEARANCE_GENERIC_MEDIA_PLAYER
enumerator APPEARANCE_GENERIC_BARCODE_SCANNER
enumerator APPEARANCE_GENERIC_THERMOMETER
enumerator APPEARANCE_THERMOMETER_EAR
enumerator APPEARANCE_GENERIC_HEART_RATE_SENSOR
enumerator APPEARANCE_HEART_RATE_BELT
enumerator APPEARANCE_GENERIC_BLOOD_PRESSURE
enumerator APPEARANCE_BLOOD_PRESSURE_ARM
enumerator APPEARANCE_BLOOD_PRESSURE_WRIST
enumerator APPEARANCE_GENERIC_HID_DEVICE
enumerator APPEARANCE_HID_KEYBOARD
enumerator APPEARANCE_HID_MOUSE
enumerator APPEARANCE_HID_JOYSTICK
enumerator APPEARANCE_HID_GAMEPAD
enumerator APPEARANCE_HID_DIGITIZER_TABLET
enumerator APPEARANCE_HID_CARD_READER
enumerator APPEARANCE_HID_DIGITAL_PEN
enumerator APPEARANCE_HID_BARCODE_SCANNER
enumerator APPEARANCE_GENERIC_GLUCOSE_METER
enumerator APPEARANCE_GENERIC_RUNNING_WALKING_SENSOR
enumerator APPEARANCE_RUNNING_WALKING_SENSOR_IN_SHOE
enumerator APPEARANCE_RUNNING_WALKING_SENSOR_ON_SHOE
enumerator APPEARANCE_RUNNING_WALKING_SENSOR_ON_HIP
enumerator APPEARANCE_GENERIC_CYCLING
enumerator APPEARANCE_CYCLING_COMPUTER
enumerator APPEARANCE_CYCLING_SPEED_SENSOR
enumerator APPEARANCE_CYCLING_CADENCE_SENSOR
enumerator APPEARANCE_CYCLING_POWER_SENSOR
enumerator APPEARANCE_CYCLING_SPEED_AND_CADENCE_SENSOR
enumerator APPEARANCE_CONTROL_DEVICE_SWITCH
enumerator APPEARANCE_CONTROL_DEVICE_MULTI_SWITCH

Switch Control Device subtype.

enumerator APPEARANCE_CONTROL_DEVICE_BUTTON

Multi - switch.

enumerator APPEARANCE_CONTROL_DEVICE_SLIDER

Button.

enumerator APPEARANCE_CONTROL_DEVICE_ROTARY

Slider.

enumerator APPEARANCE_CONTROL_DEVICE_TOUCH_PANEL

Rotary.

enumerator APPEARANCE_NETWORK_DEVICE

Touch - panel.

enumerator APPEARANCE_ACCESS_POINT

Generic Network Device Generic category.

enumerator APPEARANCE_SENSOR_GENERIC

Access Point Generic Network subtype.

enumerator APPEARANCE_SENSOR_MOTION

Generic Sensor Generic category.

enumerator APPEARANCE_SENSOR_AIR_QUALITY

Motion Sensor.

enumerator APPEARANCE_SENSOR_TEMPERATURE

Air Quality Sensor.

enumerator APPEARANCE_SENSOR_HUMIDITY

Temperature Sensor.

enumerator APPEARANCE_SENSOR_LEAK

Humidity Sensor.

enumerator APPEARANCE_SENSOR_SMOKE

Leak Sensor.

enumerator APPEARANCE_SENSOR_OCCUPANCY

Smoke Sensor.

enumerator APPEARANCE_SENSOR_CONTACT

Occupancy Sensor.

enumerator APPEARANCE_SENSOR_CARBON_MONOXIDE

Contact Sensor.

enumerator APPEARANCE_SENSOR_CARBON_DIOXIDE

Carbon Monoxide Sensor.

enumerator APPEARANCE_SENSOR_AMBIENT_LIGHT

Carbon Dioxide Sensor.

enumerator APPEARANCE_SENSOR_ENERGY

Ambient Light Sensor.

enumerator APPEARANCE_SENSOR_COLOR_LIGHT

Energy Sensor.

enumerator APPEARANCE_SENSOR_RAIN

Color Light Sensor.

enumerator APPEARANCE_SENSOR_FIRE

Rain Sensor.

enumerator APPEARANCE_SENSOR_WIND

Fire SensorF.

enumerator APPEARANCE_SENSOR_PROXYMITY

Wind Sensor.

enumerator APPEARANCE_SENSOR_MULTI_SENSOR

Proximity Sensor.

enumerator APPEARANCE_LIGHT_GENERIC_FIXTURE

Multi - Sensor.

enumerator APPEARANCE_LIGHT_WALL

Generic Light Fixtures Generic category.

enumerator APPEARANCE_LIGHT_CEILING

Wall Light.

enumerator APPEARANCE_LIGHT_FLOOR

Ceiling Light.

enumerator APPEARANCE_LIGHT_CABINET

Floor Light.

enumerator APPEARANCE_LIGHT_DESK

Cabinet Light.

enumerator APPEARANCE_LIGHT_TROFFER

Desk Light.

enumerator APPEARANCE_LIGHT_PENDANT

Troffer Light.

enumerator APPEARANCE_LIGHT_IN_GROUND

Pendant Light.

enumerator APPEARANCE_LIGHT_FLOOD

In - ground Light.

enumerator APPEARANCE_LIGHT_UNDERWATER

Flood Light.

enumerator APPEARANCE_LIGHT_BOLLAR

Underwater Light.

enumerator APPEARANCE_LIGHT_PATHWAY

Bollard with Light.

enumerator APPEARANCE_LIGHT_GARDEN

Pathway Light.

enumerator APPEARANCE_LIGHT_POLE

Garden Light.

enumerator APPEARANCE_LIGHT_SPOTLIGHT

Pole - top Light.

enumerator APPEARANCE_LIGHT_LINEAR

Spotlight.

enumerator APPEARANCE_LIGHT_STREET

Linear Light.

enumerator APPEARANCE_LIGHT_SHELVE

Street Light.

enumerator APPEARANCE_LIGHT_HIGH_BAY_LOW_BAY

Shelves Light.

enumerator APPEARANCE_LIGHT_EMERGENCY_EXIT

High - bay / Low - bay Light.

enumerator APPEARANCE_LOCATION_AND_NAVIGATION_POD

Emergency Exit Light.

enum wiced_bt_gatt_status_e

wiced_bt_gatt_status_e: GATT Status Codes.

Values:

enumerator WICED_BT_GATT_SUCCESS

Success.

enumerator WICED_BT_GATT_INVALID_HANDLE

Invalid Handle.

enumerator WICED_BT_GATT_READ_NOT_PERMIT

Read Not Permitted.

enumerator WICED_BT_GATT_WRITE_NOT_PERMIT

Write Not permitted.

enumerator WICED_BT_GATT_INVALID_PDU

Invalid PDU.

enumerator WICED_BT_GATT_INSUF_AUTHENTICATION

Insufficient Authentication.

enumerator WICED_BT_GATT_REQ_NOT_SUPPORTED

Request Not Supported.

enumerator WICED_BT_GATT_INVALID_OFFSET

Invalid Offset.

enumerator WICED_BT_GATT_INSUF_AUTHORIZATION

Insufficient Authorization.

enumerator WICED_BT_GATT_PREPARE_Q_FULL

Prepare Queue Full.

enumerator WICED_BT_GATT_ATTRIBUTE_NOT_FOUND

Attribute Not Found.

enumerator WICED_BT_GATT_NOT_LONG

Not Long Size.

enumerator WICED_BT_GATT_INSUF_KEY_SIZE

Insufficient Key Size.

enumerator WICED_BT_GATT_INVALID_ATTR_LEN

Invalid Attribute Length.

enumerator WICED_BT_GATT_ERR_UNLIKELY

Error Unlikely.

enumerator WICED_BT_GATT_INSUF_ENCRYPTION

Insufficient Encryption.

enumerator WICED_BT_GATT_UNSUPPORT_GRP_TYPE

Unsupported Group Type.

enumerator WICED_BT_GATT_INSUF_RESOURCE

Insufficient Resource.

enumerator WICED_BT_GATT_DATABASE_OUT_OF_SYNC

GATT Database Out of Sync.

enumerator WICED_BT_GATT_VALUE_NOT_ALLOWED

Value Not allowed.

enumerator WICED_BT_GATT_ILLEGAL_PARAMETER

Illegal Parameter.

enumerator WICED_BT_GATT_NO_RESOURCES

No Resources.

enumerator WICED_BT_GATT_INTERNAL_ERROR

Internal Error.

enumerator WICED_BT_GATT_WRONG_STATE

Wrong State.

enumerator WICED_BT_GATT_DB_FULL

DB Full.

enumerator WICED_BT_GATT_BUSY

Busy.

enumerator WICED_BT_GATT_ERROR

Error.

enumerator WICED_BT_GATT_CMD_STARTED

Command Started.

enumerator WICED_BT_GATT_PENDING

Pending.

enumerator WICED_BT_GATT_AUTH_FAIL

Authentication Fail.

enumerator WICED_BT_GATT_MORE

More.

enumerator WICED_BT_GATT_INVALID_CFG

Invalid Configuration.

enumerator WICED_BT_GATT_SERVICE_STARTED

Service Started.

enumerator WICED_BT_GATT_ENCRYPED_MITM

Encrypted MITM.

enumerator WICED_BT_GATT_ENCRYPED_NO_MITM

Encrypted No MITM.

enumerator WICED_BT_GATT_NOT_ENCRYPTED

Not Encrypted.

enumerator WICED_BT_GATT_CONGESTED

Congested.

enumerator WICED_BT_GATT_NOT_ALLOWED

Operation not allowed.

enumerator WICED_BT_GATT_HANDLED

Set by application to indicate it has responded to the message.

enumerator WICED_BT_GATT_NO_PENDING_OPERATION

No pending client operation for the response sent by app.

enumerator WICED_BT_GATT_INDICATION_RESPONSE_PENDING

Indication response pending.

enumerator WICED_BT_GATT_WRITE_REQ_REJECTED

Client Write operation rejected.

enumerator WICED_BT_GATT_CCC_CFG_ERR

Improper Client Char Configuration.

enumerator WICED_BT_GATT_PRC_IN_PROGRESS

Procedure Already in Progress.

enumerator WICED_BT_GATT_OUT_OF_RANGE

Value Out of Range.

enumerator WICED_BT_GATT_BAD_OPCODE

Bad opcode.

enumerator WICED_BT_GATT_INVALID_CONNECTION_ID

Invalid connection id.

enum wiced_bt_gatt_opcode_e

wiced_bt_gatt_opcode_e: GATT Operation Codes.

All GATT_REQ_xxx are sent by the client and received on the server. All GATT_RSP_xxx are sent by the server in response to the specific requests from client All GATT_CMD_xxx are sent by client and received on the server. The server shall not send any response to the received GATT_CMD_xxx

GATT_HANDLE_VALUE_NOTIF, GATT_HANDLE_VALUE_IND and GATT_HANDLE_VALUE_MULTI_NOTIF are sent by server to notify/indicate changes to handle values on the server GATT_HANDLE_VALUE_CONF is sent by the client in response to GATT_HANDLE_VALUE_IND

Values:

enumerator GATT_RSP_ERROR

Error Response.

enumerator GATT_REQ_MTU

Exchange MTU Request.

enumerator GATT_RSP_MTU

Exchange MTU Response.

enumerator GATT_REQ_FIND_INFO

Find Information Request.

enumerator GATT_RSP_FIND_INFO

Find Information Response.

enumerator GATT_REQ_FIND_TYPE_VALUE

Find By Type Value Request.

enumerator GATT_RSP_FIND_TYPE_VALUE

Find By Type Value Response.

enumerator GATT_REQ_READ_BY_TYPE

Read By Type Request.

enumerator GATT_RSP_READ_BY_TYPE

Read By Type Response.

enumerator GATT_REQ_READ

Read Request.

enumerator GATT_RSP_READ

Read Response.

enumerator GATT_REQ_READ_BLOB

Read Blob Request.

enumerator GATT_RSP_READ_BLOB

Read Blob Response.

enumerator GATT_REQ_READ_MULTI

Read Multiple Request.

enumerator GATT_RSP_READ_MULTI

Read Multiple Response.

enumerator GATT_REQ_READ_BY_GRP_TYPE

Read By Group Type Request.

enumerator GATT_RSP_READ_BY_GRP_TYPE

Read By Group Type Response.

enumerator GATT_REQ_WRITE

Write Request.

enumerator GATT_RSP_WRITE

Write Response.

enumerator GATT_REQ_PREPARE_WRITE

Prepare Write Request.

enumerator GATT_RSP_PREPARE_WRITE

Prepare Write Response.

enumerator GATT_REQ_EXECUTE_WRITE

Execute Write Request.

enumerator GATT_RSP_EXECUTE_WRITE

Execute Write Response.

enumerator GATT_HANDLE_VALUE_NOTIF

Handle Value Notification.

enumerator GATT_HANDLE_VALUE_IND

Handle Value Indication.

enumerator GATT_HANDLE_VALUE_CONF

Handle Value Confirmation.

enumerator GATT_REQ_READ_MULTI_VAR_LENGTH

Read Multiple Variable Length Request.

enumerator GATT_RSP_READ_MULTI_VAR_LENGTH

Read Multiple Variable Length Response.

enumerator GATT_HANDLE_VALUE_MULTI_NOTIF

Handle Value Multiple Notifications.

enumerator GATT_CMD_WRITE

Write Command.

enumerator GATT_CMD_SIGNED_WRITE

changed in V4.0 1101-0010 (signed write) see write cmd above

enum wiced_bt_gatt_disconn_reason_e

wiced_bt_gatt_disconn_reason_e: GATT Disconnection reason.

Values:

enumerator GATT_CONN_UNKNOWN

Unknown reason.

enumerator GATT_CONN_L2C_FAILURE

General L2cap failure.

enumerator GATT_CONN_TIMEOUT

Connection timeout.

enumerator GATT_CONN_TERMINATE_PEER_USER

Connection terminated by peer user.

enumerator GATT_CONN_TERMINATE_LOCAL_HOST

Connection terminated by local host.

enumerator GATT_CONN_FAIL_ESTABLISH

Connection fail to establish.

enumerator GATT_CONN_LMP_TIMEOUT

Connection fail due to LMP response tout.

enumerator GATT_CONN_CANCEL

L2CAP connection cancelled.

enum wiced_bt_gatt_client_char_config_e

wiced_bt_gatt_client_char_config_e: characteristic descriptor: client configuration value

Values:

enumerator GATT_CLIENT_CONFIG_NONE

Does not allow both notifications and indications.

enumerator GATT_CLIENT_CONFIG_NOTIFICATION

Allows notifications.

enumerator GATT_CLIENT_CONFIG_INDICATION

Allows indications.

enum wiced_bt_gatt_server_char_config_e

wiced_bt_gatt_server_char_config_e: characteristic descriptor: server configuration value

Values:

enumerator GATT_SERVER_CONFIG_NONE

No broadcast.

enumerator GATT_SERVER_CONFIG_BROADCAST

Broadcast.

enum wiced_bt_gatt_char_properties_e

wiced_bt_gatt_char_properties_e: GATT Characteristic Properties Mask.

Values:

enumerator GATT_CHAR_PROPERTIES_BIT_BROADCAST

bit 0: Broadcast

enumerator GATT_CHAR_PROPERTIES_BIT_READ

bit 1: Read

enumerator GATT_CHAR_PROPERTIES_BIT_WRITE_NR

bit 2: Write (No Response)

enumerator GATT_CHAR_PROPERTIES_BIT_WRITE

bit 3: Write

enumerator GATT_CHAR_PROPERTIES_BIT_NOTIFY

bit 4: Notify

enumerator GATT_CHAR_PROPERTIES_BIT_INDICATE

bit 5: Indicate

enumerator GATT_CHAR_PROPERTIES_BIT_AUTH

bit 6: Authenticate

enumerator GATT_CHAR_PROPERTIES_BIT_EXT_PROP

bit 7: Extended Properties

enum wiced_bt_gatt_auth_req_e

wiced_bt_gatt_auth_req_e: Authentication requirement.

Values:

enumerator GATT_AUTH_REQ_NONE

No Authentication Required.

enumerator GATT_AUTH_REQ_NO_MITM

Unauthenticated encryption (No MITM)

enumerator GATT_AUTH_REQ_MITM

Authenticated encryption (MITM)

enumerator GATT_AUTH_REQ_SIGNED_NO_MITM

Signed Data (No MITM)

enumerator GATT_AUTH_REQ_SIGNED_MITM

Signed Data (MITM)

enum wiced_bt_gatt_exec_flag_e

wiced_bt_gatt_exec_flag_e: GATT Write Execute request flags.

Values:

enumerator GATT_PREPARE_WRITE_CANCEL

GATT_PREP_WRITE_CANCEL.

enumerator GATT_PREPARE_WRITE_EXEC

GATT_PREP_WRITE_EXEC.

enum wiced_bt_gatt_discovery_type_e

wiced_bt_gatt_discovery_type_e: Discovery types.

Values:

enumerator GATT_DISCOVER_SERVICES_ALL

discover all services

enumerator GATT_DISCOVER_SERVICES_BY_UUID

discover service by UUID

enumerator GATT_DISCOVER_INCLUDED_SERVICES

discover an included service within a service

enumerator GATT_DISCOVER_CHARACTERISTICS

discover characteristics of a service with/without type requirement

enumerator GATT_DISCOVER_CHARACTERISTIC_DESCRIPTORS

discover characteristic descriptors of a character

enumerator GATT_DISCOVER_MAX

maximum discovery types

enum wiced_bt_gatt_optype_e

wiced_bt_gatt_optype_e: GATT client operation type, used in client callback function.

Values:

enumerator GATTC_OPTYPE_NONE

None.

enumerator GATTC_OPTYPE_DISCOVERY

Discovery.

enumerator GATTC_OPTYPE_READ_HANDLE

Read handle or Read blob.

enumerator GATTC_OPTYPE_READ_BY_TYPE

Read by type operation.

enumerator GATTC_OPTYPE_READ_MULTIPLE

Read multiple, or read multiple var length.

enumerator GATTC_OPTYPE_WRITE_WITH_RSP

Write with response.

enumerator GATTC_OPTYPE_WRITE_NO_RSP

Write no response.

enumerator GATTC_OPTYPE_PREPARE_WRITE

Prepare Write.

enumerator GATTC_OPTYPE_EXECUTE_WRITE

Execute Write.

enumerator GATTC_OPTYPE_CONFIG_MTU

Configure MTU.

enumerator GATTC_OPTYPE_NOTIFICATION

Notification.

enumerator GATTC_OPTYPE_INDICATION

Indication.

enum wiced_bt_gatt_caching_status_e

wiced_bt_gatt_caching_status_e: GATT caching status of the peer(client)

Values:

enumerator GATT_PEER_CLIENT_CACHE_CHANGE_AWARE

Peer client is cache aware.

enumerator GATT_PEER_CLIENT_CACHE_CHANGE_UNAWARE

Peer client is cache unaware.

enumerator GATT_PEER_CLIENT_CACHE_READY_TO_BE_AWARE

Peer client is reading the database hash.

enum wiced_bt_gatt_format_e

wiced_bt_gatt_format_e: Format of the value of a characteristic.

Enumeration types for the UUID_DESCRIPTOR_CHARACTERISTIC_PRESENTATION_FORMAT descriptor

Values:

enumerator GATT_CHAR_PRESENTATION_FORMAT_RES
enumerator GATT_CHAR_PRESENTATION_FORMAT_BOOL
enumerator GATT_CHAR_PRESENTATION_FORMAT_2BITS
enumerator GATT_CHAR_PRESENTATION_FORMAT_NIBBLE
enumerator GATT_CHAR_PRESENTATION_FORMAT_UINT8
enumerator GATT_CHAR_PRESENTATION_FORMAT_UINT12
enumerator GATT_CHAR_PRESENTATION_FORMAT_UINT16
enumerator GATT_CHAR_PRESENTATION_FORMAT_UINT24
enumerator GATT_CHAR_PRESENTATION_FORMAT_UINT32
enumerator GATT_CHAR_PRESENTATION_FORMAT_UINT48
enumerator GATT_CHAR_PRESENTATION_FORMAT_UINT64
enumerator GATT_CHAR_PRESENTATION_FORMAT_UINT128
enumerator GATT_CHAR_PRESENTATION_FORMAT_SINT8
enumerator GATT_CHAR_PRESENTATION_FORMAT_SINT12
enumerator GATT_CHAR_PRESENTATION_FORMAT_SINT16
enumerator GATT_CHAR_PRESENTATION_FORMAT_SINT24
enumerator GATT_CHAR_PRESENTATION_FORMAT_SINT32
enumerator GATT_CHAR_PRESENTATION_FORMAT_SINT48
enumerator GATT_CHAR_PRESENTATION_FORMAT_SINT64
enumerator GATT_CHAR_PRESENTATION_FORMAT_SINT128
enumerator GATT_CHAR_PRESENTATION_FORMAT_FLOAT32
enumerator GATT_CHAR_PRESENTATION_FORMAT_FLOAT64
enumerator GATT_CHAR_PRESENTATION_FORMAT_SFLOAT
enumerator GATT_CHAR_PRESENTATION_FORMAT_FLOAT
enumerator GATT_CHAR_PRESENTATION_FORMAT_DUINT16
enumerator GATT_CHAR_PRESENTATION_FORMAT_UTF8S
enumerator GATT_CHAR_PRESENTATION_FORMAT_UTF16S
enumerator GATT_CHAR_PRESENTATION_FORMAT_STRUCT
enumerator GATT_CHAR_PRESENTATION_FORMAT_MAX
enum t_gatt_csf_assignments

t_gatt_csf_assignments: .Enumeration of known Client Supported Feature Bit assignments of the wiced_bt_gatt_client_supported_features_t

Values:

enumerator GATT_CSF_ROBUST_CACHING

Client supports Robust Caching.

enumerator GATT_CSF_EATT

Client supports Enhanaced ATT bearers.

enumerator GATT_CSF_MULTIPLE_HANDLE_VALUE_NOTIFICATIONS

Client supports receiving multiple handle value notifications.

enum wiced_bt_gatt_evt_t

wiced_bt_gatt_evt_t: GATT events.

Values:

enumerator GATT_CONNECTION_STATUS_EVT

GATT connection status change.

Event data: wiced_bt_gatt_connection_status_t

enumerator GATT_OPERATION_CPLT_EVT

GATT client events.

Event data: wiced_bt_gatt_event_data_t

enumerator GATT_DISCOVERY_RESULT_EVT

GATT attribute discovery result.

Event data: wiced_bt_gatt_discovery_result_t

enumerator GATT_DISCOVERY_CPLT_EVT

GATT attribute discovery complete.

Event data: wiced_bt_gatt_event_data_t

enumerator GATT_ATTRIBUTE_REQUEST_EVT

GATT attribute request (from remote client).

Event data: wiced_bt_gatt_attribute_request_t

enumerator GATT_CONGESTION_EVT

GATT congestion (running low in tx buffers).

Event data: wiced_bt_gatt_congestion_event_t TODO: add more details regarding congestion

enumerator GATT_GET_RESPONSE_BUFFER_EVT

GATT buffer request, typically sized to max of bearer mtu - 1.

enumerator GATT_APP_BUFFER_TRANSMITTED_EVT

GATT buffer transmitted event, check wiced_bt_gatt_buffer_transmitted_t.

struct wiced_bt_gatt_read_t
#include <wiced_bt_gatt.h>

Attribute read request.

< Opcode request, can be GATT_REQ_READ, GATT_REQ_READ_BLOB

Public Members

uint16_t handle

Handle of attribute to read.

uint16_t offset

Offset to read.

struct wiced_bt_gatt_read_multiple_req_t

Public Members

int num_handles

Number of handles pointed to by p_handle_stream.

uint8_t *p_handle_stream

Stream containing the handles.

struct wiced_bt_gatt_read_multiple_rsp_t
#include <wiced_bt_gatt.h>

Response structure for read multiple .

Public Members

wiced_bt_gatt_opcode_t opcode

Response Opcode, can be GATT_RSP_READ_MULTI or GATT_RSP_READ_MULTI_VAR_LENGTH.

wiced_bt_gatt_read_multiple_req_t req

The request parameters used by client in the wiced_bt_gatt_client_send_read_multiple API.

uint8_t *p_multi_rsp

The response received from the peer.

The response is valid only for GATT_RSP_READ_MULTI. The peer response received for GATT_RSP_READ_MULTI_VAR_LENGTH is split and sent to the app using the GATTC_OPTYPE_READ_HANDLE event.

uint16_t rsp_len

Length of the data pointed to by p_multi_rsp.

struct wiced_bt_gatt_read_by_type_t
#include <wiced_bt_gatt.h>

Parameters for GATT_READ_BY_TYPE and GATT_READ_CHAR_VALUE.

< Opcode request, can be GATT_REQ_READ_MULTI, GATT_REQ_READ_MULTI_VAR_LENGTH

Public Members

uint16_t s_handle

Starting handle.

uint16_t e_handle

Ending handle.

wiced_bt_uuid_t uuid

uuid

struct wiced_bt_gatt_write_hdr_t
#include <wiced_bt_gatt.h>

Attribute header, used for GATT write operations, and read response callbacks.

Public Members

uint16_t handle

Attribute handle.

uint16_t offset

Attribute value offset, ignored if not needed for a command.

uint16_t len

Length of attribute value.

wiced_bt_gatt_auth_req_t auth_req

Authentication requirement (see wiced_bt_gatt_auth_req_t )

struct wiced_bt_gatt_write_req_t
#include <wiced_bt_gatt.h>

Attribute write request.

Public Members

uint16_t handle

Handle of attribute to write.

uint16_t offset

Offset to write.

uint16_t val_len

Value length.

uint8_t *p_val

Value pointer.

struct wiced_bt_gatt_req_conf_t
#include <wiced_bt_gatt.h>

Attribute handle confirmation, sent to app to indicate completion of server events on the server.

Public Members

uint16_t handle

first handle on which the notification or indication was sent

wiced_bt_gatt_opcode_t opcode

GATT_HANDLE_VALUE_NOTIF, GATT_HANDLE_VALUE_IND, GATT_HANDLE_VALUE_MULTI_NOTIF

struct wiced_bt_gatt_execute_write_req_t
#include <wiced_bt_gatt.h>

Attribute handle execution write request received on the client.

Public Members

wiced_bt_gatt_exec_flag_t exec_write

GATT execute flag (see wiced_bt_gatt_exec_flag_e)

union wiced_bt_gatt_request_params_t
#include <wiced_bt_gatt.h>

Attribute information for GATT attribute requests types received on the server.

Public Members

wiced_bt_gatt_read_t read_req

Parameters for GATT_REQ_TYPE_READ, received on GATT_REQ_READ_BY_TYPE, GATT_REQ_READ and GATT_REQ_READ_BLOB.

wiced_bt_gatt_read_multiple_req_t read_multiple_req

Parameters for the GATT_REQ_READ_MULTI and GATT_REQ_READ_MULTI_VAR_LENGTH.

wiced_bt_gatt_read_by_type_t read_by_type

Parameters for GATT_REQ_READ_BY_TYPE.

wiced_bt_gatt_write_req_t write_req

Parameters for GATT_REQ_WRITE and GATT_REQ_PREPARE_WRITE.

uint16_t remote_mtu

Parameters for GATT_REQ_MTU.

wiced_bt_gatt_req_conf_t confirm

Parameters for GATT_HANDLE_VALUE_CONF, GATT_HANDLE_VALUE_NOTIF, GATT_HANDLE_VALUE_MULTI_NOTIF.

wiced_bt_gatt_execute_write_req_t exec_write_req

Parameters for GATTS_REQ_TYPE_WRITE_EXEC.

struct wiced_bt_gatt_discovery_param_t
#include <wiced_bt_gatt.h>

Parameters used in a GATT Discovery.

Public Members

wiced_bt_uuid_t uuid

Service or Characteristic UUID.

uint16_t s_handle

Start handle for range to search.

uint16_t e_handle

End handle for range to search.

struct wiced_bt_gatt_data_t
#include <wiced_bt_gatt.h>

Response data for read operations.

Public Members

uint16_t handle

handle

uint16_t len

length of response data or notification or indication data.

In case of multiple notifications, it is total length of notification tuples pointed by p_data

uint16_t offset

offset

uint8_t *p_data

attribute data.

In case of multiple notifications, it is array of handle length and notification data tuples

union wiced_bt_gatt_operation_complete_rsp_t
#include <wiced_bt_gatt.h>

Client Operation Complete response data.

Public Members

wiced_bt_gatt_data_t att_value

Response data for read operations (initiated using #wiced_bt_gatt_send_read) (or) Notification or Inidcation data (or) Handle length value tuple in case of multiple notifications.

wiced_bt_gatt_read_multiple_rsp_t multi_rsp

Data Response for GATT_REQ_READ_MULTI and Operation complete response for GATT_REQ_READ_MULTI_VAR_LENGTH.

uint16_t mtu

Response data for configuration operations.

uint16_t handle

Response data for write operations (initiated using wiced_bt_gatt_client_send_write)

struct wiced_bt_gatt_char_declaration_t
#include <wiced_bt_gatt.h>

characteristic declaration

Public Members

wiced_bt_gatt_char_properties_t characteristic_properties

characteristic properties (see wiced_bt_gatt_char_properties_t )

uint16_t val_handle

characteristic value attribute handle

uint16_t handle

characteristic declaration handle

wiced_bt_uuid_t char_uuid

characteristic UUID type

struct wiced_bt_gatt_group_value_t
#include <wiced_bt_gatt.h>

GATT group value.

Public Members

wiced_bt_uuid_t service_type

group type

uint16_t s_handle

starting handle of the group

uint16_t e_handle

ending handle of the group

struct wiced_bt_gatt_included_service_t
#include <wiced_bt_gatt.h>

included service attribute value

Public Members

wiced_bt_uuid_t service_type

included service UUID

uint16_t handle

included service handle

uint16_t s_handle

included service starting handle

uint16_t e_handle

included service ending handle

struct wiced_bt_gatt_char_descr_info_t
#include <wiced_bt_gatt.h>

characteristic descriptor information

Public Members

wiced_bt_uuid_t type

descriptor UUID type

uint16_t handle

descriptor attribute handle

union wiced_bt_gatt_discovery_data_t
#include <wiced_bt_gatt.h>

Discovery result data Use GATT_DISCOVERY_RESULT_SERVICE_* or GATT_DISCOVERY_RESULT_CHARACTERISTIC_* macros to parse discovery data)

Public Members

wiced_bt_gatt_included_service_t included_service_type

Result for GATT_DISCOVER_INCLUDED_SERVICES.

wiced_bt_gatt_group_value_t group_value

Result for GATT_DISCOVER_SERVICES_ALL or GATT_DISCOVER_SERVICES_BY_UUID.

wiced_bt_gatt_char_declaration_t characteristic_declaration

Result for GATT_DISCOVER_CHARACTERISTICS.

wiced_bt_gatt_char_descr_info_t char_descr_info

Result for GATT_DISCOVER_CHARACTERISTIC_DESCRIPTORS.

struct wiced_bt_gatt_discovery_result_t
#include <wiced_bt_gatt.h>

Discovery result (used by GATT_DISCOVERY_RESULT_EVT notification)

Public Members

uint16_t conn_id

ID of the connection.

wiced_bt_gatt_discovery_type_t discovery_type

Discovery type (see wiced_bt_gatt_discovery_type_t )

wiced_bt_gatt_discovery_data_t discovery_data

Discovery data.

struct wiced_bt_gatt_discovery_complete_t
#include <wiced_bt_gatt.h>

Discovery Complete (used by GATT_DISCOVERY_CPLT_EVT notification)

Public Members

uint16_t conn_id

ID of the connection.

wiced_bt_gatt_discovery_type_t discovery_type

Discovery type (see wiced_bt_gatt_discovery_type_t )

wiced_bt_gatt_status_t status

Status of clcb_operation.

struct wiced_bt_gatt_operation_complete_t
#include <wiced_bt_gatt.h>

Response to read/write/disc/config operations (used by GATT_OPERATION_CPLT_EVT notification)

Public Members

uint16_t conn_id

ID of the connection.

wiced_bt_gatt_optype_t op

Type of clcb_operation completed (see wiced_bt_gatt_optype_t )

wiced_bt_gatt_status_t status

Status of clcb_operation.

uint8_t pending_events

Number of pending events, used to initiate next read.

wiced_bt_gatt_operation_complete_rsp_t response_data

Response data (dependent on optype)

struct wiced_bt_gatt_connection_status_t
#include <wiced_bt_gatt.h>

GATT connection status (used by GATT_CONNECTION_STATUS_EVT notification)

Public Members

uint8_t *bd_addr

Remote device address.

wiced_bt_ble_address_type_t addr_type

Remmote device address type.

uint16_t conn_id

ID of the connection.

wiced_bool_t connected

TRUE if connected, FALSE if disconnected.

wiced_bt_gatt_disconn_reason_t reason

Reason code (see wiced_bt_gatt_disconn_reason_t )

wiced_bt_transport_t transport

Transport type of the connection.

Link role on this connection.

struct wiced_bt_gatt_attribute_request_t
#include <wiced_bt_gatt.h>

GATT attribute request (used by GATT_ATTRIBUTE_REQUEST_EVT notification)

Public Members

uint16_t conn_id

ID of the connection.

uint16_t len_requested

Max size of data requested as response.

wiced_bt_gatt_opcode_t opcode

GATT request opcode.

wiced_bt_gatt_request_params_t data

Information about attribute being request (dependent on request type)

struct wiced_bt_gatt_congestion_event_t
#include <wiced_bt_gatt.h>

GATT channel congestion/uncongestion (used by GATT_CONGESTION_EVT notification)

Public Members

uint16_t conn_id

ID of the connection.

wiced_bool_t congested

congestion state

struct wiced_bt_gatt_app_response_buffer_t
#include <wiced_bt_gatt.h>

Structure to hold the response buffer and the application context for that buffer Typically the application context is expected to be hint to allow the application to free the buffer.

Public Members

uint8_t *p_app_rsp_buffer

Pointer to assign the buffer allocated by the app.

wiced_bt_gatt_app_context_t p_app_ctxt

Application context.

struct wiced_bt_gatt_buffer_request_t
#include <wiced_bt_gatt.h>

Structure to get a response buffer of the len_requested and the application context for that buffer.

Public Members

uint16_t len_requested

Size of the requested buffer to be returned in p_buffer.

wiced_bt_gatt_app_response_buffer_t buffer

Structure to be filled by the app to return the allocated buffer.

struct wiced_bt_gatt_buffer_transmitted_t
#include <wiced_bt_gatt.h>

Structure to return the application buffer and context given to the stack On client this is the buffer sent to the stack in.

Public Members

wiced_bt_gatt_app_context_t p_app_ctxt
uint8_t *p_app_data
union wiced_bt_gatt_event_data_t
#include <wiced_bt_gatt.h>

Structures for GATT event notifications.

Public Members

wiced_bt_gatt_discovery_result_t discovery_result

Data for GATT_DISCOVERY_RESULT_EVT.

wiced_bt_gatt_discovery_complete_t discovery_complete

Data for GATT_DISCOVERY_CPLT_EVT.

wiced_bt_gatt_operation_complete_t operation_complete

Data for GATT_OPERATION_CPLT_EVT.

wiced_bt_gatt_connection_status_t connection_status

Data for GATT_CONNECTION_STATUS_EVT.

wiced_bt_gatt_attribute_request_t attribute_request

Data for GATT_ATTRIBUTE_REQUEST_EVT.

wiced_bt_gatt_congestion_event_t congestion

Data for GATT_CONGESTION_EVT.

wiced_bt_gatt_buffer_request_t buffer_request

Data for GATT_GET_RESPONSE_BUFFER_EVT.

wiced_bt_gatt_buffer_transmitted_t buffer_xmitted

Data for GATT_APP_BUFFER_TRANSMITTED_EVT.

union wiced_bt_gatt_gap_ble_attr_value_t
#include <wiced_bt_gatt.h>

GATT attribute value included in central role DB.

Public Members

uint8_t addr_resolution

binary value to indicate if addr.

resolution is supported

struct wiced_gattdb_entry_t
#include <wiced_bt_gatt.h>

Structure used by wiced_bt_gattdb APIS, to parse GATTDB.

Public Members

uint16_t handle

attribute Handle

uint8_t perm

attribute permission.

uint8_t len

attribute length .

It excludes the header.

struct wiced_bt_gatt_eatt_connection_indication_event_t
#include <wiced_bt_gatt.h>

GATT connection request (used by GATT_EATT_CONNECTION_INDICATION_EVT notification) To be returned by application for accepting/rejecting the connection with the wiced_bt_eatt_connection_response.

Public Members

wiced_bt_device_address_t bdaddr

Bluetooth address of remote device.

wiced_bt_transport_t transport

Transport type of the connection.

wiced_bt_eatt_lcid_list lcids

List of the l2cap cids (channel ids)

uint16_t mtu

Peer MTU.

uint8_t trans_id

Transaction id for the connection.

struct wiced_bt_gatt_eatt_connection_response_t
#include <wiced_bt_gatt.h>

structure to be used to respond to received EATT connection request

Public Members

wiced_bt_gatt_status_t response

Application response to be sent for the connection request.

uint16_t our_rx_mtu

Application MTU (Maximum Transmission Unit) to be used for the connection.

uint16_t our_rx_mps

Application MPS (Maximum Protocol Size) to be used for the connection.

wiced_bt_eatt_drbs ppDRBs

Data Receive Buffers of our_rx_mtu size to be used for receiving incoming data.

struct wiced_bt_gatt_eatt_connection_confirmation_event_t
#include <wiced_bt_gatt.h>

structure used to deliver the confirmation status of the requested EATT connection

Public Members

wiced_bt_device_address_t bdaddr

Bluetooth address of remote device.

wiced_bt_transport_t transport

Transport type of the connection.

uint16_t conn_id

conn_id of the connection

uint16_t mtu

Peer MTU.

uint16_t result

Result of the connection for the conn_id in wiced_bt_gatt_eatt_connection_confirmation_event_t::conn_id.

struct wiced_bt_gatt_eatt_callbacks_t
#include <wiced_bt_gatt.h>

callbacks for GATT EATT event notifications

Public Members

wiced_bt_gatt_eatt_on_connect_ind_t eatt_connect_ind_cb

callback upon GATT EATT connection

wiced_bt_gatt_eatt_on_connect_complete_t eatt_connect_cmpl_cb

callback upon GATT EATT connection complete

wiced_bt_gatt_eatt_on_reconfigure_ind_t eatt_reconfigure_ind_cb

callback upon GATT EATT reconnection complete

wiced_bt_gatt_eatt_release_drb_t eatt_release_drb

callback upon releasing the DRB