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

Reply via email to