QDbusMessage Problem with dbus

Nirav Rabara Nirav.Rabara at Matrixtelesol.com
Mon Nov 23 04:08:31 PST 2009


Hi,

 

I am using Qt binding to speak with DBus, I have created interface with
system bus.

 

Now when I cal QDbusMessage msg = interface.call("ListDevices");

 

It gives me the following,

 

qDebu() << " msg :" << msg;

 

msg: QDBusMessage = (type=MethodReturn, service":1:0", signature="ao",
contents=((Arguments: ao{[objectPath:
/org/bluez/780/hci0/dev_00_1C_EF_44_D6_1D], [ObjectPath:
/org/bluez/780/hci0/dev_00_OD_18_D1_OF_1A]) )

 

Now when I try to get string from the message by using following, code got
to infinite loop.

 

QList <QVariant> devices = msg.arguments();

QVariant (name,devices)

{

            QString dName =name.toStringList()[0]; // code gets hang here

            qDebug << "Debug" << dName;

} 

 

Can Anybody help me, how to iterate this msg and find the List of devices
from the message(last arguments[contents])

 

Your suggestion would be a great help for me.

 

Thanks in advance,

Nirav

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20091123/baba82fb/attachment.html 


More information about the dbus mailing list