From 6f0c6f1874d329b7f7a2fdee14f3d70b5172224a Mon Sep 17 00:00:00 2001 From: Jakub Pawlowski Date: Thu, 23 Mar 2017 18:13:12 -0700 Subject: [PATCH] Expose connection update callback (2/3) Test: manual Bug: 30622771 Change-Id: I5ed4fe503ba3212af808b759b67d71b895395bd3 --- include/hardware/bt_gatt_client.h | 6 ++++++ include/hardware/bt_gatt_server.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/include/hardware/bt_gatt_client.h b/include/hardware/bt_gatt_client.h index 3df0a960..d54256d8 100644 --- a/include/hardware/bt_gatt_client.h +++ b/include/hardware/bt_gatt_client.h @@ -170,6 +170,11 @@ typedef void (*services_added_callback)(int conn_id, btgatt_db_element_t *added, typedef void (*phy_updated_callback)(int conn_id, uint8_t tx_phy, uint8_t rx_phy, uint8_t status); +/** Callback invoked when the connection parameters for a given connection changes */ +typedef void (*conn_updated_callback)(int conn_id, uint16_t interval, + uint16_t latency, uint16_t timeout, + uint8_t status); + typedef struct { register_client_callback register_client_cb; connect_callback open_cb; @@ -189,6 +194,7 @@ typedef struct { services_removed_callback services_removed_cb; services_added_callback services_added_cb; phy_updated_callback phy_updated_cb; + conn_updated_callback conn_updated_cb; } btgatt_client_callbacks_t; /** Represents the standard BT-GATT client interface. */ diff --git a/include/hardware/bt_gatt_server.h b/include/hardware/bt_gatt_server.h index d2e4ccd0..36259a18 100644 --- a/include/hardware/bt_gatt_server.h +++ b/include/hardware/bt_gatt_server.h @@ -109,6 +109,10 @@ typedef void (*mtu_changed_callback)(int conn_id, int mtu); typedef void (*phy_updated_callback)(int conn_id, uint8_t tx_phy, uint8_t rx_phy, uint8_t status); +/** Callback invoked when the connection parameters for a given connection changes */ +typedef void (*conn_updated_callback)(int conn_id, uint16_t interval, + uint16_t latency, uint16_t timeout, + uint8_t status); typedef struct { register_server_callback register_server_cb; connection_callback connection_cb; @@ -125,6 +129,7 @@ typedef struct { congestion_callback congestion_cb; mtu_changed_callback mtu_changed_cb; phy_updated_callback phy_updated_cb; + conn_updated_callback conn_updated_cb; } btgatt_server_callbacks_t; /** Represents the standard BT-GATT server interface. */