migrated to sdbus-cpp v2

This commit is contained in:
lasan
2026-03-19 20:23:24 +05:30
parent 45406089e1
commit e0a888a51f
33 changed files with 198 additions and 186 deletions
@@ -26,8 +26,8 @@ void Server::onResolveServiceReply(const int32_t& interface,
const std::string& host, const int32_t& aprotocol,
const std::string& address, const uint16_t& port,
const std::vector<std::vector<uint8_t>>& txt, const uint32_t& flags,
const sdbus::Error* error) {
if (error != nullptr && error->isValid()) {
std::optional<sdbus::Error> error) {
if (error.has_value()) {
LOG(ERROR) << __func__ << ": ResolveService failed with error '"
<< error->getName() << "' message '" << error->getMessage()
<< "'";
@@ -67,7 +67,7 @@ class Server final
const std::string& host, const int32_t& aprotocol,
const std::string& address, const uint16_t& port,
const std::vector<std::vector<uint8_t>>& txt, const uint32_t& flags,
const sdbus::Error* error) override;
std::optional<sdbus::Error> error) override;
};
class EntryGroup final
@@ -120,10 +120,10 @@ bool GattClient::WriteCharacteristic(
try {
chr->WriteValue(
value_bytes,
{{"type",
type == api::ble::GattClient::WriteType::kWithResponse
? "request"
: "command"}});
{{sdbus::PropertyName("type"),
sdbus::Variant(type == api::ble::GattClient::WriteType::kWithResponse
? "request"
: "command")}});
return true;
} catch (const sdbus::Error &e) {
DBUS_LOG_METHOD_CALL_ERROR(chr, "WriteValue", e);
@@ -199,7 +199,7 @@ void BluezGattDiscovery::Shutdown() {
bool BluezGattDiscovery::InitializeKnownServices() {
std::map<sdbus::ObjectPath,
std::map<std::string, std::map<std::string, sdbus::Variant>>>
std::map<sdbus::InterfaceName, std::map<sdbus::PropertyName, sdbus::Variant>>>
objects;
try {
objects = GetManagedObjects();
@@ -213,16 +213,16 @@ bool BluezGattDiscovery::InitializeKnownServices() {
auto chr_it = std::find_if(
objects.cbegin(), objects.cend(),
[](std::pair<sdbus::ObjectPath,
std::map<std::string, std::map<std::string, sdbus::Variant>>>
std::map<sdbus::InterfaceName, std::map<sdbus::PropertyName, sdbus::Variant>>>
object) {
return object.second.count(
org::bluez::GattCharacteristic1_proxy::INTERFACE_NAME) == 1;
sdbus::InterfaceName(org::bluez::GattCharacteristic1_proxy::INTERFACE_NAME)) == 1;
});
for (; chr_it != objects.cend(); ++chr_it) {
const auto& [path, ifaces] = *chr_it;
auto iface_it = ifaces.find(org::bluez::GattCharacteristic1_proxy::INTERFACE_NAME);
auto iface_it = ifaces.find(sdbus::InterfaceName(org::bluez::GattCharacteristic1_proxy::INTERFACE_NAME));
if (iface_it == ifaces.end()) {
// Not a GattCharacteristic1 object (or interfaces map incomplete) -> skip
continue;
@@ -343,10 +343,11 @@ BluezGattDiscovery::GetSubscribedCharacteristic(
std::optional<std::tuple<Uuid, Uuid, sdbus::ObjectPath>>
BluezGattDiscovery::characteristicProperties(
const sdbus::ObjectPath &char_path,
const std::map<std::string, sdbus::Variant> &properties) {
const std::map<sdbus::PropertyName, sdbus::Variant> &properties) {
mutex_.AssertHeld();
const std::string &chr_uuid_str = properties.at("UUID");
const std::string &chr_uuid_str =
properties.at(sdbus::PropertyName("UUID")).get<std::string>();
auto chr_uuid = UuidFromString(chr_uuid_str);
if (!chr_uuid.has_value()) {
LOG(ERROR) << ": Couldn't parse UUID '" << chr_uuid_str
@@ -354,7 +355,8 @@ BluezGattDiscovery::characteristicProperties(
return std::nullopt;
}
const sdbus::ObjectPath &service_path = properties.at("Service");
const sdbus::ObjectPath &service_path =
properties.at(sdbus::PropertyName("Service")).get<sdbus::ObjectPath>();
if (cached_services_.count(service_path) == 0) {
cached_services_.emplace(
service_path, std::make_unique<GattServiceClient>(system_bus_, service_path));
@@ -403,11 +405,11 @@ void BluezGattDiscovery::onInterfacesAdded(
std::map<sdbus::PropertyName, sdbus::Variant>>
&interfacesAndProperties) {
if (interfacesAndProperties.count(
org::bluez::GattCharacteristic1_proxy::INTERFACE_NAME) == 0)
sdbus::InterfaceName(org::bluez::GattCharacteristic1_proxy::INTERFACE_NAME)) == 0)
return;
const auto &properties = interfacesAndProperties.at(
org::bluez::GattCharacteristic1_proxy::INTERFACE_NAME);
sdbus::InterfaceName(org::bluez::GattCharacteristic1_proxy::INTERFACE_NAME));
absl::MutexLock lock(&mutex_);
auto maybe_props = characteristicProperties(objectPath, properties);
@@ -78,7 +78,7 @@ class BluezGattDiscovery final : public bluez::BluezObjectManager {
std::optional<std::tuple<Uuid, Uuid, sdbus::ObjectPath>>
characteristicProperties(
const sdbus::ObjectPath &char_path,
const std::map<std::string, sdbus::Variant> &properties)
const std::map<sdbus::PropertyName, sdbus::Variant> &properties)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
void Shutdown() ABSL_LOCKS_EXCLUDED(mutex_);
@@ -45,7 +45,7 @@ GattServer::CreateCharacteristic(
system_bus_, count, service_uuid, server_cb_, devices_);
try {
service->emitInterfacesAddedSignal(
{org::bluez::GattService1_adaptor::INTERFACE_NAME});
{sdbus::InterfaceName(org::bluez::GattService1_adaptor::INTERFACE_NAME)});
} catch (const sdbus::Error& e) {
LOG(ERROR)
<< __func__
@@ -144,7 +144,7 @@ void GattServer::Stop() {
LOG(INFO) << __func__ << ": Unregistering service "
<< service->getObject().getObjectPath();
try {
manager.UnregisterApplication("/");
manager.UnregisterApplication(sdbus::ObjectPath("/"));
} catch (const sdbus::Error& e) {
DBUS_LOG_METHOD_CALL_ERROR(&manager, "UnregisterApplication", e);
}
@@ -65,7 +65,8 @@ class GattServer : public api::ble::GattServer {
devices_(std::move(devices)),
adapter_(adapter),
local_peripheral_(adapter_),
gatt_service_root_object_manager(std::make_unique<RootObjectManager>(system_bus_, "/com/google/nearby/medium/ble/gatt")),
gatt_service_root_object_manager(std::make_unique<RootObjectManager>(system_bus_,
sdbus::ObjectPath("/com/google/nearby/medium/ble/gatt"))),
gatt_manager_(std::make_unique<bluez::GattManager>(system_bus_, adapter_.GetObjectPath())),
server_cb_(std::make_shared<api::ble::ServerGattConnectionCallback>(
std::move(server_cb))) {}
@@ -72,7 +72,7 @@ BleV2Medium::BleV2Medium(BluetoothAdapter &adapter)
observers_(std::make_shared<ObserverList<api::BluetoothClassicMedium::Observer>>()),
devices_(std::make_unique<BluetoothDevices>(
system_bus_, adapter_.GetObjectPath(), *observers_)),
root_object_manager_(std::make_unique<RootObjectManager>(*system_bus_, "/com/google/nearby/medium/ble/advertisement/monitor")),
root_object_manager_(std::make_unique<RootObjectManager>(*system_bus_, sdbus::ObjectPath("/com/google/nearby/medium/ble/advertisement/monitor"))),
adv_monitor_manager_(
bluez::AdvertisementMonitorManager::
DiscoverAdvertisementMonitorManager(*system_bus_, adapter_)),
@@ -268,7 +268,7 @@ bool BleV2Medium::StartScanning(const Uuid &service_uuid,
try {
// why is this emitted?
monitor->emitInterfacesAddedSignal(
{org::bluez::AdvertisementMonitor1_adaptor::INTERFACE_NAME});
{sdbus::InterfaceName(org::bluez::AdvertisementMonitor1_adaptor::INTERFACE_NAME)});
// adv_monitor_manager_ -> RegisterMonitor(monitor -> getObject().getObjectPath());
LOG(INFO)<< __func__ << ": Registered advertisement monitor with path " << monitor -> getObject().getObjectPath();
@@ -289,7 +289,7 @@ bool BleV2Medium::StartScanning(const Uuid &service_uuid,
device_watcher = nullptr;
try {
monitor->emitInterfacesRemovedSignal(
{org::bluez::AdvertisementMonitor1_adaptor::INTERFACE_NAME});
{sdbus::InterfaceName(org::bluez::AdvertisementMonitor1_adaptor::INTERFACE_NAME)});
} catch (const sdbus::Error &e) {
LOG(ERROR)
<< __func__
@@ -338,7 +338,7 @@ bool BleV2Medium::StopScanning() {
LOG(INFO) << __func__ << ": Removing advertising monitor "
<< adv_monitor->getObject().getObjectPath();
adv_monitor->emitInterfacesRemovedSignal(
{org::bluez::AdvertisementMonitor1_adaptor::INTERFACE_NAME});
{sdbus::InterfaceName(org::bluez::AdvertisementMonitor1_adaptor::INTERFACE_NAME)});
}
active_adv_monitors_.erase(monitor_it);
cur_monitored_service_uuid_ = std::nullopt;
@@ -366,7 +366,7 @@ bool BleV2Medium::StopScanning() {
std::move(callback));
try {
monitor->emitInterfacesAddedSignal(
{org::bluez::AdvertisementMonitor1_adaptor::INTERFACE_NAME});
{sdbus::InterfaceName(org::bluez::AdvertisementMonitor1_adaptor::INTERFACE_NAME)});
} catch (const sdbus::Error &e) {
LOG(ERROR)
<< __func__
@@ -384,7 +384,7 @@ bool BleV2Medium::StopScanning() {
<< adapter_.GetObjectPath();
try {
monitor->emitInterfacesRemovedSignal(
{org::bluez::AdvertisementMonitor1_adaptor::INTERFACE_NAME});
{sdbus::InterfaceName(org::bluez::AdvertisementMonitor1_adaptor::INTERFACE_NAME)});
} catch (const sdbus::Error &e) {
LOG(ERROR)
<< __func__
@@ -412,7 +412,7 @@ bool BleV2Medium::StopScanning() {
auto &[monitor, watcher] = active_adv_monitors_[service_uuid];
try {
monitor->emitInterfacesRemovedSignal(
{org::bluez::AdvertisementMonitor1_adaptor::INTERFACE_NAME});
{sdbus::InterfaceName(org::bluez::AdvertisementMonitor1_adaptor::INTERFACE_NAME)});
} catch (const sdbus::Error &e) {
LOG(ERROR)
<< __func__
@@ -497,8 +497,8 @@ bool BleV2Medium::IsExtendedAdvertisementsAvailable() {
bool BleV2Medium::StartLEDiscovery() {
std::map<std::string, sdbus::Variant> filter;
filter["Transport"] = "auto";
filter["DuplicateData"] = true;
filter["Transport"] = sdbus::Variant("auto");
filter["DuplicateData"] = sdbus::Variant(true);
auto &adapter = adapter_.GetBluezAdapterObject();
try {
@@ -58,7 +58,7 @@ void Profile::NewConnection(
LOG(ERROR) << __func__
<< ": NewConnection called on released object "
<< getObject().getObjectPath();
throw sdbus::Error("org.bluez.Error.Rejected",
throw sdbus::Error(sdbus::Error::Name("org.bluez.Error.Rejected"),
"NewConnection called on released object");
}
@@ -95,7 +95,7 @@ void Profile::RequestDisconnection(
<< ": RequestDisconnection called with a device object "
"we don't know about: "
<< device_object_path;
throw sdbus::Error("org.bluez.Error.Rejected", "Unknown object");
throw sdbus::Error(sdbus::Error::Name("org.bluez.Error.Rejected"), "Unknown object");
}
auto mac_addr = device -> GetMacAddress();
@@ -128,17 +128,17 @@ bool ProfileManager::Register(std::optional<absl::string_view> name,
try {
std::map<std::string, sdbus::Variant> options;
if (name.has_value()) {
options["Name"] = std::string(*name);
options["Name"] = sdbus::Variant(std::string(*name));
}
options["RequireAuthorization"] = false;
options["RequireAuthentication"] = false;
options["Channel"] = static_cast<uint16_t>(0);
options["PSM"] = static_cast<uint16_t>(0);
options["RequireAuthorization"] = sdbus::Variant(false);
options["RequireAuthentication"] = sdbus::Variant(false);
options["Channel"] = sdbus::Variant(static_cast<uint16_t>(0));
options["PSM"] = sdbus::Variant(static_cast<uint16_t>(0));
RegisterProfile(profile->getObject().getObjectPath(),
std::string(service_uuid), options);
} catch (const sdbus::Error &e) {
BLUEZ_LOG_METHOD_CALL_ERROR(&getProxy(), "RegisterProfile", e);
BLUEZ_LOG_METHOD_CALL_ERROR(this, "RegisterProfile", e);
return false;
}
@@ -167,7 +167,7 @@ void ProfileManager::Unregister(absl::string_view service_uuid) {
try {
UnregisterProfile(profile_object_path);
} catch (const sdbus::Error &e) {
BLUEZ_LOG_METHOD_CALL_ERROR(&getProxy(), "UnregisterProfile", e);
BLUEZ_LOG_METHOD_CALL_ERROR(this, "UnregisterProfile", e);
}
registered_services_.erase(std::string(service_uuid));
@@ -72,10 +72,10 @@ class Profile final
explicit FDProperties(const std::map<std::string, sdbus::Variant> &fd_props)
: version(std::nullopt), features(std::nullopt) {
if (fd_props.count("Version") == 1) {
version = fd_props.at("Version");
version = fd_props.at("Version").get<uint16_t>();
}
if (fd_props.count("Features") == 1) {
features = fd_props.at("Features");
features = fd_props.at("Features").get<uint16_t>();
}
}
@@ -151,7 +151,8 @@ bool BluetoothDevice::ConnectToProfile(absl::string_view service_uuid) {
std::shared_ptr<bluez::Device> device,
ObserverList<api::BluetoothClassicMedium::Observer> &observers)
: BluetoothDevice(device),
ProxyInterfaces<sdbus::Properties_proxy>(*system_bus, bluez::SERVICE_DEST,
ProxyInterfaces<sdbus::Properties_proxy>(*system_bus,
sdbus::ServiceName(bluez::SERVICE_DEST),
device->getProxy().getObjectPath()),
system_bus_(std::move(system_bus)),
observers_(observers) {
@@ -159,9 +160,9 @@ bool BluetoothDevice::ConnectToProfile(absl::string_view service_uuid) {
}
void MonitoredBluetoothDevice::onPropertiesChanged(
const std::string &interfaceName,
const std::map<std::string, sdbus::Variant> &changedProperties,
const std::vector<std::string> &invalidatedProperties) {
const sdbus::InterfaceName &interfaceName,
const std::map<sdbus::PropertyName, sdbus::Variant> &changedProperties,
const std::vector<sdbus::PropertyName> &invalidatedProperties) {
if (interfaceName != bluez::DEVICE_INTERFACE) {
return;
}
@@ -172,7 +173,7 @@ void MonitoredBluetoothDevice::onPropertiesChanged(
if (it->first == bluez::DEVICE_PROP_ADDRESS) {
LOG(INFO) << __func__ << ": " << getProxy().getObjectPath()
<< ": Notifying observers about address change";
std::string address = it->second;
std::string address = it->second.get<std::string>();
for (const auto &observer : observers_.GetObservers()) {
observer->DeviceAddressChanged(*this, address);
}
@@ -181,17 +182,17 @@ void MonitoredBluetoothDevice::onPropertiesChanged(
LOG(INFO) << __func__ << ": " << getProxy().getObjectPath()
<< "Notifying observers about paired status change.";
for (const auto &observer : observers_.GetObservers()) {
observer->DevicePairedChanged(*this, it->second);
observer->DevicePairedChanged(*this, it->second.get<bool>());
}
} else if (it->first == bluez::DEVICE_PROP_CONNECTED) {
LOG(INFO)
<< __func__ << ": " << getProxy().getObjectPath()
<< "Notifying observers about connected status change";
for (const auto &observer : observers_.GetObservers()) {
observer->DeviceConnectedStateChanged(*this, it->second);
observer->DeviceConnectedStateChanged(*this, it->second.get<bool>());
}
} else if ( it -> first == "ServicesResolved"){
LOG(INFO) << ": ServicesResolved :" << std::string(it->second);
LOG(INFO) << ": ServicesResolved :" << it->second.get<std::string>();
}else if (it->first == bluez::DEVICE_NAME) {
auto callback = GetDiscoveryCallback();
if (callback != nullptr && callback->device_name_changed_cb != nullptr)
@@ -108,7 +108,8 @@ class BluetoothDevice : public api::BluetoothDevice {
}
}
void SetPairReplyCallback(absl::AnyInvocable<void(const sdbus::Error *)> cb) {
void SetPairReplyCallback(
absl::AnyInvocable<void(std::optional<sdbus::Error>)> cb) {
auto device = device_;
if (device) device->SetPairReplyCallback(std::move(cb));
}
@@ -137,7 +138,10 @@ class MonitoredBluetoothDevice final
public:
using sdbus::ProxyInterfaces<sdbus::Properties_proxy>::registerProxy;
using sdbus::ProxyInterfaces<sdbus::Properties_proxy>::unregisterProxy;
using sdbus::ProxyInterfaces<sdbus::Properties_proxy>::getObjectPath;
sdbus::ObjectPath getObjectPath() const {
return getProxy().getObjectPath();
}
MonitoredBluetoothDevice(const MonitoredBluetoothDevice &) = delete;
MonitoredBluetoothDevice(MonitoredBluetoothDevice &&) = delete;
@@ -159,9 +163,9 @@ class MonitoredBluetoothDevice final
protected:
void onPropertiesChanged(
const std::string &interfaceName,
const std::map<std::string, sdbus::Variant> &changedProperties,
const std::vector<std::string> &invalidatedProperties) override;
const sdbus::InterfaceName &interfaceName,
const std::map<sdbus::PropertyName, sdbus::Variant> &changedProperties,
const std::vector<sdbus::PropertyName> &invalidatedProperties) override;
private:
std::shared_ptr<sdbus::IConnection> system_bus_;
@@ -58,7 +58,7 @@ bool BluetoothClassicMedium::StartDiscovery(
observers_);
std::map<std::string, sdbus::Variant> filter;
filter["Transport"] = "auto";
filter["Transport"] = sdbus::Variant("auto");
auto &adapter = adapter_.GetBluezAdapterObject();
try {
@@ -93,7 +93,7 @@ std::shared_ptr<BluetoothDevice> BluetoothDevices::get_device_by_address(
const MacAddress &addr) {
auto device_object_path =
bluez::device_object_path(adapter_object_path_, addr.ToString());
return get_device_by_path(device_object_path);
return get_device_by_path(sdbus::ObjectPath(device_object_path));
}
void BluetoothDevices::remove_device_by_path(
@@ -152,7 +152,7 @@ void DeviceWatcher::onInterfacesAdded(
return;
}
if (interfacesAndProperties.count(org::bluez::Device1_proxy::INTERFACE_NAME) ==
if (interfacesAndProperties.count(sdbus::InterfaceName(org::bluez::Device1_proxy::INTERFACE_NAME)) ==
0)
return;
@@ -181,16 +181,16 @@ void DeviceWatcher::onInterfacesRemoved(
auto removed_device_it = std::find(interfaces.begin(), interfaces.end(),
org::bluez::Device1_proxy::INTERFACE_NAME);
if (removed_device_it != interfaces.end()) {
auto device = devices_->get_device_by_path(object);
auto device = devices_->get_device_by_path(objectPath);
if (device == nullptr) {
LOG(WARNING) << __func__
<< ": received InterfacesRemoved for a device "
"we don't know about: "
<< object;
<< objectPath;
return;
}
LOG(INFO) << __func__ << ": Device " << object
LOG(INFO) << __func__ << ": Device " << objectPath
<< " has been removed";
if (discovery_cb_ != nullptr && discovery_cb_->device_lost_cb != nullptr) {
discovery_cb_->device_lost_cb(*device);
@@ -200,16 +200,16 @@ void DeviceWatcher::onInterfacesRemoved(
for (const auto &observer : observers_->GetObservers()) {
observer->DeviceRemoved(*device);
}
devices_->remove_device_by_path(object);
devices_->remove_device_by_path(objectPath);
} else {
devices_->mark_peripheral_lost(object);
devices_->mark_peripheral_lost(objectPath);
}
}
}
void DeviceWatcher::notifyExistingDevices() {
std::map<sdbus::ObjectPath,
std::map<std::string, std::map<std::string, sdbus::Variant>>>
std::map<sdbus::InterfaceName, std::map<sdbus::PropertyName, sdbus::Variant>>>
objects;
try {
objects = GetManagedObjects();
@@ -222,15 +222,15 @@ void DeviceWatcher::notifyExistingDevices() {
for (const auto& [device_path, interfaces] : objects) {
if (device_path.find(absl::Substitute("$0/dev_", adapter_object_path_)) == 0 &&
interfaces.count(org::bluez::Device1_proxy::INTERFACE_NAME) == 1) {
interfaces.count(sdbus::InterfaceName(org::bluez::Device1_proxy::INTERFACE_NAME)) == 1) {
// Don't remove bonded, paired, connected, or trusted devices
bool should_skip = false;
auto device_interface_it = interfaces.find(org::bluez::Device1_proxy::INTERFACE_NAME);
auto device_interface_it = interfaces.find(sdbus::InterfaceName(org::bluez::Device1_proxy::INTERFACE_NAME));
if (device_interface_it != interfaces.end()) {
const auto& properties = device_interface_it->second;
auto check_bool_property = [&properties](const std::string& prop_name) -> bool {
auto check_bool_property = [&properties](const sdbus::PropertyName& prop_name) -> bool {
auto it = properties.find(prop_name);
if (it != properties.end()) {
try {
@@ -242,10 +242,10 @@ void DeviceWatcher::notifyExistingDevices() {
return false;
};
if (check_bool_property("Bonded") ||
check_bool_property("Paired") ||
check_bool_property("Connected") ||
check_bool_property("Trusted")) {
if (check_bool_property(sdbus::PropertyName("Bonded")) ||
check_bool_property(sdbus::PropertyName("Paired")) ||
check_bool_property(sdbus::PropertyName("Connected")) ||
check_bool_property(sdbus::PropertyName("Trusted"))) {
should_skip = true;
LOG(INFO) << __func__ << ": Skipping device " << device_path
<< " (bonded/paired/connected/trusted)";
@@ -26,8 +26,8 @@
namespace nearby {
namespace linux {
void BluetoothPairing::pairing_reply_handler(const sdbus::Error *error) {
if (error != nullptr && error->isValid()) {
void BluetoothPairing::pairing_reply_handler(std::optional<sdbus::Error> error) {
if (error.has_value() && error->isValid()) {
const auto &name = error->getName();
api::BluetoothPairingCallback::PairingError err =
api::BluetoothPairingCallback::PairingError::kAuthFailed;
@@ -78,8 +78,8 @@ bool BluetoothPairing::InitiatePairing(
bool BluetoothPairing::FinishPairing(
std::optional<absl::string_view> pin_code) {
device_->SetPairReplyCallback([this](const sdbus::Error *error) {
this->pairing_reply_handler(error);
device_->SetPairReplyCallback([this](std::optional<sdbus::Error> error) {
this->pairing_reply_handler(std::move(error));
});
auto call = device_->Pair();
@@ -41,7 +41,7 @@ class BluetoothPairing final : public api::BluetoothPairing {
bool IsPaired() override;
private:
void pairing_reply_handler(const sdbus::Error *e);
void pairing_reply_handler(std::optional<sdbus::Error> e);
sdbus::PendingAsyncCall pair_async_call_;
+11 -11
View File
@@ -30,39 +30,39 @@ std::string device_object_path(const sdbus::ObjectPath &adapter_object_path,
}
sdbus::ObjectPath profile_object_path(absl::string_view service_uuid) {
return absl::Substitute(
return sdbus::ObjectPath(absl::Substitute(
"/com/google/nearby/medium/bluetooth_classic/profiles/$0",
absl::StrReplaceAll(service_uuid, {{"-", "_"}}));
absl::StrReplaceAll(service_uuid, {{"-", "_"}})));
}
sdbus::ObjectPath gatt_profile_object_path(absl::string_view service_uuid) {
return absl::Substitute(
return sdbus::ObjectPath(absl::Substitute(
"$0/profile_$1",
NEARBY_BLE_GATT_PROFILE_PATH_ROOT,
absl::StrReplaceAll(service_uuid, {{"-", "_"}}));
absl::StrReplaceAll(service_uuid, {{"-", "_"}})));
}
sdbus::ObjectPath adapter_object_path(absl::string_view name) {
return absl::Substitute("/org/bluez/$0", name);
return sdbus::ObjectPath(absl::Substitute("/org/bluez/$0", name));
}
sdbus::ObjectPath gatt_service_path(size_t num) {
return absl::Substitute("$0/service$1", NEARBY_BLE_GATT_PATH_ROOT, num);
return sdbus::ObjectPath(absl::Substitute("$0/service$1", NEARBY_BLE_GATT_PATH_ROOT, num));
}
sdbus::ObjectPath gatt_characteristic_path(
const sdbus::ObjectPath &service_path, size_t num) {
return absl::Substitute("$0/char$1", service_path, num);
return sdbus::ObjectPath(absl::Substitute("$0/char$1", service_path, num));
}
sdbus::ObjectPath ble_advertisement_path(size_t num) {
return absl::Substitute("/com/google/nearby/medium/ble/advertisement/$0",
num);
return sdbus::ObjectPath(absl::Substitute("/com/google/nearby/medium/ble/advertisement/$0",
num));
}
sdbus::ObjectPath advertisement_monitor_path(absl::string_view uuid) {
return absl::Substitute(
return sdbus::ObjectPath(absl::Substitute(
"/com/google/nearby/medium/ble/advertisement/monitor/$0",
absl::StrReplaceAll(uuid, {{"-", "_"}}));
absl::StrReplaceAll(uuid, {{"-", "_"}})));
}
int16_t TxPowerLevelDbm(api::ble::TxPowerLevel level) {
@@ -56,7 +56,7 @@ void AdvertisementMonitor::DeviceFound(const sdbus::ObjectPath &device) {
continue;
}
std::vector<uint8_t> bytes = data;
std::vector<uint8_t> bytes = data.get<std::vector<uint8_t>>();
adv_data.service_data.emplace(*uuid,
std::string(bytes.begin(), bytes.end()));
}
@@ -56,7 +56,7 @@ class AdvertisementMonitorManager final
const ::nearby::linux::BluetoothAdapter &adapter) {
bluez::BluezObjectManager manager(system_bus);
std::map<sdbus::ObjectPath,
std::map<std::string, std::map<std::string, sdbus::Variant>>>
std::map<sdbus::InterfaceName, std::map<sdbus::PropertyName, sdbus::Variant>>>
objects;
try {
objects = manager.GetManagedObjects();
@@ -71,7 +71,7 @@ class AdvertisementMonitorManager final
}
if (objects[adapter.GetObjectPath()].count(
org::bluez::AdvertisementMonitorManager1_proxy::INTERFACE_NAME) ==
sdbus::InterfaceName(org::bluez::AdvertisementMonitorManager1_proxy::INTERFACE_NAME)) ==
0) {
LOG(ERROR)
<< __func__ << ": Adapter " << adapter.GetObjectPath()
@@ -35,7 +35,8 @@ class Device : public sdbus::ProxyInterfaces<org::bluez::Device1_proxy> {
}
~Device() { unregisterProxy(); }
void SetPairReplyCallback(absl::AnyInvocable<void(const sdbus::Error *)> cb)
void SetPairReplyCallback(
absl::AnyInvocable<void(std::optional<sdbus::Error>)> cb)
ABSL_LOCKS_EXCLUDED(pair_callback_lock_) {
absl::MutexLock l(&pair_callback_lock_);
on_pair_reply_cb_ = std::move(cb);
@@ -47,16 +48,16 @@ class Device : public sdbus::ProxyInterfaces<org::bluez::Device1_proxy> {
}
protected:
void onPairReply(const sdbus::Error *error) override
void onPairReply(std::optional<sdbus::Error> error) override
ABSL_LOCKS_EXCLUDED(pair_callback_lock_) {
absl::ReaderMutexLock l(&pair_callback_lock_);
if (on_pair_reply_cb_ != nullptr) on_pair_reply_cb_(error);
if (on_pair_reply_cb_ != nullptr) on_pair_reply_cb_(std::move(error));
};
private:
std::shared_ptr<sdbus::IConnection> system_bus;
absl::Mutex pair_callback_lock_;
absl::AnyInvocable<void(const sdbus::Error *)> on_pair_reply_cb_
absl::AnyInvocable<void(std::optional<sdbus::Error>)> on_pair_reply_cb_
ABSL_GUARDED_BY(pair_callback_lock_) = nullptr;
};
} // namespace bluez
@@ -22,14 +22,15 @@ namespace nearby {
namespace linux {
namespace bluez {
void SubscribedGattCharacteristicClient::onPropertiesChanged(
const std::string& interfaceName,
const std::map<std::string, sdbus::Variant>& changedProperties,
const std::vector<std::string>& invalidatedProperties) {
const sdbus::InterfaceName& interfaceName,
const std::map<sdbus::PropertyName, sdbus::Variant>& changedProperties,
const std::vector<sdbus::PropertyName>& invalidatedProperties) {
if (interfaceName != org::bluez::GattCharacteristic1_proxy::INTERFACE_NAME)
return;
if (changedProperties.count("Value") == 1) {
std::vector<uint8_t> value_bytes = changedProperties.at("Value");
if (changedProperties.count(sdbus::PropertyName("Value")) == 1) {
std::vector<uint8_t> value_bytes = changedProperties.at(sdbus::PropertyName("Value"))
.get<std::vector<uint8_t>>();
if (notify_callback_ != nullptr) {
auto value = std::string(value_bytes.cbegin(), value_bytes.cend());
notify_callback_(value);
@@ -41,9 +41,9 @@ class GattCharacteristicClient
protected:
void onPropertiesChanged(
const std::string& interfaceName,
const std::map<std::string, sdbus::Variant>& changedProperties,
const std::vector<std::string>& invalidatedProperties) override {}
const sdbus::InterfaceName& interfaceName,
const std::map<sdbus::PropertyName, sdbus::Variant>& changedProperties,
const std::vector<sdbus::PropertyName>& invalidatedProperties) override {}
std::shared_ptr<sdbus::IConnection> system_bus_;
};
@@ -58,9 +58,9 @@ class SubscribedGattCharacteristicClient : public GattCharacteristicClient {
protected:
void onPropertiesChanged(
const std::string& interfaceName,
const std::map<std::string, sdbus::Variant>& changedProperties,
const std::vector<std::string>& invalidatedProperties) override;
const sdbus::InterfaceName& interfaceName,
const std::map<sdbus::PropertyName, sdbus::Variant>& changedProperties,
const std::vector<sdbus::PropertyName>& invalidatedProperties) override;
private:
absl::AnyInvocable<void(absl::string_view value)> notify_callback_;
@@ -57,8 +57,8 @@ absl::Status GattCharacteristicServer::NotifyChanged(
}
try {
emitPropertiesChangedSignal(GattCharacteristic1_adaptor::INTERFACE_NAME,
{"Value"});
emitPropertiesChangedSignal(sdbus::InterfaceName(GattCharacteristic1_adaptor::INTERFACE_NAME),
{sdbus::PropertyName("Value")});
return absl::OkStatus();
} catch (const sdbus::Error &e) {
LOG(ERROR) << __func__
@@ -84,13 +84,13 @@ void GattCharacteristicServer::ReadValue(
}
}
uint16_t offset = options["offset"];
sdbus::ObjectPath device_path = options["device"];
uint16_t offset = options["offset"].get<uint16_t>();
sdbus::ObjectPath device_path = options["device"].get<sdbus::ObjectPath>();
auto device = devices_->get_device_by_path(device_path);
if (device == nullptr) {
result.returnError(
sdbus::Error("org.bluez.Error.NotAuthorized", "device does not exist"));
sdbus::Error(sdbus::Error::Name("org.bluez.Error.NotAuthorized"), "device does not exist"));
return;
}
auto characteristic = characteristic_;
@@ -132,16 +132,16 @@ void GattCharacteristicServer::ReadValue(
void GattCharacteristicServer::WriteValue(
sdbus::Result<> &&result, std::vector<uint8_t> value,
std::map<std::string, sdbus::Variant> options) {
uint16_t offset = options["offset"];
sdbus::ObjectPath device_path = options["device"];
uint16_t offset = options["offset"].get<uint16_t>();
sdbus::ObjectPath device_path = options["device"].get<sdbus::ObjectPath>();
auto device = devices_->get_device_by_path(device_path);
if (device == nullptr) {
result.returnError(
sdbus::Error("org.bluez.Error.NotAuthorized", "device does not exist"));
sdbus::Error(sdbus::Error::Name("org.bluez.Error.NotAuthorized"), "device does not exist"));
return;
}
std::string type = options["type"];
std::string type = options["type"].get<std::string>();
std::string data(value.begin(), value.end());
auto characteristic = characteristic_;
@@ -183,7 +183,7 @@ void GattCharacteristicServer::StartNotify() {
notifying_ = true;
}
} else {
throw(sdbus::Error("org.bluez.Error.NotSupported"));
throw(sdbus::Error(sdbus::Error::Name("org.bluez.Error.NotSupported")));
}
}
@@ -198,7 +198,7 @@ void GattCharacteristicServer::StopNotify() {
notifying_ = false;
}
} else {
throw(sdbus::Error("org.bluez.Error.Failed"));
throw(sdbus::Error(sdbus::Error::Name("org.bluez.Error.Failed")));
}
}
@@ -36,7 +36,7 @@ bool GattServiceServer::AddCharacteristic(
server_cb_, devices_);
try {
chr->emitInterfacesAddedSignal(
{org::bluez::GattCharacteristic1_adaptor::INTERFACE_NAME});
{sdbus::InterfaceName(org::bluez::GattCharacteristic1_adaptor::INTERFACE_NAME)});
} catch (const sdbus::Error &e) {
LOG(ERROR)
<< __func__
@@ -66,7 +66,7 @@ class GattServiceServer final
<< characteristic->getObject().getObjectPath();
try {
characteristic->emitInterfacesRemovedSignal(
{org::bluez::GattCharacteristic1_adaptor::INTERFACE_NAME});
{sdbus::InterfaceName(org::bluez::GattCharacteristic1_adaptor::INTERFACE_NAME)});
} catch (const sdbus::Error &e) {
LOG(ERROR)
<< __func__
@@ -90,7 +90,7 @@ class GattServiceServer final
// Properties
std::string UUID() override { return uuid_; }
bool Primary() override { return primary_; }
sdbus::ObjectPath Device() override { return "/"; }
sdbus::ObjectPath Device() override { return sdbus::ObjectPath("/"); }
std::vector<sdbus::ObjectPath> Includes() override { return {}; }
absl::Mutex characterstics_mutex_;
@@ -51,7 +51,7 @@ LEAdvertisement::LEAdvertisement(
}
// LOG(INFO)<< __func__ << ": " << uuid_string;
// LOG(INFO)<< __func__ << ": " << BytesToHexString(data_bytes);
service_data_.insert({uuid_string, std::move(data_bytes)});
service_data_.insert({uuid_string, std::move(sdbus::Variant(data_bytes))});
// service_data_.insert({"0000FE2C-0000-1000-8000-00805F9B34FB", std::move(data_bytes)});
}
@@ -73,9 +73,9 @@ class LEAdvertisement final
std::map<std::string, sdbus::Variant> ServiceData() override {
return service_data_;
}
std::map<std::string, sdbus::Variant> ScanResponseServiceData() override {
return {};
}
//std::map<std::string, sdbus::Variant> ScanResponseServiceData() override {
// return {};
//}
std::vector<std::string> Includes() override {
return {};
}
@@ -26,7 +26,7 @@ ObjectManager::GetActiveConnectionForAccessPoint(
const sdbus::ObjectPath &access_point,
const sdbus::ObjectPath &device_path) {
std::map<sdbus::ObjectPath,
std::map<std::string, std::map<std::string, sdbus::Variant>>>
std::map<sdbus::InterfaceName, std::map<sdbus::PropertyName, sdbus::Variant>>>
objects;
try {
objects = GetManagedObjects();
@@ -38,13 +38,13 @@ ObjectManager::GetActiveConnectionForAccessPoint(
for (auto &[object_path, interfaces] : objects) {
if (object_path.find("/org/freedesktop/NetworkManager/ActiveConnection/") ==
0) {
if (interfaces.count(org::freedesktop::NetworkManager::Connection::
Active_proxy::INTERFACE_NAME) == 1) {
auto props = interfaces[org::freedesktop::NetworkManager::Connection::
Active_proxy::INTERFACE_NAME];
sdbus::ObjectPath specific_object = props["SpecificObject"];
if (interfaces.count(sdbus::InterfaceName(org::freedesktop::NetworkManager::Connection::
Active_proxy::INTERFACE_NAME)) == 1) {
auto props = interfaces[sdbus::InterfaceName(org::freedesktop::NetworkManager::Connection::
Active_proxy::INTERFACE_NAME)];
sdbus::ObjectPath specific_object = props[sdbus::PropertyName("SpecificObject")].get<sdbus::ObjectPath>();
if (specific_object == access_point) {
std::vector<sdbus::ObjectPath> devices = props["Devices"];
std::vector<sdbus::ObjectPath> devices = props[sdbus::PropertyName("Devices")].get<std::vector<sdbus::ObjectPath>>();
for (auto &path : devices) {
if (path == device_path) {
return std::make_unique<ActiveConnection>(
@@ -61,7 +61,7 @@ ObjectManager::GetActiveConnectionForAccessPoint(
std::unique_ptr<IP4Config> ObjectManager::GetIp4Config(
const sdbus::ObjectPath &active_connection) {
std::map<sdbus::ObjectPath,
std::map<std::string, std::map<std::string, sdbus::Variant>>>
std::map<sdbus::InterfaceName, std::map<sdbus::PropertyName, sdbus::Variant>>>
objects;
try {
objects = GetManagedObjects();
@@ -73,13 +73,13 @@ std::unique_ptr<IP4Config> ObjectManager::GetIp4Config(
for (auto &[object_path, interfaces] : objects) {
if (object_path.find("/org/freedesktop/NetworkManager/ActiveConnection/",
0) == 0) {
if (interfaces.count(org::freedesktop::NetworkManager::Connection::
Active_proxy::INTERFACE_NAME) == 1) {
auto props = interfaces[org::freedesktop::NetworkManager::Connection::
Active_proxy::INTERFACE_NAME];
sdbus::ObjectPath specific_object = props["SpecificObject"];
if (interfaces.count(sdbus::InterfaceName(org::freedesktop::NetworkManager::Connection::
Active_proxy::INTERFACE_NAME)) == 1) {
auto props = interfaces[sdbus::InterfaceName(org::freedesktop::NetworkManager::Connection::
Active_proxy::INTERFACE_NAME)];
sdbus::ObjectPath specific_object = props[sdbus::PropertyName("SpecificObject")].get<sdbus::ObjectPath>();
if (specific_object == active_connection) {
sdbus::ObjectPath ip4config = props["Ip4Config"];
sdbus::ObjectPath ip4config = sdbus::ObjectPath(props[sdbus::MemberName("Ip4Config")]);
return std::make_unique<IP4Config>(system_bus_, ip4config);
}
}
@@ -96,7 +96,7 @@ std::vector<std::string> ActiveConnection::GetIP4Addresses() {
std::vector<std::string> ip4addresses;
for (auto &data : address_data) {
if (data.count("address") == 1) {
ip4addresses.push_back(data["address"]);
ip4addresses.push_back(data["address"].get<std::string>());
}
}
return ip4addresses;
@@ -224,7 +224,7 @@ ImplementationPlatform::CreateBluetoothAdapter() {
try {
auto interfaces = manager.GetManagedObjects();
for (auto &[object, properties] : interfaces) {
if (properties.count(org::bluez::Adapter1_proxy::INTERFACE_NAME) == 1) {
if (properties.count(sdbus::InterfaceName(org::bluez::Adapter1_proxy::INTERFACE_NAME)) == 1) {
LOG(INFO) << __func__ << ": found bluetooth adapter " << object;
return std::make_unique<linux::BluetoothAdapter>(system_bus, object);
}
@@ -273,7 +273,7 @@ static std::unique_ptr<linux::NetworkManagerWifiMedium> createWifiMedium(
auto manager = linux::networkmanager::ObjectManager(nm->GetConnection());
std::map<sdbus::ObjectPath,
std::map<std::string, std::map<std::string, sdbus::Variant>>>
std::map<sdbus::InterfaceName, std::map<sdbus::PropertyName, sdbus::Variant>>>
objects;
try {
objects = manager.GetManagedObjects();
@@ -285,8 +285,8 @@ static std::unique_ptr<linux::NetworkManagerWifiMedium> createWifiMedium(
for (auto &device_path : device_paths) {
if (objects.count(device_path) == 1) {
auto device = objects[device_path];
if (device.count(org::freedesktop::NetworkManager::Device::
Wireless_proxy::INTERFACE_NAME) == 1) {
if (device.count(sdbus::InterfaceName(org::freedesktop::NetworkManager::Device::
Wireless_proxy::INTERFACE_NAME)) == 1) {
LOG(INFO) << __func__
<< ": Found a wireless device at :" << device_path;
return std::make_unique<linux::NetworkManagerWifiMedium>(nm,
@@ -192,40 +192,42 @@ bool NetworkManagerWifiHotspotMedium::StartWifiHotspot(
connection_settings{
{
"connection",
{{"uuid", *connection_id},
{"id", "Google Nearby Hotspot"},
{"type", "802-11-wireless"},
{"zone", "Public"}},
{{"uuid", sdbus::Variant(*connection_id)},
{"id", sdbus::Variant("Google Nearby Hotspot")},
{"type", sdbus::Variant("802-11-wireless")},
{"zone", sdbus::Variant("Public")}},
},
{"802-11-wireless",
{{"assigned-mac-address", "random"},
{"ap-isolation", networkmanager::constants::kNMTernaryFalse},
{"mode", "ap"},
{"band", selected_band},
{"channel", selected_channel},
{"ssid", std::vector<uint8_t>(ssid.begin(), ssid.end())},
{"security", "802-11-wireless-security"}}},
{{"assigned-mac-address", sdbus::Variant("random")},
{"ap-isolation", sdbus::Variant(networkmanager::constants::kNMTernaryFalse)},
{"mode", sdbus::Variant("ap")},
{"band", sdbus::Variant(selected_band)},
{"channel", sdbus::Variant(selected_channel)},
{"ssid", sdbus::Variant(std::vector<uint8_t>(ssid.begin(), ssid.end()))},
{"security", sdbus::Variant("802-11-wireless-security")}}},
{"802-11-wireless-security",
{{"pmf",
networkmanager::constants::setting::kWirelessSecurityPMFDisable},
{"key-mgmt", "wpa-psk"},
{"psk", password}}},
{"ipv4", {{"method", "shared"}}},
{{"pmf", sdbus::Variant(networkmanager::constants::setting::kWirelessSecurityPMFDisable)},
{"key-mgmt", sdbus::Variant("wpa-psk")},
{"psk", sdbus::Variant(password)}}},
{"ipv4", {{"method", sdbus::Variant("shared")}}},
{"ipv6",
{
{"addr-gen-mode", networkmanager::constants::setting::
kIP6ConfigAddrGenModeStablePrivacy},
{"method", "shared"},
{"addr-gen-mode",
sdbus::Variant(networkmanager::constants::setting::kIP6ConfigAddrGenModeStablePrivacy)},
{"method", sdbus::Variant("shared")},
}}};
if (include_channel_width) {
connection_settings["802-11-wireless"]["channel-width"] =
fallback_channel_width;
sdbus::Variant(fallback_channel_width);
}
try {
auto [path, active_path, result] =
network_manager_->AddAndActivateConnection2(
connection_settings, wireless_device_->getProxy().getObjectPath(), "/",
{{"persist", "volatile"}, {"bind-activation", "dbus-client"}});
connection_settings,
wireless_device_->getProxy().getObjectPath(),
sdbus::ObjectPath("/"),
{{"persist", sdbus::Variant("volatile")},
{"bind-activation", sdbus::Variant("dbus-client")}});
active_conn = std::make_unique<networkmanager::ActiveConnection>(
system_bus_, active_path);
break;
@@ -63,7 +63,7 @@ std::string WifiLanServerSocket::GetIPAddress() const {
}
if (address_data.size() > 0) {
std::string ip_address = address_data[0]["address"];
std::string ip_address = address_data[0]["address"].get<std::string>();
struct in_addr addr {};
if (inet_aton(ip_address.c_str(), &addr) == 0) {
LOG(ERROR) << __func__
@@ -43,7 +43,7 @@ api::WifiCapability &NetworkManagerWifiMedium::GetCapability() {
capability_.supports_6_ghz = (cap_mask & 0x00008000) != 0;
capability_.support_wifi_direct = true;
} catch (const sdbus::Error &e) {
DBUS_LOG_PROPERTY_GET_ERROR(&getProxy(), "WirelessCapabilities", e);
DBUS_LOG_PROPERTY_GET_ERROR(this, "WirelessCapabilities", e);
}
return capability_;
@@ -93,17 +93,17 @@ api::WifiInformation &NetworkManagerWifiMedium::GetInformation() {
}
void NetworkManagerWifiMedium::onPropertiesChanged(
const std::string &interfaceName,
const std::map<std::string, sdbus::Variant> &changedProperties,
const std::vector<std::string> &invalidatedProperties) {
const sdbus::InterfaceName &interfaceName,
const std::map<sdbus::PropertyName, sdbus::Variant> &changedProperties,
const std::vector<sdbus::PropertyName> &invalidatedProperties) {
if (interfaceName != org::freedesktop::NetworkManager::Device::
Wireless_proxy::INTERFACE_NAME) {
return;
}
if (changedProperties.count("LastScan") == 1) {
if (changedProperties.count(sdbus::PropertyName("LastScan")) == 1) {
absl::MutexLock l(&last_scan_lock_);
last_scan_ = changedProperties.at("LastScan");
last_scan_ = changedProperties.at(sdbus::PropertyName("LastScan")).get<int64_t>();
}
}
@@ -148,7 +148,7 @@ NetworkManagerWifiMedium::SearchBySSID(absl::string_view ssid,
// Otherwise, request a Scan first and wait for it to finish.
try {
RequestScan(
{{"ssids", std::vector<std::vector<std::uint8_t>>{ssid_bytes}}});
{{"ssids", sdbus::Variant(std::vector<std::vector<std::uint8_t>>{ssid_bytes})}});
} catch (const sdbus::Error &e) {
DBUS_LOG_METHOD_CALL_ERROR(this, "RequestScan", e);
}
@@ -211,33 +211,33 @@ NetworkManagerWifiMedium::WifiConnectionStatus NetworkManagerWifiMedium::Connect
connection_settings{
{"connection",
{
{"uuid", *connection_id},
{"autoconnect", true},
{"id", std::string(ssid)},
{"type", "802-11-wireless"},
{"zone", "Public"},
{"uuid", sdbus::Variant(*connection_id)},
{"autoconnect", sdbus::Variant(true)},
{"id", sdbus::Variant(std::string(ssid))},
{"type", sdbus::Variant(std::string("802-11-wireless"))},
{"zone", sdbus::Variant(std::string("Public"))},
}},
{"802-11-wireless",
{
{"ssid", std::vector<uint8_t>(ssid.begin(), ssid.end())},
{"mode", "infrastructure"},
{"security", "802-11-wireless-security"},
{"assigned-mac-address", "random"},
{"ssid", sdbus::Variant(std::vector<uint8_t>(ssid.begin(), ssid.end()))},
{"mode", sdbus::Variant(std::string("infrastructure"))},
{"security", sdbus::Variant(std::string("802-11-wireless-security"))},
{"assigned-mac-address", sdbus::Variant(std::string("random"))},
}},
{"802-11-wireless-security", {{"key-mgmt", key_mgmt}}}};
{"802-11-wireless-security", {{"key-mgmt", sdbus::Variant(key_mgmt)}}}};
if (!password.empty()) {
connection_settings["802-11-wireless-security"]["psk"] =
std::string(password);
sdbus::Variant(std::string(password));
}
if (auth_alg.has_value()) {
connection_settings["802-11-wireless-security"]["auth-alg"] = *auth_alg;
connection_settings["802-11-wireless-security"]["auth-alg"] = sdbus::Variant(*auth_alg);
}
sdbus::ObjectPath connection_path, active_conn_path;
try {
auto [cp, acp, _r] = network_manager_->AddAndActivateConnection2(
connection_settings, getProxy().getObjectPath(), ap->getProxy().getObjectPath(),
{{"persist", "volatile"}, {"bind-activation", "dbus-client"}});
{{"persist", sdbus::Variant(std::string("volatile"))}, {"bind-activation", sdbus::Variant(std::string("dbus-client"))}});
connection_path = std::move(cp);
active_conn_path = std::move(acp);
} catch (const sdbus::Error &e) {
@@ -101,9 +101,9 @@ class NetworkManagerWifiMedium
protected:
void onPropertiesChanged(
const std::string &interfaceName,
const std::map<std::string, sdbus::Variant> &changedProperties,
const std::vector<std::string> &invalidatedProperties) override;
const sdbus::InterfaceName &interfaceName,
const std::map<sdbus::PropertyName, sdbus::Variant> &changedProperties,
const std::vector<sdbus::PropertyName> &invalidatedProperties) override;
void onAccessPointAdded(const sdbus::ObjectPath &access_point) override
ABSL_LOCKS_EXCLUDED(known_access_points_lock_) {