Infineon Logo AIROC BTSDK v4.4 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
wiced_bt_gatt.h File Reference

AIROC Generic Attribute (GATT) Application Programming Interface. More...

Data Structures

struct  wiced_bt_gatt_value_t
 Attribute value, used for GATT write operations, and read response callbacks. More...
 
struct  wiced_bt_gatt_read_t
 Attribute read request. More...
 
struct  wiced_bt_gatt_write_t
 Attribute write request. More...
 
union  wiced_bt_gatt_request_data_t
 Attribute information for GATT attribute requests. More...
 
struct  wiced_bt_gatt_discovery_param_t
 Parameters used in a GATT Discovery. More...
 
struct  wiced_bt_gatt_read_by_type_t
 Parameters for GATT_READ_BY_TYPE and GATT_READ_CHAR_VALUE. More...
 
struct  wiced_bt_gatt_read_multi_t
 Parameters for GATT_READ_MULTIPLE. More...
 
struct  wiced_bt_gatt_read_by_handle_t
 Parameters for GATT_READ_BY_HANDLE. More...
 
struct  wiced_bt_gatt_read_partial_t
 Parameters for GATT_READ_PARTIAL. More...
 
union  wiced_bt_gatt_read_param_t
 Read request parameters - used when calling wiced_bt_gatt_send_read. More...
 
struct  wiced_bt_gatt_data_t
 Response data for read operations. More...
 
union  wiced_bt_gatt_operation_complete_rsp_t
 Client Operation Complete response data (dependent on operation completed) More...
 
struct  wiced_bt_gatt_char_declaration_t
 characteristic declaration More...
 
struct  wiced_bt_gatt_group_value_t
 GATT group value. More...
 
struct  wiced_bt_gatt_included_service_t
 included service attribute value More...
 
struct  wiced_bt_gatt_char_descr_info_t
 characteristic descriptor information More...
 
union  wiced_bt_gatt_discovery_data_t
 Discovery result data Use GATT_DISCOVERY_RESULT_SERVICE_* or GATT_DISCOVERY_RESULT_CHARACTERISTIC_* macros to parse discovery data) More...
 
struct  wiced_bt_gatt_discovery_result_t
 Discovery result (used by GATT_DISCOVERY_RESULT_EVT notification) More...
 
struct  wiced_bt_gatt_discovery_complete_t
 Discovery Complete (used by GATT_DISCOVERY_CPLT_EVT notification) More...
 
struct  wiced_bt_gatt_operation_complete_t
 Response to read/write/disc/config operations (used by GATT_OPERATION_CPLT_EVT notification) More...
 
struct  wiced_bt_gatt_connection_status_t
 GATT connection status (used by GATT_CONNECTION_STATUS_EVT notification) More...
 
struct  wiced_bt_gatt_attribute_request_t
 GATT attribute request (used by GATT_ATTRIBUTE_REQUEST_EVT notification) More...
 
struct  wiced_bt_gatt_congestion_event_t
 GATT channel congestion/uncongestion (used by GATT_CONGESTION_EVT notification) More...
 
union  wiced_bt_gatt_event_data_t
 Stuctures for GATT event notifications. More...
 
struct  wiced_bt_gatt_gap_ble_pref_param_t
 GATT attribute structure for preferred connection parameters. More...
 
union  wiced_bt_gatt_gap_ble_attr_value_t
 GATT attribute value included in central role DB. More...
 

Macros

#define GATT_RSP_ERROR   0x01
 GATT Operation Codes. More...
 
#define GATT_REQ_MTU   0x02
 Exchange MTU Request.
 
#define GATT_RSP_MTU   0x03
 Exchange MTU Response.
 
#define GATT_REQ_FIND_INFO   0x04
 Find Information Request.
 
#define GATT_RSP_FIND_INFO   0x05
 Find Information Response.
 
#define GATT_REQ_FIND_TYPE_VALUE   0x06
 Find By Type Value Request.
 
#define GATT_RSP_FIND_TYPE_VALUE   0x07
 Find By Type Value Response.
 
#define GATT_REQ_READ_BY_TYPE   0x08
 Read By Type Request.
 
#define GATT_RSP_READ_BY_TYPE   0x09
 Read By Type Response.
 
#define GATT_REQ_READ   0x0A
 Read Request.
 
#define GATT_RSP_READ   0x0B
 Read Response.
 
#define GATT_REQ_READ_BLOB   0x0C
 Read Blob Request.
 
#define GATT_RSP_READ_BLOB   0x0D
 Read Blob Response.
 
#define GATT_REQ_READ_MULTI   0x0E
 Read Multiple Request.
 
#define GATT_RSP_READ_MULTI   0x0F
 Read Multiple Response.
 
#define GATT_REQ_READ_BY_GRP_TYPE   0x10
 Read By Group Type Request.
 
#define GATT_RSP_READ_BY_GRP_TYPE   0x11
 Read By Group Type Response.
 
#define GATT_REQ_WRITE   0x12
 Write Request.
 
#define GATT_RSP_WRITE   0x13
 Write Request.
 
#define GATT_CMD_WRITE   0x52
 Write Command.
 
#define GATT_REQ_PREPARE_WRITE   0x16
 Prepare Write Request.
 
#define GATT_RSP_PREPARE_WRITE   0x17
 Prepare Write Response.
 
#define GATT_REQ_EXEC_WRITE   0x18
 Execute Write Request.
 
#define GATT_RSP_EXEC_WRITE   0x19
 Execute Write Response.
 
#define GATT_HANDLE_VALUE_NOTIF   0x1B
 Handle Value Notification.
 
#define GATT_HANDLE_VALUE_IND   0x1D
 Handle Value Indication.
 
#define GATT_HANDLE_VALUE_CONF   0x1E
 Handle Value Confirmation.
 
#define GATT_OP_CODE_MAX   (GATT_HANDLE_VALUE_CONF + 1)
 Maximum opcode value.
 
#define GATT_SIGN_CMD_WRITE   0xD2
 changed in V4.0 1101-0010 (signed write) see write cmd above
 
#define GATT_DEF_BLE_MTU_SIZE   23
 
#define GATT_INVALID_CONN_ID   0xFFFF
 
#define GATT_SERVER_CONFIG_NONE   0x0000
 characteristic descriptor: server configuration value More...
 
#define GATT_SERVER_CONFIG_BROADCAST   0x0001
 Broadcast.
 
#define GATT_DISCOVERY_RESULT_SERVICE_START_HANDLE(p_event_data)   (p_event_data->discovery_result.discovery_data.group_value.s_handle)
 
#define GATT_DISCOVERY_RESULT_SERVICE_END_HANDLE(p_event_data)   (p_event_data->discovery_result.discovery_data.group_value.e_handle)
 
#define GATT_DISCOVERY_RESULT_SERVICE_UUID_LEN(p_event_data)   (p_event_data->discovery_result.discovery_data.group_value.service_type.len)
 
#define GATT_DISCOVERY_RESULT_SERVICE_UUID16(p_event_data)   (p_event_data->discovery_result.discovery_data.group_value.service_type.uu.uuid16)
 
#define GATT_DISCOVERY_RESULT_SERVICE_UUID32(p_event_data)   (p_event_data->discovery_result.discovery_data.group_value.service_type.uu.uuid32)
 
#define GATT_DISCOVERY_RESULT_SERVICE_UUID128(p_event_data)   (p_event_data->discovery_result.discovery_data.group_value.service_type.uu.uuid128)
 
#define GATT_DISCOVERY_RESULT_CHARACTERISTIC_DESCRIPTOR_UUID_LEN(p_event_data)   (p_event_data->discovery_result.discovery_data.char_descr_info.type.len)
 
#define GATT_DISCOVERY_RESULT_CHARACTERISTIC_DESCRIPTOR_UUID16(p_event_data)   (p_event_data->discovery_result.discovery_data.char_descr_info.type.uu.uuid16)
 
#define GATT_DISCOVERY_RESULT_CHARACTERISTIC_DESCRIPTOR_UUID32(p_event_data)   (p_event_data->discovery_result.discovery_data.char_descr_info.type.uu.uuid32)
 
#define GATT_DISCOVERY_RESULT_CHARACTERISTIC_DESCRIPTOR_UUID128(p_event_data)   (p_event_data->discovery_result.discovery_data.char_descr_info.type.uu.uuid128)
 
#define GATT_DISCOVERY_RESULT_CHARACTERISTIC_DESCRIPTOR_VALUE_HANDLE(p_event_data)   (p_event_data->discovery_result.discovery_data.char_descr_info.handle)
 
#define GATT_DISCOVERY_RESULT_CHARACTERISTIC_VALUE_HANDLE(p_event_data)   (p_event_data->discovery_result.discovery_data.characteristic_declaration.val_handle)
 
#define GATT_DISCOVERY_RESULT_CHARACTERISTIC_UUID_LEN(p_event_data)   (p_event_data->discovery_result.discovery_data.characteristic_declaration.char_uuid.len)
 
#define GATT_DISCOVERY_RESULT_CHARACTERISTIC_UUID16(p_event_data)   (p_event_data->discovery_result.discovery_data.characteristic_declaration.char_uuid.uu.uuid16)
 
#define GATT_DISCOVERY_RESULT_CHARACTERISTIC_UUID32(p_event_data)   (p_event_data->discovery_result.discovery_data.characteristic_declaration.char_uuid.uu.uuid32)
 
#define GATT_DISCOVERY_RESULT_CHARACTERISTIC_UUID128(p_event_data)   (p_event_data->discovery_result.discovery_data.characteristic_declaration.char_uuid.uu.uuid128)
 
#define GATT_RESPONSE_SIZE(attr_val_len)   ( sizeof( wiced_bt_gatt_value_t ) - 1 + attr_val_len )
 
#define GATT_MAX_READ_MULTI_HANDLES   10
 Max attributes allowed in one GATT_READ_MULTIPLE request.
 
#define GATT_LINK_IDLE_TIMEOUT_WHEN_NO_APP   0 /* start a idle timer for this duration when no application need to use the link */
 
#define GATT_LINK_NO_IDLE_TIMEOUT   0xFFFF
 
#define GATT_INVALID_ACL_HANDLE   0xFFFF
 
#define GATT_HANDLE_IS_VALID(x)   ((x) != 0)
 
#define GATTDB_PERM_NONE   (0x00)
 
#define GATTDB_PERM_VARIABLE_LENGTH   (0x1 << 0)
 
#define GATTDB_PERM_READABLE   (0x1 << 1)
 
#define GATTDB_PERM_WRITE_CMD   (0x1 << 2)
 
#define GATTDB_PERM_WRITE_REQ   (0x1 << 3)
 
#define GATTDB_PERM_AUTH_READABLE   (0x1 << 4)
 
#define GATTDB_PERM_RELIABLE_WRITE   (0x1 << 5)
 
#define GATTDB_PERM_AUTH_WRITABLE   (0x1 << 6)
 
#define GATTDB_PERM_WRITABLE   (GATTDB_PERM_WRITE_CMD | GATTDB_PERM_WRITE_REQ| GATTDB_PERM_AUTH_WRITABLE)
 
#define GATTDB_PERM_MASK   (0x7f) /* All the permission bits. */
 
#define GATTDB_PERM_SERVICE_UUID_128   (0x1 << 7)
 
#define GATTDB_CHAR_PROP_BROADCAST   (0x1 << 0)
 
#define GATTDB_CHAR_PROP_READ   (0x1 << 1)
 
#define GATTDB_CHAR_PROP_WRITE_NO_RESPONSE   (0x1 << 2)
 
#define GATTDB_CHAR_PROP_WRITE   (0x1 << 3)
 
#define GATTDB_CHAR_PROP_NOTIFY   (0x1 << 4)
 
#define GATTDB_CHAR_PROP_INDICATE   (0x1 << 5)
 
#define GATTDB_CHAR_PROP_AUTHD_WRITES   (0x1 << 6)
 
#define GATTDB_CHAR_PROP_EXTENDED   (0x1 << 7)
 
#define BIT16_TO_8(val)
 
#define GATTDB_UUID16_SIZE   2
 
#define GATTDB_UUID128_SIZE   16
 
#define LEGATTDB_PERM_NONE   GATTDB_PERM_NONE
 
#define LEGATTDB_PERM_VARIABLE_LENGTH   GATTDB_PERM_VARIABLE_LENGTH
 
#define LEGATTDB_PERM_READABLE   GATTDB_PERM_READABLE
 
#define LEGATTDB_PERM_WRITE_CMD   GATTDB_PERM_WRITE_CMD
 
#define LEGATTDB_PERM_WRITE_REQ   GATTDB_PERM_WRITE_REQ
 
#define LEGATTDB_PERM_AUTH_READABLE   GATTDB_PERM_AUTH_READABLE
 
#define LEGATTDB_PERM_RELIABLE_WRITE   GATTDB_PERM_RELIABLE_WRITE
 
#define LEGATTDB_PERM_AUTH_WRITABLE   GATTDB_PERM_AUTH_WRITABLE
 
#define LEGATTDB_PERM_WRITABLE   GATTDB_PERM_WRITABLE
 
#define LEGATTDB_PERM_MASK   GATTDB_PERM_MASK
 
#define LEGATTDB_PERM_SERVICE_UUID_128   GATTDB_PERM_SERVICE_UUID_128
 
#define LEGATTDB_CHAR_PROP_BROADCAST   GATTDB_CHAR_PROP_BROADCAST
 
#define LEGATTDB_CHAR_PROP_READ   GATTDB_CHAR_PROP_READ
 
#define LEGATTDB_CHAR_PROP_WRITE_NO_RESPONSE   GATTDB_CHAR_PROP_WRITE_NO_RESPONSE
 
#define LEGATTDB_CHAR_PROP_WRITE   GATTDB_CHAR_PROP_WRITE
 
#define LEGATTDB_CHAR_PROP_NOTIFY   GATTDB_CHAR_PROP_NOTIFY
 
#define LEGATTDB_CHAR_PROP_INDICATE   GATTDB_CHAR_PROP_INDICATE
 
#define LEGATTDB_CHAR_PROP_AUTHD_WRITES   GATTDB_CHAR_PROP_AUTHD_WRITES
 
#define LEGATTDB_CHAR_PROP_EXTENDED   GATTDB_CHAR_PROP_EXTENDED
 
#define LEGATTDB_UUID16_SIZE   GATTDB_UUID16_SIZE
 
#define LEGATTDB_UUID128_SIZE   GATTDB_UUID128_SIZE
 
#define ATTRIBUTE16(handle, permission, datalen, uuid)
 
#define PRIMARY_SERVICE_UUID16(handle, service)
 
#define PRIMARY_SERVICE_UUID128(handle, service)
 
#define SECONDARY_SERVICE_UUID16(handle, service)
 
#define SECONDARY_SERVICE_UUID128(handle, service)
 
#define INCLUDE_SERVICE_UUID16(handle, service_handle, end_group_handle, service)
 
#define INCLUDE_SERVICE_UUID128(handle, service_handle, end_group_handle)
 
#define CHARACTERISTIC_UUID16(handle, handle_value, uuid, properties, permission)
 
#define CHARACTERISTIC_UUID128(handle, handle_value, uuid, properties, permission)
 
#define CHARACTERISTIC_UUID16_WRITABLE(handle, handle_value, uuid, properties, permission)
 
#define CHARACTERISTIC_UUID128_WRITABLE(handle, handle_value, uuid, properties, permission)
 
#define CHAR_DESCRIPTOR_UUID16_WRITABLE(handle, uuid, permission)
 
#define CHAR_DESCRIPTOR_UUID16(handle, uuid, permission)
 
#define CHAR_DESCRIPTOR_UUID128_WRITABLE(handle, uuid, permission)
 
#define CHAR_DESCRIPTOR_UUID128(handle, uuid, permission)
 

Typedefs

typedef uint8_t wiced_bt_gatt_status_t
 GATT status (see wiced_bt_gatt_status_e)
 
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_request_type_t
 GATT Attribute Request Type (see wiced_bt_gatt_request_type_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_read_type_t
 GATT read type (see wiced_bt_gatt_read_type_e)
 
typedef uint8_t wiced_bt_gatt_write_type_t
 GATT write type (see wiced_bt_gatt_write_type_e)
 
typedef uint8_t wiced_bt_gatt_optype_t
 GATT operation type (see wiced_bt_gatt_optype_e)
 
typedef uint16_t wiced_bt_gatt_appearance_t
 GATT appearance (see #gatt_appearance_e)
 
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. More...
 
struct {
   uint16_t   handle
 atribute Handle
 
   uint8_t   perm
 attribute permission. More...
 
   uint8_t   len
 attribute length . More...
 
wiced_gattdb_entry_t
 Structure used by wiced_bt_gattdb APIS, to parse GATTDB.
 

Enumerations

enum  wiced_bt_gatt_status_e {
  WICED_BT_GATT_SUCCESS = 0x00, WICED_BT_GATT_INVALID_HANDLE = 0x01, WICED_BT_GATT_READ_NOT_PERMIT = 0x02, WICED_BT_GATT_WRITE_NOT_PERMIT = 0x03,
  WICED_BT_GATT_INVALID_PDU = 0x04, WICED_BT_GATT_INSUF_AUTHENTICATION = 0x05, WICED_BT_GATT_REQ_NOT_SUPPORTED = 0x06, WICED_BT_GATT_INVALID_OFFSET = 0x07,
  WICED_BT_GATT_INSUF_AUTHORIZATION = 0x08, WICED_BT_GATT_PREPARE_Q_FULL = 0x09, WICED_BT_GATT_NOT_FOUND = 0x0a, WICED_BT_GATT_NOT_LONG = 0x0b,
  WICED_BT_GATT_INSUF_KEY_SIZE = 0x0c, WICED_BT_GATT_INVALID_ATTR_LEN = 0x0d, WICED_BT_GATT_ERR_UNLIKELY = 0x0e, WICED_BT_GATT_INSUF_ENCRYPTION = 0x0f,
  WICED_BT_GATT_UNSUPPORT_GRP_TYPE = 0x10, WICED_BT_GATT_INSUF_RESOURCE = 0x11, WICED_BT_GATT_DATABASE_OUT_OF_SYNC = 0x12, WICED_BT_GATT_VALUE_NOT_ALLOWED = 0x13,
  WICED_BT_GATT_ILLEGAL_PARAMETER = 0x87, WICED_BT_GATT_NO_RESOURCES = 0x80, WICED_BT_GATT_INTERNAL_ERROR = 0x81, WICED_BT_GATT_WRONG_STATE = 0x82,
  WICED_BT_GATT_DB_FULL = 0x83, WICED_BT_GATT_BUSY = 0x84, WICED_BT_GATT_ERROR = 0x85, WICED_BT_GATT_CMD_STARTED = 0x86,
  WICED_BT_GATT_PENDING = 0x88, WICED_BT_GATT_AUTH_FAIL = 0x89, WICED_BT_GATT_MORE = 0x8a, WICED_BT_GATT_INVALID_CFG = 0x8b,
  WICED_BT_GATT_SERVICE_STARTED = 0x8c, WICED_BT_GATT_ENCRYPED_MITM = WICED_BT_GATT_SUCCESS, WICED_BT_GATT_ENCRYPED_NO_MITM = 0x8d, WICED_BT_GATT_NOT_ENCRYPTED = 0x8e,
  WICED_BT_GATT_CONGESTED = 0x8f, WICED_BT_GATT_WRITE_REQ_REJECTED = 0xFC, WICED_BT_GATT_CCC_CFG_ERR = 0xFD, WICED_BT_GATT_PRC_IN_PROGRESS = 0xFE,
  WICED_BT_GATT_OUT_OF_RANGE = 0xFF
}
 GATT Status Codes. More...
 
enum  wiced_bt_gatt_disconn_reason_e {
  GATT_CONN_UNKNOWN = 0, GATT_CONN_L2C_FAILURE = 1, GATT_CONN_TIMEOUT = HCI_ERR_CONNECTION_TOUT, GATT_CONN_TERMINATE_PEER_USER = HCI_ERR_PEER_USER,
  GATT_CONN_TERMINATE_LOCAL_HOST = HCI_ERR_CONN_CAUSE_LOCAL_HOST, GATT_CONN_FAIL_ESTABLISH = HCI_ERR_CONN_FAILED_ESTABLISHMENT, GATT_CONN_LMP_TIMEOUT = HCI_ERR_LMP_RESPONSE_TIMEOUT, GATT_CONN_CANCEL = L2CAP_CONN_CANCEL
}
 GATT Disconnection reason. More...
 
enum  wiced_bt_gatt_client_char_config_e { GATT_CLIENT_CONFIG_NONE = 0x0000, GATT_CLIENT_CONFIG_NOTIFICATION = 0x0001, GATT_CLIENT_CONFIG_INDICATION = 0x0002 }
 characteristic descriptor: client configuration value More...
 
enum  wiced_bt_gatt_char_properties_e {
  GATT_CHAR_PROPERTIES_BIT_BROADCAST = (1 << 0), GATT_CHAR_PROPERTIES_BIT_READ = (1 << 1), GATT_CHAR_PROPERTIES_BIT_WRITE_NR = (1 << 2), GATT_CHAR_PROPERTIES_BIT_WRITE = (1 << 3),
  GATT_CHAR_PROPERTIES_BIT_NOTIFY = (1 << 4), GATT_CHAR_PROPERTIES_BIT_INDICATE = (1 << 5), GATT_CHAR_PROPERTIES_BIT_AUTH = (1 << 6), GATT_CHAR_PROPERTIES_BIT_EXT_PROP = (1 << 7)
}
 GATT Characteristic Properties Mask. More...
 
enum  wiced_bt_gatt_auth_req_e {
  GATT_AUTH_REQ_NONE = 0, GATT_AUTH_REQ_NO_MITM = 1, GATT_AUTH_REQ_MITM = 2, GATT_AUTH_REQ_SIGNED_NO_MITM = 3,
  GATT_AUTH_REQ_SIGNED_MITM = 4
}
 Authentication requirement. More...
 
enum  wiced_bt_gatt_exec_flag_e { GATT_PREP_WRITE_CANCEL = 0x00, GATT_PREP_WRITE_EXEC = 0x01 }
 GATT Write Execute request flags. More...
 
enum  wiced_bt_gatt_request_type_e {
  GATTS_REQ_TYPE_READ = 1, GATTS_REQ_TYPE_WRITE, GATTS_REQ_TYPE_PREP_WRITE, GATTS_REQ_TYPE_WRITE_EXEC,
  GATTS_REQ_TYPE_MTU, GATTS_REQ_TYPE_CONF
}
 GATT Attribute Request Type. More...
 
enum  wiced_bt_gatt_discovery_type_e {
  GATT_DISCOVER_SERVICES_ALL = 1, GATT_DISCOVER_SERVICES_BY_UUID, GATT_DISCOVER_INCLUDED_SERVICES, GATT_DISCOVER_CHARACTERISTICS,
  GATT_DISCOVER_CHARACTERISTIC_DESCRIPTORS, GATT_DISCOVER_MAX
}
 Discovery types. More...
 
enum  wiced_bt_gatt_read_type_e {
  GATT_READ_BY_TYPE = 1, GATT_READ_BY_HANDLE, GATT_READ_MULTIPLE, GATT_READ_CHAR_VALUE,
  GATT_READ_PARTIAL, GATT_READ_MAX
}
 GATT Read Types. More...
 
enum  wiced_bt_gatt_write_type_e { GATT_WRITE_NO_RSP = 1, GATT_WRITE, GATT_WRITE_PREPARE }
 Write request types - used when calling wiced_bt_gatt_send_write. More...
 
enum  wiced_bt_gatt_optype_e {
  GATTC_OPTYPE_NONE = 0, GATTC_OPTYPE_DISCOVERY = 1, GATTC_OPTYPE_READ = 2, GATTC_OPTYPE_WRITE = 3,
  GATTC_OPTYPE_EXE_WRITE = 4, GATTC_OPTYPE_CONFIG = 5, GATTC_OPTYPE_NOTIFICATION = 6, GATTC_OPTYPE_INDICATION = 7
}
 GATT client operation type, used in client callback function. More...
 
enum  wiced_bt_gatt_evt_t {
  GATT_CONNECTION_STATUS_EVT, GATT_OPERATION_CPLT_EVT, GATT_DISCOVERY_RESULT_EVT, GATT_DISCOVERY_CPLT_EVT,
  GATT_ATTRIBUTE_REQUEST_EVT, GATT_CONGESTION_EVT
}
 GATT events. More...
 

Functions

wiced_bt_gatt_status_t wiced_bt_gatt_db_init (const uint8_t *p_gatt_db, uint16_t gatt_db_size)
 Function wiced_bt_gatt_db_init. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_send_indication (uint16_t conn_id, uint16_t attr_handle, uint16_t val_len, uint8_t *p_val)
 Function wiced_bt_gatt_send_indication. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_send_notification (uint16_t conn_id, uint16_t attr_handle, uint16_t val_len, uint8_t *p_val)
 Function wiced_bt_gatt_send_notification. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_send_response (wiced_bt_gatt_status_t status, uint16_t conn_id, uint16_t attr_handle, uint16_t attr_len, uint16_t offset, uint8_t *p_attr)
 Function wiced_bt_gatt_send_response. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_configure_mtu (uint16_t conn_id, uint16_t mtu)
 Function wiced_bt_gatt_configure_mtu. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_send_discover (uint16_t conn_id, wiced_bt_gatt_discovery_type_t discovery_type, wiced_bt_gatt_discovery_param_t *p_discovery_param)
 Function wiced_bt_gatt_send_discover. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_send_read (uint16_t conn_id, wiced_bt_gatt_read_type_t type, wiced_bt_gatt_read_param_t *p_read)
 Function wiced_bt_gatt_send_read. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_send_write (uint16_t conn_id, wiced_bt_gatt_write_type_t type, wiced_bt_gatt_value_t *p_write)
 Function wiced_bt_gatt_send_write. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_send_execute_write (uint16_t conn_id, wiced_bool_t is_execute)
 Function wiced_bt_gatt_send_execute_write. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_send_indication_confirm (uint16_t conn_id, uint16_t handle)
 Function wiced_bt_gatt_send_indication_confirm. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_register (wiced_bt_gatt_cback_t *p_gatt_cback)
 Function wiced_bt_gatt_register. More...
 
wiced_bool_t wiced_bt_gatt_le_connect (wiced_bt_device_address_t bd_addr, wiced_bt_ble_address_type_t bd_addr_type, wiced_bt_ble_conn_mode_t conn_mode, wiced_bool_t is_direct)
 Function wiced_bt_gatt_le_connect. More...
 
wiced_bool_t wiced_bt_gatt_bredr_connect (wiced_bt_device_address_t bd_addr)
 Function wiced_bt_gatt_bredr_connect. More...
 
wiced_bool_t wiced_bt_gatt_cancel_connect (wiced_bt_device_address_t bd_addr, wiced_bool_t is_direct)
 Function wiced_bt_gatt_cancel_connect. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_disconnect (uint16_t conn_id)
 Function wiced_bt_gatt_disconnect. More...
 
wiced_bool_t wiced_bt_gatt_listen (wiced_bool_t start, wiced_bt_device_address_t bd_addr)
 Function wiced_bt_gatt_listen. More...
 
uint8_t wiced_bt_gatt_get_uncompleted_tx_packet_count (uint16_t conn_id)
 Function wiced_bt_gatt_get_uncompleted_tx_packet_count. More...
 
wiced_gattdb_entry_twiced_bt_gattdb_next_entry (wiced_gattdb_entry_t *p_db_entry)
 Function wiced_bt_gattdb_next_entry. More...
 
uint16_t wiced_bt_gattdb_get_handle (wiced_gattdb_entry_t *p_db_entry)
 Function wiced_bt_gattdb_get_handle. More...
 
int wiced_bt_gattdb_get_attribute_uuid (wiced_gattdb_entry_t *p_db_entry, uint8_t *p_uuid)
 Function wiced_bt_gattdb_get_attribute_uuid. More...
 
uint16_t wiced_bt_gattdb_get_attribute_value_uuid16 (wiced_gattdb_entry_t *p_db_entry)
 Function wiced_bt_gattdb_get_attribute_value_uuid16. More...
 
uint16_t wiced_bt_gattdb_get_charcteristic_descriptor_handle (uint16_t char_handle, uint16_t descriptor_uuid)
 Function wiced_bt_gattdb_get_charcteristic_descriptor_handle. More...
 

Detailed Description

AIROC Generic Attribute (GATT) Application Programming Interface.

Macro Definition Documentation

#define ATTRIBUTE16 (   handle,
  permission,
  datalen,
  uuid 
)
Value:
BIT16_TO_8(handle), \
(uint8_t)(permission), \
(uint8_t)(datalen + 2), \
BIT16_TO_8(uuid)
uint8_t uuid[16]
UUID of the node to provision.
Definition: wiced_bt_mesh_core.h:137
uint16_t handle
atribute Handle
Definition: wiced_bt_gatt.h:761
#define BIT16_TO_8 (   val)
Value:
(uint8_t)( (val) & 0xff),/* LSB */ \
(uint8_t)(( (val) >> 8 ) & 0xff) /* MSB */
#define CHAR_DESCRIPTOR_UUID128 (   handle,
  uuid,
  permission 
)
Value:
BIT16_TO_8((uint16_t)(handle)), \
(uint8_t)(permission | GATTDB_PERM_SERVICE_UUID_128), \
(uint8_t)(GATTDB_UUID128_SIZE), \
uint8_t uuid[16]
UUID of the node to provision.
Definition: wiced_bt_mesh_core.h:137
uint16_t handle
atribute Handle
Definition: wiced_bt_gatt.h:761
#define CHAR_DESCRIPTOR_UUID128_WRITABLE (   handle,
  uuid,
  permission 
)
Value:
BIT16_TO_8((uint16_t)(handle)), \
(uint8_t)(permission | GATTDB_PERM_SERVICE_UUID_128), \
(uint8_t)(GATTDB_UUID128_SIZE), \
(uint8_t)(0), \
uint8_t uuid[16]
UUID of the node to provision.
Definition: wiced_bt_mesh_core.h:137
uint16_t handle
atribute Handle
Definition: wiced_bt_gatt.h:761
#define CHAR_DESCRIPTOR_UUID16 (   handle,
  uuid,
  permission 
)
Value:
BIT16_TO_8((uint16_t)(handle)), \
(uint8_t)(permission), \
(uint8_t)(GATTDB_UUID16_SIZE), \
BIT16_TO_8(uuid)
uint8_t uuid[16]
UUID of the node to provision.
Definition: wiced_bt_mesh_core.h:137
uint16_t handle
atribute Handle
Definition: wiced_bt_gatt.h:761
#define CHAR_DESCRIPTOR_UUID16_WRITABLE (   handle,
  uuid,
  permission 
)
Value:
BIT16_TO_8((uint16_t)(handle)), \
(uint8_t)(permission), \
(uint8_t)(GATTDB_UUID16_SIZE), \
(uint8_t)(0), \
BIT16_TO_8(uuid)
uint8_t uuid[16]
UUID of the node to provision.
Definition: wiced_bt_mesh_core.h:137
uint16_t handle
atribute Handle
Definition: wiced_bt_gatt.h:761
#define CHARACTERISTIC_UUID128 (   handle,
  handle_value,
  uuid,
  properties,
  permission 
)
Value:
BIT16_TO_8((uint16_t)(handle)), \
GATTDB_PERM_READABLE, \
21, \
BIT16_TO_8(GATT_UUID_CHAR_DECLARE), \
(uint8_t)(properties), \
BIT16_TO_8((uint16_t)(handle_value)), \
BIT16_TO_8((uint16_t)(handle_value)), \
(uint8_t)(permission | GATTDB_PERM_SERVICE_UUID_128), \
(uint8_t)(GATTDB_UUID128_SIZE), \
wiced_bt_mesh_core_config_property_t * properties
Array of properties of that element.
Definition: wiced_bt_mesh_cfg.h:209
uint8_t uuid[16]
UUID of the node to provision.
Definition: wiced_bt_mesh_core.h:137
uint16_t handle
atribute Handle
Definition: wiced_bt_gatt.h:761
#define CHARACTERISTIC_UUID128_WRITABLE (   handle,
  handle_value,
  uuid,
  properties,
  permission 
)
Value:
BIT16_TO_8((uint16_t)(handle)), \
GATTDB_PERM_READABLE, \
21, \
BIT16_TO_8(GATT_UUID_CHAR_DECLARE), \
(uint8_t)(properties), \
BIT16_TO_8((uint16_t)(handle_value)), \
BIT16_TO_8((uint16_t)(handle_value)), \
(uint8_t)(permission | GATTDB_PERM_SERVICE_UUID_128), \
(uint8_t)(GATTDB_UUID128_SIZE), \
(uint8_t)(0), \
wiced_bt_mesh_core_config_property_t * properties
Array of properties of that element.
Definition: wiced_bt_mesh_cfg.h:209
uint8_t uuid[16]
UUID of the node to provision.
Definition: wiced_bt_mesh_core.h:137
uint16_t handle
atribute Handle
Definition: wiced_bt_gatt.h:761
#define CHARACTERISTIC_UUID16 (   handle,
  handle_value,
  uuid,
  properties,
  permission 
)
Value:
BIT16_TO_8((uint16_t)(handle)), \
GATTDB_PERM_READABLE, \
0x07, \
BIT16_TO_8(GATT_UUID_CHAR_DECLARE), \
(uint8_t)(properties), \
BIT16_TO_8((uint16_t)(handle_value)), \
BIT16_TO_8(uuid), \
BIT16_TO_8((uint16_t)(handle_value)), \
(uint8_t)(permission), \
(uint8_t)(GATTDB_UUID16_SIZE), \
BIT16_TO_8(uuid)
wiced_bt_mesh_core_config_property_t * properties
Array of properties of that element.
Definition: wiced_bt_mesh_cfg.h:209
uint8_t uuid[16]
UUID of the node to provision.
Definition: wiced_bt_mesh_core.h:137
uint16_t handle
atribute Handle
Definition: wiced_bt_gatt.h:761
#define CHARACTERISTIC_UUID16_WRITABLE (   handle,
  handle_value,
  uuid,
  properties,
  permission 
)
Value:
BIT16_TO_8((uint16_t)(handle)), \
GATTDB_PERM_READABLE, \
0x07, \
BIT16_TO_8(GATT_UUID_CHAR_DECLARE), \
(uint8_t)(properties), \
BIT16_TO_8((uint16_t)(handle_value)), \
BIT16_TO_8(uuid), \
BIT16_TO_8((uint16_t)(handle_value)), \
(uint8_t)(permission), \
(uint8_t)(GATTDB_UUID16_SIZE), \
(uint8_t)(0), \
BIT16_TO_8(uuid)
wiced_bt_mesh_core_config_property_t * properties
Array of properties of that element.
Definition: wiced_bt_mesh_cfg.h:209
uint8_t uuid[16]
UUID of the node to provision.
Definition: wiced_bt_mesh_core.h:137
uint16_t handle
atribute Handle
Definition: wiced_bt_gatt.h:761
#define GATT_RSP_ERROR   0x01

GATT Operation Codes.

Error Response

#define GATT_SERVER_CONFIG_NONE   0x0000

characteristic descriptor: server configuration value

No broadcast

#define INCLUDE_SERVICE_UUID128 (   handle,
  service_handle,
  end_group_handle 
)
Value:
BIT16_TO_8((uint16_t)(handle)), \
GATTDB_PERM_READABLE, \
6, \
BIT16_TO_8(GATT_UUID_INCLUDE_SERVICE), \
BIT16_TO_8(service_handle), \
BIT16_TO_8(end_group_handle)
uint16_t handle
atribute Handle
Definition: wiced_bt_gatt.h:761
#define INCLUDE_SERVICE_UUID16 (   handle,
  service_handle,
  end_group_handle,
  service 
)
Value:
BIT16_TO_8((uint16_t)(handle)), \
GATTDB_PERM_READABLE, \
8, \
BIT16_TO_8(GATT_UUID_INCLUDE_SERVICE), \
BIT16_TO_8(service_handle), \
BIT16_TO_8(end_group_handle), \
BIT16_TO_8(service)
uint16_t handle
atribute Handle
Definition: wiced_bt_gatt.h:761
#define PRIMARY_SERVICE_UUID128 (   handle,
  service 
)
Value:
BIT16_TO_8((uint16_t)(handle)), \
GATTDB_PERM_READABLE, \
18, \
BIT16_TO_8(GATT_UUID_PRI_SERVICE), \
service
uint16_t handle
atribute Handle
Definition: wiced_bt_gatt.h:761
#define PRIMARY_SERVICE_UUID16 (   handle,
  service 
)
Value:
BIT16_TO_8((uint16_t)(handle)), \
GATTDB_PERM_READABLE, \
4, \
BIT16_TO_8((GATT_UUID_PRI_SERVICE)), \
BIT16_TO_8((service))
uint16_t handle
atribute Handle
Definition: wiced_bt_gatt.h:761
#define SECONDARY_SERVICE_UUID128 (   handle,
  service 
)
Value:
BIT16_TO_8((uint16_t)(handle)), \
GATTDB_PERM_READABLE, \
18, \
BIT16_TO_8(GATT_UUID_SEC_SERVICE), \
service
uint16_t handle
atribute Handle
Definition: wiced_bt_gatt.h:761
#define SECONDARY_SERVICE_UUID16 (   handle,
  service 
)
Value:
BIT16_TO_8((uint16_t)(handle)), \
GATTDB_PERM_READABLE, \
4, \
BIT16_TO_8((GATT_UUID_SEC_SERVICE)), \
BIT16_TO_8((service))
uint16_t handle
atribute Handle
Definition: wiced_bt_gatt.h:761

Typedef Documentation

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()

Parameters
event: Event ID
p_event_data: Event data
Returns
Status of event handling

Enumeration Type Documentation

Authentication requirement.

Enumerator
GATT_AUTH_REQ_NONE 

No Authentication Required.

GATT_AUTH_REQ_NO_MITM 

Unauthenticated encryption (No MITM)

GATT_AUTH_REQ_MITM 

Authenticated encryption (MITM)

GATT_AUTH_REQ_SIGNED_NO_MITM 

Signed Data (No MITM)

GATT_AUTH_REQ_SIGNED_MITM 

Signed Data (MITM)

GATT Characteristic Properties Mask.

Enumerator
GATT_CHAR_PROPERTIES_BIT_BROADCAST 

bit 0: Broadcast

GATT_CHAR_PROPERTIES_BIT_READ 

bit 1: Read

GATT_CHAR_PROPERTIES_BIT_WRITE_NR 

bit 2: Write (No Response)

GATT_CHAR_PROPERTIES_BIT_WRITE 

bit 3: Write

GATT_CHAR_PROPERTIES_BIT_NOTIFY 

bit 4: Notify

GATT_CHAR_PROPERTIES_BIT_INDICATE 

bit 5: Indicate

GATT_CHAR_PROPERTIES_BIT_AUTH 

bit 6: Authenticate

GATT_CHAR_PROPERTIES_BIT_EXT_PROP 

bit 7: Extended Properties

characteristic descriptor: client configuration value

Enumerator
GATT_CLIENT_CONFIG_NONE 

Does not allow both notifications and indications.

GATT_CLIENT_CONFIG_NOTIFICATION 

Allows notifications.

GATT_CLIENT_CONFIG_INDICATION 

Allows indications.

GATT Disconnection reason.

Enumerator
GATT_CONN_UNKNOWN 

Unknown reason.

GATT_CONN_L2C_FAILURE 

General L2cap failure.

GATT_CONN_TIMEOUT 

Connection timeout.

GATT_CONN_TERMINATE_PEER_USER 

Connection terminated by peer user.

GATT_CONN_TERMINATE_LOCAL_HOST 

Connection terminated by local host.

GATT_CONN_FAIL_ESTABLISH 

Connection fail to establish.

GATT_CONN_LMP_TIMEOUT 

Connection fail due to LMP response tout.

GATT_CONN_CANCEL 

L2CAP connection cancelled.

Discovery types.

Enumerator
GATT_DISCOVER_SERVICES_ALL 

discover all services

GATT_DISCOVER_SERVICES_BY_UUID 

discover service by UUID

GATT_DISCOVER_INCLUDED_SERVICES 

discover an included service within a service

GATT_DISCOVER_CHARACTERISTICS 

discover characteristics of a service with/without type requirement

GATT_DISCOVER_CHARACTERISTIC_DESCRIPTORS 

discover characteristic descriptors of a character

GATT events.

Enumerator
GATT_CONNECTION_STATUS_EVT 

GATT connection status change.

Event data: wiced_bt_gatt_connection_status_t

GATT_OPERATION_CPLT_EVT 

GATT operation complete.

Event data: wiced_bt_gatt_event_data_t

GATT_DISCOVERY_RESULT_EVT 

GATT attribute discovery result.

Event data: wiced_bt_gatt_discovery_result_t

GATT_DISCOVERY_CPLT_EVT 

GATT attribute discovery complete.

Event data: wiced_bt_gatt_event_data_t

GATT_ATTRIBUTE_REQUEST_EVT 

GATT attribute request (from remote client).

Event data: wiced_bt_gatt_attribute_request_t

GATT_CONGESTION_EVT 

GATT congestion (running low in tx buffers).

Event data: wiced_bt_gatt_congestion_event_t

GATT Write Execute request flags.

Enumerator
GATT_PREP_WRITE_CANCEL 

GATT_PREP_WRITE_CANCEL.

GATT_PREP_WRITE_EXEC 

GATT_PREP_WRITE_EXEC.

GATT client operation type, used in client callback function.

Enumerator
GATTC_OPTYPE_NONE 

None.

GATTC_OPTYPE_DISCOVERY 

Discovery.

GATTC_OPTYPE_READ 

Read.

GATTC_OPTYPE_WRITE 

Write.

GATTC_OPTYPE_EXE_WRITE 

Execute Write.

GATTC_OPTYPE_CONFIG 

Configure.

GATTC_OPTYPE_NOTIFICATION 

Notification.

GATTC_OPTYPE_INDICATION 

Indication.

GATT Read Types.

Enumerator
GATT_READ_BY_TYPE 

Read by Type (service or characteristic UUIDs)

GATT_READ_BY_HANDLE 

Read by Handle.

GATT_READ_MULTIPLE 

Read Multiple (array of handles)

GATT_READ_CHAR_VALUE 

Read Characteristic Value.

GATT_READ_PARTIAL 

Read Partial.

GATT Attribute Request Type.

Enumerator
GATTS_REQ_TYPE_READ 

Attribute read notification (attribute value internally read from GATT database)

GATTS_REQ_TYPE_WRITE 

Attribute write notification (attribute value internally written to GATT database)

GATTS_REQ_TYPE_PREP_WRITE 

Attribute Prepare Write Notification (Suspending write request before triggering actual execute write )

GATTS_REQ_TYPE_WRITE_EXEC 

Execute write request.

GATTS_REQ_TYPE_MTU 

MTU exchange information.

GATTS_REQ_TYPE_CONF 

Value confirmation.

GATT Status Codes.

Enumerator
WICED_BT_GATT_SUCCESS 

Success.

WICED_BT_GATT_INVALID_HANDLE 

Invalid Handle.

WICED_BT_GATT_READ_NOT_PERMIT 

Read Not Permitted.

WICED_BT_GATT_WRITE_NOT_PERMIT 

Write Not permitted.

WICED_BT_GATT_INVALID_PDU 

Invalid PDU.

WICED_BT_GATT_INSUF_AUTHENTICATION 

Insufficient Authentication.

WICED_BT_GATT_REQ_NOT_SUPPORTED 

Request Not Supported.

WICED_BT_GATT_INVALID_OFFSET 

Invalid Offset.

WICED_BT_GATT_INSUF_AUTHORIZATION 

Insufficient Authorization.

WICED_BT_GATT_PREPARE_Q_FULL 

Prepare Queue Full.

WICED_BT_GATT_NOT_FOUND 

Not Found.

WICED_BT_GATT_NOT_LONG 

Not Long Size.

WICED_BT_GATT_INSUF_KEY_SIZE 

Insufficient Key Size.

WICED_BT_GATT_INVALID_ATTR_LEN 

Invalid Attribute Length.

WICED_BT_GATT_ERR_UNLIKELY 

Error Unlikely.

WICED_BT_GATT_INSUF_ENCRYPTION 

Insufficient Encryption.

WICED_BT_GATT_UNSUPPORT_GRP_TYPE 

Unsupported Group Type.

WICED_BT_GATT_INSUF_RESOURCE 

Insufficient Resource.

WICED_BT_GATT_DATABASE_OUT_OF_SYNC 

GATT Database Out of Sync.

WICED_BT_GATT_VALUE_NOT_ALLOWED 

Value Not allowed.

WICED_BT_GATT_ILLEGAL_PARAMETER 

Illegal Parameter.

WICED_BT_GATT_NO_RESOURCES 

No Resources.

WICED_BT_GATT_INTERNAL_ERROR 

Internal Error.

WICED_BT_GATT_WRONG_STATE 

Wrong State.

WICED_BT_GATT_DB_FULL 

DB Full.

WICED_BT_GATT_BUSY 

Busy.

WICED_BT_GATT_ERROR 

Error.

WICED_BT_GATT_CMD_STARTED 

Command Started.

WICED_BT_GATT_PENDING 

Pending.

WICED_BT_GATT_AUTH_FAIL 

Authentication Fail.

WICED_BT_GATT_MORE 

More.

WICED_BT_GATT_INVALID_CFG 

Invalid Configuration.

WICED_BT_GATT_SERVICE_STARTED 

Service Started.

WICED_BT_GATT_ENCRYPED_MITM 

Encrypted MITM.

WICED_BT_GATT_ENCRYPED_NO_MITM 

Encrypted No MITM.

WICED_BT_GATT_NOT_ENCRYPTED 

Not Encrypted.

WICED_BT_GATT_CONGESTED 

Congested.

WICED_BT_GATT_WRITE_REQ_REJECTED 

Write operation rejected.

WICED_BT_GATT_CCC_CFG_ERR 

Improper Client Char Configuration.

WICED_BT_GATT_PRC_IN_PROGRESS 

Procedure Already in Progress.

WICED_BT_GATT_OUT_OF_RANGE 

Value Out of Range.

Write request types - used when calling wiced_bt_gatt_send_write.

Enumerator
GATT_WRITE_NO_RSP 

Write without response.

GATT_WRITE 

Write with response.

GATT_WRITE_PREPARE 

Prepare to write (call wiced_bt_gatt_send_execute_write to execute the write)

Variable Documentation

uint8_t len

attribute length .

It excludes the header.

uint8_t perm

attribute permission.