Re: QT and dbus - no such signal

2010-01-10 Thread Christian Rüb
 [...]
  Thanks for this. Where exactly did you change it? I grepped 'Os' and 'O2' 
  in openembedded/recipes/qt4/* but found neither.
  -O seems no to be set in CFLAGS under qt4/
 
 I do not know if this is the right way, just digged in bitbake sources
 and added to local.conf the line:
 
 FULL_OPTIMIZATION_pn-qt4-x11-free = -fexpensive-optimizations
 -fomit-frame-pointer -frename-registers -O2
 
   Niko

Hi Niko!

Thanks a lot, that did it! I wonder why it is not integrated by default though.

...definition and registration of FSOResourceStatus struct ...

I also try to connect to the ResourceChanged signal from ousaged which has a 
more complex signature and it reports that signal would not exist.
I use the following code to display all signals/methods on ousaged interface:
usageInterface = new QDBusInterface(org.freesmartphone.ousaged, 
/org/freesmartphone/Usage, org.freesmartphone.Usage, 
QDBusConnection::systemBus(), this);
if(usageInterface-isValid()) {
const QMetaObject* metaObject = usageInterface-metaObject();
qDebug()  \norg.freesmartphone.Usage methods:;
for(int i = metaObject-methodOffset(); i  
metaObject-methodCount(); ++i)
qDebug()  
QString::fromLatin1(metaObject-method(i).signature())  [  
(metaObject-method(i).methodType()==1?signal:method)  ];
connect(usageInterface, 
SIGNAL(ResourceChanged(FSOResourceStatus)), this, 
SLOT(handleStatusChange(FSOResourceStatus)));
}

output is:

org.freesmartphone.Usage methods:
GetResourcePolicy(QString) [ method ]
GetResourceState(QString) [ method ]
GetResourceUsers(QString) [ method ]
ListResources() [ method ]
Reboot() [ method ]
RegisterResource(QString,QDBusObjectPath) [ method ]
ReleaseResource(QString) [ method ]
RequestResource(QString) [ method ]
ResourceAvailable(QString,bool) [ signal ]
SetResourcePolicy(QString,QString) [ method ]
Shutdown() [ method ]
Suspend() [ method ]
SystemAction(QString) [ signal ]
UnregisterResource(QString) [ method ]
initResources() [ method ]
Object::connect: No such signal 
org::freesmartphone::Usage::ResourceChanged(FSOResourceStatus)

As you can see, the ResourceChanged signal is not listed (neither on my FR nor 
on my PC), but with qdbusviewer I can connect to it and receive the signal:

Received signal from :1.17, path /org/freesmartphone/Usage, interface 
org.freesmartphone.Usage, member ResourceChanged
  Arguments: GPS, true, [Argument: a{sv} {policy = [Variant(QString): 
auto], refcount = [Variant(int): 1]}]

Any ideas how I can investigate further?

Thanks.

Christian

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: QT and dbus - no such signal

2010-01-10 Thread Christian Rüb
 [...]
  As you can see, the ResourceChanged signal is not listed (neither on my FR 
  nor on my PC), but with qdbusviewer I can connect to it and receive the 
  signal:
 
 It seems the signature is wrong.
 In a my working snippet I used (with QDBusConnection::connect):
 
 dbus-connect(OUSAGED_SERVICE,OUSAGED_PATH,OUSAGED_INTERFACE,ResourceChanged,this,SLOT(resourceChanged(QString,bool,QVariantMap)));
 
 where resourceChanged has the following signature:
 
 void resourceChanged(QString name, bool state, QVariantMap attributes);
 
 Hoping it helps.
 
  Niko

Thanks. Using QDBusConnection did it. Using this signature 
(QString,bool,QVariantMap) with my dbus interface does not work though.

My struct (FSOResourceStatus) was defined as QString,bool,MapQVariant but did 
not work.

Nevertheless, using only a connection and no struct but Qt datatypes directly 
as you stated above does the job. But it still makes me wonder why it does not 
work with a QDBusInterface...

Cheers,
 Christian

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: QT and dbus - no such signal

2010-01-10 Thread Nicola Mfb
On Sun, Jan 10, 2010 at 7:30 PM, Christian Rüb christian.r...@gmx.net wrote:
[...]
 Nevertheless, using only a connection and no struct but Qt datatypes directly 
 as you stated above does the job. But it still makes me wonder why it does 
 not work with a QDBusInterface...

It may be that the qdbusinterface constructor has problem in parsing
the dbus signature to autocreate the right slot, but it looks strange
to me too, as the three types should be natively supported by qtdbus
module, should ask on the qt-interest list.

 Niko

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: QT and dbus - no such signal

2010-01-10 Thread Mickael Labrousse
I'm late but I have both QtExtended 4.4.3 and QtEmbedded 4.5 on shr 
running a program using QtDBus.


Mickael.

Nicola Mfb a écrit :
 On Sun, Jan 10, 2010 at 7:30 PM, Christian Rüb christian.r...@gmx.net wrote:
 [...]
   
 Nevertheless, using only a connection and no struct but Qt datatypes 
 directly as you stated above does the job. But it still makes me wonder why 
 it does not work with a QDBusInterface...
 

 It may be that the qdbusinterface constructor has problem in parsing
 the dbus signature to autocreate the right slot, but it looks strange
 to me too, as the three types should be natively supported by qtdbus
 module, should ask on the qt-interest list.

  Niko

 ___
 Openmoko community mailing list
 community@lists.openmoko.org
 http://lists.openmoko.org/mailman/listinfo/community

   

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: QT and dbus - no such signal

2010-01-09 Thread Christian Rüb
Am Freitag, 8. Januar 2010 schrieb Christian Rüb:
 Hi,
 
 I am about to write my own little GPS application in Qt and try to connect to 
 FixStatusChanged signal from Gypsy but have the following problem
 
 Code snippet:
 ...
 deviceInterface = new QDBusInterface(org.freedesktop.Gypsy, 
 /org/freedesktop/Gypsy/default, org.freedesktop.Gypsy.Device, 
 QDBusConnection::systemBus(),this);
 ...
 connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this, 
 SIGNAL(fixChanged(int)));
 
 I want to pass the signal on to use it somewhere else in my application...
 
 now when starting my application I get:
 
 Object::connect: No such signal 
 org::freedesktop::Gypsy::Device::FixStatusChanged(int)
 
 but  mdbus -s org.freedesktop.Gypsy /org/freedesktop/Gypsy
 lists:
 [SIGNAL]org.freedesktop.Gypsy.Device.FixStatusChanged( i:fixstatus )
 
 Do you have any idea what is going wrong?
 
 You can find the full code here:
 
 http://git.senfdax.de/?p=qgpslog;a=blob;f=src/gypsy.cpp;h=27014f72b3705c6439e10d9130c8c03f8cd9bfdf;hb=HEAD
 
 Thanks for any help.
 
 Cheers,
  Christian

Sorry for replying to myself, but after installing fso on my laptop and 
starting my application there the signal connection DOES work. So I guess it's 
related with Qt on my Freerunner...

I tested it with GPS Dummy device and received the FixStatusChanged signal. 
Also dbusviewer showed objects paths and signals/methods there.

I built Qt4 for SHR-unstable with SHR Makefile, Qt 4.5.2.

Does anyone have a Qt version running on SHR where connection signals DOES work?

Thanks,
 Christian

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: QT and dbus - no such signal

2010-01-09 Thread Nicola Mfb
On Sat, Jan 9, 2010 at 4:18 PM, Christian Rüb christian.r...@gmx.net wrote:
[...]
 I built Qt4 for SHR-unstable with SHR Makefile, Qt 4.5.2.

 Does anyone have a Qt version running on SHR where connection signals DOES 
 work?

Just a shot in the dark.
Building Qt on shr some time ago (but already on the shr/merge branch)
resulted in unstable behaviour, I had to replace -Os with -O2 as
suggested from a gentle guy having the same issue on gentoo.
I reported that on oe.dev, but do not know if it was applyed, and
above all if it's related to your problem.
Anyway I'm using a lot dbus with qt and got no problem, cannot help
much with QDBusInterface, I use QDBusConnection::connect directly.
Finally you may use QMetaObject to retrieve the full list of signals
exported by the QDBusInterface, this may help in debugging.

Regards

 Niko

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: QT and dbus - no such signal

2010-01-09 Thread Christian Rüb
 [...]
  I built Qt4 for SHR-unstable with SHR Makefile, Qt 4.5.2.
 
  Does anyone have a Qt version running on SHR where connection signals DOES 
  work?
 
 Just a shot in the dark.
 Building Qt on shr some time ago (but already on the shr/merge branch)
 resulted in unstable behaviour, I had to replace -Os with -O2 as
 suggested from a gentle guy having the same issue on gentoo.
 I reported that on oe.dev, but do not know if it was applyed, and
 above all if it's related to your problem.
 Anyway I'm using a lot dbus with qt and got no problem, cannot help
 much with QDBusInterface, I use QDBusConnection::connect directly.
 Finally you may use QMetaObject to retrieve the full list of signals
 exported by the QDBusInterface, this may help in debugging.
 
 Regards
 
  Niko

Thanks for this. Where exactly did you change it? I grepped 'Os' and 'O2' in 
openembedded/recipes/qt4/* but found neither.
-O seems no to be set in CFLAGS under qt4/

Cheers,
 Christian


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: QT and dbus - no such signal

2010-01-09 Thread Nicola Mfb
On Sat, Jan 9, 2010 at 5:28 PM, Christian Rüb christian.r...@gmx.net wrote:
[...]
 Thanks for this. Where exactly did you change it? I grepped 'Os' and 'O2' in 
 openembedded/recipes/qt4/* but found neither.
 -O seems no to be set in CFLAGS under qt4/

I do not know if this is the right way, just digged in bitbake sources
and added to local.conf the line:

FULL_OPTIMIZATION_pn-qt4-x11-free = -fexpensive-optimizations
-fomit-frame-pointer -frename-registers -O2

  Niko

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: QT and dbus - no such signal

2010-01-08 Thread Christophe M
 Hi,

 I am about to write my own little GPS application in Qt and try to connect
 to FixStatusChanged signal from Gypsy but have the following problem

 Code snippet:
 ...
 deviceInterface = new QDBusInterface(org.freedesktop.Gypsy,
 /org/freedesktop/Gypsy/default, org.freedesktop.Gypsy.Device,
 QDBusConnection::systemBus(),this);
 ...
 connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this,
 SIGNAL(fixChanged(int)));

 I want to pass the signal on to use it somewhere else in my application...

 now when starting my application I get:

 Object::connect: No such signal
 org::freedesktop::Gypsy::Device::FixStatusChanged(int)

 but  mdbus -s org.freedesktop.Gypsy /org/freedesktop/Gypsy
 lists:
 [SIGNAL]org.freedesktop.Gypsy.Device.FixStatusChanged( i:fixstatus )

 Do you have any idea what is going wrong?

 You can find the full code here:


 http://git.senfdax.de/?p=qgpslog;a=blob;f=src/gypsy.cpp;h=27014f72b3705c6439e10d9130c8c03f8cd9bfdf;hb=HEAD

 Thanks for any help.

 Cheers,
  Christian



Hi!
Quick response, I don't have a lot of time, here is an example of connection
to fso in Qt :

m_db_ressourceManager = new QDBusInterface(org.freesmartphone.ogpsd,
/org/freedesktop/Gypsy,, QDBusConnection::systemBus());

connect 
(m_db_ressourceManager,SIGNAL(FixStatusChanged(int)),this,SLOT(fixStatusChanged(int)));


Try :

new QDBusInterface(org.

 freedesktop.Gypsy, /org/freedesktop/Gypsy/default, ,
 QDBusConnection::systemBus());


Then connect to the signal.

Many dbus examples are in the Qalee tree :
http://think-free83.homelinux.org/project/qalee/trunk/
And on the wiki there is some informations : http://www.qalee.org

-- 
--

Openmoko phone gui :

http://www.qalee.org
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: QT and dbus - no such signal

2010-01-08 Thread Michael Zanetti
On Friday 08 January 2010 12:52:14 Christian Rüb wrote:
 Hi,
 
 I am about to write my own little GPS application in Qt and try to connect
  to FixStatusChanged signal from Gypsy but have the following problem
 
 Code snippet:
 ...
 deviceInterface = new QDBusInterface(org.freedesktop.Gypsy,
  /org/freedesktop/Gypsy/default, org.freedesktop.Gypsy.Device,
  QDBusConnection::systemBus(),this); ...
 connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this,
  SIGNAL(fixChanged(int)));
 


try this:
...
deviceInterface = new QDBusInterface(org.freedesktop.Gypsy, /default, 
org.freedesktop.Gypsy.Device, QDBusConnection::systemBus(),this);

Qt doesn't need the full path for the node again. 


Here you find some very useful QtDBus examples:
http://techbase.kde.org/Development/Tutorials#D-Bus

Not sure if you know about qdbusviewer. It comes with your Qt4 installation 
and helps you a lot debugging and understanding DBus.

Hope this helps.
Michael


signature.asc
Description: This is a digitally signed message part.
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: QT and dbus - no such signal

2010-01-08 Thread Mickael Labrousse
In Qt you must connect a signal to a slot.
Looking your code :
connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this, 
SIGNAL(fixChanged(int)));

You try to connect a signal to a signal ! It should be :
connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this, 
SLOT(fixChanged(int)));

Be careful you fixChanged(int) method is declared as  slot in your header

Christophe M a écrit :

 Hi,

 I am about to write my own little GPS application in Qt and try to
 connect to FixStatusChanged signal from Gypsy but have the
 following problem

 Code snippet:
 ...
 deviceInterface = new QDBusInterface(org.freedesktop.Gypsy,
 /org/freedesktop/Gypsy/default, org.freedesktop.Gypsy.Device,
 QDBusConnection::systemBus(),this);
 ...
 connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this,
 SIGNAL(fixChanged(int)));

 I want to pass the signal on to use it somewhere else in my
 application...

 now when starting my application I get:

 Object::connect: No such signal
 org::freedesktop::Gypsy::Device::FixStatusChanged(int)

 but  mdbus -s org.freedesktop.Gypsy /org/freedesktop/Gypsy
 lists:
 [SIGNAL]org.freedesktop.Gypsy.Device.FixStatusChanged(
 i:fixstatus )

 Do you have any idea what is going wrong?

 You can find the full code here:

 
 http://git.senfdax.de/?p=qgpslog;a=blob;f=src/gypsy.cpp;h=27014f72b3705c6439e10d9130c8c03f8cd9bfdf;hb=HEAD

 Thanks for any help.

 Cheers,
  Christian



 Hi!
 Quick response, I don't have a lot of time, here is an example of 
 connection to fso in Qt :

 m_db_ressourceManager = new QDBusInterface(org.freesmartphone.ogpsd, 
 /org/freedesktop/Gypsy,, QDBusConnection::systemBus());
 connect 
 (m_db_ressourceManager,SIGNAL(FixStatusChanged(int)),this,SLOT(fixStatusChanged(int)));

 Try :

 new QDBusInterface(org.

 freedesktop.Gypsy, /org/freedesktop/Gypsy/default, ,
 QDBusConnection::systemBus());


 Then connect to the signal.

 Many dbus examples are in the Qalee tree : 
 http://think-free83.homelinux.org/project/qalee/trunk/
 And on the wiki there is some informations : http://www.qalee.org

 -- 
 --

 Openmoko phone gui :

 http://www.qalee.org

 

 ___
 Openmoko community mailing list
 community@lists.openmoko.org
 http://lists.openmoko.org/mailman/listinfo/community
   

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: QT and dbus - no such signal

2010-01-08 Thread Christian Rüb
On Friday, 8. January 2010 13:01:40 Christophe M wrote:
  Hi,
 
  I am about to write my own little GPS application in Qt and try to connect
  to FixStatusChanged signal from Gypsy but have the following problem
 
  Code snippet:
  ...
  deviceInterface = new QDBusInterface(org.freedesktop.Gypsy,
  /org/freedesktop/Gypsy/default, org.freedesktop.Gypsy.Device,
  QDBusConnection::systemBus(),this);
  ...
  connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this,
  SIGNAL(fixChanged(int)));
 
  I want to pass the signal on to use it somewhere else in my application...
 
  now when starting my application I get:
 
  Object::connect: No such signal
  org::freedesktop::Gypsy::Device::FixStatusChanged(int)
 
  but  mdbus -s org.freedesktop.Gypsy /org/freedesktop/Gypsy
  lists:
  [SIGNAL]org.freedesktop.Gypsy.Device.FixStatusChanged( i:fixstatus )
 
  Do you have any idea what is going wrong?
 
  You can find the full code here:
 
 
  http://git.senfdax.de/?p=qgpslog;a=blob;f=src/gypsy.cpp;h=27014f72b3705c6439e10d9130c8c03f8cd9bfdf;hb=HEAD
 
  Thanks for any help.
 
  Cheers,
   Christian
 
 
 
 Hi!
 Quick response, I don't have a lot of time, here is an example of connection
 to fso in Qt :
 
 m_db_ressourceManager = new QDBusInterface(org.freesmartphone.ogpsd,
 /org/freedesktop/Gypsy,, QDBusConnection::systemBus());
 
 connect 
 (m_db_ressourceManager,SIGNAL(FixStatusChanged(int)),this,SLOT(fixStatusChanged(int)));
 
 
 Try :
 
 new QDBusInterface(org.
 
  freedesktop.Gypsy, /org/freedesktop/Gypsy/default, ,
  QDBusConnection::systemBus());
 
 
 Then connect to the signal.
 
 Many dbus examples are in the Qalee tree :
 http://think-free83.homelinux.org/project/qalee/trunk/
 And on the wiki there is some informations : http://www.qalee.org

Thanks for this - so you are using a different object path - will try this 
later.

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: QT and dbus - no such signal

2010-01-08 Thread Christian Rüb
Hi,

thanks for your reply, but it is possible to connect a signal to a signal [1] 
and that is exactly what I want.

It is even possible to connect a signal directly to another signal.

[1] http://doc.trolltech.com/4.6/signalsandslots.html

On Friday, 8. January 2010 13:27:32 Mickael Labrousse wrote:
 In Qt you must connect a signal to a slot.
 Looking your code :
 connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this, 
 SIGNAL(fixChanged(int)));
 
 You try to connect a signal to a signal ! It should be :
 connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this, 
 SLOT(fixChanged(int)));
 
 Be careful you fixChanged(int) method is declared as  slot in your header

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: QT and dbus - no such signal

2010-01-08 Thread Mickael Labrousse
I didn't know, my bad ;)

Christian Rüb a écrit :
 Hi,

 thanks for your reply, but it is possible to connect a signal to a signal [1] 
 and that is exactly what I want.

 It is even possible to connect a signal directly to another signal.

 [1] http://doc.trolltech.com/4.6/signalsandslots.html

 On Friday, 8. January 2010 13:27:32 Mickael Labrousse wrote:
   
 In Qt you must connect a signal to a slot.
 Looking your code :
 connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this, 
 SIGNAL(fixChanged(int)));

 You try to connect a signal to a signal ! It should be :
 connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this, 
 SLOT(fixChanged(int)));

 Be careful you fixChanged(int) method is declared as  slot in your header
 

 ___
 Openmoko community mailing list
 community@lists.openmoko.org
 http://lists.openmoko.org/mailman/listinfo/community

   

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: QT and dbus - no such signal

2010-01-08 Thread Christian Rüb
Am Freitag, 8. Januar 2010 schrieb Christophe M:
  Hi,
 
  I am about to write my own little GPS application in Qt and try to connect
  to FixStatusChanged signal from Gypsy but have the following problem
 
  Code snippet:
  ...
  deviceInterface = new QDBusInterface(org.freedesktop.Gypsy,
  /org/freedesktop/Gypsy/default, org.freedesktop.Gypsy.Device,
  QDBusConnection::systemBus(),this);
  ...
  connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this,
  SIGNAL(fixChanged(int)));
 
  I want to pass the signal on to use it somewhere else in my application...
 
  now when starting my application I get:
 
  Object::connect: No such signal
  org::freedesktop::Gypsy::Device::FixStatusChanged(int)
 
  but  mdbus -s org.freedesktop.Gypsy /org/freedesktop/Gypsy
  lists:
  [SIGNAL]org.freedesktop.Gypsy.Device.FixStatusChanged( i:fixstatus )
 
  Do you have any idea what is going wrong?
 
  You can find the full code here:
 
 
  http://git.senfdax.de/?p=qgpslog;a=blob;f=src/gypsy.cpp;h=27014f72b3705c6439e10d9130c8c03f8cd9bfdf;hb=HEAD
 
  Thanks for any help.
 
  Cheers,
   Christian
 
 
 
 Hi!
 Quick response, I don't have a lot of time, here is an example of connection
 to fso in Qt :
 
 m_db_ressourceManager = new QDBusInterface(org.freesmartphone.ogpsd,
 /org/freedesktop/Gypsy,, QDBusConnection::systemBus());
 
 connect 
 (m_db_ressourceManager,SIGNAL(FixStatusChanged(int)),this,SLOT(fixStatusChanged(int)));
 
 
 Try :
 
 new QDBusInterface(org.
 
  freedesktop.Gypsy, /org/freedesktop/Gypsy/default, ,
  QDBusConnection::systemBus());
 
 
 Then connect to the signal.
 
 Many dbus examples are in the Qalee tree :
 http://think-free83.homelinux.org/project/qalee/trunk/
 And on the wiki there is some informations : http://www.qalee.org

I tried:

QDBusInterface *m_db_ressourceManager = new 
QDBusInterface(org.freedesktop.Gypsy, /org/freedesktop/Gypsy,, 
QDBusConnection::systemBus());
QDBusMessage message = m_db_ressourceManager-call(GetPosition);
qDebug()  message  message;
connect 
(m_db_ressourceManager,SIGNAL(FixStatusChanged(int)),this,SLOT(showFix(int)));

but get:
 message QDBusMessage(type=Error, service=, error 
name=org.freedesktop.DBus.Error.AccessDenied, error message=Rejected send 
message, 4 matched rules; type=method_call, sender=:1.42 (uid=0 pid=2202 
comm=./qgpslog) interface=(unset) member=GetPosition error name=(unset) 
requested_reply=0 destination=org.freedesktop.Gypsy (uid=0 pid=1554 
comm=python)), signature=, contents=([]) )
Object::connect: No such signal QDBusInterface::FixStatusChanged(int)

I also tried to to change my interface to use org.freesmartphone.ogpsd as 
service name and tried different settings for object path:

/default
/org/freedesktop/Gypsy
/org/freedesktop/Gypsy/default

None with success.

Note I am using SHR unstable and compiled qt 4.5.2 from OE without 
modifications.

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: QT and dbus - no such signal

2010-01-08 Thread Christian Rüb
Am Freitag, 8. Januar 2010 schrieb Michael Zanetti:
 On Friday 08 January 2010 12:52:14 Christian Rüb wrote:
  Hi,
  
  I am about to write my own little GPS application in Qt and try to connect
   to FixStatusChanged signal from Gypsy but have the following problem
  
  Code snippet:
  ...
  deviceInterface = new QDBusInterface(org.freedesktop.Gypsy,
   /org/freedesktop/Gypsy/default, org.freedesktop.Gypsy.Device,
   QDBusConnection::systemBus(),this); ...
  connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this,
   SIGNAL(fixChanged(int)));
  
 
 
 try this:
 ...
 deviceInterface = new QDBusInterface(org.freedesktop.Gypsy, /default, 
 org.freedesktop.Gypsy.Device, QDBusConnection::systemBus(),this);
 
 Qt doesn't need the full path for the node again. 
 
 
 Here you find some very useful QtDBus examples:
 http://techbase.kde.org/Development/Tutorials#D-Bus
 
 Not sure if you know about qdbusviewer. It comes with your Qt4 installation 
 and helps you a lot debugging and understanding DBus.
 
 Hope this helps.
 Michael

Thanks Michael,

tried your suggestion:
deviceInterface = new QDBusInterface(org.freedesktop.Gypsy, 
/default, org.freedesktop.Gypsy.Device, QDBusConnection::systemBus(),this);
connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this, 
SIGNAL(fixChanged(int)));
qDebug()  testcall  deviceInterface-call(GetFixStatus);

the result was the same :(
Object::connect: No such signal 
org::freedesktop::Gypsy::Device::FixStatusChanged(int)

I already came across the page you mentioned - that's where I got connect to a 
dbus signal from...

Yes, I know qdbusviewer, I tried it on my Freerunner but it does not dispaly 
anything but the service names :(
same for qdbus

Calling a method on the above interface also gives an error:
testcall QDBusMessage(type=Error, service=, error 
name=org.freedesktop.DBus.Error.UnknownMethod, error message=Method 
GetFixStatus with signature  on interface org.freedesktop.Gypsy.Device 
doesn't exist
, signature=, contents=([]) )

trying with
deviceInterface = new QDBusInterface(org.freedesktop.Gypsy, 
/org/freedesktop/Gypsy, org.freedesktop.Gypsy.Device, 
QDBusConnection::systemBus(),this);
connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this, 
SIGNAL(fixChanged(int)));
qDebug()  testcall  deviceInterface-call(GetFixStatus);

I get:
Object::connect: No such signal 
org::freedesktop::Gypsy::Device::FixStatusChanged(int)
testcall QDBusMessage(type=MethodReturn, service=:1.15, signature=i, 
contents=(1) )

So at least the function call works here - but not the signal.

Any ideas?

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community