Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Passing QVariant as argument to QDBusInterface->Call in bluez Set method

Passing QVariant as argument to QDBusInterface->Call in bluez Set method

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 794 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.
  • V Offline
    V Offline
    vegtaa
    wrote on last edited by
    #1

    I am trying to set a property (Powered) in the bluez service but fail with this error message.

    QDBusMessage(type=Error, service="", error name="org.freedesktop.DBus.Error.UnknownMethod", error message="Method "Set" with signature "ssb" on interface "org.freedesktop.DBus.Properties" doesn't exist
    ", signature="", contents=([]) )

    I should be passing a string, string, variant to the Set method. But per the error message it looks like I am sending "ssb" or string, string, bool??. This is irritating because I should be sending a QVarriant of type bool.

    When I call the Get method everything works. So I believe that the QDBusInterface is good.

    Here is the code snippet. my appologies for the formatting, it is hard to get the spacing right on the posting
    @
    QDBusInterface *adapter1 = new QDBusInterface("org.bluez","/org/bluez/hci0","org.freedesktop.DBus.Properties",bus);

    //does not work
    QVariant power(false);
    QDBusMessage blah=adapter1->call("Set","org.bluez.Adapter1","Powered",power);
    qDebug()<<blah;

    //works
    QDBusReply<QVariant> replyAdapter=adapter1->call("Get","org.bluez.Adapter1","Powered")
    qDebug()<<replyAdapter.value().toBool();
    @

    1 Reply Last reply
    0

    • Login

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