Loading system/service/hal/bluetooth_gatt_interface.cpp +86 −13 Original line number Diff line number Diff line Loading @@ -46,22 +46,60 @@ base::ObserverList<BluetoothGattInterface::ClientObserver>* FOR_EACH_OBSERVER(BluetoothGattInterface::ClientObserver, \ *GetClientObservers(), func) #define VERIFY_INTERFACE_OR_RETURN() \ if (!g_interface) { \ LOG(WARNING) << "Callback received after |g_interface| is NULL"; \ return; \ } void RegisterClientCallback(int status, int client_if, bt_uuid_t* app_uuid) { lock_guard<mutex> lock(g_instance_lock); if (!g_interface) { LOG(WARNING) << "Callback received after global instance was destroyed"; return; } VLOG(2) << __func__ << " - status: " << status << " client_if: " << client_if; VERIFY_INTERFACE_OR_RETURN(); VLOG(2) << "RegisterClientCallback status: " << status << " client_if: " << client_if; if (!app_uuid) { LOG(WARNING) << "|app_uuid| is NULL; ignoring RegisterClientCallback"; return; } FOR_EACH_CLIENT_OBSERVER( RegisterClientCallback(status, client_if, *app_uuid)); RegisterClientCallback(g_interface, status, client_if, *app_uuid)); } void MultiAdvEnableCallback(int client_if, int status) { lock_guard<mutex> lock(g_instance_lock); VLOG(2) << __func__ << " - status: " << status << " client_if: " << client_if; VERIFY_INTERFACE_OR_RETURN(); FOR_EACH_CLIENT_OBSERVER( MultiAdvEnableCallback(g_interface, client_if, status)); } void MultiAdvUpdateCallback(int client_if, int status) { lock_guard<mutex> lock(g_instance_lock); VLOG(2) << __func__ << " - status: " << status << " client_if: " << client_if; VERIFY_INTERFACE_OR_RETURN(); FOR_EACH_CLIENT_OBSERVER( MultiAdvUpdateCallback(g_interface, client_if, status)); } void MultiAdvDataCallback(int client_if, int status) { lock_guard<mutex> lock(g_instance_lock); VLOG(2) << __func__ << " - status: " << status << " client_if: " << client_if; VERIFY_INTERFACE_OR_RETURN(); FOR_EACH_CLIENT_OBSERVER( MultiAdvDataCallback(g_interface, client_if, status)); } void MultiAdvDisableCallback(int client_if, int status) { lock_guard<mutex> lock(g_instance_lock); VLOG(2) << __func__ << " - status: " << status << " client_if: " << client_if; VERIFY_INTERFACE_OR_RETURN(); FOR_EACH_CLIENT_OBSERVER( MultiAdvDisableCallback(g_interface, client_if, status)); } // The HAL Bluetooth GATT client interface callbacks. These signal a mixture of Loading Loading @@ -89,10 +127,10 @@ const btgatt_client_callbacks_t gatt_client_callbacks = { nullptr, // scan_filter_cfg_cb nullptr, // scan_filter_param_cb nullptr, // scan_filter_status_cb nullptr, // multi_adv_enable_cb nullptr, // multi_adv_update_cb nullptr, // multi_adv_data_cb nullptr, // multi_adv_disable_cb MultiAdvEnableCallback, MultiAdvUpdateCallback, MultiAdvDataCallback, MultiAdvDisableCallback, nullptr, // congestion_cb nullptr, // batchscan_cfg_storage_cb nullptr, // batchscan_enb_disable_cb Loading Loading @@ -143,11 +181,19 @@ class BluetoothGattInterfaceImpl : public BluetoothGattInterface { // BluetoothGattInterface overrides: void AddClientObserver(ClientObserver* observer) override { lock_guard<mutex> lock(g_instance_lock); client_observers_.AddObserver(observer); AddClientObserverUnsafe(observer); } void RemoveClientObserver(ClientObserver* observer) override { lock_guard<mutex> lock(g_instance_lock); RemoveClientObserverUnsafe(observer); } void AddClientObserverUnsafe(ClientObserver* observer) override { client_observers_.AddObserver(observer); } void RemoveClientObserverUnsafe(ClientObserver* observer) override { client_observers_.RemoveObserver(observer); } Loading Loading @@ -212,7 +258,34 @@ GetClientObservers() { // Default observer implementations. These are provided so that the methods // themselves are optional. void BluetoothGattInterface::ClientObserver::RegisterClientCallback( int status, int client_if, const bt_uuid_t& app_uuid) { BluetoothGattInterface* /* gatt_iface */, int /* status */, int /* client_if */, const bt_uuid_t& /* app_uuid */) { // Do nothing. } void BluetoothGattInterface::ClientObserver::MultiAdvEnableCallback( BluetoothGattInterface* /* gatt_iface */, int /* status */, int /* client_if */) { // Do nothing. } void BluetoothGattInterface::ClientObserver::MultiAdvUpdateCallback( BluetoothGattInterface* /* gatt_iface */, int /* status */, int /* client_if */) { // Do nothing. } void BluetoothGattInterface::ClientObserver::MultiAdvDataCallback( BluetoothGattInterface* /* gatt_iface */, int /* status */, int /* client_if */) { // Do nothing. } void BluetoothGattInterface::ClientObserver::MultiAdvDisableCallback( BluetoothGattInterface* /* gatt_iface */, int /* status */, int /* client_if */) { // Do nothing. } Loading system/service/hal/bluetooth_gatt_interface.h +32 −4 Original line number Diff line number Diff line Loading @@ -47,9 +47,24 @@ class BluetoothGattInterface { // All of the events below correspond to callbacks defined in // "bt_gatt_client_callbacks_t" in the HAL API definitions. virtual void RegisterClientCallback(int status, int client_if, virtual void RegisterClientCallback( BluetoothGattInterface* gatt_iface, int status, int client_if, const bt_uuid_t& app_uuid); virtual void MultiAdvEnableCallback( BluetoothGattInterface* gatt_iface, int client_if, int status); virtual void MultiAdvUpdateCallback( BluetoothGattInterface* gatt_iface, int client_if, int status); virtual void MultiAdvDataCallback( BluetoothGattInterface* gatt_iface, int client_if, int status); virtual void MultiAdvDisableCallback( BluetoothGattInterface* gatt_iface, int client_if, int status); // TODO(armansito): Complete the list of callbacks. }; Loading @@ -70,14 +85,27 @@ class BluetoothGattInterface { static void InitializeForTesting(BluetoothGattInterface* test_instance); // Returns the BluetoothGattInterface singleton. If the interface has // not been initialized, returns nullptr. // not been initialized, returns nullptr. This method is thread-safe, in that // it will block if the internal lock is being held by another thread. Don't // call this re-entrantly from an observer event as this may cause a deadlock. static BluetoothGattInterface* Get(); // Add or remove an observer that is interested in GATT client interface // notifications from us. // notifications from us. These methods are thread-safe. This implies that // this cannot be called re-entrantly from a ClientObserver event without // causing a dead-lock. If you must modify the observer list re-entrantly, use // the unsafe variants instead. virtual void AddClientObserver(ClientObserver* observer) = 0; virtual void RemoveClientObserver(ClientObserver* observer) = 0; // Unsafe variants of the Add|RemoveClientObserver methods above. The above // methods acquire an internal lock to prevent concurrent access to the // observer list while the unsafe ones don't, so use them wisely. One // recommended use of these methods is from observer methods where the // internal lock is already being held by the executing thread. virtual void AddClientObserverUnsafe(ClientObserver* observer) = 0; virtual void RemoveClientObserverUnsafe(ClientObserver* observer) = 0; // The HAL module pointer that represents the standard BT-GATT client // interface. This is implemented in and provided by the shared Bluetooth // library, so this isn't owned by us. Loading system/service/hal/fake_bluetooth_gatt_interface.cpp +66 −4 Original line number Diff line number Diff line Loading @@ -39,6 +39,40 @@ bt_status_t FakeUnregisterClient(int client_if) { return BT_STATUS_FAIL; } bt_status_t FakeMultiAdvEnable( int client_if, int min_interval, int max_interval, int adv_type, int chnl_map, int tx_power, int timeout_s) { if (g_handler.get()) return g_handler->MultiAdvEnable(client_if, min_interval, max_interval, adv_type, chnl_map, tx_power, timeout_s); return BT_STATUS_FAIL; } bt_status_t FakeMultiAdvSetInstData( int client_if, bool set_scan_rsp, bool include_name, bool incl_txpower, int appearance, int manufacturer_len, char* manufacturer_data, int service_data_len, char* service_data, int service_uuid_len, char* service_uuid) { if (g_handler.get()) return g_handler->MultiAdvSetInstData( client_if, set_scan_rsp, include_name, incl_txpower, appearance, manufacturer_len, manufacturer_data, service_data_len, service_data, service_uuid_len, service_uuid); return BT_STATUS_FAIL; } bt_status_t FakeMultiAdvDisable(int client_if) { if (g_handler.get()) return g_handler->MultiAdvDisable(client_if); return BT_STATUS_FAIL; } btgatt_client_interface_t fake_btgattc_iface = { FakeRegisterClient, FakeUnregisterClient, Loading Loading @@ -68,10 +102,10 @@ btgatt_client_interface_t fake_btgattc_iface = { nullptr, /* configure_mtu */ nullptr, /* conn_parameter_update */ nullptr, /* set_scan_parameters */ nullptr, /* multi_adv_enable */ FakeMultiAdvEnable, nullptr, /* multi_adv_update */ nullptr, /* multi_adv_inst_data */ nullptr, /* multi_adv_disable */ FakeMultiAdvSetInstData, FakeMultiAdvDisable, nullptr, /* batchscan_cfg_storate */ nullptr, /* batchscan_enb_batch_scan */ nullptr, /* batchscan_dis_batch_scan */ Loading Loading @@ -102,7 +136,25 @@ void FakeBluetoothGattInterface::NotifyRegisterClientCallback( int status, int client_if, const bt_uuid_t& app_uuid) { FOR_EACH_OBSERVER(ClientObserver, client_observers_, RegisterClientCallback(status, client_if, app_uuid)); RegisterClientCallback(this, status, client_if, app_uuid)); } void FakeBluetoothGattInterface::NotifyMultiAdvEnableCallback( int client_if, int status) { FOR_EACH_OBSERVER(ClientObserver, client_observers_, MultiAdvEnableCallback(this, client_if, status)); } void FakeBluetoothGattInterface::NotifyMultiAdvDataCallback( int client_if, int status) { FOR_EACH_OBSERVER(ClientObserver, client_observers_, MultiAdvDataCallback(this, client_if, status)); } void FakeBluetoothGattInterface::NotifyMultiAdvDisableCallback( int client_if, int status) { FOR_EACH_OBSERVER(ClientObserver, client_observers_, MultiAdvDisableCallback(this, client_if, status)); } void FakeBluetoothGattInterface::AddClientObserver(ClientObserver* observer) { Loading @@ -116,6 +168,16 @@ void FakeBluetoothGattInterface::RemoveClientObserver( client_observers_.RemoveObserver(observer); } void FakeBluetoothGattInterface::AddClientObserverUnsafe( ClientObserver* observer) { AddClientObserver(observer); } void FakeBluetoothGattInterface::RemoveClientObserverUnsafe( ClientObserver* observer) { RemoveClientObserver(observer); } const btgatt_client_interface_t* FakeBluetoothGattInterface::GetClientHALInterface() const { return &fake_btgattc_iface; Loading system/service/hal/fake_bluetooth_gatt_interface.h +15 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,16 @@ class FakeBluetoothGattInterface : public BluetoothGattInterface { virtual bt_status_t RegisterClient(bt_uuid_t* app_uuid) = 0; virtual bt_status_t UnregisterClient(int client_if) = 0; virtual bt_status_t MultiAdvEnable( int client_if, int min_interval, int max_interval, int adv_type, int chnl_map, int tx_power, int timeout_s) = 0; virtual bt_status_t MultiAdvSetInstData( int client_if, bool set_scan_rsp, bool include_name, bool incl_txpower, int appearance, int manufacturer_len, char* manufacturer_data, int service_data_len, char* service_data, int service_uuid_len, char* service_uuid) = 0; virtual bt_status_t MultiAdvDisable(int client_if) = 0; }; // Constructs the fake with the given handler |handler|. Implementations can Loading @@ -46,10 +56,15 @@ class FakeBluetoothGattInterface : public BluetoothGattInterface { // given parameters. void NotifyRegisterClientCallback(int status, int client_if, const bt_uuid_t& app_uuid); void NotifyMultiAdvEnableCallback(int client_if, int status); void NotifyMultiAdvDataCallback(int client_if, int status); void NotifyMultiAdvDisableCallback(int client_if, int status); // BluetoothGattInterface overrides: void AddClientObserver(ClientObserver* observer) override; void RemoveClientObserver(ClientObserver* observer) override; void AddClientObserverUnsafe(ClientObserver* observer) override; void RemoveClientObserverUnsafe(ClientObserver* observer) override; const btgatt_client_interface_t* GetClientHALInterface() const override; private: Loading Loading
system/service/hal/bluetooth_gatt_interface.cpp +86 −13 Original line number Diff line number Diff line Loading @@ -46,22 +46,60 @@ base::ObserverList<BluetoothGattInterface::ClientObserver>* FOR_EACH_OBSERVER(BluetoothGattInterface::ClientObserver, \ *GetClientObservers(), func) #define VERIFY_INTERFACE_OR_RETURN() \ if (!g_interface) { \ LOG(WARNING) << "Callback received after |g_interface| is NULL"; \ return; \ } void RegisterClientCallback(int status, int client_if, bt_uuid_t* app_uuid) { lock_guard<mutex> lock(g_instance_lock); if (!g_interface) { LOG(WARNING) << "Callback received after global instance was destroyed"; return; } VLOG(2) << __func__ << " - status: " << status << " client_if: " << client_if; VERIFY_INTERFACE_OR_RETURN(); VLOG(2) << "RegisterClientCallback status: " << status << " client_if: " << client_if; if (!app_uuid) { LOG(WARNING) << "|app_uuid| is NULL; ignoring RegisterClientCallback"; return; } FOR_EACH_CLIENT_OBSERVER( RegisterClientCallback(status, client_if, *app_uuid)); RegisterClientCallback(g_interface, status, client_if, *app_uuid)); } void MultiAdvEnableCallback(int client_if, int status) { lock_guard<mutex> lock(g_instance_lock); VLOG(2) << __func__ << " - status: " << status << " client_if: " << client_if; VERIFY_INTERFACE_OR_RETURN(); FOR_EACH_CLIENT_OBSERVER( MultiAdvEnableCallback(g_interface, client_if, status)); } void MultiAdvUpdateCallback(int client_if, int status) { lock_guard<mutex> lock(g_instance_lock); VLOG(2) << __func__ << " - status: " << status << " client_if: " << client_if; VERIFY_INTERFACE_OR_RETURN(); FOR_EACH_CLIENT_OBSERVER( MultiAdvUpdateCallback(g_interface, client_if, status)); } void MultiAdvDataCallback(int client_if, int status) { lock_guard<mutex> lock(g_instance_lock); VLOG(2) << __func__ << " - status: " << status << " client_if: " << client_if; VERIFY_INTERFACE_OR_RETURN(); FOR_EACH_CLIENT_OBSERVER( MultiAdvDataCallback(g_interface, client_if, status)); } void MultiAdvDisableCallback(int client_if, int status) { lock_guard<mutex> lock(g_instance_lock); VLOG(2) << __func__ << " - status: " << status << " client_if: " << client_if; VERIFY_INTERFACE_OR_RETURN(); FOR_EACH_CLIENT_OBSERVER( MultiAdvDisableCallback(g_interface, client_if, status)); } // The HAL Bluetooth GATT client interface callbacks. These signal a mixture of Loading Loading @@ -89,10 +127,10 @@ const btgatt_client_callbacks_t gatt_client_callbacks = { nullptr, // scan_filter_cfg_cb nullptr, // scan_filter_param_cb nullptr, // scan_filter_status_cb nullptr, // multi_adv_enable_cb nullptr, // multi_adv_update_cb nullptr, // multi_adv_data_cb nullptr, // multi_adv_disable_cb MultiAdvEnableCallback, MultiAdvUpdateCallback, MultiAdvDataCallback, MultiAdvDisableCallback, nullptr, // congestion_cb nullptr, // batchscan_cfg_storage_cb nullptr, // batchscan_enb_disable_cb Loading Loading @@ -143,11 +181,19 @@ class BluetoothGattInterfaceImpl : public BluetoothGattInterface { // BluetoothGattInterface overrides: void AddClientObserver(ClientObserver* observer) override { lock_guard<mutex> lock(g_instance_lock); client_observers_.AddObserver(observer); AddClientObserverUnsafe(observer); } void RemoveClientObserver(ClientObserver* observer) override { lock_guard<mutex> lock(g_instance_lock); RemoveClientObserverUnsafe(observer); } void AddClientObserverUnsafe(ClientObserver* observer) override { client_observers_.AddObserver(observer); } void RemoveClientObserverUnsafe(ClientObserver* observer) override { client_observers_.RemoveObserver(observer); } Loading Loading @@ -212,7 +258,34 @@ GetClientObservers() { // Default observer implementations. These are provided so that the methods // themselves are optional. void BluetoothGattInterface::ClientObserver::RegisterClientCallback( int status, int client_if, const bt_uuid_t& app_uuid) { BluetoothGattInterface* /* gatt_iface */, int /* status */, int /* client_if */, const bt_uuid_t& /* app_uuid */) { // Do nothing. } void BluetoothGattInterface::ClientObserver::MultiAdvEnableCallback( BluetoothGattInterface* /* gatt_iface */, int /* status */, int /* client_if */) { // Do nothing. } void BluetoothGattInterface::ClientObserver::MultiAdvUpdateCallback( BluetoothGattInterface* /* gatt_iface */, int /* status */, int /* client_if */) { // Do nothing. } void BluetoothGattInterface::ClientObserver::MultiAdvDataCallback( BluetoothGattInterface* /* gatt_iface */, int /* status */, int /* client_if */) { // Do nothing. } void BluetoothGattInterface::ClientObserver::MultiAdvDisableCallback( BluetoothGattInterface* /* gatt_iface */, int /* status */, int /* client_if */) { // Do nothing. } Loading
system/service/hal/bluetooth_gatt_interface.h +32 −4 Original line number Diff line number Diff line Loading @@ -47,9 +47,24 @@ class BluetoothGattInterface { // All of the events below correspond to callbacks defined in // "bt_gatt_client_callbacks_t" in the HAL API definitions. virtual void RegisterClientCallback(int status, int client_if, virtual void RegisterClientCallback( BluetoothGattInterface* gatt_iface, int status, int client_if, const bt_uuid_t& app_uuid); virtual void MultiAdvEnableCallback( BluetoothGattInterface* gatt_iface, int client_if, int status); virtual void MultiAdvUpdateCallback( BluetoothGattInterface* gatt_iface, int client_if, int status); virtual void MultiAdvDataCallback( BluetoothGattInterface* gatt_iface, int client_if, int status); virtual void MultiAdvDisableCallback( BluetoothGattInterface* gatt_iface, int client_if, int status); // TODO(armansito): Complete the list of callbacks. }; Loading @@ -70,14 +85,27 @@ class BluetoothGattInterface { static void InitializeForTesting(BluetoothGattInterface* test_instance); // Returns the BluetoothGattInterface singleton. If the interface has // not been initialized, returns nullptr. // not been initialized, returns nullptr. This method is thread-safe, in that // it will block if the internal lock is being held by another thread. Don't // call this re-entrantly from an observer event as this may cause a deadlock. static BluetoothGattInterface* Get(); // Add or remove an observer that is interested in GATT client interface // notifications from us. // notifications from us. These methods are thread-safe. This implies that // this cannot be called re-entrantly from a ClientObserver event without // causing a dead-lock. If you must modify the observer list re-entrantly, use // the unsafe variants instead. virtual void AddClientObserver(ClientObserver* observer) = 0; virtual void RemoveClientObserver(ClientObserver* observer) = 0; // Unsafe variants of the Add|RemoveClientObserver methods above. The above // methods acquire an internal lock to prevent concurrent access to the // observer list while the unsafe ones don't, so use them wisely. One // recommended use of these methods is from observer methods where the // internal lock is already being held by the executing thread. virtual void AddClientObserverUnsafe(ClientObserver* observer) = 0; virtual void RemoveClientObserverUnsafe(ClientObserver* observer) = 0; // The HAL module pointer that represents the standard BT-GATT client // interface. This is implemented in and provided by the shared Bluetooth // library, so this isn't owned by us. Loading
system/service/hal/fake_bluetooth_gatt_interface.cpp +66 −4 Original line number Diff line number Diff line Loading @@ -39,6 +39,40 @@ bt_status_t FakeUnregisterClient(int client_if) { return BT_STATUS_FAIL; } bt_status_t FakeMultiAdvEnable( int client_if, int min_interval, int max_interval, int adv_type, int chnl_map, int tx_power, int timeout_s) { if (g_handler.get()) return g_handler->MultiAdvEnable(client_if, min_interval, max_interval, adv_type, chnl_map, tx_power, timeout_s); return BT_STATUS_FAIL; } bt_status_t FakeMultiAdvSetInstData( int client_if, bool set_scan_rsp, bool include_name, bool incl_txpower, int appearance, int manufacturer_len, char* manufacturer_data, int service_data_len, char* service_data, int service_uuid_len, char* service_uuid) { if (g_handler.get()) return g_handler->MultiAdvSetInstData( client_if, set_scan_rsp, include_name, incl_txpower, appearance, manufacturer_len, manufacturer_data, service_data_len, service_data, service_uuid_len, service_uuid); return BT_STATUS_FAIL; } bt_status_t FakeMultiAdvDisable(int client_if) { if (g_handler.get()) return g_handler->MultiAdvDisable(client_if); return BT_STATUS_FAIL; } btgatt_client_interface_t fake_btgattc_iface = { FakeRegisterClient, FakeUnregisterClient, Loading Loading @@ -68,10 +102,10 @@ btgatt_client_interface_t fake_btgattc_iface = { nullptr, /* configure_mtu */ nullptr, /* conn_parameter_update */ nullptr, /* set_scan_parameters */ nullptr, /* multi_adv_enable */ FakeMultiAdvEnable, nullptr, /* multi_adv_update */ nullptr, /* multi_adv_inst_data */ nullptr, /* multi_adv_disable */ FakeMultiAdvSetInstData, FakeMultiAdvDisable, nullptr, /* batchscan_cfg_storate */ nullptr, /* batchscan_enb_batch_scan */ nullptr, /* batchscan_dis_batch_scan */ Loading Loading @@ -102,7 +136,25 @@ void FakeBluetoothGattInterface::NotifyRegisterClientCallback( int status, int client_if, const bt_uuid_t& app_uuid) { FOR_EACH_OBSERVER(ClientObserver, client_observers_, RegisterClientCallback(status, client_if, app_uuid)); RegisterClientCallback(this, status, client_if, app_uuid)); } void FakeBluetoothGattInterface::NotifyMultiAdvEnableCallback( int client_if, int status) { FOR_EACH_OBSERVER(ClientObserver, client_observers_, MultiAdvEnableCallback(this, client_if, status)); } void FakeBluetoothGattInterface::NotifyMultiAdvDataCallback( int client_if, int status) { FOR_EACH_OBSERVER(ClientObserver, client_observers_, MultiAdvDataCallback(this, client_if, status)); } void FakeBluetoothGattInterface::NotifyMultiAdvDisableCallback( int client_if, int status) { FOR_EACH_OBSERVER(ClientObserver, client_observers_, MultiAdvDisableCallback(this, client_if, status)); } void FakeBluetoothGattInterface::AddClientObserver(ClientObserver* observer) { Loading @@ -116,6 +168,16 @@ void FakeBluetoothGattInterface::RemoveClientObserver( client_observers_.RemoveObserver(observer); } void FakeBluetoothGattInterface::AddClientObserverUnsafe( ClientObserver* observer) { AddClientObserver(observer); } void FakeBluetoothGattInterface::RemoveClientObserverUnsafe( ClientObserver* observer) { RemoveClientObserver(observer); } const btgatt_client_interface_t* FakeBluetoothGattInterface::GetClientHALInterface() const { return &fake_btgattc_iface; Loading
system/service/hal/fake_bluetooth_gatt_interface.h +15 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,16 @@ class FakeBluetoothGattInterface : public BluetoothGattInterface { virtual bt_status_t RegisterClient(bt_uuid_t* app_uuid) = 0; virtual bt_status_t UnregisterClient(int client_if) = 0; virtual bt_status_t MultiAdvEnable( int client_if, int min_interval, int max_interval, int adv_type, int chnl_map, int tx_power, int timeout_s) = 0; virtual bt_status_t MultiAdvSetInstData( int client_if, bool set_scan_rsp, bool include_name, bool incl_txpower, int appearance, int manufacturer_len, char* manufacturer_data, int service_data_len, char* service_data, int service_uuid_len, char* service_uuid) = 0; virtual bt_status_t MultiAdvDisable(int client_if) = 0; }; // Constructs the fake with the given handler |handler|. Implementations can Loading @@ -46,10 +56,15 @@ class FakeBluetoothGattInterface : public BluetoothGattInterface { // given parameters. void NotifyRegisterClientCallback(int status, int client_if, const bt_uuid_t& app_uuid); void NotifyMultiAdvEnableCallback(int client_if, int status); void NotifyMultiAdvDataCallback(int client_if, int status); void NotifyMultiAdvDisableCallback(int client_if, int status); // BluetoothGattInterface overrides: void AddClientObserver(ClientObserver* observer) override; void RemoveClientObserver(ClientObserver* observer) override; void AddClientObserverUnsafe(ClientObserver* observer) override; void RemoveClientObserverUnsafe(ClientObserver* observer) override; const btgatt_client_interface_t* GetClientHALInterface() const override; private: Loading