Move start advertise method to advertising interface (2/3)
Advertising related code should be exposed through
BleAdvertiserInterface. Move client.listen function into this interface.
Remove reduntant clientif parameter.
Bug: 30622771
Bug: 24099160
Test: no tests necessary
Change-Id: Ic4335f2c65c1e21f20d3ae08222fba4341b63e27
diff --git a/include/hardware/ble_advertiser.h b/include/hardware/ble_advertiser.h
index 10bf8dd..f486ed8 100644
--- a/include/hardware/ble_advertiser.h
+++ b/include/hardware/ble_advertiser.h
@@ -42,6 +42,9 @@
/** Set the advertising data or scan response data */
virtual void SetData(bool set_scan_rsp, vector<uint8_t> data) = 0;
+ /** Start or stop advertising */
+ virtual void Enable(bool start, BleAdvertiserCb cb) = 0;
+
/* Set the parameters as per spec, user manual specified values */
virtual void MultiAdvSetParameters(int advertiser_id, int min_interval,
int max_interval, int adv_type,
diff --git a/include/hardware/bt_gatt_client.h b/include/hardware/bt_gatt_client.h
index eb9af2b..6c5a85e 100644
--- a/include/hardware/bt_gatt_client.h
+++ b/include/hardware/bt_gatt_client.h
@@ -165,11 +165,6 @@
typedef void (*read_remote_rssi_callback)(int client_if, bt_bdaddr_t* bda,
int rssi, int status);
-/**
- * Callback indicating the status of a listen() operation
- */
-typedef void (*listen_callback)(int status, int server_if);
-
/** Callback invoked when the MTU for a given connection changes */
typedef void (*configure_mtu_callback)(int conn_id, int status, int mtu);
@@ -203,7 +198,6 @@
write_descriptor_callback write_descriptor_cb;
execute_write_callback execute_write_cb;
read_remote_rssi_callback read_remote_rssi_cb;
- listen_callback listen_cb;
configure_mtu_callback configure_mtu_cb;
congestion_callback congestion_cb;
get_gatt_db_callback get_gatt_db_cb;
@@ -228,9 +222,6 @@
bt_status_t (*disconnect)( int client_if, const bt_bdaddr_t *bd_addr,
int conn_id);
- /** Start or stop advertisements to listen for incoming connections */
- bt_status_t (*listen)(int client_if, bool start);
-
/** Clear the attribute cache for a given device */
bt_status_t (*refresh)( int client_if, const bt_bdaddr_t *bd_addr );