From 502629ad46d67277d146b8a07c51b443121008ec Mon Sep 17 00:00:00 2001 From: Date: Mon, 8 Dec 2014 13:56:18 +0100 Subject: alignment with the latest version of the positioning interface --- src/navigation/CMakeLists.txt | 2 +- .../enhancedposition-plugin/CMakeLists.txt | 21 +----- .../genivi_positioning_enhancedposition.cxx | 44 +++---------- src/navigation/script/build.sh | 22 +++++-- src/poi-service/poi-server/CMakeLists.txt | 26 -------- src/poi-service/poi-server/poi-server-class.h | 1 - src/poi-service/script/build.sh | 35 +--------- test/poi-service/.gitignore | 2 +- test/poi-service/CMakeLists.txt | 75 ++++++++++++++++++++++ test/poi-service/poi-client/CMakeLists.txt | 2 + test/poi-service/poi-client/mainwindow.cpp | 60 ++++++----------- test/poi-service/poi-client/mainwindow.h | 8 +-- .../poi-client-DBusEnhancedPositionInterface.h | 36 +++-------- .../poi-client/poi-client-DBusRoutingInterface.h | 6 +- test/poi-service/poi-common/poi-common-types.h | 19 +++--- .../poi-service/poi-common/poi-marshal-handler.cpp | 24 ++++--- test/poi-service/poi-common/poi-marshal-handler.h | 14 ++-- test/poi-service/script/build.sh | 42 ++++++++---- 18 files changed, 197 insertions(+), 242 deletions(-) create mode 100644 test/poi-service/CMakeLists.txt diff --git a/src/navigation/CMakeLists.txt b/src/navigation/CMakeLists.txt index fb68d34..acab237 100644 --- a/src/navigation/CMakeLists.txt +++ b/src/navigation/CMakeLists.txt @@ -159,7 +159,7 @@ endif() # Check if positioning stuff with the right version has been cloned and do it if necessary # positioning_SRC_DIR is set by cmake -Dpositioning_SRC_DIR= set(positioning_URL http://git.projects.genivi.org/lbs/positioning.git) -set(positioning_VERSION fde1a780f531389d5a05e3b0486c98ad34df3dcb) +set(positioning_VERSION 98c626c1a3856f444e9441950f6500db6ae9b997) if (EXISTS ${positioning_SRC_DIR}) execute_process(COMMAND ${git_get_src_version} diff --git a/src/navigation/navigation-core/enhancedposition-plugin/CMakeLists.txt b/src/navigation/navigation-core/enhancedposition-plugin/CMakeLists.txt index 0e5a2dc..29a008b 100644 --- a/src/navigation/navigation-core/enhancedposition-plugin/CMakeLists.txt +++ b/src/navigation/navigation-core/enhancedposition-plugin/CMakeLists.txt @@ -49,28 +49,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR}/../..) include_directories(${generated_api_DIR}) +include_directories(${positioning_API}) set(genivi_positioning_enhancedposition_LIBS ${DBUS_CPP_LDFLAGS}) -message(STATUS "${positioning_API}") - -ADD_CUSTOM_COMMAND(OUTPUT ${generated_api_DIR}/genivi-positioning-enhancedposition_proxy.h - COMMAND dbusxx-xml2cpp ${positioning_API}/genivi-positioning-enhancedposition.xml --proxy=${generated_api_DIR}/genivi-positioning-enhancedposition_proxy.h - DEPENDS ${positioning_API}/genivi-positioning-enhancedposition.xml - ) - -if(NOT EXISTS ${generated_api_DIR}/genivi-positioning-constants.h) - execute_process( - OUTPUT_FILE ${generated_api_DIR}/genivi-positioning-constants.h - COMMAND xsltproc ${api_DIR}/poi-service/enum.xsl ${positioning_API}/genivi-positioning-constants.xml - ) -else() - if(${positioning_API}/genivi-positioning-constants.xml IS_NEWER_THAN ${generated_api_DIR}/genivi-positioning-constants.h) - execute_process( - OUTPUT_FILE ${generated_api_DIR}/genivi-positioning-constants.h - COMMAND xsltproc ${api_DIR}/poi-service/enum.xsl ${positioning_API}/genivi-positioning-constants.xml #use another enum.xsl for radix consistency - ) - endif() -endif() module_add_library(genivi_positioning_enhancedposition genivi_positioning_enhancedposition.cxx ${generated_api_DIR}/genivi-positioning-enhancedposition_proxy.h) diff --git a/src/navigation/navigation-core/enhancedposition-plugin/genivi_positioning_enhancedposition.cxx b/src/navigation/navigation-core/enhancedposition-plugin/genivi_positioning_enhancedposition.cxx index acd22af..1aa7f2e 100644 --- a/src/navigation/navigation-core/enhancedposition-plugin/genivi_positioning_enhancedposition.cxx +++ b/src/navigation/navigation-core/enhancedposition-plugin/genivi_positioning_enhancedposition.cxx @@ -111,45 +111,20 @@ class EnhancedPosition } void - PositionUpdate(const std::vector< uint16_t >& changedValues) + PositionUpdate(const uint64_t& changedValues) { dbg(1,"enter\n"); int i; bool position_found=false; - for (i = 0 ; i < changedValues.size() ; i++) { - if (changedValues[i] == GENIVI_ENHANCEDPOSITIONSERVICE_LATITUDE || - changedValues[i] == GENIVI_ENHANCEDPOSITIONSERVICE_LONGITUDE) { - position_found=true; - break; - } + if ((changedValues & (GENIVI_ENHANCEDPOSITIONSERVICE_LATITUDE || GENIVI_ENHANCEDPOSITIONSERVICE_LONGITUDE)) == (GENIVI_ENHANCEDPOSITIONSERVICE_LATITUDE || GENIVI_ENHANCEDPOSITIONSERVICE_LONGITUDE)) + { + position_found=true; } if (position_found && !m_priv->cb_pending) { event_add_timeout(0, 0, m_priv->cb); m_priv->cb_pending=1; } } - - void - RotationRateUpdate(const std::vector< uint16_t >& changedValues) - { - dbg(0,"enter\n"); - } - - void - AccuracyUpdate(const std::vector< uint16_t >& changedValues) - { - dbg(0,"enter\n"); - } - - void SatelliteInfoUpdate(const std::vector< uint16_t >& changedValues) - { - dbg(0,"enter\n"); - } - - void StatusUpdate(const std::vector< uint16_t >& changedValues) - { - dbg(0,"enter\n"); - } }; /** @@ -255,13 +230,11 @@ double_variant(DBus::Variant variant) static void -vehicle_process_map(struct vehicle_priv *priv, std::map< uint16_t, ::DBus::Variant >&map) +vehicle_process_map(struct vehicle_priv *priv, std::map< uint64_t, ::DBus::Variant >&map) { - std::map< uint16_t, ::DBus::Variant >::const_iterator itr; + std::map< uint64_t, ::DBus::Variant >::const_iterator itr; for(itr = map.begin(); itr != map.end(); ++itr) { switch ((*itr).first) { - case GENIVI_ENHANCEDPOSITIONSERVICE_TIMESTAMP: - break; case GENIVI_ENHANCEDPOSITIONSERVICE_LATITUDE: priv->geo.lat=double_variant((*itr).second); break; @@ -285,7 +258,10 @@ static void vehicle_enhancedposition_callback(struct vehicle_priv *priv) { dbg(1,"enter\n"); - std::map< uint16_t, ::DBus::Variant >position=priv->enhanced_position->GetPosition(); + uint64_t valuesToReturn = (GENIVI_ENHANCEDPOSITIONSERVICE_LATITUDE || GENIVI_ENHANCEDPOSITIONSERVICE_LONGITUDE || GENIVI_ENHANCEDPOSITIONSERVICE_SPEED); + std::map< uint64_t, ::DBus::Variant > position; + uint64_t timestamp; + priv->enhanced_position->GetPositionInfo(valuesToReturn,timestamp,position); vehicle_process_map(priv, position); time(&priv->fix_time); /* FIXME: Use actual value */ priv->fix_type=2; /* 3d, FIXME: Use actual value */ diff --git a/src/navigation/script/build.sh b/src/navigation/script/build.sh index 7de97cd..70baca7 100755 --- a/src/navigation/script/build.sh +++ b/src/navigation/script/build.sh @@ -53,6 +53,10 @@ target_ilm=$PWD/../$IVI_LAYER_MANAGER #by default # modify the following flags as needed: NAVIT_FLAGS='-DDISABLE_QT=1 -DSAMPLE_MAP=0 -Dvehicle/null=1 -Dgraphics/qt_qpainter=0' NAVIT_PLUGIN_FLAGS='-DWITH_DEBUG=OFF' +GNSS_SERVICE_FLAGS='-DWITH_DLT=OFF -DWITH_GPSD=OFF -DWITH_REPLAYER=ON -DWITH_TESTS=ON -DWITH_DEBUG=OFF' +SENSORS_SERVICE_FLAGS='-DWITH_DLT=OFF -DWITH_REPLAYER=ON -DWITH_IPHONE=OFF -DWITH_TESTS=ON -DWITH_DEBUG=OFF' +ENHANCED_POSITION_SERVICE_FLAGS='-DWITH_DLT=OFF -DWITH_GPSD=OFF -DWITH_REPLAYER=ON -DWITH_IPHONE=OFF -DWITH_TESTS=ON -DWITH_DEBUG=OFF' +LOG_REPLAYER_FLAGS='-DWITH_DLT=OFF -DWITH_TESTS=ON -DWITH_DEBUG=OFF' # # by default no ilm @@ -118,7 +122,8 @@ set-path() SENSORS_SERVICE_BIN_DIR=$POSITIONING_BIN_DIR/$SENSORS_SERVICE ENHANCED_POSITION_SERVICE_SRC_DIR=$POSITIONING_SRC_DIR/$ENHANCED_POSITION_SERVICE ENHANCED_POSITION_SERVICE_BIN_DIR=$POSITIONING_BIN_DIR/$ENHANCED_POSITION_SERVICE - POSITIONING_API_DIR=$POSITIONING_SRC_DIR/$ENHANCED_POSITION_SERVICE/api + ENHANCED_POSITION_SERVICE_API_DIR=$POSITIONING_SRC_DIR/$ENHANCED_POSITION_SERVICE/api + ENHANCED_POSITION_SERVICE_GENERATED_API_DIR=$ENHANCED_POSITION_SERVICE_API_DIR/include NAVIT_SRC_DIR=$TOP_DIR/$NAVIT NAVIT_BIN_DIR=$TOP_BIN_DIR/$NAVIT @@ -216,6 +221,9 @@ build() { cd $MAP_DIR cmake -DNAVIT_MAPS_DIR=$NAVIT_BIN_DIR/navit/maps ./ + echo 'Generate DBus include files for positioning' + cd $ENHANCED_POSITION_SERVICE_API_DIR + cmake . echo '' echo 'Building positioning' cd $TOP_BIN_DIR @@ -224,25 +232,25 @@ build() { cd $POSITIONING_BIN_DIR mkdir -p $GNSS_SERVICE cd $GNSS_SERVICE_BIN_DIR - cmake $GNSS_SERVICE_SRC_DIR && make + cmake $GNSS_SERVICE_FLAGS $GNSS_SERVICE_SRC_DIR && make cd $POSITIONING_BIN_DIR mkdir -p $SENSORS_SERVICE cd $SENSORS_SERVICE_BIN_DIR - cmake $SENSORS_SERVICE_SRC_DIR && make + cmake $SENSORS_SERVICE_FLAGS $SENSORS_SERVICE_SRC_DIR && make cd $POSITIONING_BIN_DIR mkdir -p $LOG_REPLAYER cd $LOG_REPLAYER_BIN_DIR - cmake $LOG_REPLAYER_SRC_DIR && make + cmake $LOG_REPLAYER_FLAGS $LOG_REPLAYER_SRC_DIR && make cd $POSITIONING_BIN_DIR mkdir -p $ENHANCED_POSITION_SERVICE cd $ENHANCED_POSITION_SERVICE_BIN_DIR - cmake -DWITH_GPSD=OFF -DWITH_DLT=OFF -DWITH_REPLAYER=ON -DWITH_TESTS=OFF $ENHANCED_POSITION_SERVICE_SRC_DIR && make + cmake $ENHANCED_POSITION_SERVICE_FLAGS $ENHANCED_POSITION_SERVICE_SRC_DIR && make echo '' - echo 'Generate DBus include files' + echo 'Generate DBus include files for navigation, mapviewer and poiservice' cd $API_DIR mkdir -p include @@ -291,7 +299,7 @@ build() { cd $NAVIGATION_CORE_BIN_DIR mkdir -p $NAVIGATION_CORE_ENHANCEDPOSITION cd $NAVIGATION_CORE_ENHANCEDPOSITION_BIN_DIR - cmake -Wno-dev -C $NAVIT_BIN_DIR/cmake_plugin_settings.txt -Dpositioning_API=$POSITIONING_API_DIR -Dapi_DIR=$API_DIR -Dgenerated_api_DIR=$GENERATED_API_DIR -Dnavit_SRC_DIR=$NAVIT_SRC_DIR $NAVIT_PLUGIN_FLAGS $NAVIGATION_CORE_ENHANCEDPOSITION_SRC_DIR && make + cmake -Wno-dev -C $NAVIT_BIN_DIR/cmake_plugin_settings.txt -Dpositioning_API=$ENHANCED_POSITION_SERVICE_GENERATED_API_DIR -Dapi_DIR=$API_DIR -Dgenerated_api_DIR=$GENERATED_API_DIR -Dnavit_SRC_DIR=$NAVIT_SRC_DIR $NAVIT_PLUGIN_FLAGS $NAVIGATION_CORE_ENHANCEDPOSITION_SRC_DIR && make cd $TOP_BIN_DIR mkdir -p $MAP_VIEWER diff --git a/src/poi-service/poi-server/CMakeLists.txt b/src/poi-service/poi-server/CMakeLists.txt index fa839dc..d2212d4 100644 --- a/src/poi-service/poi-server/CMakeLists.txt +++ b/src/poi-service/poi-server/CMakeLists.txt @@ -41,31 +41,6 @@ include_directories(${GOBJECT_INCLUDE_DIRS}) include_directories(${DBUS_INCLUDE_DIRS}) include_directories(${DBUS_CPP_GLIB_INCLUDE_DIRS}) -set (git_get_src_version git rev-parse HEAD) -set (git_executable git) -set(cmake_create_dir cmake -E make_directory) - -include_directories(${generated_api_DIR}) - -ADD_CUSTOM_COMMAND(OUTPUT ${generated_api_DIR}/genivi-positioning-enhancedposition_proxy.h - COMMAND dbusxx-xml2cpp ${positioning_API}/genivi-positioning-enhancedposition.xml --proxy=${generated_api_DIR}/genivi-positioning-enhancedposition_proxy.h - DEPENDS ${positioning_API}/genivi-positioning-enhancedposition.xml - ) - -if(NOT EXISTS ${generated_api_DIR}/genivi-positioning-constants.h) - execute_process( - OUTPUT_FILE ${generated_api_DIR}/genivi-positioning-constants.h - COMMAND xsltproc ${api_DIR}/poi-service/enum.xsl ${positioning_API}/genivi-positioning-constants.xml - ) -else() - if(${positioning_API}/genivi-positioning-constants.xml IS_NEWER_THAN ${generated_api_DIR}/genivi-positioning-constants.h) - execute_process( - OUTPUT_FILE ${generated_api_DIR}/genivi-positioning-constants.h - COMMAND xsltproc ${api_DIR}/poi-service/enum.xsl ${positioning_API}/genivi-positioning-constants.xml #use another enum.xsl for radix consistency - ) - endif() -endif() - link_directories( ${DBUS_CPP_LIBRARY_DIRS} @@ -84,7 +59,6 @@ add_executable(poi-server poi-server-class.h poi-datamodel.h ../poi-common/common-data-model.h - ${generated_api_DIR}/genivi-positioning-enhancedposition_proxy.h ) set(LIBRARIES diff --git a/src/poi-service/poi-server/poi-server-class.h b/src/poi-service/poi-server/poi-server-class.h index c792ca3..0b1877f 100644 --- a/src/poi-service/poi-server/poi-server-class.h +++ b/src/poi-service/poi-server/poi-server-class.h @@ -28,7 +28,6 @@ #ifndef POIPOCSERVERCLASS_H #define POIPOCSERVERCLASS_H -#include "../../../api/include/genivi-positioning-constants.h" #include "../../../api/include/genivi-mapviewer-constants.h" #include "../../../api/include/genivi-navigationcore-constants.h" #include "../../../api/include/genivi-poiservice-constants.h" diff --git a/src/poi-service/script/build.sh b/src/poi-service/script/build.sh index 01f6781..0fccbb6 100755 --- a/src/poi-service/script/build.sh +++ b/src/poi-service/script/build.sh @@ -21,25 +21,19 @@ POI_COMMON=poi-common NAVIGATION_CORE=navigation-core MAP_VIEWER=map-viewer POI_SERVICE=poi-service -POSITIONING=positioning -ENHANCED_POSITION_SERVICE=enhanced-position-service target_root=$PWD/.. target_bin=$PWD/../bin #by default -target_positioning=$PWD/../$POSITIONING #by default set-path() { TOP_DIR=$target_root TOP_BIN_DIR=$target_bin API_DIR=$TOP_DIR/../../api - GENERATED_API_DIR=$API_DIR/include POI_SERVER_SRC_DIR=$TOP_DIR/$POI_SERVER POI_SERVER_BIN_DIR=$TOP_BIN_DIR/$POI_SERVER POI_COMMON_SRC_DIR=$TOP_DIR/$POI_COMMON - POSITIONING_SRC_DIR=$target_positioning - POSITIONING_API_DIR=$POSITIONING_SRC_DIR/$ENHANCED_POSITION_SERVICE/api } usage() { @@ -48,8 +42,6 @@ usage() { echo "command:" echo " make Build" echo " clean Clean" - echo " src-clean Clean the cloned sources" - echo " clone Clone the sources" echo " help Print Help" echo echo @@ -59,11 +51,6 @@ build() { echo '' echo 'Building poi-server' - if [ ! -d "$POSITIONING_SRC_DIR" ]; then - echo 'Do clone first' - exit 1 - fi - echo 'Generate DBus include files' cd $API_DIR @@ -77,16 +64,7 @@ build() { cd $TOP_BIN_DIR mkdir -p $POI_SERVER cd $POI_SERVER_BIN_DIR - cmake -Dapi_DIR=$API_DIR -Dpositioning_API=$POSITIONING_API_DIR -Dgenerated_api_DIR=$GENERATED_API_DIR $POI_SERVER_SRC_DIR && make -} - -clone() { - echo '' - echo 'Clone/update version of additional sources if needed' - cd $TOP_DIR - mkdir -p bin - cd $TOP_BIN_DIR - cmake -Dpositioning_SRC_DIR=$POSITIONING_SRC_DIR $TOP_DIR + cmake -Dapi_DIR=$API_DIR -Dgenerated_api_DIR=$GENERATED_API_DIR $POI_SERVER_SRC_DIR && make } clean() { @@ -94,11 +72,6 @@ clean() { rm -rf $TOP_BIN_DIR } -src-clean() { - echo 'delete' $POSITIONING_SRC_DIR - rm -rf $POSITIONING_SRC_DIR - clean -} set -e @@ -111,12 +84,6 @@ if [ $# -ge 1 ]; then elif [ $1 = clean ]; then set-path clean - elif [ $1 = src-clean ]; then - set-path - src-clean - elif [ $1 = clone ]; then - set-path - clone else usage fi diff --git a/test/poi-service/.gitignore b/test/poi-service/.gitignore index eb4ee2a..dbdac10 100644 --- a/test/poi-service/.gitignore +++ b/test/poi-service/.gitignore @@ -5,7 +5,7 @@ *_proxy.h genivi-*.h *.user - +Makefile diff --git a/test/poi-service/CMakeLists.txt b/test/poi-service/CMakeLists.txt new file mode 100644 index 0000000..105e8b8 --- /dev/null +++ b/test/poi-service/CMakeLists.txt @@ -0,0 +1,75 @@ +########################################################################### +# @licence app begin@ +# SPDX-License-Identifier: MPL-2.0 +# +# Component Name: poi-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(poi-service) +cmake_minimum_required(VERSION 2.8) + +message(STATUS "poi-service") + +find_program(GIT git) + +set (git_get_src_version ${GIT} rev-parse HEAD) +set (git_executable ${GIT}) + +# Check if positioning stuff with the right version has been cloned and do it if necessary +# positioning_SRC_DIR is set by cmake -Dpositioning_SRC_DIR= +set(positioning_URL http://git.projects.genivi.org/lbs/positioning.git) +set(positioning_VERSION 98c626c1a3856f444e9441950f6500db6ae9b997) + +if (EXISTS ${positioning_SRC_DIR}) + execute_process(COMMAND ${git_get_src_version} + WORKING_DIRECTORY "${positioning_SRC_DIR}" + RESULT_VARIABLE result + OUTPUT_VARIABLE version) + if (${version} MATCHES ${positioning_VERSION}) + message(STATUS "version of positioning up to date") + else() + message(STATUS "get the right version of positioning") + execute_process( + COMMAND "${git_executable}" pull + COMMAND "${git_executable}" checkout ${positioning_VERSION} + WORKING_DIRECTORY "${positioning_SRC_DIR}" + RESULT_VARIABLE error_code + ) + if(error_code) + message(FATAL_ERROR "Failed to checkout version: '${positioning_VERSION}'") + endif() + endif() +else() + message(STATUS "clone positioning") + execute_process( + COMMAND "${git_executable}" clone "${positioning_URL}" "${positioning_SRC_DIR}" + RESULT_VARIABLE error_code + ) + if(error_code) + message(FATAL_ERROR "Failed to clone repository: '${positioning_URL}'") + endif() + + message(STATUS "get the right version of positioning") + execute_process( + COMMAND "${git_executable}" pull + COMMAND "${git_executable}" checkout ${positioning_VERSION} + WORKING_DIRECTORY "${positioning_SRC_DIR}" + RESULT_VARIABLE error_code + ) + if(error_code) + message(FATAL_ERROR "Failed to checkout version: '${positioning_VERSION}'") + endif() +endif() + + + diff --git a/test/poi-service/poi-client/CMakeLists.txt b/test/poi-service/poi-client/CMakeLists.txt index d900cc4..8b3a64a 100644 --- a/test/poi-service/poi-client/CMakeLists.txt +++ b/test/poi-service/poi-client/CMakeLists.txt @@ -58,6 +58,7 @@ set(API_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../api) set(TARGET_GENERATED_API_DIR ${API_DIR}/include) file(GLOB DBUS_DEF_INCLUDE ${TARGET_GENERATED_API_DIR}/*-constants.h) +include_directories(${positioning_API}) link_directories( ${QT5_CORE_LIBRARY_DIRS} @@ -186,6 +187,7 @@ add_executable(poi-client poi-client-DBusNavigationCoreSessionInterface.h poi-client-DBusContentAccessInterface.h ../poi-common/poi-marshal-handler.h + ../poi-common/poi-common-types.h ) target_link_libraries(poi-client ${LIBRARIES}) diff --git a/test/poi-service/poi-client/mainwindow.cpp b/test/poi-service/poi-client/mainwindow.cpp index 903f911..970122b 100644 --- a/test/poi-service/poi-client/mainwindow.cpp +++ b/test/poi-service/poi-client/mainwindow.cpp @@ -297,10 +297,10 @@ void MainWindow::InitUi() QObject::connect(m_dbusPoiSearchInterface, SIGNAL(ResultListChanged(uchar,ushort)), this, SLOT(on_DBusSignalResultListChanged(uchar,ushort))); QObject::connect(m_dbusPoiSearchInterface, SIGNAL(CategoriesUpdated(QList)), this, SLOT(on_DBusSignalCategoriesUpdated(QList))); - QObject::connect(m_dbusNavigationRoutingInterface, SIGNAL(RouteCalculationSuccessful(uchar,tupleUshort_t)),this,SLOT(on_DBusSignalRouteCalculationSuccessful(uchar, tupleUshort_t))); + QObject::connect(m_dbusNavigationRoutingInterface, SIGNAL(RouteCalculationSuccessful(uchar,tupleUshortUshort)),this,SLOT(on_DBusSignalRouteCalculationSuccessful(uchar, tupleUshortUshort))); QObject::connect(m_dbusNavigationRoutingInterface, SIGNAL(RouteDeleted(uchar)),this,SLOT(on_DBusSignalRouteDeleted(uchar))); - QObject::connect(m_dbusPositioningEnhancedPositionInterface, SIGNAL(PositionUpdate(QList)),this,SLOT(on_DBusSignalPositionUpdate(QList))); + QObject::connect(m_dbusPositioningEnhancedPositionInterface, SIGNAL(PositionUpdate(ulong)),this,SLOT(on_DBusSignalPositionUpdate(ulong))); // start periodic timer for position m_dbusPositioningEnhancedPositionInterface->startTimerForPosition(settingsTimerPeriodForPosition); @@ -1616,50 +1616,26 @@ void MainWindow::on_DBusSignalCategoriesUpdated(QList po * \param * \return */ -void MainWindow::on_DBusSignalPositionUpdate(QList changedValues) +void MainWindow::on_DBusSignalPositionUpdate(ulong changedValues) { - tupleVariant_t position; - tupleVariant_t satelliteInfo; - QList satelliteDetailsList; - QVariant value1; + qulonglong timestamp; + tupleUlongVariant data; - //todo management of kind of values updated - - // GetPosition - QDBusPendingReplyreply_0 = m_dbusPositioningEnhancedPositionInterface->GetPosition(); + // GetPositionInfo + QDBusPendingReplyreply_0 = m_dbusPositioningEnhancedPositionInterface->GetPositionInfo(changedValues); reply_0.waitForFinished(); if (reply_0.isError()) manageDBusError(reply_0.reply()); // call failed else { - position = reply_0.value(); - if (position.contains(GENIVI_ENHANCEDPOSITIONSERVICE_LATITUDE)) - ui->currentLocationLatitude->setText(QString::number(position.value(GENIVI_ENHANCEDPOSITIONSERVICE_LATITUDE).variant().toDouble())); - if (position.contains(GENIVI_ENHANCEDPOSITIONSERVICE_LONGITUDE)) - ui->currentLocationLongitude->setText(QString::number(position.value(GENIVI_ENHANCEDPOSITIONSERVICE_LONGITUDE).variant().toDouble())); + timestamp = qdbus_cast(reply_0.argumentAt(0)); + data = qdbus_cast(reply_0.argumentAt(1)); + if (data.contains(GENIVI_ENHANCEDPOSITIONSERVICE_LATITUDE)) + ui->currentLocationLatitude->setText(QString::number(data.value(GENIVI_ENHANCEDPOSITIONSERVICE_LATITUDE).variant().toDouble())); + if (data.contains(GENIVI_ENHANCEDPOSITIONSERVICE_LONGITUDE)) + ui->currentLocationLongitude->setText(QString::number(data.value(GENIVI_ENHANCEDPOSITIONSERVICE_LONGITUDE).variant().toDouble())); } - - // GetSatelliteInfo - QDBusPendingReplyreply_1 = m_dbusPositioningEnhancedPositionInterface->GetSatelliteInfo(); - reply_1.waitForFinished(); - if (reply_1.isError()) - manageDBusError(reply_1.reply()); // call failed - else - { - satelliteInfo = reply_1.value(); - if (satelliteInfo.contains(GENIVI_ENHANCEDPOSITIONSERVICE_VISIBLE_SATELLITES)) - { - m_satelliteAmount = satelliteInfo.value(GENIVI_ENHANCEDPOSITIONSERVICE_VISIBLE_SATELLITES).variant().toUInt(); - } - if (satelliteInfo.contains(GENIVI_ENHANCEDPOSITIONSERVICE_SATELLITE_DETAILS)) - { - value1 = satelliteInfo.value(GENIVI_ENHANCEDPOSITIONSERVICE_SATELLITE_DETAILS).variant(); - satelliteDetailsList.clear(); - value1.value() >> satelliteDetailsList; - } - } - } /** @@ -1670,7 +1646,7 @@ void MainWindow::on_DBusSignalPositionUpdate(QList changedValues) * \param QList unfullfilledPreferences * \return */ -void MainWindow::on_DBusSignalRouteCalculationSuccessful(uchar routeHandle, tupleUshort_t unfullfilledPreferences) +void MainWindow::on_DBusSignalRouteCalculationSuccessful(uchar routeHandle, tupleUshortUshort unfullfilledPreferences) { QString str; short detailLevel; @@ -1679,7 +1655,7 @@ void MainWindow::on_DBusSignalRouteCalculationSuccessful(uchar routeHandle, tupl uint offset; int index; route_vector_t routeVector; - QList routeSegments; + QList routeSegments; m_routeHandle = routeHandle; ui->searchMode->setText(tr("Along a route")); @@ -1713,7 +1689,7 @@ void MainWindow::on_DBusSignalRouteCalculationSuccessful(uchar routeHandle, tupl valuesToReturn.push_back(GENIVI_NAVIGATIONCORE_START_LONGITUDE); valuesToReturn.push_back(GENIVI_NAVIGATIONCORE_END_LONGITUDE); - QDBusPendingReply > reply_2 = m_dbusNavigationRoutingInterface->GetRouteSegments(m_routeHandle,detailLevel,valuesToReturn,numberOfSegments,offset); + QDBusPendingReply > reply_2 = m_dbusNavigationRoutingInterface->GetRouteSegments(m_routeHandle,detailLevel,valuesToReturn,numberOfSegments,offset); reply_2.waitForFinished(); if (reply_2.isError()) manageDBusError(reply_2.reply()); // call failed @@ -1725,13 +1701,13 @@ void MainWindow::on_DBusSignalRouteCalculationSuccessful(uchar routeHandle, tupl //Get the whole route numberOfSegments = m_totalNumberOfSegments; - QDBusPendingReply > reply_3 = m_dbusNavigationRoutingInterface->GetRouteSegments(m_routeHandle,detailLevel,valuesToReturn,numberOfSegments,offset); + QDBusPendingReply > reply_3 = m_dbusNavigationRoutingInterface->GetRouteSegments(m_routeHandle,detailLevel,valuesToReturn,numberOfSegments,offset); reply_3.waitForFinished(); if (reply_3.isError()) manageDBusError(reply_3.reply()); // call failed else { - routeSegments << (qdbus_cast >(reply_3.argumentAt(1))); //get the list + routeSegments << (qdbus_cast >(reply_3.argumentAt(1))); //get the list for (index=0;index #include #include -#include "../../../api/include/genivi-positioning-constants.h" +#include "../../positioning/enhanced-position-service/api/include/genivi-positioning-constants.h" #include "../../../api/include/genivi-mapviewer-constants.h" #include "../../../api/include/genivi-navigationcore-constants.h" #include "../../../api/include/genivi-poiservice-constants.h" @@ -122,9 +122,9 @@ private slots: void on_DBusSignalCategoriesUpdated(QList poiCategories); - void on_DBusSignalPositionUpdate(QList changedValues); + void on_DBusSignalPositionUpdate(ulong changedValues); - void on_DBusSignalRouteCalculationSuccessful(uchar routeHandle,tupleUshort_t unfullfilledPreferences); + void on_DBusSignalRouteCalculationSuccessful(uchar routeHandle,tupleUshortUshort unfullfilledPreferences); void on_DBusSignalRouteDeleted(uchar routeHandle); @@ -250,7 +250,7 @@ private: bool isSetProximityModeSelected; bool isSearchAroundTheVehicleSelected; - QList m_satelliteDetails; + QList m_satelliteInfo; uchar m_satelliteAmount; }; diff --git a/test/poi-service/poi-client/poi-client-DBusEnhancedPositionInterface.h b/test/poi-service/poi-client/poi-client-DBusEnhancedPositionInterface.h index b29e492..cd9e704 100644 --- a/test/poi-service/poi-client/poi-client-DBusEnhancedPositionInterface.h +++ b/test/poi-service/poi-client/poi-client-DBusEnhancedPositionInterface.h @@ -54,46 +54,26 @@ public Q_SLOTS: // METHODS return asyncCall(QLatin1String("GetVersion")); } - inline QDBusPendingReply GetData(QList valuesToReturn) - { // "aq" in "a{qv}" out + inline QDBusPendingReply GetPositionInfo(ulong valuesToReturn) + { // "t" in "t" "a{tv}" out QList argumentList; argumentList << qVariantFromValue(valuesToReturn); - return asyncCallWithArgumentList(QLatin1String("GetData"), argumentList); + return asyncCallWithArgumentList(QLatin1String("GetPositionInfo"), argumentList); } - inline QDBusPendingReply GetPosition() - { // "a{qv}" out - return asyncCall(QLatin1String("GetPosition")); - } - - inline QDBusPendingReply GetRotationRate() - { // "a{qv}" out - return asyncCall(QLatin1String("GetRotationRate")); - } - - inline QDBusPendingReply GetAccuracy() - { // "a{qv}" out - return asyncCall(QLatin1String("GetAccuracy")); - } - - inline QDBusPendingReply GetSatelliteInfo() - { // "a{qv}" out + inline QDBusPendingReply > GetSatelliteInfo() + { // "t" "a(qqqqqb)" out return asyncCall(QLatin1String("GetSatelliteInfo")); } - inline QDBusPendingReply GetStatus() - { // "a{qv}" out - return asyncCall(QLatin1String("GetStatus")); - } - - inline QDBusPendingReply GetTime() - { // "a{qv}" out + inline QDBusPendingReply GetTime() + { // "t" "a{tv}" out return asyncCall(QLatin1String("GetTime")); } void onTimerPositionTimeout() { - QDBusPendingReply reply = GetTime(); + QDBusPendingReply reply = GetTime(); reply.waitForFinished(); } diff --git a/test/poi-service/poi-client/poi-client-DBusRoutingInterface.h b/test/poi-service/poi-client/poi-client-DBusRoutingInterface.h index 71b7e3f..7246efb 100644 --- a/test/poi-service/poi-client/poi-client-DBusRoutingInterface.h +++ b/test/poi-service/poi-client/poi-client-DBusRoutingInterface.h @@ -64,11 +64,11 @@ public Q_SLOTS: // METHODS inline QDBusPendingReply GetRouteBoundingBox(uchar sessionHandle, uchar routeHandle) { // "y" "y" in "((dd)(dd))" out QList argumentList; - argumentList << qVariantFromValue(routeHandle); + argumentList << qVariantFromValue(sessionHandle) << qVariantFromValue(routeHandle); return asyncCallWithArgumentList(QLatin1String("GetRouteBoundingBox"), argumentList); } - inline QDBusPendingReply > GetRouteSegments(uchar routeHandle, short detailLevel, QList valuesToReturn, uint numberOfSegments, uint offset) + inline QDBusPendingReply > GetRouteSegments(uchar routeHandle, short detailLevel, QList valuesToReturn, uint numberOfSegments, uint offset) { // "y" "n" "aq" "u" "u" in "u" "aa{qv}" out QList argumentList; argumentList << qVariantFromValue(routeHandle) << qVariantFromValue(detailLevel) << qVariantFromValue(valuesToReturn) << qVariantFromValue(numberOfSegments) << qVariantFromValue(offset); @@ -77,7 +77,7 @@ public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS //D-Bus signals here - void RouteCalculationSuccessful(uchar,tupleUshort_t); // "y" "a{qq}" out + void RouteCalculationSuccessful(uchar,tupleUshortUshort); // "y" "a{qq}" out void RouteDeleted(uchar); // "y" out private: diff --git a/test/poi-service/poi-common/poi-common-types.h b/test/poi-service/poi-common/poi-common-types.h index 9ce012e..fa442e9 100644 --- a/test/poi-service/poi-common/poi-common-types.h +++ b/test/poi-service/poi-common/poi-common-types.h @@ -166,9 +166,11 @@ struct categoryDetailsList_t QList sortOptions; }; -typedef QMap tupleVariant_t; +typedef QMap tupleUshortVariant; -typedef QMap tupleUshort_t; +typedef QMap tupleUlongVariant; + +typedef QMap tupleUshortUshort; struct resultCamSearch_t { //(usq(ddi)qa(sqv)) @@ -210,13 +212,14 @@ struct poiCategoryCamUpdate_t QList sortOptions; }; -struct satellitedetails_t -{ //(ubuuu) - uint satId; +struct satelliteInfo_t +{ //(qqqqqb) + ushort system; + ushort satelliteId; + ushort azimuth; + ushort elevation; + ushort snr; bool inUse; - uint elevation; - uint azimuth; - uint snr; }; struct route_vector_t diff --git a/test/poi-service/poi-common/poi-marshal-handler.cpp b/test/poi-service/poi-common/poi-marshal-handler.cpp index 8cab97e..5502811 100644 --- a/test/poi-service/poi-common/poi-marshal-handler.cpp +++ b/test/poi-service/poi-common/poi-marshal-handler.cpp @@ -332,18 +332,18 @@ QDBusArgument &operator << (QDBusArgument &argument, const results_t &source) return argument; } -const QDBusArgument &operator >> (const QDBusArgument &argument,satellitedetails_t &dest) +const QDBusArgument &operator >> (const QDBusArgument &argument,satelliteInfo_t &dest) { argument.beginStructure(); - argument >> dest.satId >> dest.inUse >> dest.elevation >> dest.azimuth >> dest.snr; + argument >> dest.system >> dest.satelliteId >> dest.azimuth >> dest.elevation >> dest.snr >> dest.inUse; argument.endStructure(); return argument; } -QDBusArgument &operator << (QDBusArgument &argument, const satellitedetails_t &source) +QDBusArgument &operator << (QDBusArgument &argument, const satelliteInfo_t &source) { argument.beginStructure(); - argument << source.satId << source.inUse << source.elevation << source.azimuth << source.snr; + argument << source.system << source.satelliteId << source.azimuth << source.elevation << source.snr << source.inUse; argument.endStructure(); return argument; } @@ -501,10 +501,11 @@ void MarshalHandler::registerMetaType() qDBusRegisterMetaType >(); qDBusRegisterMetaType(); qDBusRegisterMetaType >(); - qDBusRegisterMetaType(); - qDBusRegisterMetaType >(); - qDBusRegisterMetaType(); - qDBusRegisterMetaType >(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType >(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType >(); + qDBusRegisterMetaType(); qDBusRegisterMetaType(); qDBusRegisterMetaType >(); qDBusRegisterMetaType(); @@ -516,7 +517,6 @@ void MarshalHandler::registerMetaType() qDBusRegisterMetaType >(); qDBusRegisterMetaType(); qDBusRegisterMetaType >(); - qRegisterMetaType(); qRegisterMetaType >(); qRegisterMetaType(); @@ -551,10 +551,8 @@ void MarshalHandler::registerMetaType() qRegisterMetaType >(); qRegisterMetaType(); qRegisterMetaType >(); - qRegisterMetaType(); - qRegisterMetaType >(); - qRegisterMetaType(); - qRegisterMetaType >(); + qRegisterMetaType(); + qRegisterMetaType >(); qRegisterMetaType(); qRegisterMetaType >(); qRegisterMetaType(); diff --git a/test/poi-service/poi-common/poi-marshal-handler.h b/test/poi-service/poi-common/poi-marshal-handler.h index a7f4682..6a5a1a5 100644 --- a/test/poi-service/poi-common/poi-marshal-handler.h +++ b/test/poi-service/poi-common/poi-marshal-handler.h @@ -128,9 +128,9 @@ Q_DECLARE_METATYPE(categoryDetailsList_t) const QDBusArgument &operator >> (const QDBusArgument &argument,categoryDetailsList_t &dest); QDBusArgument &operator << (QDBusArgument &argument, const categoryDetailsList_t &source); Q_DECLARE_METATYPE(QList) -Q_DECLARE_METATYPE(tupleVariant_t) -Q_DECLARE_METATYPE(QList) -Q_DECLARE_METATYPE(tupleUshort_t) +Q_DECLARE_METATYPE(tupleUshortVariant) +Q_DECLARE_METATYPE(tupleUlongVariant) +Q_DECLARE_METATYPE(tupleUshortUshort) Q_DECLARE_METATYPE(resultCamSearch_t) const QDBusArgument &operator >> (const QDBusArgument &argument,resultCamSearch_t &dest); QDBusArgument &operator << (QDBusArgument &argument, const resultCamSearch_t &source); @@ -150,9 +150,9 @@ Q_DECLARE_METATYPE(poiCategoryCamUpdate_t) const QDBusArgument &operator >> (const QDBusArgument &argument,poiCategoryCamUpdate_t &dest); QDBusArgument &operator << (QDBusArgument &argument, const poiCategoryCamUpdate_t &source); Q_DECLARE_METATYPE(QList) -Q_DECLARE_METATYPE(satellitedetails_t) -const QDBusArgument &operator >> (const QDBusArgument &argument,satellitedetails_t &dest); -QDBusArgument &operator << (QDBusArgument &argument, const satellitedetails_t &source); -Q_DECLARE_METATYPE(QList) +Q_DECLARE_METATYPE(satelliteInfo_t) +const QDBusArgument &operator >> (const QDBusArgument &argument,satelliteInfo_t &dest); +QDBusArgument &operator << (QDBusArgument &argument, const satelliteInfo_t &source); +Q_DECLARE_METATYPE(QList) #endif // MARSHALHANDLER_H diff --git a/test/poi-service/script/build.sh b/test/poi-service/script/build.sh index e143039..9f348b9 100755 --- a/test/poi-service/script/build.sh +++ b/test/poi-service/script/build.sh @@ -48,6 +48,14 @@ NAVIGATION_CORE=navigation-core MAP_VIEWER=map-viewer POI_SERVICE=poi-service +POSITIONING=positioning +target_positioning=$PWD/../$POSITIONING #by default +POSITIONING_SRC_DIR=$target_positioning +ENHANCED_POSITION_SERVICE=enhanced-position-service +ENHANCED_POSITION_SERVICE_API_DIR=$POSITIONING_SRC_DIR/$ENHANCED_POSITION_SERVICE/api +ENHANCED_POSITION_SERVICE_GENERATED_API_DIR=$ENHANCED_POSITION_SERVICE_API_DIR/include + + #-------------------------------------------------------------------------- # Compiler Flags #-------------------------------------------------------------------------- @@ -56,33 +64,43 @@ POI_SERVICE=poi-service #-------------------------------------------------------------------------- usage() { - echo "Usage: ./build.sh Build poi-service" - echo " or: ./build.sh [command]" + echo "Usage: ./build.sh [command]" echo echo "command:" echo " make Build" echo " clean Clean" echo " src-clean Clean the cloned sources" + echo " clone Clone the sources" echo " help Print Help" echo echo } +clone() { + echo '' + echo 'Clone/update version of additional sources if needed' + cd $TOP_DIR + cmake -Dpositioning_SRC_DIR=$target_positioning $TOP_DIR +} + build() { echo '' echo 'Building poi-service' - echo 'Generate DBus include files' - + echo 'Generate DBus include files for navigation, mapviewer and poiservice' cd $API_DIR mkdir -p include cmake $API_DIR/$NAVIGATION_CORE cmake $API_DIR/$MAP_VIEWER cmake $API_DIR/$POI_SERVICE + echo 'Generate DBus include files for positioning' + cd $ENHANCED_POSITION_SERVICE_API_DIR + cmake . + + cd echo 'Check and build poi-server if needed' cd $POI_SERVER_SCRIPT_DIR - bash $POI_SERVER_BUILD_SCRIPT clone bash $POI_SERVER_BUILD_SCRIPT make cd $TOP_DIR @@ -91,7 +109,7 @@ build() { cd $TOP_BIN_DIR mkdir -p $POI_CLIENT cd $POI_CLIENT_BIN_DIR - cmake $POI_CLIENT_SRC_DIR && make + cmake -Dpositioning_API=$ENHANCED_POSITION_SERVICE_GENERATED_API_DIR $POI_CLIENT_SRC_DIR && make cd $TOP_BIN_DIR mkdir -p $POI_SUPPLIER @@ -114,11 +132,9 @@ clean() { } src-clean() { - cd $POI_SERVER_SCRIPT_DIR && bash $POI_SERVER_BUILD_SCRIPT src-clean - echo 'delete' $TOP_BIN_DIR - rm -rf $TOP_BIN_DIR - echo 'delete qm generated files' - rm -f $POI_COMMON_SRC_DIR/*.qm + echo 'delete' $POSITIONING_SRC_DIR + rm -rf $POSITIONING_SRC_DIR + clean } @@ -133,11 +149,11 @@ if [ $# -ge 1 ]; then clean elif [ $1 = src-clean ]; then src-clean + elif [ $1 = clone ]; then + clone else usage fi -elif [ $# -eq 0 ]; then - build else usage fi -- cgit v1.2.1