summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Pawlowski <jpawlowski@google.com>2017-03-24 01:08:07 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-03-24 01:08:08 +0000
commit4929629d91908b68d7b4a9740f70a9b2bb05a7f3 (patch)
tree379cccb00ea09a0a05819d5b3d17e5c75f0abf40
parentecb7fc53325d1eecd23e7eb221720f7d76f0af14 (diff)
parentf3eb55825c6dac631e418bfc44004acfd6b43534 (diff)
downloadlibhardware-4929629d91908b68d7b4a9740f70a9b2bb05a7f3.tar.gz
Merge "Set preferred PHY and read PHY implementation (2/3)"
-rw-r--r--include/hardware/bt_gatt_client.h13
-rw-r--r--include/hardware/bt_gatt_server.h13
2 files changed, 26 insertions, 0 deletions
diff --git a/include/hardware/bt_gatt_client.h b/include/hardware/bt_gatt_client.h
index 76b52fd3..3df0a960 100644
--- a/include/hardware/bt_gatt_client.h
+++ b/include/hardware/bt_gatt_client.h
@@ -166,6 +166,10 @@ typedef void (*services_removed_callback)(int conn_id, uint16_t start_handle, ui
/** GATT services were added */
typedef void (*services_added_callback)(int conn_id, btgatt_db_element_t *added, int added_count);
+/** Callback invoked when the PHY for a given connection changes */
+typedef void (*phy_updated_callback)(int conn_id, uint8_t tx_phy,
+ uint8_t rx_phy, uint8_t status);
+
typedef struct {
register_client_callback register_client_cb;
connect_callback open_cb;
@@ -184,6 +188,7 @@ typedef struct {
get_gatt_db_callback get_gatt_db_cb;
services_removed_callback services_removed_cb;
services_added_callback services_added_cb;
+ phy_updated_callback phy_updated_cb;
} btgatt_client_callbacks_t;
/** Represents the standard BT-GATT client interface. */
@@ -255,6 +260,14 @@ typedef struct {
bt_status_t (*conn_parameter_update)(const bt_bdaddr_t *bd_addr, int min_interval,
int max_interval, int latency, int timeout);
+ bt_status_t (*set_preferred_phy)(int conn_id, uint8_t tx_phy,
+ uint8_t rx_phy, uint16_t phy_options);
+
+ bt_status_t (*read_phy)(
+ int conn_id,
+ base::Callback<void(uint8_t tx_phy, uint8_t rx_phy, uint8_t status)>
+ cb);
+
/** Test mode interface */
bt_status_t (*test_command)( int command, btgatt_test_params_t* params);
diff --git a/include/hardware/bt_gatt_server.h b/include/hardware/bt_gatt_server.h
index b105cba3..d2e4ccd0 100644
--- a/include/hardware/bt_gatt_server.h
+++ b/include/hardware/bt_gatt_server.h
@@ -105,6 +105,10 @@ typedef void (*congestion_callback)(int conn_id, bool congested);
/** Callback invoked when the MTU for a given connection changes */
typedef void (*mtu_changed_callback)(int conn_id, int mtu);
+/** Callback invoked when the PHY for a given connection changes */
+typedef void (*phy_updated_callback)(int conn_id, uint8_t tx_phy,
+ uint8_t rx_phy, uint8_t status);
+
typedef struct {
register_server_callback register_server_cb;
connection_callback connection_cb;
@@ -120,6 +124,7 @@ typedef struct {
indication_sent_callback indication_sent_cb;
congestion_callback congestion_cb;
mtu_changed_callback mtu_changed_cb;
+ phy_updated_callback phy_updated_cb;
} btgatt_server_callbacks_t;
/** Represents the standard BT-GATT server interface. */
@@ -156,6 +161,14 @@ typedef struct {
bt_status_t (*send_response)(int conn_id, int trans_id,
int status, btgatt_response_t *response);
+ bt_status_t (*set_preferred_phy)(int conn_id, uint8_t tx_phy,
+ uint8_t rx_phy, uint16_t phy_options);
+
+ bt_status_t (*read_phy)(
+ int conn_id,
+ base::Callback<void(uint8_t tx_phy, uint8_t rx_phy, uint8_t status)>
+ cb);
+
} btgatt_server_interface_t;
__END_DECLS