Add support for sharing DiscoveryCallbacks across BluetoothDevices.

This commit is contained in:
Vibhav Pant
2023-09-05 20:00:25 +05:30
parent ad7401616b
commit 4042687b8d
7 changed files with 20 additions and 7 deletions
@@ -163,6 +163,10 @@ void MonitoredBluetoothDevice::onPropertiesChanged(
for (auto &observer : observers_.GetObservers()) {
observer->DeviceConnectedStateChanged(*this, it->second);
}
} else if (it->first == bluez::DEVICE_NAME) {
auto callback = discovery_cb_.lock();
if (callback != nullptr && callback->device_name_changed_cb != nullptr)
callback->device_name_changed_cb(*this);
}
}
}