diff options
author | Andre Eisenbach <andre@broadcom.com> | 2014-03-28 14:53:33 -0700 |
---|---|---|
committer | Andre Eisenbach <eisenbach@google.com> | 2014-06-25 14:00:30 -0700 |
commit | 9ef3c72ef3e90a93ed641e757310c2a389d32834 (patch) | |
tree | bdcf7fa2117583eabe773b39549dbb961fd46d26 /include/hardware/bt_gatt_client.h | |
parent | fb5fd093db65913f25d8fcdb962a11030c06874f (diff) | |
download | hardware_libhardware-9ef3c72ef3e90a93ed641e757310c2a389d32834.zip hardware_libhardware-9ef3c72ef3e90a93ed641e757310c2a389d32834.tar.gz hardware_libhardware-9ef3c72ef3e90a93ed641e757310c2a389d32834.tar.bz2 |
LE: Add notification sent and congestion callbacks (1/4)
This change introduces two new callbacks for applications to better
handle LE notification flow control and transport congestion. The
notification callback is invoked when the remote platform confirms an
indication or when a local notification has been passed to the
controller. No new notifications should be sent until a callback is
received.
Congestion callbacks are triggered when a GATT operation cannot be sent
to the local Bluetooth controller. Repeatedly calling
writeCharacteristic() for example will eventually trigger a congestion
callback. Applications cannot send additional data until a further
callback is received, indicating that the congestion has cleared up.
Change-Id: I613cbf968770921f853a407888bb8308849039f3
Diffstat (limited to 'include/hardware/bt_gatt_client.h')
-rw-r--r-- | include/hardware/bt_gatt_client.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/hardware/bt_gatt_client.h b/include/hardware/bt_gatt_client.h index d650671..d20c2e8 100644 --- a/include/hardware/bt_gatt_client.h +++ b/include/hardware/bt_gatt_client.h @@ -174,6 +174,13 @@ typedef void (*multi_adv_data_callback)(int client_if, int status); /** Callback invoked when multi-adv disable operation has completed */ typedef void (*multi_adv_disable_callback)(int client_if, int status); +/** + * Callback notifying an application that a remote device connection is currently congested + * and cannot receive any more data. An application should avoid sending more data until + * a further callback is received indicating the congestion status has been cleared. + */ +typedef void (*congestion_callback)(int conn_id, bool congested); + typedef struct { register_client_callback register_client_cb; scan_result_callback scan_result_cb; @@ -199,6 +206,7 @@ typedef struct { multi_adv_update_callback multi_adv_update_cb; multi_adv_data_callback multi_adv_data_cb; multi_adv_disable_callback multi_adv_disable_cb; + congestion_callback congestion_cb; } btgatt_client_callbacks_t; /** Represents the standard BT-GATT client interface. */ |