Infineon Logo AIROC BTSDK v4.2 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

GATT Profile Client Functions. More...

Functions

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...
 

Detailed Description

GATT Profile Client Functions.

Function Documentation

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.

Parameters
[in]conn_id: GATT connection handle
[in]mtu: New MTU size
Returns
wiced_bt_gatt_status_t
Note
Allowed mtu range is 23 upto wiced_bt_cfg_ble_t::ble_max_rx_pdu_size for LE links as configured in wiced_bt_cfg_settings_t
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.

Discovery results are notified using GATT_DISCOVERY_RESULT_EVT ; completion is notified using GATT_DISCOVERY_CPLT_EVT of wiced_bt_gatt_cback_t.

Parameters
[in]conn_id: GATT connection handle
[in]discovery_type: Discover type
[in]p_discovery_param: Discover parameter
Returns
wiced_bt_gatt_status_t
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.

Parameters
[in]conn_id: Connection handle
[in]is_execute: WICED_BT_TRUE to execute, WICED_BT_FALSE to cancel
Returns
wiced_bt_gatt_status_t
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.

in response to GATTC_OPTYPE_INDICATION of wiced_bt_gatt_cback_t

Parameters
[in]conn_id: Connection handle
[in]handle: Attribute handle
Returns
wiced_bt_gatt_status_t
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.

Result is notified using GATT_OPERATION_CPLT_EVT of wiced_bt_gatt_cback_t, with wiced_bt_gatt_operation_complete_t::op set to GATTC_OPTYPE_READ_BY_TYPE

Parameters
[in]conn_id: Connection id
[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
[out]p_read_buf: The buffer to save the read response in case the first response to the type does not fit into the available MTU.
[in]len: Length of the p_read_buf
[in]auth_req: Authentication requirements
Returns
wiced_bt_gatt_status_t
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.

Result is notified using GATT_OPERATION_CPLT_EVT of wiced_bt_gatt_cback_t, with wiced_bt_gatt_operation_complete_t::op set to GATTC_OPTYPE_READ_HANDLE

Parameters
[in]conn_id: Connection id
[in]handle: Attribute handle to read
[in]offset: Offset to start read from. To read the entire attribute set offset to 0.
Note
: In case the offset is set to 0, the stack first sends a GATT_REQ_READ and then sends out a series of GATT_REQ_READ_BLOB till the entire attribute is read or until the p_read_buf is filled upto len
Parameters
[out]p_read_buf: The buffer to save the read response
[in]len: Length of the p_read_buf
[in]auth_req: Authentication requirements
Returns
wiced_bt_gatt_status_t
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.

Result is notified using GATT_OPERATION_CPLT_EVT of wiced_bt_gatt_cback_t, with wiced_bt_gatt_operation_complete_t::op set to GATTC_OPTYPE_READ_MULTIPLE for opcode = GATT_REQ_READ_MULTI and set to GATTC_OPTYPE_READ_HANDLE for opcode = GATT_REQ_READ_MULTI_VAR_LENGTH and

Parameters
[in]conn_id: Connection id
[in]opcode: Can be set to GATT_REQ_READ_MULTI or GATT_REQ_READ_MULTI_VAR_LENGTH
[in]num_handles: Number of handles pointed to by p_handle_stream
[in]p_handle_stream: The list of 16 bit handles arranged in Little Endian format
[in]auth_req: Authentication requirements
Returns
wiced_bt_gatt_status_t
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.

Result is notified using GATT_OPERATION_CPLT_EVT of wiced_bt_gatt_cback_t.

Parameters
[in]conn_id: Connection handle
[in]opcode: Can be GATT_REQ_WRITE, GATT_CMD_WRITE, GATT_REQ_PREPARE_WRITE
Note
: When opcode is set to GATT_REQ_WRITE and the length to be written is greater than MTU - 3, then the stack splits the write into a series of GATT_REQ_PREPARE_WRITE and finally sends a GATT_REQ_EXECUTE_WRITE to complete the write.
Parameters
[in]p_hdr: Pointer to the write parameters, with application data in p_app_write_buffer
[in]p_app_write_bufferPointer to the application data buffer to be sent. The len of the buffer is in p_hdr->len
[in]p_app_ctxt: Application context for p_app_write_buffer
Note
The application may free the p_app_write_buffer pointer on receiving a GATT_APP_BUFFER_TRANSMITTED_EVT with wiced_bt_gatt_buffer_transmitted_t::p_app_data = p_app_write_buffer and wiced_bt_gatt_buffer_transmitted_t::p_app_ctxt = p_app_ctxt
Returns
wiced_bt_gatt_status_t