Infineon Logo AIROC BTSDK v4.2 - 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_read_t
 Attribute read request. More...
 
struct  wiced_bt_gatt_read_multiple_req_t_
 Response structure, containing the requested handle list for GATT_RSP_READ_MULTI or GATT_RSP_READ_MULTI_VAR_LENGTH commands. More...
 
struct  wiced_bt_gatt_read_multiple_rsp_t
 Response structure for read multiple . 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_write_hdr_t
 Attribute header, used for GATT write operations, and read response callbacks. More...
 
struct  wiced_bt_gatt_write_req_t
 Attribute write request. More...
 
struct  wiced_bt_gatt_req_conf_t
 Attribute handle confirmation, sent to app to indicate completion of server events on the server. More...
 
struct  wiced_bt_gatt_execute_write_req_t
 Attribute handle execution write request received on the client. More...
 
union  wiced_bt_gatt_request_params_t
 Attribute information for GATT attribute requests types received on the server. More...
 
struct  wiced_bt_gatt_discovery_param_t
 Parameters used in a GATT Discovery. 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. 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...
 
struct  wiced_bt_gatt_buffer_transmitted_t
 Structure to return the application buffer and application buffer context given to the stack in various APIs The application is expected to use this event to free allocated memory used for sending client requests or responding to client requests. More...
 
struct  wiced_bt_gatt_app_response_buffer_t
 Structure to hold the response buffer and the application context for that buffer. More...
 
struct  wiced_bt_gatt_buffer_request_t
 Structure to get a response buffer of the len_requested and the application context for that buffer. More...
 
union  wiced_bt_gatt_event_data_t
 Structures for GATT event notifications. More...
 
union  wiced_bt_gatt_gap_ble_attr_value_t
 GATT attribute value included in central role DB. More...
 
struct  wiced_gattdb_entry_s
 Structure used by wiced_bt_gattdb APIS, to parse GATTDB. More...
 
struct  wiced_bt_gatt_eatt_connection_indication_event_t
 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. More...
 
struct  wiced_bt_gatt_eatt_connection_response_t
 structure to be used to respond to received EATT connection request More...
 
struct  wiced_bt_gatt_eatt_connection_confirmation_event_t
 structure used to deliver the confirmation status of the requested EATT connection More...
 
struct  wiced_bt_gatt_eatt_callbacks_t
 callbacks for GATT EATT event notifications More...
 

Macros

#define GATT_BLE_DEFAULT_MTU_SIZE   23
 Default GATT MTU size over LE link.
 
#define GATT_AUTH_SIGN_LEN   12
 Size of the signature appended to application data in signed write cmd.
 
#define GATT_CLIENT_MAX_WRITE_SIGNED_DATA   (23 - 3 - GATT_AUTH_SIGN_LEN)
 Max size of application data allowed to be sent using the signed write cmd.
 
#define WICED_GATT_HDR_SIZE   3
 GATT Header size (1 byte opcode + 2 byte handle)
 
#define WICED_BT_GATT_ENCRYPED_MITM   WICED_BT_GATT_ENCRYPTED_MITM
 For backward compatiability with previous releases.
 
#define WICED_BT_GATT_ENCRYPED_NO_MITM   WICED_BT_GATT_ENCRYPTED_NO_MITM
 
#define GATT_PREP_WRITE_CANCEL   GATT_PREPARE_WRITE_CANCEL
 See GATT_PREPARE_WRITE_CANCEL.
 
#define GATT_PREP_WRITE_EXEC   GATT_PREPARE_WRITE_EXEC
 See GATT_PREPARE_WRITE_EXEC.
 
#define GATTDB_PERM_NONE   (0x00)
 The permission bits (see Vol 3, Part F, 3.2.5)
 
#define GATTDB_PERM_VARIABLE_LENGTH   (0x1 << 0)
 The permission bits (see Vol 3, Part F, 3.2.5)
 
#define GATTDB_PERM_READABLE   (0x1 << 1)
 The permission bits (see Vol 3, Part F, 3.2.5)
 
#define GATTDB_PERM_WRITE_CMD   (0x1 << 2)
 The permission bits (see Vol 3, Part F, 3.2.5)
 
#define GATTDB_PERM_WRITE_REQ   (0x1 << 3)
 The permission bits (see Vol 3, Part F, 3.2.5)
 
#define GATTDB_PERM_AUTH_READABLE   (0x1 << 4)
 The permission bits (see Vol 3, Part F, 3.2.5)
 
#define GATTDB_PERM_RELIABLE_WRITE   (0x1 << 5)
 The permission bits (see Vol 3, Part F, 3.2.5)
 
#define GATTDB_PERM_AUTH_WRITABLE   (0x1 << 6)
 The permission bits (see Vol 3, Part F, 3.2.5)
 
#define GATTDB_PERM_WRITABLE   (GATTDB_PERM_WRITE_CMD | GATTDB_PERM_WRITE_REQ| GATTDB_PERM_AUTH_WRITABLE)
 The permission bits (see Vol 3, Part F, 3.2.5)
 
#define GATTDB_PERM_MASK   (0x7f)
 All the permission bits. More...
 
#define GATTDB_PERM_SERVICE_UUID_128   (0x1 << 7)
 The permission bits (see Vol 3, Part F, 3.2.5)
 
#define GATTDB_CHAR_PROP_BROADCAST   (0x1 << 0)
 GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)
 
#define GATTDB_CHAR_PROP_READ   (0x1 << 1)
 GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)
 
#define GATTDB_CHAR_PROP_WRITE_NO_RESPONSE   (0x1 << 2)
 GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)
 
#define GATTDB_CHAR_PROP_WRITE   (0x1 << 3)
 GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)
 
#define GATTDB_CHAR_PROP_NOTIFY   (0x1 << 4)
 GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)
 
#define GATTDB_CHAR_PROP_INDICATE   (0x1 << 5)
 GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)
 
#define GATTDB_CHAR_PROP_AUTHD_WRITES   (0x1 << 6)
 GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)
 
#define GATTDB_CHAR_PROP_EXTENDED   (0x1 << 7)
 GATT Characteristic Properties (see Vol 3, Part G, 3.3.1.1)
 
#define GATTDB_CHAR_EXTENDED_PROP_RELIABLE   (0x1 << 0)
 GATT Characteristic Extended Properties (see Vol 3, Part G, 3.3.3.1)
 
#define GATTDB_CHAR_EXTENDED_PROP_WRITABLE_AUXILIARIES   (0x1 << 1)
 GATT Characteristic Extended Properties (see Vol 3, Part G, 3.3.3.1)
 
#define BIT16_TO_8(val)
 Conversion macros. More...
 
#define GATTDB_UUID16_SIZE   2
 UUID lengths.
 
#define GATTDB_UUID128_SIZE   16
 UUID lengths.
 
#define LEGATTDB_PERM_NONE   GATTDB_PERM_NONE
 Since the GATT DB macro names were changed from LEGATTDB_xxx from GATTDB_xxx, these backwards compatibility macros are temporarily defined to minimize impact on applications. More...
 
#define LEGATTDB_PERM_VARIABLE_LENGTH   GATTDB_PERM_VARIABLE_LENGTH
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_PERM_READABLE   GATTDB_PERM_READABLE
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_PERM_WRITE_CMD   GATTDB_PERM_WRITE_CMD
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_PERM_WRITE_REQ   GATTDB_PERM_WRITE_REQ
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_PERM_AUTH_READABLE   GATTDB_PERM_AUTH_READABLE
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_PERM_RELIABLE_WRITE   GATTDB_PERM_RELIABLE_WRITE
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_PERM_AUTH_WRITABLE   GATTDB_PERM_AUTH_WRITABLE
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_PERM_WRITABLE   GATTDB_PERM_WRITABLE
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_PERM_MASK   GATTDB_PERM_MASK
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_PERM_SERVICE_UUID_128   GATTDB_PERM_SERVICE_UUID_128
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_CHAR_PROP_BROADCAST   GATTDB_CHAR_PROP_BROADCAST
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_CHAR_PROP_READ   GATTDB_CHAR_PROP_READ
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_CHAR_PROP_WRITE_NO_RESPONSE   GATTDB_CHAR_PROP_WRITE_NO_RESPONSE
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_CHAR_PROP_WRITE   GATTDB_CHAR_PROP_WRITE
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_CHAR_PROP_NOTIFY   GATTDB_CHAR_PROP_NOTIFY
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_CHAR_PROP_INDICATE   GATTDB_CHAR_PROP_INDICATE
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_CHAR_PROP_AUTHD_WRITES   GATTDB_CHAR_PROP_AUTHD_WRITES
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_CHAR_PROP_EXTENDED   GATTDB_CHAR_PROP_EXTENDED
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_UUID16_SIZE   GATTDB_UUID16_SIZE
 To be deprecated, defined for backward compatiablility.
 
#define LEGATTDB_UUID128_SIZE   GATTDB_UUID128_SIZE
 To be deprecated, defined for backward compatiablility.
 
#define GATT_IS_CSF_FEATURE_SUPPORTED(csf, m)   (csf[(m)/8] & (1 << (m)%8))
 macro to determine GATT Client Support features
 
Service and Characteristic macros

#define PRIMARY_SERVICE_UUID16(handle, service)
 Macro to assist 16 bit primary service declaration. More...
 
#define PRIMARY_SERVICE_UUID128(handle, service)
 Macro to assist 128 bit primary service declaration. More...
 
#define SECONDARY_SERVICE_UUID16(handle, service)
 Macro to assist 16 bit secondary service declaration. More...
 
#define SECONDARY_SERVICE_UUID128(handle, service)
 Macro to assist 128 bit secondary service declaration. More...
 
#define INCLUDE_SERVICE_UUID16(handle, service_handle, end_group_handle, service)
 Macro to assist included service declaration. More...
 
#define INCLUDE_SERVICE_UUID128(handle, service_handle, end_group_handle)
 Macro to assist 128 bit included service declaration. More...
 
#define CHARACTERISTIC_UUID16(handle, handle_value, uuid, properties, permission)
 Macro to assist readable 16 bit characteristic declaration. More...
 
#define CHARACTERISTIC_UUID128(handle, handle_value, uuid, properties, permission)
 Macro to assist readable 128 bit characteristic declaration. More...
 
#define CHARACTERISTIC_UUID16_WRITABLE(handle, handle_value, uuid, properties, permission)
 Macro to assist writable 16 bit characteristic declaration. More...
 
#define CHARACTERISTIC_UUID128_WRITABLE(handle, handle_value, uuid, properties, permission)
 Macro to assist writable 128 bit characteristic declaration. More...
 
#define CHAR_DESCRIPTOR_UUID16_WRITABLE(handle, uuid, permission)
 Macro to assist writable 16 bit descriptor declaration. More...
 
#define CHAR_DESCRIPTOR_UUID16(handle, uuid, permission)
 Macro to assist readable 16 bit descriptor declaration. More...
 
#define CHAR_DESCRIPTOR_UUID128_WRITABLE(handle, uuid, permission)
 Macro to assist writable 128 bit descriptor declaration. More...
 
#define CHAR_DESCRIPTOR_UUID128(handle, uuid, permission)
 Macro to assist readable 128 bit descriptor declaration. More...
 
#define CHAR_DESCRIPTOR_EXTENDED_PROPERTIES(handle, ext_properties)
 Macro to assist extended properties declaration. More...
 

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
 GATT Opcodes.
 
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 struct
wiced_bt_gatt_read_multiple_req_t_ 
wiced_bt_gatt_read_multiple_req_t
 Response structure, containing the requested handle list for GATT_RSP_READ_MULTI or GATT_RSP_READ_MULTI_VAR_LENGTH commands.
 
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. More...
 
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 More...
 
typedef uint16_t wiced_bt_gatt_eatt_conn_id_list [EATT_CHANNELS_PER_TRANSACTION]
 list of EATT connection id's More...
 
typedef tDRBwiced_bt_eatt_drbs [EATT_CHANNELS_PER_TRANSACTION]
 list of Data Receive Blocks
 
typedef void * wiced_bt_gatt_app_context_t
 Context is returned to application in event GATT_APP_BUFFER_TRANSMITTED_EVT on transmission of application data buffer.
 
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...
 
typedef struct wiced_gattdb_entry_s wiced_gattdb_entry_t
 Structure used by wiced_bt_gattdb APIS, to parse GATTDB.
 
typedef void(* wiced_bt_gatt_eatt_on_connect_ind_t )(wiced_bt_gatt_eatt_connection_indication_event_t *p_ind)
 Function callbacks for EATT. More...
 
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
 

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_ATTRIBUTE_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 = 0x8780, WICED_BT_GATT_NO_RESOURCES = 0x8781, WICED_BT_GATT_INTERNAL_ERROR = 0x8783, WICED_BT_GATT_WRONG_STATE = 0x8784,
  WICED_BT_GATT_DB_FULL = 0x8785, WICED_BT_GATT_BUSY = 0x8786, WICED_BT_GATT_ERROR = 0x8787, WICED_BT_GATT_CMD_STARTED = 0x8788,
  WICED_BT_GATT_PENDING = 0x8789, WICED_BT_GATT_AUTH_FAIL = 0x878A, WICED_BT_GATT_MORE = 0x878B, WICED_BT_GATT_INVALID_CFG = 0x878C,
  WICED_BT_GATT_SERVICE_STARTED = 0x878D, WICED_BT_GATT_ENCRYPTED_MITM = WICED_BT_GATT_SUCCESS, WICED_BT_GATT_ENCRYPTED_NO_MITM = 0x878E, WICED_BT_GATT_NOT_ENCRYPTED = 0x878F,
  WICED_BT_GATT_CONGESTED = 0x8791, WICED_BT_GATT_NOT_ALLOWED = 0x8792, WICED_BT_GATT_HANDLED = 0x8793, WICED_BT_GATT_NO_PENDING_OPERATION = 0x8794,
  WICED_BT_GATT_INDICATION_RESPONSE_PENDING = 0x8795, WICED_BT_GATT_WRITE_REQ_REJECTED = 0x8796, WICED_BT_GATT_CCC_CFG_ERR = 0x8797, WICED_BT_GATT_PRC_IN_PROGRESS = 0x8798,
  WICED_BT_GATT_OUT_OF_RANGE = 0x8799, WICED_BT_GATT_BAD_OPCODE = 0x879A, WICED_BT_GATT_INVALID_CONNECTION_ID = 0xFFFF
}
 GATT Status Codes. More...
 
enum  wiced_bt_gatt_opcode_e {
  GATT_RSP_ERROR = 0x01, GATT_REQ_MTU = 0x02, GATT_RSP_MTU = 0x03, GATT_REQ_FIND_INFO = 0x04,
  GATT_RSP_FIND_INFO = 0x05, GATT_REQ_FIND_TYPE_VALUE = 0x06, GATT_RSP_FIND_TYPE_VALUE = 0x07, GATT_REQ_READ_BY_TYPE = 0x08,
  GATT_RSP_READ_BY_TYPE = 0x09, GATT_REQ_READ = 0x0A, GATT_RSP_READ = 0x0B, GATT_REQ_READ_BLOB = 0x0C,
  GATT_RSP_READ_BLOB = 0x0D, GATT_REQ_READ_MULTI = 0x0E, GATT_RSP_READ_MULTI = 0x0F, GATT_REQ_READ_BY_GRP_TYPE = 0x10,
  GATT_RSP_READ_BY_GRP_TYPE = 0x11, GATT_REQ_WRITE = 0x12, GATT_RSP_WRITE = 0x13, GATT_REQ_PREPARE_WRITE = 0x16,
  GATT_RSP_PREPARE_WRITE = 0x17, GATT_REQ_EXECUTE_WRITE = 0x18, GATT_RSP_EXECUTE_WRITE = 0x19, GATT_HANDLE_VALUE_NOTIF = 0x1B,
  GATT_HANDLE_VALUE_IND = 0x1D, GATT_HANDLE_VALUE_CONF = 0x1E, GATT_REQ_READ_MULTI_VAR_LENGTH = 0x20, GATT_RSP_READ_MULTI_VAR_LENGTH = 0x21,
  GATT_HANDLE_VALUE_MULTI_NOTIF = 0x23, GATT_CMD_WRITE = 0x52, GATT_CMD_SIGNED_WRITE = 0xD2
}
 GATT Operation 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_server_char_config_e { GATT_SERVER_CONFIG_NONE = 0x0000, GATT_SERVER_CONFIG_BROADCAST = 0x0001 }
 characteristic descriptor: server 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_PREPARE_WRITE_CANCEL = 0x00, GATT_PREPARE_WRITE_EXEC = 0x01 }
 GATT Write Execute request flags. 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_optype_e {
  GATTC_OPTYPE_NONE = 0, GATTC_OPTYPE_DISCOVERY, GATTC_OPTYPE_READ_HANDLE, GATTC_OPTYPE_READ_BY_TYPE,
  GATTC_OPTYPE_READ_MULTIPLE, GATTC_OPTYPE_WRITE_WITH_RSP, GATTC_OPTYPE_WRITE_NO_RSP, GATTC_OPTYPE_PREPARE_WRITE,
  GATTC_OPTYPE_EXECUTE_WRITE, GATTC_OPTYPE_CONFIG_MTU, GATTC_OPTYPE_NOTIFICATION, GATTC_OPTYPE_INDICATION
}
 GATT client operation type, used in client callback function. More...
 
enum  wiced_bt_gatt_caching_status_e { GATT_PEER_CLIENT_CACHE_CHANGE_AWARE = 0, GATT_PEER_CLIENT_CACHE_CHANGE_UNAWARE = 1, GATT_PEER_CLIENT_CACHE_READY_TO_BE_AWARE = 2 }
 GATT caching status of the peer(client) More...
 
enum  wiced_bt_gatt_format_e {
  GATT_CHAR_PRESENTATION_FORMAT_RES, GATT_CHAR_PRESENTATION_FORMAT_BOOL, GATT_CHAR_PRESENTATION_FORMAT_2BITS, GATT_CHAR_PRESENTATION_FORMAT_NIBBLE,
  GATT_CHAR_PRESENTATION_FORMAT_UINT8, GATT_CHAR_PRESENTATION_FORMAT_UINT12, GATT_CHAR_PRESENTATION_FORMAT_UINT16, GATT_CHAR_PRESENTATION_FORMAT_UINT24,
  GATT_CHAR_PRESENTATION_FORMAT_UINT32, GATT_CHAR_PRESENTATION_FORMAT_UINT48, GATT_CHAR_PRESENTATION_FORMAT_UINT64, GATT_CHAR_PRESENTATION_FORMAT_UINT128,
  GATT_CHAR_PRESENTATION_FORMAT_SINT8, GATT_CHAR_PRESENTATION_FORMAT_SINT12, GATT_CHAR_PRESENTATION_FORMAT_SINT16, GATT_CHAR_PRESENTATION_FORMAT_SINT24,
  GATT_CHAR_PRESENTATION_FORMAT_SINT32, GATT_CHAR_PRESENTATION_FORMAT_SINT48, GATT_CHAR_PRESENTATION_FORMAT_SINT64, GATT_CHAR_PRESENTATION_FORMAT_SINT128,
  GATT_CHAR_PRESENTATION_FORMAT_FLOAT32, GATT_CHAR_PRESENTATION_FORMAT_FLOAT64, GATT_CHAR_PRESENTATION_FORMAT_SFLOAT, GATT_CHAR_PRESENTATION_FORMAT_FLOAT,
  GATT_CHAR_PRESENTATION_FORMAT_DUINT16, GATT_CHAR_PRESENTATION_FORMAT_UTF8S, GATT_CHAR_PRESENTATION_FORMAT_UTF16S, GATT_CHAR_PRESENTATION_FORMAT_STRUCT,
  GATT_CHAR_PRESENTATION_FORMAT_MAX
}
 Format of the value of a characteristic. More...
 
enum  t_gatt_csf_assignments { GATT_CSF_ROBUST_CACHING = 0, GATT_CSF_EATT = 1, GATT_CSF_MULTIPLE_HANDLE_VALUE_NOTIFICATIONS = 2 }
 .Enumeration of known Client Supported Feature Bit assignments of the wiced_bt_gatt_client_supported_features_t 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_GET_RESPONSE_BUFFER_EVT, GATT_APP_BUFFER_TRANSMITTED_EVT
}
 GATT events. More...
 

Functions

wiced_bt_gatt_status_t wiced_bt_gatt_server_send_indication (uint16_t conn_id, uint16_t attr_handle, uint16_t val_len, uint8_t *p_app_buffer, wiced_bt_gatt_app_context_t p_app_ctxt)
 This API will send a long (1 upto (MTU -3) bytes) indication to the client for the specified handle with a persistent buffer in p_app_buffer. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_notification (uint16_t conn_id, uint16_t attr_handle, uint16_t val_len, uint8_t *p_app_buffer, wiced_bt_gatt_app_context_t p_app_ctxt)
 This API will send a long (1 upto (MTU -3) bytes) notification to the client for the specified handle with a persistent buffer in p_app_buffer. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_multiple_notifications (uint16_t conn_id, uint16_t app_buffer_len, uint8_t *p_app_buffer, wiced_bt_gatt_app_context_t p_app_ctxt)
 This API will send a long (1 upto (MTU -1) bytes) multiple variable length notification to the client with a persistent buffer in p_app_buffer. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_db_init (const uint8_t *p_gatt_db, uint16_t gatt_db_size, wiced_bt_db_hash_t hash)
 Initialize the GATT database (Please refer Service and Characteristic macros for MACRO's to create or add entries to GATT database) More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_add_services_to_db (const uint8_t *p_gatt_db, uint16_t gatt_db_size, wiced_bt_db_hash_t hash)
 Add a service module to the database. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_db_remove_services_from_db (const uint8_t *p_gatt_db, wiced_bt_db_hash_t hash)
 Remove the service module from the database. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_mtu_rsp (uint16_t conn_id, uint16_t remote_mtu, uint16_t my_mtu)
 Server API to respond to a MTU request from the client. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_read_handle_rsp (uint16_t conn_id, wiced_bt_gatt_opcode_t opcode, uint16_t len, uint8_t *p_attr, wiced_bt_gatt_app_context_t p_app_ctxt)
 Server API to respond to a read request from the client This API can be used to respond to GATT_REQ_READ and GATT_REQ_READ_BLOB request. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_read_by_type_rsp (uint16_t conn_id, wiced_bt_gatt_opcode_t opcode, uint8_t type_len, uint16_t data_len, uint8_t *p_data, wiced_bt_gatt_app_context_t p_app_ctxt)
 Server API to respond to a read by type request from the client This API can be used to respond to GATT_REQ_READ_BY_TYPE The application receivess a callback on the registered wiced_bt_gatt_cback_t with the wiced_bt_gatt_attribute_request_t::opcode set to GATT_REQ_READ_BY_TYPE. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_read_multiple_rsp (uint16_t conn_id, wiced_bt_gatt_opcode_t opcode, uint16_t len, uint8_t *p_app_rsp_buffer, wiced_bt_gatt_app_context_t p_app_ctxt)
 Server API to respond to read multiple request from the client This API can be used to respond to GATT_REQ_READ_MULTI or GATT_REQ_READ_MULTI_VAR_LENGTH The application receivess a callback on the registered wiced_bt_gatt_cback_t with the wiced_bt_gatt_attribute_request_t::opcode set to GATT_REQ_READ_MULTI or GATT_REQ_READ_MULTI_VAR_LENGTH. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_write_rsp (uint16_t conn_id, wiced_bt_gatt_opcode_t opcode, uint16_t handle)
 Server API to respond to a write request from the client This API can be used to respond to GATT_REQ_WRITE The application receives a callback on the registered wiced_bt_gatt_cback_t with the wiced_bt_gatt_attribute_request_t::opcode set to GATT_REQ_WRITE or GATT_CMD_WRITE or GATT_CMD_SIGNED_WRITE The command parameters are in wiced_bt_gatt_write_req_t. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_prepare_write_rsp (uint16_t conn_id, wiced_bt_gatt_opcode_t opcode, uint16_t handle, uint16_t offset, uint16_t len, uint8_t *p_app_rsp_buffer, wiced_bt_gatt_app_context_t p_app_ctxt)
 Server API to respond to a prepare write request from the client This API can be used to respond to GATT_REQ_PREPARE_WRITE The application receives a callback on the registered wiced_bt_gatt_cback_t with the wiced_bt_gatt_attribute_request_t::opcode set to GATT_REQ_PREPARE_WRITE The application is expected to queue up the writes till it receives a GATT_REQ_EXECUTE_WRITE The command parameters are in wiced_bt_gatt_write_req_t. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_execute_write_rsp (uint16_t conn_id, wiced_bt_gatt_opcode_t opcode)
 Server API to respond to an execute write request from the client The application receives a callback on the registered wiced_bt_gatt_cback_t with the wiced_bt_gatt_attribute_request_t::opcode set to GATT_REQ_EXECUTE_WRITE The application is expected to write the prepare write queue on receiving this command. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_error_rsp (uint16_t conn_id, wiced_bt_gatt_opcode_t opcode, uint16_t handle, wiced_bt_gatt_status_t status)
 Server API to send an error response to any of the received requests on encountering an error in the command. More...
 
uint16_t wiced_bt_gatt_find_handle_by_type (uint16_t s_handle, uint16_t e_handle, wiced_bt_uuid_t *p_uuid)
 Utility function on the server to find a handle matching a uuid in a range. More...
 
void wiced_bt_gatt_set_client_supported_features (uint16_t conn_id, wiced_bt_gatt_client_supported_features_t csfs)
 Set the remote client supported features upon write and for bonded device after reconnect as read from NVRAM. More...
 
void wiced_bt_gatt_get_client_supported_features (uint16_t conn_id, wiced_bt_gatt_client_supported_features_t csfs)
 Get the remote client supported features. More...
 
void wiced_bt_gatt_get_peer_caching_status (uint16_t conn_id, wiced_bt_gatt_caching_status_t *caching_status)
 Function wiced_bt_gatt_get_peer_caching_status Can be used by the server application to read the robust caching status of the peer. More...
 
void wiced_bt_gatt_set_peer_caching_status (uint16_t conn_id, wiced_bt_gatt_caching_status_t status)
 This function is used by the application to set peer's caching state. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_client_configure_mtu (uint16_t conn_id, uint16_t mtu)
 Configure the ATT MTU size for a connection on an LE transport. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_client_send_discover (uint16_t conn_id, wiced_bt_gatt_discovery_type_t discovery_type, wiced_bt_gatt_discovery_param_t *p_discovery_param)
 Start an attribute discovery on an ATT server. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_client_send_read_handle (uint16_t conn_id, uint16_t handle, uint16_t offset, uint8_t *p_read_buf, uint16_t len, wiced_bt_gatt_auth_req_t auth_req)
 Read from remote ATT server. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_client_send_read_by_type (uint16_t conn_id, uint16_t s_handle, uint16_t e_handle, wiced_bt_uuid_t *p_uuid, uint8_t *p_read_buf, uint16_t len, wiced_bt_gatt_auth_req_t auth_req)
 Read from remote ATT server. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_client_send_read_multiple (uint16_t conn_id, wiced_bt_gatt_opcode_t opcode, int num_handles, uint8_t *p_handle_stream, wiced_bt_gatt_auth_req_t auth_req)
 Read multiple from remote ATT server. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_client_send_write (uint16_t conn_id, wiced_bt_gatt_opcode_t opcode, wiced_bt_gatt_write_hdr_t *p_hdr, uint8_t *p_app_write_buffer, wiced_bt_gatt_app_context_t p_app_ctxt)
 Write to remote ATT server. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_client_send_execute_write (uint16_t conn_id, wiced_bool_t is_execute)
 Send Execute Write request to remote ATT server. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_client_send_indication_confirm (uint16_t conn_id, uint16_t handle)
 Send a handle value confirmation to remote ATT server. 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)
 Open GATT over LE connection to a remote device Result is notified using GATT_CONNECTION_STATUS_EVT of wiced_bt_gatt_cback_t. More...
 
wiced_bool_t wiced_bt_gatt_bredr_connect (wiced_bt_device_address_t bd_addr)
 Open GATT over BR/EDR connection to a remote device Result is notified using GATT_CONNECTION_STATUS_EVT of wiced_bt_gatt_cback_t. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_register (wiced_bt_gatt_cback_t *p_gatt_cback)
 Register an application callback for GATT. More...
 
wiced_bool_t wiced_bt_gatt_cancel_connect (wiced_bt_device_address_t bd_addr, wiced_bool_t is_direct)
 Cancel initiating GATT connection. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_disconnect (uint16_t conn_id)
 Close the specified GATT connection. More...
 
wiced_bool_t wiced_bt_gatt_listen (wiced_bool_t start, wiced_bt_device_address_t bd_addr, wiced_bt_ble_address_type_t type)
 Start or stop LE advertisement and listen for connection. More...
 
uint32_t wiced_bt_gatt_eatt_register (wiced_bt_gatt_eatt_callbacks_t *p_gatt_cback, uint32_t max_eatt_bearers)
 Register an application callback for GATT. More...
 
wiced_result_t wiced_bt_gatt_eatt_connect (uint16_t legacy_conn_id, uint32_t mtu, uint32_t mps, uint32_t num_bearers, wiced_bt_eatt_drbs ppDRBs, wiced_bt_gatt_eatt_conn_id_list conn_id_list_out)
 API to create the enhanced gatt channels, using the legacy/unenhanced connection id. More...
 
wiced_result_t wiced_bt_gatt_eatt_connect_response (wiced_bt_gatt_eatt_connection_indication_event_t *p_indication, wiced_bt_gatt_eatt_connection_response_t *p_response, wiced_bt_gatt_eatt_conn_id_list conn_id_list_out)
 API to create the respond to the enhanced gatt channels connection indication. More...
 
wiced_result_t wiced_bt_gatt_eatt_reconfigure (wiced_bt_gatt_eatt_conn_id_list conn_id_list, uint32_t num_bearers, uint32_t mtu, uint32_t mps, wiced_bt_eatt_drbs ppDRBs)
 API the reconfigure the enhanced gatt channels. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_get_device_address (uint16_t conn_id, wiced_bt_device_address_t *p_bdaddr, wiced_bt_transport_t *p_transport, wiced_bt_ble_address_type_t *p_addr_type)
 API to get the bluetooth device address of the connected gatt conn_id. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_validate_conn_id (uint16_t conn_id)
 API to validate connected gatt conn_id. More...
 
wiced_bool_t wiced_bt_is_same_uuid (const wiced_bt_uuid_t *p_left, const wiced_bt_uuid_t *p_right)
 Utility function to compare UUIDs. More...
 
uint16_t wiced_bt_gatt_get_bearer_mtu (uint16_t conn_id)
 Utility function to get the configured ATT bearer mtu. More...
 
wiced_bt_gatt_status_t wiced_bt_gatt_server_check_attribute_permission (uint16_t conn_id, uint16_t handle, wiced_bt_gatt_opcode_t opcode)
 Utility function to check whether the attribute referred to by handle has the permission to perform actions required by opcode received in the attribute request from the peer. More...
 
int wiced_bt_gatt_put_read_by_type_rsp_in_stream (uint8_t *p_stream, int stream_len, uint8_t *p_pair_len, uint16_t attr_handle, uint16_t attr_len, const uint8_t *p_attr)
 Utility function to copy a partial read by type response to the buffer. More...
 
int wiced_bt_gatt_put_read_multi_rsp_in_stream (wiced_bt_gatt_optype_t opcode, uint8_t *p_stream, int stream_len, uint16_t attr_handle, uint16_t attr_len, const uint8_t *p_attr)
 Utility function to put the handle, data into the multi handle response stream. More...
 
int wiced_bt_gatt_get_multi_handle_data_from_stream (uint8_t *p_stream, int stream_len, uint8_t **pp_addr, int *p_attr_len, int *p_data_in_rsp)
 Utility function to get the variable length handle data from the read multi var length response stream. More...
 
uint16_t wiced_bt_gatt_get_handle_from_stream (uint8_t *p_handle_stream, uint16_t handle_index)
 Utility function to get the handle at index from the handle stream. More...
 
int wiced_bt_gatt_put_handle_in_stream (uint8_t *p_handle_stream, int stream_len, uint16_t handle)
 Utility function to put the handle into the handle stream. More...
 
const uint8_t * wiced_bt_gatt_get_handle_value (uint16_t handle, int *p_len)
 Utility function to get the handle value and handle value len of internal DB handles. More...
 
int wiced_bt_gatt_get_num_queued_tx_packets (uint16_t conn_id, int *p_fragments_with_controller)
 Utility function to get the number of packets queued to tx. More...
 
const wiced_gattdb_entry_twiced_bt_gattdb_local_read_data_by_type (wiced_bt_gatt_discovery_type_t type, const wiced_gattdb_entry_t *p_db_start, wiced_bt_gatt_discovery_data_t *p_disc_data)
 Utility function to read local registered db by type, by iterating to the next in a loop database entry. More...
 
wiced_gattdb_entry_twiced_bt_gattdb_next_entry (wiced_gattdb_entry_t *p_db_entry)
 Return a pointer to next GATT DB entry. More...
 
uint16_t wiced_bt_gattdb_getAttrUUID16 (const wiced_gattdb_entry_t *p_db_entry)
 Utility function to return the 16 bit UUID of the database entry in the local database This will return a attribute UUID in the entry. More...
 
uint8_t * wiced_bt_gattdb_getAttrValue (const wiced_gattdb_entry_t *p_db_entry)
 Utility function to return the data of the database entry in the local database. More...
 
uint8_t * wiced_bt_gattdb_getAttrPtr (const wiced_gattdb_entry_t *p)
 This function will return a pointer to the actual attribute, skip over the header. 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...
 

Detailed Description

AIROC Generic Attribute (GATT) Application Programming Interface.

Function Documentation

uint16_t wiced_bt_gatt_find_handle_by_type ( uint16_t  s_handle,
uint16_t  e_handle,
wiced_bt_uuid_t p_uuid 
)

Utility function on the server to find a handle matching a uuid in a range.

Parameters
[in]s_handle: Start handle of the range to search
[in]e_handle: End handle of the range to search
[in]p_uuid: The attribute uuid to match
Returns
wiced_bt_gatt_status_t
uint16_t wiced_bt_gatt_get_bearer_mtu ( uint16_t  conn_id)

Utility function to get the configured ATT bearer mtu.

Parameters
conn_id
Returns
MTU of the bearer
uint16_t wiced_bt_gatt_get_handle_from_stream ( uint8_t *  p_handle_stream,
uint16_t  handle_index 
)

Utility function to get the handle at index from the handle stream.

Parameters
[in]p_handle_stream: Stream of handles each of 2 octets
[in]handle_index: index into the handle stream
Returns
const uint8_t* wiced_bt_gatt_get_handle_value ( uint16_t  handle,
int *  p_len 
)

Utility function to get the handle value and handle value len of internal DB handles.

Parameters
[in]handle: Attribute Handle
[out]p_len: pointer to store the length of the handle value
Returns
pointer to the value of the handle in the db
int wiced_bt_gatt_get_multi_handle_data_from_stream ( uint8_t *  p_stream,
int  stream_len,
uint8_t **  pp_addr,
int *  p_attr_len,
int *  p_data_in_rsp 
)

Utility function to get the variable length handle data from the read multi var length response stream.

Parameters
[in]p_stream: Pointer to the buffer to be read
[in]stream_len: Readable length of buffer pointed to by p_stream
[out]pp_addr: Addr to the start of the handle data to be filled
[out]p_attr_len: Pointer to fill in the complete attribute length
[out]p_data_in_rspPointer to fill in the actual received length in the rsp at (*pp_addr)
Returns
size of the p_stream read
int wiced_bt_gatt_get_num_queued_tx_packets ( uint16_t  conn_id,
int *  p_fragments_with_controller 
)

Utility function to get the number of packets queued to tx.

Parameters
[in]conn_id: Connection identifier
[out]p_fragments_with_controllerpointer to receive the number of fragments with the controller
Returns
number of packets queued to tx
int wiced_bt_gatt_put_handle_in_stream ( uint8_t *  p_handle_stream,
int  stream_len,
uint16_t  handle 
)

Utility function to put the handle into the handle stream.

Parameters
[in]p_handle_stream: Stream of handles each of 2 octets
[in]stream_len: Length of the stream
[in]handle: handle
Returns
int wiced_bt_gatt_put_read_by_type_rsp_in_stream ( uint8_t *  p_stream,
int  stream_len,
uint8_t *  p_pair_len,
uint16_t  attr_handle,
uint16_t  attr_len,
const uint8_t *  p_attr 
)

Utility function to copy a partial read by type response to the buffer.

Parameters
[in]p_stream: Pointer to the buffer to be filled
[in]stream_len: Writable length of buffer pointed to by p_stream
[out]p_pair_len: The value length for the read by type rsp.
Note
: (*p_pair_len) shall be initialized to 0 prior to the first call to this API
Parameters
[in]attr_handle: Attribute handle to be filled
[in]attr_len: Attribute len to be filled
[in]p_attr: Attribute data
Returns
length of data filled, 0 on error.
int wiced_bt_gatt_put_read_multi_rsp_in_stream ( wiced_bt_gatt_optype_t  opcode,
uint8_t *  p_stream,
int  stream_len,
uint16_t  attr_handle,
uint16_t  attr_len,
const uint8_t *  p_attr 
)

Utility function to put the handle, data into the multi handle response stream.

Parameters
[in]opcode: Can be either GATT_REQ_READ_MULTI or GATT_REQ_READ_MULTI_VAR_LENGTH
[in]p_stream: Pointer to the buffer to be filled
[in]stream_len: Writable length of buffer pointed to by p_stream
[in]attr_handle: Attribute handle to be filled
[in]attr_len: Attribute len to be filled
[in]p_attr: Attribute data
Returns
length of data filled, 0 on error.
wiced_bt_gatt_status_t wiced_bt_gatt_server_check_attribute_permission ( uint16_t  conn_id,
uint16_t  handle,
wiced_bt_gatt_opcode_t  opcode 
)

Utility function to check whether the attribute referred to by handle has the permission to perform actions required by opcode received in the attribute request from the peer.

Parameters
[in]conn_id: Bearer Connection id
[in]handle: Attribute handle to check permission on
[in]opcode: Opcode received from peer.
Returns
WICED_BT_GATT_SUCCESS if the perm_to_check is allowed on the handle, else the specific error
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_error_rsp ( uint16_t  conn_id,
wiced_bt_gatt_opcode_t  opcode,
uint16_t  handle,
wiced_bt_gatt_status_t  status 
)

Server API to send an error response to any of the received requests on encountering an error in the command.

Parameters
[in]conn_id: GATT Connection ID
[in]opcode: The opcode received in the event
[in]handle: The attribute handle as received in the event
[in]status: The reason code for the error
Returns
wiced_bt_gatt_status_t
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_execute_write_rsp ( uint16_t  conn_id,
wiced_bt_gatt_opcode_t  opcode 
)

Server API to respond to an execute write request from the client The application receives a callback on the registered wiced_bt_gatt_cback_t with the wiced_bt_gatt_attribute_request_t::opcode set to GATT_REQ_EXECUTE_WRITE The application is expected to write the prepare write queue on receiving this command.

The command parameters are in wiced_bt_gatt_execute_write_req_t

Parameters
[in]conn_id: GATT Connection ID
[in]opcode: The opcode received in the event
Returns
wiced_bt_gatt_status_t
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_mtu_rsp ( uint16_t  conn_id,
uint16_t  remote_mtu,
uint16_t  my_mtu 
)

Server API to respond to a MTU request from the client.

Parameters
[in]conn_id: GATT Connection ID
[in]remote_mtuThe remote MTU received in wiced_bt_gatt_request_params_t::remote_mtu
[in]my_mtu: The response MTU of the application
Note
: my_mtu shall be set to <= the configured pdu size in wiced_bt_cfg_settings_t and shall be >= GATT_BLE_DEFAULT_MTU_SIZE
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_prepare_write_rsp ( uint16_t  conn_id,
wiced_bt_gatt_opcode_t  opcode,
uint16_t  handle,
uint16_t  offset,
uint16_t  len,
uint8_t *  p_app_rsp_buffer,
wiced_bt_gatt_app_context_t  p_app_ctxt 
)

Server API to respond to a prepare write request from the client This API can be used to respond to GATT_REQ_PREPARE_WRITE The application receives a callback on the registered wiced_bt_gatt_cback_t with the wiced_bt_gatt_attribute_request_t::opcode set to GATT_REQ_PREPARE_WRITE The application is expected to queue up the writes till it receives a GATT_REQ_EXECUTE_WRITE The command parameters are in wiced_bt_gatt_write_req_t.

The mechanism of prepare writes is only applicable for attributes which have set the GATTDB_PERM_RELIABLE_WRITE

Parameters
[in]conn_id: GATT Connection ID
[in]opcode: The opcode received in the event
[in]handle: The handle as received in the request
[in]offset: The offset as received in the request
[in]len: The actual length of the p_data
[in]p_app_rsp_bufferThe data copied into the queue as received in the command.
Note
: This is a copy of the received data. The application should not send the received wiced_bt_gatt_write_req_t::p_val pointer
Parameters
[in]p_app_ctxt: Application context for p_app_rsp_buffer
Note
The application may free the p_app_rsp_buffer pointer on receiving a GATT_APP_BUFFER_TRANSMITTED_EVT with wiced_bt_gatt_buffer_transmitted_t::p_app_data = p_app_rsp_buffer and wiced_bt_gatt_buffer_transmitted_t::p_app_ctxt = p_app_ctxt
Returns
wiced_bt_gatt_status_t
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_read_by_type_rsp ( uint16_t  conn_id,
wiced_bt_gatt_opcode_t  opcode,
uint8_t  type_len,
uint16_t  data_len,
uint8_t *  p_data,
wiced_bt_gatt_app_context_t  p_app_ctxt 
)

Server API to respond to a read by type request from the client This API can be used to respond to GATT_REQ_READ_BY_TYPE The application receivess a callback on the registered wiced_bt_gatt_cback_t with the wiced_bt_gatt_attribute_request_t::opcode set to GATT_REQ_READ_BY_TYPE.

Parameters
[in]conn_id: GATT Connection ID
[in]opcode: The opcode received in the event
[in]type_lenThe length of the type in the response
[in]data_len: Actual valid length pointed to by p_app_rsp_buffer
[in]p_app_rsp_buffer: The formatted data response
[in]p_app_ctxt: Application context for p_app_rsp_buffer
Note
The application may free the p_app_rsp_buffer pointer on receiving a GATT_APP_BUFFER_TRANSMITTED_EVT with wiced_bt_gatt_buffer_transmitted_t::p_app_data = p_app_rsp_buffer and wiced_bt_gatt_buffer_transmitted_t::p_app_ctxt = p_app_ctxt
Returns
wiced_bt_gatt_status_t
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_read_handle_rsp ( uint16_t  conn_id,
wiced_bt_gatt_opcode_t  opcode,
uint16_t  len,
uint8_t *  p_attr,
wiced_bt_gatt_app_context_t  p_app_ctxt 
)

Server API to respond to a read request from the client This API can be used to respond to GATT_REQ_READ and GATT_REQ_READ_BLOB request.

The application receivess a callback on the registered wiced_bt_gatt_cback_t with the wiced_bt_gatt_attribute_request_t::opcode set to GATT_REQ_READ or GATT_REQ_READ_BLOB

Parameters
[in]conn_id: GATT Connection ID
[in]opcode: The opcode received in the event
[in]len: Actual valid length pointed to by p_attr_rsp
[in]p_attr_rsp: The attribute handle wiced_bt_gatt_read_t::handle data as requested, at an offset of wiced_bt_gatt_read_t::offset
[in]p_app_ctxt: Application context for p_attr_rsp
Note
The application may free the p_attr_rsp pointer on receiving a GATT_APP_BUFFER_TRANSMITTED_EVT with wiced_bt_gatt_buffer_transmitted_t::p_app_data = p_app_buffer and wiced_bt_gatt_buffer_transmitted_t::p_app_ctxt = p_attr_rsp
Returns
wiced_bt_gatt_status_t
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_read_multiple_rsp ( uint16_t  conn_id,
wiced_bt_gatt_opcode_t  opcode,
uint16_t  len,
uint8_t *  p_app_rsp_buffer,
wiced_bt_gatt_app_context_t  p_app_ctxt 
)

Server API to respond to read multiple request from the client This API can be used to respond to GATT_REQ_READ_MULTI or GATT_REQ_READ_MULTI_VAR_LENGTH The application receivess a callback on the registered wiced_bt_gatt_cback_t with the wiced_bt_gatt_attribute_request_t::opcode set to GATT_REQ_READ_MULTI or GATT_REQ_READ_MULTI_VAR_LENGTH.

Parameters
[in]conn_id: GATT Connection ID
[in]opcode: The opcode received in the event
[in]len: Actual valid length pointed to by p_app_rsp_buffer
[in]p_app_rsp_buffer: The formatted data response
[in]p_app_ctxt: Application context for p_app_rsp_buffer
Note
The application may free the p_app_rsp_buffer pointer on receiving a GATT_APP_BUFFER_TRANSMITTED_EVT with wiced_bt_gatt_buffer_transmitted_t::p_app_data = p_app_rsp_buffer and wiced_bt_gatt_buffer_transmitted_t::p_app_ctxt = p_app_ctxt
Returns
wiced_bt_gatt_status_t
wiced_bt_gatt_status_t wiced_bt_gatt_server_send_write_rsp ( uint16_t  conn_id,
wiced_bt_gatt_opcode_t  opcode,
uint16_t  handle 
)

Server API to respond to a write request from the client This API can be used to respond to GATT_REQ_WRITE The application receives a callback on the registered wiced_bt_gatt_cback_t with the wiced_bt_gatt_attribute_request_t::opcode set to GATT_REQ_WRITE or GATT_CMD_WRITE or GATT_CMD_SIGNED_WRITE The command parameters are in wiced_bt_gatt_write_req_t.

Parameters
[in]conn_id: GATT Connection ID
[in]opcode: The opcode received in the event
[in]handle: The handle as received in the request
Returns
wiced_bt_gatt_status_t
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.

Parameters
[in]p_db_entry: GATT DB atrribute entry
[out]p_uuid: pointer to UUID holder. Application should pass the required size of UUID It is recommended to pass uint8_t[16], so that we can avoid overflow in case of 128 bit uuid
Returns
size of the UUID
uint8_t* wiced_bt_gattdb_getAttrPtr ( const wiced_gattdb_entry_t p)

This function will return a pointer to the actual attribute, skip over the header.

Parameters
pDatabase entry of which the data is to be returned
Returns
data of the database entry
uint16_t wiced_bt_gattdb_getAttrUUID16 ( const wiced_gattdb_entry_t p_db_entry)

Utility function to return the 16 bit UUID of the database entry in the local database This will return a attribute UUID in the entry.

If the attribute uuid is not 2 bytes. It will return 0x0 which is invalid uuid.

Parameters
[in]p_db_entryDatabase entry for which the UUID is to be returned.
Returns
16 bit UUID value if available, or 0
uint8_t* wiced_bt_gattdb_getAttrValue ( const wiced_gattdb_entry_t p_db_entry)

Utility function to return the data of the database entry in the local database.

Parameters
[in]p_db_entryDatabase entry of which the data is to be returned.
Returns
data of the database entry
const wiced_gattdb_entry_t* wiced_bt_gattdb_local_read_data_by_type ( wiced_bt_gatt_discovery_type_t  type,
const wiced_gattdb_entry_t p_db_start,
wiced_bt_gatt_discovery_data_t p_disc_data 
)

Utility function to read local registered db by type, by iterating to the next in a loop database entry.

Initially p_db_start is set to NULL, which resets the search to the head of the local database. The database is traversed to locate the next entry which matches the intended type. If an entry is found the data of that entry is written to p_disc_data and the entry in the database is returned. The returned entry is passed in the subsequent call to this function in p_db_start. If an entry is not found the function returns a NULL, which indicates that the entire database has been iterated and the calling loop can end.

Parameters
[in]typeDiscovery type
[in]p_db_startThe database entry to search from. Value of NULL, resets the database pointer to the head
[out]p_disc_datadiscovered data, only valid if the return is not NULL
Returns
wiced_gattdb_entry_t *
wiced_gattdb_entry_t* wiced_bt_gattdb_next_entry ( wiced_gattdb_entry_t p_db_entry)

Return a pointer to next GATT DB entry.

Parameters
p_db_entrycurrent Db entry
Returns
next Db entry
wiced_bool_t wiced_bt_is_same_uuid ( const wiced_bt_uuid_t p_left,
const wiced_bt_uuid_t p_right 
)

Utility function to compare UUIDs.

Parameters
[in]p_left: UUID to compare
[in]p_right: UUID to compare
Returns
WICED_TRUE if same, WICED_FALSE otherwise