From f3eb55825c6dac631e418bfc44004acfd6b43534 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowski Date: Wed, 22 Mar 2017 19:09:19 -0700 Subject: [PATCH] Set preferred PHY and read PHY implementation (2/3) Test: manual Bug: 30622771 Change-Id: I26d64e8f0a2d881ddd648b3c7786ada25c72b455 --- include/hardware/bt_gatt_client.h | 13 +++++++++++++ include/hardware/bt_gatt_server.h | 13 +++++++++++++ 2 files changed, 26 insertions(+) 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 + 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 + cb); + } btgatt_server_interface_t; __END_DECLS