From f82a2497957d19fd7b7c7a074f783b487acac051 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowski Date: Mon, 31 Oct 2016 11:14:05 -0700 Subject: [PATCH] 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 --- include/hardware/ble_advertiser.h | 3 +++ include/hardware/bt_gatt_client.h | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/include/hardware/ble_advertiser.h b/include/hardware/ble_advertiser.h index 10bf8ddd..f486ed83 100644 --- a/include/hardware/ble_advertiser.h +++ b/include/hardware/ble_advertiser.h @@ -42,6 +42,9 @@ class BleAdvertiserInterface { /** Set the advertising data or scan response data */ virtual void SetData(bool set_scan_rsp, vector 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 eb9af2b8..6c5a85ec 100644 --- a/include/hardware/bt_gatt_client.h +++ b/include/hardware/bt_gatt_client.h @@ -165,11 +165,6 @@ typedef void (*write_descriptor_callback)(int conn_id, int status, uint16_t hand 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 @@ typedef struct { 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 @@ typedef struct { 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 );