nrabara
23rd November 2009, 13:09
Hi,
I am using Qt binding to speak with DBus, I have created interface with system bus.
//Now when I call 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
I am using Qt binding to speak with DBus, I have created interface with system bus.
//Now when I call 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