Hi, I try someting with tqt dbus - I want to try to talk to BT. I found this nice application dbusxml2qt3 and I want to thank the author for the effort, even if have not (yet) succeeded with it.
I have a problem when I try to compile generated code. It says:
error: no matching function for call to 'TQT_DBusDataMap<TQT_DBusObjectPath>::TQT_DBusDataMap(TQMap<TQT_DBusObjectPath, TQT_DBusDataMap<TQString> >&)' reply << TQT_DBusData::fromObjectPathKeyMap(TQT_DBusDataMap< TQT_DBusObjectPath >(_objects));
... ... ...
/usr/include/dbus-1-tqt/tqdbusdatamap.h:477:5: note: candidate: TQT_DBusDataMap<K>::TQT_DBusDataMap(const TQMap<T, TQT_DBusVariant>&) [with T = TQT_DBusObjectPath] TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusVariant>& other)
etc etc.
This is the line where it fails TQMap< TQT_DBusObjectPath, TQT_DBusDataMap< TQString > > _objects;
and in the header I have
template <typename K, typename V> class TQMap; template <typename K> class TQT_DBusDataMap;
Does it mean it is missing in tqt dbus as I think dbusxml2qt3 is working fine, but could be Variant was added later somewhere in dbus?
I understand I am missing prototype for
TQMap< TQT_DBusObjectPath, TQT_DBusDataMap< TQString > >
Who can help me work around this situation?
Thanks in advance
deloptes wrote:
This is the line where it fails TQMap< TQT_DBusObjectPath, TQT_DBusDataMap< TQString > > _objects;
might be easier to fix the generated code to use TQT_DBusVariant and encapsulate TQT_DBusDataMap< TQString > in it like:
TQMap< TQT_DBusObjectPath, TQT_DBusVariant > _objects;
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
On 2018/05/26 08:55 AM, deloptes wrote:
Hi, I try someting with tqt dbus - I want to try to talk to BT. I found this nice application dbusxml2qt3 and I want to thank the author for the effort, even if have not (yet) succeeded with it.
I have a problem when I try to compile generated code. It says:
error: no matching function for call to 'TQT_DBusDataMap<TQT_DBusObjectPath>::TQT_DBusDataMap(TQMap<TQT_DBusObjectPath, TQT_DBusDataMap<TQString> >&)' reply << TQT_DBusData::fromObjectPathKeyMap(TQT_DBusDataMap< TQT_DBusObjectPath >(_objects));
.. .. ..
/usr/include/dbus-1-tqt/tqdbusdatamap.h:477:5: note: candidate: TQT_DBusDataMap<K>::TQT_DBusDataMap(const TQMap<T, TQT_DBusVariant>&) [with T = TQT_DBusObjectPath] TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusVariant>& other)
etc etc.
This is the line where it fails TQMap< TQT_DBusObjectPath, TQT_DBusDataMap< TQString > > _objects;
and in the header I have
template <typename K, typename V> class TQMap; template <typename K> class TQT_DBusDataMap;
Does it mean it is missing in tqt dbus as I think dbusxml2qt3 is working fine, but could be Variant was added later somewhere in dbus?
I understand I am missing prototype for
TQMap< TQT_DBusObjectPath, TQT_DBusDataMap< TQString > >
Who can help me work around this situation?
Thanks in advance
Hi Emanoil, where are you with this? and can you share a link to the original code? cheers Michele
Michele Calgaro wrote:
Hi Emanoil, where are you with this? and can you share a link to the original code? cheers Michele
Hi Michele,
$ dpkg -S /usr/bin/dbusxml2qt3 libdbus-1-tqt-dev: /usr/bin/dbusxml2qt3
To my original message - I see a problem with TQMap - TQMap< TQT_DBusObjectPath, TQT_DBusDataMap< TQString > generated by the tool is not supported. I worked around it by changing the generated code to use TQT_DBusData, but it is not the end of the story. So let me explain
Now I was looking in an option to reuse the gui for kbluetooth and rewrite the code to work with bluez5. I have been missing this since 2008, when I saw it in SuSe. In the meantime bluez changed a lot - perhaps for the better, so the code base is not really usable. In official bluez5 docs it says the entry point is ObjectManager in root of org.bluez. I try to retrieve and parse the data (objects) returned from ObjectManager when calling GetManagedObjects but I hit one problem and I think it boils down to dbus-1-tqt and perhaps TQMap as mentioned above.
I have 3 devices paired. The problem is that using tqt I get only the last object path back. However, when using dbus or qdbus I see all of them including the moregeneral paths. For example if I call
qdbus --literal --system org.bluez / org.freedesktop.DBus.ObjectManager.GetManagedObjects
or
dbus-send --system --print-reply=literal --dest=org.bluez / org.freedesktop.DBus.ObjectManager.GetManagedObjects
I have /org/bluez /org/bluez/hci0 /org/bluez/hci0/dev_xx_xx_xx_xx_xx_01 /org/bluez/hci0/dev_xx_xx_xx_xx_xx_02 /org/bluez/hci0/dev_xx_xx_xx_xx_xx_03
With the code attached I am seeing only the last one /org/bluez/hci0/dev_xx_xx_xx_xx_xx_03.
If there is no adapter attached, I see /org/bluez
When removing dev_xx_xx_xx_xx_xx_03 I see only dev_xx_xx_xx_xx_xx_02. After pairing dev_xx_xx_xx_xx_xx_03, I see again only this path.
I need help to overcome this obstacle, please. It might be also that I am doing something wrong as well :), but could be that there is something wrong handling such scenario
So these are the two problems I face: 1. I get only last object path from ObjectManager 2. TQMap does not support TQMap< K, TQT_DBusDataMap< T > >
I tried parsing the result from ObjectManager with both TQMap and TQT_DBusDataMap with same result. I have not looked into the dbus-1-tqt code (yet), but it could be toObjectPathKeyMap or map handling is somehow broken. So I am going to write a test next to construct and deconstruct objectpath maps in similar way they are returned by ObjectManager and I will report back. If you or someone else could help with #2, it would be also great. I looked into the code briefly and from what I have seen there is no valid template to handle this case.
regards
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
On 2018/05/30 04:09 AM, deloptes wrote:
Michele Calgaro wrote:
Sorry I forgot the test program
I will try to take a look at this during the weekend and give some feedback. Cheers Michele
Michele Calgaro wrote:
I will try to take a look at this during the weekend and give some feedback.
If it helps I looked further into dbus documentation and dbus-1-tqt
so the signature for output of GetManagedObjects is a{oa{sa{sv}}}
it looks like the first a{ is ignored, but if I ask the reply for it's type it says Map ...
from my sample code ... kdDebug() << "reply.front().type() : " << reply.front().typeName() << endl;
bool ok = false; TQValueList<TQT_DBusData> list = reply.front().toTQValueList(&ok); if (!ok) kdDebug() << "toTQValueList failed" << endl; else kdDebug() << "toTQValueList worked" << endl; if (!ok) return -1;
says
reply.front().type() : Map toTQValueList failed
I tracked this down to TQT_DBusMarshall::parseSignature()
it evidently ignores the first a{ and consequently returns only the last oa{
I think I should file a bug now, but will wait for you to confirm and I will write some code to construct reconstruct TQT_DBusData wih signature a{oa{sa{sv}}}.
regards
Hi
I will try to take a look at this during the weekend and give some feedback. Cheers Michele
Please, have a look at this - why it fails here
TQValueList<TQT_DBusData> list = data.toTQValueList(&ok);
is it only on my system or you see the same? is it me making a mistake or it is a bug?
when I remove the condition it works though I wouldn't expected if it fails to has any data in the list. TQValueList<TQT_DBusData> list = data.toTQValueList(&ok); if (!ok) kdDebug() << "toTQValueList failed" << endl; else kdDebug() << "toTQValueList worked" << endl; // if (!ok) return -1;ok = false;
thanks in advance regards
https://bugs.trinitydesktop.org/show_bug.cgi?id=2925
turned out it can not handle arrays of objectpath keymaps. pfui - long journey in TDE code again.
don't tell me it's no good :)
regards