[FSO] QT Dbus connection to Gypsy

Michael Tansella michael-tansella at gmx.de
Tue Oct 21 16:09:17 CEST 2008

Ok now I got it:
I can call simple methodes (see below)
But one problem I still have. i don't know what type 
Gypsy.Position.GetPosition returns.

When I call it with mdbus it returns:

#mdbus -s org.freedesktop.Gypsy /org/freedesktop/Gypsy 

(dbus.Int32(0), dbus.Int32(0), dbus.Double(49.0120504), 
dbus.Double(8.4130935000000004), dbus.Double(172.148))

But when I call GetPosition I have to choose a TYPE and I don't know which!

QDBusReply<TYPE> reply = GPSDeviceInterface->call("GetPosition");

I tried to create one but it didn't work:

	typedef struct {
		long int  Fields;
		long int  TimeStamp;
		double Lat;
		double Lon;
		double Alt;
	} GypsyPosition;

any hints???


For interested Some extractions of my current working Code:

#include <QtDBus>
#include <QDBusConnection>
#include <QDBusInterface>

// Connection to system bus
QDBusConnection GPSConnection = QDBusConnection::systemBus();

//check connection
if (GPSConnection.isConnected())
		qDebug() << "connected to system bus \n";
		qFatal("Failed to connect to session bus");

// create a proxy object for method calls
GPSDeviceInterface = new 

//Call Method - returns 3 if Fix else returns 1
	QDBusReply<int> reply = GPSDeviceInterface->call("GetFixStatus");
	qDebug()<<"GetFixStatus Reply: "<<FixStatus<<"\n";
	return FixStatus;

More information about the community mailing list