summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Residori <marco.residori@xse.de>2014-06-24 16:03:57 +0200
committerMarco Residori <marco.residori@xse.de>2014-06-24 16:03:57 +0200
commit355aea9c48fb89007681635f98b62c0045f0c63c (patch)
tree092cbcc25acd0bad697c2610b338bba1f86ca4bc
parent40c43fd3ae2210a2cfc634cf6628e97fbcd41d93 (diff)
downloadpositioning-355aea9c48fb89007681635f98b62c0045f0c63c.tar.gz
Add new version of enhanced-position-service using libdbus-c++ instead of Qt
-rw-r--r--NOTE7
-rw-r--r--README10
-rw-r--r--enhanced-position-service/CMakeLists.txt15
-rw-r--r--enhanced-position-service/README50
-rw-r--r--enhanced-position-service/api/enum.xsl37
-rw-r--r--enhanced-position-service/scripts/StartHelperGeneric.py142
-rw-r--r--enhanced-position-service/scripts/client/confif.cpp26
-rw-r--r--enhanced-position-service/scripts/client/confif.h88
-rw-r--r--enhanced-position-service/scripts/client/demoif.cpp26
-rw-r--r--enhanced-position-service/scripts/client/demoif.h104
-rwxr-xr-xenhanced-position-service/scripts/gen-dbus-conf.sh50
-rwxr-xr-xenhanced-position-service/scripts/gen-dbus.sh49
-rw-r--r--enhanced-position-service/scripts/genivi-positioning-configuration-qt.xml111
-rw-r--r--enhanced-position-service/scripts/genivi-positioning-enhancedposition-qt.xml276
-rwxr-xr-xenhanced-position-service/scripts/run-test.py55
-rw-r--r--enhanced-position-service/scripts/server/confifadaptor.cpp83
-rw-r--r--enhanced-position-service/scripts/server/confifadaptor.h146
-rw-r--r--enhanced-position-service/scripts/server/demoifadaptor.cpp83
-rw-r--r--enhanced-position-service/scripts/server/demoifadaptor.h302
-rwxr-xr-xenhanced-position-service/scripts/strip-annotations.sh8
-rw-r--r--enhanced-position-service/src/.gitignore2
-rw-r--r--enhanced-position-service/src/CMakeLists.txt101
-rw-r--r--enhanced-position-service/src/ConfigurationImpl.cpp51
-rw-r--r--enhanced-position-service/src/ConfigurationImpl.h44
-rw-r--r--enhanced-position-service/src/PositionFilter.cpp220
-rw-r--r--enhanced-position-service/src/PositionFilter.h59
-rw-r--r--enhanced-position-service/src/clienthandler.h227
-rw-r--r--enhanced-position-service/src/confifadaptor.cpp77
-rw-r--r--enhanced-position-service/src/confifadaptor.h114
-rw-r--r--enhanced-position-service/src/configuration.cpp130
-rw-r--r--enhanced-position-service/src/configuration.h52
-rw-r--r--enhanced-position-service/src/demoifadaptor.cpp83
-rw-r--r--enhanced-position-service/src/demoifadaptor.h298
-rw-r--r--enhanced-position-service/src/enhanced-position.cpp617
-rw-r--r--enhanced-position-service/src/enhanced-position.h74
-rw-r--r--enhanced-position-service/src/genivi-dbus-types.h23
-rw-r--r--enhanced-position-service/src/genivi-navigationcore-enum.h143
-rw-r--r--enhanced-position-service/src/genivi-version.cpp158
-rw-r--r--enhanced-position-service/src/genivi-version.h69
-rw-r--r--enhanced-position-service/src/log.h137
-rw-r--r--enhanced-position-service/src/main.cpp82
-rw-r--r--enhanced-position-service/src/position-feedback.cpp60
-rw-r--r--enhanced-position-service/src/position-feedback.h47
-rw-r--r--enhanced-position-service/src/serverimpl.cpp283
-rw-r--r--enhanced-position-service/src/serverimpl.h89
-rw-r--r--enhanced-position-service/src/test/CMakeLists.txt58
-rw-r--r--enhanced-position-service/src/test/ConfigurationTest.cpp80
-rw-r--r--enhanced-position-service/src/test/EnhPosTest.cpp237
-rw-r--r--enhanced-position-service/src/test/PositionFilterTest.cpp502
-rw-r--r--enhanced-position-service/src/test/externals/CMakeLists.txt24
-rw-r--r--enhanced-position-service/test/CMakeLists.txt91
-rw-r--r--enhanced-position-service/test/ConfigurationClient.cpp70
-rw-r--r--enhanced-position-service/test/ConfigurationClient.h46
-rw-r--r--enhanced-position-service/test/agentadaptor.cpp47
-rw-r--r--enhanced-position-service/test/agentadaptor.h119
-rw-r--r--enhanced-position-service/test/agentimpl.cpp40
-rw-r--r--enhanced-position-service/test/agentimpl.h43
-rw-r--r--enhanced-position-service/test/compliance-test/enhanced-position-service-compliance-test.c4
-rw-r--r--enhanced-position-service/test/confif.cpp26
-rw-r--r--enhanced-position-service/test/confif.h82
-rw-r--r--enhanced-position-service/test/demoif.cpp26
-rw-r--r--enhanced-position-service/test/demoif.h104
-rw-r--r--enhanced-position-service/test/enhanced-position-client.cpp129
-rw-r--r--enhanced-position-service/test/enhanced-position-client.h41
-rw-r--r--enhanced-position-service/test/main-client.cpp95
-rw-r--r--enhanced-position-service/test/signalhelper.cpp103
-rw-r--r--enhanced-position-service/test/signalhelper.h58
-rwxr-xr-xenhanced-position-service/test/simple-client.py67
-rw-r--r--enhanced-position-service/test/testclient.cpp253
-rw-r--r--enhanced-position-service/test/testclient.h65
-rw-r--r--gnss-service/CMakeLists.txt7
-rw-r--r--log-replayer/src/log-replayer.c14
-rwxr-xr-xpositioning_1.0.bb12
-rwxr-xr-xrun-test.sh37
-rw-r--r--sensors-service/CMakeLists.txt7
75 files changed, 1541 insertions, 5854 deletions
diff --git a/NOTE b/NOTE
index 16f7bf7..2e7c437 100644
--- a/NOTE
+++ b/NOTE
@@ -1,8 +1,5 @@
-The source code of the enhanced-position-service was developed by BMW Car IT GmbH.
-
-The source code of gnss-service and sensors-service was rewritten by XS Embedded.
-Some code fragments of the gnss-service and sensors-service were taken over from a
-previous version of the positioning proof of concept developed by BMW Car IT GmbH.
+Some code fragments of the gnss-service, sensors-service and enhanced-position-service were taken
+over from a previous version of the positioning proof of concept developed by BMW Car IT GmbH.
The icon used in the file architecture.png to represent the iPhone application "SensorLogger"
was downloaded from the following web page:
diff --git a/README b/README
index 2232de4..6e87484 100644
--- a/README
+++ b/README
@@ -20,6 +20,7 @@ sensors-service //sensors-service PoC
architecture.png //architecture overview
build-all.sh //script to build the PoCs (usage: build-all.sh help)
run-test.sh //script to run a quick test for each PoC (usage: run-test.sh help)
+positioning_x.y.bb //version x.y of a Yocto recipe for the positioning PoCs
===============================
@@ -52,13 +53,14 @@ How To Test
To test the positioning proofs of concept please use the following test application:
-./run-test.sh [service]
+./run-test.sh [command]
service:
gnss Test GNSSService
sns Test SensorsService
enhpos Test EnhancedPositionService
repl Test Replayer
+ kill Kill all test applications
help Print Help
@@ -89,9 +91,9 @@ To install 'gpsd', please execute the following commands:
sudo apt-get install gpsd
sudo apt-get install libgps-dev
-To test the enhanced-positon-service the package Qt4 must be installed.
-To install Qt4, please execute the following command:
-sudo apt-get install qtcreator
+To test the enhanced-positon-service the package 'libdbus-c++-dev' must be installed.
+To install 'libdbus-c++-dev', please execute the following command:
+sudo apt-get install libdbus-c++-dev
DWITH_TESTS=ON enables the compilation of the test application(s).
diff --git a/enhanced-position-service/CMakeLists.txt b/enhanced-position-service/CMakeLists.txt
index 9cb036c..60a2f9e 100644
--- a/enhanced-position-service/CMakeLists.txt
+++ b/enhanced-position-service/CMakeLists.txt
@@ -4,24 +4,23 @@
#
# Component Name: EnhancedPositionService
#
-# Author: Thomas Bader
+# Author: Marco Residori
#
-# Copyright (C) 2012, BMW Car IT GmbH
+# Copyright (C) 2014, XS Embedded GmbH
#
# License:
# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-# List of changes:
-#
-# 15/6/2014, Philippe Colliot, migrate to Qt5
-#
# @licence end@
###########################################################################
-cmake_minimum_required(VERSION 2.8.11)
project(enhanced-position-service)
+cmake_minimum_required(VERSION 2.6.0)
+
+option(WITH_DLT
+ "Enable DLT logging" OFF)
message(STATUS)
message(STATUS "---------------------------------------------------------")
@@ -42,8 +41,6 @@ if(WITH_REPLAYER)
set(sensors-service_LIBRARIES "sensors-service-use-replayer")
endif()
-set(QT_USE_QTDBUS TRUE)
-
include_directories(api src test ${gnss-service_INCLUDE_DIRS} ${sensors-service_INCLUDE_DIRS})
add_subdirectory(src)
diff --git a/enhanced-position-service/README b/enhanced-position-service/README
deleted file mode 100644
index 3bfcfdf..0000000
--- a/enhanced-position-service/README
+++ /dev/null
@@ -1,50 +0,0 @@
-
-[Build]
-
-* Dependencies:
- # ubuntu
- $ aptitude install qt4-dev-tools qt4-qmake libqt4-core libqt4-dbus libqt4-xml
-
-* Build instructions
- $ mkdir build && cd build
- $ cmake ..
- $ make
-
-* Call test helper (starts client and server)
- $ cd build
- $ ../run-test.py
-
-* Generate adapter/proxy
- # only needed if changes on Introspections XMLs happend
- # source introspection file
- # ../position-api/EnhancedPosition/genivi.EnhancedPosition.xml
-
- $ ./gen-dbus.sh
-
-[Documentation on the Web]
-
-* CMake Qt Tutorial:
- http://developer.qt.nokia.com/quarterly/view/using_cmake_to_build_qt_projects
-
-* QtDBus Tutorial:
- http://www.developer.nokia.com/Community/Wiki/QtDbus_quick_tutorial
-
-* Found afterwards some good example :(
- https://github.com/rohityadav/cmakeqt/tree/master/src
-
-* Official example code: Qt, DBus
- http://doc.qt.nokia.com/4.7-snapshot/dbus-dbus-chat.html
-
-* Blogs: Complex types mapped to custom types
- http://laurii.info/2007/03/dbus-and-qt-programming/
-
-* Techtutorial from KDE (Custom Types in D-Bus)
- http://techbase.kde.org/Development/Tutorials/D-Bus/CustomTypes
-
-[qdbusxml2cpp]
-
-* proxy (client):
- $ qdbusxml2cpp -v -c DemoIf -p demoif.h:demoif.cpp com.nokia.Demo.xml
-
-* stub (server):
- $ qdbusxml2cpp -c DemoIfAdaptor -a demoifadaptor.h:demoifadaptor.cpp com.nokia.Demo.xml
diff --git a/enhanced-position-service/api/enum.xsl b/enhanced-position-service/api/enum.xsl
new file mode 100644
index 0000000..b1c70ff
--- /dev/null
+++ b/enhanced-position-service/api/enum.xsl
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ************************************************************************
+* Component Name: Navit POC
+* Author: Martin Schaller <martin.schaller@it-schaller.de>
+*
+* Copyright (C) 2012, GENIVI Alliance, Inc.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2 as
+* published by the Free Software Foundation.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+************************************************************************ -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
+ <xsl:output method="text" encoding="iso-8859-15"/>
+ <xsl:template match="constants">
+ <xsl:variable name="constants" select="translate(@name,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
+/* This is an automatically generated file, do not edit */
+
+<!-- enum EPOS_<xsl:value-of select="$constants"/>_Constants {<xsl:for-each select="id">
+ POS_<xsl:value-of select="$constants"/>_<xsl:value-of select="translate(@name,'-','_')"/> = <xsl:value-of select="@value"/>,</xsl:for-each>
+};
+ -->
+
+enum EPOS_Constants {<xsl:for-each select="id">
+ POS_<xsl:value-of select="translate(@name,'-','_')"/> = <xsl:value-of select="@value"/>,</xsl:for-each>
+};
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/enhanced-position-service/scripts/StartHelperGeneric.py b/enhanced-position-service/scripts/StartHelperGeneric.py
deleted file mode 100644
index 6d10f66..0000000
--- a/enhanced-position-service/scripts/StartHelperGeneric.py
+++ /dev/null
@@ -1,142 +0,0 @@
-# vim: set noexpandtab sw=4 ts=4:
-# author: thomas.bader@bmw.de
-
-import os
-import subprocess
-import time
-import sys
-import signal
-
-# some issues with terminations.
-# time_cmd = ["/usr/bin/time", "-f", "cpu %P | user %U | system %S | %C"]
-
-
-'''
-Exmaple:
-
- # create server by helper
- file = open('/tmp/server.out', 'w')
- server = StartHelperGeneric(["server"], "server", file)
- client = StartHelperGeneric(["client"], "client-1")
-
- # start
- server.start()
- client.start()
-
- time.sleep(1)
-
- # stop them
- client.stop()
- server.stop()
- file.close()
-'''
-
-#--------------------------
-# generic
-#--------------------------
-class StartHelperGeneric:
- def __init__(self, cmd, name="unkown", out=sys.stdout):
- self.cmd = cmd
- self.name = name
- self.out = out
- self.env = os.environ
- print "%s: created" % self.name
-
- def setEnv(self, name, value):
- self.env[name] = value
- print self.env[name]
-
- def start(self):
- print "%s: starting ..." % self.name
- self.p = subprocess.Popen(self.cmd, stdin=subprocess.PIPE, stdout=self.out, stderr=sys.stderr, shell=True, env=self.env)
-
- def isTerminated(self):
- if self.p.poll() != None:
- return True
-
- def stop(self):
- # already terminated
- if self.isTerminated():
- print "%s: own termination triggered successfully!" % self.name
- return self.p.returncode
-
- # signal: SIGTERM
- self.p.send_signal(signal.SIGTERM)
- time.sleep(0.3)
- if self.isTerminated():
- print "%s: SIGTERM triggered successfully!" % self.name
- return self.p.returncode
-
- # signal: SIGINT (Ctr-C)
- self.p.send_signal(signal.SIGINT)
- time.sleep(0.3)
- if self.isTerminated():
- print "%s: Ctrl-C triggered successfully!" % self.name
- return self.p.returncode
-
- # terminate
- self.p.terminate()
- time.sleep(0.3)
- if self.isTerminated():
- print "%s: 'terminate' triggered successfully!" % self.name
- return self.p.returncode
-
- # kill
- self.p.kill()
- time.sleep(0.3)
- if self.isTerminated():
- print "%s: killed force successfully" % self.name
- return self.p.returncode
-
- print "%s: failed to terminate" % self.name
- return 1
-
- def stop_sigint(self):
- # signal: SIGINT (Ctr-C)
- self.p.send_signal(signal.SIGINT)
- time.sleep(0.3)
- if self.isTerminated():
- print "%s: Ctrl-C triggered successfully!" % self.name
- return self.p.returncode
-
-
-'''
-# demo how to customize your start/stop methods
-
-#-----------------------------------------------------------------------------
-# server
-#-----------------------------------------------------------------------------
-class StartHelperServer(StartHelperGeneric):
- def start(self):
- print "start 'server': %s" % self.name
- StartHelperGeneric.start(self)
-
- def stop(self):
- print "stop 'server': %s" % self.name
- # try by own methods
- if self.p.poll() == None:
- self.p.stdin.write("1")
- self.p.stdin.write("2")
- time.sleep(0.3) # 300 ms
- # use termination
- StartHelperGeneric.stop(self)
-
-#-----------------------------------------------------------------------------
-# client
-#-----------------------------------------------------------------------------
-class StartHelperClient(StartHelperGeneric):
- def start(self):
- print "start 'client': %s" % self.name
- StartHelperGeneric.start(self)
-
- def stop(self):
- print "stop 'client': %s" % self.name
- # try by own methods
- if self.p.poll() == None:
- self.p.stdin.write("1")
- time.sleep(2.0) # 2000 ms
- # use termination
- StartHelperGeneric.stop(self)
-*/
-'''
-
diff --git a/enhanced-position-service/scripts/client/confif.cpp b/enhanced-position-service/scripts/client/confif.cpp
deleted file mode 100644
index 7ff4d93..0000000
--- a/enhanced-position-service/scripts/client/confif.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c ConfigurationIf -p confif.h:confif.cpp -i genivi-dbus-types.h ../genivi-positioning-configuration-qt.xml org.genivi.positioning.Configuration
- *
- * qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "confif.h"
-
-/*
- * Implementation of interface class ConfigurationIf
- */
-
-ConfigurationIf::ConfigurationIf(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-ConfigurationIf::~ConfigurationIf()
-{
-}
-
diff --git a/enhanced-position-service/scripts/client/confif.h b/enhanced-position-service/scripts/client/confif.h
deleted file mode 100644
index b7c2c0d..0000000
--- a/enhanced-position-service/scripts/client/confif.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c ConfigurationIf -p confif.h:confif.cpp -i genivi-dbus-types.h ../genivi-positioning-configuration-qt.xml org.genivi.positioning.Configuration
- *
- * qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef CONFIF_H_1381241789
-#define CONFIF_H_1381241789
-
-#include <QtCore/QObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtDBus/QtDBus>
-#include "genivi-dbus-types.h"
-
-/*
- * Proxy class for interface org.genivi.positioning.Configuration
- */
-class ConfigurationIf: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.genivi.positioning.Configuration"; }
-
-public:
- ConfigurationIf(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
-
- ~ConfigurationIf();
-
- Q_PROPERTY(ushort SatelliteSystem READ satelliteSystem WRITE setSatelliteSystem)
- inline ushort satelliteSystem() const
- { return qvariant_cast< ushort >(property("SatelliteSystem")); }
- inline void setSatelliteSystem(ushort value)
- { setProperty("SatelliteSystem", QVariant::fromValue(value)); }
-
- Q_PROPERTY(int UpdateInterval READ updateInterval WRITE setUpdateInterval)
- inline int updateInterval() const
- { return qvariant_cast< int >(property("UpdateInterval")); }
- inline void setUpdateInterval(int value)
- { setProperty("UpdateInterval", QVariant::fromValue(value)); }
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<QVariantMap> GetProperties()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetProperties"), argumentList);
- }
-
- inline QDBusPendingReply<MapUShortVariant> GetSupportedProperties()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetSupportedProperties"), argumentList);
- }
-
- inline QDBusPendingReply<GeniviVersion> GetVersion()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetVersion"), argumentList);
- }
-
- inline QDBusPendingReply<> SetProperty(const QString &name, const QDBusVariant &value)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(name) << QVariant::fromValue(value);
- return asyncCallWithArgumentList(QLatin1String("SetProperty"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
- void PropertyChanged(const QString &name, const QDBusVariant &value);
-};
-
-namespace org {
- namespace genivi {
- namespace positioning {
- typedef ::ConfigurationIf Configuration;
- }
- }
-}
-#endif
diff --git a/enhanced-position-service/scripts/client/demoif.cpp b/enhanced-position-service/scripts/client/demoif.cpp
deleted file mode 100644
index 5cbe680..0000000
--- a/enhanced-position-service/scripts/client/demoif.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c DemoIf -p demoif.h:demoif.cpp -i genivi-dbus-types.h ../genivi-positioning-enhancedposition-qt.xml org.genivi.positioning.EnhancedPosition
- *
- * qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "demoif.h"
-
-/*
- * Implementation of interface class DemoIf
- */
-
-DemoIf::DemoIf(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-DemoIf::~DemoIf()
-{
-}
-
diff --git a/enhanced-position-service/scripts/client/demoif.h b/enhanced-position-service/scripts/client/demoif.h
deleted file mode 100644
index c5d4396..0000000
--- a/enhanced-position-service/scripts/client/demoif.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c DemoIf -p demoif.h:demoif.cpp -i genivi-dbus-types.h ../genivi-positioning-enhancedposition-qt.xml org.genivi.positioning.EnhancedPosition
- *
- * qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef DEMOIF_H_1381241613
-#define DEMOIF_H_1381241613
-
-#include <QtCore/QObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtDBus/QtDBus>
-#include "genivi-dbus-types.h"
-
-/*
- * Proxy class for interface org.genivi.positioning.EnhancedPosition
- */
-class DemoIf: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.genivi.positioning.EnhancedPosition"; }
-
-public:
- DemoIf(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
-
- ~DemoIf();
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<MapUShortVariant> GetAccuracy()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetAccuracy"), argumentList);
- }
-
- inline QDBusPendingReply<MapUShortVariant> GetData(const QList<ushort> &valuesToReturn)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(valuesToReturn);
- return asyncCallWithArgumentList(QLatin1String("GetData"), argumentList);
- }
-
- inline QDBusPendingReply<MapUShortVariant> GetPosition()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetPosition"), argumentList);
- }
-
- inline QDBusPendingReply<<type> > GetRotationRate()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetRotationRate"), argumentList);
- }
-
- inline QDBusPendingReply<MapUShortVariant> GetSatelliteInfo()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetSatelliteInfo"), argumentList);
- }
-
- inline QDBusPendingReply<MapUShortVariant> GetStatus()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetStatus"), argumentList);
- }
-
- inline QDBusPendingReply<MapUShortVariant> GetTime()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetTime"), argumentList);
- }
-
- inline QDBusPendingReply<GeniviVersion> GetVersion()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetVersion"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
- void AccuracyUpdate(const QList<ushort> &changedValues);
- void PositionUpdate(const QList<ushort> &changedValues);
- void RotationRateUpdate(const QList<ushort> &changedValues);
- void SatelliteInfoUpdate(const QList<ushort> &changedValues);
- void StatusUpdate(const QList<ushort> &changedValues);
-};
-
-namespace org {
- namespace genivi {
- namespace positioning {
- typedef ::DemoIf EnhancedPosition;
- }
- }
-}
-#endif
diff --git a/enhanced-position-service/scripts/gen-dbus-conf.sh b/enhanced-position-service/scripts/gen-dbus-conf.sh
deleted file mode 100755
index 80c5b7c..0000000
--- a/enhanced-position-service/scripts/gen-dbus-conf.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/bash
-#
-# execute from position-daemon direcotry
-#
-
-#introspection="../position-api/EnhancedPosition/EnhancedPosition.xml"
-
-# minimal set (hand edited)
-introspection="genivi-positioning-configuration-qt.xml"
-interface="org.genivi.positioning.Configuration"
-
-#####
-echo
-echo "precheck with xmllint"
-xmllint $introspection
-
-if [ $? != 0 ]; then
- echo "xmllint failed ... check your xml"
- exit 1
-fi
-
-mkdir -p server
-mkdir -p client
-
-#####
-echo
-echo "generate client"
-cd client
-pwd
-qdbusxml2cpp -v -c ConfigurationIf -p confif.h:confif.cpp \
- -i genivi-dbus-types.h \
- ../$introspection $interface
-
-cd ..
-
-#####
-echo
-echo "generate server"
-cd server
-pwd
-qdbusxml2cpp -v -c ConfigurationIfAdaptor -a confifadaptor.h:confifadaptor.cpp \
- -i genivi-dbus-types.h \
- -i ConfigurationImpl.h -l ConfigurationImpl \
- ../$introspection $interface
-
-cd ..
-#####
-
-echo
-echo "done"
diff --git a/enhanced-position-service/scripts/gen-dbus.sh b/enhanced-position-service/scripts/gen-dbus.sh
deleted file mode 100755
index 594e015..0000000
--- a/enhanced-position-service/scripts/gen-dbus.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-#
-# execute from position-daemon direcotry
-#
-
-#introspection="../position-api/EnhancedPosition/EnhancedPosition.xml"
-
-# minimal set (hand edited)
-introspection="genivi-positioning-enhancedposition-qt.xml"
-interface="org.genivi.positioning.EnhancedPosition"
-
-#####
-echo
-echo "precheck with xmllint"
-xmllint $introspection
-
-if [ $? != 0 ]; then
- echo "xmllint failed ... check your xml"
- exit 1
-fi
-
-mkdir -p client
-mkdir -p server
-#####
-echo
-echo "generate client"
-cd client
-pwd
-qdbusxml2cpp -v -c DemoIf -p demoif.h:demoif.cpp \
- -i genivi-dbus-types.h \
- ../$introspection $interface
-
-cd ..
-
-#####
-echo
-echo "generate server"
-cd server
-pwd
-qdbusxml2cpp -v -c DemoIfAdaptor -a demoifadaptor.h:demoifadaptor.cpp \
- -i genivi-dbus-types.h \
- -i serverimpl.h -l ServerImpl \
- ../$introspection $interface
-
-cd ..
-#####
-
-echo
-echo "done"
diff --git a/enhanced-position-service/scripts/genivi-positioning-configuration-qt.xml b/enhanced-position-service/scripts/genivi-positioning-configuration-qt.xml
deleted file mode 100644
index 9e41e49..0000000
--- a/enhanced-position-service/scripts/genivi-positioning-configuration-qt.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
-
-<!-- Component Name: EnhancedPositionService
- Compliance Level: Abstract Component
- Copyright (C) 2012, BMW Car IT GmbH, Continental Automotive GmbH, PSA Peugeot Citroën, XS Embedded GmbH
- License:
- This Source Code Form is subject to the terms of the
- Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
- this file, You can obtain one at http://mozilla.org/MPL/2.0/.
--->
-
-<node name="/org/genivi/enhancedpositionservice" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="introspect.xsd">
-
- <interface name="org.genivi.positioning.Configuration">
- <version>2.0.0 (04-06-2013)</version>
- <doc>
- <line>Configuration = This interface allows a client application to set and retrieve configuration options</line>
- </doc>
-
- <method name="GetVersion">
- <doc>
- <line>GetVersion = This method returns the API version implemented by the server application.</line>
- </doc>
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="GeniviVersion"/>
- <arg name="version" type="(qqqs)" direction="out">
- <doc>
- <line>version = struct(major,minor,micro,date)</line>
- <line>major = when the major changes, then backward compatibility with previous releases is not granted</line>
- <line>minor = when the minor changes, then backward compatibility with previous releases is granted, but something changed in the implementation of the API (e.g. new methods may have been added)</line>
- <line>micro = when the micro changes, then backward compatibility with previous releases is granted (bug fixes or documentation modifications)</line>
- <line>date = release date (e.g. 21-06-2011)</line>
- </doc>
- </arg>
- </method>
-
- <method name="GetProperties">
- <doc>
- <line>GetProperties = This method returns all global system properties.</line>
- </doc>
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
- <arg name="properties" type="a{sv}" direction="out" />
- </method>
-
- <method name="SetProperty">
- <doc>
- <line>SetProperty = This method changes the value of the specified property</line>
- <line>Only properties that are listed as read-write are changeable</line>
- <line>On success a PropertyChanged signal will be emitted</line>
- </doc>
- <arg name="name" type="s" direction="in">
- <doc>
- <line>name = property name</line>
- </doc>
- </arg>
- <arg name="value" type="v" direction="in">
- <doc>
- <line>value = property value</line>
- </doc>
- </arg>
- <error name="org.genivi.positioning.Configuration.Error.InvalidProperty" />
- </method>
-
- <signal name="PropertyChanged">
- <doc>
- <line>PropertyChanged = This signal is emitted when a property changes</line>
- </doc>
- <arg name="name" type="s">
- <doc>
- <line>name = property name</line>
- </doc>
- </arg>
- <arg name="value" type="v">
- <doc>
- <line>value = property value</line>
- </doc>
- </arg>
- </signal>
-
- <property name="SatelliteSystem" type="q" access="readwrite">
- <doc>
- <line>SatelliteSystem = enum(INVALID,GPS,GLONASS,GALILEO,COMPASS, ... )</line>
- </doc>
- </property>
-
- <property name="UpdateInterval" type="i" access="readwrite">
- <doc>
- <line>UpdateInterval = update interval in ms</line>
- </doc>
- </property>
-
- <method name="GetSupportedProperties">
- <doc>
- <line>GetSupportedProperties = This method returns all suppported global system properties</line>
- </doc>
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapUShortVariant"/>
- <arg name="properties" type="a{sv}" direction="out">
- <doc>
- <line>properties = array[property]</line>
- <line>property = dictionary[key,value]</line>
- <line>key = enum(SatelliteSystem,UpdateInterval, ... )</line>
- <line>key = SatelliteSystem, value = value of type 'aq'; 'q' is an enum(INVALID,GPS,GLONASS,GALILEO,COMPASS, ...)</line>
- <line>key = UpdateInterval, value = value of type 'ai'; 'i' is the update interval in ms</line>
- </doc>
- </arg>
- </method>
-
- </interface>
-
-</node>
diff --git a/enhanced-position-service/scripts/genivi-positioning-enhancedposition-qt.xml b/enhanced-position-service/scripts/genivi-positioning-enhancedposition-qt.xml
deleted file mode 100644
index aed4170..0000000
--- a/enhanced-position-service/scripts/genivi-positioning-enhancedposition-qt.xml
+++ /dev/null
@@ -1,276 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
-
-<!-- Component Name: EnhancedPositionService
- Compliance Level: Abstract Component
- Copyright (C) 2012, BMW Car IT GmbH, Continental Automotive GmbH, PCA Peugeot Citroën, XS Embedded GmbH
- License:
- This Source Code Form is subject to the terms of the
- Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
- this file, You can obtain one at http://mozilla.org/MPL/2.0/.
--->
-
-<node name="/org/genivi/enhancedpositionservice" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="introspect.xsd">
-
- <interface name="org.genivi.positioning.EnhancedPosition">
- <version>2.0.0 (04-06-2013)</version>
- <doc>
- <line>EnhancedPosition = This interface offers functionalities to retrieve the enhanced position of the vehicle</line>
- </doc>
-
- <method name="GetVersion">
- <doc>
- <line>GetVersion = This method returns the API version implemented by the server application</line>
- </doc>
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="GeniviVersion"/>
- <arg name="version" type="(qqqs)" direction="out">
- <doc>
- <line>version = struct(major,minor,micro,date)</line>
- <line>major = when the major changes, then backward compatibility with previous releases is not granted</line>
- <line>minor = when the minor changes, then backward compatibility with previous releases is granted, but something changed in the implementation of the API (e.g. new methods may have been added)</line>
- <line>micro = when the micro changes, then backward compatibility with previous releases is granted (bug fixes or documentation modifications)</line>
- <line>date = release date (e.g. 21-06-2011)</line>
- </doc>
- </arg>
- </method>
-
- <method name="GetData">
- <doc>
- <line>GetData = This method returns a given set of positioning data (e.g. Position, Course, Accuracy, Status, ... )</line>
- </doc>
-
- <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QList&lt;ushort&gt;"/>
- <arg name="valuesToReturn" type="aq" direction="in">
- <doc>
- <line>valuesToReturn= array[fieldType]</line>
- <line>key = enum(INVALID,TIMESTAMP,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,ROLL_RATE,PITCH_RATE,YAW_RATE,...,ALL)</line>
- </doc>
- </arg>
-
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapUShortVariant"/>
- <arg name="data" type="a{qv}" direction="out">
- <doc>
- <line>position = dictionary[key,value]</line>
- <line>dictionary = array of tuples (key,value)</line>
- <line>Invalid data is not be returned to the client application</line>
- <line>key = enum(INVALID,TIMESTAMP,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,ROLL_RATE,PITCH_RATE,YAW_RATE,PDOP,HDOP,VDOP,SIGMA_LATITUDE,SIGMA_LONGITUDE,SIGMA_ALTITUDE,SIGMA_HEADING,... ,ALL</line>
- <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>
- <line>key = LATITUDE, value = value of type 'd', that expresses the latitude of the current position. Range [-90:+90]. Example: 48.053250</line>
- <line>key = LONGITUDE, value = value of type 'd', that expresses the longitude of the current position. Range [-180:+180]. Example: 8.324500</line>
- <line>key = ALTITUDE, value = value of type 'i', that expresses the altitude above the sea level of the current position in meters</line>
- <line>key = HEADING, value = value of type 'i', that expresses the course angle in degree. Range [0:360]. 0 = north, 90 = east, 180 = south, 270 = west</line>
- <line>key = SPEED, value = value of type 'd', that expresses speed measured in m/s. A negative value indicates that the vehicle is moving backwards</line>
- <line>key = CLIMB, value = value of type 'i', that expresses the road gradient in degrees</line>
- <line>key = ROLL_RATE, value = value of type 'i', rotation rate around the X-axis in degrees/s. Range [-100:+100]</line>
- <line>key = PITCH_RATE, value = value of type 'i', rotation rate around the Y-axis in degrees/s. Range [-100:+100]</line>
- <line>key = YAW_RATE, value = value of type 'i', rotation rate around the Z-axis in degrees/s. Range [-100:+100]</line>
- <line>key = PDOP, value = value of type 'd', that represents the positional (3D) dilution of precision</line>
- <line>key = HDOP, value = value of type 'd', that represents the horizontal (2D) dilution of precision</line>
- <line>key = VDOP, value = value of type 'd', that represents vertical (altitude) dilution of precision</line>
- <line>key = SIGMA_LATITUDE, value = value of type 'd', that represents the standard deviation for latitude in m</line>
- <line>key = SIGMA_LONGITUDE, value = value of type 'd', that represents the standard deviation for longitude in m</line>
- <line>key = SIGMA_ALTITUDE, value = value of type 'd', that represents the standard deviation for altitude in m</line>
- <line>key = SIGMA_HEADING, value = value of type 'd', that represents the standard deviation for altitude in degrees</line>
- </doc>
- </arg>
- </method>
-
- <method name="GetPosition">
- <doc>
- <line>GetPosition = This method returns the current position</line>
- </doc>
-
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapUShortVariant"/>
- <arg name="position" type="a{qv}" direction="out">
- <doc>
- <line>position = dictionary[key,value]</line>
- <line>dictionary = array of tuples (key,value)</line>
- <line>Invalid data is not be returned to the client application</line>
- <line>key = enum(INVALID,TIMESTAMP,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,...)</line>
- <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>
- <line>key = LATITUDE, value = value of type 'd', that expresses the latitude of the current position. Range [-90:+90]. Example: 48.053250</line>
- <line>key = LONGITUDE, value = value of type 'd', that expresses the longitude of the current position. Range [-180:+180]. Example: 8.324500</line>
- <line>key = ALTITUDE, value = value of type 'i', that expresses the altitude above the sea level of the current position in meters</line>
- <line>key = HEADING, value = value of type 'i', that expresses the course angle in degree. Range [0:360]. 0 = north, 90 = east, 180 = south, 270 = west</line>
- <line>key = SPEED, value = value of type 'd', that expresses speed measured in m/s. A negative value indicates that the vehicle is moving backwards</line>
- <line>key = CLIMB, value = value of type 'i', that expresses the road gradient in degrees</line>
- </doc>
- </arg>
- </method>
-
- <signal name="PositionUpdate">
- <doc>
- <line>PositionUpdate = This signal is called to notifiy a client application of a position change. The update frequency is implementation specific. The maximal allowed frequency is 10Hz</line>
- </doc>
- <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QList&lt;ushort&gt;"/>
- <arg name="changedValues" type="aq" >
- <doc>
- <line>changedValues = array[value]</line>
- <line>value = enum(INVALID,TIMESTAMP,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,... )</line>
- </doc>
- </arg>
- </signal>
-
- <method name="GetRotationRate">
- <doc>
- <line>GetRotationRate = This method returns the rotation rate</line>
- </doc>
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="&lt;type&gt;"/>
- <arg name="rotationRate" type="a{qv}" direction="out">
- <doc>
- <line>rotationRates = dictionary[key,value]</line>
- <line>dictionary = array of tuples (key,value)</line>
- <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>
- <line>key = enum(INVALID,TIMESTAMP,ROLL_RATE,PITCH_RATE,YAW_RATE, ... )</line>
- <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>
- <line>key = ROLL_RATE, value = rotation rate around the X-axis in degrees/s. Range [-100:+100]</line>
- <line>key = PITCH_RATE, value = rotation rate around the Y-axis in degrees/s. Range [-100:+100]</line>
- <line>key = YAW_RATE, value = rotation rate around the Z-axis in degrees/s. Range [-100:+100]</line>
- </doc>
- </arg>
- </method>
-
- <signal name="RotationRateUpdate">
- <doc>
- <line>RotationRateUpdated = This signal is emitted when the rotation rate changes</line>
- </doc>
- <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QList&lt;ushort&gt;"/>
- <arg name="changedValues" type="aq">
- <doc>
- <line>changedValues = array[key]</line>
- <line>key = enum(INVALID,TIMESTAMP,ROLL_RATE,PITCH_RATE,YAW_RATE, ... )</line>
- </doc>
- </arg>
- </signal>
-
- <method name="GetAccuracy">
- <doc>
- <line>GetAccuracy = This method returns the accuracy</line>
- </doc>
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapUShortVariant"/>
- <arg name="accuracy" type="a{qv}" direction="out">
- <doc>
- <line>accuracy = dictionary[key,value]</line>
- <line>dictionary = array of tuples (key,value)</line>
- <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>
- <line>key = enum(INVALID,TIMESTAMP,PDOP,HDOP,VDOP,SIGMA_LATITUDE,SIGMA_LONGITUDE,SIGMA_ALTITUDE,SIGMA_HEADING,... )</line>
- <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>
- <line>key = PDOP, value = value of type 'd', that represents the positional (3D) dilution of precision</line>
- <line>key = HDOP, value = value of type 'd', that represents the horizontal (2D) dilution of precision</line>
- <line>key = VDOP, value = value of type 'd', that represents vertical (altitude) dilution of precision</line>
- <line>key = SIGMA_LATITUDE, value = value of type 'd', that represents the standard deviation for latitude in m</line>
- <line>key = SIGMA_LONGITUDE, value = value of type 'd', that represents the standard deviation for longitude in m</line>
- <line>key = SIGMA_ALTITUDE, value = value of type 'd', that represents the standard deviation for altitude in m</line>
- <line>key = SIGMA_HEADING, value = value of type 'd', that represents the standard deviation for altitude in degrees</line>
- </doc>
- </arg>
- </method>
-
- <signal name="AccuracyUpdate">
- <doc>
- <line>AccuracyUpdated = This signal is emitted when the accuracy changes</line>
- </doc>
- <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QList&lt;ushort&gt;"/>
- <arg name="changedValues" type="aq" direction="out">
- <doc>
- <line>changedValues = array[value]</line>
- <line>value = enum(INVALID,TIMESTAMP,PDOP,HDOP,VDOP,SIGMA_LATITUDE,SIGMA_LONGITUDE,SIGMA_ALTITUDE,SIGMA_HEADING, ... )</line>
- </doc>
- </arg>
- </signal>
-
- <method name="GetSatelliteInfo">
- <doc>
- <line>GetSatelliteInfo = This method returns information about the current satellite constellation</line>
- </doc>
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapUShortVariant"/>
- <arg name="satelliteInfo" type="a{qv}" direction="out">
- <doc>
- <line>satelliteInfo = dictionary[key,value]</line>
- <line>dictionary = array of tuples (key,value)</line>
- <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>
- <line>key = enum(INVALID,TIMESTAMP,USED_SATELLITES,TRACKED_SATELLITES,VISIBLE_SATELLITES,SATELLITE_DETAILS, ...)</line>
- <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>
- <line>key = USED_SATELLITES, value = value of type 'y', that represents the number of used satellites</line>
- <line>key = TRACKED_SATELLITES, value = value of type 'y', that represents the number of tracked satellites</line>
- <line>key = VISIBLE_SATELLITES, value = value of type 'y', that represents the number of visible satellites</line>
- <line>key = SATELLITE_DETAILS, value = value of type 'a(ubuuu)', that represents an array(struct(satId,inUse,elevation,azimuth,snr).
- The satID numbering scheme shall be as defined by NMEA-0183 (v3.01 or later) for the GSV sentence:
- 1..32: GPS satellites (by PRN), 33..64: SBAS/WAAS satellites, 65..96: Glonass satellites
- Note: Later NMEA-0183 versions probably already have Galileo support
- </line>
- </doc>
- </arg>
- </method>
-
- <signal name="SatelliteInfoUpdate">
- <doc>
- <line>SatelliteInfoUpdate = This signal is emitted when information about the current satellite information is updated</line>
- </doc>
- <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QList&lt;ushort&gt;"/>
- <arg name="changedValues" type="aq">
- <doc>
- <line>changedValues = array[value]</line>
- <line>key = enum(INVALID,TIMESTAMP,USED_SATELLITES,TRACKED_SATELLITES,VISIBLE_SATELLITES,SATELLITE_DETAILS, ...)</line>
- </doc>
- </arg>
- </signal>
-
- <method name="GetStatus">
- <doc>
- <line>GetStatus = This method returns the status of this service</line>
- </doc>
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapUShortVariant"/>
- <arg name="status" type="a{qv}" direction="out">
- <doc>
- <line>status = dictionary[key,value]</line>
- <line>dictionary = array of tuples (key,value)</line>
- <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>
- <line>key = enum(INVALID,TIMESTAMP,GNSS_FIX_STATUS,DR_STATUS, ... )</line>
- <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>
- <line>key = GNSS_FIX_STATUS, value = value of type 'q', that represents an enum(INVALID(0x00),NO_FIX(0x01),TIME_FIX(0x02),2D_FIX(0x03),3D_FIX(0x04), ... )</line>
- <line>key = DR_STATUS, value = value of type 'b', where TRUE means that a dead-reckoning algorithm has been used to calculate the current position</line>
- </doc>
- </arg>
- </method>
-
- <signal name="StatusUpdate">
- <doc>
- <line>StatusUpdate = This signal is emitted when the status of this service changes</line>
- </doc>
- <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QList&lt;ushort&gt;"/>
- <arg name="changedValues" type="aq">
- <doc>
- <line>changedValues = array[value]</line>
- <line>key = enum(INVALID,TIMESTAMP,GNSS_FIX_STATUS,DR_STATUS, ... )</line>
- </doc>
- </arg>
- </signal>
-
- <method name="GetTime">
- <doc>
- <line>GetTime = This method returns UTC time and date</line>
- </doc>
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapUShortVariant"/>
- <arg name="time" type="a{qv}" direction="out">
- <doc>
- <line>time = dictionary[key,value]</line>
- <line>dictionary = array of tuples (key,value)</line>
- <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>
- <line>key = enum(INVALID,TIMESTAMP,YEAR,MONTH,DAY,HOUR,MINUTE,SECOND,MS, ... )</line>
- <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>
- <line>key = YEAR, value = value of type 'q', 4 digits number that indicates the year. Example: 2012</line>
- <line>key = MONTH, value = value of type 'y', 2 digits number that indicates the month. Example: 03 means March</line>
- <line>key = DAY, value = value of type 'y', 2 digits number that indicates the day. Range [0:31]. Example: 07</line>
- <line>key = HOUR, value = value of type 'y', 2 digits number that indicates the hour. Range [0:23]. Example: 01</line>
- <line>key = MINUTE, value = value of type 'y', 2 digits number that represents the minutes. Range [0:59]. Example: 01</line>
- <line>key = SECOND, value = value of type 'y', 2 digits number that represents the seconds. Range [0:59]. Example: 01</line>
- <line>key = MS, value = value of type 'q', 3 digits number that represents the milliseconds. Range [0:999]. Example: 007</line>
- </doc>
- </arg>
- </method>
-
- </interface>
-
-</node>
diff --git a/enhanced-position-service/scripts/run-test.py b/enhanced-position-service/scripts/run-test.py
deleted file mode 100755
index 9226ca0..0000000
--- a/enhanced-position-service/scripts/run-test.py
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/python
-#
-# call from your build directory (e.g. build, Debug, ...)
-#
-# vim: set noexpandtab sw=4 ts=4:
-#
-#-----------------------------------------------------------------------
-# If you have no active dbus session you have to call with dbus-launch
-#
-# $ dbus-launch --exit-with-session ../run-test.py
-#
-#-----------------------------------------------------------------------
-
-
-import time
-import sys
-from StartHelperGeneric import StartHelperGeneric
-
-#-----------------------------------------------------------------------------
-# main
-#-----------------------------------------------------------------------------
-def main():
- duration = 3.0
- print "starting test script: test %i seconds...\n" % duration
-
- # starten server by helper
- server = StartHelperGeneric(["enhanced-position-service/src/position-daemon"], "server")
- server.setEnv("REPLAYER_LOG_FILE",
- "../replayer/logs/testlog.gvsl")
- client = StartHelperGeneric(["enhanced-position-service/test/test-enhpos"], "test-client")
-
- server.start()
-
- time.sleep(2)
- client.start()
-
- time.sleep(duration)
-
- # expect them to be terminated by SIGINT --> -2
- status = 0
- rc = 0
- rc = client.stop()
- if rc != -2:
- status += 1
-
- rc = server.stop()
- if rc != -2:
- status += 1
-
- print "exit code: %d" % status
- sys.exit(status)
-
-if __name__ == "__main__":
- main()
-
diff --git a/enhanced-position-service/scripts/server/confifadaptor.cpp b/enhanced-position-service/scripts/server/confifadaptor.cpp
deleted file mode 100644
index e2ced5c..0000000
--- a/enhanced-position-service/scripts/server/confifadaptor.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c ConfigurationIfAdaptor -a confifadaptor.h:confifadaptor.cpp -i genivi-dbus-types.h -i ConfigurationImpl.h -l ConfigurationImpl ../genivi-positioning-configuration-qt.xml org.genivi.positioning.Configuration
- *
- * qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#include "confifadaptor.h"
-#include <QtCore/QMetaObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-
-/*
- * Implementation of adaptor class ConfigurationIfAdaptor
- */
-
-ConfigurationIfAdaptor::ConfigurationIfAdaptor(ConfigurationImpl *parent)
- : QDBusAbstractAdaptor(parent)
-{
- // constructor
- setAutoRelaySignals(true);
-}
-
-ConfigurationIfAdaptor::~ConfigurationIfAdaptor()
-{
- // destructor
-}
-
-ushort ConfigurationIfAdaptor::satelliteSystem() const
-{
- // get the value of property SatelliteSystem
- return qvariant_cast< ushort >(parent()->property("SatelliteSystem"));
-}
-
-void ConfigurationIfAdaptor::setSatelliteSystem(ushort value)
-{
- // set the value of property SatelliteSystem
- parent()->setProperty("SatelliteSystem", QVariant::fromValue(value));
-}
-
-int ConfigurationIfAdaptor::updateInterval() const
-{
- // get the value of property UpdateInterval
- return qvariant_cast< int >(parent()->property("UpdateInterval"));
-}
-
-void ConfigurationIfAdaptor::setUpdateInterval(int value)
-{
- // set the value of property UpdateInterval
- parent()->setProperty("UpdateInterval", QVariant::fromValue(value));
-}
-
-QVariantMap ConfigurationIfAdaptor::GetProperties()
-{
- // handle method call org.genivi.positioning.Configuration.GetProperties
- return parent()->GetProperties();
-}
-
-MapUShortVariant ConfigurationIfAdaptor::GetSupportedProperties()
-{
- // handle method call org.genivi.positioning.Configuration.GetSupportedProperties
- return parent()->GetSupportedProperties();
-}
-
-GeniviVersion ConfigurationIfAdaptor::GetVersion()
-{
- // handle method call org.genivi.positioning.Configuration.GetVersion
- return parent()->GetVersion();
-}
-
-void ConfigurationIfAdaptor::SetProperty(const QString &name, const QDBusVariant &value)
-{
- // handle method call org.genivi.positioning.Configuration.SetProperty
- parent()->SetProperty(name, value);
-}
-
diff --git a/enhanced-position-service/scripts/server/confifadaptor.h b/enhanced-position-service/scripts/server/confifadaptor.h
deleted file mode 100644
index 1d56780..0000000
--- a/enhanced-position-service/scripts/server/confifadaptor.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c ConfigurationIfAdaptor -a confifadaptor.h:confifadaptor.cpp -i genivi-dbus-types.h -i ConfigurationImpl.h -l ConfigurationImpl ../genivi-positioning-configuration-qt.xml org.genivi.positioning.Configuration
- *
- * qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#ifndef CONFIFADAPTOR_H_1381241789
-#define CONFIFADAPTOR_H_1381241789
-
-#include <QtCore/QObject>
-#include <QtDBus/QtDBus>
-#include "genivi-dbus-types.h"
-#include "ConfigurationImpl.h"
-class QByteArray;
-template<class T> class QList;
-template<class Key, class Value> class QMap;
-class QString;
-class QStringList;
-class QVariant;
-
-/*
- * Adaptor class for interface org.genivi.positioning.Configuration
- */
-class ConfigurationIfAdaptor: public QDBusAbstractAdaptor
-{
- Q_OBJECT
- Q_CLASSINFO("D-Bus Interface", "org.genivi.positioning.Configuration")
- Q_CLASSINFO("D-Bus Introspection", ""
-" <interface name=\"org.genivi.positioning.Configuration\">\n"
-" <version>2.0.0 (04-06-2013)</version>\n"
-" <doc>\n"
-" <line>Configuration = This interface allows a client application to set and retrieve configuration options</line>\n"
-" </doc>\n"
-" <method name=\"GetVersion\">\n"
-" <doc>\n"
-" <line>GetVersion = This method returns the API version implemented by the server application.</line>\n"
-" </doc>\n"
-" <annotation value=\"GeniviVersion\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"(qqqs)\" name=\"version\">\n"
-" <doc>\n"
-" <line>version = struct(major,minor,micro,date)</line>\n"
-" <line>major = when the major changes, then backward compatibility with previous releases is not granted</line>\n"
-" <line>minor = when the minor changes, then backward compatibility with previous releases is granted, but something changed in the implementation of the API (e.g. new methods may have been added)</line>\n"
-" <line>micro = when the micro changes, then backward compatibility with previous releases is granted (bug fixes or documentation modifications)</line>\n"
-" <line>date = release date (e.g. 21-06-2011)</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <method name=\"GetProperties\">\n"
-" <doc>\n"
-" <line>GetProperties = This method returns all global system properties.</line>\n"
-" </doc>\n"
-" <annotation value=\"QVariantMap\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{sv}\" name=\"properties\"/>\n"
-" </method>\n"
-" <method name=\"SetProperty\">\n"
-" <doc>\n"
-" <line>SetProperty = This method changes the value of the specified property</line>\n"
-" <line>Only properties that are listed as read-write are changeable</line>\n"
-" <line>On success a PropertyChanged signal will be emitted</line>\n"
-" </doc>\n"
-" <arg direction=\"in\" type=\"s\" name=\"name\">\n"
-" <doc>\n"
-" <line>name = property name</line>\n"
-" </doc>\n"
-" </arg>\n"
-" <arg direction=\"in\" type=\"v\" name=\"value\">\n"
-" <doc>\n"
-" <line>value = property value</line>\n"
-" </doc>\n"
-" </arg>\n"
-" <error name=\"org.genivi.positioning.Configuration.Error.InvalidProperty\"/>\n"
-" </method>\n"
-" <signal name=\"PropertyChanged\">\n"
-" <doc>\n"
-" <line>PropertyChanged = This signal is emitted when a property changes</line>\n"
-" </doc>\n"
-" <arg type=\"s\" name=\"name\">\n"
-" <doc>\n"
-" <line>name = property name</line>\n"
-" </doc>\n"
-" </arg>\n"
-" <arg type=\"v\" name=\"value\">\n"
-" <doc>\n"
-" <line>value = property value</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </signal>\n"
-" <property access=\"readwrite\" type=\"q\" name=\"SatelliteSystem\">\n"
-" <doc>\n"
-" <line>SatelliteSystem = enum(INVALID,GPS,GLONASS,GALILEO,COMPASS, ... )</line>\n"
-" </doc>\n"
-" </property>\n"
-" <property access=\"readwrite\" type=\"i\" name=\"UpdateInterval\">\n"
-" <doc>\n"
-" <line>UpdateInterval = update interval in ms</line>\n"
-" </doc>\n"
-" </property>\n"
-" <method name=\"GetSupportedProperties\">\n"
-" <doc>\n"
-" <line>GetSupportedProperties = This method returns all suppported global system properties</line>\n"
-" </doc>\n"
-" <annotation value=\"MapUShortVariant\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{sv}\" name=\"properties\">\n"
-" <doc>\n"
-" <line>properties = array[property]</line>\n"
-" <line>property = dictionary[key,value]</line>\n"
-" <line>key = enum(SatelliteSystem,UpdateInterval, ... )</line>\n"
-" <line>key = SatelliteSystem, value = value of type 'aq'; 'q' is an enum(INVALID,GPS,GLONASS,GALILEO,COMPASS, ...)</line>\n"
-" <line>key = UpdateInterval, value = value of type 'ai'; 'i' is the update interval in ms</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" </interface>\n"
- "")
-public:
- ConfigurationIfAdaptor(ConfigurationImpl *parent);
- virtual ~ConfigurationIfAdaptor();
-
- inline ConfigurationImpl *parent() const
- { return static_cast<ConfigurationImpl *>(QObject::parent()); }
-
-public: // PROPERTIES
- Q_PROPERTY(ushort SatelliteSystem READ satelliteSystem WRITE setSatelliteSystem)
- ushort satelliteSystem() const;
- void setSatelliteSystem(ushort value);
-
- Q_PROPERTY(int UpdateInterval READ updateInterval WRITE setUpdateInterval)
- int updateInterval() const;
- void setUpdateInterval(int value);
-
-public Q_SLOTS: // METHODS
- QVariantMap GetProperties();
- MapUShortVariant GetSupportedProperties();
- GeniviVersion GetVersion();
- void SetProperty(const QString &name, const QDBusVariant &value);
-Q_SIGNALS: // SIGNALS
- void PropertyChanged(const QString &name, const QDBusVariant &value);
-};
-
-#endif
diff --git a/enhanced-position-service/scripts/server/demoifadaptor.cpp b/enhanced-position-service/scripts/server/demoifadaptor.cpp
deleted file mode 100644
index 4e87093..0000000
--- a/enhanced-position-service/scripts/server/demoifadaptor.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c DemoIfAdaptor -a demoifadaptor.h:demoifadaptor.cpp -i genivi-dbus-types.h -i serverimpl.h -l ServerImpl ../genivi-positioning-enhancedposition-qt.xml org.genivi.positioning.EnhancedPosition
- *
- * qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#include "demoifadaptor.h"
-#include <QtCore/QMetaObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-
-/*
- * Implementation of adaptor class DemoIfAdaptor
- */
-
-DemoIfAdaptor::DemoIfAdaptor(ServerImpl *parent)
- : QDBusAbstractAdaptor(parent)
-{
- // constructor
- setAutoRelaySignals(true);
-}
-
-DemoIfAdaptor::~DemoIfAdaptor()
-{
- // destructor
-}
-
-MapUShortVariant DemoIfAdaptor::GetAccuracy()
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetAccuracy
- return parent()->GetAccuracy();
-}
-
-MapUShortVariant DemoIfAdaptor::GetData(const QList<ushort> &valuesToReturn)
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetData
- return parent()->GetData(valuesToReturn);
-}
-
-MapUShortVariant DemoIfAdaptor::GetPosition()
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetPosition
- return parent()->GetPosition();
-}
-
-<type> DemoIfAdaptor::GetRotationRate()
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetRotationRate
- return parent()->GetRotationRate();
-}
-
-MapUShortVariant DemoIfAdaptor::GetSatelliteInfo()
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetSatelliteInfo
- return parent()->GetSatelliteInfo();
-}
-
-MapUShortVariant DemoIfAdaptor::GetStatus()
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetStatus
- return parent()->GetStatus();
-}
-
-MapUShortVariant DemoIfAdaptor::GetTime()
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetTime
- return parent()->GetTime();
-}
-
-GeniviVersion DemoIfAdaptor::GetVersion()
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetVersion
- return parent()->GetVersion();
-}
-
diff --git a/enhanced-position-service/scripts/server/demoifadaptor.h b/enhanced-position-service/scripts/server/demoifadaptor.h
deleted file mode 100644
index 2f3ac12..0000000
--- a/enhanced-position-service/scripts/server/demoifadaptor.h
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c DemoIfAdaptor -a demoifadaptor.h:demoifadaptor.cpp -i genivi-dbus-types.h -i serverimpl.h -l ServerImpl ../genivi-positioning-enhancedposition-qt.xml org.genivi.positioning.EnhancedPosition
- *
- * qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#ifndef DEMOIFADAPTOR_H_1381241613
-#define DEMOIFADAPTOR_H_1381241613
-
-#include <QtCore/QObject>
-#include <QtDBus/QtDBus>
-#include "genivi-dbus-types.h"
-#include "serverimpl.h"
-class QByteArray;
-template<class T> class QList;
-template<class Key, class Value> class QMap;
-class QString;
-class QStringList;
-class QVariant;
-
-/*
- * Adaptor class for interface org.genivi.positioning.EnhancedPosition
- */
-class DemoIfAdaptor: public QDBusAbstractAdaptor
-{
- Q_OBJECT
- Q_CLASSINFO("D-Bus Interface", "org.genivi.positioning.EnhancedPosition")
- Q_CLASSINFO("D-Bus Introspection", ""
-" <interface name=\"org.genivi.positioning.EnhancedPosition\">\n"
-" <version>2.0.0 (04-06-2013)</version>\n"
-" <doc>\n"
-" <line>EnhancedPosition = This interface offers functionalities to retrieve the enhanced position of the vehicle</line>\n"
-" </doc>\n"
-" <method name=\"GetVersion\">\n"
-" <doc>\n"
-" <line>GetVersion = This method returns the API version implemented by the server application</line>\n"
-" </doc>\n"
-" <annotation value=\"GeniviVersion\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"(qqqs)\" name=\"version\">\n"
-" <doc>\n"
-" <line>version = struct(major,minor,micro,date)</line>\n"
-" <line>major = when the major changes, then backward compatibility with previous releases is not granted</line>\n"
-" <line>minor = when the minor changes, then backward compatibility with previous releases is granted, but something changed in the implementation of the API (e.g. new methods may have been added)</line>\n"
-" <line>micro = when the micro changes, then backward compatibility with previous releases is granted (bug fixes or documentation modifications)</line>\n"
-" <line>date = release date (e.g. 21-06-2011)</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <method name=\"GetData\">\n"
-" <doc>\n"
-" <line>GetData = This method returns a given set of positioning data (e.g. Position, Course, Accuracy, Status, ... )</line>\n"
-" </doc>\n"
-" <annotation value=\"QList&lt;ushort>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <arg direction=\"in\" type=\"aq\" name=\"valuesToReturn\">\n"
-" <doc>\n"
-" <line>valuesToReturn= array[fieldType]</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,ROLL_RATE,PITCH_RATE,YAW_RATE,...,ALL)</line>\n"
-" </doc>\n"
-" </arg>\n"
-" <annotation value=\"MapUShortVariant\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{qv}\" name=\"data\">\n"
-" <doc>\n"
-" <line>position = dictionary[key,value]</line>\n"
-" <line>dictionary = array of tuples (key,value)</line>\n"
-" <line>Invalid data is not be returned to the client application</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,ROLL_RATE,PITCH_RATE,YAW_RATE,PDOP,HDOP,VDOP,SIGMA_LATITUDE,SIGMA_LONGITUDE,SIGMA_ALTITUDE,SIGMA_HEADING,... ,ALL</line>\n"
-" <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>\n"
-" <line>key = LATITUDE, value = value of type 'd', that expresses the latitude of the current position. Range [-90:+90]. Example: 48.053250</line>\n"
-" <line>key = LONGITUDE, value = value of type 'd', that expresses the longitude of the current position. Range [-180:+180]. Example: 8.324500</line>\n"
-" <line>key = ALTITUDE, value = value of type 'i', that expresses the altitude above the sea level of the current position in meters</line>\n"
-" <line>key = HEADING, value = value of type 'i', that expresses the course angle in degree. Range [0:360]. 0 = north, 90 = east, 180 = south, 270 = west</line>\n"
-" <line>key = SPEED, value = value of type 'd', that expresses speed measured in m/s. A negative value indicates that the vehicle is moving backwards</line>\n"
-" <line>key = CLIMB, value = value of type 'i', that expresses the road gradient in degrees</line>\n"
-" <line>key = ROLL_RATE, value = value of type 'i', rotation rate around the X-axis in degrees/s. Range [-100:+100]</line>\n"
-" <line>key = PITCH_RATE, value = value of type 'i', rotation rate around the Y-axis in degrees/s. Range [-100:+100]</line>\n"
-" <line>key = YAW_RATE, value = value of type 'i', rotation rate around the Z-axis in degrees/s. Range [-100:+100]</line>\n"
-" <line>key = PDOP, value = value of type 'd', that represents the positional (3D) dilution of precision</line>\n"
-" <line>key = HDOP, value = value of type 'd', that represents the horizontal (2D) dilution of precision</line>\n"
-" <line>key = VDOP, value = value of type 'd', that represents vertical (altitude) dilution of precision</line>\n"
-" <line>key = SIGMA_LATITUDE, value = value of type 'd', that represents the standard deviation for latitude in m</line>\n"
-" <line>key = SIGMA_LONGITUDE, value = value of type 'd', that represents the standard deviation for longitude in m</line>\n"
-" <line>key = SIGMA_ALTITUDE, value = value of type 'd', that represents the standard deviation for altitude in m</line>\n"
-" <line>key = SIGMA_HEADING, value = value of type 'd', that represents the standard deviation for altitude in degrees</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <method name=\"GetPosition\">\n"
-" <doc>\n"
-" <line>GetPosition = This method returns the current position</line>\n"
-" </doc>\n"
-" <annotation value=\"MapUShortVariant\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{qv}\" name=\"position\">\n"
-" <doc>\n"
-" <line>position = dictionary[key,value]</line>\n"
-" <line>dictionary = array of tuples (key,value)</line>\n"
-" <line>Invalid data is not be returned to the client application</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,...)</line>\n"
-" <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>\n"
-" <line>key = LATITUDE, value = value of type 'd', that expresses the latitude of the current position. Range [-90:+90]. Example: 48.053250</line>\n"
-" <line>key = LONGITUDE, value = value of type 'd', that expresses the longitude of the current position. Range [-180:+180]. Example: 8.324500</line>\n"
-" <line>key = ALTITUDE, value = value of type 'i', that expresses the altitude above the sea level of the current position in meters</line>\n"
-" <line>key = HEADING, value = value of type 'i', that expresses the course angle in degree. Range [0:360]. 0 = north, 90 = east, 180 = south, 270 = west</line>\n"
-" <line>key = SPEED, value = value of type 'd', that expresses speed measured in m/s. A negative value indicates that the vehicle is moving backwards</line>\n"
-" <line>key = CLIMB, value = value of type 'i', that expresses the road gradient in degrees</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <signal name=\"PositionUpdate\">\n"
-" <doc>\n"
-" <line>PositionUpdate = This signal is called to notifiy a client application of a position change. The update frequency is implementation specific. The maximal allowed frequency is 10Hz</line>\n"
-" </doc>\n"
-" <annotation value=\"QList&lt;ushort>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <arg type=\"aq\" name=\"changedValues\">\n"
-" <doc>\n"
-" <line>changedValues = array[value]</line>\n"
-" <line>value = enum(INVALID,TIMESTAMP,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,... )</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </signal>\n"
-" <method name=\"GetRotationRate\">\n"
-" <doc>\n"
-" <line>GetRotationRate = This method returns the rotation rate</line>\n"
-" </doc>\n"
-" <annotation value=\"&lt;type>\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{qv}\" name=\"rotationRate\">\n"
-" <doc>\n"
-" <line>rotationRates = dictionary[key,value]</line>\n"
-" <line>dictionary = array of tuples (key,value)</line>\n"
-" <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,ROLL_RATE,PITCH_RATE,YAW_RATE, ... )</line>\n"
-" <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>\n"
-" <line>key = ROLL_RATE, value = rotation rate around the X-axis in degrees/s. Range [-100:+100]</line>\n"
-" <line>key = PITCH_RATE, value = rotation rate around the Y-axis in degrees/s. Range [-100:+100]</line>\n"
-" <line>key = YAW_RATE, value = rotation rate around the Z-axis in degrees/s. Range [-100:+100]</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <signal name=\"RotationRateUpdate\">\n"
-" <doc>\n"
-" <line>RotationRateUpdated = This signal is emitted when the rotation rate changes</line>\n"
-" </doc>\n"
-" <annotation value=\"QList&lt;ushort>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <arg type=\"aq\" name=\"changedValues\">\n"
-" <doc>\n"
-" <line>changedValues = array[key]</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,ROLL_RATE,PITCH_RATE,YAW_RATE, ... )</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </signal>\n"
-" <method name=\"GetAccuracy\">\n"
-" <doc>\n"
-" <line>GetAccuracy = This method returns the accuracy</line>\n"
-" </doc>\n"
-" <annotation value=\"MapUShortVariant\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{qv}\" name=\"accuracy\">\n"
-" <doc>\n"
-" <line>accuracy = dictionary[key,value]</line>\n"
-" <line>dictionary = array of tuples (key,value)</line>\n"
-" <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,PDOP,HDOP,VDOP,SIGMA_LATITUDE,SIGMA_LONGITUDE,SIGMA_ALTITUDE,SIGMA_HEADING,... )</line>\n"
-" <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>\n"
-" <line>key = PDOP, value = value of type 'd', that represents the positional (3D) dilution of precision</line>\n"
-" <line>key = HDOP, value = value of type 'd', that represents the horizontal (2D) dilution of precision</line>\n"
-" <line>key = VDOP, value = value of type 'd', that represents vertical (altitude) dilution of precision</line>\n"
-" <line>key = SIGMA_LATITUDE, value = value of type 'd', that represents the standard deviation for latitude in m</line>\n"
-" <line>key = SIGMA_LONGITUDE, value = value of type 'd', that represents the standard deviation for longitude in m</line>\n"
-" <line>key = SIGMA_ALTITUDE, value = value of type 'd', that represents the standard deviation for altitude in m</line>\n"
-" <line>key = SIGMA_HEADING, value = value of type 'd', that represents the standard deviation for altitude in degrees</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <signal name=\"AccuracyUpdate\">\n"
-" <doc>\n"
-" <line>AccuracyUpdated = This signal is emitted when the accuracy changes</line>\n"
-" </doc>\n"
-" <annotation value=\"QList&lt;ushort>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <arg direction=\"out\" type=\"aq\" name=\"changedValues\">\n"
-" <doc>\n"
-" <line>changedValues = array[value]</line>\n"
-" <line>value = enum(INVALID,TIMESTAMP,PDOP,HDOP,VDOP,SIGMA_LATITUDE,SIGMA_LONGITUDE,SIGMA_ALTITUDE,SIGMA_HEADING, ... )</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </signal>\n"
-" <method name=\"GetSatelliteInfo\">\n"
-" <doc>\n"
-" <line>GetSatelliteInfo = This method returns information about the current satellite constellation</line>\n"
-" </doc>\n"
-" <annotation value=\"MapUShortVariant\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{qv}\" name=\"satelliteInfo\">\n"
-" <doc>\n"
-" <line>satelliteInfo = dictionary[key,value]</line>\n"
-" <line>dictionary = array of tuples (key,value)</line>\n"
-" <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,USED_SATELLITES,TRACKED_SATELLITES,VISIBLE_SATELLITES,SATELLITE_DETAILS, ...)</line>\n"
-" <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>\n"
-" <line>key = USED_SATELLITES, value = value of type 'y', that represents the number of used satellites</line>\n"
-" <line>key = TRACKED_SATELLITES, value = value of type 'y', that represents the number of tracked satellites</line>\n"
-" <line>key = VISIBLE_SATELLITES, value = value of type 'y', that represents the number of visible satellites</line>\n"
-" <line>key = SATELLITE_DETAILS, value = value of type 'a(ubuuu)', that represents an array(struct(satId,inUse,elevation,azimuth,snr).\n"
-" The satID numbering scheme shall be as defined by NMEA-0183 (v3.01 or later) for the GSV sentence:\n"
-" 1..32: GPS satellites (by PRN), 33..64: SBAS/WAAS satellites, 65..96: Glonass satellites\n"
-" Note: Later NMEA-0183 versions probably already have Galileo support\n"
-" </line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <signal name=\"SatelliteInfoUpdate\">\n"
-" <doc>\n"
-" <line>SatelliteInfoUpdate = This signal is emitted when information about the current satellite information is updated</line>\n"
-" </doc>\n"
-" <annotation value=\"QList&lt;ushort>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <arg type=\"aq\" name=\"changedValues\">\n"
-" <doc>\n"
-" <line>changedValues = array[value]</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,USED_SATELLITES,TRACKED_SATELLITES,VISIBLE_SATELLITES,SATELLITE_DETAILS, ...)</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </signal>\n"
-" <method name=\"GetStatus\">\n"
-" <doc>\n"
-" <line>GetStatus = This method returns the status of this service</line>\n"
-" </doc>\n"
-" <annotation value=\"MapUShortVariant\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{qv}\" name=\"status\">\n"
-" <doc>\n"
-" <line>status = dictionary[key,value]</line>\n"
-" <line>dictionary = array of tuples (key,value)</line>\n"
-" <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,GNSS_FIX_STATUS,DR_STATUS, ... )</line>\n"
-" <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>\n"
-" <line>key = GNSS_FIX_STATUS, value = value of type 'q', that represents an enum(INVALID(0x00),NO_FIX(0x01),TIME_FIX(0x02),2D_FIX(0x03),3D_FIX(0x04), ... )</line>\n"
-" <line>key = DR_STATUS, value = value of type 'b', where TRUE means that a dead-reckoning algorithm has been used to calculate the current position</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <signal name=\"StatusUpdate\">\n"
-" <doc>\n"
-" <line>StatusUpdate = This signal is emitted when the status of this service changes</line>\n"
-" </doc>\n"
-" <annotation value=\"QList&lt;ushort>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <arg type=\"aq\" name=\"changedValues\">\n"
-" <doc>\n"
-" <line>changedValues = array[value]</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,GNSS_FIX_STATUS,DR_STATUS, ... )</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </signal>\n"
-" <method name=\"GetTime\">\n"
-" <doc>\n"
-" <line>GetTime = This method returns UTC time and date</line>\n"
-" </doc>\n"
-" <annotation value=\"MapUShortVariant\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{qv}\" name=\"time\">\n"
-" <doc>\n"
-" <line>time = dictionary[key,value]</line>\n"
-" <line>dictionary = array of tuples (key,value)</line>\n"
-" <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,YEAR,MONTH,DAY,HOUR,MINUTE,SECOND,MS, ... )</line>\n"
-" <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>\n"
-" <line>key = YEAR, value = value of type 'q', 4 digits number that indicates the year. Example: 2012</line>\n"
-" <line>key = MONTH, value = value of type 'y', 2 digits number that indicates the month. Example: 03 means March</line>\n"
-" <line>key = DAY, value = value of type 'y', 2 digits number that indicates the day. Range [0:31]. Example: 07</line>\n"
-" <line>key = HOUR, value = value of type 'y', 2 digits number that indicates the hour. Range [0:23]. Example: 01</line>\n"
-" <line>key = MINUTE, value = value of type 'y', 2 digits number that represents the minutes. Range [0:59]. Example: 01</line>\n"
-" <line>key = SECOND, value = value of type 'y', 2 digits number that represents the seconds. Range [0:59]. Example: 01</line>\n"
-" <line>key = MS, value = value of type 'q', 3 digits number that represents the milliseconds. Range [0:999]. Example: 007</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" </interface>\n"
- "")
-public:
- DemoIfAdaptor(ServerImpl *parent);
- virtual ~DemoIfAdaptor();
-
- inline ServerImpl *parent() const
- { return static_cast<ServerImpl *>(QObject::parent()); }
-
-public: // PROPERTIES
-public Q_SLOTS: // METHODS
- MapUShortVariant GetAccuracy();
- MapUShortVariant GetData(const QList<ushort> &valuesToReturn);
- MapUShortVariant GetPosition();
- <type> GetRotationRate();
- MapUShortVariant GetSatelliteInfo();
- MapUShortVariant GetStatus();
- MapUShortVariant GetTime();
- GeniviVersion GetVersion();
-Q_SIGNALS: // SIGNALS
- void AccuracyUpdate(const QList<ushort> &changedValues);
- void PositionUpdate(const QList<ushort> &changedValues);
- void RotationRateUpdate(const QList<ushort> &changedValues);
- void SatelliteInfoUpdate(const QList<ushort> &changedValues);
- void StatusUpdate(const QList<ushort> &changedValues);
-};
-
-#endif
diff --git a/enhanced-position-service/scripts/strip-annotations.sh b/enhanced-position-service/scripts/strip-annotations.sh
deleted file mode 100755
index bc702be..0000000
--- a/enhanced-position-service/scripts/strip-annotations.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-in_file=genivi-positioning-enhancedposition-qt.xml
-out_file=../api/genivi-positioning-enhancedposition.xml
-
-# use all lines but the <annotation .../> tags.
-grep -v "annotation" $in_file > $out_file
-
diff --git a/enhanced-position-service/src/.gitignore b/enhanced-position-service/src/.gitignore
deleted file mode 100644
index a15fd39..0000000
--- a/enhanced-position-service/src/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Debug
-*.cxx
diff --git a/enhanced-position-service/src/CMakeLists.txt b/enhanced-position-service/src/CMakeLists.txt
index 8e8359c..34ea850 100644
--- a/enhanced-position-service/src/CMakeLists.txt
+++ b/enhanced-position-service/src/CMakeLists.txt
@@ -4,43 +4,20 @@
#
# Component Name: EnhancedPositionService
#
-# Author: Thomas Bader, Marco Residori
+# Author: Marco Residori
#
-# Copyright (C) 2012, BMW Car IT GmbH, XS Embedded GmbH
+# Copyright (C) 2014, XS Embedded GmbH
#
# License:
# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-# List of changes:
-#
-# 15/6/2014, Philippe Colliot, migrate to Qt5
-#
# @licence end@
###########################################################################
-cmake_minimum_required(VERSION 2.8.11)
-
-project(position-daemon)
-
-# Find includes in corresponding build directories
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-# Instruct CMake to run moc automatically when needed.
-set(CMAKE_AUTOMOC ON)
-
-# Manage packages
-find_package(PkgConfig)
-
-# Set Qt stuff
-find_package(Qt5Core)
-find_package(Qt5DBus)
-get_target_property(QtCore_location Qt5::Core LOCATION)
-get_target_property(QtDBus_location Qt5::DBus LOCATION)
-include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5DBus_INCLUDE_DIRS})
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5DBus_EXECUTABLE_COMPILE_FLAGS}")
+project(enhanced-position-service)
+cmake_minimum_required(VERSION 2.6.0)
message(STATUS "ENHANCED-POSITION-SERVICE")
message(STATUS "WITH_DLT = ${WITH_DLT}")
@@ -48,11 +25,51 @@ message(STATUS "WITH_GPSD = ${WITH_GPSD}")
message(STATUS "WITH_REPLAYER = ${WITH_REPLAYER}")
message(STATUS "WITH_TESTS = ${WITH_TESTS}")
-include_directories("${PROJECT_SOURCE_DIR}/../../common")
+find_package(PkgConfig REQUIRED)
+
+pkg_check_modules(DBUS_CPP dbus-c++-1)
+
+include_directories("${PROJECT_SOURCE_DIR}/../api")
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${DBUS_CPP_INCLUDE_DIRS})
+include_directories(${gnss-service_INCLUDE_DIRS})
+include_directories(${sensors-service_INCLUDE_DIRS})
+
+# Generate the client glue code before building the client
+add_custom_command(
+ OUTPUT enhanced-position-adaptor.h
+ COMMAND dbusxx-xml2cpp ${CMAKE_CURRENT_SOURCE_DIR}/../api/genivi-positioning-enhancedposition.xml
+ --adaptor=enhanced-position-adaptor.h
+ OUTPUT position-feedback-adaptor.h
+ COMMAND dbusxx-xml2cpp ${CMAKE_CURRENT_SOURCE_DIR}/../api/genivi-positioning-positionfeedback.xml
+ --adaptor=position-feedback-adaptor.h
+ OUTPUT configuration-adaptor.h
+ COMMAND dbusxx-xml2cpp ${CMAKE_CURRENT_SOURCE_DIR}/../api/genivi-positioning-configuration.xml
+ --adaptor=configuration-adaptor.h
+ OUTPUT positioning-constants.h
+ COMMAND xsltproc ${CMAKE_CURRENT_SOURCE_DIR}/../api/enum.xsl ${CMAKE_CURRENT_SOURCE_DIR}/../api/genivi-positioning-constants.xml > positioning-constants.h
+)
+
+link_directories(
+ ${DBUS_CPP_LIBRARY_DIRS}
+ ${gnss-service_LIBRARY_DIRS}
+ ${sensors-service_LIBRARY_DIRS})
+
+add_executable(enhanced-position-service
+ main.cpp
+ enhanced-position.cpp
+ enhanced-position.h
+ enhanced-position-adaptor.h
+ position-feedback.cpp
+ position-feedback.h
+ position-feedback-adaptor.h
+ configuration.cpp
+ configuration.h
+ configuration-adaptor.h
+)
set(LIBRARIES
- ${Qt5Core_LIBRARIES}
- ${Qt5DBus_LIBRARIES}
+ ${DBUS_CPP_LIBRARIES}
${gnss-service_LIBRARIES}
${sensors-service_LIBRARIES}
)
@@ -65,26 +82,10 @@ if(WITH_DLT)
set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES})
endif()
-# Specify the paths in which the linker should search for libraries.
-# The command will apply only to targets created after it is called.
-link_directories(
- ${gnss-service_LIBRARY_DIRS}
- ${sensors-service_LIBRARY_DIRS})
-
-# Tell CMake to create the position-daemon executable
-add_executable(position-daemon
- main.cpp
- demoifadaptor.cpp
- serverimpl.cpp
- PositionFilter.cpp
- confifadaptor.cpp
- ConfigurationImpl.cpp
- genivi-version.cpp
-)
-
-target_link_libraries(position-daemon
- ${LIBRARIES})
-
+target_link_libraries(enhanced-position-service ${LIBRARIES})
+message(STATUS "DBUS_CPP_LIBRARIES: " ${DBUS_CPP_LIBRARIES})
+message(STATUS "GNSS_SERVICE_LIBRARIES: " ${gnss-service_LIBRARIES})
+message(STATUS "SENSORS_SERVICE_LIBRARIES: " ${sensors-service_LIBRARIES})
diff --git a/enhanced-position-service/src/ConfigurationImpl.cpp b/enhanced-position-service/src/ConfigurationImpl.cpp
deleted file mode 100644
index 638d4b5..0000000
--- a/enhanced-position-service/src/ConfigurationImpl.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#include "ConfigurationImpl.h"
-
-ConfigurationImpl::ConfigurationImpl(QObject *parent)
-{
-
-}
-
-ConfigurationImpl::~ConfigurationImpl()
-{
-
-}
-
-GeniviVersion ConfigurationImpl::GetVersion()
-{
- GeniviVersion v;
- v.setVersion(1,0,0);
- return v;
-}
-
-QVariantMap ConfigurationImpl::GetProperties()
-{
- QVariantMap props;
-
- props.insert("UpdateInterval", quint32(1000));
- props.insert("SatelliteSystem", quint16(0x02)); // 0x01 = INVALID, 0x02 = GPS
-
- return props;
-}
-
-void ConfigurationImpl::SetProperty(const QString &name, const QDBusVariant &value)
-{
- qDebug("SetProperty: %s", name.toUtf8().constData());
- return;
-}
diff --git a/enhanced-position-service/src/ConfigurationImpl.h b/enhanced-position-service/src/ConfigurationImpl.h
deleted file mode 100644
index e184017..0000000
--- a/enhanced-position-service/src/ConfigurationImpl.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-
-#ifndef CONFIGURATIONIMPL_H
-#define CONFIGURATIONIMPL_H
-
-#include <QtCore/QObject>
-#include <QtDBus/QtDBus>
-#include <QtDBus/QDBusContext>
-
-#include "genivi-dbus-types.h"
-
-class ConfigurationImpl : public QObject, public QDBusContext
-{
-Q_OBJECT
-public:
- explicit ConfigurationImpl(QObject *parent = 0);
- ~ConfigurationImpl();
-
-public Q_SLOTS: // METHODS
- QVariantMap GetProperties();
- GeniviVersion GetVersion();
- void SetProperty(const QString &name, const QDBusVariant &value);
-
-Q_SIGNALS: // SIGNALS
- void PropertyChanged(const QString &name, const QDBusVariant &value);
-};
-
-#endif /* CONFIGURATIONIMPL_H */
diff --git a/enhanced-position-service/src/PositionFilter.cpp b/enhanced-position-service/src/PositionFilter.cpp
deleted file mode 100644
index a9e47d3..0000000
--- a/enhanced-position-service/src/PositionFilter.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-* \author thomas.bader@bmw.de
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#include "PositionFilter.h"
-#include <iostream>
-#include <cassert>
-#include "genivi-navigationcore-enum.h"
-#include "QtCore/qdebug.h"
-
-PositionFilter* PositionFilter::filterInstanct = 0;
-
-PositionFilter::PositionFilter()
-{
-
-}
-
-PositionFilter::~PositionFilter()
-{
- if (0 != filterInstanct)
- delete filterInstanct;
-}
-
-bool PositionFilter::diffPositions(QList<ushort>& list, const TGNSSPosition& pos1, const TGNSSPosition& pos2)
-{
- if ( ((pos1.validityBits & GNSS_POSITION_LATITUDE_VALID) != (pos2.validityBits & GNSS_POSITION_LATITUDE_VALID)) ||
- (pos1.latitude != pos2.latitude) )
- list.push_back(EnhancedPosition::LATITUDE);
-
- if ( ((pos1.validityBits & GNSS_POSITION_LONGITUDE_VALID) != (pos2.validityBits & GNSS_POSITION_LONGITUDE_VALID)) ||
- (pos1.longitude != pos2.longitude))
- list.push_back(EnhancedPosition::LONGITUDE);
-
- if ( ((pos1.validityBits & GNSS_POSITION_ALTITUDE_VALID) != (pos2.validityBits & GNSS_POSITION_ALTITUDE_VALID)) ||
- (pos1.altitude != pos2.altitude) )
- list.push_back(EnhancedPosition::ALTITUDE);
-
- if (pos1.timestamp != pos2.timestamp)
- list.push_back(EnhancedPosition::TIMESTAMP);
-
- return false;
-}
-
-bool PositionFilter::diffCourses(QList<ushort>& list, const TGNSSCourse& course1, const TGNSSCourse& course2) {
-
- if ( ((course1.validityBits & GNSS_COURSE_SPEED_VALID) != (course2.validityBits & GNSS_COURSE_SPEED_VALID)) ||
- (course1.speed != course2.speed) )
- list.push_back(EnhancedPosition::SPEED);
-
- return false;
-}
-
-void PositionFilter::runFiltering(QList<ushort>& changedElements)
-{
- // *** Position ***
- diffPositions(changedElements, mPos, mRawPos);
- mPos = mRawPos;
-
- // *** Course ***
- uint64_t tsDiff = abs(mRawCourse.timestamp - mPos.timestamp);
-
- if (mPos.timestamp > 0 && tsDiff > 500) // 500 [ms]
- qDebug() << "warning: between course and position is diff in timestamps > 500 ms";
-
- diffCourses(changedElements, mCourse, mRawCourse);
- mCourse = mRawCourse;
-}
-
-bool PositionFilter::appendPositionTo(MapUShortVariant& map)
-{
- map.remove(EnhancedPosition::INVALID);
- int count = map.size();
-
- if ((GNSS_POSITION_LATITUDE_VALID == (mPos.validityBits & GNSS_POSITION_LATITUDE_VALID))
- && (GNSS_POSITION_LONGITUDE_VALID == (mPos.validityBits & GNSS_POSITION_LONGITUDE_VALID))
- && (GNSS_POSITION_ALTITUDE_VALID == (mCourse.validityBits & GNSS_POSITION_ALTITUDE_VALID))
- ) {
- map.insert(EnhancedPosition::LATITUDE, qreal(mPos.latitude));
- map.insert(EnhancedPosition::LONGITUDE, qreal(mPos.longitude));
- map.insert(EnhancedPosition::ALTITUDE, qreal(mPos.altitude));
- }
-
- if (map.empty()) {
- map.insert(EnhancedPosition::INVALID, "invalid");
- return false;
- }
-
- return (count < map.size());
-}
-
-bool PositionFilter::appendTimestampTo(MapUShortVariant& map)
-{
- map.remove(EnhancedPosition::INVALID);
- int count = map.size();
-
- if (mPos.timestamp > 0) {
- map.insert(EnhancedPosition::TIMESTAMP,
- QVariant((qlonglong)mPos.timestamp));
- }
-
- if (map.empty()) {
- map.insert(EnhancedPosition::INVALID, QVariant("invalid"));
- return false;
- }
-
- return (count < map.size());
-}
-
-bool PositionFilter::appendCourseTo(MapUShortVariant& map)
-{
- map.remove(EnhancedPosition::INVALID);
- int count = map.size();
-
- if (GNSS_COURSE_HEADING_VALID == (mCourse.validityBits & GNSS_COURSE_HEADING_VALID))
- map.insert(EnhancedPosition::HEADING, qreal(mCourse.heading));
- if (GNSS_COURSE_SPEED_VALID == (mCourse.validityBits & GNSS_COURSE_SPEED_VALID))
- map.insert(EnhancedPosition::SPEED, qreal(mCourse.speed));
- if (GNSS_COURSE_CLIMB_VALID == (mCourse.validityBits & GNSS_COURSE_CLIMB_VALID))
- map.insert(EnhancedPosition::CLIMB, qreal(mCourse.climb));
-
- if (map.empty()) {
- map.insert(EnhancedPosition::INVALID, QVariant("invalid"));
- return false;
- }
-
- return (count < map.size());
-}
-
-bool PositionFilter::appendElementTo(MapUShortVariant& map, ushort key)
-{
- int count = map.size();
-
- switch(key) {
- case EnhancedPositionData::INVALID:
- std::cout << "append INVALID to map" << std::endl;
- break;
-
- case EnhancedPositionData::ALL:
- appendPositionTo(map);
- appendCourseTo(map);
- appendTimestampTo(map);
- break;
-
- case EnhancedPositionData::LATITUDE:
- map.insert(EnhancedPositionData::LATITUDE, qreal(mPos.latitude));
- break;
-
- case EnhancedPositionData::LONGITUDE:
- map.insert(EnhancedPositionData::LONGITUDE, qreal(mPos.longitude));
- break;
-
- case EnhancedPositionData::ALTITUDE:
- map.insert(EnhancedPositionData::ALTITUDE, qreal(mPos.altitude));
- break;
-
- case EnhancedPositionData::SPEED:
- map.insert(EnhancedPositionData::SPEED, qreal(mCourse.speed));
- break;
-
- case EnhancedPositionData::TIMESTAMP:
- map.insert(EnhancedPositionData::TIMESTAMP, qreal(mPos.timestamp));
- break;
-
- default:
- std::cout << __FUNCTION__
- << ": no valid KEY or not implemented ("<< key << ")" << std::endl;
- }
-
- if (map.size() > count) { // success
- std::cout << __FUNCTION__ << ": added " << map.size() - count << std::endl;
- map.remove(EnhancedPosition::INVALID);
- return true;
- }
-
- return false;
-}
-
-// static
-PositionFilter* PositionFilter::getInstance()
-{
- if (0 == filterInstanct) {
- filterInstanct = new PositionFilter();
- }
- assert(filterInstanct);
- return filterInstanct;
-}
-
-// static
-void PositionFilter::onPositionUpdate(const TGNSSPosition pos[], uint16_t numElements)
-{
- if (numElements > 0) {
- filterInstanct->mRawPos = pos[0];
- }
- //std::cout << "latitude : " << std::fixed << pos.latitude << std::endl;
- //std::cout << "longitude: " << std::fixed << pos.longitude << std::endl;
- return;
-}
-
-// static
-void PositionFilter::onCourseUpdate(const TGNSSCourse course[], uint16_t numElements)
-{
- if (numElements > 0) {
- filterInstanct->mRawCourse = course[0];
- }
- return;
-}
diff --git a/enhanced-position-service/src/PositionFilter.h b/enhanced-position-service/src/PositionFilter.h
deleted file mode 100644
index dc1a9c3..0000000
--- a/enhanced-position-service/src/PositionFilter.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-* \author thomas.bader@bmw.de
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#ifndef POSITIONFILTER_H
-#define POSITIONFILTER_H
-
-#include "gnss-simple.h"
-
-#include "QtCore/qmap.h"
-#include "QtCore/qvariant.h"
-typedef QMap<ushort,QVariant> MapUShortVariant;
-
-/**
- * gets the updates and manages results.
- */
-class PositionFilter
-{
-public:
- PositionFilter();
- virtual ~PositionFilter();
-
- void runFiltering(QList<ushort>& changedElements);
- bool appendPositionTo(MapUShortVariant& map);
- bool appendTimestampTo(MapUShortVariant& map);
- bool appendCourseTo(MapUShortVariant& map);
- bool appendElementTo(MapUShortVariant& map, ushort key);
-
- static PositionFilter* getInstance();
- static void onPositionUpdate(const TGNSSPosition pos[], uint16_t num_elements);
- static void onCourseUpdate(const TGNSSCourse course[], uint16_t num_elements);
-
-private:
- bool diffPositions(QList<ushort>& list, const TGNSSPosition& pos1, const TGNSSPosition& pos2);
- bool diffCourses(QList<ushort>& list, const TGNSSCourse& course1, const TGNSSCourse& course2);
-
-private:
- static PositionFilter* filterInstanct;
- TGNSSPosition mPos;
- TGNSSPosition mRawPos;
- TGNSSCourse mCourse;
- TGNSSCourse mRawCourse;
-};
-
-#endif /* POSITIONFILTER_H */
diff --git a/enhanced-position-service/src/clienthandler.h b/enhanced-position-service/src/clienthandler.h
deleted file mode 100644
index 50e5208..0000000
--- a/enhanced-position-service/src/clienthandler.h
+++ /dev/null
@@ -1,227 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#ifndef CLIENTHANDLER_H_
-#define CLIENTHANDLER_H_
-
-const QString params[] = {
- "Name",
- "MaxUpdateRate",
- "MinUpdateRate",
- "RequiresDeadReckoning",
- ""
-};
-
-class PositionAgent {
-private:
- QString m_agentPath;
- QString m_agentUniqueName;
- QString m_paramName;
-
-public:
- PositionAgent(const QString& path, const QString& uniqueName) :
- m_agentPath(""), m_agentUniqueName(""), m_paramName(uniqueName) {
- m_agentPath = path;
- m_agentUniqueName = uniqueName;
- qDebug("k-tor: %s, %s", m_agentPath.toUtf8().data(),
- m_agentUniqueName.toUtf8().data());
- }
-
- QString toString() const {
- QString temp;
- QTextStream ts(&temp);
- ts << "Agent{" << m_paramName << ", "
- << m_agentUniqueName << ", "
- << m_agentPath << "}";
- return temp;
- }
-
- QString getPath() const {
- return m_agentPath;
- }
-
- QString getUniqueName() const {
- return m_agentUniqueName;
- }
-
- // some helper for printing a list of Strings
- QString listToString(const QStringList& list) const {
- QString res;
- QTextStream ts(&res);
-
- ts << "[";
-
- QStringListIterator i(list);
- while (i.hasNext()) {
- const QString& s = i.next();
- ts << s.toUtf8().constData();
- if (i.hasNext())
- ts << ", ";
- }
- ts << "]";
-
- return res;
- }
-
- bool handleConfigParameter(const QString& key, const QString& value) {
- if (key.size() == 0 || value.size() == 0)
- return false;
-
- //
- // some fix values
- if (key.compare("Name") == 0) {
- qDebug(" ++ agent with name '%s'", value.toUtf8().constData());
- m_paramName = value;
- return true;
- }
-
- // TODO: more flexible ...
- int i;
- QStringList candidates;
- for (i = 0; params[i].size() != 0; ++i) {
- if (params[i].compare(key) == 0) {
- return true;
- }
-
- // check for similarities - miss typed?
- if (checkForSimilarParameter(params[i], key)) {
- candidates.append(params[i]);
- }
- }
-
- if (candidates.size() > 0) {
- qDebug("* found candidate for invalid parameter:\n* do you mean %s instead of %s",
- listToString(candidates).toUtf8().constData(),
- key.toUtf8().constData());
- }
-
- return false;
- }
-
- static bool checkForSimilarParameter(const QString& shouldStr,
- const QString& wrongStr) {
- if (shouldStr.isEmpty() || wrongStr.isEmpty())
- return false;
-
- //qDebug(" compare '%s' with '%s'",
- // sollString.toUtf8().constData(),
- // falschString.toUtf8().constData());
-
- // split 'AbcDef' into 'Abc', 'Def'
- QRegExp rx("([A-Z]+[a-z]*)");
- QStringList parts;
- int pos = 0;
- while ((pos = rx.indexIn(wrongStr, pos)) != -1) {
- parts << rx.cap(1);
- pos += rx.matchedLength();
- }
-
- // find strings in shouldStr pattern
- QStringList::const_iterator i;
- QString word;
- for (i = parts.begin(); i != parts.end(); ++i) {
- word = *i;
- if (shouldStr.contains(word)) {
- return true;
- }
- }
-
- return false;
- }
-
- bool parseAgentParameters(QList<QString> params) {
- bool configError = false;
-
- // handle configuration parameters. only printed, no other usage.
- if (params.isEmpty()) {
- qDebug(" - no configuration parameters given");
- return false;
- }
-
- QStringList::const_iterator i;
- for (i = params.begin(); i != params.end(); ++i) {
- const QString& param = *i;
- QStringList values = param.split('=');
-
- if (values.size() > 1 && handleConfigParameter(values.at(0),
- values.at(1))) {
- qDebug(" - '%s' = '%s'", values[0].toUtf8().constData(),
- values[1].toUtf8().constData());
- } else {
- qDebug(" - '%s' (error)", param.toUtf8().constData());
- configError = true;
- }
- }
- return (configError == false);
- }
-};
-
-class ClientHandler {
-public:
- ClientHandler() {
- }
-
- bool addNewAgent(QString uniqueName, QString path) {
-
- if (uniqueName.isEmpty() || path.isEmpty()) {
- qWarning("addNewAgent failed");
- return false;
- }
-
- PositionAgent agent(path, uniqueName);
- if (agent.getPath().isEmpty() || agent.getUniqueName().isEmpty()) {
- qWarning("failed to crate PositonAgent object");
- return false;
- }
-
- m_agents.insert(uniqueName, agent);
- printAllAgents();
- return true;
- }
-
- void printAllAgents() {
- qDebug("******* %d ***********", m_agents.size());
- // Improtant! own copy of list required for iteration!!
- QList<PositionAgent> list = m_agents.values();
- QList<PositionAgent>::const_iterator i;
-
- for (i = list.begin(); i != list.end(); ++i) {
- PositionAgent s = *i;
- qDebug("* + %s", s.toString().toUtf8().data());
- }
- }
-
- bool removeAgent(QString uniqueName, const QString path="") {
- return (m_agents.remove(uniqueName) > 0);
- }
-
- QList<PositionAgent> values() {
- return m_agents.values();
- }
-
- QList<QString> keys() {
- return m_agents.keys();
- }
-
- PositionAgent& getAgent(const QString &key) {
- return *m_agents.find(key);
- }
-private:
- QMap<QString, PositionAgent> m_agents;
-};
-
-#endif /* CLIENTHANDLER_H_ */
diff --git a/enhanced-position-service/src/confifadaptor.cpp b/enhanced-position-service/src/confifadaptor.cpp
deleted file mode 100644
index 6a5af60..0000000
--- a/enhanced-position-service/src/confifadaptor.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c ConfigurationIfAdaptor -a confifadaptor.h:confifadaptor.cpp -i genivi-dbus-types.h -i ConfigurationImpl.h -l ConfigurationImpl ../genivi-positioning-configuration-qt.xml org.genivi.positioning.Configuration
- *
- * qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#include "confifadaptor.h"
-#include <QtCore/QMetaObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-
-/*
- * Implementation of adaptor class ConfigurationIfAdaptor
- */
-
-ConfigurationIfAdaptor::ConfigurationIfAdaptor(ConfigurationImpl *parent)
- : QDBusAbstractAdaptor(parent)
-{
- // constructor
- setAutoRelaySignals(true);
-}
-
-ConfigurationIfAdaptor::~ConfigurationIfAdaptor()
-{
- // destructor
-}
-
-int ConfigurationIfAdaptor::satelliteSystem() const
-{
- // get the value of property SatelliteSystem
- return qvariant_cast< int >(parent()->property("SatelliteSystem"));
-}
-
-void ConfigurationIfAdaptor::setSatelliteSystem(int value)
-{
- // set the value of property SatelliteSystem
- parent()->setProperty("SatelliteSystem", QVariant::fromValue(value));
-}
-
-ushort ConfigurationIfAdaptor::updateInterval() const
-{
- // get the value of property UpdateInterval
- return qvariant_cast< ushort >(parent()->property("UpdateInterval"));
-}
-
-void ConfigurationIfAdaptor::setUpdateInterval(ushort value)
-{
- // set the value of property UpdateInterval
- parent()->setProperty("UpdateInterval", QVariant::fromValue(value));
-}
-
-QVariantMap ConfigurationIfAdaptor::GetProperties()
-{
- // handle method call org.genivi.positioning.Configuration.GetProperties
- return parent()->GetProperties();
-}
-
-GeniviVersion ConfigurationIfAdaptor::GetVersion()
-{
- // handle method call org.genivi.positioning.Configuration.GetVersion
- return parent()->GetVersion();
-}
-
-void ConfigurationIfAdaptor::SetProperty(const QString &name, const QDBusVariant &value)
-{
- // handle method call org.genivi.positioning.Configuration.SetProperty
- parent()->SetProperty(name, value);
-}
-
diff --git a/enhanced-position-service/src/confifadaptor.h b/enhanced-position-service/src/confifadaptor.h
deleted file mode 100644
index e54518e..0000000
--- a/enhanced-position-service/src/confifadaptor.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c ConfigurationIfAdaptor -a confifadaptor.h:confifadaptor.cpp -i genivi-dbus-types.h -i ConfigurationImpl.h -l ConfigurationImpl ../genivi-positioning-configuration-qt.xml org.genivi.positioning.Configuration
- *
- * qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#ifndef CONFIFADAPTOR_H_1331549840
-#define CONFIFADAPTOR_H_1331549840
-
-#include <QtCore/QObject>
-#include <QtDBus/QtDBus>
-#include "genivi-dbus-types.h"
-#include "ConfigurationImpl.h"
-class QByteArray;
-template<class T> class QList;
-template<class Key, class Value> class QMap;
-class QString;
-class QStringList;
-class QVariant;
-
-/*
- * Adaptor class for interface org.genivi.positioning.Configuration
- */
-class ConfigurationIfAdaptor: public QDBusAbstractAdaptor
-{
- Q_OBJECT
- Q_CLASSINFO("D-Bus Interface", "org.genivi.positioning.Configuration")
- Q_CLASSINFO("D-Bus Introspection", ""
-" <interface name=\"org.genivi.positioning.Configuration\">\n"
-" <version>0.0.3 (13-03-2012)</version>\n"
-" <doc>\n"
-" <line>Configuration = This interface allow a client application to set and read configuration options</line>\n"
-" </doc>\n"
-" <method name=\"GetVersion\">\n"
-" <doc>\n"
-" <line>GetVersion = This method returns the API version implemented by the server application</line>\n"
-" </doc>\n"
-" <annotation value=\"GeniviVersion\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"(qqqs)\" name=\"version\">\n"
-" <doc>\n"
-" <line>version = struct(major,minor,micro,date)</line>\n"
-" <line>major = when the major changes, then backward compatibility with previous releases is not granted</line>\n"
-" <line>minor = when the minor changes, then backward compatibility with previous releases is granted, but something changed in the implementation of the API (e.g. new methods may have been added)</line>\n"
-" <line>micro = when the micro changes, then backward compatibility with previous releases is granted (bug fixes or documentation modifications)</line>\n"
-" <line>date = release date (e.g. 21-06-2011)</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <method name=\"GetProperties\">\n"
-" <doc>\n"
-" <line>Returns all global system properties. See the properties section for available properties.</line>\n"
-" </doc>\n"
-" <annotation value=\"QVariantMap\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{sv}\" name=\"properties\"/>\n"
-" </method>\n"
-" <method name=\"SetProperty\">\n"
-" <doc>\n"
-" <line>Changes the value of the specified property.</line>\n"
-" <line>Only properties that are listed as read-write are changeable.</line>\n"
-" <line>On success a PropertyChanged signal will be emitted.</line>\n"
-" </doc>\n"
-" <arg direction=\"in\" type=\"s\" name=\"name\"/>\n"
-" <arg direction=\"in\" type=\"v\" name=\"value\"/>\n"
-" <error name=\"org.genivi.positioning.Configuration.Error.InvalidProperty\"/>\n"
-" </method>\n"
-" <signal name=\"PropertyChanged\">\n"
-" <doc>\n"
-" <line>This signal indicates a changed value of the given property.</line>\n"
-" </doc>\n"
-" <arg direction=\"out\" type=\"s\" name=\"name\"/>\n"
-" <arg direction=\"out\" type=\"v\" name=\"value\"/>\n"
-" </signal>\n"
-" <property access=\"readwrite\" type=\"i\" name=\"SatelliteSystem\">\n"
-" <doc>\n"
-" <line>SatelliteSystem = enum(INVALID,GPS,GLONASS,GALILEO,COMPASS, ...)</line>\n"
-" </doc>\n"
-" </property>\n"
-" <property access=\"readwrite\" type=\"q\" name=\"UpdateInterval\">\n"
-" <doc>\n"
-" <line>UpdateInterval = update interval in ms</line>\n"
-" </doc>\n"
-" </property>\n"
-" </interface>\n"
- "")
-public:
- ConfigurationIfAdaptor(ConfigurationImpl *parent);
- virtual ~ConfigurationIfAdaptor();
-
- inline ConfigurationImpl *parent() const
- { return static_cast<ConfigurationImpl *>(QObject::parent()); }
-
-public: // PROPERTIES
- Q_PROPERTY(int SatelliteSystem READ satelliteSystem WRITE setSatelliteSystem)
- int satelliteSystem() const;
- void setSatelliteSystem(int value);
-
- Q_PROPERTY(ushort UpdateInterval READ updateInterval WRITE setUpdateInterval)
- ushort updateInterval() const;
- void setUpdateInterval(ushort value);
-
-public Q_SLOTS: // METHODS
- QVariantMap GetProperties();
- GeniviVersion GetVersion();
- void SetProperty(const QString &name, const QDBusVariant &value);
-Q_SIGNALS: // SIGNALS
- void PropertyChanged(const QString &name, const QDBusVariant &value);
-};
-
-#endif
diff --git a/enhanced-position-service/src/configuration.cpp b/enhanced-position-service/src/configuration.cpp
new file mode 100644
index 0000000..e29e93c
--- /dev/null
+++ b/enhanced-position-service/src/configuration.cpp
@@ -0,0 +1,130 @@
+/**************************************************************************
+* @licence app begin@
+*
+* SPDX-License-Identifier: MPL-2.0
+*
+* \ingroup EnhancedPositionService
+* \author Marco Residori <marco.residori@xse.de>
+*
+* \copyright Copyright (C) 2014, XS Embedded GmbH
+*
+* \license
+* This Source Code Form is subject to the terms of the
+* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*
+* @licence end@
+**************************************************************************/
+
+#include <stdio.h>
+#include "configuration.h"
+#include "positioning-constants.h"
+#include "log.h"
+
+DLT_IMPORT_CONTEXT(gCtx);
+
+static DBus::Variant variant_uint16(uint16_t i)
+{
+ DBus::Variant variant;
+ DBus::MessageIter iter=variant.writer();
+ iter << i;
+ return variant;
+}
+
+static DBus::Variant variant_int32(int32_t i)
+{
+ DBus::Variant variant;
+ DBus::MessageIter iter=variant.writer();
+ iter << i;
+ return variant;
+}
+
+static DBus::Variant variant_array_uint16(std::vector< uint16_t > i)
+{
+ DBus::Variant variant;
+ DBus::MessageIter iter=variant.writer();
+ iter << i;
+ return variant;
+}
+
+static DBus::Variant variant_array_int32(std::vector< int32_t > i)
+{
+ DBus::Variant variant;
+ DBus::MessageIter iter=variant.writer();
+ iter << i;
+ return variant;
+}
+
+Configuration::Configuration(DBus::Connection &connection, const char * path)
+ : DBus::ObjectAdaptor(connection, path)
+{
+}
+
+Configuration::~Configuration()
+{
+}
+
+::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > Configuration::GetVersion()
+{
+ ::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > Version;
+
+ Version._1 = 2;
+ Version._2 = 0;
+ Version._3 = 0;
+ Version._4 = std::string("04-06-2013");
+
+ return Version;
+}
+
+std::map< std::string, ::DBus::Variant > Configuration::GetProperties()
+{
+ std::map< std::string, ::DBus::Variant > Properties;
+
+ Properties["UpdateInterval"] = variant_int32(1000);
+ Properties["SatelliteSystem"] = variant_uint16(POS_GPS);
+
+ return Properties;
+}
+
+void Configuration::SetProperty(const std::string& name, const ::DBus::Variant& value)
+{
+ throw DBus::ErrorNotSupported("Method not supported yet");
+}
+
+std::map< std::string, ::DBus::Variant > Configuration::GetSupportedProperties()
+{
+ std::map< std::string, ::DBus::Variant > SupportedProperties;
+
+ std::vector< int32_t > updateIntervals;
+ updateIntervals.push_back(1000);
+
+ std::vector< uint16_t > satelliteSystems;
+ satelliteSystems.push_back(POS_GPS);
+ satelliteSystems.push_back(POS_GLONASS);
+ satelliteSystems.push_back(POS_GALILEO);
+ satelliteSystems.push_back(POS_COMPASS);
+
+ SupportedProperties["UpdateInterval"] = variant_array_int32(updateIntervals);
+ SupportedProperties["SatelliteSystem"] = variant_array_uint16(satelliteSystems);
+
+ return SupportedProperties;
+}
+
+void Configuration::run()
+{
+ LOG_INFO_MSG(gCtx,"Starting Configuration dispatcher...");
+}
+
+void Configuration::shutdown()
+{
+}
+
+
+
+
+
+
+
+
+
+
diff --git a/enhanced-position-service/src/configuration.h b/enhanced-position-service/src/configuration.h
new file mode 100644
index 0000000..093a511
--- /dev/null
+++ b/enhanced-position-service/src/configuration.h
@@ -0,0 +1,52 @@
+/**************************************************************************
+* @licence app begin@
+*
+* SPDX-License-Identifier: MPL-2.0
+*
+* \ingroup EnhancedPositionService
+* \author Marco Residori <marco.residori@xse.de>
+*
+* \copyright Copyright (C) 2014, XS Embedded GmbH
+*
+* \license
+* This Source Code Form is subject to the terms of the
+* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*
+* @licence end@
+**************************************************************************/
+#ifndef ___CONFIGURATION_H
+#define ___CONFIGURATION_H
+
+#include <dbus-c++/dbus.h>
+#include "configuration-adaptor.h"
+#include "gnss.h"
+#include "gnss-simple.h"
+#include "gnss-ext.h"
+
+class Configuration
+ : public org::genivi::positioning::Configuration_adaptor
+ , public DBus::IntrospectableAdaptor
+ , public DBus::ObjectAdaptor
+{
+public:
+
+ Configuration(DBus::Connection &connection, const char * path);
+
+ ~Configuration();
+
+ ::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > GetVersion();
+
+ std::map< std::string, ::DBus::Variant > GetProperties();
+
+ void SetProperty(const std::string& name, const ::DBus::Variant& value);
+
+ std::map< std::string, ::DBus::Variant > GetSupportedProperties();
+
+ void run();
+
+ void shutdown();
+
+};
+
+#endif//__CONFIGURATION_H
diff --git a/enhanced-position-service/src/demoifadaptor.cpp b/enhanced-position-service/src/demoifadaptor.cpp
deleted file mode 100644
index 41262fe..0000000
--- a/enhanced-position-service/src/demoifadaptor.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c DemoIfAdaptor -a demoifadaptor.h:demoifadaptor.cpp -i genivi-dbus-types.h -i serverimpl.h -l ServerImpl ../genivi-positioning-enhancedposition-qt.xml org.genivi.positioning.EnhancedPosition
- *
- * qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#include "demoifadaptor.h"
-#include <QtCore/QMetaObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-
-/*
- * Implementation of adaptor class DemoIfAdaptor
- */
-
-DemoIfAdaptor::DemoIfAdaptor(ServerImpl *parent)
- : QDBusAbstractAdaptor(parent)
-{
- // constructor
- setAutoRelaySignals(true);
-}
-
-DemoIfAdaptor::~DemoIfAdaptor()
-{
- // destructor
-}
-
-MapUShortVariant DemoIfAdaptor::GetAccuracy()
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetAccuracy
- return parent()->GetAccuracy();
-}
-
-MapUShortVariant DemoIfAdaptor::GetData(const QList<ushort> &valuesToReturn)
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetData
- return parent()->GetData(valuesToReturn);
-}
-
-MapUShortVariant DemoIfAdaptor::GetPosition()
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetPosition
- return parent()->GetPosition();
-}
-
-MapUShortVariant DemoIfAdaptor::GetRotationRate()
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetRotationRate
- return parent()->GetRotationRate();
-}
-
-MapUShortVariant DemoIfAdaptor::GetSatelliteInfo()
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetSatelliteInfo
- return parent()->GetSatelliteInfo();
-}
-
-MapUShortVariant DemoIfAdaptor::GetStatus()
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetStatus
- return parent()->GetStatus();
-}
-
-MapUShortVariant DemoIfAdaptor::GetTime()
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetTime
- return parent()->GetTime();
-}
-
-GeniviVersion DemoIfAdaptor::GetVersion()
-{
- // handle method call org.genivi.positioning.EnhancedPosition.GetVersion
- return parent()->GetVersion();
-}
-
diff --git a/enhanced-position-service/src/demoifadaptor.h b/enhanced-position-service/src/demoifadaptor.h
deleted file mode 100644
index bb5e435..0000000
--- a/enhanced-position-service/src/demoifadaptor.h
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c DemoIfAdaptor -a demoifadaptor.h:demoifadaptor.cpp -i genivi-dbus-types.h -i serverimpl.h -l ServerImpl ../genivi-positioning-enhancedposition-qt.xml org.genivi.positioning.EnhancedPosition
- *
- * qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#ifndef DEMOIFADAPTOR_H_1333107453
-#define DEMOIFADAPTOR_H_1333107453
-
-#include <QtCore/QObject>
-#include <QtDBus/QtDBus>
-#include "genivi-dbus-types.h"
-#include "serverimpl.h"
-class QByteArray;
-template<class T> class QList;
-template<class Key, class Value> class QMap;
-class QString;
-class QStringList;
-class QVariant;
-
-/*
- * Adaptor class for interface org.genivi.positioning.EnhancedPosition
- */
-class DemoIfAdaptor: public QDBusAbstractAdaptor
-{
- Q_OBJECT
- Q_CLASSINFO("D-Bus Interface", "org.genivi.positioning.EnhancedPosition")
- Q_CLASSINFO("D-Bus Introspection", ""
-" <interface name=\"org.genivi.positioning.EnhancedPosition\">\n"
-" <version>1.0.0 (22-03-2012)</version>\n"
-" <doc>\n"
-" <line>EnhancedPosition = This interface offers functionalities to retrieve the enhanced position of the vehicle</line>\n"
-" </doc>\n"
-" <method name=\"GetVersion\">\n"
-" <doc>\n"
-" <line>GetVersion = This method returns the API version implemented by the server application</line>\n"
-" </doc>\n"
-" <annotation value=\"GeniviVersion\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"(qqqs)\" name=\"version\">\n"
-" <doc>\n"
-" <line>version = struct(major,minor,micro,date)</line>\n"
-" <line>major = when the major changes, then backward compatibility with previous releases is not granted</line>\n"
-" <line>minor = when the minor changes, then backward compatibility with previous releases is granted, but something changed in the implementation of the API (e.g. new methods may have been added)</line>\n"
-" <line>micro = when the micro changes, then backward compatibility with previous releases is granted (bug fixes or documentation modifications)</line>\n"
-" <line>date = release date (e.g. 21-06-2011)</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <method name=\"GetData\">\n"
-" <doc>\n"
-" <line>GetData = This method returns the current data for Position, Course, Accuracy, Status,...</line>\n"
-" </doc>\n"
-" <annotation value=\"QList&lt;ushort>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <arg direction=\"in\" type=\"aq\" name=\"valuesToReturn\">\n"
-" <doc>\n"
-" <line>valuesToReturn= array[fieldType]</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,ROLL_RATE,PITCH_RATE,YAW_RATE,...,ALL)</line>\n"
-" </doc>\n"
-" </arg>\n"
-" <annotation value=\"MapUShortVariant\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{qv}\" name=\"data\">\n"
-" <doc>\n"
-" <line>position = dictionary[key,value]</line>\n"
-" <line>dictionary = array of tuples (key,value)</line>\n"
-" <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,ROLL_RATE,PITCH_RATE,YAW_RATE,PDOP,HDOP,VDOP,SIGMA_LATITUDE,SIGMA_LONGITUDE,SIGMA_ALTITUDE,SIGMA_HEADING,... ,ALL</line>\n"
-" <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>\n"
-" <line>key = LATITUDE, value = value of type 'd', that expresses the latitude of the current position. Range [-90:+90]. Example: 48.053250</line>\n"
-" <line>key = LONGITUDE, value = value of type 'd', that expresses the longitude of the current position. Range [-180:+180]. Example: 8.324500</line>\n"
-" <line>key = ALTITUDE, value = value of type 'd', that expresses the altitude above the sea level of the current position in meters</line>\n"
-" <line>key = HEADING, value = value of type 'd', that expresses the course angle in degree. Range [0:360]. 0 = north, 90 = east, 180 = south, 270 = west</line>\n"
-" <line>key = SPEED, value = value of type 'd', that expresses speed measured in m/s. A negative value indicates that the vehicle is moving backwards</line>\n"
-" <line>key = CLIMB, value = value of type 'd', that expresses the road gradient in degrees</line>\n"
-" <line>key = ROLL_RATE, value = value of type 'd', rotation rate around the X-axis in degrees/s. Range [-100:+100]</line>\n"
-" <line>key = PITCH_RATE, value = value of type 'd', rotation rate around the Y-axis in degrees/s. Range [-100:+100]</line>\n"
-" <line>key = YAW_RATE, value = value of type 'd', rotation rate around the Z-axis in degrees/s. Range [-100:+100]</line>\n"
-" <line>key = PDOP, value = value of type 'd', that represents the positional (3D) dilution of precision</line>\n"
-" <line>key = HDOP, value = value of type 'd', that represents the horizontal (2D) dilution of precision</line>\n"
-" <line>key = VDOP, value = value of type 'd', that represents vertical (altitude) dilution of precision</line>\n"
-" <line>key = SIGMA_LATITUDE, value = value of type 'd', that represents the standard deviation for latitude in m</line>\n"
-" <line>key = SIGMA_LONGITUDE, value = value of type 'd', that represents the standard deviation for longitude in m</line>\n"
-" <line>key = SIGMA_ALTITUDE, value = value of type 'd', that represents the standard deviation for altitude in m</line>\n"
-" <line>key = SIGMA_HEADING, value = value of type 'd', that represents the standard deviation for altitude in degrees</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <method name=\"GetPosition\">\n"
-" <doc>\n"
-" <line>GetPosition = This method returns the current position</line>\n"
-" </doc>\n"
-" <annotation value=\"MapUShortVariant\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{qv}\" name=\"position\">\n"
-" <doc>\n"
-" <line>position = dictionary[key,value]</line>\n"
-" <line>dictionary = array of tuples (key,value)</line>\n"
-" <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,...)</line>\n"
-" <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>\n"
-" <line>key = LATITUDE, value = value of type 'd', that expresses the latitude of the current position. Range [-90:+90]. Example: 48.053250</line>\n"
-" <line>key = LONGITUDE, value = value of type 'd', that expresses the longitude of the current position. Range [-180:+180]. Example: 8.324500</line>\n"
-" <line>key = ALTITUDE, value = value of type 'd', that expresses the altitude above the sea level of the current position in meters</line>\n"
-" <line>key = HEADING, value = value of type 'd', that expresses the course angle in degree. Range [0:360]. 0 = north, 90 = east, 180 = south, 270 = west</line>\n"
-" <line>key = SPEED, value = value of type 'd', that expresses speed measured in m/s. A negative value indicates that the vehicle is moving backwards</line>\n"
-" <line>key = CLIMB, value = value of type 'd', that expresses the road gradient in degrees</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <signal name=\"PositionUpdate\">\n"
-" <doc>\n"
-" <line>PositionUpdate = This signal is called to notifiy a client application of a position change. The update frequency is implementation specific. The maximal allowed frequency is 10Hz</line>\n"
-" </doc>\n"
-" <annotation value=\"QList&lt;ushort>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <arg direction=\"out\" type=\"aq\" name=\"changedValues\">\n"
-" <doc>\n"
-" <line>changedValues = array[value]</line>\n"
-" <line>value = enum(INVALID,TIMESTAMP,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,... )</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </signal>\n"
-" <method name=\"GetRotationRate\">\n"
-" <doc>\n"
-" <line>GetRotationRate = This method returns the rotation rate</line>\n"
-" </doc>\n"
-" <annotation value=\"MapUShortVariant\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{qv}\" name=\"rotationRate\">\n"
-" <doc>\n"
-" <line>rotationRates = dictionary[key,value]</line>\n"
-" <line>dictionary = array of tuples (key,value)</line>\n"
-" <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,ROLL_RATE,PITCH_RATE,YAW_RATE, ... )</line>\n"
-" <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>\n"
-" <line>key = ROLL_RATE, value = rotation rate around the X-axis in degrees/s. Range [-100:+100]</line>\n"
-" <line>key = PITCH_RATE, value = rotation rate around the Y-axis in degrees/s. Range [-100:+100]</line>\n"
-" <line>key = YAW_RATE, value = rotation rate around the Z-axis in degrees/s. Range [-100:+100]</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <signal name=\"RotationRateUpdate\">\n"
-" <doc>\n"
-" <line>RotationRateUpdated = This signal is emitted when the rotation rate changes</line>\n"
-" </doc>\n"
-" <annotation value=\"QList&lt;ushort>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <arg direction=\"out\" type=\"aq\" name=\"changedValues\">\n"
-" <doc>\n"
-" <line>changedValues = array[key]</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,ROLL_RATE,PITCH_RATE,YAW_RATE, ... )</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </signal>\n"
-" <method name=\"GetAccuracy\">\n"
-" <doc>\n"
-" <line>GetAccuracy = This method returns the accuracy</line>\n"
-" </doc>\n"
-" <annotation value=\"MapUShortVariant\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{qv}\" name=\"accuracy\">\n"
-" <doc>\n"
-" <line>accuracy = dictionary[key,value]</line>\n"
-" <line>dictionary = array of tuples (key,value)</line>\n"
-" <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,PDOP,HDOP,VDOP,SIGMA_LATITUDE,SIGMA_LONGITUDE,SIGMA_ALTITUDE,SIGMA_HEADING,... )</line>\n"
-" <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>\n"
-" <line>key = PDOP, value = value of type 'd', that represents the positional (3D) dilution of precision</line>\n"
-" <line>key = HDOP, value = value of type 'd', that represents the horizontal (2D) dilution of precision</line>\n"
-" <line>key = VDOP, value = value of type 'd', that represents vertical (altitude) dilution of precision</line>\n"
-" <line>key = SIGMA_LATITUDE, value = value of type 'd', that represents the standard deviation for latitude in m</line>\n"
-" <line>key = SIGMA_LONGITUDE, value = value of type 'd', that represents the standard deviation for longitude in m</line>\n"
-" <line>key = SIGMA_ALTITUDE, value = value of type 'd', that represents the standard deviation for altitude in m</line>\n"
-" <line>key = SIGMA_HEADING, value = value of type 'd', that represents the standard deviation for altitude in degrees</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <signal name=\"AccuracyUpdate\">\n"
-" <doc>\n"
-" <line>AccuracyUpdated = This signal is emitted when the accuracy changes</line>\n"
-" </doc>\n"
-" <annotation value=\"QList&lt;ushort>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <arg direction=\"out\" type=\"aq\" name=\"changedValues\">\n"
-" <doc>\n"
-" <line>changedValues = array[value]</line>\n"
-" <line>value = enum(INVALID,TIMESTAMP,PDOP,HDOP,VDOP,SIGMA_LATITUDE,SIGMA_LONGITUDE,SIGMA_ALTITUDE,SIGMA_HEADING, ... )</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </signal>\n"
-" <method name=\"GetSatelliteInfo\">\n"
-" <doc>\n"
-" <line>GetSatelliteInfo = This method returns information about the current satellite constellation</line>\n"
-" </doc>\n"
-" <annotation value=\"MapUShortVariant\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{qv}\" name=\"satelliteInfo\">\n"
-" <doc>\n"
-" <line>satelliteInfo = dictionary[key,value]</line>\n"
-" <line>dictionary = array of tuples (key,value)</line>\n"
-" <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,USED_SATELLITES,TRACKED_SATELLITES,VISIBLE_SATELLITES,SATELLITE_DETAILS, ...)</line>\n"
-" <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>\n"
-" <line>key = USED_SATELLITES, value = value of type 'y', that represents the number of used satellites</line>\n"
-" <line>key = TRACKED_SATELLITES, value = value of type 'y', that represents the number of tracked satellites</line>\n"
-" <line>key = VISIBLE_SATELLITES, value = value of type 'y', that represents the number of visible satellites</line>\n"
-" <line>key = SATELLITE_DETAILS, value = value of type 'a(ubuuu)', that represents an array(struct(satId,inUse,elevation,azimuth,snr)</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <signal name=\"SatelliteInfoUpdate\">\n"
-" <doc>\n"
-" <line>SatelliteInfoUpdate = This signal is emitted when information about the current satellite information is updated</line>\n"
-" </doc>\n"
-" <annotation value=\"QList&lt;ushort>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <arg direction=\"out\" type=\"aq\" name=\"changedValues\">\n"
-" <doc>\n"
-" <line>changedValues = array[value]</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,USED_SATELLITES,TRACKED_SATELLITES,VISIBLE_SATELLITES,SATELLITE_DETAILS, ...)</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </signal>\n"
-" <method name=\"GetStatus\">\n"
-" <doc>\n"
-" <line>GetStatus = This method returns the status of this service</line>\n"
-" </doc>\n"
-" <annotation value=\"MapUShortVariant\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{qv}\" name=\"status\">\n"
-" <doc>\n"
-" <line>status = dictionary[key,value]</line>\n"
-" <line>dictionary = array of tuples (key,value)</line>\n"
-" <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,GNSS_FIX_STATUS,DR_STATUS, ... )</line>\n"
-" <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>\n"
-" <line>key = GNSS_FIX_STATUS, value = value of type 'q', that represents an enum(INVALID(0x00),NO_FIX(0x01),TIME_FIX(0x02),2D_FIX(0x03),3D_FIX(0x04), ... )</line>\n"
-" <line>key = DR_STATUS, value = value of type 'b', where TRUE means that a dead-reckoning algorithm has been used to calculate the current position</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <signal name=\"StatusUpdate\">\n"
-" <doc>\n"
-" <line>StatusUpdate = This signal is emitted when the status of this service changes</line>\n"
-" </doc>\n"
-" <annotation value=\"QList&lt;ushort>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <arg direction=\"out\" type=\"aq\" name=\"changedValues\">\n"
-" <doc>\n"
-" <line>changedValues = array[value]</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,GNSS_FIX_STATUS,DR_STATUS, ... )</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </signal>\n"
-" <method name=\"GetTime\">\n"
-" <doc>\n"
-" <line>GetTime = This method returns UTC time and date</line>\n"
-" </doc>\n"
-" <annotation value=\"MapUShortVariant\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"out\" type=\"a{qv}\" name=\"time\">\n"
-" <doc>\n"
-" <line>time = dictionary[key,value]</line>\n"
-" <line>dictionary = array of tuples (key,value)</line>\n"
-" <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line>\n"
-" <line>key = enum(INVALID,TIMESTAMP,YEAR,MONTH,DAY,HOUR,MINUTE,SECOND,MS, ... )</line>\n"
-" <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line>\n"
-" <line>key = YEAR, value = value of type 'q', 4 digits number that indicates the year. Example: 2012</line>\n"
-" <line>key = MONTH, value = value of type 'y', 2 digits number that indicates the month. Example: 03 means March</line>\n"
-" <line>key = DAY, value = value of type 'y', 2 digits number that indicates the day. Range [0:31]. Example: 07</line>\n"
-" <line>key = HOUR, value = value of type 'y', 2 digits number that indicates the hour. Range [0:23]. Example: 01</line>\n"
-" <line>key = MINUTE, value = value of type 'y', 2 digits number that represents the minutes. Range [0:59]. Example: 01</line>\n"
-" <line>key = SECOND, value = value of type 'y', 2 digits number that represents the seconds. Range [0:59]. Example: 01</line>\n"
-" <line>key = MS, value = value of type 'q', 3 digits number that represents the milliseconds. Range [0:999]. Example: 007</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" </interface>\n"
- "")
-public:
- DemoIfAdaptor(ServerImpl *parent);
- virtual ~DemoIfAdaptor();
-
- inline ServerImpl *parent() const
- { return static_cast<ServerImpl *>(QObject::parent()); }
-
-public: // PROPERTIES
-public Q_SLOTS: // METHODS
- MapUShortVariant GetAccuracy();
- MapUShortVariant GetData(const QList<ushort> &valuesToReturn);
- MapUShortVariant GetPosition();
- MapUShortVariant GetRotationRate();
- MapUShortVariant GetSatelliteInfo();
- MapUShortVariant GetStatus();
- MapUShortVariant GetTime();
- GeniviVersion GetVersion();
-Q_SIGNALS: // SIGNALS
- void AccuracyUpdate(const QList<ushort> &changedValues);
- void PositionUpdate(const QList<ushort> &changedValues);
- void RotationRateUpdate(const QList<ushort> &changedValues);
- void SatelliteInfoUpdate(const QList<ushort> &changedValues);
- void StatusUpdate(const QList<ushort> &changedValues);
-};
-
-#endif
diff --git a/enhanced-position-service/src/enhanced-position.cpp b/enhanced-position-service/src/enhanced-position.cpp
new file mode 100644
index 0000000..85ff4ff
--- /dev/null
+++ b/enhanced-position-service/src/enhanced-position.cpp
@@ -0,0 +1,617 @@
+/**************************************************************************
+* @licence app begin@
+*
+* SPDX-License-Identifier: MPL-2.0
+*
+* \ingroup EnhancedPositionService
+* \author Marco Residori <marco.residori@xse.de>
+*
+* \copyright Copyright (C) 2014, XS Embedded GmbH
+*
+* \license
+* This Source Code Form is subject to the terms of the
+* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*
+* @licence end@
+**************************************************************************/
+
+#include <stdio.h>
+#include "enhanced-position.h"
+#include "positioning-constants.h"
+#include "log.h"
+
+DLT_IMPORT_CONTEXT(gCtx);
+
+EnhancedPosition* EnhancedPosition::mpSelf = 0;
+
+static DBus::Variant variant_double(double d)
+{
+ DBus::Variant variant;
+ DBus::MessageIter iter=variant.writer();
+ iter << d;
+ return variant;
+}
+
+static DBus::Variant variant_uint16(uint16_t i)
+{
+ DBus::Variant variant;
+ DBus::MessageIter iter=variant.writer();
+ iter << i;
+ return variant;
+}
+
+static DBus::Variant variant_int32(int32_t i)
+{
+ DBus::Variant variant;
+ DBus::MessageIter iter=variant.writer();
+ iter << i;
+ return variant;
+}
+
+static DBus::Variant variant_string(std::string s)
+{
+ DBus::Variant variant;
+ DBus::MessageIter iter=variant.writer();
+ iter << s;
+ return variant;
+}
+
+EnhancedPosition::EnhancedPosition(DBus::Connection & connection, const char * path)
+ : DBus::ObjectAdaptor(connection, path)
+{
+ mpSelf = this;
+}
+
+EnhancedPosition::~EnhancedPosition()
+{
+ mpSelf = 0;
+}
+
+::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > EnhancedPosition::GetVersion()
+{
+ ::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > Version;
+
+ Version._1 = 2;
+ Version._2 = 0;
+ Version._3 = 0;
+ Version._4 = std::string("04-06-2013");
+
+ return Version;
+}
+
+std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetData(const std::vector< uint16_t >& valuesToReturn)
+{
+ std::map< uint16_t, ::DBus::Variant > Data;
+
+ TGNSSPosition pos;
+ TGNSSCourse course;
+
+ bool isPosRequested = false;
+ bool isCourseRequested = false;
+
+ for (int i = 0; i < valuesToReturn.size(); i++)
+ {
+ if ((valuesToReturn[i] == POS_LATITUDE) ||
+ (valuesToReturn[i] == POS_LONGITUDE) ||
+ (valuesToReturn[i] == POS_ALTITUDE))
+ {
+ //if any of the three IDs above is set, then gnssSimpleGetPosition will have to be called
+ isPosRequested = true;
+ }
+
+ if ((valuesToReturn[i] == POS_HEADING) ||
+ (valuesToReturn[i] == POS_SPEED) ||
+ (valuesToReturn[i] == POS_CLIMB ))
+ {
+ //if any of the three IDs above is set, then gnssSimpleGetCourse will have to be called
+ isCourseRequested = true;
+ }
+ }
+
+ if(isPosRequested)
+ {
+ if(gnssSimpleGetPosition(&pos))
+ {
+ if (pos.validityBits && GNSS_POSITION_LATITUDE_VALID)
+ {
+ Data[POS_LATITUDE] = variant_double(pos.latitude);
+ }
+
+ if (pos.validityBits && GNSS_POSITION_LONGITUDE_VALID)
+ {
+ Data[POS_LONGITUDE] = variant_double(pos.longitude);
+ }
+
+ if (pos.validityBits && GNSS_POSITION_ALTITUDE_VALID)
+ {
+ Data[POS_ALTITUDE] = variant_int32(pos.altitude);
+ }
+ }
+ }
+
+ if(isCourseRequested)
+ {
+ if(gnssSimpleGetCourse(&course))
+ {
+ if (course.validityBits && GNSS_COURSE_SPEED_VALID)
+ {
+ Data[POS_HEADING] = variant_int32(course.heading);
+ }
+
+ if (course.validityBits && GNSS_COURSE_CLIMB_VALID)
+ {
+ Data[POS_SPEED] = variant_double(course.speed);
+ }
+
+ if (course.validityBits && GNSS_COURSE_HEADING_VALID)
+ {
+ Data[POS_CLIMB] = variant_int32(course.climb);
+ }
+ }
+ }
+
+ return Data;
+}
+
+std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetPosition()
+{
+ std::map< uint16_t, ::DBus::Variant > Position;
+ TGNSSPosition pos;
+ TGNSSCourse course;
+
+ if (gnssSimpleGetPosition(&pos))
+ {
+ if (pos.validityBits && GNSS_POSITION_LATITUDE_VALID)
+ {
+ Position[POS_LATITUDE] = variant_double(pos.latitude);
+ }
+
+ if (pos.validityBits && GNSS_POSITION_LONGITUDE_VALID)
+ {
+ Position[POS_LONGITUDE] = variant_double(pos.longitude);
+ }
+
+ if (pos.validityBits && GNSS_POSITION_ALTITUDE_VALID)
+ {
+ Position[POS_ALTITUDE] = variant_int32(pos.altitude);
+ }
+ }
+
+ if(gnssSimpleGetCourse(&course))
+ {
+ if (pos.validityBits && GNSS_COURSE_SPEED_VALID)
+ {
+ Position[POS_HEADING] = variant_int32(course.heading);
+ }
+
+ if (pos.validityBits && GNSS_COURSE_CLIMB_VALID)
+ {
+ Position[POS_SPEED] = variant_double(course.speed);
+ }
+
+ if (pos.validityBits && GNSS_COURSE_HEADING_VALID)
+ {
+ Position[POS_CLIMB] = variant_int32(course.climb);
+ }
+ }
+
+ return Position;
+}
+
+std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetRotationRate()
+{
+ std::map< uint16_t, ::DBus::Variant > RotationRate;
+
+ throw DBus::ErrorNotSupported("Method not supported yet");
+
+ return RotationRate;
+}
+
+std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetAccuracy()
+{
+ std::map< uint16_t, ::DBus::Variant > Accuracy;
+
+ throw DBus::ErrorNotSupported("Method not supported yet");
+
+ return Accuracy;
+}
+
+std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetSatelliteInfo()
+{
+ std::map< uint16_t, ::DBus::Variant > SatelliteInfo;
+
+ throw DBus::ErrorNotSupported("Method not supported yet");
+
+ return SatelliteInfo;
+}
+
+std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetStatus()
+{
+ std::map< uint16_t, ::DBus::Variant > Status;
+
+ throw DBus::ErrorNotSupported("Method not supported yet");
+
+ return Status;
+}
+
+std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetTime()
+{
+ std::map< uint16_t, ::DBus::Variant > Time;
+
+ throw DBus::ErrorNotSupported("Method not supported yet");
+
+ return Time;
+}
+
+void EnhancedPosition::cbPosition(const TGNSSPosition pos[], uint16_t numElements)
+{
+ bool latChanged = false;
+ bool lonChanged = false;
+ bool altChanged = false;
+
+ std::vector< uint16_t > position;
+
+ if (pos == NULL || numElements < 1)
+ {
+ LOG_ERROR_MSG(gCtx,"cbPosition failed!");
+ return;
+ }
+
+ for (int i = 0; i< numElements; i++)
+ {
+ LOG_INFO(gCtx,"Position Update[%d/%d]: lat=%f lon=%f alt=%f",
+ i+1,
+ numElements,
+ pos[i].latitude,
+ pos[i].longitude,
+ pos[i].altitude);
+
+ if (latChanged == false)
+ {
+ latChanged = (pos[i].validityBits && GNSS_POSITION_LATITUDE_VALID);
+ }
+
+ if (lonChanged == false)
+ {
+ lonChanged = (pos[i].validityBits && GNSS_POSITION_LONGITUDE_VALID);
+ }
+
+ if (altChanged == false)
+ {
+ altChanged = (pos[i].validityBits && GNSS_POSITION_ALTITUDE_VALID);
+ }
+
+ }
+
+ //in a real product, the coordinates would be used for dead-reckoning.
+ //in this proof of concept, the client application is simply notified
+ //about changes of latitude, longitude and/or altitude
+ std::vector< uint16_t > changedValues;
+ std::vector<uint16_t>::iterator it;
+ it = changedValues.begin();
+
+ if (latChanged)
+ {
+ it = changedValues.insert(it,POS_LATITUDE);
+ }
+
+ if (lonChanged)
+ {
+ it = changedValues.insert(it,POS_LONGITUDE);
+ }
+
+ if (altChanged)
+ {
+ it = changedValues.insert(it,POS_ALTITUDE);
+ }
+
+ if (!mpSelf)
+ {
+ LOG_ERROR_MSG(gCtx,"Null pointer!");
+ return;
+ }
+
+ //notify clients
+ mpSelf->PositionUpdate(changedValues);
+}
+
+void EnhancedPosition::cbCourse(const TGNSSCourse course[], uint16_t numElements)
+{
+ bool speedChanged = false;
+ bool headingChanged = false;
+ bool climbChanged = false;
+
+ if (course == NULL || numElements < 1)
+ {
+ LOG_ERROR_MSG(gCtx,"cbCourse failed!");
+ return;
+ }
+
+ for (int i = 0; i < numElements; i++)
+ {
+ LOG_INFO(gCtx,"Course Update[%d/%d]: speed=%f heading=%f climb=%f",
+ i+1,
+ numElements,
+ course[i].speed,
+ course[i].heading,
+ course[i].climb);
+
+ if (speedChanged == false)
+ {
+ speedChanged = (course[i].validityBits && GNSS_COURSE_SPEED_VALID);
+ }
+
+ if (headingChanged == false)
+ {
+ headingChanged = (course[i].validityBits && GNSS_COURSE_HEADING_VALID);
+ }
+
+ if (climbChanged == false)
+ {
+ climbChanged = (course[i].validityBits && GNSS_COURSE_CLIMB_VALID);
+ }
+ }
+
+ //in a real product, the course would be used for dead-reckoning.
+ //in this proof of concept, the client application is simply notified
+ //about changes of speed, heading and/or climb
+ std::vector< uint16_t > changedValues;
+ std::vector<uint16_t>::iterator it;
+ it = changedValues.begin();
+
+ if (speedChanged)
+ {
+ it = changedValues.insert(it,POS_SPEED);
+ }
+
+ if (headingChanged)
+ {
+ it = changedValues.insert(it,POS_HEADING);
+ }
+
+ if (climbChanged)
+ {
+ it = changedValues.insert(it,POS_CLIMB);
+ }
+
+ if (!mpSelf)
+ {
+ LOG_ERROR_MSG(gCtx,"Null pointer!");
+ return;
+ }
+
+ //notify clients
+ mpSelf->PositionUpdate(changedValues);
+}
+
+void EnhancedPosition::cbAccuracy(const TGNSSAccuracy accuracy[], uint16_t numElements)
+{
+ //satellite info
+ bool usedSatellitesChanged = false;
+ bool trackedSatellitesChanged = false;
+ bool visibleSatellitesChanged = false;
+
+ //status
+ bool fixStatusChanged = false;
+ bool fixTypeBitsChanged = false;
+
+ //accuracy
+ bool pdopChanged = false;
+ bool hdopChanged = false;
+ bool vdopChanged = false;
+ bool sigmaLatitudeChanged = false;
+ bool sigmaLongitudeChanged = false;
+ bool sigmaAltitudeChanged = false;
+
+ if (accuracy == NULL || numElements < 1)
+ {
+ LOG_ERROR_MSG(gCtx,"cbAccuracy failed!");
+ return;
+ }
+
+ for (int i = 0; i< numElements; i++)
+ {
+ LOG_INFO(gCtx,"Accuracy Update[%d/%d]: usedSatellites=%d trackedSatellites=%d visibleSatellites=%d",
+ i+1,
+ numElements,
+ accuracy[i].usedSatellites,
+ accuracy[i].trackedSatellites,
+ accuracy[i].visibleSatellites);
+
+ LOG_INFO(gCtx,"Accuracy Update[%d/%d]: fixStatus=%d fixTypeBits=0x%08X",
+ i+1,
+ numElements,
+ accuracy[i].fixStatus,
+ accuracy[i].fixTypeBits);
+
+ LOG_INFO(gCtx,"Accuracy Update[%d/%d]: pdop=%f hdop=%f vdop=%f \
+ sigmaLatitude=%f sigmaLongitude=%f sigmaAltitude=%f",
+ i+1,
+ numElements,
+ accuracy[i].pdop,
+ accuracy[i].hdop,
+ accuracy[i].vdop,
+ accuracy[i].sigmaLatitude,
+ accuracy[i].sigmaLongitude,
+ accuracy[i].sigmaAltitude);
+
+ if (usedSatellitesChanged == false)
+ {
+ usedSatellitesChanged = (accuracy[i].validityBits && GNSS_ACCURACY_USAT_VALID);
+ }
+
+ if (trackedSatellitesChanged == false)
+ {
+ trackedSatellitesChanged = (accuracy[i].validityBits && GNSS_ACCURACY_TSAT_VALID);
+ }
+
+ if (visibleSatellitesChanged == false)
+ {
+ visibleSatellitesChanged = (accuracy[i].validityBits && GNSS_ACCURACY_VSAT_VALID);
+ }
+
+ if (fixStatusChanged == false)
+ {
+ fixStatusChanged = (accuracy[i].validityBits && GNSS_ACCURACY_STAT_VALID);
+ }
+
+ if (fixTypeBitsChanged == false)
+ {
+ fixTypeBitsChanged = (accuracy[i].validityBits && GNSS_ACCURACY_TYPE_VALID);
+ }
+
+ if (pdopChanged == false)
+ {
+ pdopChanged = (accuracy[i].validityBits && GNSS_ACCURACY_PDOP_VALID);
+ }
+
+ if (hdopChanged == false)
+ {
+ hdopChanged = (accuracy[i].validityBits && GNSS_ACCURACY_HDOP_VALID);
+ }
+
+ if (vdopChanged == false)
+ {
+ vdopChanged = (accuracy[i].validityBits && GNSS_ACCURACY_VDOP_VALID);
+ }
+
+ if (sigmaLatitudeChanged == false)
+ {
+ sigmaLatitudeChanged = (accuracy[i].validityBits && GNSS_ACCURACY_SLAT_VALID);
+ }
+
+ if (sigmaLongitudeChanged == false)
+ {
+ sigmaLongitudeChanged = (accuracy[i].validityBits && GNSS_ACCURACY_SLON_VALID);
+ }
+
+ if (sigmaAltitudeChanged == false)
+ {
+ sigmaAltitudeChanged = (accuracy[i].validityBits && GNSS_ACCURACY_SALT_VALID);
+ }
+ }
+
+ //in a real product, the accuracy would be used for dead-reckoning.
+ //in this proof of concept, the client application is simply notified
+ //about accuracy changes
+ std::vector<uint16_t>::iterator it;
+
+ std::vector< uint16_t > changedSatelliteInfoValues;
+ it = changedSatelliteInfoValues.begin();
+
+ if (usedSatellitesChanged)
+ {
+ it = changedSatelliteInfoValues.insert(it,POS_USED_SATELLITES);
+ }
+
+ if (trackedSatellitesChanged)
+ {
+ it = changedSatelliteInfoValues.insert(it,POS_TRACKED_SATELLITES);
+ }
+
+ if (visibleSatellitesChanged)
+ {
+ it = changedSatelliteInfoValues.insert(it,POS_VISIBLE_SATELLITES);
+ }
+
+ //todo: handle other field-changes here (accuracy and status)
+
+ if (!mpSelf)
+ {
+ LOG_ERROR_MSG(gCtx,"Null pointer!");
+ return;
+ }
+
+ mpSelf->SatelliteInfoUpdate(changedSatelliteInfoValues);
+
+ //todo: send other notifications
+ //mpSelf->AccuracyUpdate(changedAccuracyValues);
+ //mpSelf->StatusUpdate(changedStatusValues);
+}
+
+void EnhancedPosition::cbSatelliteDetail(const TGNSSSatelliteDetail satelliteDetail[], uint16_t numElements)
+{
+ if (satelliteDetail == NULL || numElements < 1)
+ {
+ LOG_ERROR_MSG(gCtx,"cbSatelliteDetail failed!");
+ return;
+ }
+
+ for (int i = 0; i<numElements; i++)
+ {
+ LOG_INFO(gCtx,"SatelliteDetail Update[%d/%d]: satelliteId=%d azimuth=%d elevation=%d SNR=%d",
+ i+1,
+ numElements,
+ satelliteDetail[i].satelliteId,
+ satelliteDetail[i].azimuth,
+ satelliteDetail[i].elevation,
+ satelliteDetail[i].SNR);
+ }
+
+ if (!mpSelf)
+ {
+ LOG_ERROR_MSG(gCtx,"Null pointer!");
+ return;
+ }
+
+ //todo: notify clients
+ //mpSelf->SatelliteInfoUpdate(changedValues);
+}
+
+bool EnhancedPosition::checkMajorVersion(int expectedMajor)
+{
+ int major = -1;
+
+ gnssGetVersion(&major, 0, 0);
+
+ if (major != expectedMajor)
+ {
+ LOG_ERROR(gCtx,"Wrong API version: gnssGetVersion returned unexpected value %d != %d",
+ major,
+ expectedMajor);
+
+ return false;
+ }
+
+ return true;
+}
+
+void EnhancedPosition::run()
+{
+ if(!checkMajorVersion(2))
+ {
+ exit(EXIT_FAILURE);
+ }
+
+ if(!gnssInit())
+ {
+ exit(EXIT_FAILURE);
+ }
+
+ if(!gnssSimpleInit())
+ {
+ exit(EXIT_FAILURE);
+ }
+
+ LOG_INFO_MSG(gCtx,"Starting EnhancedPosition dispatcher...");
+
+ gnssSimpleRegisterPositionCallback(&cbPosition);
+ gnssSimpleRegisterCourseCallback(&cbCourse);
+ gnssExtendedRegisterAccuracyCallback(&cbAccuracy);
+ gnssExtendedRegisterSatelliteDetailCallback(&cbSatelliteDetail);
+}
+
+void EnhancedPosition::shutdown()
+{
+ LOG_INFO_MSG(gCtx,"shutting down...");
+
+ gnssSimpleDeregisterPositionCallback(&cbPosition);
+ gnssSimpleDeregisterCourseCallback(&cbCourse);
+ gnssExtendedDeregisterAccuracyCallback(&cbAccuracy);
+ gnssExtendedDeregisterSatelliteDetailCallback(&cbSatelliteDetail);
+ gnssSimpleDestroy();
+ gnssDestroy();
+}
+
+
diff --git a/enhanced-position-service/src/enhanced-position.h b/enhanced-position-service/src/enhanced-position.h
new file mode 100644
index 0000000..af76a98
--- /dev/null
+++ b/enhanced-position-service/src/enhanced-position.h
@@ -0,0 +1,74 @@
+/**************************************************************************
+* @licence app begin@
+*
+* SPDX-License-Identifier: MPL-2.0
+*
+* \ingroup EnhancedPositionService
+* \author Marco Residori <marco.residori@xse.de>
+*
+* \copyright Copyright (C) 2014, XS Embedded GmbH
+*
+* \license
+* This Source Code Form is subject to the terms of the
+* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*
+* @licence end@
+**************************************************************************/
+#ifndef ___ENHANCED_POSITION_H
+#define ___ENHANCED_POSITION_H
+
+#include <dbus-c++/dbus.h>
+
+#include "enhanced-position-adaptor.h"
+#include "gnss.h"
+#include "gnss-simple.h"
+#include "gnss-ext.h"
+
+class EnhancedPosition
+ : public org::genivi::positioning::EnhancedPosition_adaptor
+ , public DBus::IntrospectableAdaptor
+ , public DBus::ObjectAdaptor
+{
+public:
+
+ EnhancedPosition(DBus::Connection & connection, const char * path);
+
+ ~EnhancedPosition();
+
+ ::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > GetVersion();
+
+ std::map< uint16_t, ::DBus::Variant > GetData(const std::vector< uint16_t >& valuesToReturn);
+
+ std::map< uint16_t, ::DBus::Variant > GetPosition();
+
+ std::map< uint16_t, ::DBus::Variant > GetRotationRate();
+
+ std::map< uint16_t, ::DBus::Variant > GetAccuracy();
+
+ std::map< uint16_t, ::DBus::Variant > GetSatelliteInfo();
+
+ std::map< uint16_t, ::DBus::Variant > GetStatus();
+
+ std::map< uint16_t, ::DBus::Variant > GetTime();
+
+ void run();
+
+ void shutdown();
+
+private:
+
+ bool checkMajorVersion(int expectedMajor);
+
+ static void cbSatelliteDetail(const TGNSSSatelliteDetail satelliteDetail[], uint16_t numElements);
+
+ static void cbAccuracy(const TGNSSAccuracy accuracy[], uint16_t numElements);
+
+ static void cbCourse(const TGNSSCourse course[], uint16_t numElements);
+
+ static void cbPosition(const TGNSSPosition pos[], uint16_t numElements);
+
+ static EnhancedPosition* mpSelf;
+};
+
+#endif//__ENHANCED_POSITION_H
diff --git a/enhanced-position-service/src/genivi-dbus-types.h b/enhanced-position-service/src/genivi-dbus-types.h
deleted file mode 100644
index 76d121a..0000000
--- a/enhanced-position-service/src/genivi-dbus-types.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#ifndef GENIVI_DBUS_TYPES_H_
-#define GENIVI_DBUS_TYPES_H_
-
-#include "genivi-version.h"
-
-#endif /* GENIVI_DBUS_TYPES_H_ */
diff --git a/enhanced-position-service/src/genivi-navigationcore-enum.h b/enhanced-position-service/src/genivi-navigationcore-enum.h
deleted file mode 100644
index 897c51a..0000000
--- a/enhanced-position-service/src/genivi-navigationcore-enum.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-
-#ifndef GENIVI_NAVIGATIONCORE_ENUM
-#define GENIVI_NAVIGATIONCORE_ENUM
-
-class Base {
-public:
- enum {
- INVALID = 0x0000,
- TIMESTAMP = 0x0001,
- ALL = 0xffff
- };
-};
-
-class Position {
-public:
- enum {
- LATITUDE = 0x0020,
- LONGITUDE = 0x0021,
- ALTITUDE = 0x0022
- };
-};
-
-class Course {
-public:
- enum {
- HEADING = 0x0030,
- SPEED = 0x0031,
- CLIMB = 0x0032
- };
-};
-
-class Address : public Base {
-public:
- enum {
- COUNTRY = 0x0040,
- CITY = 0x0041,
- STREET = 0x0042,
- NUMBER = 0x0043,
- CROSSING = 0x0044,
- DISTRICT = 0x0045,
- TIMEZONE_OFFSET = 0x0046,
- DAYLIGHT_OFFSET = 0x0047,
- MATCH_TYPE = 0x0048
- };
-};
-
-class RotationRate : public Base {
-public:
- enum {
- ROLL_RATE = 0x0060,
- PITCH_RATE = 0x0061,
- YAW_RATE = 0x0062
- };
-};
-
-class EnhancedPositionStatus : public Base {
-public:
- enum {
- GNSS_FIX_STATUS = 0x0070,
- DR_STATUS = 0x0071
- };
-};
-
-class MapMatchedPositionStatus : public EnhancedPositionStatus {
-public:
- enum {
- MM_STATUS = 0x0072
- };
-};
-
-class Accuracy : public EnhancedPositionStatus {
-public:
- enum {
- PDOP = 0x0080,
- HDOP = 0x0081,
- VDOP = 0x0082,
- SIGMA_LATITUDE = 0x0083,
- SIGMA_LONGITUDE = 0x0084,
- SIGMA_ALTITUDE = 0x0085,
- SIGMA_HEADING = 0x0086,
- FILTER_STATUS = 0x0087
- };
-};
-
-class SatelliteInfo : public Base {
-public:
- enum {
- USED_SATELLITES = 0x0090,
- TRACKED_SATELLITES = 0x0091,
- VISIBLE_SATELLITES = 0x0092,
- SATELLITE_DETAILS = 0x0093
- };
-};
-
-class EnhancedPosition : public Base, public Position, public Course {
-public:
- enum {
- // emtpy
- };
-};
-
-class EnhancedPositionData :
- public EnhancedPosition,
- public Accuracy
-{
-public:
- enum {
- // empty
- };
-};
-
-class Time : public Base {
-public:
- enum {
- YEAR = 0x00a0,
- MONTH = 0x00a1,
- DAY = 0x00a2,
- HOUR = 0x00a3,
- MINUTE = 0x00a4,
- SECOND = 0x00a5,
- MS = 0x00a6
- };
-};
-
-
-#endif
diff --git a/enhanced-position-service/src/genivi-version.cpp b/enhanced-position-service/src/genivi-version.cpp
deleted file mode 100644
index 9938ee7..0000000
--- a/enhanced-position-service/src/genivi-version.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-
-#include "genivi-version.h"
-
-#define DUMMY_VERSION_MAJOR (0)
-#define DUMMY_VERSION_MINOR (0)
-#define DUMMY_VERSION_MICRO (0)
-#define DUMMY_VERSION_DATE "2011-07-25"
-
-GeniviVersion::GeniviVersion()
- : _major(DUMMY_VERSION_MAJOR),
- _minor(DUMMY_VERSION_MINOR),
- _micro(DUMMY_VERSION_MICRO)
-{
- // qDebug() << "ktor: " << _major << _minor << _micro;
-}
-
-GeniviVersion::GeniviVersion(uint major, uint minor, uint micro)
-: _major(major),
- _minor(minor),
- _micro(micro)
-{
- // qDebug() << "ktor: ..." << _major << _minor << _micro;
-}
-
-GeniviVersion::~GeniviVersion()
-{
- // TODO
-}
-
-void GeniviVersion::setVersion(uint major, uint minor, uint micro)
-{
- _major = major;
- _minor = minor;
- _micro = micro;
-}
-
-uint GeniviVersion::getMajorVersion() const
-{
- return _major;
-}
-
-uint GeniviVersion::getMinorVersion() const
-{
- return _minor;
-}
-
-uint GeniviVersion::getMicroVersion() const
-{
- return _micro;
-}
-
-// Marshall the MyStructure data into a D-BUS argument
-QDBusArgument &operator<<(QDBusArgument &argument, const GeniviVersion &mystruct)
-{
- argument.beginStructure();
- argument << mystruct.getMajorVersion()
- << mystruct.getMinorVersion()
- << mystruct.getMicroVersion();
- //<< "unknown";
- argument.endStructure();
- return argument;
-}
-
-// Retrieve the MyStructure data from the D-BUS argument
-const QDBusArgument &operator>>(const QDBusArgument &argument, GeniviVersion &mystruct)
-{
- uint major;
- uint minor;
- uint micro;
- //QString date;
-
- argument.beginStructure();
- argument >> major >> minor >> micro; /* date */
- argument.endStructure();
-
- mystruct.setVersion(major, minor, micro);
-
- return argument;
-}
-
-QDBusArgument &operator<<(QDBusArgument &argument, const MapIntVariant &myMap)
-{
- QMap<int, QVariant>::const_iterator i;
- argument.beginMap( QVariant::Int, qMetaTypeId<QDBusVariant>() );
- for (i = myMap.constBegin(); i != myMap.constEnd(); ++i) {
- argument.beginMapEntry();
- argument << i.key() << QDBusVariant(i.value());
- argument.endMapEntry();
- }
- argument.endMap();
- return argument;
-}
-
-const QDBusArgument &operator>>(const QDBusArgument &argument, MapIntVariant &myMap)
-{
- argument.beginMap();
- myMap.clear();
- while ( !argument.atEnd() ) {
- // argument
- int key;
- QVariant value;
- argument.beginMapEntry();
- argument >> key >> value;
- argument.endMapEntry();
- myMap.insert(key, value);
- }
- argument.endMap();
- return argument;
-}
-
-QDBusArgument &operator<<(QDBusArgument &argument, const MapUShortVariant &myMap)
-{
- QMap<ushort, QVariant>::const_iterator i;
- argument.beginMap(qMetaTypeId<ushort>(), qMetaTypeId<QDBusVariant>());
-
- for (i = myMap.constBegin(); i != myMap.constEnd(); ++i) {
- argument.beginMapEntry();
- argument << i.key() << QDBusVariant(i.value());
- argument.endMapEntry();
- }
- argument.endMap();
- return argument;
-}
-
-const QDBusArgument &operator>>(const QDBusArgument &argument,
- MapUShortVariant &myMap)
-{
- argument.beginMap();
- myMap.clear();
- while ( !argument.atEnd() ) {
- // argument
- ushort key;
- QVariant value;
- argument.beginMapEntry();
- argument >> key >> value;
- argument.endMapEntry();
- myMap.insert(key, value);
- }
- argument.endMap();
- return argument;
-}
diff --git a/enhanced-position-service/src/genivi-version.h b/enhanced-position-service/src/genivi-version.h
deleted file mode 100644
index 5f0d8ac..0000000
--- a/enhanced-position-service/src/genivi-version.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/**************************************************************************
- * Part of GENIVI Proof of Concept for Positioning
- * Copyright (C) BMW Car IT GmbH 2011, 2012
- **************************************************************************/
-
-
-#ifndef GENIVI_VERSION_H_
-#define GENIVI_VERSION_H_
-
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QMetaType>
-#include <QtDBus/QtDBus>
-
-class GeniviVersion {
-public:
- GeniviVersion();
- GeniviVersion(uint major, uint minor, uint micro=0);
- virtual ~GeniviVersion();
-
- void setVersion(uint major, uint minor, uint micro);
-
- uint getMajorVersion() const;
- uint getMinorVersion() const;
- uint getMicroVersion() const;
-
-private:
- uint _major;
- uint _minor;
- uint _micro;
- //QString date; // TODO fix issue with defect dereference
-};
-
-typedef QMap<int,QVariant> MapIntVariant;
-typedef QMap<ushort,QVariant> MapUShortVariant;
-
-Q_DECLARE_METATYPE(GeniviVersion);
-Q_DECLARE_METATYPE(QList<bool>);
-Q_DECLARE_METATYPE(QList<int>);
-Q_DECLARE_METATYPE(QList<ushort>);
-Q_DECLARE_METATYPE(QList<QString>);
-Q_DECLARE_METATYPE(MapUShortVariant);
-Q_DECLARE_METATYPE(MapIntVariant);
-
-inline void registerCommTypes() {
- qDebug("registerCommTypes: GeniviVersion");
- qDBusRegisterMetaType<GeniviVersion >();
- qDBusRegisterMetaType<QList<bool> >();
- qDBusRegisterMetaType<QList<int> >();
- qDBusRegisterMetaType<QList<ushort> >();
- qDBusRegisterMetaType<QList<QString> >();
- qDBusRegisterMetaType<MapIntVariant >();
- qDBusRegisterMetaType<MapUShortVariant >();
-}
-
-
-QDBusArgument &operator<<(QDBusArgument &argument, const GeniviVersion &mystruct);
-const QDBusArgument &operator>>(const QDBusArgument &argument,
- GeniviVersion &mystruct);
-
-QDBusArgument &operator<<(QDBusArgument &argument, const MapIntVariant &myMap);
-const QDBusArgument &operator>>(const QDBusArgument &argument,
- MapIntVariant &myMap);
-
-QDBusArgument &operator<<(QDBusArgument &argument, const MapUShortVariant &myMap);
-const QDBusArgument &operator>>(const QDBusArgument &argument,
- MapUShortVariant &myMap);
-
-#endif /* GENIVI_VERSION_H_ */
diff --git a/enhanced-position-service/src/log.h b/enhanced-position-service/src/log.h
new file mode 100644
index 0000000..f310461
--- /dev/null
+++ b/enhanced-position-service/src/log.h
@@ -0,0 +1,137 @@
+/**************************************************************************
+* @licence app begin@
+*
+* SPDX-License-Identifier: MPL-2.0
+*
+* \ingroup GNSSService
+*
+* \copyright Copyright (C) BMW Car IT GmbH 2011
+* Copyright (C) 2013, XS Embedded GmbH
+*
+* \license
+* This Source Code Form is subject to the terms of the
+* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*
+* @licence end@
+**************************************************************************/
+
+#ifndef INCLUDE_LOG
+#define INCLUDE_LOG
+
+// turn-on via cmake define:
+// $ cmake -DWITH_DLT=1 ..
+
+#if (!DLT_ENABLED)
+/*****************************************************************************/
+// use printf
+#include <stdio.h>
+
+// some type-name used instead of DLT context
+typedef const char* NoDltContext;
+
+#define DLT_DECLARE_CONTEXT(CONTEXT) \
+ NoDltContext CONTEXT;
+
+#define DLT_IMPORT_CONTEXT(CONTEXT) \
+ extern NoDltContext CONTEXT;
+
+#define DLT_REGISTER_CONTEXT(CONTEXT, CONTEXT_ID, DESC) \
+ CONTEXT = CONTEXT_ID;
+
+#define DLT_REGISTER_APP(CONTEXT, DESC) ;
+
+#define DLT_UNREGISTER_CONTEXT(CONTEXT) ;
+#define DLT_UNREGISTER_APP() ;
+#define dlt_free() ;
+
+// log calls
+#define LOG_VERBOSE_MSG(context, msg) \
+ fprintf(stderr, "[VERBO][%4s] " msg "\n", context)
+#define LOG_VERBOSE(context, fmt, ...) \
+ fprintf(stderr, "[VERBO][%4s] " fmt "\n", context, __VA_ARGS__)
+
+#define LOG_DEBUG_MSG(context, msg) \
+ fprintf(stderr, "[DEBUG][%4s] " msg "\n", context)
+#define LOG_DEBUG(context, fmt, ...) \
+ fprintf(stderr, "[DEBUG][%4s] " fmt "\n", context, __VA_ARGS__)
+
+#define LOG_INFO_MSG(context, msg) \
+ fprintf(stderr, "[INFO ][%4s] " msg "\n", context)
+#define LOG_INFO(context, fmt, ...) \
+ fprintf(stderr, "[INFO ][%4s] " fmt "\n", context, __VA_ARGS__)
+
+#define LOG_WARNING_MSG(context, msg) \
+ fprintf(stderr, "[WARN ][%4s] " msg "\n", context)
+#define LOG_WARNING(context, fmt, ...) \
+ fprintf(stderr, "[WARN ][%4s] " fmt "\n", context, __VA_ARGS__)
+
+#define LOG_ERROR_MSG(context, msg) \
+ fprintf(stderr, "[ERROR][%4s] " msg "\n", context)
+#define LOG_ERROR(context, fmt, ...) \
+ fprintf(stderr, "[ERROR][%4s] " fmt "\n", context, __VA_ARGS__)
+
+#define LOG_FATAL_MSG(context, msg) \
+ fprintf(stderr, "[FATAL][%4s] " msg "\n", context)
+#define LOG_FATAL(context, fmt, ...) \
+ fprintf(stderr, "[FATAL][%4s] " fmt "\n", context, __VA_ARGS__)
+
+#else /* DLT_ENABLED */
+/*****************************************************************************/
+// use DLT
+#include "dlt.h"
+
+typedef const char* Context;
+
+#define LOG_VERBOSE_MSG(context, msg) \
+ DLT_LOG(context, DLT_LOG_VERBOSE, DLT_STRING(msg));
+#define LOG_VERBOSE(context, fmt, ...) \
+ { \
+ char logBuffer[256]; \
+ sprintf(logBuffer, fmt, __VA_ARGS__); \
+ DLT_LOG(context, DLT_LOG_VERBOSE, DLT_STRING(logBuffer)); \
+ }
+#define LOG_DEBUG_MSG(context, msg) \
+ DLT_LOG(context, DLT_LOG_DEBUG, DLT_STRING(msg));
+#define LOG_DEBUG(context, fmt, ...) \
+ { \
+ char logBuffer[256]; \
+ sprintf(logBuffer, fmt, __VA_ARGS__); \
+ DLT_LOG(context, DLT_LOG_DEBUG, DLT_STRING(logBuffer)); \
+ }
+#define LOG_INFO_MSG(context, msg) \
+ DLT_LOG(context, DLT_LOG_INFO, DLT_STRING(msg));
+#define LOG_INFO(context, fmt, ...) \
+ { \
+ char logBuffer[256]; \
+ sprintf(logBuffer, fmt, __VA_ARGS__); \
+ DLT_LOG(context, DLT_LOG_INFO, DLT_STRING(logBuffer)); \
+ }
+#define LOG_WARNING_MSG(context, msg) \
+ DLT_LOG(context, DLT_LOG_WARN, DLT_STRING(msg));
+#define LOG_WARNING(context, fmt, ...) \
+ { \
+ char logBuffer[256]; \
+ sprintf(logBuffer, fmt, __VA_ARGS__); \
+ DLT_LOG(context, DLT_LOG_WARN, DLT_STRING(logBuffer)); \
+ }
+#define LOG_ERROR_MSG(context, msg) \
+ DLT_LOG(context, DLT_LOG_ERROR, DLT_STRING(msg));
+#define LOG_ERROR(context, fmt, ...) \
+ { \
+ char logBuffer[256]; \
+ sprintf(logBuffer, fmt, __VA_ARGS__); \
+ DLT_LOG(context, DLT_LOG_ERROR, DLT_STRING(logBuffer)); \
+ }
+#define LOG_FATAL_MSG(context, msg) \
+ DLT_LOG(context, DLT_LOG_FATAL, DLT_STRING(msg));
+#define LOG_FATAL(context, fmt, ...) \
+ { \
+ char logBuffer[256]; \
+ sprintf(logBuffer, fmt, __VA_ARGS__); \
+ DLT_LOG(context, DLT_LOG_FATAL, DLT_STRING(logBuffer)); \
+ }
+
+#endif /* DLT_ENABLED */
+
+#endif /* INCLUDE_LOG */
diff --git a/enhanced-position-service/src/main.cpp b/enhanced-position-service/src/main.cpp
index 3fca398..649d8b3 100644
--- a/enhanced-position-service/src/main.cpp
+++ b/enhanced-position-service/src/main.cpp
@@ -4,8 +4,9 @@
* SPDX-License-Identifier: MPL-2.0
*
* \ingroup EnhancedPositionService
+* \author Marco Residori <marco.residori@xse.de>
*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
+* \copyright Copyright (C) 2014, XS Embedded GmbH
*
* \license
* This Source Code Form is subject to the terms of the
@@ -15,42 +16,67 @@
* @licence end@
**************************************************************************/
-#include "serverimpl.h"
-#include "demoifadaptor.h"
+#include <stdio.h>
+#include <signal.h>
+#include <dbus-c++/dbus.h>
-#include "ConfigurationImpl.h"
-#include "confifadaptor.h"
+#include "enhanced-position.h"
+#include "position-feedback.h"
+#include "configuration.h"
+#include "log.h"
-// e.g. testing with dbus-launch
-#define USE_DBUS_SESSION_BUS 1
+const char* ENHANCED_POSITION_SERVICE_NAME = "org.genivi.positioning.EnhancedPosition";
+const char* ENHANCED_POSITION_OBJECT_PATH = "/org/genivi/positioning/EnhancedPosition";
+const char* POSITION_FEEDBACK_OBJECT_PATH = "/org/genivi/positioning/PositionFeedback";
+const char* CONFIGURATION_OBJECT_PATH = "/org/genivi/positioning/Configuration";
-int main(int argc, char *argv[])
+DLT_DECLARE_CONTEXT(gCtx);
+
+DBus::BusDispatcher dispatcher;
+
+static DBus::Connection *conn;
+
+void sighandler(int sig)
+{
+ LOG_INFO_MSG(gCtx,"Signal received");
+
+ dispatcher.leave();
+}
+
+int main()
{
- QCoreApplication a(argc, argv);
+ DLT_REGISTER_APP("ENHP", "EnhancedPositionService");
+ DLT_REGISTER_CONTEXT(gCtx,"EPSR", "Global Context");
+ LOG_INFO_MSG(gCtx,"starting EnhancedPositionService...");
+
+ signal(SIGTERM, sighandler);
+ signal(SIGINT, sighandler);
- ServerImpl *server = new ServerImpl();
- new DemoIfAdaptor(server);
+ DBus::default_dispatcher = &dispatcher;
- ConfigurationImpl *confServer = new ConfigurationImpl();
- new ConfigurationIfAdaptor(confServer);
+ conn = new DBus::Connection(DBus::Connection::SessionBus());
-#if USE_DBUS_SESSION_BUS
- QDBusConnection connection = QDBusConnection::sessionBus();
-#else
- QDBusConnection connection = QDBusConnection::systemBus();
-#endif
+ if (conn == NULL)
+ {
+ LOG_ERROR_MSG(gCtx,"Null pointer!");
+ }
- server->setConnection(connection);
+ conn->setup(&dispatcher);
+ conn->request_name(ENHANCED_POSITION_SERVICE_NAME);
- bool ret = false;
- ret |= connection.registerService("org.genivi.positioning.EnhancedPosition");
- ret |= connection.registerObject("/position", server);
- ret |= connection.registerObject("/config", confServer);
+ EnhancedPosition EnhancedPositionServer(*conn, ENHANCED_POSITION_OBJECT_PATH);
+ PositionFeedback PositionFeedbackServer(*conn, POSITION_FEEDBACK_OBJECT_PATH);
+ Configuration ConfigurationServer(*conn, CONFIGURATION_OBJECT_PATH);
+
+ EnhancedPositionServer.run();
+ PositionFeedbackServer.run();
+ ConfigurationServer.run();
- if (!ret) {
- return EXIT_FAILURE;
- }
+ dispatcher.enter();
- qDebug() << "loop ...";
- return a.exec();
+ ConfigurationServer.shutdown();
+ PositionFeedbackServer.shutdown();
+ EnhancedPositionServer.shutdown();
+
+ return 0;
}
diff --git a/enhanced-position-service/src/position-feedback.cpp b/enhanced-position-service/src/position-feedback.cpp
new file mode 100644
index 0000000..be5f59e
--- /dev/null
+++ b/enhanced-position-service/src/position-feedback.cpp
@@ -0,0 +1,60 @@
+/**************************************************************************
+* @licence app begin@
+*
+* SPDX-License-Identifier: MPL-2.0
+*
+* \ingroup EnhancedPositionService
+* \author Marco Residori <marco.residori@xse.de>
+*
+* \copyright Copyright (C) 2014, XS Embedded GmbH
+*
+* \license
+* This Source Code Form is subject to the terms of the
+* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*
+* @licence end@
+**************************************************************************/
+
+#include <stdio.h>
+#include "position-feedback.h"
+#include "log.h"
+
+DLT_IMPORT_CONTEXT(gCtx);
+
+PositionFeedback::PositionFeedback(DBus::Connection & connection, const char * path)
+ : DBus::ObjectAdaptor(connection, path)
+{
+}
+
+PositionFeedback::~PositionFeedback()
+{
+}
+
+::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > PositionFeedback::GetVersion()
+{
+ ::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > Version;
+
+ Version._1 = 2;
+ Version._2 = 0;
+ Version._3 = 0;
+ Version._4 = std::string("04-06-2013");
+
+ return Version;
+}
+
+void PositionFeedback::SetPositionFeedback(const std::vector< std::map< uint16_t, ::DBus::Variant > >& feedback, const uint64_t& timestamp, const uint16_t& feedbackType)
+{
+ throw DBus::ErrorNotSupported("Method not supported yet");
+}
+
+void PositionFeedback::run()
+{
+ LOG_INFO_MSG(gCtx,"Starting PositionFeedback dispatcher...");
+}
+
+void PositionFeedback::shutdown()
+{
+}
+
+
diff --git a/enhanced-position-service/src/position-feedback.h b/enhanced-position-service/src/position-feedback.h
new file mode 100644
index 0000000..c030073
--- /dev/null
+++ b/enhanced-position-service/src/position-feedback.h
@@ -0,0 +1,47 @@
+/**************************************************************************
+* @licence app begin@
+*
+* SPDX-License-Identifier: MPL-2.0
+*
+* \ingroup EnhancedPositionService
+* \author Marco Residori <marco.residori@xse.de>
+*
+* \copyright Copyright (C) 2014, XS Embedded GmbH
+*
+* \license
+* This Source Code Form is subject to the terms of the
+* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*
+* @licence end@
+**************************************************************************/
+
+#ifndef ___POSITION_FEEDBACK_H
+#define ___POSITION_FEEDBACK_H
+
+#include <dbus-c++/dbus.h>
+#include "position-feedback-adaptor.h"
+
+class PositionFeedback
+ : public org::genivi::positioning::PositionFeedback_adaptor
+ , public DBus::IntrospectableAdaptor
+ , public DBus::ObjectAdaptor
+{
+
+public:
+
+ PositionFeedback(DBus::Connection & connection, const char * path);
+
+ ~PositionFeedback();
+
+ ::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > GetVersion();
+
+ void SetPositionFeedback(const std::vector< std::map< uint16_t, ::DBus::Variant > >& feedback, const uint64_t& timestamp, const uint16_t& feedbackType);
+
+ void run();
+
+ void shutdown();
+
+};
+
+#endif//___POSITION_FEEDBACK_H
diff --git a/enhanced-position-service/src/serverimpl.cpp b/enhanced-position-service/src/serverimpl.cpp
deleted file mode 100644
index a2f3af5..0000000
--- a/enhanced-position-service/src/serverimpl.cpp
+++ /dev/null
@@ -1,283 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#include "serverimpl.h"
-#include "genivi-navigationcore-enum.h"
-
-#include <iostream>
-
-#include "gnss.h"
-#include "gnss-simple.h"
-
-#include <QtCore/QDateTime>
-
-static ServerImpl* instance;
-
-ServerImpl::ServerImpl(QObject *parent)
- : m_pConnection(NULL)
- , m_posFilter(*PositionFilter::getInstance())
- , m_watcher(NULL)
-{
- qDebug("ServerImpl instantiated.");
- registerCommTypes();
-
- // use GENIVI PosGnss interface.
- gnssInit();
- gnssSimpleInit();
- gnssSimpleRegisterCourseCallback(&PositionFilter::onCourseUpdate);
- gnssSimpleRegisterPositionCallback(&PositionFilter::onPositionUpdate);
-
- // FIXME: how to deal with this? create c++ wrapper for callback API?
- instance = this;
-
- QTimer *timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), this, SLOT(sendUpdate()));
- timer->start(500); // [ms]
-}
-
-ServerImpl::~ServerImpl()
-{
- gnssSimpleDeregisterPositionCallback(&PositionFilter::onPositionUpdate);
- gnssSimpleDeregisterCourseCallback(&PositionFilter::onCourseUpdate);
- gnssSimpleDestroy();
-}
-
-
-void ServerImpl::setConnection(QDBusConnection& conn)
-{
- if (!conn.isConnected())
- qWarning("SetConnection: conn is not connected.");
-
- m_pConnection = &conn;
-
- // setup watcher - detects disappearing clients.
- m_watcher.setConnection(conn);
-}
-
-
-MapUShortVariant ServerImpl::GetAccuracy()
-{
- MapUShortVariant temp; // FIXME: use real values.
- temp.insert(Accuracy::INVALID, "not implemented");
-
- qDebug("%s was called.", __FUNCTION__);
- return temp;
-}
-
-MapUShortVariant ServerImpl::GetData(const QList<ushort> &valuesToReturn)
-{
- MapUShortVariant temp;
-
- QList<ushort> changeList;
- QList<ushort>::const_iterator i;
- for (i = valuesToReturn.begin(); i != valuesToReturn.end(); ++i) {
- qDebug() << "append now" << (ushort)*i;
- m_posFilter.appendElementTo(temp, *i);
- }
-
- if (temp.count() <= 0) {
- temp.insert(EnhancedPosition::INVALID, "no valid position available.");
- qDebug("%s: no valid position available.", __FUNCTION__);
- }
-
- qDebug("%s was called. (%d)", __FUNCTION__, temp.count());
- return temp;
-}
-
-MapUShortVariant ServerImpl::GetPosition()
-{
- MapUShortVariant temp;
-
- qDebug("GetPosition: ..");
-
- QList<ushort> changeList;
- m_posFilter.appendPositionTo(temp);
- m_posFilter.appendCourseTo(temp);
- m_posFilter.appendTimestampTo(temp);
-
- if (temp.count() <= 0)
- temp.insert(EnhancedPosition::INVALID, "no valid position available.");
-
- qDebug("%s was called.", __FUNCTION__);
- return temp;
-}
-
-MapUShortVariant ServerImpl::GetRotationRate()
-{
- MapUShortVariant temp;
-
- if (temp.count() <= 0)
- temp.insert(RotationRate::INVALID, "no valid rotation rate available.");
-
- qDebug("%s was called.", __FUNCTION__);
- return temp;
-}
-
-MapUShortVariant ServerImpl::GetSatelliteInfo()
-{
- MapUShortVariant temp;
- qDebug("%s was called.", __FUNCTION__);
-
- if (message().service().isEmpty())
- return temp;
-
- //
- // NOT IMPLEMENTED, but demonstrates error message
- //
-
- m_pConnection->call(
- message().createErrorReply(
- "org.genivi.positioning.EnhancedPosition.NotImplemented",
- "method 'GetSatelliteInfo' is not implemented."),
- QDBus::NoBlock);
-
- return temp;
-}
-
-MapUShortVariant ServerImpl::GetStatus()
-{
- MapUShortVariant temp;
-
- qDebug("%s was called.", __FUNCTION__);
- temp.insert(EnhancedPositionStatus::DR_STATUS, false);
-
- return temp;
-}
-
-MapUShortVariant ServerImpl::GetTime()
-{
- MapUShortVariant temp;
-
- QDateTime now = QDateTime::currentDateTimeUtc();
- QDate date = now.date();
- QTime time = now.time();
-
- temp.insert(Time::YEAR, date.year());
- temp.insert(Time::MONTH, date.month());
- temp.insert(Time::DAY, date.day());
-
- temp.insert(Time::HOUR, time.hour());
- temp.insert(Time::MINUTE, time.minute());
- temp.insert(Time::SECOND, time.second());
- temp.insert(Time::MS, time.msec());
-
- qDebug("%s was called.", __FUNCTION__);
- return temp;
-}
-
-GeniviVersion ServerImpl::GetVersion()
-{
- GeniviVersion apiVersion(1, 0, 0);
- qDebug("%s was called.", __FUNCTION__);
- return apiVersion;
-}
-
-QDBusConnection* ServerImpl::getConnection()
-{
- return m_pConnection;
-}
-
-// TODO: decide if still part of demo, not call at the moment.
-bool ServerImpl::activateWatcherFor(const QString& uniqueId) {
- // only interested in EnhancedPosition-service
- m_watcher.addWatchedService(uniqueId);
-
- // call me only if agent is unregistered
- connect(&m_watcher, SIGNAL(serviceUnregistered(QString)),
- this, SLOT(onAgentUnregistered(QString)) );
-
- return true;
-}
-
-void ServerImpl::onAgentUnregistered(const QString &serviceName)
-{
- qDebug("+++++ agent disappeared: %s ++++++",
- serviceName.toUtf8().data());
-
- m_watcher.removeWatchedService(serviceName);
-}
-
-/**
- * This method is called by a QTimer to update (later) the Status.
- */
-void ServerImpl::changeStatus()
-{
- //checkAndPrintDBusContext();
-}
-
-void ServerImpl::sendUpdate()
-{
- // extract and fill data for signal!
- QList<ushort> updates;
- PositionFilter::getInstance()->runFiltering(updates);
-
- if (0 == updates.count()) {
- // updates.append(EnhancedPosition::INVALID);
- //qDebug("*** sendUpdate: no changes or invalild content! --> no PositionUpdate signal");
- return;
- }
-
- qDebug("*** sendUpdate done *** ");
- PositionUpdate(updates);
-}
-
-/**
- * Visualizes the important infos from the current DBus context.
- * The information is provided via message() and connection() call.
- */
-bool ServerImpl::checkAndPrintDBusContext()
-{
- bool rv = false;
-#if 0
- if (m_agentPath != NULL) {
- qDebug("m_agentPath: %s", m_agentPath.toUtf8().data());
- rv = true;
- }
-
- if (m_agentUniqueName != NULL) {
- qDebug("m_agentUniqueName: %s", m_agentUniqueName.toUtf8().data());
- rv = true;
- }
-
- if (!QDBusContext::calledFromDBus())
- return false;
-
- if (message().service() != NULL) {
- // show infos we use to identify the agent.
- qDebug("message():\n"
- " * path : '%s'\n"
- " * interface : '%s'\n"
- " * service : '%s'\n", message().path().toUtf8().data(),
- message().interface().toUtf8().data(),
- message().service().toUtf8().data());
- rv = true;
- }
-
- if (connection().sender().baseService() != NULL) {
- qDebug("connection():\n"
- " * sender : '%s'\n",
- connection().sender().baseService().toUtf8().data());
- rv |= true;
- }
-
- if (!rv) {
- qWarning("chack and print of DBus context failed.\n");
- }
-#endif
-
- return rv;
-}
diff --git a/enhanced-position-service/src/serverimpl.h b/enhanced-position-service/src/serverimpl.h
deleted file mode 100644
index 5c446ef..0000000
--- a/enhanced-position-service/src/serverimpl.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#ifndef SERVERIMPL_H
-#define SERVERIMPL_H
-
-#include <QtCore>
-#include <QtDBus>
-
-#include "genivi-dbus-types.h"
-#include "ConfigurationImpl.h"
-
-#include "gnss-simple.h"
-#include "PositionFilter.h"
-
-// FIXME: decide, if still needed.
-enum _EnhancedPositionStatus {
- ENH_STATUS_INVALID = 0,
- ENH_STATUS_UNKNOWN = 1,
- ENH_STATUS_DISCONNECTED = 2,
- ENH_STATUS_STARTUP = 3,
- ENH_STATUS_READY = 4,
- ENH_STATUS_CONNECTED = 5
-};
-
-/*
- * Signatures needs to match demoifadaptor.h
- */
-class ServerImpl : public QObject, public QDBusContext
-{
-Q_OBJECT
-public:
- explicit ServerImpl(QObject *parent = 0);
- ~ServerImpl();
- void setConnection(QDBusConnection& conn);
-
- QDBusConnection* getConnection();
-
-
-public: // PROPERTIES
-public Q_SLOTS: // METHODS
- MapUShortVariant GetAccuracy();
- MapUShortVariant GetData(const QList<ushort> &valuesToReturn);
- MapUShortVariant GetPosition();
- MapUShortVariant GetRotationRate();
- MapUShortVariant GetSatelliteInfo();
- MapUShortVariant GetStatus();
- MapUShortVariant GetTime();
- GeniviVersion GetVersion();
-
-Q_SIGNALS: // SIGNALS
- void AccuracyUpdate(const QList<ushort> &changedValues);
- void PositionUpdate(const QList<ushort> &changedValues);
- void RotationRateUpdate(const QList<ushort> &changedValues);
- void SatelliteInfoUpdate(const QList<ushort> &changedValues);
- void StatusUpdate(const QList<ushort> &changedValues);
-
-private Q_SLOTS:
- void changeStatus();
- void sendUpdate();
- void onAgentUnregistered(const QString &serviceName);
-
-private:
- bool checkAndPrintDBusContext();
- bool activateWatcherFor(const QString& uniqueId);
-
- QDBusConnection* m_pConnection;
- QDBusServiceWatcher m_watcher;
-
- _EnhancedPositionStatus m_status;
-
- PositionFilter& m_posFilter;
-};
-
-#endif
diff --git a/enhanced-position-service/src/test/CMakeLists.txt b/enhanced-position-service/src/test/CMakeLists.txt
deleted file mode 100644
index 2343340..0000000
--- a/enhanced-position-service/src/test/CMakeLists.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-###########################################################################
-# @licence app begin@
-# SPDX-License-Identifier: MPL-2.0
-#
-# Component Name: EnhancedPositionService
-#
-# Author: Thomas Bader
-#
-# Copyright (C) 2012, BMW Car IT GmbH
-#
-# License:
-# This Source Code Form is subject to the terms of the
-# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# @licence end@
-###########################################################################
-
-project(enhpos-test)
-cmake_minimum_required(VERSION 2.6.0)
-
-message(STATUS)
-message(STATUS "---------------------------------------------------------")
-
-# gtest
-add_subdirectory(externals)
-include_directories(${gtest_SOURCE_DIR}/include)
-link_directories(${gtest_BINARY_DIR})
-
-# tests for D-Bus Enhanced Position Service POC:
-# This client uses the code of the test-client to speak with the
-# position-daemon.
-add_executable(test-enhpos
- ${gtest_SOURCE_DIR}/src/gtest_main.cc
- EnhPosTest.cpp
- ConfigurationTest.cpp
-)
-target_link_libraries(test-enhpos
- ClientEnhpos QtCore QtDBus QtXml
- gtest
-)
-
-# unit tests for position-daemon internals
-add_executable(test-daemon-internals
-# tests
- ${gtest_SOURCE_DIR}/src/gtest_main.cc
- PositionFilterTest.cpp
-# files under test
- ../server/PositionFilter.cpp
-)
-target_link_libraries(test-daemon-internals
- # ClientEnhpos QtDBus QtXml
- gtest
- QtCore
-)
-
-message(STATUS "---------------------------------------------------------")
-message(STATUS)
diff --git a/enhanced-position-service/src/test/ConfigurationTest.cpp b/enhanced-position-service/src/test/ConfigurationTest.cpp
deleted file mode 100644
index 32861d9..0000000
--- a/enhanced-position-service/src/test/ConfigurationTest.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#include <gtest/gtest.h>
-#include <stdio.h>
-
-#include "ConfigurationClient.h"
-#include "genivi-version.h"
-
-#include "genivi-navigationcore-enum.h"
-
-class ConfigurationTest : public testing::Test {
-protected: // You should make the members protected s.t. they can be
- // accessed from sub-classes.
-
- ConfigurationTest() : confClient(NULL) {
- QCoreApplication a();
- registerCommTypes();
- confClient = new ConfigurationClient();
- }
-
- // virtual void SetUp() { }
- // virtual void TearDown() { }
-
- ConfigurationClient* confClient;
-};
-
-
-TEST_F(ConfigurationTest, getVersionShouldPass) {
-
- ConfigurationIf* pClient = confClient->getClient();
- ASSERT_FALSE(pClient == NULL);
- ASSERT_TRUE(pClient->isValid());
-
- // request api version
- QDBusReply<GeniviVersion> replyResult;
- replyResult = pClient->GetVersion();
-
- ASSERT_TRUE(replyResult.isValid());
-
- GeniviVersion version = replyResult.value();
- qDebug("API version: %d.%d.%d", version.getMajorVersion(),
- version.getMinorVersion(), version.getMicroVersion());
- // versionDate.toUtf8().data());
-
- EXPECT_EQ(version.getMajorVersion(), 1);
- EXPECT_EQ(version.getMinorVersion(), 0);
- EXPECT_EQ(version.getMicroVersion(), 0);
-}
-
-TEST_F(ConfigurationTest, getConfigurationShouldPass) {
-
- ConfigurationIf* pClient = confClient->getClient();
- ASSERT_FALSE(pClient == NULL);
- ASSERT_TRUE(pClient->isValid());
-
- // request api version
- QDBusReply<QVariantMap> replyResult;
- replyResult = pClient->GetProperties();
-
- ASSERT_TRUE(replyResult.isValid());
-
- QVariantMap map = replyResult.value();
- EXPECT_TRUE(map.value("UpdateInterval").isValid());
- EXPECT_TRUE(map.value("SatelliteSystem").isValid());
-}
diff --git a/enhanced-position-service/src/test/EnhPosTest.cpp b/enhanced-position-service/src/test/EnhPosTest.cpp
deleted file mode 100644
index 499d3c9..0000000
--- a/enhanced-position-service/src/test/EnhPosTest.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#include <gtest/gtest.h>
-#include <stdio.h>
-
-#include "testclient.h"
-#include "genivi-version.h"
-
-#include "genivi-navigationcore-enum.h"
-
-class EnhPosTest : public testing::Test {
-protected: // You should make the members protected s.t. they can be
- // accessed from sub-classes.
-
- EnhPosTest() : testClient(NULL) {
- QCoreApplication a();
- registerCommTypes();
- testClient = new TestClient();
- }
-
- // virtual void SetUp() { }
- // virtual void TearDown() { }
-
- TestClient* testClient;
-};
-
-
-TEST_F(EnhPosTest, getVersionShouldPass) {
-
- DemoIf* pClient = testClient->getClient();
- ASSERT_FALSE(pClient == NULL);
- ASSERT_TRUE(pClient->isValid());
-
- // request api version
- QDBusReply<GeniviVersion> replyResult;
- replyResult = pClient->GetVersion();
-
- ASSERT_TRUE(replyResult.isValid());
-
- GeniviVersion version = replyResult.value();
- qDebug("API version: %d.%d.%d", version.getMajorVersion(),
- version.getMinorVersion(), version.getMicroVersion());
- // versionDate.toUtf8().data());
-
- EXPECT_EQ(version.getMajorVersion(), 1);
- EXPECT_EQ(version.getMinorVersion(), 0);
- EXPECT_EQ(version.getMicroVersion(), 0);
-}
-
-TEST_F(EnhPosTest, getDataWithAllShouldPass) {
- DemoIf* pClient = testClient->getClient();
- ASSERT_FALSE(pClient == NULL);
- ASSERT_TRUE(pClient->isValid());
-
- // request api version
- QList<ushort> requestVales;
- requestVales.push_back(EnhancedPositionData::ALL);
-
- QDBusReply<MapUShortVariant> replyResult;
- replyResult = pClient->GetData(requestVales);
-
- ASSERT_TRUE(replyResult.isValid());
-
- MapUShortVariant list = replyResult.value();
-}
-
-TEST_F(EnhPosTest, getDataShouldReturnValues) {
- DemoIf* pClient = testClient->getClient();
- ASSERT_FALSE(pClient == NULL);
- ASSERT_TRUE(pClient->isValid());
-
- QList<ushort> requestVales;
- requestVales.push_back(EnhancedPositionData::ALL);
-
- QDBusReply<MapUShortVariant> replyResult;
- replyResult = pClient->GetData(requestVales);
-
- ASSERT_TRUE(replyResult.isValid());
-
- MapUShortVariant list = replyResult.value();
- qDebug() << "list: " << list;
- EXPECT_FALSE(list.value(EnhancedPositionData::INVALID).isValid());
-}
-
-TEST_F(EnhPosTest, getPositionShouldPass) {
- DemoIf* pClient = testClient->getClient();
- ASSERT_FALSE(pClient == NULL);
- ASSERT_TRUE(pClient->isValid());
-
- QList<ushort> requestVales;
- requestVales.push_back(EnhancedPositionData::ALL);
-
- QDBusReply<MapUShortVariant> replyResult;
- replyResult = pClient->GetPosition();
-
- ASSERT_TRUE(replyResult.isValid());
-
- MapUShortVariant list = replyResult.value();
- qDebug() << "list: " << list;
- EXPECT_FALSE(list.value(EnhancedPositionData::INVALID).isValid());
-
- EXPECT_TRUE(list.value(EnhancedPositionData::LATITUDE).isValid());
- EXPECT_TRUE(list.value(EnhancedPositionData::LONGITUDE).isValid());
- EXPECT_TRUE(list.value(EnhancedPositionData::SPEED).isValid());
- EXPECT_TRUE(list.value(EnhancedPositionData::HEADING).isValid());
-
- EXPECT_FALSE(list.value(Accuracy::FILTER_STATUS).isValid());
-}
-
-TEST_F(EnhPosTest, getRotationRateShouldPass) {
- DemoIf* pClient = testClient->getClient();
- ASSERT_FALSE(pClient == NULL);
- ASSERT_TRUE(pClient->isValid());
-
- QDBusReply<MapUShortVariant> replyResult;
- replyResult = pClient->GetRotationRate();
-
- ASSERT_TRUE(replyResult.isValid());
-
- MapUShortVariant list = replyResult.value();
- qDebug() << "GetRotationRate: " << list;
-
- EXPECT_GT(list.size(), 0);
- EXPECT_FALSE(list.value(RotationRate::INVALID).isValid());
-}
-
-TEST_F(EnhPosTest, getSatInfoShouldPass) {
- DemoIf* pClient = testClient->getClient();
- ASSERT_FALSE(pClient == NULL);
- ASSERT_TRUE(pClient->isValid());
-
- QDBusReply<MapUShortVariant> replyResult;
- replyResult = pClient->GetSatelliteInfo();
-
- ASSERT_TRUE(replyResult.isValid());
-
- MapUShortVariant list = replyResult.value();
- qDebug() << "GetSatelliteInfo: " << list;
-
- EXPECT_GT(list.size(), 0);
- EXPECT_FALSE(list.value(RotationRate::INVALID).isValid());
-}
-
-TEST_F(EnhPosTest, getAccuracyShouldPass) {
- DemoIf* pClient = testClient->getClient();
- ASSERT_FALSE(pClient == NULL);
- ASSERT_TRUE(pClient->isValid());
-
- QDBusReply<MapUShortVariant> replyResult;
- replyResult = pClient->GetAccuracy();
-
- ASSERT_TRUE(replyResult.isValid());
-
- MapUShortVariant list = replyResult.value();
- qDebug() << "GetAccuracy: " << list;
-
- EXPECT_GT(list.size(), 0);
- EXPECT_FALSE(list.value(Accuracy::INVALID).isValid());
-}
-
-TEST_F(EnhPosTest, getStatusShouldReturnSth) {
- DemoIf* pClient = testClient->getClient();
- ASSERT_FALSE(pClient == NULL);
- ASSERT_TRUE(pClient->isValid());
-
- QDBusReply<MapUShortVariant> replyResult;
- replyResult = pClient->GetStatus();
-
- ASSERT_TRUE(replyResult.isValid());
-
- MapUShortVariant list = replyResult.value();
- qDebug() << "GetStatus: " << list;
-
- EXPECT_GT(list.size(), 0);
- EXPECT_FALSE(list.value(Base::ALL).isValid()); // FIXME - constant define missing
-}
-
-TEST_F(EnhPosTest, getTimeShouldReturnValidTime) {
- DemoIf* pClient = testClient->getClient();
- ASSERT_FALSE(pClient == NULL);
- ASSERT_TRUE(pClient->isValid());
-
- QDBusReply<MapUShortVariant> replyResult;
- replyResult = pClient->GetTime();
-
- ASSERT_TRUE(replyResult.isValid());
-
- MapUShortVariant list = replyResult.value();
- qDebug() << "GetStatus: " << list;
-
- EXPECT_GT(list.size(), 0);
- EXPECT_FALSE(list.value(Time::INVALID).isValid());
-
- // date
- EXPECT_TRUE(list.value(Time::YEAR).isValid());
- EXPECT_GT(list.value(Time::YEAR).toUInt(), 1970);
-
- EXPECT_TRUE(list.value(Time::MONTH).isValid());
- EXPECT_GE(list.value(Time::MONTH).toUInt(), 1);
- EXPECT_LE(list.value(Time::MONTH).toUInt(), 12);
-
- EXPECT_TRUE(list.value(Time::DAY).isValid());
- EXPECT_GE(list.value(Time::DAY).toUInt(), 1);
- EXPECT_LE(list.value(Time::DAY).toUInt(), 31);
-
- // time
- EXPECT_TRUE(list.value(Time::HOUR).isValid());
- EXPECT_GE(list.value(Time::HOUR).toUInt(), 0);
- EXPECT_LE(list.value(Time::HOUR).toUInt(), 23);
-
- EXPECT_TRUE(list.value(Time::MINUTE).isValid());
- EXPECT_GE(list.value(Time::MINUTE).toUInt(), 0);
- EXPECT_LE(list.value(Time::MINUTE).toUInt(), 59);
-
- EXPECT_TRUE(list.value(Time::SECOND).isValid());
- EXPECT_GE(list.value(Time::SECOND).toUInt(), 0);
- EXPECT_LE(list.value(Time::SECOND).toUInt(), 60); // correction second included.
-
- EXPECT_TRUE(list.value(Time::MS).isValid());
- EXPECT_GE(list.value(Time::MS).toUInt(), 0);
- EXPECT_LE(list.value(Time::MS).toUInt(), 999); // correction second included.
-}
diff --git a/enhanced-position-service/src/test/PositionFilterTest.cpp b/enhanced-position-service/src/test/PositionFilterTest.cpp
deleted file mode 100644
index bf9d1d5..0000000
--- a/enhanced-position-service/src/test/PositionFilterTest.cpp
+++ /dev/null
@@ -1,502 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#include <gtest/gtest.h>
-#include <stdio.h>
-
-#include "PositionFilter.h"
-#include "genivi-navigationcore-enum.h"
-#include "gnss/gnss-util.h"
-#include "QtCore/qdebug.h"
-
-TEST(PositionFilterTest, newPositionFilter) {
- ASSERT_FALSE(PositionFilter::getInstance() == NULL);
-}
-
-TEST(PositionFilterTest, singeltonCheck) {
- PositionFilter* inst1 = PositionFilter::getInstance();
- PositionFilter* inst2 = PositionFilter::getInstance();
- ASSERT_EQ(inst1, inst2);
-}
-
-TEST(PositionFilterTest, runFiltering_plain) {
- QList<ushort> changeList;
- PositionFilter::getInstance()->runFiltering(changeList);
- EXPECT_TRUE(true);
-}
-
-TEST(PositionFilterTest, injectPosition) {
- GNSSPosition pos;
- pos.latitude = 11.0f;
- pos.longitude = 48.0f;
- pos.altitude = 512.0f;
- pos.timestamp = 12345;
- pos.validField = {true, true, true}; // lat, lon, alt
-
- PositionFilter::getInstance()->onPositionUpdate(pos);
- EXPECT_TRUE(true);
-}
-
-TEST(PositionFilterTest, injectAndAppendPosition) {
- PositionFilter* inst = PositionFilter::getInstance();
- ASSERT_FALSE(inst == NULL);
-
- GNSSPosition pos;
- pos.latitude = 11.0f;
- pos.longitude = 48.0f;
- pos.altitude = 512.0f;
- pos.timestamp = 12345;
- pos.validField = {true, true, true}; // lat, lon, alt
-
- inst->onPositionUpdate(pos);
- QList<ushort> changeList;
- inst->runFiltering(changeList);
-
- MapUShortVariant map;
- EXPECT_TRUE(inst->appendPositionTo(map));
- EXPECT_GT(map.size(), 0);
-}
-
-TEST(PositionFilterTest, appendSomeValidLatLon) {
- PositionFilter* inst = PositionFilter::getInstance();
- ASSERT_FALSE(inst == NULL);
-
- GNSSPosition pos;
- pos.latitude = 11.0f;
- pos.longitude = 48.0f;
- pos.altitude = 512.0f;
- pos.timestamp = 12345;
- pos.validField = {true, true, true}; // lat, lon, alt
-
- inst->onPositionUpdate(pos);
- QList<ushort> changeList;
- inst->runFiltering(changeList);
-
- MapUShortVariant map;
- EXPECT_TRUE(inst->appendPositionTo(map));
- EXPECT_GT(map.size(), 0);
-
- EXPECT_FALSE(map.value(EnhancedPosition::INVALID).isValid());
- EXPECT_TRUE(map.value(EnhancedPosition::LATITUDE).isValid());
- EXPECT_TRUE(map.value(EnhancedPosition::LONGITUDE).isValid());
-}
-
-TEST(PositionFilterTest, appendTheGivenLatLon) {
- PositionFilter* inst = PositionFilter::getInstance();
- ASSERT_FALSE(inst == NULL);
-
- GNSSPosition pos;
- pos.latitude = 48.367472f;
- pos.longitude = 11.846595f;
- pos.altitude = 512.0f;
- pos.timestamp = 12345;
- pos.validField = {true, true, true}; // lat, lon, alt
-
- // inject position in PositionFilter
- inst->onPositionUpdate(pos);
- // give chance to do sth.
- QList<ushort> changeList;
- inst->runFiltering(changeList);
-
- // general checks
- MapUShortVariant map;
- EXPECT_TRUE(inst->appendPositionTo(map));
- EXPECT_GT(map.size(), 0);
- EXPECT_FALSE(map.value(EnhancedPosition::INVALID).isValid());
-
- // content checks
- EXPECT_TRUE(map.value(EnhancedPosition::LATITUDE).isValid());
- EXPECT_NEAR(map.value(EnhancedPosition::LATITUDE).toFloat(),
- pos.latitude, 0.01f);
-
- EXPECT_TRUE(map.value(EnhancedPosition::LONGITUDE).isValid());
- EXPECT_NEAR(map.value(EnhancedPosition::LONGITUDE).toFloat(),
- pos.longitude, 0.01f);
-}
-
-TEST(PositionFilterTest, notAppendTheGivenLatLon) {
- PositionFilter* inst = PositionFilter::getInstance();
- ASSERT_FALSE(inst == NULL);
-
- GNSSPosition pos;
- pos.timestamp = 12345;
- pos.validField = {false, false, false}; // lat, lon, alt
-
- // inject position in PositionFilter
- inst->onPositionUpdate(pos);
- // give chance to do sth.
- QList<ushort> changeList;
- inst->runFiltering(changeList);
-
- // general checks
- MapUShortVariant map;
- map.clear();
-
- EXPECT_FALSE(inst->appendPositionTo(map));
- EXPECT_EQ(map.size(), 1);
- EXPECT_TRUE(map.value(EnhancedPosition::INVALID).isValid());
-
- EXPECT_FALSE(map.value(EnhancedPosition::LATITUDE).isValid());
- EXPECT_FALSE(map.value(EnhancedPosition::LONGITUDE).isValid());
-}
-
-TEST(PositionFilterTest, appendTheGivenTimestamp) {
- PositionFilter* inst = PositionFilter::getInstance();
- ASSERT_FALSE(inst == NULL);
-
- GNSSPosition pos;
- pos.latitude = 48.367472f;
- pos.longitude = 11.846595f;
- pos.altitude = 512.0f;
- pos.timestamp = 45677;
- pos.validField = {true, true, true}; // lat, lon, alt
-
- // inject position in PositionFilter
- inst->onPositionUpdate(pos);
- // give chance to do sth.
- QList<ushort> changeList;
- inst->runFiltering(changeList);
-
- // general checks
- MapUShortVariant map;
- map.clear();
- EXPECT_TRUE(inst->appendTimestampTo(map));
- EXPECT_GT(map.size(), 0);
- EXPECT_FALSE(map.value(EnhancedPosition::INVALID).isValid());
-
- // content checks
- EXPECT_TRUE(map.value(EnhancedPosition::TIMESTAMP).isValid());
- EXPECT_NEAR(map.value(EnhancedPosition::TIMESTAMP).toULongLong(),
- pos.timestamp, 100); // can differ by 100 ms
-}
-
-TEST(PositionFilterTest, appendTheGivenCourse) {
- PositionFilter* inst = PositionFilter::getInstance();
- ASSERT_FALSE(inst == NULL);
-
- GNSSCourse course;
- course.timestamp = 45677;
- course.speed = 10.0f;
- course.climb = 0.0f;
- course.heading = 180.0f;
- course.validField = {true, true, true}; // speed, climb, heading
-
- // inject course in PositionFilter
- inst->onCourseUpdate(course);
- // give chance to do sth.
- QList<ushort> changeList;
- inst->runFiltering(changeList);
-
- // general checks
- MapUShortVariant map;
- map.clear();
- EXPECT_TRUE(inst->appendCourseTo(map));
- EXPECT_GT(map.size(), 0);
- EXPECT_FALSE(map.value(EnhancedPosition::INVALID).isValid());
-
- // content checks
- EXPECT_TRUE(map.value(EnhancedPosition::HEADING).isValid());
- EXPECT_NEAR(map.value(EnhancedPosition::HEADING).toFloat(),
- course.heading, 18.0f); // can differ by 18 [degree] = 1/20 of circle
-
- EXPECT_TRUE(map.value(EnhancedPosition::CLIMB).isValid());
- EXPECT_NEAR(map.value(EnhancedPosition::CLIMB).toFloat(),
- course.climb, 5.0f);
-
- EXPECT_TRUE(map.value(EnhancedPosition::SPEED).isValid());
- EXPECT_NEAR(map.value(EnhancedPosition::SPEED).toFloat(),
- course.speed, 1.0f);
-}
-
-TEST(PositionFilterTest, appendPositionCourseAndTime) {
- PositionFilter* inst = PositionFilter::getInstance();
- ASSERT_FALSE(inst == NULL);
-
- // inject course in PositionFilter
- GNSSCourse course;
- course.timestamp = 45677;
- course.speed = 10.0f;
- course.climb = 0.0f;
- course.heading = 180.0f;
- course.validField = {true, true, true}; // speed, climb, heading
- inst->onCourseUpdate(course);
-
- // inject position in PositionFilter
- GNSSPosition pos;
- pos.timestamp = 45690; // small diff in timestamp!
- pos.latitude = 48.367472f;
- pos.longitude = 11.846595f;
- pos.altitude = 512.0f;
- pos.validField = {true, true, true}; // lat, lon, alt
- inst->onPositionUpdate(pos);
-
- // give chance to do sth.
- QList<ushort> changeList;
- inst->runFiltering(changeList);
-
- // general checks
- MapUShortVariant map;
- map.clear();
-
- EXPECT_TRUE(inst->appendPositionTo(map));
- EXPECT_TRUE(inst->appendCourseTo(map));
- EXPECT_TRUE(inst->appendTimestampTo(map));
-
- EXPECT_GT(map.size(), 0);
- EXPECT_FALSE(map.value(EnhancedPosition::INVALID).isValid());
-
- // content checks
- EXPECT_TRUE(map.value(EnhancedPosition::HEADING).isValid());
- EXPECT_NEAR(map.value(EnhancedPosition::HEADING).toFloat(),
- course.heading, 18.0f); // can differ by 18 [degree] = 1/20 of circle
-
- EXPECT_TRUE(map.value(EnhancedPosition::CLIMB).isValid());
- EXPECT_NEAR(map.value(EnhancedPosition::CLIMB).toFloat(),
- course.climb, 5.0f);
-
- EXPECT_TRUE(map.value(EnhancedPosition::SPEED).isValid());
- EXPECT_NEAR(map.value(EnhancedPosition::SPEED).toFloat(),
- course.speed, 1.0f);
-
- // content checks
- EXPECT_TRUE(map.value(EnhancedPosition::LATITUDE).isValid());
- EXPECT_NEAR(map.value(EnhancedPosition::LATITUDE).toFloat(),
- pos.latitude, 0.01f);
-
- EXPECT_TRUE(map.value(EnhancedPosition::LONGITUDE).isValid());
- EXPECT_NEAR(map.value(EnhancedPosition::LONGITUDE).toFloat(),
- pos.longitude, 0.01f);
-
- // content checks
- EXPECT_TRUE(map.value(EnhancedPosition::TIMESTAMP).isValid());
- EXPECT_NEAR(map.value(EnhancedPosition::TIMESTAMP).toULongLong(),
- pos.timestamp, 100); // can differ by 100 ms
- EXPECT_NEAR(map.value(EnhancedPosition::TIMESTAMP).toULongLong(),
- course.timestamp, 100); // can differ by 100 ms
-}
-
-TEST(PositionFilterTest, removeAppendWhenAddingValidCourse) {
- PositionFilter* inst = PositionFilter::getInstance();
- ASSERT_FALSE(inst == NULL);
-
- // inject course in PositionFilter
- GNSSCourse course;
- course.timestamp = 45677;
- course.speed = 10.0f;
- course.climb = 0.0f;
- course.heading = 180.0f;
- course.validField = {true, true, true}; // speed, climb, heading
- inst->onCourseUpdate(course);
-
- // inject position in PositionFilter
- GNSSPosition pos;
- pos.timestamp = 45690; // small diff in timestamp!
- pos.validField = {false, false, false}; // lat, lon, alt
- inst->onPositionUpdate(pos);
-
- // give chance to do sth.
- QList<ushort> changeList;
- inst->runFiltering(changeList);
-
- // general checks
- MapUShortVariant map;
- map.clear();
-
- // appending position should not work. --> only one key: INVALID
- EXPECT_FALSE(inst->appendPositionTo(map));
- EXPECT_EQ(map.size(), 1);
- EXPECT_TRUE(map.value(EnhancedPosition::INVALID).isValid());
-
- // now append something with valid content --> remove INVALID value!
- EXPECT_TRUE(inst->appendCourseTo(map));
-
- EXPECT_GT(map.size(), 0);
- EXPECT_FALSE(map.value(EnhancedPosition::INVALID).isValid());
- // qDebug() << map;
-}
-
-TEST(PositionFilterTest, removeAppendWhenAddingValidPosition) {
- PositionFilter* inst = PositionFilter::getInstance();
- ASSERT_FALSE(inst == NULL);
-
- // inject course in PositionFilter
- GNSSCourse course;
- course.timestamp = 45677;
- course.validField = {false, false, false}; // speed, climb, heading
- inst->onCourseUpdate(course);
-
- // inject position in PositionFilter
- GNSSPosition pos;
- pos.timestamp = 45690; // small diff in timestamp!
- pos.latitude = 48.367472f;
- pos.longitude = 11.846595f;
- pos.altitude = 512.0f;
- pos.validField = {true, true, true}; // lat, lon, alt
- inst->onPositionUpdate(pos);
-
- // give chance to do sth.
- QList<ushort> changeList;
- inst->runFiltering(changeList);
-
- // general checks
- MapUShortVariant map;
- map.clear();
-
- // appending course should not work.
- // --> only one map entry with INVALID
- EXPECT_FALSE(inst->appendCourseTo(map));
- EXPECT_EQ(map.size(), 1);
- EXPECT_TRUE(map.value(EnhancedPosition::INVALID).isValid());
-
- // now append something with valid content (course)
- // --> remove INVALID value!
- EXPECT_TRUE(inst->appendPositionTo(map));
-
- EXPECT_GT(map.size(), 0);
- EXPECT_FALSE(map.value(EnhancedPosition::INVALID).isValid());
-}
-
-TEST(PositionFilterTest, appendElement) {
- PositionFilter* inst = PositionFilter::getInstance();
- ASSERT_FALSE(inst == NULL);
-
- // inject position in PositionFilter
- GNSSPosition pos;
- pos.timestamp = 45690; // small diff in timestamp!
- pos.latitude = 48.367472f;
- pos.longitude = 11.846595f;
- pos.altitude = 512.0f;
- pos.validField = {true, true, true}; // lat, lon, alt
- inst->onPositionUpdate(pos);
-
- // give chance to do sth.
- QList<ushort> changeList;
- inst->runFiltering(changeList);
- // general checks
- MapUShortVariant map;
- map.clear();
-
- EXPECT_TRUE(inst->appendElementTo(map, EnhancedPosition::LATITUDE));
- EXPECT_TRUE(map.value(EnhancedPosition::LATITUDE).isValid());
- EXPECT_TRUE(inst->appendElementTo(map, EnhancedPosition::LONGITUDE));
- EXPECT_TRUE(map.value(EnhancedPosition::LONGITUDE).isValid());
- EXPECT_TRUE(inst->appendElementTo(map, EnhancedPosition::ALTITUDE));
- EXPECT_TRUE(map.value(EnhancedPosition::ALTITUDE).isValid());
- EXPECT_TRUE(inst->appendElementTo(map, EnhancedPosition::TIMESTAMP));
- EXPECT_TRUE(map.value(EnhancedPosition::TIMESTAMP).isValid());
-
- // TODO
- //EXPECT_TRUE(inst->appendElementTo(map, EnhancedPosition::HEADING));
- //EXPECT_TRUE(map.value(EnhancedPosition::HEADING).isValid());
-
- EXPECT_FALSE(map.value(EnhancedPosition::INVALID).isValid());
-}
-
-TEST(PositionFilterTest, runFilteringCheckList) {
- PositionFilter* inst = PositionFilter::getInstance();
- ASSERT_FALSE(inst == NULL);
-
- GNSSPosition pos;
- QList<ushort> list;
-
- // inject 1st position in PositionFilter
- pos.timestamp = 12340;
- pos.latitude = 48.3670f;
- pos.validField = {true, false, false}; // lat, lon, alt
- inst->onPositionUpdate(pos);
-
- // TICK
- list.clear();
- inst->runFiltering(list);
-
- // inject a 2nd position in PositionFilter
- pos.timestamp = 12345; // small diff in timestamp!
- pos.latitude = 48.3675f;
- pos.validField = {true, false, false}; // lat, lon, alt
- inst->onPositionUpdate(pos);
-
- // TACK
- list.clear();
- inst->runFiltering(list);
-
- EXPECT_TRUE(list.contains(EnhancedPosition::TIMESTAMP));
- EXPECT_TRUE(list.contains(EnhancedPosition::LATITUDE));
- EXPECT_FALSE(list.contains(EnhancedPosition::LONGITUDE));
-}
-
-
-TEST(PositionFilterTest, runFilteringCheckList_invalid2valid) {
- PositionFilter* inst = PositionFilter::getInstance();
- ASSERT_FALSE(inst == NULL);
-
- GNSSPosition pos;
- QList<ushort> list;
-
- // inject INVALID data for position
- pos.timestamp = 0;
- pos.validField = {false, false, false}; // lat, lon, alt
- inst->onPositionUpdate(pos);
-
- // TICK
- list.clear();
- inst->runFiltering(list);
-
- // inject VALID data position
- pos.timestamp = 12345; // small diff in timestamp!
- pos.latitude = 48.3675f;
- pos.validField = {true, false, false}; // lat, lon, alt
- inst->onPositionUpdate(pos);
-
- // TACK
- list.clear();
- inst->runFiltering(list);
-
- EXPECT_TRUE(list.contains(EnhancedPosition::TIMESTAMP));
- EXPECT_TRUE(list.contains(EnhancedPosition::LATITUDE));
- EXPECT_FALSE(list.contains(EnhancedPosition::LONGITUDE));
-}
-
-TEST(PositionFilterTest, runFilteringCheckList_valid2invalid) {
- PositionFilter* inst = PositionFilter::getInstance();
- ASSERT_FALSE(inst == NULL);
-
- GNSSPosition pos;
- QList<ushort> list;
-
- // inject a VALID position in PositionFilter
- pos.timestamp = 12340;
- pos.latitude = 48.3670f;
- pos.validField = {true, false, false}; // lat, lon, alt
- inst->onPositionUpdate(pos);
-
- // TICK
- list.clear();
- inst->runFiltering(list);
-
- // inject a INVALID position in PositionFilter
- pos.timestamp = 0; // small diff in timestamp!
- pos.validField = {false, false, false}; // lat, lon, alt
- inst->onPositionUpdate(pos);
-
- // TACK
- list.clear();
- inst->runFiltering(list);
-
- EXPECT_TRUE(list.contains(EnhancedPosition::TIMESTAMP));
- EXPECT_TRUE(list.contains(EnhancedPosition::LATITUDE));
- EXPECT_FALSE(list.contains(EnhancedPosition::LONGITUDE));
-}
diff --git a/enhanced-position-service/src/test/externals/CMakeLists.txt b/enhanced-position-service/src/test/externals/CMakeLists.txt
deleted file mode 100644
index e5926f0..0000000
--- a/enhanced-position-service/src/test/externals/CMakeLists.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-###########################################################################
-# @licence app begin@
-# SPDX-License-Identifier: MPL-2.0
-#
-# Component Name: EnhancedPositionService
-#
-# Author: Thomas Bader
-#
-# Copyright (C) 2012, BMW Car IT GmbH
-#
-# License:
-# This Source Code Form is subject to the terms of the
-# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# @licence end@
-###########################################################################
-
-if (WITH_TESTS)
-
-add_subdirectory(gtest-1.6.0)
-#include_directories(${gtest_SOURCE_DIR}/include)
-
-endif(WITH_TESTS)
diff --git a/enhanced-position-service/test/CMakeLists.txt b/enhanced-position-service/test/CMakeLists.txt
index 418bf9d..d35f92c 100644
--- a/enhanced-position-service/test/CMakeLists.txt
+++ b/enhanced-position-service/test/CMakeLists.txt
@@ -4,72 +4,73 @@
#
# Component Name: EnhancedPositionService
#
-# Author: Thomas Bader
+# Author: Marco Residori
#
-# Copyright (C) 2012, BMW Car IT GmbH
+# Copyright (C) 2014, XS Embedded GmbH
#
# License:
# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-# List of changes:
-#
-# 15/6/2014, Philippe Colliot, migrate to Qt5
-#
# @licence end@
###########################################################################
-cmake_minimum_required(VERSION 2.8.11)
+project(enhanced-position-client)
+cmake_minimum_required(VERSION 2.6.0)
-project(test-client)
+message(STATUS "ENHANCED-POSITION-CLIENT")
+message(STATUS "WITH_DLT = ${WITH_DLT}")
-# Find includes in corresponding build directories
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
+find_package(PkgConfig REQUIRED)
-# Instruct CMake to run moc automatically when needed.
-set(CMAKE_AUTOMOC ON)
+pkg_check_modules(DBUS_CPP dbus-c++-1)
-# Tell CMake where are Qt packages
-set(CMAKE_PREFIX_PATH $ENV{QTDIR})
+include_directories(${DBUS_CPP_INCLUDE_DIRS})
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${DBUS_CPP_INCLUDE_DIRS})
-# Tell CMake what Qt components are used
-find_package(Qt5Core)
-find_package(Qt5DBus)
-get_target_property(QtCore_location Qt5::Core LOCATION)
-get_target_property(QtDBus_location Qt5::DBus LOCATION)
-include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5DBus_INCLUDE_DIRS})
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5DBus_EXECUTABLE_COMPILE_FLAGS}")
+# Generate the client glue code before building the client
+add_custom_command(
+ OUTPUT enhanced-position-proxy.h
+ COMMAND dbusxx-xml2cpp ${CMAKE_CURRENT_SOURCE_DIR}/../api/genivi-positioning-enhancedposition.xml
+ --proxy=enhanced-position-proxy.h
+ OUTPUT position-feedback-proxy.h
+ COMMAND dbusxx-xml2cpp ${CMAKE_CURRENT_SOURCE_DIR}/../api/genivi-positioning-positionfeedback.xml
+ --proxy=position-feedback-proxy.h
+ OUTPUT configuration-proxy.h
+ COMMAND dbusxx-xml2cpp ${CMAKE_CURRENT_SOURCE_DIR}/../api/genivi-positioning-configuration.xml
+ --proxy=configuration-proxy.h
+ OUTPUT positioning-constants.h
+ COMMAND xsltproc ${CMAKE_CURRENT_SOURCE_DIR}/../api/enum.xsl ${CMAKE_CURRENT_SOURCE_DIR}/../api/genivi-positioning-constants.xml > positioning-constants.h
+)
-message(STATUS "ENHANCED-POSITION-SERVICE TEST-APPLICATION")
-message(STATUS "WITH_DLT = ${WITH_DLT}")
-message(STATUS "WITH_GPSD = ${WITH_GPSD}")
-message(STATUS "WITH_REPLAYER = ${WITH_REPLAYER}")
+link_directories(${DBUS_CPP_LIBRARY_DIRS})
-set(LIBRARIES
- ${Qt5Core_LIBRARIES}
- ${Qt5DBus_LIBRARIES}
+add_executable(enhanced-position-client
+ enhanced-position-proxy.h
+ enhanced-position-client.h
+ enhanced-position-client.cpp
+ position-feedback-proxy.h
+ configuration-proxy.h
+ positioning-constants.h
)
-add_library(ClientEnhpos STATIC
- demoif.cpp
- testclient.cpp
- confif.cpp
- ConfigurationClient.cpp
- ../src/genivi-version.cpp
- signalhelper.cpp
+set(LIBRARIES
+ ${DBUS_CPP_LIBRARIES}
)
-# Specify the paths in which the linker should search for libraries.
-# The command will apply only to targets created after it is called.
-link_directories(${QT_LIBRARY_DIR})
+if(WITH_DLT)
+ add_definitions("-DDLT_ENABLED=1")
+ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/..")
+ find_package(DLT REQUIRED)
+ include_directories( ${DLT_INCLUDE_DIRS} )
+ set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES})
+endif()
+
+target_link_libraries(enhanced-position-client ${LIBRARIES})
+
+message(STATUS "DBUS_CPP_LIBRARIES: " ${DBUS_CPP_LIBRARIES})
-# Tell CMake to create the test-client executable
-add_executable(test-client main-client.cpp)
-target_link_libraries(test-client
- ClientEnhpos
- ${LIBRARIES}
-)
diff --git a/enhanced-position-service/test/ConfigurationClient.cpp b/enhanced-position-service/test/ConfigurationClient.cpp
deleted file mode 100644
index 704d79c..0000000
--- a/enhanced-position-service/test/ConfigurationClient.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#include "ConfigurationClient.h"
-
-ConfigurationClient::ConfigurationClient(QObject *parent)
- : m_connection(QDBusConnection::sessionBus()),
- m_client(NULL)
-{
- qDebug("ConfigurationClient started\n");
-
- if (!connectToProxy()) {
- qWarning() << "failed to connect to server";
- }
-}
-
-ConfigurationClient::~ConfigurationClient()
-{
- qDebug("ConfigurationClient: d-tor\n");
-}
-
-void ConfigurationClient::PropertyChanged(const QString &name, const QDBusVariant &value)
-{
- qDebug("PropertyChanged: %s", name.toUtf8().constData());
-}
-
-bool ConfigurationClient::connectToProxy()
-{
- if (m_client != NULL) {
- qWarning("m_client already created. do not continue here.");
- return false;
- }
-
- m_client = new ConfigurationIf(getServiceName(), "/config", getConnection(), 0);
-
- if (!m_client->isValid()) {
- qWarning("failed to connect to service '%s'.",
- getServiceName().toUtf8().constData());
- delete(m_client);
- m_client = NULL;
- return false;
- }
-
-#if 0
- QObject::connect(m_client, SIGNAL(StatusUpdate(QList<int>)),
- this, SLOT(StatusUpdate(QList<int>)));
- QObject::connect(m_client, SIGNAL(PositionUpdate(QList<int>)),
- this, SLOT(PositionUpdate(QList<int>)));
- QObject::connect(m_client, SIGNAL(SatelliteInfoUpdate(QList<int>)),
- this, SLOT(SatelliteInfoUpdate(QList<int>)));
- QObject::connect(m_client, SIGNAL(AccuracyUpdate(QList<int>)),
- this, SLOT(AccuracyUpdate(QList<int>)));
-#endif
-
- return true;
-}
diff --git a/enhanced-position-service/test/ConfigurationClient.h b/enhanced-position-service/test/ConfigurationClient.h
deleted file mode 100644
index a24204b..0000000
--- a/enhanced-position-service/test/ConfigurationClient.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#ifndef CONFIGURATIONCLIENT_H
-#define CONFIGURATIONCLIENT_H
-
-#include "confif.h"
-
-class ConfigurationClient : public QObject
-{
-Q_OBJECT
-public:
- explicit ConfigurationClient(QObject *parent = 0);
- ~ConfigurationClient();
-
- QDBusConnection& getConnection() { return m_connection; }
- ConfigurationIf* getClient() { return m_client; }
-
-public Q_SLOTS:
- void PropertyChanged(const QString &name, const QDBusVariant &value);
-
-private:
- bool connectToProxy();
- static const QString getServiceName() {
- return QString("org.genivi.positioning.EnhancedPosition");
- }
-
- QDBusConnection m_connection;
- ConfigurationIf* m_client;
-};
-
-#endif
diff --git a/enhanced-position-service/test/agentadaptor.cpp b/enhanced-position-service/test/agentadaptor.cpp
deleted file mode 100644
index 83637d3..0000000
--- a/enhanced-position-service/test/agentadaptor.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c AgentAdaptor -a agentadaptor.h:agentadaptor.cpp -i genivi-dbus-types.h -i agentimpl.h -l AgentImpl ../EnhancedPositionAgent.xml org.genivi.position.EnhancedPositionAgent
- *
- * qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#include "agentadaptor.h"
-#include <QtCore/QMetaObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-
-/*
- * Implementation of adaptor class AgentAdaptor
- */
-
-AgentAdaptor::AgentAdaptor(AgentImpl *parent)
- : QDBusAbstractAdaptor(parent)
-{
- // constructor
- setAutoRelaySignals(true);
-}
-
-AgentAdaptor::~AgentAdaptor()
-{
- // destructor
-}
-
-void AgentAdaptor::PositionUpdate(const QList<bool> &validFields, double latitude, double longitude, double altitude, uint timestamp)
-{
- // handle method call org.genivi.position.EnhancedPositionAgent.PositionUpdate
- parent()->PositionUpdate(validFields, latitude, longitude, altitude, timestamp);
-}
-
-void AgentAdaptor::StatusUpdate(uint status)
-{
- // handle method call org.genivi.position.EnhancedPositionAgent.StatusUpdate
- parent()->StatusUpdate(status);
-}
-
diff --git a/enhanced-position-service/test/agentadaptor.h b/enhanced-position-service/test/agentadaptor.h
deleted file mode 100644
index aea0b81..0000000
--- a/enhanced-position-service/test/agentadaptor.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c AgentAdaptor -a agentadaptor.h:agentadaptor.cpp -i genivi-dbus-types.h -i agentimpl.h -l AgentImpl ../EnhancedPositionAgent.xml org.genivi.position.EnhancedPositionAgent
- *
- * qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#ifndef AGENTADAPTOR_H_1320934380
-#define AGENTADAPTOR_H_1320934380
-
-#include <QtCore/QObject>
-#include <QtDBus/QtDBus>
-#include "genivi-dbus-types.h"
-#include "agentimpl.h"
-class QByteArray;
-template<class T> class QList;
-template<class Key, class Value> class QMap;
-class QString;
-class QStringList;
-class QVariant;
-
-/*
- * Adaptor class for interface org.genivi.position.EnhancedPositionAgent
- */
-class AgentAdaptor: public QDBusAbstractAdaptor
-{
- Q_OBJECT
- Q_CLASSINFO("D-Bus Interface", "org.genivi.position.EnhancedPositionAgent")
- Q_CLASSINFO("D-Bus Introspection", ""
-" <interface name=\"org.genivi.position.EnhancedPositionAgent\">\n"
-" <version>0.0.5</version>\n"
-" <doc/>\n"
-" <!-- \n"
-" <method name=\"CourseUpdate\">\n"
-" <doc>\n"
-" <line>is called when the course changed</line>\n"
-" </doc>\n"
-" <arg name=\"validFields\" type=\"b\" direction=\"in\" >\n"
-" <doc>\n"
-" <line>validFields = bit mask indicating which fields contain valid information</line>\n"
-" </doc>\n"
-" </arg>\n"
-" <arg name=\"heading\" type=\"d\" direction=\"in\" >\n"
-" <doc>\n"
-" <line>todo</line>\n"
-" </doc>\n"
-" </arg>\n"
-" <arg name=\"speed\" type=\"d\" direction=\"in\" >\n"
-" <doc>\n"
-" <line>todo</line>\n"
-" </doc>\n"
-" </arg>\n"
-" <arg name=\"climb\" type=\"d\" direction=\"in\" >\n"
-" <doc>\n"
-" <line>todo</line>\n"
-" </doc>\n"
-" </arg>\n"
-" <arg name=\"yawRate\" type=\"d\" direction=\"in\" >\n"
-" <doc>\n"
-" <line>todo</line>\n"
-" </doc>\n"
-" </arg>\n"
-" <arg name=\"timestamp\" type=\"u\" direction=\"in\" >\n"
-" <doc>\n"
-" <line>timestamp in [ms]</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-"-->\n"
-" <method name=\"StatusUpdate\">\n"
-" <doc>\n"
-" <line>This method is called if the status changed.</line>\n"
-" </doc>\n"
-" <arg direction=\"in\" type=\"u\" name=\"status\">\n"
-" <doc>\n"
-" <line>status = enum(INVALID(0x00),UNKNOWN(0x01),DISCONNECTED(0x02),STARTUP(0x03),READY(0x04),CONNECTED(0x05) ... )</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" <method name=\"PositionUpdate\">\n"
-" <doc>\n"
-" <line>This method is called if the position changed.</line>\n"
-" </doc>\n"
-" <arg direction=\"in\" type=\"a(b)\" name=\"validFields\">\n"
-" <annotation value=\"QList&lt;bool>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <doc>\n"
-" <line>bit mask indicating which fields contain valid information</line>\n"
-" </doc>\n"
-" </arg>\n"
-" <arg direction=\"in\" type=\"d\" name=\"latitude\"/>\n"
-" <arg direction=\"in\" type=\"d\" name=\"longitude\"/>\n"
-" <arg direction=\"in\" type=\"d\" name=\"altitude\"/>\n"
-" <arg direction=\"in\" type=\"u\" name=\"timestamp\">\n"
-" <doc>\n"
-" <line>timestamp in [ms]</line>\n"
-" </doc>\n"
-" </arg>\n"
-" </method>\n"
-" </interface>\n"
- "")
-public:
- AgentAdaptor(AgentImpl *parent);
- virtual ~AgentAdaptor();
-
- inline AgentImpl *parent() const
- { return static_cast<AgentImpl *>(QObject::parent()); }
-
-public: // PROPERTIES
-public Q_SLOTS: // METHODS
- void PositionUpdate(const QList<bool> &validFields, double latitude, double longitude, double altitude, uint timestamp);
- void StatusUpdate(uint status);
-Q_SIGNALS: // SIGNALS
-};
-
-#endif
diff --git a/enhanced-position-service/test/agentimpl.cpp b/enhanced-position-service/test/agentimpl.cpp
deleted file mode 100644
index cc20f99..0000000
--- a/enhanced-position-service/test/agentimpl.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#include "agentimpl.h"
-#include "agentadaptor.h"
-
-
-AgentImpl::AgentImpl(QObject *parent) : m_adaptor(NULL)
-{
- m_adaptor = new AgentAdaptor(this);
-}
-
-AgentImpl::~AgentImpl()
-{
-
-}
-
-void AgentImpl::StatusUpdate(uint status)
-{
- qDebug("Agent: received 'StatusUpdate' %d.", status);
-}
-
-void AgentImpl::PositionUpdate(const QList<bool> &validFields, double latitude, double longitude, double altitude, uint timestamp)
-{
- qDebug("Agent: received 'PositionUpdate' ... position %f, %f", latitude, longitude);
-}
diff --git a/enhanced-position-service/test/agentimpl.h b/enhanced-position-service/test/agentimpl.h
deleted file mode 100644
index a4ba998..0000000
--- a/enhanced-position-service/test/agentimpl.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#ifndef AGENTIMPL_H_
-#define AGENTIMPL_H_
-
-#include <QtCore/QObject>
-#include <QtDBus/QtDBus>
-
-class AgentAdaptor;
-
-class AgentImpl : public QObject
-{
-Q_OBJECT
-public:
- explicit AgentImpl(QObject *parent = 0);
- ~AgentImpl();
-
-public Q_SLOTS: // METHODS
- void StatusUpdate(uint status);
- void PositionUpdate(const QList<bool> &validFields, double latitude, double longitude, double altitude, uint timestamp);
-Q_SIGNALS: // SIGNALS
-
-private:
- AgentAdaptor* m_adaptor;
-
-};
-
-#endif /* AGENTIMPL_H_ */
diff --git a/enhanced-position-service/test/compliance-test/enhanced-position-service-compliance-test.c b/enhanced-position-service/test/compliance-test/enhanced-position-service-compliance-test.c
index caac5b0..9abd5e6 100644
--- a/enhanced-position-service/test/compliance-test/enhanced-position-service-compliance-test.c
+++ b/enhanced-position-service/test/compliance-test/enhanced-position-service-compliance-test.c
@@ -31,8 +31,8 @@
#define ALT 34 //value taken from GENIVI API
const char * DBUS_INTERFACE = "org.genivi.positioning.EnhancedPosition";
-const char * DBUS_PATH = "/position";
-const char * DBUS_SOURCE = "org.genivi.positioning.Client";
+const char * DBUS_PATH = "/org/genivi/positioning/EnhancedPosition";
+const char * DBUS_SOURCE = "org.genivi.positioning.EnhancedPositionClient";
const char * DBUS_DESTINATION = "org.genivi.positioning.EnhancedPosition";
const char * DBUS_METHOD_GET_DATA = "GetData";
diff --git a/enhanced-position-service/test/confif.cpp b/enhanced-position-service/test/confif.cpp
deleted file mode 100644
index b958b14..0000000
--- a/enhanced-position-service/test/confif.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c ConfigurationIf -p confif.h:confif.cpp -i genivi-dbus-types.h ../genivi-positioning-configuration-qt.xml org.genivi.positioning.Configuration
- *
- * qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "confif.h"
-
-/*
- * Implementation of interface class ConfigurationIf
- */
-
-ConfigurationIf::ConfigurationIf(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-ConfigurationIf::~ConfigurationIf()
-{
-}
-
diff --git a/enhanced-position-service/test/confif.h b/enhanced-position-service/test/confif.h
deleted file mode 100644
index 158a112..0000000
--- a/enhanced-position-service/test/confif.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c ConfigurationIf -p confif.h:confif.cpp -i genivi-dbus-types.h ../genivi-positioning-configuration-qt.xml org.genivi.positioning.Configuration
- *
- * qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef CONFIF_H_1331560215
-#define CONFIF_H_1331560215
-
-#include <QtCore/QObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtDBus/QtDBus>
-#include "genivi-dbus-types.h"
-
-/*
- * Proxy class for interface org.genivi.positioning.Configuration
- */
-class ConfigurationIf: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.genivi.positioning.Configuration"; }
-
-public:
- ConfigurationIf(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
-
- ~ConfigurationIf();
-
- Q_PROPERTY(int SatelliteSystem READ satelliteSystem WRITE setSatelliteSystem)
- inline int satelliteSystem() const
- { return qvariant_cast< int >(property("SatelliteSystem")); }
- inline void setSatelliteSystem(int value)
- { setProperty("SatelliteSystem", QVariant::fromValue(value)); }
-
- Q_PROPERTY(ushort UpdateInterval READ updateInterval WRITE setUpdateInterval)
- inline ushort updateInterval() const
- { return qvariant_cast< ushort >(property("UpdateInterval")); }
- inline void setUpdateInterval(ushort value)
- { setProperty("UpdateInterval", QVariant::fromValue(value)); }
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<QVariantMap> GetProperties()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetProperties"), argumentList);
- }
-
- inline QDBusPendingReply<GeniviVersion> GetVersion()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetVersion"), argumentList);
- }
-
- inline QDBusPendingReply<> SetProperty(const QString &name, const QDBusVariant &value)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(name) << QVariant::fromValue(value);
- return asyncCallWithArgumentList(QLatin1String("SetProperty"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
- void PropertyChanged(const QString &name, const QDBusVariant &value);
-};
-
-namespace org {
- namespace genivi {
- namespace positioning {
- typedef ::ConfigurationIf Configuration;
- }
- }
-}
-#endif
diff --git a/enhanced-position-service/test/demoif.cpp b/enhanced-position-service/test/demoif.cpp
deleted file mode 100644
index 6656b9b..0000000
--- a/enhanced-position-service/test/demoif.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c DemoIf -p demoif.h:demoif.cpp -i genivi-dbus-types.h ../genivi-positioning-enhancedposition-qt.xml org.genivi.positioning.EnhancedPosition
- *
- * qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "demoif.h"
-
-/*
- * Implementation of interface class DemoIf
- */
-
-DemoIf::DemoIf(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-DemoIf::~DemoIf()
-{
-}
-
diff --git a/enhanced-position-service/test/demoif.h b/enhanced-position-service/test/demoif.h
deleted file mode 100644
index 7f3498b..0000000
--- a/enhanced-position-service/test/demoif.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -v -c DemoIf -p demoif.h:demoif.cpp -i genivi-dbus-types.h ../genivi-positioning-enhancedposition-qt.xml org.genivi.positioning.EnhancedPosition
- *
- * qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef DEMOIF_H_1333107453
-#define DEMOIF_H_1333107453
-
-#include <QtCore/QObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtDBus/QtDBus>
-#include "genivi-dbus-types.h"
-
-/*
- * Proxy class for interface org.genivi.positioning.EnhancedPosition
- */
-class DemoIf: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.genivi.positioning.EnhancedPosition"; }
-
-public:
- DemoIf(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
-
- ~DemoIf();
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<MapUShortVariant> GetAccuracy()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetAccuracy"), argumentList);
- }
-
- inline QDBusPendingReply<MapUShortVariant> GetData(const QList<ushort> &valuesToReturn)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(valuesToReturn);
- return asyncCallWithArgumentList(QLatin1String("GetData"), argumentList);
- }
-
- inline QDBusPendingReply<MapUShortVariant> GetPosition()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetPosition"), argumentList);
- }
-
- inline QDBusPendingReply<MapUShortVariant> GetRotationRate()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetRotationRate"), argumentList);
- }
-
- inline QDBusPendingReply<MapUShortVariant> GetSatelliteInfo()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetSatelliteInfo"), argumentList);
- }
-
- inline QDBusPendingReply<MapUShortVariant> GetStatus()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetStatus"), argumentList);
- }
-
- inline QDBusPendingReply<MapUShortVariant> GetTime()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetTime"), argumentList);
- }
-
- inline QDBusPendingReply<GeniviVersion> GetVersion()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetVersion"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
- void AccuracyUpdate(const QList<ushort> &changedValues);
- void PositionUpdate(const QList<ushort> &changedValues);
- void RotationRateUpdate(const QList<ushort> &changedValues);
- void SatelliteInfoUpdate(const QList<ushort> &changedValues);
- void StatusUpdate(const QList<ushort> &changedValues);
-};
-
-namespace org {
- namespace genivi {
- namespace positioning {
- typedef ::DemoIf EnhancedPosition;
- }
- }
-}
-#endif
diff --git a/enhanced-position-service/test/enhanced-position-client.cpp b/enhanced-position-service/test/enhanced-position-client.cpp
new file mode 100644
index 0000000..6b9e00a
--- /dev/null
+++ b/enhanced-position-service/test/enhanced-position-client.cpp
@@ -0,0 +1,129 @@
+/**************************************************************************
+* @licence app begin@
+*
+* SPDX-License-Identifier: MPL-2.0
+*
+* \ingroup EnhancedPositionService
+* \author Marco Residori <marco.residori@xse.de>
+*
+* \copyright Copyright (C) 2014, XS Embedded GmbH
+*
+* \license
+* This Source Code Form is subject to the terms of the
+* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*
+* @licence end@
+**************************************************************************/
+
+#include <signal.h>
+#include <stdio.h>
+
+#include "enhanced-position-client.h"
+#include "positioning-constants.h"
+#include "log.h"
+
+using namespace std;
+DBus::BusDispatcher dispatcher;
+DBus::DefaultTimeout *timeout;
+
+DLT_DECLARE_CONTEXT(gCtx);
+
+EnhancedPositionClient::EnhancedPositionClient(DBus::Connection &connection, const char *path, const char *name)
+ : DBus::ObjectProxy(connection, path, name)
+{
+}
+
+void EnhancedPositionClient::PositionUpdate(const std::vector< uint16_t >& changedValues)
+{
+ LOG_INFO_MSG(gCtx,"Position Update");
+
+ // retrieve the data
+ std::map< uint16_t, ::DBus::Variant > posData = GetData(changedValues);
+
+ for (int i = 0; i < changedValues.size(); i++)
+ {
+ if (changedValues[i] == POS_LATITUDE)
+ {
+ LOG_INFO(gCtx,"LAT=%lf", posData[POS_LATITUDE].reader().get_double());
+ }
+
+ if (changedValues[i] == POS_LONGITUDE)
+ {
+ LOG_INFO(gCtx,"LON=%lf", posData[POS_LONGITUDE].reader().get_double());
+ }
+
+ if (changedValues[i] == POS_ALTITUDE)
+ {
+ LOG_INFO(gCtx,"ALT=%d", posData[POS_ALTITUDE].reader().get_int32());
+ }
+
+ if (changedValues[i] == POS_SPEED)
+ {
+ LOG_INFO(gCtx,"SPEED=%lf", posData[POS_SPEED].reader().get_double());
+ }
+
+ if (changedValues[i] == POS_CLIMB)
+ {
+ LOG_INFO(gCtx,"CLIMB=%d", posData[POS_CLIMB].reader().get_int32());
+ }
+
+ if (changedValues[i] == POS_HEADING)
+ {
+ LOG_INFO(gCtx,"HEADING=%d", posData[POS_HEADING].reader().get_int32());
+ }
+ }
+
+}
+
+void EnhancedPositionClient::RotationRateUpdate(const std::vector< uint16_t >& changedValues)
+{
+ LOG_INFO_MSG(gCtx,"RotationRateUpdate");
+}
+
+void EnhancedPositionClient::AccuracyUpdate(const std::vector< uint16_t >& changedValues)
+{
+ LOG_INFO_MSG(gCtx,"AccuracyUpdate");
+}
+
+void EnhancedPositionClient::SatelliteInfoUpdate(const std::vector< uint16_t >& changedValues)
+{
+ LOG_INFO_MSG(gCtx,"SatelliteInfoUpdate");
+}
+
+void EnhancedPositionClient::StatusUpdate(const std::vector< uint16_t >& changedValues)
+{
+ LOG_INFO_MSG(gCtx,"StatusUpdate");
+}
+
+void signalhandler(int sig)
+{
+ LOG_INFO_MSG(gCtx,"Signal received");
+ dispatcher.leave();
+}
+
+int main()
+{
+ DLT_REGISTER_APP("ENHPOS", "EnhancedPositionClient");
+ DLT_REGISTER_CONTEXT(gCtx,"EPCL", "Global Context");
+
+ LOG_INFO_MSG(gCtx,"starting EnhancedPositionClient...");
+
+ signal(SIGTERM, signalhandler);
+ signal(SIGINT, signalhandler);
+
+ DBus::default_dispatcher = &dispatcher;
+
+ // increase DBus-C++ frequency
+ new DBus::DefaultTimeout(100, false, &dispatcher);
+
+ DBus::Connection conn = DBus::Connection::SessionBus();
+
+ EnhancedPositionClient client(conn, "/org/genivi/positioning/EnhancedPosition",
+ "org.genivi.positioning.EnhancedPosition");
+
+ // dispatch
+ dispatcher.enter();
+
+ return 0;
+}
diff --git a/enhanced-position-service/test/enhanced-position-client.h b/enhanced-position-service/test/enhanced-position-client.h
new file mode 100644
index 0000000..4519bb3
--- /dev/null
+++ b/enhanced-position-service/test/enhanced-position-client.h
@@ -0,0 +1,41 @@
+/**************************************************************************
+* @licence app begin@
+*
+* SPDX-License-Identifier: MPL-2.0
+*
+* \ingroup EnhancedPositionService
+* \author Marco Residori <marco.residori@xse.de>
+*
+* \copyright Copyright (C) 2014, XS Embedded GmbH
+*
+* \license
+* This Source Code Form is subject to the terms of the
+* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*
+* @licence end@
+**************************************************************************/
+#ifndef __ENHANCED_POSITION_CLIENT_H
+#define __ENHANCED_POSITION_CLIENT_H
+
+#include <dbus-c++/dbus.h>
+#include "enhanced-position-proxy.h"
+
+class EnhancedPositionClient
+ : public org::genivi::positioning::EnhancedPosition_proxy,
+ public DBus::IntrospectableProxy,
+ public DBus::ObjectProxy
+{
+public:
+
+ EnhancedPositionClient(DBus::Connection &connection, const char *path, const char *name);
+
+ void PositionUpdate(const std::vector< uint16_t >& changedValues);
+ void RotationRateUpdate(const std::vector< uint16_t >& changedValues);
+ void AccuracyUpdate(const std::vector< uint16_t >& changedValues);
+ void SatelliteInfoUpdate(const std::vector< uint16_t >& changedValues);
+ void StatusUpdate(const std::vector< uint16_t >& changedValues);
+
+};
+
+#endif//__ENHANCED_POSITION_CLIENT_H
diff --git a/enhanced-position-service/test/main-client.cpp b/enhanced-position-service/test/main-client.cpp
deleted file mode 100644
index abb6fe5..0000000
--- a/enhanced-position-service/test/main-client.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#include "testclient.h"
-#include "ConfigurationClient.h"
-#include "genivi-version.h"
-
-#include "signalhelper.h"
-
-
-int checkVersion(const QDBusConnection& conn, DemoIf* client)
-{
- if (client == NULL) {
- qWarning("client == NULL: can not speak with server, proxy not initialized.");
- return -1;
- }
-
- if (!client->isValid()) {
- qWarning("client is not valid: can not check for version.");
- return -1;
- }
-
- // request api version
- QDBusReply<GeniviVersion> replyResult;
- replyResult = client->GetVersion();
-
- if (replyResult.isValid()) {
- GeniviVersion version = replyResult.value();
-
- qDebug("API version: %d.%d.%d", version.getMajorVersion(),
- version.getMinorVersion(), version.getMicroVersion());
- // versionDate.toUtf8().data());
- }
- else {
- qDebug("reply is not valid?:");
- qDebug() << replyResult.error();
- }
-
- return 0;
-}
-
-void getConfiguration(ConfigurationIf* client)
-{
- if (client == NULL) {
- qWarning("getConfiguration: client is null.");
- return;
- }
-
- QDBusPendingReply<QVariantMap> reply = client->GetProperties();
-
- if (reply.isError()) {
- qWarning() << reply.error().name() << "; " << reply.error().message();
- return;
- }
-
- QVariantMap props = reply.value();
- qDebug() << "Configuration properties: " << props;
-}
-
-int main(int argc, char **argv)
-{
- QCoreApplication a(argc, argv);
-
- registerCommTypes();
-
- // TestClient implements the 'DBus signal' callbacks
- TestClient testClient;
- ConfigurationClient confClient;
-
- // terminates main loop if SIGTERM appears
- SignalHelper sigTermHelper;
-
- // do a first call to check connection to service.
- checkVersion(testClient.getConnection(), testClient.getClient());
- getConfiguration(confClient.getClient());
-
- // loop
- int rv = a.exec();
-
- return rv;
-}
diff --git a/enhanced-position-service/test/signalhelper.cpp b/enhanced-position-service/test/signalhelper.cpp
deleted file mode 100644
index 95a91e5..0000000
--- a/enhanced-position-service/test/signalhelper.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#include "signalhelper.h"
-#include <QtCore/qcoreapplication.h>
-
-static int setup_unix_signal_handlers()
-{
- struct sigaction hup, term;
-
- hup.sa_handler = SignalHelper::hupSignalHandler;
- sigemptyset(&hup.sa_mask);
- hup.sa_flags = 0;
- hup.sa_flags |= SA_RESTART;
-
- if (sigaction(SIGHUP, &hup, 0) > 0)
- return 1;
-
- term.sa_handler = SignalHelper::termSignalHandler;
- sigemptyset(&term.sa_mask);
- term.sa_flags |= SA_RESTART;
-
- if (sigaction(SIGTERM, &term, 0) > 0)
- return 2;
-
- return 0;
-}
-
-SignalHelper::SignalHelper(QObject *parent, const char *name)
- : QObject(parent)
-{
- setup_unix_signal_handlers();
-
- if (socketpair(AF_UNIX, SOCK_STREAM, 0, sighupFd))
- qFatal("Couldn't create HUP socketpair");
-
- if (socketpair(AF_UNIX, SOCK_STREAM, 0, sigtermFd))
- qFatal("Couldn't create TERM socketpair");
-
- snHup = new QSocketNotifier(sighupFd[1], QSocketNotifier::Read, this);
- connect(snHup, SIGNAL(activated(int)), this, SLOT(handleSigHup()));
- snTerm = new QSocketNotifier(sigtermFd[1], QSocketNotifier::Read, this);
- connect(snTerm, SIGNAL(activated(int)), this, SLOT(handleSigTerm()));
-}
-
-SignalHelper::~SignalHelper()
-{
-
-}
-
-void SignalHelper::hupSignalHandler(int)
-{
- char a = 1;
- ::write(sighupFd[0], &a, sizeof(a));
-}
-
-void SignalHelper::termSignalHandler(int)
-{
- char a = 1;
- ::write(sigtermFd[0], &a, sizeof(a));
-}
-
-void SignalHelper::handleSigTerm()
-{
- snTerm->setEnabled(false);
- char tmp;
- ::read(sigtermFd[1], &tmp, sizeof(tmp));
-
- // do Qt stuff
- qDebug("terminate ...");
- QCoreApplication::exit(0);
-
- snTerm->setEnabled(true);
-}
-
-void SignalHelper::handleSigHup()
-{
- snHup->setEnabled(false);
- char tmp;
- ::read(sighupFd[1], &tmp, sizeof(tmp));
-
- // do Qt stuff
- qDebug("handleSigHup");
-
- snHup->setEnabled(true);
-}
-
-
-
diff --git a/enhanced-position-service/test/signalhelper.h b/enhanced-position-service/test/signalhelper.h
deleted file mode 100644
index 3435d9d..0000000
--- a/enhanced-position-service/test/signalhelper.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-/*
- * See documentation at:
- * http://doc.qt.nokia.com/4.8/unix-signals.html
- */
-
-#ifndef MYCLIENT_H_
-#define MYCLIENT_H_
-
-#include <QtCore/QObject>
-#include <QtCore/QSocketNotifier>
-
-#include <signal.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-
-static int sighupFd[2];
-static int sigtermFd[2];
-
-class SignalHelper : public QObject {
-Q_OBJECT
-
-public:
- SignalHelper(QObject *parent = 0, const char *name = 0);
- ~SignalHelper();
-
- // Unix signal handlers.
- static void hupSignalHandler(int unused);
- static void termSignalHandler(int unused);
-
-public slots:
- // Qt signal handlers.
- void handleSigHup();
- void handleSigTerm();
-
-private:
- QSocketNotifier *snHup;
- QSocketNotifier *snTerm;
-};
-
-#endif /* MYCLIENT_H_ */
diff --git a/enhanced-position-service/test/simple-client.py b/enhanced-position-service/test/simple-client.py
deleted file mode 100755
index e032088..0000000
--- a/enhanced-position-service/test/simple-client.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-# author: thomas.bader@bmw.de
-# This client communicates with postion-daemon (genivi)
-# DBUS Client using PySide integration
-
-import sys, signal, time
-from traceback import print_exc
-
-# import python dbus module
-import dbus
-# import python dbus GLib mainloop support
-import dbus.mainloop.glib
-# import QtCore
-from PySide.QtCore import *
-
-# handler: state changed
-def state_changed(eventText):
- print "state changed ["+ eventText + "]"
- sys.stdout.flush()
-
-#
-# MAIN
-#
-if __name__ == '__main__':
-
- # use glib main loop
- dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
- # communicate on session bus
- bus = dbus.SessionBus()
-
- try:
- # get server object
- server_object = bus.get_object("org.genivi.position.EnhancedPosition",
- "/")
- # connect to interface
- iface = dbus.Interface(server_object, "org.genivi.position.EnhancedPosition")
- except dbus.DBusException:
- print_exc()
- sys.exit(1)
-
- # Start the application
- app = QCoreApplication([])
- # qtside specific termination handler! redirect to _DFL
- signal.signal(signal.SIGINT, signal.SIG_DFL)
-
- # version ok?
- version = []
- result = 0
- version, date = iface.GetVersion()
- print "GetVersion: %d.%d.%d (%s)" % (version[0], version[1], version[2] , date)
-
- # connect state signal
- iface.connect_to_signal("StateChanged", state_changed)
-
- # method call: CreateSession
- iface.CreateSession('simple-client.py')
- print 'created session'
-
- # mehtod call: CloseSession
- iface.CloseSession()
- print 'closed session'
-
- # enter main loop
- print 'enter application loop ... termninate with ctrl-c'
- app.exec_()
diff --git a/enhanced-position-service/test/testclient.cpp b/enhanced-position-service/test/testclient.cpp
deleted file mode 100644
index b63bf7c..0000000
--- a/enhanced-position-service/test/testclient.cpp
+++ /dev/null
@@ -1,253 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#include "testclient.h"
-
-#include "agentimpl.h"
-#include "genivi-navigationcore-enum.h"
-
-TestClient::TestClient(QObject *parent)
- : m_watcher(this),
- m_client(NULL),
- m_connection(QDBusConnection::sessionBus())
-{
- qDebug("TestClient started\n");
-
- if (!connectToProxy()) {
- qWarning() << "failed to connect to server";
- }
-
- // listen on bus: signal when EnhancedPositon server is started.
- activateWatcher();
-}
-
-TestClient::~TestClient()
-{
- m_watcher.removeWatchedService(DemoIf::staticInterfaceName());
-
- if (m_client != NULL)
- delete(m_client);
-}
-
-// signal callback
-void TestClient::AccuracyUpdate(const QList<ushort> &changedValues)
-{
- qDebug("'%s' is called", __FUNCTION__);
- emit requestAccuracy();
-}
-
-// signal callback
-void TestClient::PositionUpdate(const QList<ushort> &changedValues)
-{
- qDebug("'%s' is called (%d elements)", __FUNCTION__, changedValues.count());
- emit requestData();
-}
-
-// signal callback
-void TestClient::SatelliteInfoUpdate(const QList<ushort> &changedValues)
-{
- qDebug("'%s' is called", __FUNCTION__);
- emit requestSatelliteInfo();
-}
-
-// signal callback
-void TestClient::StatusUpdate(const QList<ushort> &changedValues)
-{
- qDebug("'%s' is called", __FUNCTION__);
- emit requestStatus();
-}
-
-// TODO use this to enable a robust client logic which registers to a new
-// appearing position daemon.
-void TestClient::serviceRegistered(const QString &serviceName)
-{
- qDebug("+++ DBus activities + registered %s +++",
- serviceName.toUtf8().constData());
-
- connectToProxy();
- // activateAgent();
-}
-
-void TestClient::serviceUnregistered(const QString &serviceName)
-{
- qDebug("+++ DBus activities + unegistered %s +++",
- serviceName.toUtf8().constData());
-
- if (m_client != NULL) {
- delete(m_client);
- m_client = NULL;
- }
-}
-
-
-void TestClient::requestData()
-{
- QList<ushort> request;
- request.append(EnhancedPositionData::ALL);
-
- QDBusPendingReply<MapUShortVariant> reply = getClient()->GetData(request);
-
- if (reply.isError()) {
- qWarning() << "GetData failed: "
- << reply.error().name() << "; "
- << reply.error().message();
- return;
- }
-
- MapUShortVariant data = reply.value();
- if (data.value(EnhancedPositionData::INVALID).isValid()) {
- qWarning() << "GetData: returned INVALID key";
- return;
- }
-
- // qDebug() << "GetData: " << data;
- qDebug() << "GetData: " << "\n" <<
- "lat = " << data.value(EnhancedPositionData::LATITUDE) << "\n"
- "long = " << data.value(EnhancedPositionData::LONGITUDE);
-}
-
-void TestClient::requestPosition()
-{
- QDBusPendingReply<MapUShortVariant> reply = getClient()->GetPosition();
-
- if (reply.isError()) {
- qWarning() << "GetPosition failed: "
- << reply.error().name() << "; "
- << reply.error().message();
- return;
- }
-
- MapUShortVariant data = reply.value();
- if (data.value(EnhancedPosition::INVALID).isValid()) {
- qWarning() << "GetPosition: returned INVALID key";
- return;
- }
-
- qDebug() << "GetPosition: " << data;
-}
-
-void TestClient::requestStatus()
-{
- QDBusPendingReply<MapUShortVariant> reply = getClient()->GetStatus();
-
- if (reply.isError()) {
- qWarning() << "GetStatus failed: "
- << reply.error().name() << "; "
- << reply.error().message();
- return;
- }
-
- MapUShortVariant data = reply.value();
- if (data.value(EnhancedPositionStatus::INVALID).isValid()) {
- qWarning() << "GetStatus: returned INVALID key";
- return;
- }
-
- qDebug() << "GetStatus: " << data;
-}
-
-void TestClient::requestAccuracy()
-{
- QDBusPendingReply<MapUShortVariant> reply = getClient()->GetAccuracy();
-
- if (reply.isError()) {
- qWarning() << "GetAccuracy failed: "
- << reply.error().name() << "; "
- << reply.error().message();
- return;
- }
-
- MapUShortVariant data = reply.value();
- if (data.value(Accuracy::INVALID).isValid()) {
- qWarning() << "GetAccuracy: returned INVALID key";
- return;
- }
-
- qDebug() << "GetAccuracy: " << data;
-}
-
-void TestClient::requestSatelliteInfo()
-{
- QDBusPendingReply<MapUShortVariant> reply = getClient()->GetSatelliteInfo();
-
- if (reply.isError()) {
- qWarning() << "GetSatelliteInfo failed: "
- << reply.error().name() << "; "
- << reply.error().message();
- return;
- }
-
- MapUShortVariant data = reply.value();
- if (data.value(SatelliteInfo::INVALID).isValid()) {
- qWarning() << "GetSatelliteInfo: returned INVALID key";
- return;
- }
-
- qDebug() << "GetSatelliteInfo: " << data;
-}
-
-// private
-bool TestClient::activateWatcher()
-{
- // only interesseted in EnhancedPosition-service
- m_watcher.addWatchedService(DemoIf::staticInterfaceName());
-
- // call me if: registered or unregistered
- connect(&m_watcher, SIGNAL(serviceRegistered(QString)),
- this, SLOT(serviceRegistered(QString)) );
- connect(&m_watcher, SIGNAL(serviceUnregistered(QString)),
- this, SLOT(serviceUnregistered(QString)) );
-
- m_watcher.setConnection(getConnection());
-}
-
-/*
- * connect signals to get info about position update!
- */
-bool TestClient::connectToProxy()
-{
- if (m_client != NULL) {
- qWarning("m_client already created. do not continue here.");
- return false;
- }
-
- m_client = new DemoIf(DemoIf::staticInterfaceName(), "/position", getConnection(), 0);
-
- if (!m_client->isValid()) {
- qWarning("failed to connect to service '%s'.",
- DemoIf::staticInterfaceName());
- delete(m_client);
- m_client = NULL;
- return false;
- }
-
- QObject::connect(m_client, SIGNAL(StatusUpdate(QList<ushort>)),
- this, SLOT(StatusUpdate(QList<ushort>)));
- QObject::connect(m_client, SIGNAL(PositionUpdate(QList<ushort>)),
- this, SLOT(PositionUpdate(QList<ushort>)));
- QObject::connect(m_client, SIGNAL(SatelliteInfoUpdate(QList<ushort>)),
- this, SLOT(SatelliteInfoUpdate(QList<ushort>)));
- QObject::connect(m_client, SIGNAL(AccuracyUpdate(QList<ushort>)),
- this, SLOT(AccuracyUpdate(QList<ushort>)));
-
- return true;
-}
-
-QDBusConnection& TestClient::getConnection()
-{
- return m_connection;
-}
diff --git a/enhanced-position-service/test/testclient.h b/enhanced-position-service/test/testclient.h
deleted file mode 100644
index 4f5a3d3..0000000
--- a/enhanced-position-service/test/testclient.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/**************************************************************************
-* @licence app begin@
-*
-* SPDX-License-Identifier: MPL-2.0
-*
-* \ingroup EnhancedPositionService
-*
-* \copyright Copyright (C) BMW Car IT GmbH 2011, 2012
-*
-* \license
-* This Source Code Form is subject to the terms of the
-* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
-* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*
-* @licence end@
-**************************************************************************/
-
-#ifndef TESTCLIENT_H
-#define TESTCLIENT_H
-
-#include "demoif.h"
-
-#include <QtDBus/QDBusServiceWatcher>
-
-/*
- * signaturs needs to match demoifadaptor.h
- */
-class TestClient : public QObject
-{
-Q_OBJECT
-public:
- explicit TestClient(QObject *parent = 0);
- ~TestClient();
- QDBusConnection& getConnection();
- DemoIf* getClient() { return m_client; }
-
-private Q_SLOTS:
- // calls when the relevant service appears/disappears.
- void serviceRegistered(const QString &serviceName);
- void serviceUnregistered(const QString &servicName);
-
-public Q_SLOTS:
- void AccuracyUpdate(const QList<ushort> &changedValues);
- void PositionUpdate(const QList<ushort> &changedValues);
- void SatelliteInfoUpdate(const QList<ushort> &changedValues);
- void StatusUpdate(const QList<ushort> &changedValues);
-
-private Q_SLOTS:
- void requestData();
- void requestPosition();
- void requestStatus();
- void requestAccuracy();
- void requestSatelliteInfo();
-
-private:
- bool activateWatcher();
- bool connectToProxy();
-
-// member:
- DemoIf* m_client;
- QDBusConnection m_connection;
- QDBusServiceWatcher m_watcher;
-};
-
-#endif /* TESTCLIENT_H */
diff --git a/gnss-service/CMakeLists.txt b/gnss-service/CMakeLists.txt
index 510b8c7..1288fca 100644
--- a/gnss-service/CMakeLists.txt
+++ b/gnss-service/CMakeLists.txt
@@ -31,11 +31,8 @@ option(WITH_REPLAYER
option(WITH_TESTS
"Compile test applications" OFF)
-if(${CMAKE_INSTALL_RPATH})
- set(CMAKE_INSTALL_RPATH ${LIBRARY_INSTALL_PATH}:${CMAKE_INSTALL_RPATH})
-else(${CMAKE_INSTALL_RPATH})
- set(CMAKE_INSTALL_RPATH ${LIBRARY_INSTALL_PATH})
-endif(${CMAKE_INSTALL_RPATH})
+SET(CMAKE_INSTALL_RPATH "")
+#SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
message(STATUS)
message(STATUS "---------------------------------------------------------")
diff --git a/log-replayer/src/log-replayer.c b/log-replayer/src/log-replayer.c
index bf24c60..ab1370a 100644
--- a/log-replayer/src/log-replayer.c
+++ b/log-replayer/src/log-replayer.c
@@ -19,6 +19,7 @@
#include <arpa/inet.h>
#include <netinet/in.h>
#include <stdio.h>
+#include <signal.h>
#include <stdlib.h>
#include <stdbool.h>
#include <sys/types.h>
@@ -36,6 +37,14 @@
DLT_DECLARE_CONTEXT(gContext);
+bool running = true;
+
+void sighandler(int sig)
+{
+ LOG_INFO_MSG(gContext,"Signal received");
+ running = false;
+}
+
bool getStrToSend(FILE* file, char* line, int dim)
{
static long unsigned int lastTimestamp = 0;
@@ -111,6 +120,9 @@ int main(int argc, char* argv[])
char buf[BUFLEN];
char msgId[MSGIDLEN];
+ signal(SIGTERM, sighandler);
+ signal(SIGINT, sighandler);
+
if(argc < 2)
{
LOG_ERROR_MSG(gContext,"missing input parameter: logfile");
@@ -151,7 +163,7 @@ int main(int argc, char* argv[])
LOG_INFO(gContext,"Started reading log file %s",filename);
- while(1)
+ while(running)
{
if(!getStrToSend(logfile,buf,BUFLEN))
{
diff --git a/positioning_1.0.bb b/positioning_1.0.bb
index a76dd74..38926d1 100755
--- a/positioning_1.0.bb
+++ b/positioning_1.0.bb
@@ -20,11 +20,11 @@
# Description: This is a Yocto recipe of the 4 proofs of concept contained
# in the positioning repository
#
-# Status: Draft (Work in Progress)
+# Status: Work in Progress
#
DESCRIPTION = "Positioning"
-HOMEPAGE = "http://git.projects.genivi.org/?p=lbs/positioning.git;a=summary"
+HOMEPAGE = "http://projects.genivi.org/ivi-navigation"
LICENSE = "MPLv2"
LICENSE_${PN}-gnss= "MPLv2"
@@ -42,7 +42,7 @@ S = "${WORKDIR}/git"
DEPENDS = "dbus"
DEPENDS += "dlt-daemon"
#DEPENDS += "gpsd"
-#DEPENDS += "qt4"
+#DEPENDS += "dbus-c++ dbus-c++-native "
inherit cmake pkgconfig
@@ -54,6 +54,12 @@ DEPENDS_${PN}-gnss-test = "${PN}-gnss"
RDEPENDS_${PN}-sns-test = "${PN}-sns"
DEPENDS_${PN}-sns-test = "${PN}-sns"
+RDEPENDS_${PN}-enhpos-test = "${PN}-enhpos"
+DEPENDS_${PN}-enhpos-test = "${PN}-enhpos"
+
+RDEPENDS_${PN}-repl-test = "${PN}-repl"
+DEPENDS_${PN}-repl-test = "${PN}-repl"
+
do_configure() {
cd ${S}/gnss-service && cmake -DWITH_DLT=OFF -DWITH_GPSD=OFF -DWITH_REPLAYER=ON -DWITH_TESTS=ON .
cd ${S}/sensors-service && cmake -DWITH_DLT=OFF -DWITH_REPLAYER=ON -DWITH_IPHONE=OFF -DWITH_TESTS=ON .
diff --git a/run-test.sh b/run-test.sh
index 9dc3ab5..b4d2eaa 100755
--- a/run-test.sh
+++ b/run-test.sh
@@ -25,6 +25,7 @@ usage() {
echo " sns Test SensorsService"
echo " enhpos Test EnhancedPositionService"
echo " repl Test LogReplayer"
+ echo " kill Kill all test applications"
echo " help Print Help"
echo
}
@@ -35,7 +36,6 @@ testGnssService()
sleep 3
echo 'starting log replayer...'
build/log-replayer/src/log-replayer log-replayer/logs/20100411_Geko_Regensburg_short.log > /dev/null 2>&1 &
- #build/log-replayer/src/log-replayer log-replayer/logs/testlog-gnss.gvsl > /dev/null 2>&1 &
sleep 10
echo 'stopping test...'
killall log-replayer
@@ -48,7 +48,6 @@ testSensorsService()
sleep 3
echo 'starting log replayer...'
build/log-replayer/src/log-replayer log-replayer/logs/20100411_Geko_Regensburg_short.log > /dev/null 2>&1 &
- #build/log-replayer/src/log-replayer log-replayer/logs/testlog-whtk.gvsl > /dev/null 2>&1 &
sleep 10
echo 'stopping test...'
killall log-replayer
@@ -57,32 +56,42 @@ testSensorsService()
testEnhancedPositionService()
{
- build/enhanced-position-service/src/position-daemon > /dev/null 2>&1 &
+ build/enhanced-position-service/src/enhanced-position-service > /dev/null 2>&1 &
sleep 3
- build/enhanced-position-service/test/test-client &
+ build/enhanced-position-service/test/enhanced-position-client &
sleep 3
echo 'starting log replayer...'
- build/log-replayer/src/log-replayer log-replayer/logs/geneve-cologny.log > /dev/null 2>&1 &
+ build/log-replayer/src/log-replayer log-replayer/logs/geneve-cologny.log > /dev/null 2>&1 &
sleep 10
echo 'stopping test...'
+ killall enhanced-position-client
+ killall enhanced-position-service
killall log-replayer
- killall test-client
- killall position-daemon
}
testLogReplayer()
{
- build/log-replayer/test/test-log-replayer 9931 &
+ build/log-replayer/test/test-log-replayer 9930 &
sleep 3
echo 'starting log replayer...'
- build/log-replayer/src/log-replayer log-replayer/logs/20100411_Geko_Regensburg_short.log > /dev/null 2>&1 &
- #build/log-replayer/src/log-replayer log-replayer/logs/testlog-whtk.gvsl > /dev/null 2>&1 &
+ build/log-replayer/src/log-replayer log-replayer/logs/geneve-cologny.log > /dev/null 2>&1
+ #build/log-replayer/src/log-replayer log-replayer/logs/20100411_Geko_Regensburg_short.log > /dev/null 2>&1 &
sleep 10
echo 'stopping test...'
killall log-replayer
killall test-log-replayer
}
+killAllTests()
+{
+ killall gnss-service-client
+ killall sensors-service-client
+ killall enhanced-position-client
+ killall enhanced-position-service
+ killall test-log-replayer
+ killall log-replayer
+}
+
if [ $# -eq 1 ]; then
if [ $1 = help ]; then
usage
@@ -91,11 +100,13 @@ if [ $# -eq 1 ]; then
elif [ $1 = sns ]; then
testSensorsService
elif [ $1 = enhpos ]; then
- testEnhancedPositionService
+ testEnhancedPositionService
elif [ $1 = repl ]; then
- testLogReplayer
+ testLogReplayer
+ elif [ $1 = kill ]; then
+ killAllTests
else
- usage
+ usage
fi
else
usage
diff --git a/sensors-service/CMakeLists.txt b/sensors-service/CMakeLists.txt
index 933f228..07a7ba9 100644
--- a/sensors-service/CMakeLists.txt
+++ b/sensors-service/CMakeLists.txt
@@ -19,11 +19,8 @@
project(sensors-service)
cmake_minimum_required(VERSION 2.6.0)
-if(${CMAKE_INSTALL_RPATH})
- set(CMAKE_INSTALL_RPATH ${LIBRARY_INSTALL_PATH}:${CMAKE_INSTALL_RPATH})
-else(${CMAKE_INSTALL_RPATH})
- set(CMAKE_INSTALL_RPATH ${LIBRARY_INSTALL_PATH})
-endif(${CMAKE_INSTALL_RPATH})
+SET(CMAKE_INSTALL_RPATH "")
+#SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
option(WITH_DLT
"Enable DLT logging" OFF)