Results 1 to 3 of 3

Thread: HAL & qdbus introspection & InvalidSignature error

  1. #1
    Join Date
    Dec 2007
    Posts
    11
    Thanks
    4

    Default HAL & qdbus introspection & InvalidSignature error

    Hello! I have a little problem with the usage of the introspection XML file generated by HAL and the QDBusAbstractInterface::callWithArgumentList() method, but don't know exactly whether is a Qt problem or a HAL one, let me explain the scenario:

    - first, obtain the XML introspection from the "org.freedesktop.Hal.Manager" D-Bus interface:
    Qt Code:
    1. $ qdbus --system org.freedesktop.Hal /org/freedesktop/Hal/Manager org.freedesktop.DBus.Introspectable.Introspect > Hal.Manager.xml
    To copy to clipboard, switch view to plain text mode 

    - second, use the XML file to obtain a C++ Qt class proxy in order to have an easy way of using the various methods of the Hal.Manager interface:
    Qt Code:
    1. $ qdbusxml2cpp -c QHalManagerInterface -N -p QHalManagerInterface Hal.Manager.xml org.freedesktop.Hal.Manager
    To copy to clipboard, switch view to plain text mode 
    This generates the cpp and h files for the class "QHalManagerInterface". Now it's time to use this class in our code.

    - third, integrate the generated class in the code: create an instance of QHalManagerInterface, and call any of its methods. For example:
    Qt Code:
    1. QHalManagerInterface* iface;
    2. QDBusConnection system = QDBusConnection::systemBus();
    3. if (system.isConnected()) {
    4. iface = new QHalManagerInterface("org.freedesktop.Hal", "/org/freedesktop/Hal/Manager", system, this);
    5. if (iface && iface->isValid()) {
    6. /* We see in the auto-generated QHalManagerInterface.h that the method
    7. * GetAllDevices() returns a QDBusReply<QList<QDBusObjectPath> > */
    8. QDBusReply<QList<QDBusObjectPath> > reply = iface->GetAllDevices();
    9. if (reply.isValid()) {
    10. foreach(QDBusObjectPath udi, reply.value()) {
    11. qDebug() << "Found the device:" << udi.path();
    12. }
    13. }
    14. else {
    15. qDebug() << QString("D-Bus error: %1: %2").arg(reply.error.name()).arg(reply.error.message());
    16. }
    17. }
    18. }
    To copy to clipboard, switch view to plain text mode 

    Then you obtain the following in the console:
    Qt Code:
    1. D-Bus error: org.freedesktop.DBus.Error.InvalidSignature: Unexpected reply signature: got "no signature", expected "" (QList<QDBusObjectPath>)
    To copy to clipboard, switch view to plain text mode 

    BUT, it all works by changing the type of return of the GetAllDevices() method, from QDBusReply<QList<QDBusObjectPath> > to QDBusReply<QStringList>.

    So maybe QDBusReply is failing to adapt the signature of the "org.freedesktop.Hal.Manager.GetAllDevices" (which HAL claims to be "ao", an "array of objectpaths"), or maybe the problem is HAL claiming the method interface as "ao" but then expecting to be "as" at runtime?

  2. #2
    Join Date
    Dec 2007
    Posts
    11
    Thanks
    4

    Question Re: HAL & qdbus introspection & InvalidSignature error

    Any thoughts about this?
    Currently I'm just editing the XML, and changing the "ao" ("array of objectpaths) parameter occurences with "as" (arry of strings). After that, all works as expected.

  3. #3
    Join Date
    Dec 2007
    Posts
    11
    Thanks
    4

    Default Re: HAL & qdbus introspection & InvalidSignature error

    Well ok, it seems to be a bug in HAL, I think this bug report is about the same problem as the one I described:

    http://www.qtsoftware.com/developer/...ntry&id=190546

Similar Threads

  1. nmake error during .pro compiling
    By mattia in forum Installation and Deployment
    Replies: 5
    Last Post: 18th June 2008, 10:15
  2. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 13:43
  3. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57
  4. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  5. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12:19

Tags for this Thread

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.