5 Gypsy::Gypsy(QObject *parent) : QObject(parent) {
6 positionInterface = new QDBusInterface("org.freedesktop.Gypsy", "/org/freedesktop/Gypsy", "org.freedesktop.Gypsy.Position", QDBusConnection::systemBus(),this);
7 deviceInterface = new QDBusInterface("org.freedesktop.Gypsy", "/org/freedesktop/Gypsy", "org.freedesktop.Gypsy.Device", QDBusConnection::systemBus(),this);
8 accuracyInterface = new QDBusInterface("org.freedesktop.Gypsy", "/org/freedesktop/Gypsy", "org.freedesktop.Gypsy.Accuracy", QDBusConnection::systemBus(),this);
11 connect(deviceInterface, SIGNAL(FixStatusChanged(int)), this, SIGNAL(fixChanged(int)));
14 void Gypsy::printCoordinates() const {
15 qDebug() << "Position" << positionInterface->call("GetPosition");
16 qDebug() << "Fix" << deviceInterface->call("GetFixStatus");
17 // QDBusMessage msg = positionInterface->call("GetPosition");
18 // QList<QVariant> args = msg.arguments();
19 // qDebug() << "valid" << args[0].toInt();
20 // qDebug() << "time" << args[1].toInt() << QDateTime::fromTime_t(args[1].toInt());
21 // qDebug() << "Lat" << args[2].toDouble();
22 // qDebug() << "Lon" << args[3].toDouble();
23 // qDebug() << "Alt" << args[4].toDouble();