Results 1 to 3 of 3

Thread: QDbus and wpa_supplicant

  1. #1
    Join Date
    Jul 2009
    Posts
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default QDbus and wpa_supplicant

    Hi,

    I'm trying to use qtdbus to communicate with wpa_supplicant.

    The dbus connection its self works, the only thing that doesn't work is getting back the values of the signals.
    Someone knows what I'm doing wrong here?..

    The output I get until now is:
    D-BUS interface added
    QVariant(QString, "Capabilities")
    QVariant(QString, "State")
    QVariant(QString, "Scanning")
    QVariant(QString, "ApScan")
    QVariant(QString, "Ifname")
    QVariant(QString, "Driver")
    QVariant(QString, "BridgeIfname")
    QVariant(QString, "CurrentBSS")
    QVariant(QString, "CurrentNetwork")
    QVariant(QString, "Blobs")
    QVariant(QString, "BSSs")
    QVariant(QString, "Networks")

    with the following code:
    void Menu::slotInterfaceAdded(QDBusMessage msg)
    {
    qDebug("D-BUS interface added");
    overlay.hide();


    QList<QVariant> argument = qdbus_cast< QList<QVariant> >(msg.arguments()[1]);

    foreach ( QVariant _var, argument )
    {
    qDebug() << _var;
    }

    }

    But this is only half of the information, does someone know how to get (for example) the actual State?

    Full output of dbus-monitor
    signal sender=:1.60 -> dest=(null destination) path=/fi/w1/wpa_supplicant1; interface=fi.w1.wpa_supplicant1; member=InterfaceAdded
    object path "/fi/w1/wpa_supplicant1/Interfaces/0"
    array [
    dict entry(
    string "Capabilities"
    variant array [
    dict entry(
    string "Pairwise"
    variant array [
    string "ccmp"
    string "tkip"
    ]
    )
    dict entry(
    string "Group"
    variant array [
    string "ccmp"
    string "tkip"
    string "wep104"
    string "wep40"
    ]
    )
    dict entry(
    string "KeyMgmt"
    variant array [
    string "none"
    string "ieee8021x"
    string "wpa-eap"
    string "wpa-psk"
    ]
    )
    dict entry(
    string "Protocol"
    variant array [
    string "rsn"
    string "wpa"
    ]
    )
    dict entry(
    string "AuthAlg"
    variant array [
    string "open"
    string "shared"
    string "leap"
    ]
    )
    dict entry(
    string "Scan"
    variant array [
    string "active"
    string "passive"
    string "ssid"
    ]
    )
    dict entry(
    string "Modes"
    variant array [
    string "infrastructure"
    string "ad-hoc"
    ]
    )
    ]
    )
    dict entry(
    string "State"
    variant string "disconnected"
    )
    dict entry(
    string "Scanning"
    variant boolean false
    )
    dict entry(
    string "ApScan"
    variant uint32 1
    )
    dict entry(
    string "Ifname"
    variant string "eth2"
    )
    dict entry(
    string "Driver"
    variant string "wext"
    )
    dict entry(
    string "BridgeIfname"
    variant string ""
    )
    dict entry(
    string "CurrentBSS"
    variant object path "/"
    )
    dict entry(
    string "CurrentNetwork"
    variant object path "/"
    )
    dict entry(
    string "Blobs"
    variant array [
    ]
    )
    dict entry(
    string "BSSs"
    variant array [
    ]
    )
    dict entry(
    string "Networks"
    variant array [
    ]
    )
    ]

  2. #2
    Join Date
    Jul 2009
    Posts
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QDbus and wpa_supplicant

    Solved,

    QVariantMap argument = qdbus_cast< QVariantMap >(msg.arguments()[1]);

    gives a QMap<QString,QVariant> with the content of the dbus message..

  3. The following user says thank you to knee for this useful post:

    pitonyak (11th February 2010)

  4. #3
    Join Date
    Jan 2010
    Posts
    73
    Thanks
    6
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDbus and wpa_supplicant

    Always nice to see that someone not only solved their problem on their own, but then, bothered to post the solution...

Similar Threads

  1. QDBus-cpptoxml
    By diptiman in forum Qt Programming
    Replies: 1
    Last Post: 21st January 2009, 09:15
  2. qdbus signal
    By khcbabu in forum Qt Programming
    Replies: 1
    Last Post: 18th January 2009, 13:17
  3. Using QDBus
    By Sandip in forum Qt Programming
    Replies: 3
    Last Post: 27th May 2008, 07:17
  4. qDBus in windows?
    By cxl2253 in forum Qt Programming
    Replies: 2
    Last Post: 15th January 2008, 07:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.