Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. qdbus
    Log in to post

    • UNSOLVED QDBus path encoding
      General and Desktop • qdbus • • Chruetli  

      4
      0
      Votes
      4
      Posts
      66
      Views

      Thank you for the answer. Honestly I expected this as some kind of magic done in background... At the moment I will use the sd_bus_path_encode function. The source of the function can be found at https://github.com/systemd/systemd/blob/main/src/basic/bus-label.c called bus_label_escape.
    • UNSOLVED qdbusreply: unexpected reply signature?
      General and Desktop • error dbus qdbus signature • • flodo  

      2
      0
      Votes
      2
      Posts
      53
      Views

      You have to register the expected Response first! In my case it was like #include <QtDBus/QDBusMetaType> // ... typedef QMap<QString, QMap<QString, QVariant> > ConnectionDetails; Q_DECLARE_METATYPE(ConnectionDetails) and int main() { qDBusRegisterMetaType<ConnectionDetails>(); // ... }
    • UNSOLVED Receiving system D-Bus signals and responding to them
      General and Desktop • dbus qdbus • • swirl  

      1
      0
      Votes
      1
      Posts
      83
      Views

      No one has replied

    • SOLVED Cannot receive response from DBus
      General and Desktop • dbus qdbus • • Crindu  

      3
      0
      Votes
      3
      Posts
      479
      Views

      @SGaist You're right,I did not think about it! I have to remove the systemBus, I'm not using it in reality, it's part of the project that I found on Github. Ok then I can try to make it an instance variable of the class or similer. Thank you!
    • UNSOLVED QDbus list names under a specific path
      General and Desktop • service path interface list qdbus • • Mark81  

      2
      0
      Votes
      2
      Posts
      960
      Views

      @Mark81 ok, I found a way: QDBusInterface *iface = new QDBusInterface("your.service", "/your/path", "org.freedesktop.DBus.Introspectable", QDBusConnection::systemBus(), this); qDebug() << iface->call("Introspect").arguments();
    • UNSOLVED QDBus: how to retreive object path
      General and Desktop • path qdbus object avrcp • • Mark81  

      2
      0
      Votes
      2
      Posts
      887
      Views

      @Mark81 Hi, I'm not sure if it is returned from some DBus methods or I have to manually build it using the bluetooth address and the local device. It is not, you have to handle it manually. From what I can discern from your link it's a path you construct out of device names. If the service is compliant you can usually list the objects it exposes. Kind regards.
    • UNSOLVED Unknown Object Path even after registering object in QDbus
      General and Desktop • qt 5.5 qdbus • • spyd3r  

      1
      0
      Votes
      1
      Posts
      1224
      Views

      No one has replied

    • UNSOLVED Signal not emitted over QDbus
      General and Desktop • qdbus signal&slot • • wenzel  

      1
      0
      Votes
      1
      Posts
      740
      Views

      No one has replied

    • UNSOLVED qdbusxml2cpp Annotations and Supported Types
      General and Desktop • qdbus • • Matthew Vick  

      2
      0
      Votes
      2
      Posts
      1279
      Views

      Hi and welcome to devnet, Since it might need some knowledge of the internals of QtDBus, I'd recommend posting this question on the interest mailing list You'll find there Qt's developers/maintainers (this forum is more user oriented)
    • QDBus - SLOT not called upon SIGNAL emit
      General and Desktop • signal & slot qdbus qt5.4.0 • • ShayPrat  

      1
      0
      Votes
      1
      Posts
      695
      Views

      No one has replied

    • DBus method calls with arguments
      General and Desktop • linux qdbus • • StMartin81  

      2
      0
      Votes
      2
      Posts
      4459
      Views

      I got it working. Problem was that instead of bool I had to use QVariant of QDBusVariant type. So the two functions look like this now: These are the defines I've used: #define BLUEZ_DBUS_SERVICE "org.bluez" #define BLUEZ_DBUS_PATH "/org/bluez/hci0" #define BLUEZ_DBUS_IF "org.bluez.Adapter1" And here is the first implementationÖ QDBusConnection bus = QDBusConnection::systemBus(); if (!bus.isConnected()) { qFatal("Cannot connect to the D-Bus session bus."); return; } QDBusMessage message = QDBusMessage::createMethodCall(BLUEZ_DBUS_SERVICE, BLUEZ_DBUS_PATH, "org.freedesktop.DBus.Properties", "Set"); QList<QVariant> arguments; arguments << BLUEZ_DBUS_IF << "Powered" << QVariant::fromValue(QDBusVariant(true)); message.setArguments(arguments); QDBusPendingReply<QVariantMap> reply = bus.asyncCall(message); reply.waitForFinished(); and here is the second possibility to implement the method call: QDBusConnection bus = QDBusConnection::systemBus(); if (!bus.isConnected()) { qFatal("Cannot connect to the D-Bus session bus."); return; } QDBusInterface dbus_iface(BLUEZ_DBUS_SERVICE, BLUEZ_DBUS_PATH, "org.freedesktop.DBus.Properties", bus); if ( dbus_iface.isValid() ) { QDBusPendingReply<QVariantMap> reply = dbus_iface.asyncCall("Set", BLUEZ_DBUS_IF, "Powered", QVariant::fromValue(QDBusVariant(true))); reply.waitForFinished(); reply.error().message(); } In case anybody wants to do the same thing there is also the possibility to set the "Powered" property directly: QDBusInterface ifc( BLUEZ_DBUS_SERVICE, BLUEZ_DBUS_PATH, BLUEZ_DBUS_IF, QDBusConnection::systemBus()); if ( ifc.isValid() ) { ifc.setProperty("Powered", true); }