mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Add support for sharing DiscoveryCallbacks across BluetoothDevices.
This commit is contained in:
@@ -96,6 +96,12 @@ class MonitoredBluetoothDevice final
|
||||
ObserverList<api::BluetoothClassicMedium::Observer> &observers);
|
||||
~MonitoredBluetoothDevice() override { unregisterProxy(); }
|
||||
|
||||
void SetDiscoveryCallback(
|
||||
std::shared_ptr<api::BluetoothClassicMedium::DiscoveryCallback>
|
||||
&callback) {
|
||||
discovery_cb_ = callback;
|
||||
};
|
||||
|
||||
protected:
|
||||
void onPropertiesChanged(
|
||||
const std::string &interfaceName,
|
||||
@@ -104,6 +110,7 @@ class MonitoredBluetoothDevice final
|
||||
|
||||
private:
|
||||
ObserverList<api::BluetoothClassicMedium::Observer> &observers_;
|
||||
std::weak_ptr<api::BluetoothClassicMedium::DiscoveryCallback> discovery_cb_;
|
||||
};
|
||||
|
||||
} // namespace linux
|
||||
|
||||
Reference in New Issue
Block a user