diff options
author | Marco Residori <marco.residori@xse.de> | 2014-12-10 11:39:26 +0100 |
---|---|---|
committer | Marco Residori <marco.residori@xse.de> | 2014-12-10 11:39:26 +0100 |
commit | 7289ad087e475a6f2a2c0a43980993e97e24b36e (patch) | |
tree | 2a39b427aeb9cb5722942c07370c6498134f91c2 | |
parent | e98daf7a49c4aed39da4b57ba2c3083daa6625d8 (diff) | |
parent | 8543a75f0612703ce5fb9e64428c4f034acb6928 (diff) | |
download | positioning-7289ad087e475a6f2a2c0a43980993e97e24b36e.tar.gz |
Merge branch 'master' of ssh://git.projects.genivi.org/lbs/positioning
46 files changed, 790 insertions, 1100 deletions
@@ -1,3 +1,5 @@ build/ +CMakeFiles/ +CMakeCache.txt *~ *.user diff --git a/build-all.sh b/build-all.sh index bfe68e2..fb3e2a7 100755 --- a/build-all.sh +++ b/build-all.sh @@ -14,6 +14,10 @@ # 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/. # +# Update (2014/12/02) : Philippe Colliot <philippe.colliot@mpsa.com>, +# PSA Peugeot Citroen +# - introduce debug flag to enable verbosity +# - generate the API of enhanced-position-service into the API folder # @licence end@ ########################################################################### @@ -21,10 +25,10 @@ # Compiler Flags #-------------------------------------------------------------------------- # modify the following flags as needed: -GNSS_SERVICE_FLAGS='-DWITH_DLT=OFF -DWITH_GPSD=OFF -DWITH_REPLAYER=ON -DWITH_TESTS=ON' -SENSORS_SERVICE_FLAGS='-DWITH_DLT=OFF -DWITH_REPLAYER=ON -DWITH_IPHONE=OFF -DWITH_TESTS=ON' -ENHANCED_POSITION_SERVICE_FLAGS='-DWITH_DLT=OFF -DWITH_GPSD=OFF -DWITH_REPLAYER=ON -DWITH_IPHONE=OFF -DWITH_TESTS=ON' -LOG_REPLAYER_FLAGS='-DWITH_DLT=OFF -DWITH_TESTS=ON' +GNSS_SERVICE_FLAGS='-DWITH_DLT=OFF -DWITH_GPSD=OFF -DWITH_REPLAYER=ON -DWITH_TESTS=ON -DWITH_DEBUG=ON' +SENSORS_SERVICE_FLAGS='-DWITH_DLT=OFF -DWITH_REPLAYER=ON -DWITH_IPHONE=OFF -DWITH_TESTS=ON -DWITH_DEBUG=ON' +ENHANCED_POSITION_SERVICE_FLAGS='-DWITH_DLT=OFF -DWITH_GPSD=OFF -DWITH_REPLAYER=ON -DWITH_IPHONE=OFF -DWITH_TESTS=ON -DWITH_DEBUG=ON' +LOG_REPLAYER_FLAGS='-DWITH_DLT=OFF -DWITH_TESTS=ON -DWITH_DEBUG=ON' #-------------------------------------------------------------------------- TOP_SRC_DIR=$PWD @@ -33,6 +37,7 @@ TOP_BIN_DIR=$PWD/build GNSS_SERVICE_SRC_DIR=$TOP_SRC_DIR/gnss-service SENSORS_SERVICE_SRC_DIR=$TOP_SRC_DIR/sensors-service ENHANCED_POSITION_SERVICE_SRC_DIR=$TOP_SRC_DIR/enhanced-position-service +ENHANCED_POSITION_SERVICE_API_DIR=$ENHANCED_POSITION_SERVICE_SRC_DIR/api LOG_REPLAYER_SRC_DIR=$TOP_SRC_DIR/log-replayer GNSS_SERVICE_BIN_DIR=$TOP_BIN_DIR/gnss-service @@ -84,6 +89,12 @@ buildEnhancedPositionService() { buildLogReplayer() { echo '' echo 'Building LogReplayer ->' $LOG_REPLAYER_SRC_DIR + echo '' + echo 'Generate DBus include files' + cd $ENHANCED_POSITION_SERVICE_API_DIR + cmake . + echo '' + echo 'Build the code' mkdir -p $LOG_REPLAYER_BIN_DIR cd $LOG_REPLAYER_BIN_DIR cmake $LOG_REPLAYER_FLAGS $LOG_REPLAYER_SRC_DIR && make diff --git a/enhanced-position-service/.gitignore b/enhanced-position-service/.gitignore new file mode 100644 index 0000000..d0cf84f --- /dev/null +++ b/enhanced-position-service/.gitignore @@ -0,0 +1,3 @@ +*.user +*.cmake + diff --git a/enhanced-position-service/CMakeLists.txt b/enhanced-position-service/CMakeLists.txt index ed92182..f9a6a98 100644 --- a/enhanced-position-service/CMakeLists.txt +++ b/enhanced-position-service/CMakeLists.txt @@ -13,6 +13,9 @@ # 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/. # +# Update (2014/12/02) : Philippe Colliot <philippe.colliot@mpsa.com>, +# PSA Peugeot Citroen +# - introduce debug flag to disable verbosity # @licence end@ ########################################################################### @@ -31,6 +34,9 @@ option(WITH_REPLAYER option(WITH_TESTS "Compile test applications" OFF) +option(WITH_DEBUG + "Enable the debug messages" OFF) + message(STATUS) message(STATUS "---------------------------------------------------------") @@ -56,7 +62,9 @@ else() message(STATUS "Invalid cmake options!") endif() -include_directories(api src test ${gnss-service_INCLUDE_DIRS} ${sensors-service_INCLUDE_DIRS}) +set(enhanced-position-service_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/api/include") + +include_directories(${enhanced-position-service_INCLUDE_DIRS} src test ${gnss-service_INCLUDE_DIRS} ${sensors-service_INCLUDE_DIRS}) add_subdirectory(src) diff --git a/enhanced-position-service/api/.gitignore b/enhanced-position-service/api/.gitignore new file mode 100644 index 0000000..c52045f --- /dev/null +++ b/enhanced-position-service/api/.gitignore @@ -0,0 +1,2 @@ +include/ +Makefile diff --git a/enhanced-position-service/api/CMakeLists.txt b/enhanced-position-service/api/CMakeLists.txt new file mode 100644 index 0000000..3f2ab24 --- /dev/null +++ b/enhanced-position-service/api/CMakeLists.txt @@ -0,0 +1,95 @@ +########################################################################### +# @licence app begin@ +# SPDX-License-Identifier: MPL-2.0 +# +# Component Name: enhanced-position-service +# +# Author: Philippe Colliot +# +# Copyright (C) 2014, PCA Peugeot Citroën +# +# 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(enhanced-position-service) +cmake_minimum_required(VERSION 2.8) + +message(STATUS "generation of DBus files for enhanced-position-service") + +find_program(XSLTPROC xsltproc REQUIRED) +find_program(DBUSXML2CPP dbusxx-xml2cpp REQUIRED) + +set(cmake_create_dir cmake -E make_directory) + +set(API_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + +execute_process( + WORKING_DIRECTORY ${API_DIR} + COMMAND ${cmake_create_dir} include +) + +set(TARGET_GENERATED_API_DIR ${API_DIR}/include) + +file (GLOB XML_TO_DBUS_PROXY + ${CMAKE_CURRENT_SOURCE_DIR}/genivi-positioning-configuration.xml + ${CMAKE_CURRENT_SOURCE_DIR}/genivi-positioning-enhancedposition.xml + ${CMAKE_CURRENT_SOURCE_DIR}/genivi-positioning-positionfeedback.xml +) +foreach (RAW_FILE ${XML_TO_DBUS_PROXY}) + get_filename_component(FILE ${RAW_FILE} NAME_WE) + if(NOT EXISTS ${TARGET_GENERATED_API_DIR}/${FILE}_proxy.h) + execute_process( + COMMAND ${DBUSXML2CPP} ${RAW_FILE} --proxy=${TARGET_GENERATED_API_DIR}/${FILE}_proxy.h + ) + else() + if(${RAW_FILE} IS_NEWER_THAN ${TARGET_GENERATED_API_DIR}/${FILE}_proxy.h) + execute_process( + COMMAND ${DBUSXML2CPP} ${RAW_FILE} --proxy=${TARGET_GENERATED_API_DIR}/${FILE}_proxy.h + ) + endif() + endif() +endforeach() + +file (GLOB XML_TO_DBUS_ADAPTOR + ${CMAKE_CURRENT_SOURCE_DIR}/genivi-positioning-configuration.xml + ${CMAKE_CURRENT_SOURCE_DIR}/genivi-positioning-enhancedposition.xml + ${CMAKE_CURRENT_SOURCE_DIR}/genivi-positioning-positionfeedback.xml +) +foreach (RAW_FILE ${XML_TO_DBUS_ADAPTOR}) + get_filename_component(FILE ${RAW_FILE} NAME_WE) + if(NOT EXISTS ${TARGET_GENERATED_API_DIR}/${FILE}_adaptor.h) + execute_process( + COMMAND ${DBUSXML2CPP} ${RAW_FILE} --adaptor=${TARGET_GENERATED_API_DIR}/${FILE}_adaptor.h + ) + else() + if(${RAW_FILE} IS_NEWER_THAN ${TARGET_GENERATED_API_DIR}/${FILE}_adaptor.h) + execute_process( + COMMAND ${DBUSXML2CPP} ${RAW_FILE} --adaptor=${TARGET_GENERATED_API_DIR}/${FILE}_adaptor.h + ) + endif() + endif() +endforeach() + +file (GLOB XML_TO_DBUS_CONSTANT + ${CMAKE_CURRENT_SOURCE_DIR}/genivi-positioning-constants.xml +) +foreach (RAW_FILE ${XML_TO_DBUS_CONSTANT}) + get_filename_component(FILE ${RAW_FILE} NAME_WE) + if(NOT EXISTS ${TARGET_GENERATED_API_DIR}/${FILE}.h) + execute_process( + OUTPUT_FILE ${TARGET_GENERATED_API_DIR}/${FILE}.h + COMMAND ${XSLTPROC} ${CMAKE_CURRENT_SOURCE_DIR}/enum.xsl ${RAW_FILE} + ) + else() + if(${RAW_FILE} IS_NEWER_THAN ${TARGET_GENERATED_API_DIR}/${FILE}.h) + execute_process( + OUTPUT_FILE ${TARGET_GENERATED_API_DIR}/${FILE}.h + COMMAND ${XSLTPROC} ${CMAKE_CURRENT_SOURCE_DIR}/enum.xsl ${RAW_FILE} + ) + endif() + endif() +endforeach() diff --git a/enhanced-position-service/api/enum.xsl b/enhanced-position-service/api/enum.xsl index b1c70ff..672d64d 100644 --- a/enhanced-position-service/api/enum.xsl +++ b/enhanced-position-service/api/enum.xsl @@ -30,8 +30,8 @@ }; --> -enum EPOS_Constants {<xsl:for-each select="id"> - POS_<xsl:value-of select="translate(@name,'-','_')"/> = <xsl:value-of select="@value"/>,</xsl:for-each> +enum GENIVI_<xsl:value-of select="$constants"/>_Constants {<xsl:for-each select="id"> + GENIVI_<xsl:value-of select="$constants"/>_<xsl:value-of select="translate(@name,'-','_')"/> = <xsl:value-of select="@value"/>,</xsl:for-each> }; </xsl:template> </xsl:stylesheet> diff --git a/enhanced-position-service/api/franca/Configuration.fidl b/enhanced-position-service/api/franca/Configuration.fidl index 022d0c8..cc3ae71 100755 --- a/enhanced-position-service/api/franca/Configuration.fidl +++ b/enhanced-position-service/api/franca/Configuration.fidl @@ -12,32 +12,24 @@ package org.genivi.EnhancedPositionService import org.genivi.EnhancedPositionService.EnhancedPositionServiceTypes.* from "EnhancedPositionServiceTypes.fidl"
-<**
- @description : Configuration = This interface allows a client application to set and retrieve configuration options
-**>
+<** @description : Configuration = This interface allows a client application to set and retrieve configuration options **>
interface Configuration {
- version {
- major 0
- minor 0
- }
+ version {
+ major 0
+ minor 0
+ }
- <**
- @description : SatelliteSystem = satellite system (GPS, Glonass, ...)
- **>
- attribute UInt16 SatelliteSystem
+ <** @description : SatSystem = satellite system (GPS, GLONASS, ...) **>
+ attribute SatelliteSystem SatSystem
- <**
- @description : UpdateInterval = update interval
- **>
+ <** @description : UpdateInterval = update interval **>
attribute Int32 UpdateInterval
- <**
- @description : GetVersion = This method returns the API version implemented by the server application.
- **>
+ <** @description : GetVersion = This method returns the API version implemented by the server application **>
method GetVersion {
- out {
- Version ^version
- }
- }
+ out {
+ Version ^version
+ }
+ }
}
diff --git a/enhanced-position-service/api/franca/EnhancedPosition.fidl b/enhanced-position-service/api/franca/EnhancedPosition.fidl index 5f47b07..8b7bdba 100755 --- a/enhanced-position-service/api/franca/EnhancedPosition.fidl +++ b/enhanced-position-service/api/franca/EnhancedPosition.fidl @@ -12,140 +12,67 @@ package org.genivi.EnhancedPositionService import org.genivi.EnhancedPositionService.EnhancedPositionServiceTypes.* from "EnhancedPositionServiceTypes.fidl"
-<**
- @description : EnhancedPosition = This interface offers functionalities to retrieve the enhanced position of the vehicle
-**>
+<** @description : EnhancedPosition = This interface offers functionalities to retrieve the enhanced position of the vehicle **>
interface EnhancedPosition {
- version {
- major 0
- minor 0
- }
+ version {
+ major 0
+ minor 0
+ }
- <**
- @description : GetVersion = This method returns the API version implemented by the server application
- **>
+ <** @description : GetVersion = This method returns the API version implemented by the server application **>
method GetVersion {
- out {
- Version ^version
- }
- }
-
- <**
- @description : GetData = This method returns a given set of positioning data (e.g. Position, Course, Accuracy, Status, ... )
- Note: If a requested value is invalid, it's not returned to the client application
- **>
- method GetData {
- in {
- PositionDataKey[] valuesToReturn
- }
- out {
- PositionData data
- }
- }
-
- <**
- @description : GetPosition = This method returns the current position
- Note: If a requested value is invalid, it's not returned to the client application
- **>
- method GetPosition {
- out {
- PositionInfo position
- }
- }
+ out {
+ Version ^version
+ }
+ }
- <**
- @description : GetRotationRate = This method returns the rotation rate
- Note: If a requested value is invalid, it's not returned to the client application
- **>
- method GetRotationRate {
- out {
- RotationRate rotationRate
- }
- }
-
- <**
- @description : GetAccuracy = This method returns the accuracy
- Note: If a requested value is invalid, it's not returned to the client application
+ <** @description : GetPositionInfo = This method returns a given set of positioning data (e.g. Position, Course, Accuracy, Status, ... )
+ Note: If a requested value is invalid, it's not returned to the client application
**>
- method GetAccuracy {
- out {
- AccuracyInfo accuracy
- }
- }
-
+ method GetPositionInfo {
+ in {
+ <** @description : valuesToReturn = Bitmask obtained as result of a bitwise OR operation on the keys corresponding to the values to be returned **>
+ Bitmask valuesToReturn
+ }
+ out {
+ <** @description : timestamp = Timestamp of the acquisition of the position data [ms] **>
+ Timestamp timestamp
+ <** @description : data = Position data **>
+ PositionInfo[] data
+ }
+ }
+
<**
@description : GetSatelliteInfo = This method returns information about the current satellite constellation
Note: If a requested value is invalid, it's not returned to the client application
**>
- method GetSatelliteInfo {
- out {
- SatelliteInfo satelliteInfo
- }
- }
-
- <**
- @description : GetStatus = This method returns the status of this service
- Note: If a requested value is invalid, it's not returned to the client application
- **>
- method GetStatus {
- out {
- StatusInfo status
- }
- }
-
- <**
- @description : GetTime = This method returns UTC time and date
- Note: If a requested value is invalid, it's not returned to the client application
- **>
- method GetTime {
- out {
- TimeInfo time
- }
- }
-
- <**
- @description : 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
+ method GetSatelliteInfo {
+ out {
+ <** @description : timestamp = Timestamp of the acquisition of the satellite detail data [ms] **>
+ Timestamp timestamp
+ <** @description : satelliteInfo = satellite information **>
+ SatelliteInfo[] satelliteInfo
+ }
+ }
+
+ <** @description : GetTime = This method returns UTC time and date.
+ Note: If a requested value is invalid, it's not returned to the client application
**>
+ method GetTime {
+ out {
+ <** @description : timestamp = Timestamp of the acquisition of the UTC date/time [ms] **>
+ Timestamp timestamp
+ <** @description : time = UTC date/time **>
+ TimeInfo time
+ }
+ }
+
+ <** @description : 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 **>
broadcast PositionUpdate {
- out {
- PositionDataKey[] changedValues
- }
- }
-
- <**
- @description : RotationRateUpdated = This signal is emitted when the rotation rate changes
- **>
- broadcast RotationRateUpdate {
- out {
- RotationRateKey[] changedValues
- }
- }
-
- <**
- @description : AccuracyUpdated = This signal is emitted when the accuracy changes
- **>
- broadcast AccuracyUpdate {
- out {
- AccuracyInfoKey[] changedValues
- }
- }
-
- <**
- @description : SatelliteInfoUpdate = This signal is emitted when information about the current satellite information is updated
- **>
- broadcast SatelliteInfoUpdate {
- out {
- SatelliteInfoKey[] changedValues
- }
- }
-
- <**
- @description : StatusUpdate = This signal is emitted when the status of this service changes
- **>
- broadcast StatusUpdate {
- out {
- StatusInfoKey[] changedValues
- }
- }
+ out {
+ <** @description : valuesToReturn = Bitmask obtained as result of a bitwise OR operation on the keys corresponding to the values that changed **>
+ Bitmask changedValues
+ }
+ }
}
diff --git a/enhanced-position-service/api/franca/EnhancedPositionServiceTypes.fidl b/enhanced-position-service/api/franca/EnhancedPositionServiceTypes.fidl index a16cb07..cdb66af 100755 --- a/enhanced-position-service/api/franca/EnhancedPositionServiceTypes.fidl +++ b/enhanced-position-service/api/franca/EnhancedPositionServiceTypes.fidl @@ -11,226 +11,121 @@ package org.genivi.EnhancedPositionService
typeCollection EnhancedPositionServiceTypes {
+
+ typedef Timestamp is UInt64
- typedef Handle is UInt32
+ <** @description: bitmask obtained as a result of an OR operation on enum values of type PositionInfoKey **>
+ typedef Bitmask is UInt64
- <** @description: version.**>
+ <** @description: version **>
struct Version {
- <** @description : when the major changes, then backward compatibility with previous releases is not granted.**>
- UInt16 ^major
- <** @description : 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).**>
- UInt16 ^minor
- <** @description : when the micro changes, then backward compatibility with previous releases is granted (bug fixes or documentation modifications).**>
- UInt16 ^micro
- <** @description : release date (e.g. 21-06-2011).**>
- String date
+ <** @description : when the major changes, then backward compatibility with previous releases is not granted **>
+ UInt16 ^major
+ <** @description : 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) **>
+ UInt16 ^minor
+ <** @description : when the micro changes, then backward compatibility with previous releases is granted (bug fixes or documentation modifications) **>
+ UInt16 ^micro
+ <** @description : release date (e.g. 21-06-2011) **>
+ String date
}
- <** @description : genereic value (mapped to a dbus variant ('v') data type.**>
+ <** @description : Value = generic value (mapped to a dbus variant ('v') data type)**>
union Value {
- UInt32 uInt32Value
- String stringValue
- }
-
- enumeration BasicEnum {
- INVALID = 0x0000
- }
-
- <** @description: 2D geocoordinate.**>
- struct Coordinate2D {
- <** @description : latitude of a vertex of the polygon in format %3.6f. Range [-90:+90]. Example: 48.053250.**>
- Double latitude
- <** @description : longitude of a vertex of the polygon in format %3.6f. Range [-180:+180]. Example: 48.053250.**>
- Double longitude
+ UInt64 uInt64Value
+ String stringValue
}
- <** @description: 3D geocoordinate.**>
- struct Coordinate3D extends Coordinate2D {
- <** @description : altitude above the sea level of the current position in meters.**>
- Int32 altitude
- }
-
- enumeration PositionDataKey extends BasicEnum {
- TIMESTAMP = 0x0001
- LATITUDE = 0x0020
- LONGITUDE = 0x0021
- ALTITUDE = 0x0022
- HEADING = 0x0030
- SPEED = 0x0031
- CLIMB = 0x0032
- ROLL_RATE = 0x0060
- PITCH_RATE = 0x0061
- YAW_RATE = 0x0062
- PDOP = 0x0080
- HDOP = 0x0081
- VDOP = 0x0082
- SIGMA_LATITUDE = 0x0083
- SIGMA_LONGITUDE = 0x0084
- SIGMA_ALTITUDE = 0x0085
- SIGMA_HEADING = 0x0086
- ALL = 0xffff
- }
-
- <**
- @description : PositioningData = array of tuples (key,value)
- key = enumeration PositionDataKey
- key = TIMESTAMP, value = value of type 'UInt64', that represents a timestamp in ms
- key = LATITUDE, value = value of type 'Double', that expresses the latitude of the current position. Range [-90:+90]. Example: 48.053250
- key = LONGITUDE, value = value of type 'Double', that expresses the longitude of the current position. Range [-180:+180]. Example: 8.324500
- key = ALTITUDE, value = value of type 'Int32', that expresses the altitude above the sea level of the current position in meters
- key = HEADING, value = value of type 'Int32', that expresses the course angle in degree. Range [0:360]. 0 = north, 90 = east, 180 = south, 270 = west
- key = SPEED, value = value of type 'Double', that expresses speed measured in m/s. A negative value indicates that the vehicle is moving backwards
- key = CLIMB, value = value of type 'Int32', that expresses the road gradient in degrees
- key = ROLL_RATE, value = value of type 'Int32', rotation rate around the X-axis in degrees/s. Range [-100:+100]
- key = PITCH_RATE, value = value of type 'Int32', rotation rate around the Y-axis in degrees/s. Range [-100:+100]
- key = YAW_RATE, value = value of type 'Int32', rotation rate around the Z-axis in degrees/s. Range [-100:+100]
- key = PDOP, value = value of type 'Double', that represents the positional (3D) dilution of precision
- key = HDOP, value = value of type 'Double', that represents the horizontal (2D) dilution of precision
- key = VDOP, value = value of type 'Double', that represents vertical (altitude) dilution of precision
- key = SIGMA_LATITUDE, value = value of type 'Double', that represents the standard deviation for latitude in m
- key = SIGMA_LONGITUDE, value = value of type 'Double', that represents the standard deviation for longitude in m
- key = SIGMA_ALTITUDE, value = value of type 'Double', that represents the standard deviation for altitude in m
- key = SIGMA_HEADING, value = value of type 'Double', that represents the standard deviation for altitude in degrees
- **>
- map PositionData {
- PositionDataKey to Value
- }
-
- enumeration PositionInfoKey extends BasicEnum {
- TIMESTAMP = 0x0001
- LATITUDE = 0x0020
- LONGITUDE = 0x0021
- ALTITUDE = 0x0022
- HEADING = 0x0030
- SPEED = 0x0031
- CLIMB = 0x0032
+ enumeration PositionInfoKey {
+ LATITUDE = "0x00000001"
+ LONGITUDE = "0x00000002"
+ ALTITUDE = "0x00000004"
+ HEADING = "0x00000008"
+ SPEED = "0x00000010"
+ CLIMB = "0x00000020"
+ ROLL_RATE = "0x00000040"
+ PITCH_RATE = "0x00000080"
+ YAW_RATE = "0x00000100"
+ PDOP = "0x00000200"
+ HDOP = "0x00000400"
+ VDOP = "0x00000800"
+ USED_SATELLITES = "0x00001000"
+ TRACKED_SATELLITES = "0x00002000"
+ VISIBLE_SATELLITES = "0x00004000"
+ SIGMA_HPOSITION = "0x00008000"
+ SIGMA_ALTITUDE = "0x00010000"
+ SIGMA_HEADING = "0x00020000"
+ SIGMA_SPEED = "0x00040000"
+ SIGMA_CLIMB = "0x00080000"
+ GNSS_FIX_STATUS = "0x00100000"
+ DR_STATUS = "0x00200000"
+ RELIABILTY_INDEX = "0x00400000"
}
- <**
- @description : PositionInfo = array of tuples (key,value)
- key = enumeration PositionInfoKey
- key = TIMESTAMP, value = value of type 'UInt64', that represents a timestamp in ms
- key = LATITUDE, value = value of type 'Double', that expresses the latitude of the current position. Range [-90:+90]. Example: 48.053250
- key = LONGITUDE, value = value of type 'Double', that expresses the longitude of the current position. Range [-180:+180]. Example: 8.324500
- key = ALTITUDE, value = value of type 'Int32', that expresses the altitude above the sea level of the current position in meters
- key = HEADING, value = value of type 'Int32', that expresses the course angle in degree. Range [0:360]. 0 = north, 90 = east, 180 = south, 270 = west
- key = SPEED, value = value of type 'Double', that expresses speed measured in m/s. A negative value indicates that the vehicle is moving backwards
- key = CLIMB, value = value of type 'Int32', that expresses the road gradient in degrees
- **>
+ <** @description : PositionInfo = array of tuples (key,value)
+ key = enumeration PositionInfoKey
+ key = LATITUDE, value = value of type 'Double', that expresses the latitude of the current position. Range [-90:+90]. Example: 48.053250
+ key = LONGITUDE, value = value of type 'Double', that expresses the longitude of the current position. Range [-180:+180]. Example: 8.324500
+ key = ALTITUDE, value = value of type 'Double', that expresses the altitude above the sea level of the current position in meters
+ key = HEADING, value = value of type 'Double', that expresses the course angle in degree. Range [0:360]. 0 = north, 90 = east, 180 = south, 270 = west
+ key = SPEED, value = value of type 'Double', that expresses speed measured in m/s. A negative value indicates that the vehicle is moving backwards
+ key = CLIMB, value = value of type 'Double', that expresses the road gradient in degrees
+ key = ROLL_RATE, value = value of type 'Double', rotation rate around the X-axis in degrees/s. Range [-100:+100]
+ key = PITCH_RATE, value = value of type 'Double', rotation rate around the Y-axis in degrees/s. Range [-100:+100]
+ key = YAW_RATE, value = value of type 'Double', rotation rate around the Z-axis in degrees/s. Range [-100:+100]
+ key = PDOP, value = value of type 'Double', that represents the positional (3D) dilution of precision
+ key = HDOP, value = value of type 'Double', that represents the horizontal (2D) dilution of precision
+ key = VDOP, value = value of type 'Double', that represents vertical (altitude) dilution of precision
+ key = USED_SATELLITES, value = value of type 'UInt8', that represents the number of used satellites
+ key = TRACKED_SATELLITES, value = value of type 'UInt8', that represents the number of tracked satellites
+ key = VISIBLE_SATELLITES, value = value of type 'UInt8', that represents the number of visible satellites
+ key = SIGMA_HPOSITION, value = value of type 'Double', that represents the standard deviation for the horizontal position in m
+ key = SIGMA_ALTITUDE, value = value of type 'Double', that represents the standard deviation for altitude in m
+ key = SIGMA_HEADING, value = value of type 'Double', that represents the standard deviation for altitude in degrees
+ key = SIGMA_SPEED, value = value of type 'Double', that represents the standard error estimate of the speed in m/s</line>
+ key = SIGMA_CLIMB, value = value of type 'Double', that represents the standard error estimate of the climb in degrees</line>
+ key = GNSS_FIX_STATUS, value = value of type 'UInt16', that represents an enum(NO_FIX(0x01),TIME_FIX(0x01),2D_FIX(0x02),3D_FIX(0x03), ... )
+ key = DR_STATUS, value = value of type 'Boolean', where TRUE means that a dead-reckoning algorithm has been used to calculate the current position
+ **>
map PositionInfo {
- PositionInfoKey to Value
- }
-
- enumeration RotationRateKey extends BasicEnum {
- TIMESTAMP = 0x0001
- ROLL_RATE = 0x0060
- PITCH_RATE = 0x0061
- YAW_RATE = 0x0062
- }
-
- <**
- @description : RotationRate = array of tuples (key,value)
- key = enumeration RotationRateKey
- key = TIMESTAMP, value = value of type 'UInt64', that represents a timestamp in ms
- key = ROLL_RATE, value = rotation rate around the X-axis in degrees/s. Range [-100:+100]
- key = PITCH_RATE, value = rotation rate around the Y-axis in degrees/s. Range [-100:+100]
- key = YAW_RATE, value = rotation rate around the Z-axis in degrees/s. Range [-100:+100]
- **>
- map RotationRate {
- RotationRateKey to Value
- }
-
- enumeration AccuracyInfoKey extends BasicEnum {
- TIMESTAMP = 0x0001
- PDOP = 0x0080
- HDOP = 0x0081
- VDOP = 0x0082
- SIGMA_LATITUDE = 0x0083
- SIGMA_LONGITUDE = 0x0084
- SIGMA_ALTITUDE = 0x0085
- SIGMA_HEADING = 0x0086
- }
-
- <**
- @description : AccuracyInfo = array of tuples (key,value)
- key = enumeration AccuracyInfoKey
- key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms
- key = PDOP, value = value of type 'd', that represents the positional (3D) dilution of precision
- key = HDOP, value = value of type 'd', that represents the horizontal (2D) dilution of precision
- key = VDOP, value = value of type 'd', that represents vertical (altitude) dilution of precision
- key = SIGMA_LATITUDE, value = value of type 'd', that represents the standard deviation for latitude in m
- key = SIGMA_LONGITUDE, value = value of type 'd', that represents the standard deviation for longitude in m
- key = SIGMA_ALTITUDE, value = value of type 'd', that represents the standard deviation for altitude in m
- key = SIGMA_HEADING, value = value of type 'd', that represents the standard deviation for altitude in degrees
- **>
- map AccuracyInfo {
- AccuracyInfoKey to Value
+ PositionInfoKey to Value
}
-
- enumeration SatelliteInfoKey extends BasicEnum {
- TIMESTAMP = 0x0001
- USED_SATELLITES = 0x00c0
- TRACKED_SATELLITES = 0x00c1
- VISIBLE_SATELLITES = 0x00c2
- SATELLITE_DETAILS = 0x00c3
- }
-
- struct SatelliteDetails {
- UInt32 satId
- Boolean inUse
- UInt32 elevation
- UInt32 azimuth
- UInt32 snr
- }
-
- <**
- @description : SatelliteInfo = array of tuples (key,value)
- key = enumeration SatelliteInfoKey
- key = TIMESTAMP, value = value of type 'UInt64', that represents a timestamp in ms
- key = USED_SATELLITES, value = value of type 'UInt8', that represents the number of used satellites
- key = TRACKED_SATELLITES, value = value of type 'UInt8', that represents the number of tracked satellites
- key = VISIBLE_SATELLITES, value = value of type 'UInt8', that represents the number of visible satellites
- key = SATELLITE_DETAILS, value = value of type SatelliteDetails[], 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
- **>
- map SatelliteInfo {
- SatelliteInfoKey to Value
- }
-
- enumeration StatusInfoKey extends BasicEnum {
- TIMESTAMP = 0x0001
- GNSS_FIX_STATUS = 0x0070
- DR_STATUS = 0x0071
- }
-
- <**
- @description : StatusInfo = array of tuples (key,value)
- key = enumeration StatusInfoKey
- key = TIMESTAMP, value = value of type 'UInt64', that represents a timestamp in ms
- key = GNSS_FIX_STATUS, value = value of type 'UInt16', that represents an enum(INVALID(0x00),NO_FIX(0x01),TIME_FIX(0x02),2D_FIX(0x03),3D_FIX(0x04), ... )
- key = DR_STATUS, value = value of type 'Boolean', where TRUE means that a dead-reckoning algorithm has been used to calculate the current position
- **>
- map StatusInfo {
- StatusInfoKey to Value
- }
-
- enumeration TimeInfoKey extends BasicEnum {
- TIMESTAMP = 0x0001
- YEAR = 0x00a0
- MONTH = 0x00a1
- DAY = 0x00a2
- HOUR = 0x00a3
- MINUTE = 0x00a4
- SECOND = 0x00a5
- MS = 0x00a6
+
+ enumeration SatelliteSystem {
+ GPS = "0x00000001"
+ GLONASS = "0x00000002"
+ GALILEO = "0x00000003"
+ COMPASS = "0x00000004"
+ }
+
+ <** @description : SatelliteInfo = array(struct(system,satelliteId,azimuth,elevation,snr,inUse))
+ system = enum(GPS, GLONASS, GALILEO, COMPASS, ... )
+ satelliteId = satellite ID. This ID is unique within one satellite system
+ azimuth = satellite azimuth in degrees. Value range 0..359
+ elevation = satellite elevation in degrees. Value range 0..90
+ snr = SNR (C/No) in dBHz. Range 0 to 99, null when not tracking
+ inUse = flag indicating if the satellite is used for the fix (inUse=true)
+ **>
+ struct SatelliteInfo {
+ SatelliteSystem system
+ UInt32 satellitId
+ UInt32 azimuth
+ UInt32 elevation
+ UInt32 snr
+ Boolean inUse
+ }
+
+ enumeration TimeInfoKey {
+ YEAR = "0x01000000"
+ MONTH = "0x02000000"
+ DAY = "0x04000000"
+ HOUR = "0x08000000"
+ MINUTE = "0x10000000"
+ SECOND = "0x20000000"
+ MS = "0x40000000"
}
- <**
- @description : TimeInfo = array of tuples (key,value)
+ <** @description : TimeInfo = array of tuples (key,value)
key = enumeration TimeInfoKey
- key = TIMESTAMP, value = value of type 'UInt64', that represents a timestamp in ms
key = YEAR, value = value of type 'UInt16', 4 digits number that indicates the year. Example: 2012
key = MONTH, value = value of type 'UInt8', 2 digits number that indicates the month. Example: 03 means March
key = DAY, value = value of type 'UInt8', 2 digits number that indicates the day. Range [0:31]. Example: 07
@@ -240,7 +135,22 @@ typeCollection EnhancedPositionServiceTypes { key = MS, value = value of type 'UInt16', 3 digits number that represents the milliseconds. Range [0:999]. Example: 007
**>
map TimeInfo {
- TimeInfoKey to Value
+ TimeInfoKey to Value
+ }
+
+ enumeration PositionFeedbackKey {
+ LATITUDE = "0x00000001"
+ LONGITUDE = "0x00000002"
+ ALTITUDE = "0x00000004"
+ HEADING = "0x00000008"
+ SPEED = "0x00000010"
+ CLIMB = "0x00000020"
+ RELIABILTY_INDEX = "0x00400000"
+ }
+
+ enumeration PositionFeedbackType {
+ MAP_MATCHED_FEEDBACK = "0x00000001"
+ TEST_FEEDBACK = "0x00000002"
}
}
diff --git a/enhanced-position-service/api/franca/PositionFeedback.fidl b/enhanced-position-service/api/franca/PositionFeedback.fidl index a4a4131..4700453 100755 --- a/enhanced-position-service/api/franca/PositionFeedback.fidl +++ b/enhanced-position-service/api/franca/PositionFeedback.fidl @@ -46,13 +46,13 @@ interface PositionFeedback { <**
@description : feedbackType = enum(INVALID,MAP_MATCHED_FEEDBACK,TEST_FEEDBACK, ... )
**>
- UInt16 feedbackType
+ PositionFeedbackType feedbackType
}
}
<**
@description : PositionFeedback = array of tuples (key,value)</line>
- key = enum(INVALID,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,RELIABILTY_INDEX, ... )</line>
+ key = enum(LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,RELIABILTY_INDEX, ... )</line>
key = LATITUDE, value = value of type ´d´, that expresses the latitude of the current position in format %3.6f. [-90,+90]. Example: 48.053250
key = LONGITUDE, value = value of type ´d´, that expresses the longitude of the current position in format %3.6f. [-180,+180]. Example: 8.324500
key = ALTITUDE, value = value of type ´i´, that expresses the altitude above the sea level of the current position in meters
@@ -62,7 +62,7 @@ interface PositionFeedback { key = RELIABILTY_INDEX, value = value of type ´y´, that indicates the position feedabck reliabilty. It can assume values from 0 to 100
**>
map PositionFeedback {
- UInt16 to Value
+ PositionFeedbackKey to Value
}
}
diff --git a/enhanced-position-service/api/genivi-positioning-configuration.xml b/enhanced-position-service/api/genivi-positioning-configuration.xml index 8ebedd3..5e74050 100644 --- a/enhanced-position-service/api/genivi-positioning-configuration.xml +++ b/enhanced-position-service/api/genivi-positioning-configuration.xml @@ -15,7 +15,7 @@ <node name="/org/genivi/positioning/Configuration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="introspect.xsd">
<interface name="org.genivi.positioning.Configuration">
- <version>3.0.0-alpha (05-08-2014)</version>
+ <version>3.0.0 (19-11-2014)</version>
<doc>
<line>Configuration = This interface allows a client application to set and retrieve configuration options</line>
</doc>
diff --git a/enhanced-position-service/api/genivi-positioning-constants.xml b/enhanced-position-service/api/genivi-positioning-constants.xml index b0bdb8c..4ffc8d8 100644 --- a/enhanced-position-service/api/genivi-positioning-constants.xml +++ b/enhanced-position-service/api/genivi-positioning-constants.xml @@ -12,84 +12,60 @@ --> <constants name="EnhancedPositionService"> - <version>2.0.0 (04-06-2013)</version> + <version>3.0.0 (19-11-2014)</version> <doc> <line>This document defines the constants that are used in the EnhancedPositionService APIs</line> + <line>Constants for "Keys" are always individual bits within a 64 bit unsigned integer and are unique within the EnhancedPositionService</line> + <line>Constants for "Enums" increment consecutively and are only unique within the context of the specific enum</line> </doc> - <!-- special values --> - <id name="INVALID" value="0x0000" /> - <id name="TIMESTAMP" value="0x0001" /> - <id name="ALL" value="0xffff" /> - - <!-- Position --> - <id name="LATITUDE" value="0x0020" /> - <id name="LONGITUDE" value="0x0021" /> - <id name="ALTITUDE" value="0x0022" /> - - <!-- Course --> - <id name="HEADING" value="0x0030" /> - <id name="SPEED" value="0x0031" /> - <id name="CLIMB" value="0x0032" /> - - <!-- Address --> - <id name="COUNTRY" value="0x0040" /> - <id name="CITY" value="0x0041" /> - <id name="STREET" value="0x0042" /> - <id name="NUMBER" value="0x0043" /> - <id name="CROSSING" value="0x0044" /> - <id name="DISTRICT" value="0x0045" /> - <id name="TIMEZONE_OFFSET" value="0x0046" /> - <id name="DAYLIGHT_OFFSET" value="0x0047" /> - <id name="MATCH_TYPE" value="0x0048" /> - - <!-- RotationRate --> - <id name="ROLL_RATE" value="0x0060" /> - <id name="PITCH_RATE" value="0x0061" /> - <id name="YAW_RATE" value="0x0062" /> - - <!-- EnhancedPositionStatus --> - <id name="GNSS_FIX_STATUS" value="0x0070" /> - <id name="DR_STATUS" value="0x0071" /> - - <!-- MapMatchedPositionStatus --> - <id name="MM_STATUS" value="0x0072" /> - - <!-- PositionFeedback --> - <id name="RELIABILTY_INDEX" value="0x0073" /> - <id name="MAP_MATCHED_FEEDBACK" value="0x0074" /> - <id name="TEST_FEEDBACK" value="0x0075" /> - - <!-- Accuracy --> - <id name="PDOP" value="0x0080" /> - <id name="HDOP" value="0x0081" /> - <id name="VDOP" value="0x0082" /> - <id name="SIGMA_LATITUDE" value="0x0083" /> - <id name="SIGMA_LONGITUDE" value="0x0084" /> - <id name="SIGMA_ALTITUDE" value="0x0085" /> - <id name="SIGMA_HEADING" value="0x0086" /> - - <!-- Time --> - <id name="YEAR" value="0x00a0" /> - <id name="MONTH" value="0x00a1" /> - <id name="DAY" value="0x00a2" /> - <id name="HOUR" value="0x00a3" /> - <id name="MINUTE" value="0x00a4" /> - <id name="SECOND" value="0x00a5" /> - <id name="MS" value="0x00a6" /> - - <!-- SatelliteSystem --> - <id name="GPS" value="0x00b0" /> - <id name="GLONASS" value="0x00b1" /> - <id name="GALILEO" value="0x00b2" /> - <id name="COMPASS" value="0x00b3" /> - - <!-- SatelliteStatus --> - - <id name="USED_SATELLITES" value="0x00c0" /> - <id name="TRACKED_SATELLITES" value="0x00c1" /> - <id name="VISIBLE_SATELLITES" value="0x00c2" /> - <id name="SATELLITE_DETAILS" value="0x00c3" /> + <!-- PositionInfo and PositionFeedback Keys - for use in bit mask --> + <id name="LATITUDE" value="0x00000001" /> + <id name="LONGITUDE" value="0x00000002" /> + <id name="ALTITUDE" value="0x00000004" /> + <id name="HEADING" value="0x00000008" /> + <id name="SPEED" value="0x00000010" /> + <id name="CLIMB" value="0x00000020" /> + <id name="ROLL_RATE" value="0x00000040" /> + <id name="PITCH_RATE" value="0x00000080" /> + <id name="YAW_RATE" value="0x00000100" /> + <id name="PDOP" value="0x00000200" /> + <id name="HDOP" value="0x00000400" /> + <id name="VDOP" value="0x00000800" /> + <id name="USED_SATELLITES" value="0x00001000" /> + <id name="TRACKED_SATELLITES" value="0x00002000" /> + <id name="VISIBLE_SATELLITES" value="0x00004000" /> + <id name="SIGMA_HPOSITION" value="0x00008000" /> + <id name="SIGMA_ALTITUDE" value="0x00010000" /> + <id name="SIGMA_HEADING" value="0x00020000" /> + <id name="SIGMA_SPEED" value="0x00040000" /> + <id name="SIGMA_CLIMB" value="0x00080000" /> + <id name="GNSS_FIX_STATUS" value="0x00100000" /> + <id name="DR_STATUS" value="0x00200000" /> + <id name="RELIABILTY_INDEX" value="0x00400000" /> + + <!-- Time Keys - for use in bit mask --> + <id name="YEAR" value="0x01000000" /> + <id name="MONTH" value="0x02000000" /> + <id name="DAY" value="0x04000000" /> + <id name="HOUR" value="0x08000000" /> + <id name="MINUTE" value="0x10000000" /> + <id name="SECOND" value="0x20000000" /> + <id name="MS" value="0x40000000" /> + + <!-- Generic "Enum" values --> + <id name="INVALID" value="0x00000000" /> + + <!-- SatelliteSystem "Enum" --> + <id name="GPS" value="0x00000001" /> + <id name="GLONASS" value="0x00000002" /> + <id name="GALILEO" value="0x00000003" /> + <id name="BEIDOU" value="0x00000004" /> <!-- Chinese Beidou Navigation Satellite System --> + <id name="COMPASS" value="0x00000004" /> <!-- COMPASS is a synonym for BEIDOU --> + + <!-- PositionFeedback "Enum" --> + <id name="MAP_MATCHED_FEEDBACK" value="0x00000001" /> + <id name="TEST_FEEDBACK" value="0x00000002" /> <!-- ... --> </constants> diff --git a/enhanced-position-service/api/genivi-positioning-enhancedposition.xml b/enhanced-position-service/api/genivi-positioning-enhancedposition.xml index a8b1dda..283c3b0 100644 --- a/enhanced-position-service/api/genivi-positioning-enhancedposition.xml +++ b/enhanced-position-service/api/genivi-positioning-enhancedposition.xml @@ -15,7 +15,7 @@ <node name="/org/genivi/positioning/EnhancedPosition" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="introspect.xsd"> <interface name="org.genivi.positioning.EnhancedPosition"> - <version>3.0.0-alpha (05-08-2014)</version> + <version>3.0.0 (19-11-2014)</version> <doc> <line>EnhancedPosition = This interface offers functionalities to retrieve the enhanced position of the vehicle</line> </doc> @@ -35,141 +35,80 @@ </arg> </method> - <method name="GetData"> + <method name="GetPositionInfo"> <doc> - <line>GetData = This method returns a given set of positioning data (e.g. Position, Course, Accuracy, Status, ... )</line> + <line>GetPositionInfo = This method returns a given set of positioning data (e.g. Position, Course, Accuracy, Status, ... )</line> </doc> - <arg name="valuesToReturn" type="aq" direction="in"> + <arg name="valuesToReturn" type="t" 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> + <line>valuesToReturn = Bitmask obtained as result of a bitwise OR operation on the keys corresponding to requested values</line> + <line>Keys: LATITUDE,LONGITUDE,ALTITUDE,</line> + <line> HEADING,SPEED,CLIMB,</line> + <line> ROLL_RATE,PITCH_RATE,YAW_RATE,</line> + <line> PDOP,HDOP,VDOP,</line> + <line> USED_SATELLITES,TRACKED_SATELLITES,VISIBLE_SATELLITES,</line> + <line> SIGMA_HPOSITION,SIGMA_ALTITUDE,</line> + <line> SIGMA_HEADING,SIGMA_SPEED,SIGMA_CLIMB,</line> + <line> GNSS_FIX_STATUS,DR_STATUS</line> </doc> </arg> - <arg name="data" type="a{qv}" direction="out"> + <arg name="timestamp" type="t" direction="out"> <doc> - <line>data = 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>The vehicle axis system is defined by ISO 8855: In short, the X-axis pointing is forwards, the Y-axis is pointing left, the Z-axis is pointing upwards</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 WGS84 latitude of the current position in degrees. Range [-90:+90]. Example: 48.053250</line> - <line>key = LONGITUDE, value = value of type 'd', that expresses the WGS84 longitude of the current position in degrees. Range [-180:+180]. Example: 8.324500</line> - <line>key = ALTITUDE, value = value of type 'd', that expresses the altitude above the sea level of the current position in meters</line> - <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> - <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 'd', that expresses the road gradient in degrees. Range [-180:+180]. A positive value means upwards. </line> - <line>key = ROLL_RATE, value = value of type 'd', rotation rate around the X-axis in degrees/s. Range [-100:+100]</line> - <line>key = PITCH_RATE, value = value of type 'd', rotation rate around the Y-axis in degrees/s. Range [-100:+100]</line> - <line>key = YAW_RATE, value = value of type 'd', 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 error estimate of the latitude in m</line> - <line>key = SIGMA_LONGITUDE, value = value of type 'd', that represents the standard error estimate of the longitude in m</line> - <line>key = SIGMA_ALTITUDE, value = value of type 'd', that represents the standard error estimate of the altitude in m</line> - <line>key = SIGMA_HEADING, value = value of type 'd', that represents the standard error estimate of the heading in degrees</line> + <line>timestamp = Timestamp of the acquisition of the position data [ms]</line> + <line> Note: All timestamps must be based on the same time source.</line> </doc> </arg> - </method> - - <method name="GetPosition"> - <doc> - <line>GetPosition = This method returns the current position</line> - </doc> - - <arg name="position" type="a{qv}" direction="out"> + + <arg name="data" type="a{tv}" direction="out"> <doc> - <line>position = dictionary[key,value]</line> + <line>data = 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>The vehicle axis system is defined by ISO 8855: In short, the X-axis pointing is forwards, the Y-axis is pointing left, the Z-axis is pointing upwards</line> + <line>key = enum(LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,ROLL_RATE,PITCH_RATE,YAW_RATE,PDOP,HDOP,VDOP,USED_SATELLITES,TRACKED_SATELLITES,VISIBLE_SATELLITES,SIGMA_HPOSITION,SIGMA_ALTITUDE,SIGMA_HEADING,SIGMA_SPEED,SIGMA_CLIMB,GNSS_FIX_STATUS,DR_STATUS)</line> <line>key = LATITUDE, value = value of type 'd', that expresses the WGS84 latitude of the current position in degrees. Range [-90:+90]. Example: 48.053250</line> <line>key = LONGITUDE, value = value of type 'd', that expresses the WGS84 longitude of the current position in degrees. Range [-180:+180]. Example: 8.324500</line> <line>key = ALTITUDE, value = value of type 'd', that expresses the altitude above the sea level of the current position in meters</line> <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> <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 'd', that expresses the road gradient in degrees. Range [-180:+180]. A positive value means upwards. </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> - <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> - <arg name="rotationRate" type="a{qv}" direction="out"> - <doc> - <line>rotationRate = 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>The vehicle axis system is defined by ISO 8855: In short, the X-axis pointing is forwards, the Y-axis is pointing left, the Z-axis is pointing upwards</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 = value of type 'd', rotation rate around the X-axis in degrees/s. Range [-100:+100]</line> <line>key = PITCH_RATE, value = value of type 'd', rotation rate around the Y-axis in degrees/s. Range [-100:+100]</line> <line>key = YAW_RATE, value = value of type 'd', 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> - <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> - <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 error estimate of the latitude in m</line> - <line>key = SIGMA_LONGITUDE, value = value of type 'd', that represents the standard error estimate of the longitude in m</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 = SIGMA_HPOSITION, value = value of type 'd', that represents the standard error estimate of the horizontal position in m</line> <line>key = SIGMA_ALTITUDE, value = value of type 'd', that represents the standard error estimate of the altitude in m</line> <line>key = SIGMA_HEADING, value = value of type 'd', that represents the standard error estimate of the heading in degrees</line> + <line>key = SIGMA_SPEED, value = value of type 'd', that represents the standard error estimate of the speed in m/s</line> + <line>key = SIGMA_CLIMB, value = value of type 'd', that represents the standard error estimate of the climb in degrees</line> + <line>key = GNSS_FIX_STATUS, value = value of type 'q', that represents an enum(NO_FIX(0x00),TIME_FIX(0x01),2D_FIX(0x02),3D_FIX(0x03), ... )</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="AccuracyUpdate"> + <signal name="PositionUpdate"> <doc> - <line>AccuracyUpdated = This signal is emitted when the accuracy changes</line> + <line>PositionUpdate = This signal is called to notifiy a client application that updated positioning data is available. The update frequency is implementation specific. The maximum allowed frequency is 10Hz</line> </doc> - <arg name="changedValues" type="aq"> + <arg name="changedValues" type="t"> <doc> - <line>changedValues = array[value]</line> - <line>value = enum(INVALID,TIMESTAMP,PDOP,HDOP,VDOP,SIGMA_LATITUDE,SIGMA_LONGITUDE,SIGMA_ALTITUDE,SIGMA_HEADING, ... )</line> + <line>changedValues = Bitmask obtained as result of a bitwise OR operation on the keys corresponding to updated values</line> + <line>LATITUDE,LONGITUDE,ALTITUDE,</line> + <line> HEADING,SPEED,CLIMB,</line> + <line> ROLL_RATE,PITCH_RATE,YAW_RATE,</line> + <line> PDOP,HDOP,VDOP,</line> + <line> USED_SATELLITES,TRACKED_SATELLITES,VISIBLE_SATELLITES,</line> + <line> SIGMA_HPOSITION,SIGMA_ALTITUDE,</line> + <line> SIGMA_HEADING,SIGMA_SPEED,SIGMA_CLIMB,</line> + <line> GNSS_FIX_STATUS,DR_STATUS</line> </doc> </arg> </signal> @@ -178,77 +117,41 @@ <doc> <line>GetSatelliteInfo = This method returns information about the current satellite constellation</line> </doc> - <arg name="satelliteInfo" type="a{qv}" direction="out"> + <arg name="timestamp" type="t" 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> + <line>timestamp = Timestamp of the acquisition of the satellite detail data [ms]</line> + <line> Note: All timestamps must be based on the same time source.</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> - <arg name="changedValues" type="aq"> + </arg> + <arg name="satelliteInfo" type="a(qqqqqb)" direction="out"> <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> - <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> + <line>satelliteInfo = array(struct(system,satelliteId,azimuth,elevation,snr,inUse))</line> + <line> system = enum(GPS, GLONASS, GALILEO, COMPASS, ... )</line> + <line> satelliteId = satellite ID. This ID is unique within one satellite system</line> + <line> azimuth = satellite azimuth in degrees. Value range 0..359</line> + <line> elevation = satellite elevation in degrees. Value range 0..90</line> + <line> snr = SNR (C/No) in dBHz. Range 0 to 99, null when not tracking</line> + <line> inUse = flag indicating if the satellite is used for the fix (inUse=true)</line> </doc> </arg> </method> - <signal name="StatusUpdate"> - <doc> - <line>StatusUpdate = This signal is emitted when the status of this service changes</line> - </doc> - <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> - <arg name="time" type="a{qv}" direction="out"> + <arg name="timestamp" type="t" direction="out"> + <doc> + <line>timestamp = Timestamp of the acquisition of the UTC date/time [ms]</line> + <line> Note: All timestamps must be based on the same time source.</line> + </doc> + </arg> + <arg name="time" type="a{tv}" 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 = enum(YEAR,MONTH,DAY,HOUR,MINUTE,SECOND,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> diff --git a/enhanced-position-service/api/genivi-positioning-positionfeedback.xml b/enhanced-position-service/api/genivi-positioning-positionfeedback.xml index 55418fd..142bdbf 100644 --- a/enhanced-position-service/api/genivi-positioning-positionfeedback.xml +++ b/enhanced-position-service/api/genivi-positioning-positionfeedback.xml @@ -14,7 +14,7 @@ <node name="/org/genivi/positioning/PositionFeedback" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="introspect.xsd">
<interface name="org.genivi.positioning.PositionFeedback">
- <version>3.0.0-alpha (05-08-2014)</version>
+ <version>3.0.0 (19-11-2014)</version>
<doc>
<line>PositionFeedback = This interface allows the application implementing the map-matching algorithm to provide a position feedback to the EnahncedPositionService</line>
</doc>
@@ -40,12 +40,12 @@ <line>Note: This interface is typically used by the application that implements the map-matching algorithm</line>
<line>Such application can hand over to the EnhancedPositionService an array of map-matched positions with different values of reliability</line>
</doc>
- <arg name="feedback" type="aa{qv}" direction="in">
+ <arg name="feedback" type="aa{tv}" direction="in">
<doc>
<line>feedback = array[position]</line>
<line>position = dictionary[key,value]</line>
<line>dictionary = array of tuples (key,value)</line>
- <line>key = enum(INVALID,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,RELIABILTY_INDEX, ... )</line>
+ <line>key = enum(LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,RELIABILTY_INDEX, ... )</line>
<line>key = LATITUDE, value = value of type 'd', that expresses the WGS84 latitude of the current position in degrees. Range [-90:+90]. Example: 48.053250</line>
<line>key = LONGITUDE, value = value of type 'd', that expresses the WGS84 longitude of the current position in degrees. Range [-180:+180]. Example: 8.324500</line>
<line>key = ALTITUDE, value = value of type 'd', that expresses the altitude above the sea level of the current position in meters</line>
@@ -57,7 +57,8 @@ </arg>
<arg name="timestamp" type="t" direction="in">
<doc>
- <line>timestamp = timestamp in ms</line>
+ <line>timestamp = Original timestamp of the corresponding position data received from the EnhancedPosition API [ms]</line>
+ <line> Note: All timestamps must be based on the same time source.</line>
</doc>
</arg>
<arg name="feedbackType" type="q" direction="in">
diff --git a/enhanced-position-service/src/CMakeLists.txt b/enhanced-position-service/src/CMakeLists.txt index 34ea850..ddc507a 100644 --- a/enhanced-position-service/src/CMakeLists.txt +++ b/enhanced-position-service/src/CMakeLists.txt @@ -13,6 +13,9 @@ # 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/. # +# Update (2014/12/02) : Philippe Colliot <philippe.colliot@mpsa.com>, +# PSA Peugeot Citroen +# - introduce debug flag to disable verbosity # @licence end@ ########################################################################### @@ -24,31 +27,17 @@ message(STATUS "WITH_DLT = ${WITH_DLT}") message(STATUS "WITH_GPSD = ${WITH_GPSD}") message(STATUS "WITH_REPLAYER = ${WITH_REPLAYER}") message(STATUS "WITH_TESTS = ${WITH_TESTS}") +message(STATUS "WITH_DEBUG = ${WITH_DEBUG}") 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 -) +include_directories(${enhanced-position-service_INCLUDE_DIRS}) link_directories( ${DBUS_CPP_LIBRARY_DIRS} @@ -59,13 +48,13 @@ add_executable(enhanced-position-service main.cpp enhanced-position.cpp enhanced-position.h - enhanced-position-adaptor.h + ${enhanced-position-service_INCLUDE_DIRS}/genivi-positioning-enhancedposition_adaptor.h position-feedback.cpp position-feedback.h - position-feedback-adaptor.h + ${enhanced-position-service_INCLUDE_DIRS}/genivi-positioning-positionfeedback_adaptor.h configuration.cpp configuration.h - configuration-adaptor.h + ${enhanced-position-service_INCLUDE_DIRS}/genivi-positioning-configuration_adaptor.h ) set(LIBRARIES @@ -82,6 +71,10 @@ if(WITH_DLT) set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES}) endif() +if(WITH_DEBUG) + add_definitions("-DDEBUG_ENABLED=1") +endif() + target_link_libraries(enhanced-position-service ${LIBRARIES}) message(STATUS "DBUS_CPP_LIBRARIES: " ${DBUS_CPP_LIBRARIES}) diff --git a/enhanced-position-service/src/configuration.cpp b/enhanced-position-service/src/configuration.cpp index 959c4aa..29ea664 100644 --- a/enhanced-position-service/src/configuration.cpp +++ b/enhanced-position-service/src/configuration.cpp @@ -17,7 +17,7 @@ **************************************************************************/ #include "configuration.h" -#include "positioning-constants.h" +#include "genivi-positioning-constants.h" #include "log.h" DLT_IMPORT_CONTEXT(gCtx); @@ -80,7 +80,7 @@ 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); + Properties["SatelliteSystem"] = variant_uint16(GENIVI_ENHANCEDPOSITIONSERVICE_GPS); return Properties; } @@ -98,10 +98,10 @@ std::map< std::string, ::DBus::Variant > Configuration::GetSupportedProperties() 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); + satelliteSystems.push_back(GENIVI_ENHANCEDPOSITIONSERVICE_GPS); + satelliteSystems.push_back(GENIVI_ENHANCEDPOSITIONSERVICE_GLONASS); + satelliteSystems.push_back(GENIVI_ENHANCEDPOSITIONSERVICE_GALILEO); + satelliteSystems.push_back(GENIVI_ENHANCEDPOSITIONSERVICE_COMPASS); SupportedProperties["UpdateInterval"] = variant_array_int32(updateIntervals); SupportedProperties["SatelliteSystem"] = variant_array_uint16(satelliteSystems); diff --git a/enhanced-position-service/src/configuration.h b/enhanced-position-service/src/configuration.h index 78c319a..85ac9d1 100644 --- a/enhanced-position-service/src/configuration.h +++ b/enhanced-position-service/src/configuration.h @@ -19,7 +19,7 @@ #define ___CONFIGURATION_H #include <dbus-c++/dbus.h> -#include "configuration-adaptor.h" +#include "genivi-positioning-configuration_adaptor.h" class Configuration : public org::genivi::positioning::Configuration_adaptor diff --git a/enhanced-position-service/src/enhanced-position.cpp b/enhanced-position-service/src/enhanced-position.cpp index a1b999e..26e7dea 100644 --- a/enhanced-position-service/src/enhanced-position.cpp +++ b/enhanced-position-service/src/enhanced-position.cpp @@ -19,7 +19,7 @@ #include <stdio.h> #include <stdlib.h> #include "enhanced-position.h" -#include "positioning-constants.h" +#include "genivi-positioning-constants.h" #include "log.h" DLT_IMPORT_CONTEXT(gCtx); @@ -80,162 +80,86 @@ EnhancedPosition::~EnhancedPosition() return Version; } - -std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetData(const std::vector< uint16_t >& valuesToReturn) + + + +void EnhancedPosition::GetPositionInfo(const uint64_t& valuesToReturn, uint64_t& timestamp, std::map< uint64_t, ::DBus::Variant >& data) { - std::map< uint16_t, ::DBus::Variant > Data; + //std::map< uint64_t, ::DBus::Variant > Data; TGNSSPosition position; bool isPosRequested = false; bool isCourseRequested = false; - for (int i = 0; i < valuesToReturn.size(); i++) + if ((valuesToReturn & GENIVI_ENHANCEDPOSITIONSERVICE_LATITUDE) || + (valuesToReturn & GENIVI_ENHANCEDPOSITIONSERVICE_LONGITUDE) || + (valuesToReturn & GENIVI_ENHANCEDPOSITIONSERVICE_ALTITUDE)) { - if ((valuesToReturn[i] == POS_LATITUDE) || - (valuesToReturn[i] == POS_LONGITUDE) || - (valuesToReturn[i] == POS_ALTITUDE)) - { - isPosRequested = true; - } - - if ((valuesToReturn[i] == POS_HEADING) || - (valuesToReturn[i] == POS_SPEED) || - (valuesToReturn[i] == POS_CLIMB )) - { - isCourseRequested = true; - } + isPosRequested = true; } - if(isPosRequested) + if ((valuesToReturn & GENIVI_ENHANCEDPOSITIONSERVICE_HEADING) || + (valuesToReturn & GENIVI_ENHANCEDPOSITIONSERVICE_SPEED) || + (valuesToReturn & GENIVI_ENHANCEDPOSITIONSERVICE_CLIMB )) { - if(gnssGetPosition(&position)) - { - if (position.validityBits & GNSS_POSITION_LATITUDE_VALID) - { - Data[POS_LATITUDE] = variant_double(position.latitude); - } - - if (position.validityBits & GNSS_POSITION_LONGITUDE_VALID) - { - Data[POS_LONGITUDE] = variant_double(position.longitude); - } - - if (position.validityBits & GNSS_POSITION_ALTITUDEMSL_VALID) - { - Data[POS_ALTITUDE] = variant_double(position.altitudeMSL); - } - } + isCourseRequested = true; } - if(isCourseRequested) + if(gnssGetPosition(&position)) { - if(gnssGetPosition(&position)) - { - if (position.validityBits & GNSS_POSITION_HEADING_VALID) - { - Data[POS_HEADING] = variant_double(position.heading); - } - if (position.validityBits & GNSS_POSITION_HSPEED_VALID) - { - Data[POS_SPEED] = variant_double(position.hSpeed); - } + timestamp = position.timestamp; - if (position.validityBits & GNSS_POSITION_VSPEED_VALID) - { - Data[POS_CLIMB] = variant_double(position.vSpeed); - } - } - } - - return Data; -} - -std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetPosition() -{ - std::map< uint16_t, ::DBus::Variant > Position; - TGNSSPosition position; - - if(gnssGetPosition(&position)) + if(isPosRequested) { if (position.validityBits & GNSS_POSITION_LATITUDE_VALID) { - Position[POS_LATITUDE] = variant_double(position.latitude); + data[GENIVI_ENHANCEDPOSITIONSERVICE_LATITUDE] = variant_double(position.latitude); } if (position.validityBits & GNSS_POSITION_LONGITUDE_VALID) { - Position[POS_LONGITUDE] = variant_double(position.longitude); + data[GENIVI_ENHANCEDPOSITIONSERVICE_LONGITUDE] = variant_double(position.longitude); } if (position.validityBits & GNSS_POSITION_ALTITUDEMSL_VALID) { - Position[POS_ALTITUDE] = variant_double(position.altitudeMSL); + data[GENIVI_ENHANCEDPOSITIONSERVICE_ALTITUDE] = variant_double(position.altitudeMSL); } + } + if(isCourseRequested) + { if (position.validityBits & GNSS_POSITION_HEADING_VALID) { - Position[POS_HEADING] = variant_double(position.heading); + data[GENIVI_ENHANCEDPOSITIONSERVICE_HEADING] = variant_double(position.heading); } if (position.validityBits & GNSS_POSITION_HSPEED_VALID) { - Position[POS_SPEED] = variant_double(position.hSpeed); + data[GENIVI_ENHANCEDPOSITIONSERVICE_SPEED] = variant_double(position.hSpeed); } if (position.validityBits & GNSS_POSITION_VSPEED_VALID) { - Position[POS_CLIMB] = variant_double(position.vSpeed); - } + data[GENIVI_ENHANCEDPOSITIONSERVICE_CLIMB] = variant_double(position.vSpeed); + } } + } - 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() +void EnhancedPosition::GetSatelliteInfo(uint64_t& timestamp, std::vector< ::DBus::Struct< uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, bool > >& satelliteInfo) { - std::map< uint16_t, ::DBus::Variant > SatelliteInfo; - throw DBus::ErrorNotSupported("Method not supported yet"); - - return SatelliteInfo; } -std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetStatus() +void EnhancedPosition::GetTime(uint64_t& timestamp, std::map< uint64_t, ::DBus::Variant >& time) { - 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::sigPositionUpdate(const TGNSSPosition position[], uint16_t numElements) @@ -246,7 +170,14 @@ void EnhancedPosition::sigPositionUpdate(const TGNSSPosition position[], uint16_ bool speedChanged = false; bool headingChanged = false; bool climbChanged = false; + bool pdopChanged = false; + bool hdopChanged = false; + bool vdopChanged = false; + bool usatChanged = false; //used satellites + bool fixStatusChanged = false; + bool fixTypeBitsChanged = false; + uint64_t changedValues = 0; if (position == NULL || numElements < 1) { @@ -262,7 +193,23 @@ void EnhancedPosition::sigPositionUpdate(const TGNSSPosition position[], uint16_ position[i].latitude, position[i].longitude, position[i].altitudeMSL); - + + LOG_INFO(gCtx,"Accuracy Update[%d/%d]: pdop=%f hdop=%f vdop=%f \ + sigmaHPosition=%f sigmaAltitude=%f", + i+1, + numElements, + position[i].pdop, + position[i].hdop, + position[i].vdop, + position[i].sigmaHPosition, + position[i].sigmaAltitude); + + LOG_INFO(gCtx,"Status Update[%d/%d]: fixStatus=%d fixTypeBits=0x%08X", + i+1, + numElements, + position[i].fixStatus, + position[i].fixTypeBits); + if (latChanged == false) { latChanged = (position[i].validityBits & GNSS_POSITION_LATITUDE_VALID); @@ -293,83 +240,6 @@ void EnhancedPosition::sigPositionUpdate(const TGNSSPosition position[], uint16_ climbChanged = (position[i].validityBits & GNSS_POSITION_VSPEED_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 (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::sigAccuracyUpdate(const TGNSSPosition position[], uint16_t numElements) -{ - bool pdopChanged = false; - bool hdopChanged = false; - bool vdopChanged = false; - bool sigmaHPosChanged = false; - bool sigmaAltitudeChanged = false; - - if (position == NULL || numElements < 1) - { - LOG_ERROR_MSG(gCtx,"sigAccuracyUpdate failed!"); - return; - } - - for (int i = 0; i< numElements; i++) - { - LOG_INFO(gCtx,"Accuracy Update[%d/%d]: pdop=%f hdop=%f vdop=%f \ - sigmaHPosition=%f sigmaAltitude=%f", - i+1, - numElements, - position[i].pdop, - position[i].hdop, - position[i].vdop, - position[i].sigmaHPosition, - position[i].sigmaAltitude); - if (pdopChanged == false) { pdopChanged = (position[i].validityBits & GNSS_POSITION_PDOP_VALID); @@ -385,200 +255,98 @@ void EnhancedPosition::sigAccuracyUpdate(const TGNSSPosition position[], uint16_ vdopChanged = (position[i].validityBits & GNSS_POSITION_VDOP_VALID); } - if (sigmaHPosChanged == false) + if (usatChanged == false) { - sigmaHPosChanged = (position[i].validityBits & GNSS_POSITION_SHPOS_VALID); + usatChanged = (position[i].validityBits & GNSS_POSITION_USAT_VALID); } - if (sigmaAltitudeChanged == false) + if (fixStatusChanged == false) { - sigmaAltitudeChanged = (position[i].validityBits & GNSS_POSITION_SALT_VALID); + fixStatusChanged = (position[i].validityBits & GNSS_POSITION_STAT_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 > changedAccuracyValues; - it = changedAccuracyValues.begin(); + if (fixTypeBitsChanged == false) + { + fixTypeBitsChanged = (position[i].validityBits & GNSS_POSITION_TYPE_VALID); + } - if (pdopChanged) - { - it = changedAccuracyValues.insert(it,POS_PDOP); } - if (hdopChanged) - { - it = changedAccuracyValues.insert(it,POS_HDOP); - } - - if (vdopChanged) - { - it = changedAccuracyValues.insert(it,POS_VDOP); - } - if (sigmaHPosChanged) - { - it = changedAccuracyValues.insert(it,POS_SIGMA_LATITUDE); - it = changedAccuracyValues.insert(it,POS_SIGMA_LONGITUDE); - } + //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 - if (sigmaAltitudeChanged) + if (latChanged) { - it = changedAccuracyValues.insert(it,POS_VISIBLE_SATELLITES); + changedValues |= GENIVI_ENHANCEDPOSITIONSERVICE_LATITUDE; } - //todo: handle other field-changes here (accuracy and status) - - if (!mpSelf) + if (lonChanged) { - LOG_ERROR_MSG(gCtx,"Null pointer!"); - return; + changedValues |= GENIVI_ENHANCEDPOSITIONSERVICE_LONGITUDE; } - - mpSelf->AccuracyUpdate(changedAccuracyValues); -} -void EnhancedPosition::sigStatusUpdate(const TGNSSPosition position[], uint16_t numElements) -{ - - bool fixStatusChanged = false; - bool fixTypeBitsChanged = false; - - if (position == NULL || numElements < 1) + if (altChanged) { - LOG_ERROR_MSG(gCtx,"sigStatusUpdate failed!"); - return; + changedValues |= GENIVI_ENHANCEDPOSITIONSERVICE_ALTITUDE; } - for (int i = 0; i< numElements; i++) + if (speedChanged) { - LOG_INFO(gCtx,"Status Update[%d/%d]: fixStatus=%d fixTypeBits=0x%08X", - i+1, - numElements, - position[i].fixStatus, - position[i].fixTypeBits); - - if (fixStatusChanged == false) - { - fixStatusChanged = (position[i].validityBits & GNSS_POSITION_STAT_VALID); - } - - if (fixTypeBitsChanged == false) - { - fixTypeBitsChanged = (position[i].validityBits & GNSS_POSITION_TYPE_VALID); - } - + changedValues |= GENIVI_ENHANCEDPOSITIONSERVICE_SPEED; } - //in a real product, the accuracy would be used for dead-reckoning. - //in this proof of concept, the client application is simply notified - //about status changes - std::vector<uint16_t>::iterator it; - - std::vector< uint16_t > changedStatusValues; - it = changedStatusValues.begin(); - - if (fixStatusChanged) + if (headingChanged) { - it = changedStatusValues.insert(it,POS_GNSS_FIX_STATUS); + changedValues |= GENIVI_ENHANCEDPOSITIONSERVICE_HEADING; } - if (!mpSelf) + if (climbChanged) { - LOG_ERROR_MSG(gCtx,"Null pointer!"); - return; + changedValues |= GENIVI_ENHANCEDPOSITIONSERVICE_CLIMB; } - - mpSelf->StatusUpdate(changedStatusValues); -} - - - -void EnhancedPosition::sigSatelliteInfoUpdate(const TGNSSPosition position[], uint16_t numElements) -{ - //satellite info - bool usedSatellitesChanged = false; - bool trackedSatellitesChanged = false; - bool visibleSatellitesChanged = false; - - - if (position == NULL || numElements < 1) + if (pdopChanged) { - LOG_ERROR_MSG(gCtx,"sigSatelliteInfoUpdate failed!"); - return; + changedValues |= GENIVI_ENHANCEDPOSITIONSERVICE_PDOP; } - for (int i = 0; i< numElements; i++) + if (hdopChanged) { - LOG_INFO(gCtx,"SatelliteInfo Update[%d/%d]: usedSatellites=%d trackedSatellites=%d visibleSatellites=%d", - i+1, - numElements, - position[i].usedSatellites, - position[i].trackedSatellites, - position[i].visibleSatellites); - - if (usedSatellitesChanged == false) - { - usedSatellitesChanged = (position[i].validityBits & GNSS_POSITION_USAT_VALID); - } - - if (trackedSatellitesChanged == false) - { - trackedSatellitesChanged = (position[i].validityBits & GNSS_POSITION_TSAT_VALID); - } - - if (visibleSatellitesChanged == false) - { - visibleSatellitesChanged = (position[i].validityBits & GNSS_POSITION_VSAT_VALID); - } - + changedValues |= GENIVI_ENHANCEDPOSITIONSERVICE_HDOP; } - - //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) + if (vdopChanged) { - it = changedSatelliteInfoValues.insert(it,POS_USED_SATELLITES); - } + changedValues |= GENIVI_ENHANCEDPOSITIONSERVICE_VDOP; + } - if (trackedSatellitesChanged) + if (usatChanged) { - it = changedSatelliteInfoValues.insert(it,POS_TRACKED_SATELLITES); + changedValues |= GENIVI_ENHANCEDPOSITIONSERVICE_USED_SATELLITES; } - if (visibleSatellitesChanged) + if (fixStatusChanged) { - it = changedSatelliteInfoValues.insert(it,POS_VISIBLE_SATELLITES); + changedValues |= GENIVI_ENHANCEDPOSITIONSERVICE_GNSS_FIX_STATUS; } - //todo: handle other field-changes here (accuracy and status) - if (!mpSelf) { LOG_ERROR_MSG(gCtx,"Null pointer!"); return; } - - mpSelf->SatelliteInfoUpdate(changedSatelliteInfoValues); + + //notify clients + mpSelf->PositionUpdate(changedValues); } + void EnhancedPosition::cbPosition(const TGNSSPosition position[], uint16_t numElements) { sigPositionUpdate(position, numElements); - sigAccuracyUpdate(position, numElements); - sigStatusUpdate(position, numElements); - sigSatelliteInfoUpdate(position, numElements); } diff --git a/enhanced-position-service/src/enhanced-position.h b/enhanced-position-service/src/enhanced-position.h index eef2b0c..7b35a5d 100644 --- a/enhanced-position-service/src/enhanced-position.h +++ b/enhanced-position-service/src/enhanced-position.h @@ -20,7 +20,7 @@ #include <dbus-c++/dbus.h> -#include "enhanced-position-adaptor.h" +#include "genivi-positioning-enhancedposition_adaptor.h" #include "gnss-init.h" #include "gnss.h" @@ -36,20 +36,10 @@ public: ~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 GetPositionInfo(const uint64_t& valuesToReturn, uint64_t& timestamp, std::map< uint64_t, ::DBus::Variant >& data); + void GetSatelliteInfo(uint64_t& timestamp, std::vector< ::DBus::Struct< uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, bool > >& satelliteInfo); + void GetTime(uint64_t& timestamp, std::map< uint64_t, ::DBus::Variant >& time); void run(); @@ -60,15 +50,9 @@ private: bool checkMajorVersion(int expectedMajor); static void cbSatelliteDetail(const TGNSSSatelliteDetail satelliteDetail[], uint16_t numElements); - static void cbPosition(const TGNSSPosition position[], uint16_t numElements); + static void sigPositionUpdate(const TGNSSPosition position[], uint16_t numElements); - static void sigAccuracyUpdate(const TGNSSPosition position[], uint16_t numElements); - static void sigStatusUpdate(const TGNSSPosition position[], uint16_t numElements); - static void sigSatelliteInfoUpdate(const TGNSSPosition position[], uint16_t numElements); - - - static EnhancedPosition* mpSelf; }; diff --git a/enhanced-position-service/src/log.h b/enhanced-position-service/src/log.h index f310461..4d946fb 100644 --- a/enhanced-position-service/src/log.h +++ b/enhanced-position-service/src/log.h @@ -20,7 +20,7 @@ #define INCLUDE_LOG // turn-on via cmake define: -// $ cmake -DWITH_DLT=1 .. +// $ cmake -DWITH_DLT=1 -DDEBUG_ENABLED=1 .. #if (!DLT_ENABLED) /*****************************************************************************/ @@ -46,6 +46,22 @@ typedef const char* NoDltContext; #define dlt_free() ; // log calls +#if (!DEBUG_ENABLED) + +#define LOG_VERBOSE_MSG(context, msg) ; +#define LOG_VERBOSE(context, fmt, ...) ; + +#define LOG_DEBUG_MSG(context, msg) ; +#define LOG_DEBUG(context, fmt, ...) ; + +#define LOG_INFO_MSG(context, msg) ; +#define LOG_INFO(context, fmt, ...) ; + +#define LOG_WARNING_MSG(context, msg) ; +#define LOG_WARNING(context, fmt, ...) ; + +#else + #define LOG_VERBOSE_MSG(context, msg) \ fprintf(stderr, "[VERBO][%4s] " msg "\n", context) #define LOG_VERBOSE(context, fmt, ...) \ @@ -65,6 +81,7 @@ typedef const char* NoDltContext; fprintf(stderr, "[WARN ][%4s] " msg "\n", context) #define LOG_WARNING(context, fmt, ...) \ fprintf(stderr, "[WARN ][%4s] " fmt "\n", context, __VA_ARGS__) +#endif #define LOG_ERROR_MSG(context, msg) \ fprintf(stderr, "[ERROR][%4s] " msg "\n", context) diff --git a/enhanced-position-service/src/position-feedback.cpp b/enhanced-position-service/src/position-feedback.cpp index 21251b9..0538c0c 100644 --- a/enhanced-position-service/src/position-feedback.cpp +++ b/enhanced-position-service/src/position-feedback.cpp @@ -42,7 +42,7 @@ PositionFeedback::~PositionFeedback() return Version; } -void PositionFeedback::SetPositionFeedback(const std::vector< std::map< uint16_t, ::DBus::Variant > >& feedback, const uint64_t& timestamp, const uint16_t& feedbackType) +void PositionFeedback::SetPositionFeedback(const std::vector< std::map< uint64_t, ::DBus::Variant > >& feedback, const uint64_t& timestamp, const uint16_t& feedbackType) { throw DBus::ErrorNotSupported("Method not supported yet"); } diff --git a/enhanced-position-service/src/position-feedback.h b/enhanced-position-service/src/position-feedback.h index c030073..37db3ba 100644 --- a/enhanced-position-service/src/position-feedback.h +++ b/enhanced-position-service/src/position-feedback.h @@ -20,7 +20,7 @@ #define ___POSITION_FEEDBACK_H #include <dbus-c++/dbus.h> -#include "position-feedback-adaptor.h" +#include "genivi-positioning-positionfeedback_adaptor.h" class PositionFeedback : public org::genivi::positioning::PositionFeedback_adaptor @@ -36,7 +36,7 @@ public: ::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 SetPositionFeedback(const std::vector< std::map< uint64_t, ::DBus::Variant > >& feedback, const uint64_t& timestamp, const uint16_t& feedbackType); void run(); diff --git a/enhanced-position-service/test/CMakeLists.txt b/enhanced-position-service/test/CMakeLists.txt index d35f92c..5da50ce 100644 --- a/enhanced-position-service/test/CMakeLists.txt +++ b/enhanced-position-service/test/CMakeLists.txt @@ -13,6 +13,9 @@ # 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/. # +# Update (2014/12/02) : Philippe Colliot <philippe.colliot@mpsa.com>, +# PSA Peugeot Citroen +# - introduce debug flag to disable verbosity # @licence end@ ########################################################################### @@ -21,39 +24,25 @@ cmake_minimum_required(VERSION 2.6.0) message(STATUS "ENHANCED-POSITION-CLIENT") message(STATUS "WITH_DLT = ${WITH_DLT}") +message(STATUS "WITH_DEBUG = ${WITH_DEBUG}") find_package(PkgConfig REQUIRED) pkg_check_modules(DBUS_CPP dbus-c++-1) -include_directories(${DBUS_CPP_INCLUDE_DIRS}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${DBUS_CPP_INCLUDE_DIRS}) - -# 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 -) +include_directories(${enhanced-position-service_INCLUDE_DIRS}) link_directories(${DBUS_CPP_LIBRARY_DIRS}) add_executable(enhanced-position-client - enhanced-position-proxy.h + ${enhanced-position-service_INCLUDE_DIRS}/genivi-positioning-enhancedposition_proxy.h enhanced-position-client.h enhanced-position-client.cpp - position-feedback-proxy.h - configuration-proxy.h - positioning-constants.h + ${enhanced-position-service_INCLUDE_DIRS}/genivi-positioning-positionfeedback_proxy.h + ${enhanced-position-service_INCLUDE_DIRS}/genivi-positioning-configuration_proxy.h + ${enhanced-position-service_INCLUDE_DIRS}/genivi-positioning-constants.h ) set(LIBRARIES @@ -68,6 +57,10 @@ if(WITH_DLT) set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES}) endif() +if(WITH_DEBUG) + add_definitions("-DDEBUG_ENABLED=1") +endif() + target_link_libraries(enhanced-position-client ${LIBRARIES}) message(STATUS "DBUS_CPP_LIBRARIES: " ${DBUS_CPP_LIBRARIES}) diff --git a/enhanced-position-service/test/compliance-test/CMakeLists.txt b/enhanced-position-service/test/compliance-test/CMakeLists.txt index 8409e5a..9386074 100644 --- a/enhanced-position-service/test/compliance-test/CMakeLists.txt +++ b/enhanced-position-service/test/compliance-test/CMakeLists.txt @@ -13,6 +13,9 @@ # 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/. # +# Update (2014/12/02) : Philippe Colliot <philippe.colliot@mpsa.com>, +# PSA Peugeot Citroen +# - generate the API of enhanced-position-service into the API folder # @licence end@ ########################################################################### @@ -20,7 +23,6 @@ message(STATUS "ENHANCED-POSITION-SERVICE-COMPLIANCE-TEST") INCLUDE(UsePkgConfig) -include_directories("${PROJECT_SOURCE_DIR}/api") include_directories("${PROJECT_SOURCE_DIR}/../common") find_package(PkgConfig) diff --git a/enhanced-position-service/test/enhanced-position-client.cpp b/enhanced-position-service/test/enhanced-position-client.cpp index 01717f3..2a00ab2 100644 --- a/enhanced-position-service/test/enhanced-position-client.cpp +++ b/enhanced-position-service/test/enhanced-position-client.cpp @@ -20,7 +20,7 @@ #include <stdio.h> #include "enhanced-position-client.h" -#include "positioning-constants.h" +#include "genivi-positioning-constants.h" #include "log.h" using namespace std; @@ -34,66 +34,47 @@ EnhancedPositionClient::EnhancedPositionClient(DBus::Connection &connection, con { } -void EnhancedPositionClient::PositionUpdate(const std::vector< uint16_t >& changedValues) +void EnhancedPositionClient::PositionUpdate(const uint64_t& changedValues) { LOG_INFO_MSG(gCtx,"Position Update"); // retrieve the data - std::map< uint16_t, ::DBus::Variant > posData = GetData(changedValues); + uint64_t timestamp; + std::map< uint64_t, ::DBus::Variant > posData; + + GetPositionInfo(changedValues, timestamp, posData); - for (int i = 0; i < changedValues.size(); i++) + if (changedValues & GENIVI_ENHANCEDPOSITIONSERVICE_LATITUDE) { - 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=%lf", posData[POS_ALTITUDE].reader().get_double()); - } - - 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=%lf", posData[POS_CLIMB].reader().get_double()); - } - - if (changedValues[i] == POS_HEADING) - { - LOG_INFO(gCtx,"HEADING=%lf", posData[POS_HEADING].reader().get_double()); - } + LOG_INFO(gCtx,"LAT=%lf", posData[GENIVI_ENHANCEDPOSITIONSERVICE_LATITUDE].reader().get_double()); } -} + if (changedValues & GENIVI_ENHANCEDPOSITIONSERVICE_LONGITUDE) + { + LOG_INFO(gCtx,"LON=%lf", posData[GENIVI_ENHANCEDPOSITIONSERVICE_LONGITUDE].reader().get_double()); + } -void EnhancedPositionClient::RotationRateUpdate(const std::vector< uint16_t >& changedValues) -{ - LOG_INFO_MSG(gCtx,"RotationRateUpdate"); -} + if (changedValues & GENIVI_ENHANCEDPOSITIONSERVICE_ALTITUDE) + { + LOG_INFO(gCtx,"ALT=%lf", posData[GENIVI_ENHANCEDPOSITIONSERVICE_ALTITUDE].reader().get_double()); + } -void EnhancedPositionClient::AccuracyUpdate(const std::vector< uint16_t >& changedValues) -{ - LOG_INFO_MSG(gCtx,"AccuracyUpdate"); -} + if (changedValues & GENIVI_ENHANCEDPOSITIONSERVICE_SPEED) + { + LOG_INFO(gCtx,"SPEED=%lf", posData[GENIVI_ENHANCEDPOSITIONSERVICE_SPEED].reader().get_double()); + } + + if (changedValues & GENIVI_ENHANCEDPOSITIONSERVICE_CLIMB) + { + LOG_INFO(gCtx,"CLIMB=%lf", posData[GENIVI_ENHANCEDPOSITIONSERVICE_CLIMB].reader().get_double()); + } + + if (changedValues & GENIVI_ENHANCEDPOSITIONSERVICE_HEADING) + { + LOG_INFO(gCtx,"HEADING=%lf", posData[GENIVI_ENHANCEDPOSITIONSERVICE_HEADING].reader().get_double()); + } -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) diff --git a/enhanced-position-service/test/enhanced-position-client.h b/enhanced-position-service/test/enhanced-position-client.h index 4519bb3..02817e1 100644 --- a/enhanced-position-service/test/enhanced-position-client.h +++ b/enhanced-position-service/test/enhanced-position-client.h @@ -19,7 +19,7 @@ #define __ENHANCED_POSITION_CLIENT_H #include <dbus-c++/dbus.h> -#include "enhanced-position-proxy.h" +#include "genivi-positioning-enhancedposition_proxy.h" class EnhancedPositionClient : public org::genivi::positioning::EnhancedPosition_proxy, @@ -30,11 +30,7 @@ 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); + void PositionUpdate(const uint64_t& changedValues); }; diff --git a/enhanced-position-service/test/test-scripts/test-enhanced-position-service-tk-gui.py b/enhanced-position-service/test/test-scripts/test-enhanced-position-service-tk-gui.py index 2265e18..6ef7fc0 100644 --- a/enhanced-position-service/test/test-scripts/test-enhanced-position-service-tk-gui.py +++ b/enhanced-position-service/test/test-scripts/test-enhanced-position-service-tk-gui.py @@ -57,12 +57,12 @@ import Queue from Tkinter import * #constants as defined in the Positioning API -LATITUDE = 0x0020 -LONGITUDE = 0x0021 -ALTITUDE = 0x0022 -CLIMB = 0x0032 -SPEED = 0x0031 -HEADING = 0x0030 +LATITUDE = 0x00000001 +LONGITUDE = 0x00000002 +ALTITUDE = 0x00000004 +CLIMB = 0x00000020 +SPEED = 0x00000010 +HEADING = 0x00000008 if __name__ == '__main__': #According http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html#setting-up-an-event-loop @@ -96,20 +96,23 @@ def signalPositionUpdate(event): #print("signalPositionUpdate Event received by GUI thread") changedValues = commQueue.get() #print changedValues - position = enhanced_position_interface.GetPosition(changedValues) - for val in changedValues: - if val == LATITUDE: - labelLat.config(text='LATITUDE:' + str(position[dbus.UInt16(val)])) - if val == LONGITUDE: - labelLon.config(text='LONGITUDE:' + str(position[dbus.UInt16(val)])) - if val == ALTITUDE: - labelAlt.config(text='ALTITUDE:' + str(position[dbus.UInt16(val)])) - if val == CLIMB: - labelClimb.config(text='CLIMB:' + str(position[dbus.UInt16(val)])) - if val == SPEED: - labelSpeed.config(text='SPEED:' + str(position[dbus.UInt16(val)])) - if val == HEADING: - labelHeading.config(text='HEADING:' + str(position[dbus.UInt16(val)])) + position = enhanced_position_interface.GetPositionInfo(changedValues) + timestamp = position[0] + #print 'TIMESTAMP:' +str(timestamp) + data = position[1] + for key in data: + if key == LATITUDE: + labelLat.config(text='LATITUDE:' + str(data[dbus.UInt16(key)])) + if key == LONGITUDE: + labelLon.config(text='LONGITUDE:' + str(data[dbus.UInt16(key)])) + if key == ALTITUDE: + labelAlt.config(text='ALTITUDE:' + str(data[dbus.UInt16(key)])) + if key == CLIMB: + labelClimb.config(text='CLIMB:' + str(data[dbus.UInt16(key)])) + if key == SPEED: + labelSpeed.config(text='SPEED:' + str(data[dbus.UInt16(key)])) + if key == HEADING: + labelHeading.config(text='HEADING:' + str(data[dbus.UInt16(key)])) #It's important to call update_idletasks() to update the GUI tk_root.update_idletasks() diff --git a/enhanced-position-service/test/test-scripts/test-enhanced-position-service.py b/enhanced-position-service/test/test-scripts/test-enhanced-position-service.py index 9ae6f72..ee784aa 100755 --- a/enhanced-position-service/test/test-scripts/test-enhanced-position-service.py +++ b/enhanced-position-service/test/test-scripts/test-enhanced-position-service.py @@ -31,12 +31,12 @@ import gobject import dbus.mainloop.glib #constants as defined in the Positioning API -LATITUDE = 0x0020 -LONGITUDE = 0x0021 -ALTITUDE = 0x0022 -CLIMB = 0x0032 -SPEED = 0x0031 -HEADING = 0x0030 +LATITUDE = 0x00000001 +LONGITUDE = 0x00000002 +ALTITUDE = 0x00000004 +CLIMB = 0x00000020 +SPEED = 0x00000010 +HEADING = 0x00000008 print '\n--------------------------' print 'Positioning Test' @@ -51,21 +51,24 @@ bus = dbus.SessionBus() #signal receiver def catchall_positioning_signals_handler(changedValues): print 'PositonUpdate' - changedfields = dbus.Array(signature='q') - position = enhanced_position_interface.GetPosition(changedValues) - for val in changedValues: - if val == LATITUDE: - print 'LATITUDE:' + str(position[dbus.UInt16(val)]) - if val == LONGITUDE: - print 'LONGITUDE:' + str(position[dbus.UInt16(val)]) - if val == ALTITUDE: - print 'ALTITUDE:' + str(position[dbus.UInt16(val)]) - if val == CLIMB: - print 'CLIMB:' + str(position[dbus.UInt16(val)]) - if val == SPEED: - print 'SPEED:' + str(position[dbus.UInt16(val)]) - if val == HEADING: - print 'HEADING:' + str(position[dbus.UInt16(val)]) + position = enhanced_position_interface.GetPositionInfo(changedValues) + timestamp = position[0] + print 'TIMESTAMP:' +str(timestamp) + data = position[1] + #print(data) + for key in data: + if key == LATITUDE: + print 'LATITUDE:' + str(data[dbus.UInt64(key)]) + if key == LONGITUDE: + print 'LONGITUDE:' + str(data[dbus.UInt64(key)]) + if key == ALTITUDE: + print 'ALTITUDE:' + str(data[dbus.UInt64(key)]) + if key == CLIMB: + print 'CLIMB:' + str(data[dbus.UInt64(key)]) + if key == SPEED: + print 'SPEED:' + str(data[dbus.UInt64(key)]) + if key == HEADING: + print 'HEADING:' + str(data[dbus.UInt64(key)]) #add signal receiver bus.add_signal_receiver(catchall_positioning_signals_handler, \ diff --git a/gnss-service/CMakeLists.txt b/gnss-service/CMakeLists.txt index 83dde1b..ddf8fab 100644 --- a/gnss-service/CMakeLists.txt +++ b/gnss-service/CMakeLists.txt @@ -13,6 +13,9 @@ # 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/. # +# Update (2014/12/02) : Philippe Colliot <philippe.colliot@mpsa.com>, +# PSA Peugeot Citroen +# - introduce debug flag to disable verbosity # @licence end@ ########################################################################### @@ -31,6 +34,9 @@ option(WITH_REPLAYER option(WITH_TESTS "Compile test applications" OFF) +option(WITH_DEBUG + "Enable the debug messages" OFF) + SET(CMAKE_INSTALL_RPATH "") #SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) diff --git a/gnss-service/api/gnss.h b/gnss-service/api/gnss.h index 9c72c71..21d18a3 100644 --- a/gnss-service/api/gnss.h +++ b/gnss-service/api/gnss.h @@ -103,7 +103,8 @@ typedef enum { * Note: the uncommon numbering of day and month is chosen to be compatible with the struct tm from the standard C-Library */ typedef struct { - uint64_t timestamp; /**< Timestamp of the acquisition of the UTC date/time. */ + uint64_t timestamp; /**< Timestamp of the acquisition of the UTC date/time [ms]. + All sensor/GNSS timestamps must be based on the same time source. */ uint16_t year; /**< Year fraction of the UTC time. Unit: [year] Number equivalent to the year (4 digits) */ uint8_t month; /**< Month fraction of the UTC time. Unit: [month] Number betweeen 0 and 11 */ uint8_t day; /**< Day of month fraction of the UTC time. Unit: [day]. Number between 1 and 31 */ @@ -162,7 +163,8 @@ typedef enum { * Detailed data from one GNSS satellite. */ typedef struct { - uint64_t timestamp; /**< Timestamp of the acquisition of the satellite detail data. */ + uint64_t timestamp; /**< Timestamp of the acquisition of the satellite detail data [ms]. + All sensor/GNSS timestamps must be based on the same time source. */ EGNSSSystem system; /**< Value representing the GNSS system. */ uint16_t satelliteId; /**< Satellite ID. Satellite IDs are only unique within one satellite system. @@ -224,7 +226,8 @@ typedef enum { * for positioning applications such as GNSS/Dead Reckoning sensor fusion. */ typedef struct { - uint64_t timestamp; /**< Timestamp of the acquisition of the GNSS data. [ms] */ + uint64_t timestamp; /**< Timestamp of the acquisition of the GNSS data [ms]. + All sensor/GNSS timestamps must be based on the same time source. */ //position double latitude; /**< Latitude in WGS84 in degrees. */ double longitude; /**< Longitude in WGS84 in degrees. */ diff --git a/gnss-service/src/CMakeLists.txt b/gnss-service/src/CMakeLists.txt index fa6dbbb..f4c66db 100644 --- a/gnss-service/src/CMakeLists.txt +++ b/gnss-service/src/CMakeLists.txt @@ -13,6 +13,9 @@ # 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/. # +# Update (2014/12/02) : Philippe Colliot <philippe.colliot@mpsa.com>, +# PSA Peugeot Citroen +# - introduce debug flag to disable verbosity # @licence end@ ########################################################################### @@ -21,6 +24,7 @@ message(STATUS "WITH_DLT = ${WITH_DLT}") message(STATUS "WITH_GPSD = ${WITH_GPSD}") message(STATUS "WITH_REPLAYER = ${WITH_REPLAYER}") message(STATUS "WITH_TESTS = ${WITH_TESTS}") +message(STATUS "WITH_DEBUG = ${WITH_DEBUG}") include_directories("${PROJECT_SOURCE_DIR}/api") @@ -36,6 +40,10 @@ if(WITH_DLT) set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES}) endif() +if(WITH_DEBUG) + add_definitions("-DDEBUG_ENABLED=1") +endif() + if(WITH_GPSD) pkg_check_modules(GPSD libgps>=2.94) #generate library using gpsd as input diff --git a/gnss-service/src/log.h b/gnss-service/src/log.h index f310461..4d946fb 100644 --- a/gnss-service/src/log.h +++ b/gnss-service/src/log.h @@ -20,7 +20,7 @@ #define INCLUDE_LOG // turn-on via cmake define: -// $ cmake -DWITH_DLT=1 .. +// $ cmake -DWITH_DLT=1 -DDEBUG_ENABLED=1 .. #if (!DLT_ENABLED) /*****************************************************************************/ @@ -46,6 +46,22 @@ typedef const char* NoDltContext; #define dlt_free() ; // log calls +#if (!DEBUG_ENABLED) + +#define LOG_VERBOSE_MSG(context, msg) ; +#define LOG_VERBOSE(context, fmt, ...) ; + +#define LOG_DEBUG_MSG(context, msg) ; +#define LOG_DEBUG(context, fmt, ...) ; + +#define LOG_INFO_MSG(context, msg) ; +#define LOG_INFO(context, fmt, ...) ; + +#define LOG_WARNING_MSG(context, msg) ; +#define LOG_WARNING(context, fmt, ...) ; + +#else + #define LOG_VERBOSE_MSG(context, msg) \ fprintf(stderr, "[VERBO][%4s] " msg "\n", context) #define LOG_VERBOSE(context, fmt, ...) \ @@ -65,6 +81,7 @@ typedef const char* NoDltContext; fprintf(stderr, "[WARN ][%4s] " msg "\n", context) #define LOG_WARNING(context, fmt, ...) \ fprintf(stderr, "[WARN ][%4s] " fmt "\n", context, __VA_ARGS__) +#endif #define LOG_ERROR_MSG(context, msg) \ fprintf(stderr, "[ERROR][%4s] " msg "\n", context) diff --git a/gnss-service/test/CMakeLists.txt b/gnss-service/test/CMakeLists.txt index c40ef32..78f87bc 100755 --- a/gnss-service/test/CMakeLists.txt +++ b/gnss-service/test/CMakeLists.txt @@ -13,6 +13,9 @@ # 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/. # +# Update (2014/12/02) : Philippe Colliot <philippe.colliot@mpsa.com>, +# PSA Peugeot Citroen +# - introduce debug flag to disable verbosity # @licence end@ ########################################################################### @@ -20,6 +23,7 @@ message(STATUS "GNSS-SERVICE-CLIENT") message( STATUS "WITH_DLT = ${WITH_DLT}") message( STATUS "WITH_GPSD = ${WITH_GPSD}") message( STATUS "WITH_REPLAYER = ${WITH_REPLAYER}") +message(STATUS "WITH_DEBUG = ${WITH_DEBUG}") include_directories("${PROJECT_SOURCE_DIR}/api") include_directories("${PROJECT_SOURCE_DIR}/src") @@ -46,5 +50,9 @@ if(WITH_DLT) set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES}) endif() +if(WITH_DEBUG) + add_definitions("-DDEBUG_ENABLED=1") +endif() + target_link_libraries(gnss-service-client ${LIBRARIES}) diff --git a/gnss-service/test/compliance-test/CMakeLists.txt b/gnss-service/test/compliance-test/CMakeLists.txt index 51da891..416eb75 100644 --- a/gnss-service/test/compliance-test/CMakeLists.txt +++ b/gnss-service/test/compliance-test/CMakeLists.txt @@ -13,6 +13,9 @@ # 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/. # +# Update (2014/12/02) : Philippe Colliot <philippe.colliot@mpsa.com>, +# PSA Peugeot Citroen +# - introduce debug flag to disable verbosity # @licence end@ ########################################################################### @@ -20,6 +23,7 @@ message(STATUS "GNSS-SERVICE-COMPLIANCE-TEST") message( STATUS "WITH_DLT = ${WITH_DLT}") message( STATUS "WITH_GPSD = ${WITH_GPSD}") message( STATUS "WITH_REPLAYER = ${WITH_REPLAYER}") +message(STATUS "WITH_DEBUG = ${WITH_DEBUG}") include_directories("${PROJECT_SOURCE_DIR}/api") include_directories("${PROJECT_SOURCE_DIR}/src") @@ -47,5 +51,9 @@ if(WITH_DLT) set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES}) endif() +if(WITH_DEBUG) + add_definitions("-DDEBUG_ENABLED=1") +endif() + target_link_libraries(gnss-service-compliance-test ${LIBRARIES}) diff --git a/gnss-service/test/compliance-test/gnss-service-compliance-test.c b/gnss-service/test/compliance-test/gnss-service-compliance-test.c index 2856b4b..760ae9f 100644 --- a/gnss-service/test/compliance-test/gnss-service-compliance-test.c +++ b/gnss-service/test/compliance-test/gnss-service-compliance-test.c @@ -70,7 +70,7 @@ bool checkMajorVersion(int expectedMajor) bool init() { - if(!checkMajorVersion(2)) + if(!checkMajorVersion(GENIVI_GNSS_API_MAJOR)) { return false; } diff --git a/gnss-service/test/gnss-service-client.c b/gnss-service/test/gnss-service-client.c index c928380..420b257 100644 --- a/gnss-service/test/gnss-service-client.c +++ b/gnss-service/test/gnss-service-client.c @@ -134,7 +134,7 @@ bool checkMajorVersion(int expectedMajor) void init() { - if(!checkMajorVersion(3)) + if(!checkMajorVersion(GENIVI_GNSS_API_MAJOR)) { exit(EXIT_FAILURE); } diff --git a/log-replayer/CMakeLists.txt b/log-replayer/CMakeLists.txt index f13e1ec..3d21b2b 100644 --- a/log-replayer/CMakeLists.txt +++ b/log-replayer/CMakeLists.txt @@ -13,6 +13,9 @@ # 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/. # +# Update (2014/12/02) : Philippe Colliot <philippe.colliot@mpsa.com>, +# PSA Peugeot Citroen +# - introduce debug flag to disable verbosity # @licence end@ ########################################################################### @@ -25,6 +28,9 @@ option(WITH_DLT option(WITH_TESTS "Compile test applications" OFF) +option(WITH_DEBUG + "Enable the debug messages" OFF) + message(STATUS) message(STATUS "---------------------------------------------------------") diff --git a/log-replayer/src/log.h b/log-replayer/src/log.h index a683b6f..fa5c3ca 100644 --- a/log-replayer/src/log.h +++ b/log-replayer/src/log.h @@ -20,7 +20,7 @@ #define INCLUDE_LOG // turn-on via cmake define: -// $ cmake -DWITH_DLT=1 .. +// $ cmake -DWITH_DLT=1 -DDEBUG_ENABLED=1 .. #if (!DLT_ENABLED) /*****************************************************************************/ @@ -46,6 +46,22 @@ typedef const char* NoDltContext; #define dlt_free() ; // log calls +#if (!DEBUG_ENABLED) + +#define LOG_VERBOSE_MSG(context, msg) ; +#define LOG_VERBOSE(context, fmt, ...) ; + +#define LOG_DEBUG_MSG(context, msg) ; +#define LOG_DEBUG(context, fmt, ...) ; + +#define LOG_INFO_MSG(context, msg) ; +#define LOG_INFO(context, fmt, ...) ; + +#define LOG_WARNING_MSG(context, msg) ; +#define LOG_WARNING(context, fmt, ...) ; + +#else + #define LOG_VERBOSE_MSG(context, msg) \ fprintf(stderr, "[VERBO][%4s] " msg "\n", context) #define LOG_VERBOSE(context, fmt, ...) \ @@ -65,6 +81,7 @@ typedef const char* NoDltContext; fprintf(stderr, "[WARN ][%4s] " msg "\n", context) #define LOG_WARNING(context, fmt, ...) \ fprintf(stderr, "[WARN ][%4s] " fmt "\n", context, __VA_ARGS__) +#endif #define LOG_ERROR_MSG(context, msg) \ fprintf(stderr, "[ERROR][%4s] " msg "\n", context) diff --git a/log-replayer/test/CMakeLists.txt b/log-replayer/test/CMakeLists.txt index eab70a9..a0cb59c 100644 --- a/log-replayer/test/CMakeLists.txt +++ b/log-replayer/test/CMakeLists.txt @@ -13,11 +13,15 @@ # 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/. # +# Update (2014/12/02) : Philippe Colliot <philippe.colliot@mpsa.com>, +# PSA Peugeot Citroen +# - introduce debug flag to disable verbosity # @licence end@ ########################################################################### message(STATUS "TEST-LOG-REPLAYER") message(STATUS "WITH_DLT = ${WITH_DLT}") +message(STATUS "WITH_DEBUG = ${WITH_DEBUG}") include_directories("${PROJECT_SOURCE_DIR}/src") @@ -35,6 +39,10 @@ if(WITH_DLT) set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES}) endif() +if(WITH_DEBUG) + add_definitions("-DDEBUG_ENABLED=1") +endif() + target_link_libraries(test-log-replayer ${LIBRARIES}) diff --git a/sensors-service/CMakeLists.txt b/sensors-service/CMakeLists.txt index 07a7ba9..b51fef7 100644 --- a/sensors-service/CMakeLists.txt +++ b/sensors-service/CMakeLists.txt @@ -13,6 +13,9 @@ # 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/. # +# Update (2014/12/02) : Philippe Colliot <philippe.colliot@mpsa.com>, +# PSA Peugeot Citroen +# - introduce debug flag to disable verbosity # @licence end@ ########################################################################### @@ -34,6 +37,9 @@ option(WITH_IPHONE option(WITH_TESTS "Compile test applications" OFF) +option(WITH_DEBUG + "Enable the debug messages" OFF) + message(STATUS) message(STATUS "---------------------------------------------------------") diff --git a/sensors-service/api/sns-init.h b/sensors-service/api/sns-init.h index 026d6ed..f409166 100644 --- a/sensors-service/api/sns-init.h +++ b/sensors-service/api/sns-init.h @@ -12,7 +12,7 @@ #define INCLUDE_GENIVI_SNS // API Version -#define GENIVI_SNS_API_MAJOR 2 +#define GENIVI_SNS_API_MAJOR 3 #define GENIVI_SNS_API_MINOR 0 #define GENIVI_SNS_API_MICRO 0 diff --git a/sensors-service/src/CMakeLists.txt b/sensors-service/src/CMakeLists.txt index c4c5aed..f0b5ea6 100644 --- a/sensors-service/src/CMakeLists.txt +++ b/sensors-service/src/CMakeLists.txt @@ -13,6 +13,9 @@ # 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/. # +# Update (2014/12/02) : Philippe Colliot <philippe.colliot@mpsa.com>, +# PSA Peugeot Citroen +# - introduce debug flag to disable verbosity # @licence end@ ########################################################################### @@ -21,6 +24,7 @@ message(STATUS "WITH_DLT = ${WITH_DLT}") message(STATUS "WITH_IPHONE = ${WITH_IPHONE}") message(STATUS "WITH_REPLAYER = ${WITH_REPLAYER}") message(STATUS "WITH_TESTS = ${WITH_TESTS}") +message(STATUS "WITH_DEBUG = ${WITH_DEBUG}") include_directories("${PROJECT_SOURCE_DIR}/api") @@ -36,6 +40,10 @@ if(WITH_DLT) set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES}) endif() +if(WITH_DEBUG) + add_definitions("-DDEBUG_ENABLED=1") +endif() + if(WITH_IPHONE) #generate library using iphone as input set(LIB_SRC_USE_IPHONE ${CMAKE_SOURCE_DIR}/src/sns-use-iphone.c diff --git a/sensors-service/src/log.h b/sensors-service/src/log.h index a683b6f..fa5c3ca 100644 --- a/sensors-service/src/log.h +++ b/sensors-service/src/log.h @@ -20,7 +20,7 @@ #define INCLUDE_LOG // turn-on via cmake define: -// $ cmake -DWITH_DLT=1 .. +// $ cmake -DWITH_DLT=1 -DDEBUG_ENABLED=1 .. #if (!DLT_ENABLED) /*****************************************************************************/ @@ -46,6 +46,22 @@ typedef const char* NoDltContext; #define dlt_free() ; // log calls +#if (!DEBUG_ENABLED) + +#define LOG_VERBOSE_MSG(context, msg) ; +#define LOG_VERBOSE(context, fmt, ...) ; + +#define LOG_DEBUG_MSG(context, msg) ; +#define LOG_DEBUG(context, fmt, ...) ; + +#define LOG_INFO_MSG(context, msg) ; +#define LOG_INFO(context, fmt, ...) ; + +#define LOG_WARNING_MSG(context, msg) ; +#define LOG_WARNING(context, fmt, ...) ; + +#else + #define LOG_VERBOSE_MSG(context, msg) \ fprintf(stderr, "[VERBO][%4s] " msg "\n", context) #define LOG_VERBOSE(context, fmt, ...) \ @@ -65,6 +81,7 @@ typedef const char* NoDltContext; fprintf(stderr, "[WARN ][%4s] " msg "\n", context) #define LOG_WARNING(context, fmt, ...) \ fprintf(stderr, "[WARN ][%4s] " fmt "\n", context, __VA_ARGS__) +#endif #define LOG_ERROR_MSG(context, msg) \ fprintf(stderr, "[ERROR][%4s] " msg "\n", context) diff --git a/sensors-service/test/CMakeLists.txt b/sensors-service/test/CMakeLists.txt index 8b67f2a..d977016 100644 --- a/sensors-service/test/CMakeLists.txt +++ b/sensors-service/test/CMakeLists.txt @@ -13,6 +13,9 @@ # 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/. # +# Update (2014/12/02) : Philippe Colliot <philippe.colliot@mpsa.com>, +# PSA Peugeot Citroen +# - introduce debug flag to disable verbosity # @licence end@ ########################################################################### @@ -20,6 +23,7 @@ message(STATUS "SENSORS-SERVICE-CLIENT") message(STATUS "WITH_DLT = ${WITH_DLT}") message(STATUS "WITH_IPHONE = ${WITH_IPHONE}") message(STATUS "WITH_REPLAYER = ${WITH_REPLAYER}") +message(STATUS "WITH_DEBUG = ${WITH_DEBUG}") include_directories("${PROJECT_SOURCE_DIR}/api") include_directories("${PROJECT_SOURCE_DIR}/src") @@ -43,6 +47,10 @@ if(WITH_DLT) set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES}) endif() +if(WITH_DEBUG) + add_definitions("-DDEBUG_ENABLED=1") +endif() + set(SRCS ${CMAKE_SOURCE_DIR}/test/sensors-service-client.c) add_executable(sensors-service-client ${SRCS}) target_link_libraries(sensors-service-client ${LIBRARIES}) diff --git a/sensors-service/test/sensors-service-client.c b/sensors-service/test/sensors-service-client.c index c0b9b1a..beb9738 100644 --- a/sensors-service/test/sensors-service-client.c +++ b/sensors-service/test/sensors-service-client.c @@ -117,7 +117,7 @@ bool checkMajorVersion(int expectedMajor) void init() { - if(!checkMajorVersion(2)) + if(!checkMajorVersion(GENIVI_SNS_API_MAJOR)) { exit(EXIT_FAILURE); } |