summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Residori <marco.residori@xse.de>2015-04-29 09:37:08 +0200
committerMarco Residori <marco.residori@xse.de>2015-04-29 09:37:08 +0200
commit2572663aa5c02daff4c401ef2a95b70c4151803b (patch)
tree500cfa4c9695f96c57ca6c6720667bf66852f377
parente077c7f80844c34e8223b28850cdbc5f29d4e854 (diff)
downloadpositioning-2572663aa5c02daff4c401ef2a95b70c4151803b.tar.gz
Add license terms to some files and code cleanup
-rw-r--r--README16
-rw-r--r--enhanced-position-service/commonapi-service/FindDLT.cmake30
-rwxr-xr-xenhanced-position-service/commonapi-service/src/EnhancedPositionClient.cpp4
-rwxr-xr-xenhanced-position-service/commonapi-service/src/EnhancedPositionService.cpp6
-rw-r--r--enhanced-position-service/commonapi-service/src/EnhancedPositionStubImpl.cpp82
-rw-r--r--enhanced-position-service/dbus-service/FindDLT.cmake30
-rw-r--r--gnss-service/FindDLT.cmake18
-rw-r--r--log-replayer/FindDLT.cmake18
-rw-r--r--sensors-service/FindDLT.cmake18
9 files changed, 175 insertions, 47 deletions
diff --git a/README b/README
index e78cdb9..edd1e00 100644
--- a/README
+++ b/README
@@ -2,7 +2,7 @@
Positioning Git Repository
============================
-The Positioning repository is a collection of 4 proofs of concept:
+The Positioning repository is a collection of 5 proofs of concept:
* GNSSService
* SensorsService
* EnhancedPositionService
@@ -13,7 +13,7 @@ The Positioning repository is a collection of 4 proofs of concept:
Directory Structure
===============================
-enhanced-position-service //enhanced-position-service PoCs (1) dbus-service and 2) commonapi-service)
+enhanced-position-service //enhanced-position-service PoCs (a dbus-service and a commonapi-service)
gnss-service //gnss-service PoC
log-replayer //log-replayer-PoC
sensors-service //sensors-service PoC
@@ -74,17 +74,17 @@ If you wish to change the default cmake-options, please
3) delete the build directory,
4) recompile the code from scratch.
----------
+--------------------
Example
----------
+--------------------
If you wish to activate DLT logging for the GNSSService, just change the
value of GNSS_SERVICE_FLAGS in the file build-all.sh as follows:
GNSS_SERVICE_FLAGS='-DWITH_DLT=ON'
----------
-Notes & Dependencies
----------
+--------------------
+Dependencies
+--------------------
DWITH_GPSD=ON requires that the package 'gpsd' is installed.
To install 'gpsd', please execute the following commands:
@@ -95,7 +95,7 @@ To test the enhanced-positon-service (dbus-service) the package 'libdbus-c++-dev
To install 'libdbus-c++-dev', please execute the following command:
sudo apt-get install libdbus-c++-dev
-To test the enhanced-positon-service (commonapi-service) CommonAPI must be installed.
+To test the enhanced-positon-service (commonapi-service) the package CommonAPI must be installed.
To install CommonAPI, please see http://git.projects.genivi.org/?p=ipc/common-api-runtime.git;a=blob;f=README
DWITH_TESTS=ON enables the compilation of the test application(s).
diff --git a/enhanced-position-service/commonapi-service/FindDLT.cmake b/enhanced-position-service/commonapi-service/FindDLT.cmake
new file mode 100644
index 0000000..354f1d5
--- /dev/null
+++ b/enhanced-position-service/commonapi-service/FindDLT.cmake
@@ -0,0 +1,30 @@
+###########################################################################
+# @licence app begin@
+# SPDX-License-Identifier: MPL-2.0
+#
+# Component Name: EnhancedPositionService
+#
+# Author: Marco Residori
+#
+# 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@
+###########################################################################
+
+set(DLT_INCLUDE_DIRS /usr/include/dlt)
+set(DLT_LIBRARIES dlt)
+set(DLT_LIBRARY_DIRS /usr/lib)
+
+find_package(PkgConfig)
+pkg_check_modules(DLT REQUIRED automotive-dlt)
+
+if(${DLT_FOUND})
+ #message(STATUS "found and use automotive-dlt: version ${DLT_VERSION}")
+else()
+ message("missing DLT - check with 'pkg-config automotive-dlt --cflags-only-I'")
+endif()
diff --git a/enhanced-position-service/commonapi-service/src/EnhancedPositionClient.cpp b/enhanced-position-service/commonapi-service/src/EnhancedPositionClient.cpp
index fb1c12e..084b416 100755
--- a/enhanced-position-service/commonapi-service/src/EnhancedPositionClient.cpp
+++ b/enhanced-position-service/commonapi-service/src/EnhancedPositionClient.cpp
@@ -67,6 +67,10 @@ void positionUpdate(std::shared_ptr<EnhancedPositionProxyDefault> proxy, const E
}
int main() {
+
+ DLT_REGISTER_APP("ENHC","ENHANCED-POSITION-CLIENT");
+ DLT_REGISTER_CONTEXT(gCtx,"ENHC","Global Context");
+
std::shared_ptr < CommonAPI::Runtime > runtime = CommonAPI::Runtime::load();
std::shared_ptr < CommonAPI::Factory > factory = runtime->createFactory();
diff --git a/enhanced-position-service/commonapi-service/src/EnhancedPositionService.cpp b/enhanced-position-service/commonapi-service/src/EnhancedPositionService.cpp
index 14fe771..774ca5b 100755
--- a/enhanced-position-service/commonapi-service/src/EnhancedPositionService.cpp
+++ b/enhanced-position-service/commonapi-service/src/EnhancedPositionService.cpp
@@ -4,7 +4,6 @@
* 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/. */
-#include <thread>
#include <CommonAPI/CommonAPI.h>
#include "EnhancedPositionStubImpl.h"
#include "PositionFeedbackStubImpl.h"
@@ -16,8 +15,9 @@ DLT_DECLARE_CONTEXT(gCtx);
using namespace std;
int main() {
- DLT_REGISTER_APP("ENHP","ENHANCED_POSITION-SERVICE");
- DLT_REGISTER_CONTEXT(gCtx,"ENHP","Global Context");
+
+ DLT_REGISTER_APP("ENHS","ENHANCED-POSITION-SERVICE");
+ DLT_REGISTER_CONTEXT(gCtx,"ENHS","Global Context");
std::shared_ptr<CommonAPI::Runtime> runtime = CommonAPI::Runtime::load();
std::shared_ptr<CommonAPI::Factory> factory = runtime->createFactory();
diff --git a/enhanced-position-service/commonapi-service/src/EnhancedPositionStubImpl.cpp b/enhanced-position-service/commonapi-service/src/EnhancedPositionStubImpl.cpp
index 689685a..7c28d3b 100644
--- a/enhanced-position-service/commonapi-service/src/EnhancedPositionStubImpl.cpp
+++ b/enhanced-position-service/commonapi-service/src/EnhancedPositionStubImpl.cpp
@@ -63,38 +63,6 @@ void EnhancedPositionStubImpl::sigPositionUpdate(const TGNSSPosition position[],
for (int i = 0; i< numElements; i++)
{
- LOG_INFO(gCtx,"Position Update[%d/%d]: \n \
- lat=%f \n \
- lon=%f \n \
- alt=%f \n \
- speed=%f \n \
- heading=%f \n \
- climb=%f \n \
- pdop=%f \n \
- hdop=%f \n \
- vdop=%f \n \
- sigmaHPosition=%f \n \
- sigmaAltitude=%f \n \
- usedSatellites=%d \n \
- fixStatus=%d \n \
- fixTypeBits=0x%08X \n",
- i+1,
- numElements,
- position[i].latitude,
- position[i].longitude,
- position[i].altitudeMSL,
- position[i].hSpeed,
- position[i].heading,
- position[i].vSpeed,
- position[i].pdop,
- position[i].hdop,
- position[i].vdop,
- position[i].sigmaHPosition,
- position[i].sigmaAltitude,
- position[i].usedSatellites,
- position[i].fixStatus,
- position[i].fixTypeBits);
-
if (latChanged == false)
{
latChanged = (position[i].validityBits & GNSS_POSITION_LATITUDE_VALID);
@@ -155,6 +123,48 @@ void EnhancedPositionStubImpl::sigPositionUpdate(const TGNSSPosition position[],
fixTypeBitsChanged = (position[i].validityBits & GNSS_POSITION_TYPE_VALID);
}
+ //extend this OR statement if necessary (when more notifications are supported)
+ if(latChanged || lonChanged || altChanged)
+ {
+ LOG_INFO(gCtx,"Position Update[%d/%d]: lat=%f, lon=%f, alt=%f",
+ i+1,
+ numElements,
+ position[i].latitude,
+ position[i].longitude,
+ position[i].altitudeMSL);
+
+ /*LOG_INFO(gCtx,"Position Update[%d/%d]: \n \
+ lat=%f \n \
+ lon=%f \n \
+ alt=%f \n \
+ speed=%f \n \
+ heading=%f \n \
+ climb=%f \n \
+ pdop=%f \n \
+ hdop=%f \n \
+ vdop=%f \n \
+ sigmaHPosition=%f \n \
+ sigmaAltitude=%f \n \
+ usedSatellites=%d \n \
+ fixStatus=%d \n \
+ fixTypeBits=0x%08X \n",
+ i+1,
+ numElements,
+ position[i].latitude,
+ position[i].longitude,
+ position[i].altitudeMSL,
+ position[i].hSpeed,
+ position[i].heading,
+ position[i].vSpeed,
+ position[i].pdop,
+ position[i].hdop,
+ position[i].vdop,
+ position[i].sigmaHPosition,
+ position[i].sigmaAltitude,
+ position[i].usedSatellites,
+ position[i].fixStatus,
+ position[i].fixTypeBits);*/
+ }
}
//in a real product, the coordinates would be used for dead-reckoning.
@@ -222,10 +232,10 @@ void EnhancedPositionStubImpl::sigPositionUpdate(const TGNSSPosition position[],
return;
}
- //extend this list if necessary
- if (latChanged || lonChanged || altChanged ) {
- LOG_INFO(gCtx,"firePositionUpdateEvent[%lld]",changedValues);
- mpSelf->firePositionUpdateEvent(changedValues);
+ //extend this OR statement if necessary (when more notifications are supported)
+ if(latChanged || lonChanged || altChanged)
+ {
+ mpSelf->firePositionUpdateEvent(changedValues);
}
}
diff --git a/enhanced-position-service/dbus-service/FindDLT.cmake b/enhanced-position-service/dbus-service/FindDLT.cmake
new file mode 100644
index 0000000..354f1d5
--- /dev/null
+++ b/enhanced-position-service/dbus-service/FindDLT.cmake
@@ -0,0 +1,30 @@
+###########################################################################
+# @licence app begin@
+# SPDX-License-Identifier: MPL-2.0
+#
+# Component Name: EnhancedPositionService
+#
+# Author: Marco Residori
+#
+# 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@
+###########################################################################
+
+set(DLT_INCLUDE_DIRS /usr/include/dlt)
+set(DLT_LIBRARIES dlt)
+set(DLT_LIBRARY_DIRS /usr/lib)
+
+find_package(PkgConfig)
+pkg_check_modules(DLT REQUIRED automotive-dlt)
+
+if(${DLT_FOUND})
+ #message(STATUS "found and use automotive-dlt: version ${DLT_VERSION}")
+else()
+ message("missing DLT - check with 'pkg-config automotive-dlt --cflags-only-I'")
+endif()
diff --git a/gnss-service/FindDLT.cmake b/gnss-service/FindDLT.cmake
index 032eeff..039e4c8 100644
--- a/gnss-service/FindDLT.cmake
+++ b/gnss-service/FindDLT.cmake
@@ -1,3 +1,21 @@
+###########################################################################
+# @licence app begin@
+# SPDX-License-Identifier: MPL-2.0
+#
+# Component Name: GNSSService
+#
+# Author: Marco Residori
+#
+# 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@
+###########################################################################
+
set(DLT_INCLUDE_DIRS /usr/include/dlt)
set(DLT_LIBRARIES dlt)
set(DLT_LIBRARY_DIRS /usr/lib)
diff --git a/log-replayer/FindDLT.cmake b/log-replayer/FindDLT.cmake
index 032eeff..c92aba9 100644
--- a/log-replayer/FindDLT.cmake
+++ b/log-replayer/FindDLT.cmake
@@ -1,3 +1,21 @@
+###########################################################################
+# @licence app begin@
+# SPDX-License-Identifier: MPL-2.0
+#
+# Component Name: LogReplayer
+#
+# Author: Marco Residori
+#
+# 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@
+###########################################################################
+
set(DLT_INCLUDE_DIRS /usr/include/dlt)
set(DLT_LIBRARIES dlt)
set(DLT_LIBRARY_DIRS /usr/lib)
diff --git a/sensors-service/FindDLT.cmake b/sensors-service/FindDLT.cmake
index 032eeff..d34aa0d 100644
--- a/sensors-service/FindDLT.cmake
+++ b/sensors-service/FindDLT.cmake
@@ -1,3 +1,21 @@
+###########################################################################
+# @licence app begin@
+# SPDX-License-Identifier: MPL-2.0
+#
+# Component Name: SensorsService
+#
+# Author: Marco Residori
+#
+# 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@
+###########################################################################
+
set(DLT_INCLUDE_DIRS /usr/include/dlt)
set(DLT_LIBRARIES dlt)
set(DLT_LIBRARY_DIRS /usr/lib)