Bluetooth 5: Update LE2M implementation through DM (2/3)
This patch moves LE2M implementation to the DM instead of tied to GATT.
Below are the reasons to make this change:
1) Per link setting usually be done under DM, such as link policy etc.
2) In the future, if LECOC is coming to use in more profile/apps,
we can not rely on GATT API for these. Separate API should be required.
3) we could have multiple logical GATT user on top of the same link.
4) Also this will avoid duplicating all the APIs on GATTC and GATTS.
Bug: 37586939
Test: manual
Change-Id: I71579d6160fb16fb891e75cca64fe3cf9745116a
diff --git a/include/hardware/bt_gatt_client.h b/include/hardware/bt_gatt_client.h
index 154cb09..98d50d5 100644
--- a/include/hardware/bt_gatt_client.h
+++ b/include/hardware/bt_gatt_client.h
@@ -276,11 +276,11 @@
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,
+ bt_status_t (*set_preferred_phy)(const bt_bdaddr_t& bd_addr, uint8_t tx_phy,
uint8_t rx_phy, uint16_t phy_options);
bt_status_t (*read_phy)(
- int conn_id,
+ const bt_bdaddr_t& bd_addr,
base::Callback<void(uint8_t tx_phy, uint8_t rx_phy, uint8_t status)>
cb);
diff --git a/include/hardware/bt_gatt_server.h b/include/hardware/bt_gatt_server.h
index 36259a1..fcc0f30 100644
--- a/include/hardware/bt_gatt_server.h
+++ b/include/hardware/bt_gatt_server.h
@@ -166,11 +166,11 @@
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,
+ bt_status_t (*set_preferred_phy)(const bt_bdaddr_t& bd_addr, uint8_t tx_phy,
uint8_t rx_phy, uint16_t phy_options);
bt_status_t (*read_phy)(
- int conn_id,
+ const bt_bdaddr_t& bd_addr,
base::Callback<void(uint8_t tx_phy, uint8_t rx_phy, uint8_t status)>
cb);