GATT Server Data API

group gattsr_api_functions

GATT Server Data API.

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.

Application is expected to hold the contents of this buffer till it receives an GATT_ATTRIBUTE_REQUEST_EVT with wiced_bt_gatt_attribute_request_t.request_type set to GATTS_REQ_TYPE_CONF. The wiced_bt_gatt_req_conf_t.p_app_buffer value contains the pointer returned back to the application after sending it to the controller.

note

p_app_buffer pointer is required to be valid till the application receives a GATT_ATTRIBUTE_REQUEST_EVT with wiced_bt_gatt_attribute_request_t.request_type set to GATTS_REQ_TYPE_CONF. The wiced_bt_gatt_req_conf_t.p_app_buffer value contains the pointer returned back to the application after sending it to the controller.

Return

wiced_bt_gatt_status_t

Parameters
  • [in] conn_id: : connection identifier.

  • [in] attr_handle: : Attribute handle of this handle value indication.

  • [in] val_len: : Length of indication value passed.

  • [in] p_app_buffer: : Indication Value, peristent till the data is sent out to the controller

  • [in] p_app_ctxt: : Application context returned with the p_app_buffer once data is sent to the controller in the GATT_APP_BUFFER_TRANSMITTED_EVT event

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.

Application is expected to hold the contents of this buffer till it receives an GATT_ATTRIBUTE_REQUEST_EVT with wiced_bt_gatt_attribute_request_t.request_type set to GATTS_REQ_TYPE_CONF. The wiced_bt_gatt_req_conf_t.p_app_buffer value contains the pointer returned back to the application after sending it to the controller.

note

p_app_buffer pointer is required to be valid till the application receives a GATT_ATTRIBUTE_REQUEST_EVT with wiced_bt_gatt_attribute_request_t.request_type set to GATTS_REQ_TYPE_CONF. The wiced_bt_gatt_req_conf_t.p_app_buffer value contains the pointer returned back to the application after sending it to the controller.

Return

wiced_bt_gatt_status_t

Parameters
  • [in] conn_id: : connection identifier.

  • [in] attr_handle: : Attribute handle of this handle value notification.

  • [in] val_len: : Length of notification value passed.

  • [in] p_app_buffer: : Notification Value, peristent till the data is sent out to the controller

  • [in] p_app_ctxt: : Application context returned with the p_app_buffer once data is sent to the controller in the GATT_APP_BUFFER_TRANSMITTED_EVT event

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.

Application is expected to hold the contents of this buffer till it receives an GATT_ATTRIBUTE_REQUEST_EVT with wiced_bt_gatt_attribute_request_t.request_type set to GATTS_REQ_TYPE_CONF. The wiced_bt_gatt_req_conf_t.p_app_buffer value contains the pointer returned back to the application after sending it to the controller.

note

: Notification values are formatted by the application by setting the handle(2 octets LE), len(2 octets LE) and data of handle of length for atleast 2 handle, len, data pairs.

note

p_app_buffer pointer is required to be valid till the application receives a GATT_ATTRIBUTE_REQUEST_EVT with wiced_bt_gatt_attribute_request_t.request_type set to GATTS_REQ_TYPE_CONF. The wiced_bt_gatt_req_conf_t.p_app_buffer value contains the pointer returned back to the application after sending it to the controller.

Return

wiced_bt_gatt_status_t

Parameters
  • [in] conn_id: : connection identifier.

  • [in] app_buffer_len: : Length of multiple notification values passed, should not exceed MTU - 1.

  • [in] p_app_buffer: : Notification Values, peristent till the data is sent out to the controller

Parameters
  • [in] p_app_ctxt: : Application context returned with the p_app_buffer once data is sent to the controller in the GATT_APP_BUFFER_TRANSMITTED_EVT event