fix(network): read AccessPoints instead of AllAccessPoints for scan list
AllAccessPoints is not exposed by this NetworkManager ('No such property'),
so getAccessPoints() hit the error path and returned an empty scan list
with no log output. AccessPoints is the current scan results and is
universally supported. Also log the property-read failure instead of
failing silently.
This commit is contained in:
@@ -34,7 +34,7 @@ AccessPointInfo parseAccessPoint(
|
|||||||
ap.wpa_flags = wpa_flags;
|
ap.wpa_flags = wpa_flags;
|
||||||
ap.rsn_flags = rsn_flags;
|
ap.rsn_flags = rsn_flags;
|
||||||
ap.security = detectSecurityType(flags, wpa_flags, rsn_flags);
|
ap.security = detectSecurityType(flags, wpa_flags, rsn_flags);
|
||||||
|
|
||||||
return ap;
|
return ap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,13 +211,16 @@ std::vector<AccessPointInfo> WifiDevice::getAccessPoints() const {
|
|||||||
"org.freedesktop.NetworkManager",
|
"org.freedesktop.NetworkManager",
|
||||||
impl_->object_path.c_str(),
|
impl_->object_path.c_str(),
|
||||||
"org.freedesktop.NetworkManager.Device.Wireless",
|
"org.freedesktop.NetworkManager.Device.Wireless",
|
||||||
"AllAccessPoints",
|
"AccessPoints",
|
||||||
&error,
|
&error,
|
||||||
&msg,
|
&msg,
|
||||||
"ao"
|
"ao"
|
||||||
);
|
);
|
||||||
|
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
|
radiantwave::logger::Logger::instance().warning("WiFi",
|
||||||
|
"Failed to read AccessPoints on device " + impl_->object_path + ": " +
|
||||||
|
(error.message ? error.message : strerror(-r)));
|
||||||
sd_bus_error_free(&error);
|
sd_bus_error_free(&error);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user