I have the following code to retrieve access points information using NetworkManager dbus api:
//---------------------------------------------------------------------------------
QDBusInterface dbus_iface("org.freedesktop.NetworkManager",
"/org/freedesktop/NetworkManager/Devices/2", // path (might be different in other systems)
"org.freedesktop.NetworkManager.Device.Wireless",
bus);
QDBusMessage query = dbus_iface.call("GetAllAccessPoints");
qDebug() << query;
if(query.type() == QDBusMessage::ReplyMessage) {
QDBusArgument arg = query.arguments().at(0).value<QDBusArgument>();
arg.beginArray();
while(!arg.atEnd()) {
QString element = qdbus_cast<QString>(arg);
netList->append(element);
showAccessPointProperties(element);
}
arg.endArray();
} else {
qDebug() << " dbus error: " << query.errorName();
}
This code works on desktop linux (ubuntu 18.04).
But in raspbian (buster, raspberry pi 3 B/B+) this code doesn't work! The problem is that this call :
dbus_iface.call("GetAllAccessPoints");
returns empty reply.
Is it anything different on how to use NM dbus interface in raspbian and ubuntu?