Qt application with D-Bus and wpa_supplicant
-
Hi everybody,
I would like to connect my QT application with wpa_supplicant configured for D-Bus. I tried to change the pingpong example in the main below (pratically no more pingpong example) to create a new interface but it always return error and I don't understand why.The code is
int main(int argc, char **argv) { QCoreApplication app(argc, argv); if (!QDBusConnection::systemBus().isConnected()) { fprintf(stderr, "Cannot connect to the D-Bus session bus.\n" "To start it, run:\n" "\teval `dbus-launch --auto-syntax`\n"); return 1; } QDBusInterface interface("fi.w1.wpa_supplicant1", "/fi/w1/wpa_supplicant1", "fi.w1.wpa_supplicant1", QDBusConnection::systemBus()); QDBusMessage mesg = interface.call("CreateInterface"); qDebug() << mesg; return 1; }
If I run this application I have the following error
[QDBusMessage(type=Error, service=":1.14", error name="org.freedesktop.DBus.Error.InvalidArgs", error message="", signature="", contents=([]) )]([link url](link url))I also tried to change the call(...) method like this
QDBusMessage mesg = interface.call("CreateInterface","wlan0" );
but I have always the same error.
The wpa interface is active because with the following command I can see it
dbus-send --system --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNamesmethod return time=1668609255.521238 sender=org.freedesktop.DBus -> destination=:1.83 serial=3 reply_serial=2
array [
string "org.freedesktop.DBus"
string "org.freedesktop.login1"
string "org.freedesktop.timesync1"
string ":1.83"
string ":1.9"
string "org.freedesktop.systemd1"
string "org.freedesktop.Avahi"
string ":1.10"
string ":1.0"
string ":1.14"
string ":1.1"
string ":1.2"
string "org.freedesktop.network1"
string ":1.3"
string ":1.4"
string "org.freedesktop.resolve1"
string "fi.w1.wpa_supplicant1"
string ":1.5"
string ":1.6"
string "org.ofono"
]Does anybody use the wpa_supplicant in "D-Bus mode" and QDbus classes?
Thanks for your help or any tip.
Regards.