Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Qt application with D-Bus and wpa_supplicant
QtWS25 Last Chance

Qt application with D-Bus and wpa_supplicant

Scheduled Pinned Locked Moved Unsolved Qt 6
qtdbuswpasupplicant
1 Posts 1 Posters 547 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on 16 Nov 2022, 14:40 last edited by
    #1

    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.ListNames

    method 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.

    1 Reply Last reply
    0

    1/1

    16 Nov 2022, 14:40

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved