Merge "Set preferred PHY and read PHY implementation (2/3)"
diff --git a/include/hardware/bt_gatt_client.h b/include/hardware/bt_gatt_client.h
index 76b52fd..3df0a96 100644
--- a/include/hardware/bt_gatt_client.h
+++ b/include/hardware/bt_gatt_client.h
@@ -166,6 +166,10 @@
 /** 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 @@
     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 @@
     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 b105cba..d2e4ccd 100644
--- a/include/hardware/bt_gatt_server.h
+++ b/include/hardware/bt_gatt_server.h
@@ -105,6 +105,10 @@
 /** 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 @@
     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 @@
     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