diff options
author | Marco Residori <marco.residori@xse.de> | 2015-04-28 15:14:50 +0200 |
---|---|---|
committer | Marco Residori <marco.residori@xse.de> | 2015-04-28 15:14:50 +0200 |
commit | 7252ca8518ef58c11dc667af94ff11e4b0b5aeea (patch) | |
tree | 9e2e6bbb3e2370893ecadca936b4cee876dd07a5 | |
parent | 878d529e3c9e11977025444158ccc1d5ce5fefdf (diff) | |
download | positioning-7252ca8518ef58c11dc667af94ff11e4b0b5aeea.tar.gz |
GT-3171 - Implement a new version of the EnhancedPositionService PoC with CommonAPI interface (first draft)
93 files changed, 6120 insertions, 42 deletions
@@ -13,7 +13,7 @@ The Positioning repository is a collection of 4 proofs of concept: Directory Structure =============================== -enhanced-position-service //enhanced-position-service PoC +enhanced-position-service //enhanced-position-service PoCs (1) dbus-service and 2) commonapi-service) gnss-service //gnss-service PoC log-replayer //log-replayer-PoC sensors-service //sensors-service PoC @@ -83,7 +83,7 @@ value of GNSS_SERVICE_FLAGS in the file build-all.sh as follows: GNSS_SERVICE_FLAGS='-DWITH_DLT=ON' --------- -Notes +Notes & Dependencies --------- DWITH_GPSD=ON requires that the package 'gpsd' is installed. @@ -91,10 +91,13 @@ To install 'gpsd', please execute the following commands: sudo apt-get install gpsd sudo apt-get install libgps-dev -To test the enhanced-positon-service the package 'libdbus-c++-dev' must be installed. +To test the enhanced-positon-service (dbus-service) the package 'libdbus-c++-dev' must be installed. To install 'libdbus-c++-dev', please execute the following command: sudo apt-get install libdbus-c++-dev +To test the enhanced-positon-service (commonapi-service) CommonAPI must be installed. +To install CommonAPI, please see http://git.projects.genivi.org/?p=ipc/common-api-runtime.git;a=blob;f=README + DWITH_TESTS=ON enables the compilation of the test application(s). DWITH_DLT=ON requires that the DLT-daemon is installed. diff --git a/build-all.sh b/build-all.sh index fb3e2a7..0d54be6 100755 --- a/build-all.sh +++ b/build-all.sh @@ -36,13 +36,14 @@ 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 +ENHANCED_POSITION_SERVICE_DBUS_SRC_DIR=$TOP_SRC_DIR/enhanced-position-service/dbus-service +ENHANCED_POSITION_SERVICE_COMMONAPI_SRC_DIR=$TOP_SRC_DIR/enhanced-position-service/commonapi-service LOG_REPLAYER_SRC_DIR=$TOP_SRC_DIR/log-replayer GNSS_SERVICE_BIN_DIR=$TOP_BIN_DIR/gnss-service SENSORS_SERVICE_BIN_DIR=$TOP_BIN_DIR/sensors-service -ENHANCED_POSITION_SERVICE_BIN_DIR=$TOP_BIN_DIR/enhanced-position-service +ENHANCED_POSITION_SERVICE_DBUS_BIN_DIR=$TOP_BIN_DIR/enhanced-position-service/dbus-service +ENHANCED_POSITION_SERVICE_COMMONAPI_BIN_DIR=$TOP_BIN_DIR/enhanced-position-service/commonapi-service LOG_REPLAYER_BIN_DIR=$TOP_BIN_DIR/log-replayer usage() { @@ -57,7 +58,7 @@ usage() { echo "service:" echo " gnss Test GNSSService" echo " sns Test SensorsService" - echo " enhpos Test EnhancedPositionService" + echo " enhpos Test EnhancedPositionServiceDBus" echo " repl Test LogReplayer" echo } @@ -80,21 +81,21 @@ buildSensorsService() { buildEnhancedPositionService() { echo '' - echo 'Building EnhancedPositionService ->' $SENSORS_SERVICE_SRC_DIR - mkdir -p $ENHANCED_POSITION_SERVICE_BIN_DIR - cd $ENHANCED_POSITION_SERVICE_BIN_DIR - cmake $ENHANCED_POSITION_SERVICE_FLAGS $ENHANCED_POSITION_SERVICE_SRC_DIR && make + echo 'Building EnhancedPositionService (D-Bus) ->' $SENSORS_SERVICE_SRC_DIR + mkdir -p $ENHANCED_POSITION_SERVICE_DBUS_BIN_DIR + cd $ENHANCED_POSITION_SERVICE_DBUS_BIN_DIR + cmake $ENHANCED_POSITION_SERVICE_FLAGS $ENHANCED_POSITION_SERVICE_DBUS_SRC_DIR && make + + echo '' + echo 'Building EnhancedPositionService (CommonAPI) ->' $SENSORS_SERVICE_SRC_DIR + mkdir -p $ENHANCED_POSITION_SERVICE_COMMONAPI_BIN_DIR + cd $ENHANCED_POSITION_SERVICE_COMMONAPI_BIN_DIR + cmake $ENHANCED_POSITION_SERVICE_FLAGS $ENHANCED_POSITION_SERVICE_COMMONAPI_SRC_DIR && make } 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 @@ -135,7 +136,8 @@ if [ $# -ge 1 ]; then elif [ "$2" = "sns" ]; then rm -rf $SENSORS_SERVICE_BIN_DIR elif [ "$2" = "enhpos" ]; then - rm -rf $ENHANCED_POSITION_SERVICE_BIN_DIR + rm -rf $ENHANCED_POSITION_SERVICE_DBUS_BIN_DIR + rm -rf $ENHANCED_POSITION_SERVICE_COMMONAPI_BIN_DIR elif [ "$2" = "repl" ]; then rm -rf $LOG_REPLAYER_BIN_DIR fi diff --git a/enhanced-position-service/FindDLT.cmake b/enhanced-position-service/FindDLT.cmake deleted file mode 100644 index 032eeff..0000000 --- a/enhanced-position-service/FindDLT.cmake +++ /dev/null @@ -1,12 +0,0 @@ -set(DLT_INCLUDE_DIRS /usr/include/dlt) -set(DLT_LIBRARIES dlt) -set(DLT_LIBRARY_DIRS /usr/lib) - -find_package(PkgConfig) -pkg_check_modules(DLT REQUIRED automotive-dlt) - -if(${DLT_FOUND}) - #message(STATUS "found and use automotive-dlt: version ${DLT_VERSION}") -else() - message("missing DLT - check with 'pkg-config automotive-dlt --cflags-only-I'") -endif() diff --git a/enhanced-position-service/commonapi-service/CMakeLists.txt b/enhanced-position-service/commonapi-service/CMakeLists.txt new file mode 100644 index 0000000..e8d7f1b --- /dev/null +++ b/enhanced-position-service/commonapi-service/CMakeLists.txt @@ -0,0 +1,67 @@ +########################################################################### +# @licence app begin@ +# SPDX-License-Identifier: MPL-2.0 +# +# Component Name: EnhancedPositionService +# +# Author: Marco Residori +# +# Copyright (C) 2014, XS Embedded GmbH +# +# License: +# This Source Code Form is subject to the terms of the +# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +# this file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# Update (2014/12/02) : Philippe Colliot <philippe.colliot@mpsa.com>, +# PSA Peugeot Citroen +# - introduce debug flag to disable verbosity +# @licence end@ +########################################################################### + +project(enhanced-position-service-commonapi) +cmake_minimum_required(VERSION 2.6.0) + +option(WITH_DLT + "Enable DLT logging" OFF) + +option(WITH_GPSD + "Use GPSD as source of GPS data" OFF) + +option(WITH_REPLAYER + "Use REPLAYER as source of GPS data" ON) + +option(WITH_TESTS + "Compile test applications" OFF) + +option(WITH_DEBUG + "Enable the debug messages" OFF) + +set(gnss-service_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/../../gnss-service/api") +set(gnss-service_LIBRARY_DIRS "${PROJECT_BINARY_DIR}/../../gnss-service/src") + +if(WITH_GPSD) + set(gnss-service_LIBRARIES "gnss-service-use-gpsd") +elseif(WITH_REPLAYER) + set(gnss-service_LIBRARIES "gnss-service-use-replayer") +else() + message(STATUS "Invalid cmake options!") +endif() + +set(sensors-service_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/../../sensors-service/api") +set(sensors-service_LIBRARY_DIRS "${PROJECT_BINARY_DIR}/../../sensors-service/src") + +if(WITH_IPHONE) + set(sensors-service_LIBRARIES "sensors-service-use-iphone") +elseif(WITH_REPLAYER) + set(sensors-service_LIBRARIES "sensors-service-use-replayer") +else() + message(STATUS "Invalid cmake options!") +endif() + +include_directories(src test ${gnss-service_INCLUDE_DIRS} ${sensors-service_INCLUDE_DIRS}) + +#add_subdirectory(api) +add_subdirectory(src) + + diff --git a/enhanced-position-service/api/.gitignore b/enhanced-position-service/commonapi-service/api/.gitignore index c52045f..c52045f 100644 --- a/enhanced-position-service/api/.gitignore +++ b/enhanced-position-service/commonapi-service/api/.gitignore diff --git a/enhanced-position-service/api/franca/Configuration.fidl b/enhanced-position-service/commonapi-service/api/Configuration.fidl index cc3ae71..cc3ae71 100755 --- a/enhanced-position-service/api/franca/Configuration.fidl +++ b/enhanced-position-service/commonapi-service/api/Configuration.fidl diff --git a/enhanced-position-service/api/franca/EnhancedPosition.fidl b/enhanced-position-service/commonapi-service/api/EnhancedPosition.fidl index 342b072..4a991e7 100755 --- a/enhanced-position-service/api/franca/EnhancedPosition.fidl +++ b/enhanced-position-service/commonapi-service/api/EnhancedPosition.fidl @@ -67,7 +67,7 @@ interface EnhancedPosition { }
}
- <** @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 **>
+ <** @description : PositionUpdate = This signal is called to notify a client application of a position change. The update frequency is implementation specific. The maximal allowed frequency is 10Hz **>
broadcast PositionUpdate {
out {
<** @description : valuesToReturn = Bitmask obtained as result of a bitwise OR operation on the keys corresponding to the values that changed **>
diff --git a/enhanced-position-service/api/franca/EnhancedPositionServiceTypes.fidl b/enhanced-position-service/commonapi-service/api/EnhancedPositionServiceTypes.fidl index 2c9566d..2c9566d 100755 --- a/enhanced-position-service/api/franca/EnhancedPositionServiceTypes.fidl +++ b/enhanced-position-service/commonapi-service/api/EnhancedPositionServiceTypes.fidl diff --git a/enhanced-position-service/api/franca/PositionFeedback.fidl b/enhanced-position-service/commonapi-service/api/PositionFeedback.fidl index bab31a4..bab31a4 100755 --- a/enhanced-position-service/api/franca/PositionFeedback.fidl +++ b/enhanced-position-service/commonapi-service/api/PositionFeedback.fidl diff --git a/enhanced-position-service/api/franca/README b/enhanced-position-service/commonapi-service/api/README index 8ed41bb..e5c9498 100755..100644 --- a/enhanced-position-service/api/franca/README +++ b/enhanced-position-service/commonapi-service/api/README @@ -2,8 +2,7 @@ IMPORTANT NOTE --------------------------------------------------------------------------------------------------------------------------------- -Please note that the Franca intarfaces described in this folder (*.fidl) are still a draft. - +Please note that the Franca interfaces described in the current folder (*.fidl) are still a draft. The conversion of the D-Bus interfaces into Franca interfaces have not been completed yet. -The official GENIVI interfaces of the EnhancedPositionService are those defined in the D-Bus XML files contained in the folder 'api'! +The official GENIVI interfaces of the EnhancedPositionService are those defined in the D-Bus XML files contained in the folder 'api' inside of 'dbus-service' diff --git a/enhanced-position-service/commonapi-service/src/CMakeLists.txt b/enhanced-position-service/commonapi-service/src/CMakeLists.txt new file mode 100755 index 0000000..bc0dbc8 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/CMakeLists.txt @@ -0,0 +1,112 @@ +# Copyright (C) 2014 BMW Group +# Author: Manfred Bathelt (manfred.bathelt@bmw.de) +# Author: Juergen Gehring (juergen.gehring@bmw.de) +# Author: Marco Residori (marco_residori@mentor.com) +# 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/. + +cmake_minimum_required(VERSION 2.8) +find_package(PkgConfig REQUIRED) + +# Project settings +set(PROJECT_NAME EnhancedPosition) + +project(${PROJECT_NAME}) +set(CMAKE_VERBOSE_MAKEFILE on) +set(CMAKE_CXX_FLAGS "-Wall -std=c++0x") +set(CMAKE_BUILD_TYPE Debug) + +message(STATUS) +message(STATUS "---------------------------------------------------------") +message(STATUS "ENHANCED-POSITION-SERVICE-COMMON-API") +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}") + +set(DBUS_LIB_PATH /usr/lib) +# DBus Path +if (DBUS_LIB_PATH) + message(STATUS "DBUS_LIB_PATH = " ${DBUS_LIB_PATH}) +else() + message(FATAL_ERROR "Please specify the path to your patched DBus library using -D DBUS_LIB_PATH=yourPath") +endif() + +# CommonAPI +include(FindPkgConfig) +pkg_check_modules (DBUS "dbus-1 >= 1.4") +pkg_check_modules (COMMONAPI "CommonAPI >= 2.1") +pkg_check_modules (COMMONAPI_DBUS "CommonAPI-DBus >= 2.1") + +# Source Files +set(PRJ_SRC_PATH .) +set(PRJ_SRC_GEN_PATH gen/org/genivi/EnhancedPositionService) + +set(PRJ_NAME_CLIENT ${PROJECT_NAME}Client) +set(PRJ_NAME_SERVICE ${PROJECT_NAME}Service) + +STRING(REGEX REPLACE "^e" "E" PRJ_DATA_IMPL "${PRJ_NAME}") +FILE(GLOB PRJ_PROXY_GEN_SRCS ${PRJ_SRC_GEN_PATH}/*Proxy.cpp ${PRJ_SRC_GEN_PATH}/*Types.cpp ${PRJ_SRC_GEN_PATH}/${PRJ_DATA_IMPL}.cpp) +FILE(GLOB PRJ_STUB_GEN_SRCS ${PRJ_SRC_GEN_PATH}/*Stub*.cpp ${PRJ_SRC_GEN_PATH}/*Types.cpp ${PRJ_SRC_GEN_PATH}/${PRJ_DATA_IMPL}.cpp) +FILE(GLOB PRJ_STUB_IMPL_SRCS ${PRJ_SRC_PATH}/*Stub*.cpp) + +set(PRJ_CLIENT_SRCS ${PRJ_SRC_PATH}/${PRJ_NAME_CLIENT}.cpp ${PRJ_PROXY_GEN_SRCS}) +set(PRJ_SERVICE_SRCS ${PRJ_SRC_PATH}/${PRJ_NAME_SERVICE}.cpp ${PRJ_STUB_GEN_SRCS} ${PRJ_STUB_IMPL_SRCS}) + +message(STATUS "PRJ_SRC_PATH = " ${PRJ_SRC_PATH}) +message(STATUS "PRJ_SRC_GEN_PATH = " ${PRJ_SRC_GEN_PATH}) + +# Paths +message(STATUS "COMMONAPI_INCLUDEDIR = " ${COMMONAPI_INCLUDEDIR}) +message(STATUS "COMMONAPI_DBUS_INCLUDEDIR = " ${COMMONAPI_DBUS_INCLUDEDIR}) +message(STATUS "PRJ_CLIENT_SRCS = " ${PRJ_CLIENT_SRCS}) +message(STATUS "PRJ_SERVICE_SRCS = " ${PRJ_SERVICE_SRCS}) + +include_directories( + gen + ${DBUS_INCLUDE_DIRS} + ${COMMONAPI_INCLUDEDIR}/CommonAPI-2.1 + ${COMMONAPI_DBUS_INCLUDEDIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${gnss-service_INCLUDE_DIRS} + ${sensors-service_INCLUDE_DIRS} +) + +link_directories( + ${DBUS_LIB_PATH} + ${gnss-service_LIBRARY_DIRS} + ${sensors-service_LIBRARY_DIRS} + ${COMMONAPI_LIBDIR} + ${COMMONAPI_DBUS_LIBDIR} +) + +set(LIBRARIES + ${DBUS_CPP_LIBRARIES} + ${gnss-service_LIBRARIES} + ${sensors-service_LIBRARIES} +) + +if(WITH_DLT) + add_definitions("-DDLT_ENABLED=1") + set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/..") + find_package(DLT REQUIRED) + include_directories( ${DLT_INCLUDE_DIRS} ) + set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES}) +endif() + +if(WITH_DEBUG) + add_definitions("-DDEBUG_ENABLED=1") +endif() + +# Build Client +add_executable(${PRJ_NAME_CLIENT} ${PRJ_CLIENT_SRCS}) +target_link_libraries(${PRJ_NAME_CLIENT} ${LIBRARIES} CommonAPI CommonAPI-DBus) + +# Build service +add_executable(${PRJ_NAME_SERVICE} ${PRJ_SERVICE_SRCS}) +target_link_libraries(${PRJ_NAME_SERVICE} ${LIBRARIES} CommonAPI CommonAPI-DBus) + + + diff --git a/enhanced-position-service/commonapi-service/src/ConfigurationStubImpl.cpp b/enhanced-position-service/commonapi-service/src/ConfigurationStubImpl.cpp new file mode 100644 index 0000000..130e2b7 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/ConfigurationStubImpl.cpp @@ -0,0 +1,63 @@ +/************************************************************************** +* @licence app begin@ +* +* SPDX-License-Identifier: MPL-2.0 +* +* \ingroup EnhancedPositionService +* \author Marco Residori <marco.residori@xse.de> +* +* \copyright Copyright (C) 2014, XS Embedded GmbH +* +* \license +* This Source Code Form is subject to the terms of the +* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +* this file, You can obtain one at http://mozilla.org/MPL/2.0/. +* +* @licence end@ +**************************************************************************/ + +#include "ConfigurationStubImpl.h" +#include "log.h" + +//Configuration-interface version +#define VER_MAJOR 3 +#define VER_MINOR 0 +#define VER_MICRO 0 +#define VER_DATE "05-08-2014" + +DLT_IMPORT_CONTEXT(gCtx); + +using namespace org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes; + +ConfigurationStubImpl::ConfigurationStubImpl() { + setUpdateIntervalAttribute(1000); //set default time interval + setSatSystemAttribute(SatelliteSystem::GALILEO); //set default GNSS system +} + +ConfigurationStubImpl::~ConfigurationStubImpl() { +} + +void ConfigurationStubImpl::GetVersion(EnhancedPositionServiceTypes::Version& version) { + LOG_INFO_MSG(gCtx,"GetVersion"); + + version.maj = VER_MAJOR; + version.min = VER_MINOR; + version.mic = VER_MICRO; + version.date = std::string(VER_DATE); +} + +void ConfigurationStubImpl::run() +{ + LOG_INFO_MSG(gCtx,"Starting Configuration dispatcher..."); + setUpdateIntervalAttribute(1000); //set default time interval + setSatSystemAttribute(SatelliteSystem::GALILEO); //set default GNSS system +} + +void ConfigurationStubImpl::shutdown() +{ + LOG_INFO_MSG(gCtx,"Shutting down Configuration dispatcher..."); +} + + + + diff --git a/enhanced-position-service/commonapi-service/src/ConfigurationStubImpl.h b/enhanced-position-service/commonapi-service/src/ConfigurationStubImpl.h new file mode 100644 index 0000000..355df98 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/ConfigurationStubImpl.h @@ -0,0 +1,39 @@ +/************************************************************************** +* @licence app begin@ +* +* SPDX-License-Identifier: MPL-2.0 +* +* \ingroup EnhancedPositionService +* \author Marco Residori <marco.residori@xse.de> +* +* \copyright Copyright (C) 2014, XS Embedded GmbH +* +* \license +* This Source Code Form is subject to the terms of the +* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +* this file, You can obtain one at http://mozilla.org/MPL/2.0/. +* +* @licence end@ +**************************************************************************/ + +#ifndef CONFIGURATIONSTUBIMPL_H_ +#define CONFIGURATIONSTUBIMPL_H_ + +#include <CommonAPI/CommonAPI.h> +#include <org/genivi/EnhancedPositionService/ConfigurationStubDefault.h> + +using namespace org::genivi::EnhancedPositionService; + +class ConfigurationStubImpl: public ConfigurationStubDefault { + +public: + ConfigurationStubImpl(); + virtual ~ConfigurationStubImpl(); + void GetVersion(EnhancedPositionServiceTypes::Version& version); + void run(); + void shutdown(); +}; + +#endif /* CONFIGURATIONSTUBIMPL_H_ */ + + diff --git a/enhanced-position-service/commonapi-service/src/EnhancedPositionClient.cpp b/enhanced-position-service/commonapi-service/src/EnhancedPositionClient.cpp new file mode 100755 index 0000000..fb1c12e --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/EnhancedPositionClient.cpp @@ -0,0 +1,91 @@ +/* Copyright (C) 2014 Mentor Graphics + * Author: Marco Residori(marco_residori@mentor.com) + * 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/. */ + +#include <CommonAPI/CommonAPI.h> +#include <org/genivi/EnhancedPositionService/EnhancedPositionProxy.h> +#include "log.h" + +DLT_DECLARE_CONTEXT(gCtx); + +using namespace org::genivi::EnhancedPositionService; +using namespace org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes; + +void getPositionInfoAsyncCallback(const CommonAPI::CallStatus& callStatus, const EnhancedPositionServiceTypes::Timestamp& timestamp, const EnhancedPositionServiceTypes::PositionInfo& posInfo) +{ + if (callStatus != CommonAPI::CallStatus::SUCCESS) { + LOG_ERROR_MSG(gCtx,"Remote call failed!\n"); + return; + } + + for ( auto it = posInfo.begin(); it != posInfo.end(); ++it ) { + if (it->first == PositionInfoKey::LATITUDE) + { + LOG_INFO(gCtx,"LAT=%lf", it->second.get<double>()); + } + if (it->first == PositionInfoKey::LONGITUDE) + { + LOG_INFO(gCtx,"LON=%lf", it->second.get<double>()); + } + if (it->first == PositionInfoKey::ALTITUDE) + { + LOG_INFO(gCtx,"ALT=%lf", it->second.get<float>()); + } + if (it->first == PositionInfoKey::SPEED) + { + LOG_INFO(gCtx,"SPEED=%lf", it->second.get<float>()); + } + if (it->first == PositionInfoKey::CLIMB) + { + LOG_INFO(gCtx,"CLIMB=%lf", it->second.get<float>()); + } + if (it->first == PositionInfoKey::HEADING) + { + LOG_INFO(gCtx,"HEADING=%lf", it->second.get<float>()); + } + } +} + +void positionUpdate(std::shared_ptr<EnhancedPositionProxyDefault> proxy, const EnhancedPositionServiceTypes::Bitmask& changedValues) +{ + LOG_INFO_MSG(gCtx,"Position Update"); + + if(proxy == NULL) + { + LOG_ERROR_MSG(gCtx,"Null pointer!"); + return; + } + + std::function<void(const CommonAPI::CallStatus&, + const EnhancedPositionServiceTypes::Timestamp&, + const EnhancedPositionServiceTypes::PositionInfo&)> fcb = getPositionInfoAsyncCallback; + + proxy->GetPositionInfoAsync(changedValues,getPositionInfoAsyncCallback); + +} + +int main() { + std::shared_ptr < CommonAPI::Runtime > runtime = CommonAPI::Runtime::load(); + std::shared_ptr < CommonAPI::Factory > factory = runtime->createFactory(); + + const std::string& serviceAddress = "local:org.genivi.positioning.EnhancedPosition:org.genivi.positioning.EnhancedPosition"; + std::shared_ptr<EnhancedPositionProxyDefault> myProxy = factory->buildProxy<EnhancedPositionProxy>(serviceAddress); + + LOG_INFO_MSG(gCtx,"EnhancedPositionClient"); + + while (!myProxy->isAvailable()) { + usleep(10); + } + + myProxy->getPositionUpdateEvent().subscribe([&](const EnhancedPositionServiceTypes::Bitmask& changedValues) { + positionUpdate(myProxy, changedValues); + }); + + while (true) { + std::this_thread::sleep_for(std::chrono::seconds(5)); + } + + return 0; +} diff --git a/enhanced-position-service/commonapi-service/src/EnhancedPositionService.cpp b/enhanced-position-service/commonapi-service/src/EnhancedPositionService.cpp new file mode 100755 index 0000000..ec4f1a0 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/EnhancedPositionService.cpp @@ -0,0 +1,56 @@ +/* Copyright (C) 2014 Mentor Graphics + * Author: Marco Residori(marco_residori@mentor.com) + * 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/. */ + +#include <thread> +#include <CommonAPI/CommonAPI.h> +#include "EnhancedPositionStubImpl.h" +#include "PositionFeedbackStubImpl.h" +#include "ConfigurationStubImpl.h" +#include "log.h" + +DLT_DECLARE_CONTEXT(gCtx); + +using namespace std; + +int main() { + DLT_REGISTER_APP("ENHP","ENHANCED_POSITION-SERVICE"); + DLT_REGISTER_CONTEXT(gCtx,"ENHP","Global Context"); + + std::shared_ptr<CommonAPI::Runtime> runtime = CommonAPI::Runtime::load(); + std::shared_ptr<CommonAPI::Factory> factory = runtime->createFactory(); + std::shared_ptr<CommonAPI::ServicePublisher> servicePublisher = runtime->getServicePublisher(); + + const std::string& serviceEnhancedPositionAddress = "local:org.genivi.positioning.EnhancedPosition:org.genivi.positioning.EnhancedPosition"; + std::shared_ptr<EnhancedPositionStubImpl> myServiceEnhancedPosition = std::make_shared<EnhancedPositionStubImpl>(); + servicePublisher->registerService(myServiceEnhancedPosition, serviceEnhancedPositionAddress, factory); + myServiceEnhancedPosition->run(); + + const std::string& servicePositionFeedbackAddress = "local:org.genivi.positioning.PositionFeedback:org.genivi.positioning.PositionFeedback"; + std::shared_ptr<PositionFeedbackStubImpl> myServicePositionFeedback = std::make_shared<PositionFeedbackStubImpl>(); + servicePublisher->registerService(myServicePositionFeedback, servicePositionFeedbackAddress, factory); + myServicePositionFeedback->run(); + + const std::string& serviceConfigurationAddress = "local:org.genivi.positioning.Configuration:org.genivi.positioning.Configuration"; + std::shared_ptr<ConfigurationStubImpl> myServiceConfiguration = std::make_shared<ConfigurationStubImpl>(); + servicePublisher->registerService(myServiceConfiguration, serviceConfigurationAddress, factory); + myServiceConfiguration->run(); + + while (true) { + LOG_INFO_MSG(gCtx,"Waiting for calls... (Abort with CTRL+C)"); + std::this_thread::sleep_for(std::chrono::seconds(60)); + } + + myServiceEnhancedPosition->shutdown(); + myServicePositionFeedback->shutdown(); + myServiceConfiguration->shutdown(); + + return 0; +} + + + + + diff --git a/enhanced-position-service/commonapi-service/src/EnhancedPositionStubImpl.cpp b/enhanced-position-service/commonapi-service/src/EnhancedPositionStubImpl.cpp new file mode 100644 index 0000000..689685a --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/EnhancedPositionStubImpl.cpp @@ -0,0 +1,381 @@ +/************************************************************************** +* @licence app begin@ +* +* SPDX-License-Identifier: MPL-2.0 +* +* \ingroup EnhancedPositionService +* \author Marco Residori <marco.residori@xse.de> +* +* \copyright Copyright (C) 2015, XS Embedded GmbH +* +* \license +* This Source Code Form is subject to the terms of the +* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +* this file, You can obtain one at http://mozilla.org/MPL/2.0/. +* +* @licence end@ +**************************************************************************/ + +#include "EnhancedPositionStubImpl.h" +#include "log.h" + +//EnhancedPosition-interface version +#define VER_MAJOR 3 +#define VER_MINOR 0 +#define VER_MICRO 0 +#define VER_DATE "05-08-2014" + +DLT_IMPORT_CONTEXT(gCtx); + +using namespace org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes; + +EnhancedPositionStubImpl* EnhancedPositionStubImpl::mpSelf = 0; + +EnhancedPositionStubImpl::EnhancedPositionStubImpl() { + mpSelf = this; +} + +EnhancedPositionStubImpl::~EnhancedPositionStubImpl() { +} + +void EnhancedPositionStubImpl::sigPositionUpdate(const TGNSSPosition position[], uint16_t numElements) +{ + bool latChanged = false; + bool lonChanged = false; + bool altChanged = false; + 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; + + Bitmask changedValues = 0; + + if (position == NULL || numElements < 1) + { + LOG_ERROR_MSG(gCtx,"sigPositionUpdate failed!"); + return; + } + + for (int i = 0; i< numElements; i++) + { + LOG_INFO(gCtx,"Position Update[%d/%d]: \n \ + lat=%f \n \ + lon=%f \n \ + alt=%f \n \ + speed=%f \n \ + heading=%f \n \ + climb=%f \n \ + pdop=%f \n \ + hdop=%f \n \ + vdop=%f \n \ + sigmaHPosition=%f \n \ + sigmaAltitude=%f \n \ + usedSatellites=%d \n \ + fixStatus=%d \n \ + fixTypeBits=0x%08X \n", + i+1, + numElements, + position[i].latitude, + position[i].longitude, + position[i].altitudeMSL, + position[i].hSpeed, + position[i].heading, + position[i].vSpeed, + position[i].pdop, + position[i].hdop, + position[i].vdop, + position[i].sigmaHPosition, + position[i].sigmaAltitude, + position[i].usedSatellites, + position[i].fixStatus, + position[i].fixTypeBits); + + if (latChanged == false) + { + latChanged = (position[i].validityBits & GNSS_POSITION_LATITUDE_VALID); + } + + if (lonChanged == false) + { + lonChanged = (position[i].validityBits & GNSS_POSITION_LONGITUDE_VALID); + } + + if (altChanged == false) + { + altChanged = (position[i].validityBits & GNSS_POSITION_ALTITUDEMSL_VALID); + } + + if (speedChanged == false) + { + speedChanged = (position[i].validityBits & GNSS_POSITION_HSPEED_VALID); + } + + if (headingChanged == false) + { + headingChanged = (position[i].validityBits & GNSS_POSITION_HEADING_VALID); + } + + if (climbChanged == false) + { + climbChanged = (position[i].validityBits & GNSS_POSITION_VSPEED_VALID); + } + + if (pdopChanged == false) + { + pdopChanged = (position[i].validityBits & GNSS_POSITION_PDOP_VALID); + } + + if (hdopChanged == false) + { + hdopChanged = (position[i].validityBits & GNSS_POSITION_HDOP_VALID); + } + + if (vdopChanged == false) + { + vdopChanged = (position[i].validityBits & GNSS_POSITION_VDOP_VALID); + } + + if (usatChanged == false) + { + usatChanged = (position[i].validityBits & GNSS_POSITION_USAT_VALID); + } + + if (fixStatusChanged == false) + { + fixStatusChanged = (position[i].validityBits & GNSS_POSITION_STAT_VALID); + } + + if (fixTypeBitsChanged == false) + { + fixTypeBitsChanged = (position[i].validityBits & GNSS_POSITION_TYPE_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 + + if (latChanged) + { + changedValues |= static_cast<Bitmask>(PositionInfoKey::LATITUDE); + } + + if (lonChanged) + { + changedValues |= static_cast<Bitmask>(PositionInfoKey::LONGITUDE); + } + + if (altChanged) + { + changedValues |= static_cast<Bitmask>(PositionInfoKey::ALTITUDE); + } + + if (speedChanged) + { + changedValues |= static_cast<Bitmask>(PositionInfoKey::SPEED); + } + + if (headingChanged) + { + changedValues |= static_cast<Bitmask>(PositionInfoKey::HEADING); + } + + if (climbChanged) + { + changedValues |= static_cast<Bitmask>(PositionInfoKey::CLIMB); + } + + if (pdopChanged) + { + changedValues |= static_cast<Bitmask>(PositionInfoKey::PDOP); + } + + if (hdopChanged) + { + changedValues |= static_cast<Bitmask>(PositionInfoKey::HDOP); + } + + if (vdopChanged) + { + changedValues |= static_cast<Bitmask>(PositionInfoKey::VDOP); + } + + if (usatChanged) + { + changedValues |= static_cast<Bitmask>(PositionInfoKey::USED_SATELLITES); + } + + if (fixStatusChanged) + { + changedValues |= static_cast<Bitmask>(PositionInfoKey::GNSS_FIX_STATUS); + } + + if (!mpSelf) + { + LOG_ERROR_MSG(gCtx,"Null pointer!"); + return; + } + + //extend this list if necessary + if (latChanged || lonChanged || altChanged ) { + LOG_INFO(gCtx,"firePositionUpdateEvent[%lld]",changedValues); + mpSelf->firePositionUpdateEvent(changedValues); + } + +} + +void EnhancedPositionStubImpl::cbPosition(const TGNSSPosition position[], uint16_t numElements) +{ + sigPositionUpdate(position, numElements); +} + +void EnhancedPositionStubImpl::cbSatelliteDetail(const TGNSSSatelliteDetail satelliteDetail[], uint16_t numElements) +{ + if (satelliteDetail == NULL || numElements < 1) + { + LOG_ERROR_MSG(gCtx,"cbSatelliteDetail failed!"); + return; + } + + for (int i = 0; i<numElements; i++) + { + LOG_INFO(gCtx,"SatelliteDetail Update[%d/%d]: satelliteId=%d azimuth=%d elevation=%d SNR=%d", + i+1, + numElements, + satelliteDetail[i].satelliteId, + satelliteDetail[i].azimuth, + satelliteDetail[i].elevation, + satelliteDetail[i].SNR); + } + + /*if (!mpSelf) + { + LOG_ERROR_MSG(gCtx,"Null pointer!"); + return; + }*/ + + //mpSelf->fireSatelliteInfoUpdateEvent(changedValues); +} + +bool EnhancedPositionStubImpl::checkMajorVersion(int expectedMajor) +{ + int major = -1; + + gnssGetVersion(&major, 0, 0); + + if (major != expectedMajor) + { + LOG_ERROR(gCtx,"Wrong API version: gnssGetVersion returned unexpected value %d != %d", + major, + expectedMajor); + + return false; + } + + return true; +} + +void EnhancedPositionStubImpl::run() +{ + if(!checkMajorVersion(3)) + { + exit(EXIT_FAILURE); + } + + if(!gnssInit()) + { + exit(EXIT_FAILURE); + } + + LOG_INFO_MSG(gCtx,"Starting EnhancedPosition dispatcher..."); + + gnssRegisterPositionCallback(&cbPosition); + gnssRegisterSatelliteDetailCallback(&cbSatelliteDetail); +} + +void EnhancedPositionStubImpl::GetVersion(EnhancedPositionServiceTypes::Version& version) { + LOG_INFO_MSG(gCtx,"GetVersion"); + + version.maj = VER_MAJOR; + version.min = VER_MINOR; + version.mic = VER_MICRO; + version.date = std::string(VER_DATE); +} + +void EnhancedPositionStubImpl::GetPositionInfo(EnhancedPositionServiceTypes::Bitmask valuesToReturn, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::PositionInfo& data) +{ + TGNSSPosition position; + + bool isPosRequested = false; + bool isCourseRequested = false; + + if ((valuesToReturn & static_cast<Bitmask>(PositionInfoKey::LATITUDE)) || + (valuesToReturn & static_cast<Bitmask>(PositionInfoKey::LONGITUDE)) || + (valuesToReturn & static_cast<Bitmask>(PositionInfoKey::ALTITUDE))) + { + isPosRequested = true; + } + + if ((valuesToReturn & static_cast<Bitmask>(PositionInfoKey::HEADING)) || + (valuesToReturn & static_cast<Bitmask>(PositionInfoKey::SPEED)) || + (valuesToReturn & static_cast<Bitmask>(PositionInfoKey::CLIMB))) + { + isCourseRequested = true; + } + + if(gnssGetPosition(&position)) + { + timestamp = position.timestamp; + + if(isPosRequested) + { + if (position.validityBits & GNSS_POSITION_LATITUDE_VALID) + { + data[PositionInfoKey::LATITUDE] = position.latitude; + } + + if (position.validityBits & GNSS_POSITION_LONGITUDE_VALID) + { + data[PositionInfoKey::LONGITUDE] = position.longitude; + } + + if (position.validityBits & GNSS_POSITION_ALTITUDEMSL_VALID) + { + data[PositionInfoKey::ALTITUDE] = position.altitudeMSL; + } + } + + if(isCourseRequested) + { + if (position.validityBits & GNSS_POSITION_HEADING_VALID) + { + data[PositionInfoKey::HEADING] = position.heading; + } + + if (position.validityBits & GNSS_POSITION_HSPEED_VALID) + { + data[PositionInfoKey::SPEED] = position.hSpeed; + } + + if (position.validityBits & GNSS_POSITION_VSPEED_VALID) + { + data[PositionInfoKey::CLIMB] = position.vSpeed; + } + } + } +} + +void EnhancedPositionStubImpl::shutdown() +{ + LOG_INFO_MSG(gCtx,"Shutting down EnhancedPosition dispatcher..."); + + gnssDeregisterPositionCallback(&cbPosition); + gnssDeregisterSatelliteDetailCallback(&cbSatelliteDetail); + gnssDestroy(); +} diff --git a/enhanced-position-service/commonapi-service/src/EnhancedPositionStubImpl.h b/enhanced-position-service/commonapi-service/src/EnhancedPositionStubImpl.h new file mode 100644 index 0000000..5e549c3 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/EnhancedPositionStubImpl.h @@ -0,0 +1,48 @@ +/************************************************************************** +* @licence app begin@ +* +* SPDX-License-Identifier: MPL-2.0 +* +* \ingroup EnhancedPositionService +* \author Marco Residori <marco.residori@xse.de> +* +* \copyright Copyright (C) 2014, XS Embedded GmbH +* +* \license +* This Source Code Form is subject to the terms of the +* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +* this file, You can obtain one at http://mozilla.org/MPL/2.0/. +* +* @licence end@ +**************************************************************************/ + +#ifndef ENHANCEDPOSITIONSTUBIMPL_H_ +#define ENHANCEDPOSITIONSTUBIMPL_H_ + +#include <CommonAPI/CommonAPI.h> +#include <org/genivi/EnhancedPositionService/EnhancedPositionStubDefault.h> +#include "gnss-init.h" +#include "gnss.h" + +using namespace org::genivi::EnhancedPositionService; + +class EnhancedPositionStubImpl: public EnhancedPositionStubDefault { + +public: + EnhancedPositionStubImpl(); + virtual ~EnhancedPositionStubImpl(); + void GetVersion(EnhancedPositionServiceTypes::Version& version); + void GetPositionInfo(EnhancedPositionServiceTypes::Bitmask valuesToReturn, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::PositionInfo& data); + void run(); + void shutdown(); +private: + bool checkMajorVersion(int expectedMajor); + static void cbPosition(const TGNSSPosition position[], uint16_t numElements); + static void cbSatelliteDetail(const TGNSSSatelliteDetail satelliteDetail[], uint16_t numElements); + static void sigPositionUpdate(const TGNSSPosition position[], uint16_t numElements); + static EnhancedPositionStubImpl* mpSelf; +}; + +#endif /* ENHANCEDPOSITIONSTUBIMPL_H_ */ + + diff --git a/enhanced-position-service/commonapi-service/src/PositionFeedbackStubImpl.cpp b/enhanced-position-service/commonapi-service/src/PositionFeedbackStubImpl.cpp new file mode 100644 index 0000000..629268f --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/PositionFeedbackStubImpl.cpp @@ -0,0 +1,61 @@ +/************************************************************************** +* @licence app begin@ +* +* SPDX-License-Identifier: MPL-2.0 +* +* \ingroup EnhancedPositionService +* \author Marco Residori <marco.residori@xse.de> +* +* \copyright Copyright (C) 2014, XS Embedded GmbH +* +* \license +* This Source Code Form is subject to the terms of the +* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +* this file, You can obtain one at http://mozilla.org/MPL/2.0/. +* +* @licence end@ +**************************************************************************/ + +#include "PositionFeedbackStubImpl.h" +#include "log.h" + +//PositionFeedback-interface version +#define VER_MAJOR 3 +#define VER_MINOR 0 +#define VER_MICRO 0 +#define VER_DATE "05-08-2014" + +DLT_IMPORT_CONTEXT(gCtx); + +PositionFeedbackStubImpl::PositionFeedbackStubImpl() { +} + +PositionFeedbackStubImpl::~PositionFeedbackStubImpl() { +} + +void PositionFeedbackStubImpl::GetVersion(EnhancedPositionServiceTypes::Version& version) { + LOG_INFO_MSG(gCtx,"GetVersion"); + + version.maj = VER_MAJOR; + version.min = VER_MINOR; + version.mic = VER_MICRO; + version.date = std::string(VER_DATE); +} + +void PositionFeedbackStubImpl::SetPositionFeedback(std::vector<PositionFeedback::PositionFeedbackInfo> feedback, uint64_t timestamp, EnhancedPositionServiceTypes::PositionFeedbackType feedbackType) { + LOG_WARNING_MSG(gCtx,"Method not supported yet"); +} + +void PositionFeedbackStubImpl::run() +{ + LOG_INFO_MSG(gCtx,"Starting PositionFeedback dispatcher..."); +} + +void PositionFeedbackStubImpl::shutdown() +{ + LOG_INFO_MSG(gCtx,"Shutting down PositionFeedback dispatcher..."); +} + + + + diff --git a/enhanced-position-service/commonapi-service/src/PositionFeedbackStubImpl.h b/enhanced-position-service/commonapi-service/src/PositionFeedbackStubImpl.h new file mode 100644 index 0000000..1f3ec0c --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/PositionFeedbackStubImpl.h @@ -0,0 +1,41 @@ +/************************************************************************** +* @licence app begin@ +* +* SPDX-License-Identifier: MPL-2.0 +* +* \ingroup EnhancedPositionService +* \author Marco Residori <marco.residori@xse.de> +* +* \copyright Copyright (C) 2015, XS Embedded GmbH +* +* \license +* This Source Code Form is subject to the terms of the +* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +* this file, You can obtain one at http://mozilla.org/MPL/2.0/. +* +* @licence end@ +**************************************************************************/ + +#ifndef POSITIONFEEDBACKSTUBIMPL_H_ +#define POSITIONFEEDBACKSTUBIMPL_H_ + +#include <CommonAPI/CommonAPI.h> +#include <org/genivi/EnhancedPositionService/PositionFeedbackStubDefault.h> + +using namespace org::genivi::EnhancedPositionService; + +class PositionFeedbackStubImpl: public PositionFeedbackStubDefault { + +public: + PositionFeedbackStubImpl(); + virtual ~PositionFeedbackStubImpl(); + void GetVersion(EnhancedPositionServiceTypes::Version& version); + void SetPositionFeedback(std::vector<PositionFeedback::PositionFeedbackInfo> feedback, uint64_t timestamp, EnhancedPositionServiceTypes::PositionFeedbackType feedbackType); + void run(); + void shutdown(); + +}; + +#endif /* POSITIONFEEDBACKSTUBIMPL_H_ */ + + diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/Configuration.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/Configuration.h new file mode 100644 index 0000000..ef181a6 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/Configuration.h @@ -0,0 +1,65 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * Configuration = This interface allows a client application to set and retrieve + * configuration options + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_H_ + + + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/types.h> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +class Configuration { + public: + virtual ~Configuration() { } + + static inline const char* getInterfaceId(); + static inline CommonAPI::Version getInterfaceVersion(); +}; + +const char* Configuration::getInterfaceId() { + static const char* interfaceId = "org.genivi.EnhancedPositionService.Configuration"; + return interfaceId; +} + +CommonAPI::Version Configuration::getInterfaceVersion() { + return CommonAPI::Version(0, 0); +} + + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +namespace CommonAPI { + +} + + +namespace std { + //hashes for types + + //hashes for error types +} + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationDBusProxy.cpp b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationDBusProxy.cpp new file mode 100644 index 0000000..6bc748c --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationDBusProxy.cpp @@ -0,0 +1,87 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * Configuration = This interface allows a client application to set and retrieve + * configuration options + */ +#include "ConfigurationDBusProxy.h" + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +std::shared_ptr<CommonAPI::DBus::DBusProxy> createConfigurationDBusProxy( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection) { + return std::make_shared<ConfigurationDBusProxy>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection); +} + +INITIALIZER(registerConfigurationDBusProxy) { + CommonAPI::DBus::DBusFactory::registerProxyFactoryMethod(Configuration::getInterfaceId(), + &createConfigurationDBusProxy); +} + +ConfigurationDBusProxy::ConfigurationDBusProxy( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyconnection): + CommonAPI::DBus::DBusProxy(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyconnection) +,satSystem_(*this, "onSatSystemAttributeChanged", "setSatSystemAttribute", "i", "getSatSystemAttribute"), +updateInterval_(*this, "onUpdateIntervalAttributeChanged", "setUpdateIntervalAttribute", "i", "getUpdateIntervalAttribute") + { + } + +ConfigurationDBusProxy::SatSystemAttribute& ConfigurationDBusProxy::getSatSystemAttribute() { + return satSystem_; +} +ConfigurationDBusProxy::UpdateIntervalAttribute& ConfigurationDBusProxy::getUpdateIntervalAttribute() { + return updateInterval_; +} + + +/** + * GetVersion = This method returns the API version implemented by the server + * application + */ +void ConfigurationDBusProxy::GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>, + CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::Version> >::callMethodWithReply( + *this, + "GetVersion", + "", + callStatus + , version); +} +std::future<CommonAPI::CallStatus> ConfigurationDBusProxy::GetVersionAsync(GetVersionAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>, + CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::Version> >::callMethodAsync( + *this, + "GetVersion", + "", + std::move(callback)); +} + + + +void ConfigurationDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const { + ownVersionMajor = 0; + ownVersionMinor = 0; +} + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationDBusProxy.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationDBusProxy.h new file mode 100644 index 0000000..2e2b2db --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationDBusProxy.h @@ -0,0 +1,74 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * Configuration = This interface allows a client application to set and retrieve + * configuration options + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_DBUS_PROXY_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_DBUS_PROXY_H_ + +#include <org/genivi/EnhancedPositionService/ConfigurationProxyBase.h> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusFactory.h> +#include <CommonAPI/DBus/DBusProxy.h> +#include <CommonAPI/DBus/DBusAttribute.h> + +#undef COMMONAPI_INTERNAL_COMPILATION + +#include <string> + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +class ConfigurationDBusProxy: virtual public ConfigurationProxyBase, virtual public CommonAPI::DBus::DBusProxy { + public: + ConfigurationDBusProxy( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyconnection); + + virtual ~ConfigurationDBusProxy() { } + + virtual SatSystemAttribute& getSatSystemAttribute(); + virtual UpdateIntervalAttribute& getUpdateIntervalAttribute(); + + + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + virtual void GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version); + virtual std::future<CommonAPI::CallStatus> GetVersionAsync(GetVersionAsyncCallback callback); + + + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; + + private: + CommonAPI::DBus::DBusObservableAttribute<CommonAPI::DBus::DBusAttribute<SatSystemAttribute>> satSystem_; + CommonAPI::DBus::DBusObservableAttribute<CommonAPI::DBus::DBusAttribute<UpdateIntervalAttribute>> updateInterval_; + + +}; + + + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_DBUS_PROXY_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationDBusStubAdapter.cpp b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationDBusStubAdapter.cpp new file mode 100644 index 0000000..e48fdc5 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationDBusStubAdapter.cpp @@ -0,0 +1,222 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +#include "ConfigurationDBusStubAdapter.h" +#include <org/genivi/EnhancedPositionService/Configuration.h> + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createConfigurationDBusStubAdapter( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection, + const std::shared_ptr<CommonAPI::StubBase>& stubBase) { + return std::make_shared<ConfigurationDBusStubAdapter>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase); +} + +INITIALIZER(registerConfigurationDBusStubAdapter) { + CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(Configuration::getInterfaceId(), + &createConfigurationDBusStubAdapter); +} + + + +ConfigurationDBusStubAdapterInternal::~ConfigurationDBusStubAdapterInternal() { + deactivateManagedInstances(); + ConfigurationDBusStubAdapterHelper::deinit(); +} + +void ConfigurationDBusStubAdapterInternal::deactivateManagedInstances() { + +} + +const char* ConfigurationDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const { + static const std::string introspectionData = + "<method name=\"getInterfaceVersion\">\n" + "<arg name=\"value\" type=\"uu\" direction=\"out\" />" + "</method>\n" + "<method name=\"getSatSystemAttribute\">\n" + "<arg name=\"value\" type=\"i\" direction=\"out\" />" + "</method>\n" + "<method name=\"setSatSystemAttribute\">\n" + "<arg name=\"requestedValue\" type=\"i\" direction=\"in\" />\n" + "<arg name=\"setValue\" type=\"i\" direction=\"out\" />\n" + "</method>\n" + "<signal name=\"onSatSystemAttributeChanged\">\n" + "<arg name=\"changedValue\" type=\"i\" />\n" + "</signal>\n" + "<method name=\"getUpdateIntervalAttribute\">\n" + "<arg name=\"value\" type=\"i\" direction=\"out\" />" + "</method>\n" + "<method name=\"setUpdateIntervalAttribute\">\n" + "<arg name=\"requestedValue\" type=\"i\" direction=\"in\" />\n" + "<arg name=\"setValue\" type=\"i\" direction=\"out\" />\n" + "</method>\n" + "<signal name=\"onUpdateIntervalAttributeChanged\">\n" + "<arg name=\"changedValue\" type=\"i\" />\n" + "</signal>\n" + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + "<method name=\"GetVersion\">\n" + "<arg name=\"version\" type=\"(qqqs)\" direction=\"out\" />\n" + "</method>\n" + + ; + return introspectionData.c_str(); +} + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ConfigurationStub, + CommonAPI::Version + > ConfigurationDBusStubAdapterInternal::getConfigurationInterfaceVersionStubDispatcher(&ConfigurationStub::getInterfaceVersion, "uu"); + +/** + * SatSystem = satellite system (GPS, GLONASS, ...) + */ +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ConfigurationStub, + EnhancedPositionServiceTypes::SatelliteSystem + > ConfigurationDBusStubAdapterInternal::getSatSystemAttributeStubDispatcher(&ConfigurationStub::getSatSystemAttribute, "i"); +CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ConfigurationStub, + EnhancedPositionServiceTypes::SatelliteSystem + > ConfigurationDBusStubAdapterInternal::setSatSystemAttributeStubDispatcher( + &ConfigurationStub::getSatSystemAttribute, + &ConfigurationStubRemoteEvent::onRemoteSetSatSystemAttribute, + &ConfigurationStubRemoteEvent::onRemoteSatSystemAttributeChanged + ,&ConfigurationStubAdapter::fireSatSystemAttributeChanged + ,"i" + ); +/** + * UpdateInterval = update interval + */ +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ConfigurationStub, + int32_t + > ConfigurationDBusStubAdapterInternal::getUpdateIntervalAttributeStubDispatcher(&ConfigurationStub::getUpdateIntervalAttribute, "i"); +CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ConfigurationStub, + int32_t + > ConfigurationDBusStubAdapterInternal::setUpdateIntervalAttributeStubDispatcher( + &ConfigurationStub::getUpdateIntervalAttribute, + &ConfigurationStubRemoteEvent::onRemoteSetUpdateIntervalAttribute, + &ConfigurationStubRemoteEvent::onRemoteUpdateIntervalAttributeChanged + ,&ConfigurationStubAdapter::fireUpdateIntervalAttributeChanged + ,"i" + ); + + +/** + * GetVersion = This method returns the API version implemented by the server + * application + */ +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConfigurationStub, + std::tuple<>, + std::tuple<EnhancedPositionServiceTypes::Version> + > ConfigurationDBusStubAdapterInternal::getVersionStubDispatcher(&ConfigurationStub::GetVersion, "(qqqs)"); + + +/** + * SatSystem = satellite system (GPS, GLONASS, ...) + */ +void ConfigurationDBusStubAdapterInternal::fireSatSystemAttributeChanged(const EnhancedPositionServiceTypes::SatelliteSystem& value) { + CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::SatelliteSystem>> + ::sendSignal( + *this, + "onSatSystemAttributeChanged", + "i", + value + ); +} +/** + * UpdateInterval = update interval + */ +void ConfigurationDBusStubAdapterInternal::fireUpdateIntervalAttributeChanged(const int32_t& value) { + CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t>> + ::sendSignal( + *this, + "onUpdateIntervalAttributeChanged", + "i", + value + ); +} + + + +const ConfigurationDBusStubAdapterHelper::StubDispatcherTable& ConfigurationDBusStubAdapterInternal::getStubDispatcherTable() { + return stubDispatcherTable_; +} + +const CommonAPI::DBus::StubAttributeTable& ConfigurationDBusStubAdapterInternal::getStubAttributeTable() { + return stubAttributeTable_; +} + +ConfigurationDBusStubAdapterInternal::ConfigurationDBusStubAdapterInternal( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection, + const std::shared_ptr<CommonAPI::StubBase>& stub): + CommonAPI::DBus::DBusStubAdapter( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + false), + ConfigurationDBusStubAdapterHelper( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + std::dynamic_pointer_cast<ConfigurationStub>(stub), + false), + stubDispatcherTable_({ + /** + * SatSystem = satellite system (GPS, GLONASS, ...) + */ + { { "getSatSystemAttribute", "" }, &org::genivi::EnhancedPositionService::ConfigurationDBusStubAdapterInternal::getSatSystemAttributeStubDispatcher } + , { { "setSatSystemAttribute", "i" }, &org::genivi::EnhancedPositionService::ConfigurationDBusStubAdapterInternal::setSatSystemAttributeStubDispatcher }, + /** + * UpdateInterval = update interval + */ + { { "getUpdateIntervalAttribute", "" }, &org::genivi::EnhancedPositionService::ConfigurationDBusStubAdapterInternal::getUpdateIntervalAttributeStubDispatcher } + , { { "setUpdateIntervalAttribute", "i" }, &org::genivi::EnhancedPositionService::ConfigurationDBusStubAdapterInternal::setUpdateIntervalAttributeStubDispatcher } + , + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + { { "GetVersion", "" }, &org::genivi::EnhancedPositionService::ConfigurationDBusStubAdapterInternal::getVersionStubDispatcher } + }), + stubAttributeTable_() { + + stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &org::genivi::EnhancedPositionService::ConfigurationDBusStubAdapterInternal::getConfigurationInterfaceVersionStubDispatcher }); +} + +const bool ConfigurationDBusStubAdapterInternal::hasFreedesktopProperties() { + return false; +} + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationDBusStubAdapter.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationDBusStubAdapter.h new file mode 100644 index 0000000..9406b6b --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationDBusStubAdapter.h @@ -0,0 +1,150 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * Configuration = This interface allows a client application to set and retrieve + * configuration options + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_DBUS_STUB_ADAPTER_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_DBUS_STUB_ADAPTER_H_ + +#include <org/genivi/EnhancedPositionService/ConfigurationStub.h> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusStubAdapterHelper.h> +#include <CommonAPI/DBus/DBusStubAdapter.h> +#include <CommonAPI/DBus/DBusFactory.h> +#include <CommonAPI/DBus/DBusServicePublisher.h> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +typedef CommonAPI::DBus::DBusStubAdapterHelper<ConfigurationStub> ConfigurationDBusStubAdapterHelper; + +class ConfigurationDBusStubAdapterInternal: public virtual ConfigurationStubAdapter, public ConfigurationDBusStubAdapterHelper { + public: + ConfigurationDBusStubAdapterInternal( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection, + const std::shared_ptr<CommonAPI::StubBase>& stub); + + ~ConfigurationDBusStubAdapterInternal(); + + virtual const bool hasFreedesktopProperties(); + + /** + * SatSystem = satellite system (GPS, GLONASS, ...) + */ + void fireSatSystemAttributeChanged(const EnhancedPositionServiceTypes::SatelliteSystem& value); + /** + * UpdateInterval = update interval + */ + void fireUpdateIntervalAttributeChanged(const int32_t& value); + + + + const ConfigurationDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable(); + const CommonAPI::DBus::StubAttributeTable& getStubAttributeTable(); + + void deactivateManagedInstances(); + + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ConfigurationStub, + CommonAPI::Version + > getConfigurationInterfaceVersionStubDispatcher; + +/** + * SatSystem = satellite system (GPS, GLONASS, ...) + */ +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ConfigurationStub, + EnhancedPositionServiceTypes::SatelliteSystem + > getSatSystemAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ConfigurationStub, + EnhancedPositionServiceTypes::SatelliteSystem + > setSatSystemAttributeStubDispatcher; +/** + * UpdateInterval = update interval + */ +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ConfigurationStub, + int32_t + > getUpdateIntervalAttributeStubDispatcher; +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ConfigurationStub, + int32_t + > setUpdateIntervalAttributeStubDispatcher; + + +/** + * GetVersion = This method returns the API version implemented by the server + * application + */ +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConfigurationStub, + std::tuple<>, + std::tuple<EnhancedPositionServiceTypes::Version> + > getVersionStubDispatcher; + + + + + protected: + virtual const char* getMethodsDBusIntrospectionXmlData() const; + + private: + ConfigurationDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_; + CommonAPI::DBus::StubAttributeTable stubAttributeTable_; +}; + +class ConfigurationDBusStubAdapter: public ConfigurationDBusStubAdapterInternal, public std::enable_shared_from_this<ConfigurationDBusStubAdapter> { +public: + ConfigurationDBusStubAdapter( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection, + const std::shared_ptr<CommonAPI::StubBase>& stub) : + CommonAPI::DBus::DBusStubAdapter( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + false), + ConfigurationDBusStubAdapterInternal( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + stub) { } +}; + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_DBUS_STUB_ADAPTER_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationProxy.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationProxy.h new file mode 100644 index 0000000..0556d1b --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationProxy.h @@ -0,0 +1,276 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * Configuration = This interface allows a client application to set and retrieve + * configuration options + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_PROXY_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_PROXY_H_ + +#include "ConfigurationProxyBase.h" + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/AttributeExtension.h> +#include <CommonAPI/Factory.h> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +template <typename ... _AttributeExtensions> +class ConfigurationProxy: virtual public Configuration, virtual public ConfigurationProxyBase +, public _AttributeExtensions... { +public: + ConfigurationProxy(std::shared_ptr<CommonAPI::Proxy> delegate); + ~ConfigurationProxy(); + + typedef Configuration InterfaceType; + + + /** + * SatSystem = satellite system (GPS, GLONASS, ...) + */ + /** + * Returns the wrapper class that provides access to the attribute SatSystem. + */ + virtual SatSystemAttribute& getSatSystemAttribute() { + return delegate_->getSatSystemAttribute(); + } + /** + * UpdateInterval = update interval + */ + /** + * Returns the wrapper class that provides access to the attribute UpdateInterval. + */ + virtual UpdateIntervalAttribute& getUpdateIntervalAttribute() { + return delegate_->getUpdateIntervalAttribute(); + } + + + /** + * GetVersion = This method returns the API version implemented by the server + * application + * + * Calls GetVersion with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version); + /** + * Calls GetVersion with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> GetVersionAsync(GetVersionAsyncCallback callback); + + + /** + * Returns the CommonAPI address of the remote partner this proxy communicates with. + */ + virtual std::string getAddress() const; + + /** + * Returns the domain of the remote partner this proxy communicates with. + */ + virtual const std::string& getDomain() const; + + /** + * Returns the service ID of the remote partner this proxy communicates with. + */ + virtual const std::string& getServiceId() const; + + /** + * Returns the instance ID of the remote partner this proxy communicates with. + */ + virtual const std::string& getInstanceId() const; + + /** + * Returns true if the remote partner for this proxy is currently known to be available. + */ + virtual bool isAvailable() const; + + /** + * Returns true if the remote partner for this proxy is available. + */ + virtual bool isAvailableBlocking() const; + + /** + * Returns the wrapper class that is used to (de-)register for notifications about + * the availability of the remote partner of this proxy. + */ + virtual CommonAPI::ProxyStatusEvent& getProxyStatusEvent(); + + /** + * Returns the wrapper class that is used to access version information of the remote + * partner of this proxy. + */ + virtual CommonAPI::InterfaceVersionAttribute& getInterfaceVersionAttribute(); + + private: + std::shared_ptr<ConfigurationProxyBase> delegate_; +}; + +#ifdef WIN32 + typedef ConfigurationProxy<CommonAPI::WINDummyAttributeExtension<CommonAPI::WINDummyAttribute>> ConfigurationProxyDefault; +#else + typedef ConfigurationProxy<> ConfigurationProxyDefault; +#endif + +namespace ConfigurationExtensions { + /** + * SatSystem = satellite system (GPS, GLONASS, ...) + */ + template <template <typename > class _ExtensionType> + class SatSystemAttributeExtension { + public: + typedef _ExtensionType<ConfigurationProxyBase::SatSystemAttribute> extension_type; + + static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<ConfigurationProxyBase::SatSystemAttribute>, extension_type>::value, + "Not CommonAPI Attribute Extension!"); + #ifdef WIN32 + SatSystemAttributeExtension() {} + #endif + + SatSystemAttributeExtension(ConfigurationProxyBase& proxy): attributeExtension_(proxy.getSatSystemAttribute()) { + } + + inline extension_type& getSatSystemAttributeExtension() { + return attributeExtension_; + } + + private: + extension_type attributeExtension_; + }; + + /** + * UpdateInterval = update interval + */ + template <template <typename > class _ExtensionType> + class UpdateIntervalAttributeExtension { + public: + typedef _ExtensionType<ConfigurationProxyBase::UpdateIntervalAttribute> extension_type; + + static_assert(std::is_base_of<typename CommonAPI::AttributeExtension<ConfigurationProxyBase::UpdateIntervalAttribute>, extension_type>::value, + "Not CommonAPI Attribute Extension!"); + #ifdef WIN32 + UpdateIntervalAttributeExtension() {} + #endif + + UpdateIntervalAttributeExtension(ConfigurationProxyBase& proxy): attributeExtension_(proxy.getUpdateIntervalAttribute()) { + } + + inline extension_type& getUpdateIntervalAttributeExtension() { + return attributeExtension_; + } + + private: + extension_type attributeExtension_; + }; + +} // namespace ConfigurationExtensions + +// +// ConfigurationProxy Implementation +// +template <typename ... _AttributeExtensions> +ConfigurationProxy<_AttributeExtensions...>::ConfigurationProxy(std::shared_ptr<CommonAPI::Proxy> delegate): + _AttributeExtensions(*(std::dynamic_pointer_cast<ConfigurationProxyBase>(delegate)))..., + delegate_(std::dynamic_pointer_cast<ConfigurationProxyBase>(delegate)) { +} + +template <typename ... _AttributeExtensions> +ConfigurationProxy<_AttributeExtensions...>::~ConfigurationProxy() { +} + +/** + * GetVersion = This method returns the API version implemented by the server + * application + */ +template <typename ... _AttributeExtensions> +void ConfigurationProxy<_AttributeExtensions...>::GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version) { + delegate_->GetVersion(callStatus, version); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> ConfigurationProxy<_AttributeExtensions...>::GetVersionAsync(GetVersionAsyncCallback callback) { + return delegate_->GetVersionAsync(callback); +} + +template <typename ... _AttributeExtensions> +std::string ConfigurationProxy<_AttributeExtensions...>::getAddress() const { + return delegate_->getAddress(); +} + +template <typename ... _AttributeExtensions> +const std::string& ConfigurationProxy<_AttributeExtensions...>::getDomain() const { + return delegate_->getDomain(); +} + +template <typename ... _AttributeExtensions> +const std::string& ConfigurationProxy<_AttributeExtensions...>::getServiceId() const { + return delegate_->getServiceId(); +} + +template <typename ... _AttributeExtensions> +const std::string& ConfigurationProxy<_AttributeExtensions...>::getInstanceId() const { + return delegate_->getInstanceId(); +} + +template <typename ... _AttributeExtensions> +bool ConfigurationProxy<_AttributeExtensions...>::isAvailable() const { + return delegate_->isAvailable(); +} + +template <typename ... _AttributeExtensions> +bool ConfigurationProxy<_AttributeExtensions...>::isAvailableBlocking() const { + return delegate_->isAvailableBlocking(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::ProxyStatusEvent& ConfigurationProxy<_AttributeExtensions...>::getProxyStatusEvent() { + return delegate_->getProxyStatusEvent(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::InterfaceVersionAttribute& ConfigurationProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() { + return delegate_->getInterfaceVersionAttribute(); +} + + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +namespace CommonAPI { +template<template<typename > class _AttributeExtension> +struct DefaultAttributeProxyFactoryHelper<org::genivi::EnhancedPositionService::ConfigurationProxy, + _AttributeExtension> { + typedef typename org::genivi::EnhancedPositionService::ConfigurationProxy< + org::genivi::EnhancedPositionService::ConfigurationExtensions::SatSystemAttributeExtension<_AttributeExtension>, + org::genivi::EnhancedPositionService::ConfigurationExtensions::UpdateIntervalAttributeExtension<_AttributeExtension> + > class_t; +}; +} + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_PROXY_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationProxyBase.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationProxyBase.h new file mode 100644 index 0000000..6f91a7b --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationProxyBase.h @@ -0,0 +1,73 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * Configuration = This interface allows a client application to set and retrieve + * configuration options + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_PROXY_BASE_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_PROXY_BASE_H_ + +#include "Configuration.h" + + +#include <org/genivi/EnhancedPositionService/EnhancedPositionServiceTypes.h> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/InputStream.h> +#include <CommonAPI/OutputStream.h> +#include <CommonAPI/SerializableStruct.h> +#include <cstdint> +#include <string> +#include <vector> + +#include <CommonAPI/Attribute.h> +#include <CommonAPI/Proxy.h> +#include <functional> +#include <future> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +class ConfigurationProxyBase: virtual public CommonAPI::Proxy { + public: + typedef CommonAPI::ObservableAttribute<EnhancedPositionServiceTypes::SatelliteSystem> SatSystemAttribute; + typedef CommonAPI::ObservableAttribute<int32_t> UpdateIntervalAttribute; + + typedef std::function<void(const CommonAPI::CallStatus&, const EnhancedPositionServiceTypes::Version&)> GetVersionAsyncCallback; + + /** + * SatSystem = satellite system (GPS, GLONASS, ...) + */ + virtual SatSystemAttribute& getSatSystemAttribute() = 0; + /** + * UpdateInterval = update interval + */ + virtual UpdateIntervalAttribute& getUpdateIntervalAttribute() = 0; + + + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + virtual void GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version) = 0; + virtual std::future<CommonAPI::CallStatus> GetVersionAsync(GetVersionAsyncCallback callback) = 0; +}; + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_PROXY_BASE_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationStub.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationStub.h new file mode 100644 index 0000000..db7034d --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationStub.h @@ -0,0 +1,135 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * Configuration = This interface allows a client application to set and retrieve + * configuration options + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_STUB_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_STUB_H_ + + + +#include <org/genivi/EnhancedPositionService/EnhancedPositionServiceTypes.h> + +#include "Configuration.h" + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/InputStream.h> +#include <CommonAPI/OutputStream.h> +#include <CommonAPI/SerializableStruct.h> +#include <cstdint> +#include <string> +#include <vector> + +#include <CommonAPI/Stub.h> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +/** + * Receives messages from remote and handles all dispatching of deserialized calls + * to a stub for the service Configuration. Also provides means to send broadcasts + * and attribute-changed-notifications of observable attributes as defined by this service. + * An application developer should not need to bother with this class. + */ +class ConfigurationStubAdapter: virtual public CommonAPI::StubAdapter, public Configuration { + public: + ///Notifies all remote listeners about a change of value of the attribute SatSystem. + virtual void fireSatSystemAttributeChanged(const EnhancedPositionServiceTypes::SatelliteSystem& SatSystem) = 0; + ///Notifies all remote listeners about a change of value of the attribute UpdateInterval. + virtual void fireUpdateIntervalAttributeChanged(const int32_t& UpdateInterval) = 0; + + + + virtual void deactivateManagedInstances() = 0; +protected: + /** + * Defines properties for storing the ClientIds of clients / proxies that have + * subscribed to the selective broadcasts + */ +}; + + +/** + * Defines the necessary callbacks to handle remote set events related to the attributes + * defined in the IDL description for Configuration. + * For each attribute two callbacks are defined: + * - a verification callback that allows to verify the requested value and to prevent setting + * e.g. an invalid value ("onRemoteSet<AttributeName>"). + * - an action callback to do local work after the attribute value has been changed + * ("onRemote<AttributeName>Changed"). + * + * This class and the one below are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class ConfigurationStubRemoteEvent { + public: + virtual ~ConfigurationStubRemoteEvent() { } + + /// Verification callback for remote set requests on the attribute SatSystem + virtual bool onRemoteSetSatSystemAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::SatelliteSystem SatSystem) = 0; + /// Action callback for remote set requests on the attribute SatSystem + virtual void onRemoteSatSystemAttributeChanged() = 0; + + /// Verification callback for remote set requests on the attribute UpdateInterval + virtual bool onRemoteSetUpdateIntervalAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, int32_t UpdateInterval) = 0; + /// Action callback for remote set requests on the attribute UpdateInterval + virtual void onRemoteUpdateIntervalAttributeChanged() = 0; + +}; + + +/** + * Defines the interface that must be implemented by any class that should provide + * the service Configuration to remote clients. + * This class and the one above are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class ConfigurationStub: public virtual CommonAPI::Stub<ConfigurationStubAdapter, ConfigurationStubRemoteEvent> { +public: + virtual ~ConfigurationStub() { } + virtual const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) = 0; + + /** + * SatSystem = satellite system (GPS, GLONASS, ...) + */ + /// Provides getter access to the attribute SatSystem + virtual const EnhancedPositionServiceTypes::SatelliteSystem& getSatSystemAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId) = 0; + /** + * UpdateInterval = update interval + */ + /// Provides getter access to the attribute UpdateInterval + virtual const int32_t& getUpdateIntervalAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId) = 0; + + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + /// This is the method that will be called on remote calls on the method GetVersion. + virtual void GetVersion(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Version& version) = 0; + + using CommonAPI::Stub<ConfigurationStubAdapter, ConfigurationStubRemoteEvent>::initStubAdapter; + typedef CommonAPI::Stub<ConfigurationStubAdapter, ConfigurationStubRemoteEvent>::StubAdapterType StubAdapterType; + typedef CommonAPI::Stub<ConfigurationStubAdapter, ConfigurationStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType; + typedef ConfigurationStubRemoteEvent RemoteEventType; + typedef Configuration StubInterface; +}; + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_STUB_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationStubDefault.cpp b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationStubDefault.cpp new file mode 100644 index 0000000..4f0cf3f --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationStubDefault.cpp @@ -0,0 +1,148 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +#include <org/genivi/EnhancedPositionService/ConfigurationStubDefault.h> + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +ConfigurationStubDefault::ConfigurationStubDefault(): + remoteEventHandler_(this), + interfaceVersion_(Configuration::getInterfaceVersion()) { +} + +const CommonAPI::Version& ConfigurationStubDefault::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) { + return interfaceVersion_; +} + +ConfigurationStubRemoteEvent* ConfigurationStubDefault::initStubAdapter(const std::shared_ptr<ConfigurationStubAdapter>& stubAdapter) { + CommonAPI::Stub<ConfigurationStubAdapter, ConfigurationStubRemoteEvent>::stubAdapter_ = stubAdapter; + return &remoteEventHandler_; +} + +const EnhancedPositionServiceTypes::SatelliteSystem& ConfigurationStubDefault::getSatSystemAttribute() { + return satSystemAttributeValue_; +} + +const EnhancedPositionServiceTypes::SatelliteSystem& ConfigurationStubDefault::getSatSystemAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId) { + return getSatSystemAttribute(); +} + +void ConfigurationStubDefault::setSatSystemAttribute(EnhancedPositionServiceTypes::SatelliteSystem value) { + const bool valueChanged = trySetSatSystemAttribute(std::move(value)); + if (valueChanged && stubAdapter_ != NULL) { + stubAdapter_->fireSatSystemAttributeChanged(satSystemAttributeValue_); + } +} + +bool ConfigurationStubDefault::trySetSatSystemAttribute(EnhancedPositionServiceTypes::SatelliteSystem value) { + if (!validateSatSystemAttributeRequestedValue(value)) + return false; + + const bool valueChanged = (satSystemAttributeValue_ != value); + satSystemAttributeValue_ = std::move(value); + return valueChanged; +} + +bool ConfigurationStubDefault::validateSatSystemAttributeRequestedValue(const EnhancedPositionServiceTypes::SatelliteSystem& value) { + return true; +} + +void ConfigurationStubDefault::setSatSystemAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::SatelliteSystem value) { + setSatSystemAttribute(value); +} + +void ConfigurationStubDefault::onRemoteSatSystemAttributeChanged() { + // No operation in default +} + +void ConfigurationStubDefault::RemoteEventHandler::onRemoteSatSystemAttributeChanged() { + defaultStub_->onRemoteSatSystemAttributeChanged(); +} + +bool ConfigurationStubDefault::RemoteEventHandler::onRemoteSetSatSystemAttribute(EnhancedPositionServiceTypes::SatelliteSystem value) { + return defaultStub_->trySetSatSystemAttribute(std::move(value)); +} + +bool ConfigurationStubDefault::RemoteEventHandler::onRemoteSetSatSystemAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::SatelliteSystem value) { + return onRemoteSetSatSystemAttribute(value); +} + +const int32_t& ConfigurationStubDefault::getUpdateIntervalAttribute() { + return updateIntervalAttributeValue_; +} + +const int32_t& ConfigurationStubDefault::getUpdateIntervalAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId) { + return getUpdateIntervalAttribute(); +} + +void ConfigurationStubDefault::setUpdateIntervalAttribute(int32_t value) { + const bool valueChanged = trySetUpdateIntervalAttribute(std::move(value)); + if (valueChanged && stubAdapter_ != NULL) { + stubAdapter_->fireUpdateIntervalAttributeChanged(updateIntervalAttributeValue_); + } +} + +bool ConfigurationStubDefault::trySetUpdateIntervalAttribute(int32_t value) { + if (!validateUpdateIntervalAttributeRequestedValue(value)) + return false; + + const bool valueChanged = (updateIntervalAttributeValue_ != value); + updateIntervalAttributeValue_ = std::move(value); + return valueChanged; +} + +bool ConfigurationStubDefault::validateUpdateIntervalAttributeRequestedValue(const int32_t& value) { + return true; +} + +void ConfigurationStubDefault::setUpdateIntervalAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, int32_t value) { + setUpdateIntervalAttribute(value); +} + +void ConfigurationStubDefault::onRemoteUpdateIntervalAttributeChanged() { + // No operation in default +} + +void ConfigurationStubDefault::RemoteEventHandler::onRemoteUpdateIntervalAttributeChanged() { + defaultStub_->onRemoteUpdateIntervalAttributeChanged(); +} + +bool ConfigurationStubDefault::RemoteEventHandler::onRemoteSetUpdateIntervalAttribute(int32_t value) { + return defaultStub_->trySetUpdateIntervalAttribute(std::move(value)); +} + +bool ConfigurationStubDefault::RemoteEventHandler::onRemoteSetUpdateIntervalAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, int32_t value) { + return onRemoteSetUpdateIntervalAttribute(value); +} + + +/** + * GetVersion = This method returns the API version implemented by the server + * application + */ +void ConfigurationStubDefault::GetVersion(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Version& version) { + // Call old style methods in default + GetVersion(version); +} +void ConfigurationStubDefault::GetVersion(EnhancedPositionServiceTypes::Version& version) { + // No operation in default +} + + + + +ConfigurationStubDefault::RemoteEventHandler::RemoteEventHandler(ConfigurationStubDefault* defaultStub): + defaultStub_(defaultStub) { +} + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationStubDefault.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationStubDefault.h new file mode 100644 index 0000000..523f1e9 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/ConfigurationStubDefault.h @@ -0,0 +1,116 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * Configuration = This interface allows a client application to set and retrieve + * configuration options + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_STUB_DEFAULT_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_STUB_DEFAULT_H_ + + +#include <org/genivi/EnhancedPositionService/ConfigurationStub.h> +#include <sstream> + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +/** + * Provides a default implementation for ConfigurationStubRemoteEvent and + * ConfigurationStub. Method callbacks have an empty implementation, + * remote set calls on attributes will always change the value of the attribute + * to the one received. + * + * Override this stub if you only want to provide a subset of the functionality + * that would be defined for this service, and/or if you do not need any non-default + * behaviour. + */ +class ConfigurationStubDefault : public virtual ConfigurationStub { +public: + ConfigurationStubDefault(); + + ConfigurationStubRemoteEvent* initStubAdapter(const std::shared_ptr<ConfigurationStubAdapter>& stubAdapter); + + const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId); + + virtual const EnhancedPositionServiceTypes::SatelliteSystem& getSatSystemAttribute(); + virtual const EnhancedPositionServiceTypes::SatelliteSystem& getSatSystemAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId); + virtual void setSatSystemAttribute(EnhancedPositionServiceTypes::SatelliteSystem value); + virtual void setSatSystemAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::SatelliteSystem value); + virtual const int32_t& getUpdateIntervalAttribute(); + virtual const int32_t& getUpdateIntervalAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId); + virtual void setUpdateIntervalAttribute(int32_t value); + virtual void setUpdateIntervalAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, int32_t value); + + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + virtual void GetVersion(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Version& version); + virtual void GetVersion(EnhancedPositionServiceTypes::Version& version); + + + + +protected: + /** + * SatSystem = satellite system (GPS, GLONASS, ...) + */ + virtual bool trySetSatSystemAttribute(EnhancedPositionServiceTypes::SatelliteSystem value); + virtual bool validateSatSystemAttributeRequestedValue(const EnhancedPositionServiceTypes::SatelliteSystem& value); + virtual void onRemoteSatSystemAttributeChanged(); + /** + * UpdateInterval = update interval + */ + virtual bool trySetUpdateIntervalAttribute(int32_t value); + virtual bool validateUpdateIntervalAttributeRequestedValue(const int32_t& value); + virtual void onRemoteUpdateIntervalAttributeChanged(); + class RemoteEventHandler: public virtual ConfigurationStubRemoteEvent { + public: + RemoteEventHandler(ConfigurationStubDefault* defaultStub); + + /** + * SatSystem = satellite system (GPS, GLONASS, ...) + */ + virtual bool onRemoteSetSatSystemAttribute(EnhancedPositionServiceTypes::SatelliteSystem value); + virtual bool onRemoteSetSatSystemAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::SatelliteSystem value); + virtual void onRemoteSatSystemAttributeChanged(); + + /** + * UpdateInterval = update interval + */ + virtual bool onRemoteSetUpdateIntervalAttribute(int32_t value); + virtual bool onRemoteSetUpdateIntervalAttribute(const std::shared_ptr<CommonAPI::ClientId> clientId, int32_t value); + virtual void onRemoteUpdateIntervalAttributeChanged(); + + + private: + ConfigurationStubDefault* defaultStub_; + }; +private: + ConfigurationStubDefault::RemoteEventHandler remoteEventHandler_; + + /** + * SatSystem = satellite system (GPS, GLONASS, ...) + */ + EnhancedPositionServiceTypes::SatelliteSystem satSystemAttributeValue_; + /** + * UpdateInterval = update interval + */ + int32_t updateIntervalAttributeValue_; + + CommonAPI::Version interfaceVersion_; +}; + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Configuration_STUB_DEFAULT_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPosition.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPosition.h new file mode 100644 index 0000000..b6565a0 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPosition.h @@ -0,0 +1,65 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * EnhancedPosition = This interface offers functionalities to retrieve the + * enhanced position of the vehicle + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_H_ + + + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/types.h> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +class EnhancedPosition { + public: + virtual ~EnhancedPosition() { } + + static inline const char* getInterfaceId(); + static inline CommonAPI::Version getInterfaceVersion(); +}; + +const char* EnhancedPosition::getInterfaceId() { + static const char* interfaceId = "org.genivi.EnhancedPositionService.EnhancedPosition"; + return interfaceId; +} + +CommonAPI::Version EnhancedPosition::getInterfaceVersion() { + return CommonAPI::Version(0, 0); +} + + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +namespace CommonAPI { + +} + + +namespace std { + //hashes for types + + //hashes for error types +} + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionDBusProxy.cpp b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionDBusProxy.cpp new file mode 100644 index 0000000..a1b4a46 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionDBusProxy.cpp @@ -0,0 +1,153 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * EnhancedPosition = This interface offers functionalities to retrieve the + * enhanced position of the vehicle + */ +#include "EnhancedPositionDBusProxy.h" + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +std::shared_ptr<CommonAPI::DBus::DBusProxy> createEnhancedPositionDBusProxy( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection) { + return std::make_shared<EnhancedPositionDBusProxy>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection); +} + +INITIALIZER(registerEnhancedPositionDBusProxy) { + CommonAPI::DBus::DBusFactory::registerProxyFactoryMethod(EnhancedPosition::getInterfaceId(), + &createEnhancedPositionDBusProxy); +} + +EnhancedPositionDBusProxy::EnhancedPositionDBusProxy( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyconnection): + CommonAPI::DBus::DBusProxy(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyconnection) +, positionUpdate_(*this, "PositionUpdate", "t") + { + } + + +EnhancedPositionDBusProxy::PositionUpdateEvent& EnhancedPositionDBusProxy::getPositionUpdateEvent() { + return positionUpdate_; +} + +/** + * GetVersion = This method returns the API version implemented by the server + * application + */ +void EnhancedPositionDBusProxy::GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>, + CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::Version> >::callMethodWithReply( + *this, + "GetVersion", + "", + callStatus + , version); +} +std::future<CommonAPI::CallStatus> EnhancedPositionDBusProxy::GetVersionAsync(GetVersionAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>, + CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::Version> >::callMethodAsync( + *this, + "GetVersion", + "", + std::move(callback)); +} +/** + * 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 + */ +void EnhancedPositionDBusProxy::GetPositionInfo(const EnhancedPositionServiceTypes::Bitmask& valuesToReturn, CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::PositionInfo& data) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::Bitmask>, + CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::Timestamp, EnhancedPositionServiceTypes::PositionInfo> >::callMethodWithReply( + *this, + "GetPositionInfo", + "t", + valuesToReturn, + callStatus + , timestamp, data); +} +std::future<CommonAPI::CallStatus> EnhancedPositionDBusProxy::GetPositionInfoAsync(const EnhancedPositionServiceTypes::Bitmask& valuesToReturn, GetPositionInfoAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::Bitmask>, + CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::Timestamp, EnhancedPositionServiceTypes::PositionInfo> >::callMethodAsync( + *this, + "GetPositionInfo", + "t", + valuesToReturn, + std::move(callback)); +} +/** + * 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 + */ +void EnhancedPositionDBusProxy::GetSatelliteInfo(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::SatelliteInfo& satelliteInfo) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>, + CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::Timestamp, EnhancedPositionServiceTypes::SatelliteInfo> >::callMethodWithReply( + *this, + "GetSatelliteInfo", + "", + callStatus + , timestamp, satelliteInfo); +} +std::future<CommonAPI::CallStatus> EnhancedPositionDBusProxy::GetSatelliteInfoAsync(GetSatelliteInfoAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>, + CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::Timestamp, EnhancedPositionServiceTypes::SatelliteInfo> >::callMethodAsync( + *this, + "GetSatelliteInfo", + "", + std::move(callback)); +} +/** + * GetTime = This method returns UTC time and date. + Note: If a + * requested value is invalid, it's not returned to the client application + */ +void EnhancedPositionDBusProxy::GetTime(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::TimeInfo& time) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>, + CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::Timestamp, EnhancedPositionServiceTypes::TimeInfo> >::callMethodWithReply( + *this, + "GetTime", + "", + callStatus + , timestamp, time); +} +std::future<CommonAPI::CallStatus> EnhancedPositionDBusProxy::GetTimeAsync(GetTimeAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>, + CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::Timestamp, EnhancedPositionServiceTypes::TimeInfo> >::callMethodAsync( + *this, + "GetTime", + "", + std::move(callback)); +} + + + +void EnhancedPositionDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const { + ownVersionMajor = 0; + ownVersionMinor = 0; +} + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionDBusProxy.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionDBusProxy.h new file mode 100644 index 0000000..8a7c520 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionDBusProxy.h @@ -0,0 +1,95 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * EnhancedPosition = This interface offers functionalities to retrieve the + * enhanced position of the vehicle + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_DBUS_PROXY_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_DBUS_PROXY_H_ + +#include <org/genivi/EnhancedPositionService/EnhancedPositionProxyBase.h> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusFactory.h> +#include <CommonAPI/DBus/DBusProxy.h> +#include <CommonAPI/DBus/DBusEvent.h> + +#undef COMMONAPI_INTERNAL_COMPILATION + +#include <string> + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +class EnhancedPositionDBusProxy: virtual public EnhancedPositionProxyBase, virtual public CommonAPI::DBus::DBusProxy { + public: + EnhancedPositionDBusProxy( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyconnection); + + virtual ~EnhancedPositionDBusProxy() { } + + + virtual PositionUpdateEvent& getPositionUpdateEvent(); + + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + virtual void GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version); + virtual std::future<CommonAPI::CallStatus> GetVersionAsync(GetVersionAsyncCallback callback); + /** + * 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 + */ + virtual void GetPositionInfo(const EnhancedPositionServiceTypes::Bitmask& valuesToReturn, CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::PositionInfo& data); + virtual std::future<CommonAPI::CallStatus> GetPositionInfoAsync(const EnhancedPositionServiceTypes::Bitmask& valuesToReturn, GetPositionInfoAsyncCallback callback); + /** + * 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 + */ + virtual void GetSatelliteInfo(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::SatelliteInfo& satelliteInfo); + virtual std::future<CommonAPI::CallStatus> GetSatelliteInfoAsync(GetSatelliteInfoAsyncCallback callback); + /** + * GetTime = This method returns UTC time and date. + Note: If a + * requested value is invalid, it's not returned to the client application + */ + virtual void GetTime(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::TimeInfo& time); + virtual std::future<CommonAPI::CallStatus> GetTimeAsync(GetTimeAsyncCallback callback); + + + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; + + private: + + CommonAPI::DBus::DBusEvent<PositionUpdateEvent> positionUpdate_; + +}; + + + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_DBUS_PROXY_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionDBusStubAdapter.cpp b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionDBusStubAdapter.cpp new file mode 100644 index 0000000..db19749 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionDBusStubAdapter.cpp @@ -0,0 +1,237 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +#include "EnhancedPositionDBusStubAdapter.h" +#include <org/genivi/EnhancedPositionService/EnhancedPosition.h> + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createEnhancedPositionDBusStubAdapter( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection, + const std::shared_ptr<CommonAPI::StubBase>& stubBase) { + return std::make_shared<EnhancedPositionDBusStubAdapter>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase); +} + +INITIALIZER(registerEnhancedPositionDBusStubAdapter) { + CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(EnhancedPosition::getInterfaceId(), + &createEnhancedPositionDBusStubAdapter); +} + + + +EnhancedPositionDBusStubAdapterInternal::~EnhancedPositionDBusStubAdapterInternal() { + deactivateManagedInstances(); + EnhancedPositionDBusStubAdapterHelper::deinit(); +} + +void EnhancedPositionDBusStubAdapterInternal::deactivateManagedInstances() { + +} + +const char* EnhancedPositionDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const { + static const std::string introspectionData = + "<method name=\"getInterfaceVersion\">\n" + "<arg name=\"value\" type=\"uu\" direction=\"out\" />" + "</method>\n" + /** + * 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 + */ + "<signal name=\"PositionUpdate\">\n" + "<arg name=\"changedValues\" type=\"t\" />\n" + "</signal>\n" + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + "<method name=\"GetVersion\">\n" + "<arg name=\"version\" type=\"(qqqs)\" direction=\"out\" />\n" + "</method>\n" + /** + * 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 name=\"GetPositionInfo\">\n" + "<arg name=\"valuesToReturn\" type=\"t\" direction=\"in\" />\n" + "<arg name=\"timestamp\" type=\"t\" direction=\"out\" />\n" + "<arg name=\"data\" type=\"a{i(yv)}\" direction=\"out\" />\n" + "</method>\n" + /** + * 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 name=\"GetSatelliteInfo\">\n" + "<arg name=\"timestamp\" type=\"t\" direction=\"out\" />\n" + "<arg name=\"satelliteInfo\" type=\"(iuuuub)\" direction=\"out\" />\n" + "</method>\n" + /** + * GetTime = This method returns UTC time and date. + Note: If a + * requested value is invalid, it's not returned to the client application + */ + "<method name=\"GetTime\">\n" + "<arg name=\"timestamp\" type=\"t\" direction=\"out\" />\n" + "<arg name=\"time\" type=\"a{i(yv)}\" direction=\"out\" />\n" + "</method>\n" + + ; + return introspectionData.c_str(); +} + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + EnhancedPositionStub, + CommonAPI::Version + > EnhancedPositionDBusStubAdapterInternal::getEnhancedPositionInterfaceVersionStubDispatcher(&EnhancedPositionStub::getInterfaceVersion, "uu"); + + + +/** + * GetVersion = This method returns the API version implemented by the server + * application + */ +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + EnhancedPositionStub, + std::tuple<>, + std::tuple<EnhancedPositionServiceTypes::Version> + > EnhancedPositionDBusStubAdapterInternal::getVersionStubDispatcher(&EnhancedPositionStub::GetVersion, "(qqqs)"); +/** + * 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 + */ +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + EnhancedPositionStub, + std::tuple<EnhancedPositionServiceTypes::Bitmask>, + std::tuple<EnhancedPositionServiceTypes::Timestamp, EnhancedPositionServiceTypes::PositionInfo> + > EnhancedPositionDBusStubAdapterInternal::getPositionInfoStubDispatcher(&EnhancedPositionStub::GetPositionInfo, "ta{i(yv)}"); +/** + * 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 + */ +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + EnhancedPositionStub, + std::tuple<>, + std::tuple<EnhancedPositionServiceTypes::Timestamp, EnhancedPositionServiceTypes::SatelliteInfo> + > EnhancedPositionDBusStubAdapterInternal::getSatelliteInfoStubDispatcher(&EnhancedPositionStub::GetSatelliteInfo, "t(iuuuub)"); +/** + * GetTime = This method returns UTC time and date. + Note: If a + * requested value is invalid, it's not returned to the client application + */ +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + EnhancedPositionStub, + std::tuple<>, + std::tuple<EnhancedPositionServiceTypes::Timestamp, EnhancedPositionServiceTypes::TimeInfo> + > EnhancedPositionDBusStubAdapterInternal::getTimeStubDispatcher(&EnhancedPositionStub::GetTime, "ta{i(yv)}"); + + + +/** + * 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 + */ +void EnhancedPositionDBusStubAdapterInternal::firePositionUpdateEvent(const EnhancedPositionServiceTypes::Bitmask& changedValues) { + CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::Bitmask>> + ::sendSignal( + *this, + "PositionUpdate", + "t", + changedValues + ); +} + + +const EnhancedPositionDBusStubAdapterHelper::StubDispatcherTable& EnhancedPositionDBusStubAdapterInternal::getStubDispatcherTable() { + return stubDispatcherTable_; +} + +const CommonAPI::DBus::StubAttributeTable& EnhancedPositionDBusStubAdapterInternal::getStubAttributeTable() { + return stubAttributeTable_; +} + +EnhancedPositionDBusStubAdapterInternal::EnhancedPositionDBusStubAdapterInternal( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection, + const std::shared_ptr<CommonAPI::StubBase>& stub): + CommonAPI::DBus::DBusStubAdapter( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + false), + EnhancedPositionDBusStubAdapterHelper( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + std::dynamic_pointer_cast<EnhancedPositionStub>(stub), + false), + stubDispatcherTable_({ + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + { { "GetVersion", "" }, &org::genivi::EnhancedPositionService::EnhancedPositionDBusStubAdapterInternal::getVersionStubDispatcher }, + /** + * 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 + */ + { { "GetPositionInfo", "t" }, &org::genivi::EnhancedPositionService::EnhancedPositionDBusStubAdapterInternal::getPositionInfoStubDispatcher }, + /** + * 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 + */ + { { "GetSatelliteInfo", "" }, &org::genivi::EnhancedPositionService::EnhancedPositionDBusStubAdapterInternal::getSatelliteInfoStubDispatcher }, + /** + * GetTime = This method returns UTC time and date. + Note: If a + * requested value is invalid, it's not returned to the client application + */ + { { "GetTime", "" }, &org::genivi::EnhancedPositionService::EnhancedPositionDBusStubAdapterInternal::getTimeStubDispatcher } + }), + stubAttributeTable_() { + + stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &org::genivi::EnhancedPositionService::EnhancedPositionDBusStubAdapterInternal::getEnhancedPositionInterfaceVersionStubDispatcher }); +} + +const bool EnhancedPositionDBusStubAdapterInternal::hasFreedesktopProperties() { + return false; +} + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionDBusStubAdapter.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionDBusStubAdapter.h new file mode 100644 index 0000000..f6c0df6 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionDBusStubAdapter.h @@ -0,0 +1,158 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * EnhancedPosition = This interface offers functionalities to retrieve the + * enhanced position of the vehicle + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_DBUS_STUB_ADAPTER_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_DBUS_STUB_ADAPTER_H_ + +#include <org/genivi/EnhancedPositionService/EnhancedPositionStub.h> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusStubAdapterHelper.h> +#include <CommonAPI/DBus/DBusStubAdapter.h> +#include <CommonAPI/DBus/DBusFactory.h> +#include <CommonAPI/DBus/DBusServicePublisher.h> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +typedef CommonAPI::DBus::DBusStubAdapterHelper<EnhancedPositionStub> EnhancedPositionDBusStubAdapterHelper; + +class EnhancedPositionDBusStubAdapterInternal: public virtual EnhancedPositionStubAdapter, public EnhancedPositionDBusStubAdapterHelper { + public: + EnhancedPositionDBusStubAdapterInternal( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection, + const std::shared_ptr<CommonAPI::StubBase>& stub); + + ~EnhancedPositionDBusStubAdapterInternal(); + + virtual const bool hasFreedesktopProperties(); + + + /** + * 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 + */ + void firePositionUpdateEvent(const EnhancedPositionServiceTypes::Bitmask& changedValues); + + + const EnhancedPositionDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable(); + const CommonAPI::DBus::StubAttributeTable& getStubAttributeTable(); + + void deactivateManagedInstances(); + + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + EnhancedPositionStub, + CommonAPI::Version + > getEnhancedPositionInterfaceVersionStubDispatcher; + + + +/** + * GetVersion = This method returns the API version implemented by the server + * application + */ +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + EnhancedPositionStub, + std::tuple<>, + std::tuple<EnhancedPositionServiceTypes::Version> + > getVersionStubDispatcher; +/** + * 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 + */ +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + EnhancedPositionStub, + std::tuple<EnhancedPositionServiceTypes::Bitmask>, + std::tuple<EnhancedPositionServiceTypes::Timestamp, EnhancedPositionServiceTypes::PositionInfo> + > getPositionInfoStubDispatcher; +/** + * 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 + */ +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + EnhancedPositionStub, + std::tuple<>, + std::tuple<EnhancedPositionServiceTypes::Timestamp, EnhancedPositionServiceTypes::SatelliteInfo> + > getSatelliteInfoStubDispatcher; +/** + * GetTime = This method returns UTC time and date. + Note: If a + * requested value is invalid, it's not returned to the client application + */ +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + EnhancedPositionStub, + std::tuple<>, + std::tuple<EnhancedPositionServiceTypes::Timestamp, EnhancedPositionServiceTypes::TimeInfo> + > getTimeStubDispatcher; + + + + + protected: + virtual const char* getMethodsDBusIntrospectionXmlData() const; + + private: + EnhancedPositionDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_; + CommonAPI::DBus::StubAttributeTable stubAttributeTable_; +}; + +class EnhancedPositionDBusStubAdapter: public EnhancedPositionDBusStubAdapterInternal, public std::enable_shared_from_this<EnhancedPositionDBusStubAdapter> { +public: + EnhancedPositionDBusStubAdapter( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection, + const std::shared_ptr<CommonAPI::StubBase>& stub) : + CommonAPI::DBus::DBusStubAdapter( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + false), + EnhancedPositionDBusStubAdapterInternal( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + stub) { } +}; + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_DBUS_STUB_ADAPTER_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionProxy.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionProxy.h new file mode 100644 index 0000000..1c377f0 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionProxy.h @@ -0,0 +1,324 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * EnhancedPosition = This interface offers functionalities to retrieve the + * enhanced position of the vehicle + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_PROXY_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_PROXY_H_ + +#include "EnhancedPositionProxyBase.h" + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +template <typename ... _AttributeExtensions> +class EnhancedPositionProxy: virtual public EnhancedPosition, virtual public EnhancedPositionProxyBase +, public _AttributeExtensions... { +public: + EnhancedPositionProxy(std::shared_ptr<CommonAPI::Proxy> delegate); + ~EnhancedPositionProxy(); + + typedef EnhancedPosition InterfaceType; + + + + /** + * 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 + */ + /** + * Returns the wrapper class that provides access to the broadcast PositionUpdate. + */ + virtual PositionUpdateEvent& getPositionUpdateEvent() { + return delegate_->getPositionUpdateEvent(); + } + + /** + * GetVersion = This method returns the API version implemented by the server + * application + * + * Calls GetVersion with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version); + /** + * Calls GetVersion with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> GetVersionAsync(GetVersionAsyncCallback callback); + /** + * 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 + * + * Calls GetPositionInfo with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void GetPositionInfo(const EnhancedPositionServiceTypes::Bitmask& valuesToReturn, CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::PositionInfo& data); + /** + * Calls GetPositionInfo with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> GetPositionInfoAsync(const EnhancedPositionServiceTypes::Bitmask& valuesToReturn, GetPositionInfoAsyncCallback callback); + /** + * 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 + * + * Calls GetSatelliteInfo with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void GetSatelliteInfo(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::SatelliteInfo& satelliteInfo); + /** + * Calls GetSatelliteInfo with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> GetSatelliteInfoAsync(GetSatelliteInfoAsyncCallback callback); + /** + * GetTime = This method returns UTC time and date. + Note: If a + * requested value is invalid, it's not returned to the client application + * + * Calls GetTime with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void GetTime(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::TimeInfo& time); + /** + * Calls GetTime with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> GetTimeAsync(GetTimeAsyncCallback callback); + + + /** + * Returns the CommonAPI address of the remote partner this proxy communicates with. + */ + virtual std::string getAddress() const; + + /** + * Returns the domain of the remote partner this proxy communicates with. + */ + virtual const std::string& getDomain() const; + + /** + * Returns the service ID of the remote partner this proxy communicates with. + */ + virtual const std::string& getServiceId() const; + + /** + * Returns the instance ID of the remote partner this proxy communicates with. + */ + virtual const std::string& getInstanceId() const; + + /** + * Returns true if the remote partner for this proxy is currently known to be available. + */ + virtual bool isAvailable() const; + + /** + * Returns true if the remote partner for this proxy is available. + */ + virtual bool isAvailableBlocking() const; + + /** + * Returns the wrapper class that is used to (de-)register for notifications about + * the availability of the remote partner of this proxy. + */ + virtual CommonAPI::ProxyStatusEvent& getProxyStatusEvent(); + + /** + * Returns the wrapper class that is used to access version information of the remote + * partner of this proxy. + */ + virtual CommonAPI::InterfaceVersionAttribute& getInterfaceVersionAttribute(); + + private: + std::shared_ptr<EnhancedPositionProxyBase> delegate_; +}; + +#ifdef WIN32 + typedef EnhancedPositionProxy<CommonAPI::WINDummyAttributeExtension<CommonAPI::WINDummyAttribute>> EnhancedPositionProxyDefault; +#else + typedef EnhancedPositionProxy<> EnhancedPositionProxyDefault; +#endif + + +// +// EnhancedPositionProxy Implementation +// +template <typename ... _AttributeExtensions> +EnhancedPositionProxy<_AttributeExtensions...>::EnhancedPositionProxy(std::shared_ptr<CommonAPI::Proxy> delegate): + _AttributeExtensions(*(std::dynamic_pointer_cast<EnhancedPositionProxyBase>(delegate)))..., + delegate_(std::dynamic_pointer_cast<EnhancedPositionProxyBase>(delegate)) { +} + +template <typename ... _AttributeExtensions> +EnhancedPositionProxy<_AttributeExtensions...>::~EnhancedPositionProxy() { +} + +/** + * GetVersion = This method returns the API version implemented by the server + * application + */ +template <typename ... _AttributeExtensions> +void EnhancedPositionProxy<_AttributeExtensions...>::GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version) { + delegate_->GetVersion(callStatus, version); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> EnhancedPositionProxy<_AttributeExtensions...>::GetVersionAsync(GetVersionAsyncCallback callback) { + return delegate_->GetVersionAsync(callback); +} +/** + * 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 + */ +template <typename ... _AttributeExtensions> +void EnhancedPositionProxy<_AttributeExtensions...>::GetPositionInfo(const EnhancedPositionServiceTypes::Bitmask& valuesToReturn, CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::PositionInfo& data) { + delegate_->GetPositionInfo(valuesToReturn, callStatus, timestamp, data); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> EnhancedPositionProxy<_AttributeExtensions...>::GetPositionInfoAsync(const EnhancedPositionServiceTypes::Bitmask& valuesToReturn, GetPositionInfoAsyncCallback callback) { + return delegate_->GetPositionInfoAsync(valuesToReturn, callback); +} +/** + * 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 + */ +template <typename ... _AttributeExtensions> +void EnhancedPositionProxy<_AttributeExtensions...>::GetSatelliteInfo(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::SatelliteInfo& satelliteInfo) { + delegate_->GetSatelliteInfo(callStatus, timestamp, satelliteInfo); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> EnhancedPositionProxy<_AttributeExtensions...>::GetSatelliteInfoAsync(GetSatelliteInfoAsyncCallback callback) { + return delegate_->GetSatelliteInfoAsync(callback); +} +/** + * GetTime = This method returns UTC time and date. + Note: If a + * requested value is invalid, it's not returned to the client application + */ +template <typename ... _AttributeExtensions> +void EnhancedPositionProxy<_AttributeExtensions...>::GetTime(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::TimeInfo& time) { + delegate_->GetTime(callStatus, timestamp, time); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> EnhancedPositionProxy<_AttributeExtensions...>::GetTimeAsync(GetTimeAsyncCallback callback) { + return delegate_->GetTimeAsync(callback); +} + +template <typename ... _AttributeExtensions> +std::string EnhancedPositionProxy<_AttributeExtensions...>::getAddress() const { + return delegate_->getAddress(); +} + +template <typename ... _AttributeExtensions> +const std::string& EnhancedPositionProxy<_AttributeExtensions...>::getDomain() const { + return delegate_->getDomain(); +} + +template <typename ... _AttributeExtensions> +const std::string& EnhancedPositionProxy<_AttributeExtensions...>::getServiceId() const { + return delegate_->getServiceId(); +} + +template <typename ... _AttributeExtensions> +const std::string& EnhancedPositionProxy<_AttributeExtensions...>::getInstanceId() const { + return delegate_->getInstanceId(); +} + +template <typename ... _AttributeExtensions> +bool EnhancedPositionProxy<_AttributeExtensions...>::isAvailable() const { + return delegate_->isAvailable(); +} + +template <typename ... _AttributeExtensions> +bool EnhancedPositionProxy<_AttributeExtensions...>::isAvailableBlocking() const { + return delegate_->isAvailableBlocking(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::ProxyStatusEvent& EnhancedPositionProxy<_AttributeExtensions...>::getProxyStatusEvent() { + return delegate_->getProxyStatusEvent(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::InterfaceVersionAttribute& EnhancedPositionProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() { + return delegate_->getInterfaceVersionAttribute(); +} + + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_PROXY_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionProxyBase.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionProxyBase.h new file mode 100644 index 0000000..cb3296e --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionProxyBase.h @@ -0,0 +1,97 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * EnhancedPosition = This interface offers functionalities to retrieve the + * enhanced position of the vehicle + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_PROXY_BASE_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_PROXY_BASE_H_ + +#include "EnhancedPosition.h" + + +#include <org/genivi/EnhancedPositionService/EnhancedPositionServiceTypes.h> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/InputStream.h> +#include <CommonAPI/OutputStream.h> +#include <CommonAPI/SerializableStruct.h> +#include <cstdint> +#include <string> +#include <unordered_map> +#include <vector> + +#include <CommonAPI/Event.h> +#include <CommonAPI/Proxy.h> +#include <functional> +#include <future> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +class EnhancedPositionProxyBase: virtual public CommonAPI::Proxy { + public: + typedef CommonAPI::Event<EnhancedPositionServiceTypes::Bitmask> PositionUpdateEvent; + + typedef std::function<void(const CommonAPI::CallStatus&, const EnhancedPositionServiceTypes::Version&)> GetVersionAsyncCallback; + typedef std::function<void(const CommonAPI::CallStatus&, const EnhancedPositionServiceTypes::Timestamp&, const EnhancedPositionServiceTypes::PositionInfo&)> GetPositionInfoAsyncCallback; + typedef std::function<void(const CommonAPI::CallStatus&, const EnhancedPositionServiceTypes::Timestamp&, const EnhancedPositionServiceTypes::SatelliteInfo&)> GetSatelliteInfoAsyncCallback; + typedef std::function<void(const CommonAPI::CallStatus&, const EnhancedPositionServiceTypes::Timestamp&, const EnhancedPositionServiceTypes::TimeInfo&)> GetTimeAsyncCallback; + + + /** + * 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 + */ + virtual PositionUpdateEvent& getPositionUpdateEvent() = 0; + + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + virtual void GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version) = 0; + virtual std::future<CommonAPI::CallStatus> GetVersionAsync(GetVersionAsyncCallback callback) = 0; + /** + * 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 + */ + virtual void GetPositionInfo(const EnhancedPositionServiceTypes::Bitmask& valuesToReturn, CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::PositionInfo& data) = 0; + virtual std::future<CommonAPI::CallStatus> GetPositionInfoAsync(const EnhancedPositionServiceTypes::Bitmask& valuesToReturn, GetPositionInfoAsyncCallback callback) = 0; + /** + * 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 + */ + virtual void GetSatelliteInfo(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::SatelliteInfo& satelliteInfo) = 0; + virtual std::future<CommonAPI::CallStatus> GetSatelliteInfoAsync(GetSatelliteInfoAsyncCallback callback) = 0; + /** + * GetTime = This method returns UTC time and date. + Note: If a + * requested value is invalid, it's not returned to the client application + */ + virtual void GetTime(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::TimeInfo& time) = 0; + virtual std::future<CommonAPI::CallStatus> GetTimeAsync(GetTimeAsyncCallback callback) = 0; +}; + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_PROXY_BASE_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionServiceTypes.cpp b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionServiceTypes.cpp new file mode 100644 index 0000000..b83d313 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionServiceTypes.cpp @@ -0,0 +1,110 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +#include "EnhancedPositionServiceTypes.h" + + +namespace org { +namespace genivi { +namespace EnhancedPositionService { +namespace EnhancedPositionServiceTypes { + + + + +Version::Version(const uint16_t& majValue, const uint16_t& minValue, const uint16_t& micValue, const std::string& dateValue): + maj(majValue), + min(minValue), + mic(micValue), + date(dateValue) +{ +} + + +bool operator==(const Version& lhs, const Version& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.maj == rhs.maj && + lhs.min == rhs.min && + lhs.mic == rhs.mic && + lhs.date == rhs.date + ; +} + +void Version::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> maj; + inputStream >> min; + inputStream >> mic; + inputStream >> date; +} + +void Version::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << maj; + outputStream << min; + outputStream << mic; + outputStream << date; +} + + + + + +SatelliteInfo::SatelliteInfo(const SatelliteSystem& systemValue, const uint32_t& satellitIdValue, const uint32_t& azimuthValue, const uint32_t& elevationValue, const uint32_t& snrValue, const bool& inUseValue): + system(systemValue), + satellitId(satellitIdValue), + azimuth(azimuthValue), + elevation(elevationValue), + snr(snrValue), + inUse(inUseValue) +{ +} + + +bool operator==(const SatelliteInfo& lhs, const SatelliteInfo& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.system == rhs.system && + lhs.satellitId == rhs.satellitId && + lhs.azimuth == rhs.azimuth && + lhs.elevation == rhs.elevation && + lhs.snr == rhs.snr && + lhs.inUse == rhs.inUse + ; +} + +void SatelliteInfo::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> system; + inputStream >> satellitId; + inputStream >> azimuth; + inputStream >> elevation; + inputStream >> snr; + inputStream >> inUse; +} + +void SatelliteInfo::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << system; + outputStream << satellitId; + outputStream << azimuth; + outputStream << elevation; + outputStream << snr; + outputStream << inUse; +} + + + + + +} // namespace EnhancedPositionServiceTypes +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionServiceTypes.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionServiceTypes.h new file mode 100644 index 0000000..9c1f85a --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionServiceTypes.h @@ -0,0 +1,632 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_Service_Types_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_Service_Types_H_ + + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/InputStream.h> +#include <CommonAPI/OutputStream.h> +#include <CommonAPI/SerializableStruct.h> +#include <CommonAPI/SerializableVariant.h> +#include <CommonAPI/types.h> +#include <cstdint> +#include <memory> +#include <string> +#include <unordered_map> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +namespace EnhancedPositionServiceTypes { + typedef uint64_t Timestamp; + /** + * bitmask obtained as a result of an OR operation on enum values of type + * PositionInfoKey + */ + /** + * bitmask obtained as a result of an OR operation on enum values of type + * PositionInfoKey + */ + typedef uint64_t Bitmask; + /** + * version + */ + /** + * version + */ + struct Version: CommonAPI::SerializableStruct { + /** + * when the major changes, then backward compatibility with previous releases is + * not granted + */ + uint16_t maj; + /** + * 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_t min; + /** + * when the micro changes, then backward compatibility with previous releases is + * granted (bug fixes or documentation modifications) + */ + uint16_t mic; + /** + * release date (e.g. 21-06-2011) + */ + std::string date; + + Version() = default; + Version(const uint16_t& maj, const uint16_t& min, const uint16_t& mic, const std::string& date); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeStringType(); + } + }; + /** + * Value = generic value (mapped to a dbus variant ('v') data type) + */ + /** + * Value = generic value (mapped to a dbus variant ('v') data type) + */ + typedef CommonAPI::Variant<uint64_t, double, float, std::string> Value; + enum class PositionInfoKey: int32_t { + LATITUDE = 0x1, + LONGITUDE = 0x2, + ALTITUDE = 0x4, + HEADING = 0x8, + SPEED = 0x10, + CLIMB = 0x20, + ROLL_RATE = 0x40, + PITCH_RATE = 0x80, + YAW_RATE = 0x100, + PDOP = 0x200, + HDOP = 0x400, + VDOP = 0x800, + USED_SATELLITES = 0x1000, + TRACKED_SATELLITES = 0x2000, + VISIBLE_SATELLITES = 0x4000, + SIGMA_HPOSITION = 0x8000, + SIGMA_ALTITUDE = 0x10000, + SIGMA_HEADING = 0x20000, + SIGMA_SPEED = 0x40000, + SIGMA_CLIMB = 0x80000, + GNSS_FIX_STATUS = 0x100000, + DR_STATUS = 0x200000, + RELIABILTY_INDEX = 0x400000 + }; + + // Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct PositionInfoKeyComparator; + /** + * 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 + */ + /** + * 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 + */ + typedef std::unordered_map<PositionInfoKey, Value, CommonAPI::EnumHasher<PositionInfoKey>> PositionInfo; + enum class SatelliteSystem: int32_t { + GPS = 0x1, + GLONASS = 0x2, + GALILEO = 0x3, + COMPASS = 0x4 + }; + + // Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct SatelliteSystemComparator; + /** + * 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) + */ + /** + * 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: CommonAPI::SerializableStruct { + SatelliteSystem system; + uint32_t satellitId; + uint32_t azimuth; + uint32_t elevation; + uint32_t snr; + bool inUse; + + SatelliteInfo() = default; + SatelliteInfo(const SatelliteSystem& system, const uint32_t& satellitId, const uint32_t& azimuth, const uint32_t& elevation, const uint32_t& snr, const bool& inUse); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeInt32Type(); + typeOutputStream.writeUInt32Type(); + typeOutputStream.writeUInt32Type(); + typeOutputStream.writeUInt32Type(); + typeOutputStream.writeUInt32Type(); + typeOutputStream.writeBoolType(); + } + }; + enum class TimeInfoKey: int32_t { + YEAR = 0x1000000, + MONTH = 0x2000000, + DAY = 0x4000000, + HOUR = 0x8000000, + MINUTE = 0x10000000, + SECOND = 0x20000000, + MS = 0x40000000 + }; + + // Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct TimeInfoKeyComparator; + /** + * TimeInfo = array of tuples (key,value) + key = enumeration + * TimeInfoKey + 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 + key = + * HOUR, value = value of type 'UInt8', 2 digits number that indicates the hour. + * Range [0:23]. Example: 01 + key = MINUTE, value = value of type + * 'UInt8', 2 digits number that represents the minutes. Range [0:59]. Example: + * 01 + key = SECOND, value = value of type 'UInt8', 2 digits number + * that represents the seconds. Range [0:59]. Example: 01 + key = MS, + * value = value of type 'UInt16', 3 digits number that represents the + * milliseconds. Range [0:999]. Example: 007 + */ + /** + * TimeInfo = array of tuples (key,value) + key = enumeration + * TimeInfoKey + 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 + key = + * HOUR, value = value of type 'UInt8', 2 digits number that indicates the hour. + * Range [0:23]. Example: 01 + key = MINUTE, value = value of type + * 'UInt8', 2 digits number that represents the minutes. Range [0:59]. Example: + * 01 + key = SECOND, value = value of type 'UInt8', 2 digits number + * that represents the seconds. Range [0:59]. Example: 01 + key = MS, + * value = value of type 'UInt16', 3 digits number that represents the + * milliseconds. Range [0:999]. Example: 007 + */ + typedef std::unordered_map<TimeInfoKey, Value, CommonAPI::EnumHasher<TimeInfoKey>> TimeInfo; + enum class PositionFeedbackKey: int32_t { + LATITUDE = 0x1, + LONGITUDE = 0x2, + ALTITUDE = 0x4, + HEADING = 0x8, + SPEED = 0x10, + CLIMB = 0x20, + RELIABILTY_INDEX = 0x400000 + }; + + // Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct PositionFeedbackKeyComparator; + enum class PositionFeedbackType: int32_t { + MAP_MATCHED_FEEDBACK = 0x1, + TEST_FEEDBACK = 0x2 + }; + + // Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct PositionFeedbackTypeComparator; + +bool operator==(const Version& lhs, const Version& rhs); +inline bool operator!=(const Version& lhs, const Version& rhs) { + return !(lhs == rhs); +} +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, PositionInfoKey& enumValue) { + return inputStream.readEnumValue<int32_t>(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const PositionInfoKey& enumValue) { + return outputStream.writeEnumValue(static_cast<int32_t>(enumValue)); +} + +struct PositionInfoKeyComparator { + inline bool operator()(const PositionInfoKey& lhs, const PositionInfoKey& rhs) const { + return static_cast<int32_t>(lhs) < static_cast<int32_t>(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, SatelliteSystem& enumValue) { + return inputStream.readEnumValue<int32_t>(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const SatelliteSystem& enumValue) { + return outputStream.writeEnumValue(static_cast<int32_t>(enumValue)); +} + +struct SatelliteSystemComparator { + inline bool operator()(const SatelliteSystem& lhs, const SatelliteSystem& rhs) const { + return static_cast<int32_t>(lhs) < static_cast<int32_t>(rhs); + } +}; + +bool operator==(const SatelliteInfo& lhs, const SatelliteInfo& rhs); +inline bool operator!=(const SatelliteInfo& lhs, const SatelliteInfo& rhs) { + return !(lhs == rhs); +} +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, TimeInfoKey& enumValue) { + return inputStream.readEnumValue<int32_t>(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const TimeInfoKey& enumValue) { + return outputStream.writeEnumValue(static_cast<int32_t>(enumValue)); +} + +struct TimeInfoKeyComparator { + inline bool operator()(const TimeInfoKey& lhs, const TimeInfoKey& rhs) const { + return static_cast<int32_t>(lhs) < static_cast<int32_t>(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, PositionFeedbackKey& enumValue) { + return inputStream.readEnumValue<int32_t>(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const PositionFeedbackKey& enumValue) { + return outputStream.writeEnumValue(static_cast<int32_t>(enumValue)); +} + +struct PositionFeedbackKeyComparator { + inline bool operator()(const PositionFeedbackKey& lhs, const PositionFeedbackKey& rhs) const { + return static_cast<int32_t>(lhs) < static_cast<int32_t>(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, PositionFeedbackType& enumValue) { + return inputStream.readEnumValue<int32_t>(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const PositionFeedbackType& enumValue) { + return outputStream.writeEnumValue(static_cast<int32_t>(enumValue)); +} + +struct PositionFeedbackTypeComparator { + inline bool operator()(const PositionFeedbackType& lhs, const PositionFeedbackType& rhs) const { + return static_cast<int32_t>(lhs) < static_cast<int32_t>(rhs); + } +}; + + + +static inline const char* getTypeCollectionName() { + static const char* typeCollectionName = "org.genivi.EnhancedPositionService.EnhancedPositionServiceTypes"; + return typeCollectionName; +} + + +} // namespace EnhancedPositionServiceTypes + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +namespace CommonAPI { + + template<> + struct BasicTypeWriter<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionInfoKey> { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionInfoKey> { + static void beginReadVector(InputStream& inputStream, const std::vector<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionInfoKey>& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionInfoKey> { + static void beginWriteVector(OutputStream& outputStream, const std::vector<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionInfoKey>& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::SatelliteSystem> { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::SatelliteSystem> { + static void beginReadVector(InputStream& inputStream, const std::vector<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::SatelliteSystem>& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::SatelliteSystem> { + static void beginWriteVector(OutputStream& outputStream, const std::vector<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::SatelliteSystem>& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::TimeInfoKey> { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::TimeInfoKey> { + static void beginReadVector(InputStream& inputStream, const std::vector<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::TimeInfoKey>& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::TimeInfoKey> { + static void beginWriteVector(OutputStream& outputStream, const std::vector<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::TimeInfoKey>& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionFeedbackKey> { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionFeedbackKey> { + static void beginReadVector(InputStream& inputStream, const std::vector<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionFeedbackKey>& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionFeedbackKey> { + static void beginWriteVector(OutputStream& outputStream, const std::vector<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionFeedbackKey>& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionFeedbackType> { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionFeedbackType> { + static void beginReadVector(InputStream& inputStream, const std::vector<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionFeedbackType>& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionFeedbackType> { + static void beginWriteVector(OutputStream& outputStream, const std::vector<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionFeedbackType>& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + +} + + +namespace std { + //Hash for PositionInfoKey + template<> + struct hash<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionInfoKey> { + inline size_t operator()(const org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionInfoKey& positionInfoKey) const { + return static_cast<int32_t>(positionInfoKey); + } + }; + //Hash for SatelliteSystem + template<> + struct hash<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::SatelliteSystem> { + inline size_t operator()(const org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::SatelliteSystem& satelliteSystem) const { + return static_cast<int32_t>(satelliteSystem); + } + }; + //Hash for TimeInfoKey + template<> + struct hash<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::TimeInfoKey> { + inline size_t operator()(const org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::TimeInfoKey& timeInfoKey) const { + return static_cast<int32_t>(timeInfoKey); + } + }; + //Hash for PositionFeedbackKey + template<> + struct hash<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionFeedbackKey> { + inline size_t operator()(const org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionFeedbackKey& positionFeedbackKey) const { + return static_cast<int32_t>(positionFeedbackKey); + } + }; + //Hash for PositionFeedbackType + template<> + struct hash<org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionFeedbackType> { + inline size_t operator()(const org::genivi::EnhancedPositionService::EnhancedPositionServiceTypes::PositionFeedbackType& positionFeedbackType) const { + return static_cast<int32_t>(positionFeedbackType); + } + }; +} + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_Service_Types_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionStub.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionStub.h new file mode 100644 index 0000000..6381d59 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionStub.h @@ -0,0 +1,148 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * EnhancedPosition = This interface offers functionalities to retrieve the + * enhanced position of the vehicle + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_STUB_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_STUB_H_ + + + +#include <org/genivi/EnhancedPositionService/EnhancedPositionServiceTypes.h> + +#include "EnhancedPosition.h" + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/InputStream.h> +#include <CommonAPI/OutputStream.h> +#include <CommonAPI/SerializableStruct.h> +#include <cstdint> +#include <string> +#include <unordered_map> +#include <unordered_set> +#include <vector> + +#include <CommonAPI/Stub.h> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +/** + * Receives messages from remote and handles all dispatching of deserialized calls + * to a stub for the service EnhancedPosition. Also provides means to send broadcasts + * and attribute-changed-notifications of observable attributes as defined by this service. + * An application developer should not need to bother with this class. + */ +class EnhancedPositionStubAdapter: virtual public CommonAPI::StubAdapter, public EnhancedPosition { + public: + + /** + * Sends a broadcast event for PositionUpdate. Should not be called directly. + * Instead, the "fire<broadcastName>Event" methods of the stub should be used. + */ + virtual void firePositionUpdateEvent(const EnhancedPositionServiceTypes::Bitmask& changedValues) = 0; + + + virtual void deactivateManagedInstances() = 0; +protected: + /** + * Defines properties for storing the ClientIds of clients / proxies that have + * subscribed to the selective broadcasts + */ +}; + + +/** + * Defines the necessary callbacks to handle remote set events related to the attributes + * defined in the IDL description for EnhancedPosition. + * For each attribute two callbacks are defined: + * - a verification callback that allows to verify the requested value and to prevent setting + * e.g. an invalid value ("onRemoteSet<AttributeName>"). + * - an action callback to do local work after the attribute value has been changed + * ("onRemote<AttributeName>Changed"). + * + * This class and the one below are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class EnhancedPositionStubRemoteEvent { + public: + virtual ~EnhancedPositionStubRemoteEvent() { } + +}; + + +/** + * Defines the interface that must be implemented by any class that should provide + * the service EnhancedPosition to remote clients. + * This class and the one above are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class EnhancedPositionStub: public virtual CommonAPI::Stub<EnhancedPositionStubAdapter, EnhancedPositionStubRemoteEvent> { +public: + virtual ~EnhancedPositionStub() { } + virtual const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) = 0; + + + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + /// This is the method that will be called on remote calls on the method GetVersion. + virtual void GetVersion(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Version& version) = 0; + /** + * 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 + */ + /// This is the method that will be called on remote calls on the method GetPositionInfo. + virtual void GetPositionInfo(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Bitmask valuesToReturn, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::PositionInfo& data) = 0; + /** + * 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 + */ + /// This is the method that will be called on remote calls on the method GetSatelliteInfo. + virtual void GetSatelliteInfo(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::SatelliteInfo& satelliteInfo) = 0; + /** + * GetTime = This method returns UTC time and date. + Note: If a + * requested value is invalid, it's not returned to the client application + */ + /// This is the method that will be called on remote calls on the method GetTime. + virtual void GetTime(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::TimeInfo& time) = 0; + /** + * 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 + */ + /// Sends a broadcast event for PositionUpdate. + virtual void firePositionUpdateEvent(const EnhancedPositionServiceTypes::Bitmask& changedValues) = 0; + + using CommonAPI::Stub<EnhancedPositionStubAdapter, EnhancedPositionStubRemoteEvent>::initStubAdapter; + typedef CommonAPI::Stub<EnhancedPositionStubAdapter, EnhancedPositionStubRemoteEvent>::StubAdapterType StubAdapterType; + typedef CommonAPI::Stub<EnhancedPositionStubAdapter, EnhancedPositionStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType; + typedef EnhancedPositionStubRemoteEvent RemoteEventType; + typedef EnhancedPosition StubInterface; +}; + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_STUB_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionStubDefault.cpp b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionStubDefault.cpp new file mode 100644 index 0000000..3cbb5f0 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionStubDefault.cpp @@ -0,0 +1,101 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +#include <org/genivi/EnhancedPositionService/EnhancedPositionStubDefault.h> + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +EnhancedPositionStubDefault::EnhancedPositionStubDefault(): + remoteEventHandler_(this), + interfaceVersion_(EnhancedPosition::getInterfaceVersion()) { +} + +const CommonAPI::Version& EnhancedPositionStubDefault::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) { + return interfaceVersion_; +} + +EnhancedPositionStubRemoteEvent* EnhancedPositionStubDefault::initStubAdapter(const std::shared_ptr<EnhancedPositionStubAdapter>& stubAdapter) { + CommonAPI::Stub<EnhancedPositionStubAdapter, EnhancedPositionStubRemoteEvent>::stubAdapter_ = stubAdapter; + return &remoteEventHandler_; +} + + +/** + * GetVersion = This method returns the API version implemented by the server + * application + */ +void EnhancedPositionStubDefault::GetVersion(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Version& version) { + // Call old style methods in default + GetVersion(version); +} +void EnhancedPositionStubDefault::GetVersion(EnhancedPositionServiceTypes::Version& version) { + // No operation in default +} + +/** + * 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 + */ +void EnhancedPositionStubDefault::GetPositionInfo(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Bitmask valuesToReturn, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::PositionInfo& data) { + // Call old style methods in default + GetPositionInfo(valuesToReturn, timestamp, data); +} +void EnhancedPositionStubDefault::GetPositionInfo(EnhancedPositionServiceTypes::Bitmask valuesToReturn, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::PositionInfo& data) { + // No operation in default +} + +/** + * 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 + */ +void EnhancedPositionStubDefault::GetSatelliteInfo(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::SatelliteInfo& satelliteInfo) { + // Call old style methods in default + GetSatelliteInfo(timestamp, satelliteInfo); +} +void EnhancedPositionStubDefault::GetSatelliteInfo(EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::SatelliteInfo& satelliteInfo) { + // No operation in default +} + +/** + * GetTime = This method returns UTC time and date. + Note: If a + * requested value is invalid, it's not returned to the client application + */ +void EnhancedPositionStubDefault::GetTime(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::TimeInfo& time) { + // Call old style methods in default + GetTime(timestamp, time); +} +void EnhancedPositionStubDefault::GetTime(EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::TimeInfo& time) { + // No operation in default +} + + +/** + * 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 + */ +void EnhancedPositionStubDefault::firePositionUpdateEvent(const EnhancedPositionServiceTypes::Bitmask& changedValues) { + stubAdapter_->firePositionUpdateEvent(changedValues); +} + + +EnhancedPositionStubDefault::RemoteEventHandler::RemoteEventHandler(EnhancedPositionStubDefault* defaultStub): + defaultStub_(defaultStub) { +} + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionStubDefault.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionStubDefault.h new file mode 100644 index 0000000..45f68f1 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/EnhancedPositionStubDefault.h @@ -0,0 +1,106 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * EnhancedPosition = This interface offers functionalities to retrieve the + * enhanced position of the vehicle + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_STUB_DEFAULT_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_STUB_DEFAULT_H_ + + +#include <org/genivi/EnhancedPositionService/EnhancedPositionStub.h> +#include <sstream> + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +/** + * Provides a default implementation for EnhancedPositionStubRemoteEvent and + * EnhancedPositionStub. Method callbacks have an empty implementation, + * remote set calls on attributes will always change the value of the attribute + * to the one received. + * + * Override this stub if you only want to provide a subset of the functionality + * that would be defined for this service, and/or if you do not need any non-default + * behaviour. + */ +class EnhancedPositionStubDefault : public virtual EnhancedPositionStub { +public: + EnhancedPositionStubDefault(); + + EnhancedPositionStubRemoteEvent* initStubAdapter(const std::shared_ptr<EnhancedPositionStubAdapter>& stubAdapter); + + const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId); + + + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + virtual void GetVersion(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Version& version); + virtual void GetVersion(EnhancedPositionServiceTypes::Version& version); + + /** + * 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 + */ + virtual void GetPositionInfo(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Bitmask valuesToReturn, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::PositionInfo& data); + virtual void GetPositionInfo(EnhancedPositionServiceTypes::Bitmask valuesToReturn, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::PositionInfo& data); + + /** + * 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 + */ + virtual void GetSatelliteInfo(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::SatelliteInfo& satelliteInfo); + virtual void GetSatelliteInfo(EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::SatelliteInfo& satelliteInfo); + + /** + * GetTime = This method returns UTC time and date. + Note: If a + * requested value is invalid, it's not returned to the client application + */ + virtual void GetTime(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::TimeInfo& time); + virtual void GetTime(EnhancedPositionServiceTypes::Timestamp& timestamp, EnhancedPositionServiceTypes::TimeInfo& time); + + + /** + * 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 + */ + virtual void firePositionUpdateEvent(const EnhancedPositionServiceTypes::Bitmask& changedValues); + + +protected: + class RemoteEventHandler: public virtual EnhancedPositionStubRemoteEvent { + public: + RemoteEventHandler(EnhancedPositionStubDefault* defaultStub); + + + private: + EnhancedPositionStubDefault* defaultStub_; + }; +private: + EnhancedPositionStubDefault::RemoteEventHandler remoteEventHandler_; + + + CommonAPI::Version interfaceVersion_; +}; + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Enhanced_Position_STUB_DEFAULT_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedback.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedback.h new file mode 100644 index 0000000..c648ad0 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedback.h @@ -0,0 +1,145 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * PositionFeedback = This interface allows the application implementing the + * map-matching algorithm to provide a position feedback to the + * EnahncedPositionService + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_H_ + + +#include <org/genivi/EnhancedPositionService/EnhancedPositionServiceTypes.h> + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/types.h> +#include <cstdint> +#include <unordered_map> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +class PositionFeedback { + public: + virtual ~PositionFeedback() { } + + static inline const char* getInterfaceId(); + static inline CommonAPI::Version getInterfaceVersion(); + /** + * PositionFeedback = array of tuples (key,value)</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 + + * key = HEADING, value = value of type ´i´, that expresses the course + * angle in degree. [0,360]. Example: 0 => north, 90 => east, 180 => south, 270 + * => west + key = SPEED, value = value of type ´d´, that expresses + * speed measured in m/s + key = CLIMB, value = value of type ´i´, that + * expresses the inclination measured in degrees + key = + * RELIABILTY_INDEX, value = value of type ´y´, that indicates the position + * feedabck reliabilty. It can assume values from 0 to 100 + */ + /** + * PositionFeedback = array of tuples (key,value)</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 + + * key = HEADING, value = value of type ´i´, that expresses the course + * angle in degree. [0,360]. Example: 0 => north, 90 => east, 180 => south, 270 + * => west + key = SPEED, value = value of type ´d´, that expresses + * speed measured in m/s + key = CLIMB, value = value of type ´i´, that + * expresses the inclination measured in degrees + key = + * RELIABILTY_INDEX, value = value of type ´y´, that indicates the position + * feedabck reliabilty. It can assume values from 0 to 100 + */ + typedef std::unordered_map<EnhancedPositionServiceTypes::PositionFeedbackType, EnhancedPositionServiceTypes::Value, CommonAPI::EnumHasher<EnhancedPositionServiceTypes::PositionFeedbackType>> PositionFeedbackInfo; +}; + +const char* PositionFeedback::getInterfaceId() { + static const char* interfaceId = "org.genivi.EnhancedPositionService.PositionFeedback"; + return interfaceId; +} + +CommonAPI::Version PositionFeedback::getInterfaceVersion() { + return CommonAPI::Version(0, 0); +} + +/** + * PositionFeedback = array of tuples (key,value)</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 + + * key = HEADING, value = value of type ´i´, that expresses the course + * angle in degree. [0,360]. Example: 0 => north, 90 => east, 180 => south, 270 + * => west + key = SPEED, value = value of type ´d´, that expresses + * speed measured in m/s + key = CLIMB, value = value of type ´i´, that + * expresses the inclination measured in degrees + key = + * RELIABILTY_INDEX, value = value of type ´y´, that indicates the position + * feedabck reliabilty. It can assume values from 0 to 100 + */ + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +namespace CommonAPI { + +} + + +namespace std { + //hashes for types + + //hashes for error types +} + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackDBusProxy.cpp b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackDBusProxy.cpp new file mode 100644 index 0000000..6949ea3 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackDBusProxy.cpp @@ -0,0 +1,103 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * PositionFeedback = This interface allows the application implementing the + * map-matching algorithm to provide a position feedback to the + * EnahncedPositionService + */ +#include "PositionFeedbackDBusProxy.h" + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +std::shared_ptr<CommonAPI::DBus::DBusProxy> createPositionFeedbackDBusProxy( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection) { + return std::make_shared<PositionFeedbackDBusProxy>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection); +} + +INITIALIZER(registerPositionFeedbackDBusProxy) { + CommonAPI::DBus::DBusFactory::registerProxyFactoryMethod(PositionFeedback::getInterfaceId(), + &createPositionFeedbackDBusProxy); +} + +PositionFeedbackDBusProxy::PositionFeedbackDBusProxy( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyconnection): + CommonAPI::DBus::DBusProxy(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyconnection) + { + } + + + +/** + * GetVersion = This method returns the API version implemented by the server + * application + */ +void PositionFeedbackDBusProxy::GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>, + CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::Version> >::callMethodWithReply( + *this, + "GetVersion", + "", + callStatus + , version); +} +std::future<CommonAPI::CallStatus> PositionFeedbackDBusProxy::GetVersionAsync(GetVersionAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<>, + CommonAPI::DBus::DBusSerializableArguments<EnhancedPositionServiceTypes::Version> >::callMethodAsync( + *this, + "GetVersion", + "", + std::move(callback)); +} +/** + * SetPositionFeedback = This method allows a client application to provide the + * EnhancedPositionService with a position feedback + */ +void PositionFeedbackDBusProxy::SetPositionFeedback(const std::vector<PositionFeedback::PositionFeedbackInfo>& feedback, const uint64_t& timestamp, const EnhancedPositionServiceTypes::PositionFeedbackType& feedbackType, CommonAPI::CallStatus& callStatus) { + CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::vector<PositionFeedback::PositionFeedbackInfo>, uint64_t, EnhancedPositionServiceTypes::PositionFeedbackType>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodWithReply( + *this, + "SetPositionFeedback", + "aa{i(yv)}ti", + feedback, timestamp, feedbackType, + callStatus + ); +} +std::future<CommonAPI::CallStatus> PositionFeedbackDBusProxy::SetPositionFeedbackAsync(const std::vector<PositionFeedback::PositionFeedbackInfo>& feedback, const uint64_t& timestamp, const EnhancedPositionServiceTypes::PositionFeedbackType& feedbackType, SetPositionFeedbackAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper<CommonAPI::DBus::DBusSerializableArguments<std::vector<PositionFeedback::PositionFeedbackInfo>, uint64_t, EnhancedPositionServiceTypes::PositionFeedbackType>, + CommonAPI::DBus::DBusSerializableArguments<> >::callMethodAsync( + *this, + "SetPositionFeedback", + "aa{i(yv)}ti", + feedback, timestamp, feedbackType, + std::move(callback)); +} + + + +void PositionFeedbackDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const { + ownVersionMajor = 0; + ownVersionMinor = 0; +} + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackDBusProxy.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackDBusProxy.h new file mode 100644 index 0000000..1c3128c --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackDBusProxy.h @@ -0,0 +1,76 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * PositionFeedback = This interface allows the application implementing the + * map-matching algorithm to provide a position feedback to the + * EnahncedPositionService + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_DBUS_PROXY_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_DBUS_PROXY_H_ + +#include <org/genivi/EnhancedPositionService/PositionFeedbackProxyBase.h> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusFactory.h> +#include <CommonAPI/DBus/DBusProxy.h> + +#undef COMMONAPI_INTERNAL_COMPILATION + +#include <string> + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +class PositionFeedbackDBusProxy: virtual public PositionFeedbackProxyBase, virtual public CommonAPI::DBus::DBusProxy { + public: + PositionFeedbackDBusProxy( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyconnection); + + virtual ~PositionFeedbackDBusProxy() { } + + + + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + virtual void GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version); + virtual std::future<CommonAPI::CallStatus> GetVersionAsync(GetVersionAsyncCallback callback); + /** + * SetPositionFeedback = This method allows a client application to provide the + * EnhancedPositionService with a position feedback + */ + virtual void SetPositionFeedback(const std::vector<PositionFeedback::PositionFeedbackInfo>& feedback, const uint64_t& timestamp, const EnhancedPositionServiceTypes::PositionFeedbackType& feedbackType, CommonAPI::CallStatus& callStatus); + virtual std::future<CommonAPI::CallStatus> SetPositionFeedbackAsync(const std::vector<PositionFeedback::PositionFeedbackInfo>& feedback, const uint64_t& timestamp, const EnhancedPositionServiceTypes::PositionFeedbackType& feedbackType, SetPositionFeedbackAsyncCallback callback); + + + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; + + private: + + +}; + + + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_DBUS_PROXY_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackDBusStubAdapter.cpp b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackDBusStubAdapter.cpp new file mode 100644 index 0000000..dc4cec1 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackDBusStubAdapter.cpp @@ -0,0 +1,156 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +#include "PositionFeedbackDBusStubAdapter.h" +#include <org/genivi/EnhancedPositionService/PositionFeedback.h> + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createPositionFeedbackDBusStubAdapter( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection, + const std::shared_ptr<CommonAPI::StubBase>& stubBase) { + return std::make_shared<PositionFeedbackDBusStubAdapter>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase); +} + +INITIALIZER(registerPositionFeedbackDBusStubAdapter) { + CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(PositionFeedback::getInterfaceId(), + &createPositionFeedbackDBusStubAdapter); +} + + + +PositionFeedbackDBusStubAdapterInternal::~PositionFeedbackDBusStubAdapterInternal() { + deactivateManagedInstances(); + PositionFeedbackDBusStubAdapterHelper::deinit(); +} + +void PositionFeedbackDBusStubAdapterInternal::deactivateManagedInstances() { + +} + +const char* PositionFeedbackDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const { + static const std::string introspectionData = + "<method name=\"getInterfaceVersion\">\n" + "<arg name=\"value\" type=\"uu\" direction=\"out\" />" + "</method>\n" + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + "<method name=\"GetVersion\">\n" + "<arg name=\"version\" type=\"(qqqs)\" direction=\"out\" />\n" + "</method>\n" + /** + * SetPositionFeedback = This method allows a client application to provide the + * EnhancedPositionService with a position feedback + */ + "<method name=\"SetPositionFeedback\">\n" + "<arg name=\"feedback\" type=\"aa{i(yv)}\" direction=\"in\" />\n" + "<arg name=\"timestamp\" type=\"t\" direction=\"in\" />\n" + "<arg name=\"feedbackType\" type=\"i\" direction=\"in\" />\n" + "</method>\n" + + ; + return introspectionData.c_str(); +} + +CommonAPI::DBus::DBusGetAttributeStubDispatcher< + PositionFeedbackStub, + CommonAPI::Version + > PositionFeedbackDBusStubAdapterInternal::getPositionFeedbackInterfaceVersionStubDispatcher(&PositionFeedbackStub::getInterfaceVersion, "uu"); + + + +/** + * GetVersion = This method returns the API version implemented by the server + * application + */ +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + PositionFeedbackStub, + std::tuple<>, + std::tuple<EnhancedPositionServiceTypes::Version> + > PositionFeedbackDBusStubAdapterInternal::getVersionStubDispatcher(&PositionFeedbackStub::GetVersion, "(qqqs)"); +/** + * SetPositionFeedback = This method allows a client application to provide the + * EnhancedPositionService with a position feedback + */ +CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + PositionFeedbackStub, + std::tuple<std::vector<PositionFeedback::PositionFeedbackInfo>, uint64_t, EnhancedPositionServiceTypes::PositionFeedbackType>, + std::tuple<> + > PositionFeedbackDBusStubAdapterInternal::setPositionFeedbackStubDispatcher(&PositionFeedbackStub::SetPositionFeedback, ""); + + + + + +const PositionFeedbackDBusStubAdapterHelper::StubDispatcherTable& PositionFeedbackDBusStubAdapterInternal::getStubDispatcherTable() { + return stubDispatcherTable_; +} + +const CommonAPI::DBus::StubAttributeTable& PositionFeedbackDBusStubAdapterInternal::getStubAttributeTable() { + return stubAttributeTable_; +} + +PositionFeedbackDBusStubAdapterInternal::PositionFeedbackDBusStubAdapterInternal( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection, + const std::shared_ptr<CommonAPI::StubBase>& stub): + CommonAPI::DBus::DBusStubAdapter( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + false), + PositionFeedbackDBusStubAdapterHelper( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + std::dynamic_pointer_cast<PositionFeedbackStub>(stub), + false), + stubDispatcherTable_({ + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + { { "GetVersion", "" }, &org::genivi::EnhancedPositionService::PositionFeedbackDBusStubAdapterInternal::getVersionStubDispatcher }, + /** + * SetPositionFeedback = This method allows a client application to provide the + * EnhancedPositionService with a position feedback + */ + { { "SetPositionFeedback", "aa{i(yv)}ti" }, &org::genivi::EnhancedPositionService::PositionFeedbackDBusStubAdapterInternal::setPositionFeedbackStubDispatcher } + }), + stubAttributeTable_() { + + stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &org::genivi::EnhancedPositionService::PositionFeedbackDBusStubAdapterInternal::getPositionFeedbackInterfaceVersionStubDispatcher }); +} + +const bool PositionFeedbackDBusStubAdapterInternal::hasFreedesktopProperties() { + return false; +} + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackDBusStubAdapter.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackDBusStubAdapter.h new file mode 100644 index 0000000..d2b3af5 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackDBusStubAdapter.h @@ -0,0 +1,130 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * PositionFeedback = This interface allows the application implementing the + * map-matching algorithm to provide a position feedback to the + * EnahncedPositionService + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_DBUS_STUB_ADAPTER_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_DBUS_STUB_ADAPTER_H_ + +#include <org/genivi/EnhancedPositionService/PositionFeedbackStub.h> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/DBus/DBusStubAdapterHelper.h> +#include <CommonAPI/DBus/DBusStubAdapter.h> +#include <CommonAPI/DBus/DBusFactory.h> +#include <CommonAPI/DBus/DBusServicePublisher.h> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +typedef CommonAPI::DBus::DBusStubAdapterHelper<PositionFeedbackStub> PositionFeedbackDBusStubAdapterHelper; + +class PositionFeedbackDBusStubAdapterInternal: public virtual PositionFeedbackStubAdapter, public PositionFeedbackDBusStubAdapterHelper { + public: + PositionFeedbackDBusStubAdapterInternal( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection, + const std::shared_ptr<CommonAPI::StubBase>& stub); + + ~PositionFeedbackDBusStubAdapterInternal(); + + virtual const bool hasFreedesktopProperties(); + + + + + const PositionFeedbackDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable(); + const CommonAPI::DBus::StubAttributeTable& getStubAttributeTable(); + + void deactivateManagedInstances(); + + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + PositionFeedbackStub, + CommonAPI::Version + > getPositionFeedbackInterfaceVersionStubDispatcher; + + + +/** + * GetVersion = This method returns the API version implemented by the server + * application + */ +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + PositionFeedbackStub, + std::tuple<>, + std::tuple<EnhancedPositionServiceTypes::Version> + > getVersionStubDispatcher; +/** + * SetPositionFeedback = This method allows a client application to provide the + * EnhancedPositionService with a position feedback + */ +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + PositionFeedbackStub, + std::tuple<std::vector<PositionFeedback::PositionFeedbackInfo>, uint64_t, EnhancedPositionServiceTypes::PositionFeedbackType>, + std::tuple<> + > setPositionFeedbackStubDispatcher; + + + + + protected: + virtual const char* getMethodsDBusIntrospectionXmlData() const; + + private: + PositionFeedbackDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_; + CommonAPI::DBus::StubAttributeTable stubAttributeTable_; +}; + +class PositionFeedbackDBusStubAdapter: public PositionFeedbackDBusStubAdapterInternal, public std::enable_shared_from_this<PositionFeedbackDBusStubAdapter> { +public: + PositionFeedbackDBusStubAdapter( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection, + const std::shared_ptr<CommonAPI::StubBase>& stub) : + CommonAPI::DBus::DBusStubAdapter( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + false), + PositionFeedbackDBusStubAdapterInternal( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + stub) { } +}; + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_DBUS_STUB_ADAPTER_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackProxy.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackProxy.h new file mode 100644 index 0000000..229978f --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackProxy.h @@ -0,0 +1,231 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * PositionFeedback = This interface allows the application implementing the + * map-matching algorithm to provide a position feedback to the + * EnahncedPositionService + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_PROXY_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_PROXY_H_ + +#include "PositionFeedbackProxyBase.h" + + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +template <typename ... _AttributeExtensions> +class PositionFeedbackProxy: virtual public PositionFeedback, virtual public PositionFeedbackProxyBase +, public _AttributeExtensions... { +public: + PositionFeedbackProxy(std::shared_ptr<CommonAPI::Proxy> delegate); + ~PositionFeedbackProxy(); + + typedef PositionFeedback InterfaceType; + + + + + /** + * GetVersion = This method returns the API version implemented by the server + * application + * + * Calls GetVersion with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version); + /** + * Calls GetVersion with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> GetVersionAsync(GetVersionAsyncCallback callback); + /** + * SetPositionFeedback = This method allows a client application to provide the + * EnhancedPositionService with a position feedback + * + * Calls SetPositionFeedback with synchronous semantics. + * + * All const parameters are input parameters to this method. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + */ + virtual void SetPositionFeedback(const std::vector<PositionFeedback::PositionFeedbackInfo>& feedback, const uint64_t& timestamp, const EnhancedPositionServiceTypes::PositionFeedbackType& feedbackType, CommonAPI::CallStatus& callStatus); + /** + * Calls SetPositionFeedback with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future<CommonAPI::CallStatus> SetPositionFeedbackAsync(const std::vector<PositionFeedback::PositionFeedbackInfo>& feedback, const uint64_t& timestamp, const EnhancedPositionServiceTypes::PositionFeedbackType& feedbackType, SetPositionFeedbackAsyncCallback callback); + + + /** + * Returns the CommonAPI address of the remote partner this proxy communicates with. + */ + virtual std::string getAddress() const; + + /** + * Returns the domain of the remote partner this proxy communicates with. + */ + virtual const std::string& getDomain() const; + + /** + * Returns the service ID of the remote partner this proxy communicates with. + */ + virtual const std::string& getServiceId() const; + + /** + * Returns the instance ID of the remote partner this proxy communicates with. + */ + virtual const std::string& getInstanceId() const; + + /** + * Returns true if the remote partner for this proxy is currently known to be available. + */ + virtual bool isAvailable() const; + + /** + * Returns true if the remote partner for this proxy is available. + */ + virtual bool isAvailableBlocking() const; + + /** + * Returns the wrapper class that is used to (de-)register for notifications about + * the availability of the remote partner of this proxy. + */ + virtual CommonAPI::ProxyStatusEvent& getProxyStatusEvent(); + + /** + * Returns the wrapper class that is used to access version information of the remote + * partner of this proxy. + */ + virtual CommonAPI::InterfaceVersionAttribute& getInterfaceVersionAttribute(); + + private: + std::shared_ptr<PositionFeedbackProxyBase> delegate_; +}; + +#ifdef WIN32 + typedef PositionFeedbackProxy<CommonAPI::WINDummyAttributeExtension<CommonAPI::WINDummyAttribute>> PositionFeedbackProxyDefault; +#else + typedef PositionFeedbackProxy<> PositionFeedbackProxyDefault; +#endif + + +// +// PositionFeedbackProxy Implementation +// +template <typename ... _AttributeExtensions> +PositionFeedbackProxy<_AttributeExtensions...>::PositionFeedbackProxy(std::shared_ptr<CommonAPI::Proxy> delegate): + _AttributeExtensions(*(std::dynamic_pointer_cast<PositionFeedbackProxyBase>(delegate)))..., + delegate_(std::dynamic_pointer_cast<PositionFeedbackProxyBase>(delegate)) { +} + +template <typename ... _AttributeExtensions> +PositionFeedbackProxy<_AttributeExtensions...>::~PositionFeedbackProxy() { +} + +/** + * GetVersion = This method returns the API version implemented by the server + * application + */ +template <typename ... _AttributeExtensions> +void PositionFeedbackProxy<_AttributeExtensions...>::GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version) { + delegate_->GetVersion(callStatus, version); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> PositionFeedbackProxy<_AttributeExtensions...>::GetVersionAsync(GetVersionAsyncCallback callback) { + return delegate_->GetVersionAsync(callback); +} +/** + * SetPositionFeedback = This method allows a client application to provide the + * EnhancedPositionService with a position feedback + */ +template <typename ... _AttributeExtensions> +void PositionFeedbackProxy<_AttributeExtensions...>::SetPositionFeedback(const std::vector<PositionFeedback::PositionFeedbackInfo>& feedback, const uint64_t& timestamp, const EnhancedPositionServiceTypes::PositionFeedbackType& feedbackType, CommonAPI::CallStatus& callStatus) { + delegate_->SetPositionFeedback(feedback, timestamp, feedbackType, callStatus); +} + +template <typename ... _AttributeExtensions> +std::future<CommonAPI::CallStatus> PositionFeedbackProxy<_AttributeExtensions...>::SetPositionFeedbackAsync(const std::vector<PositionFeedback::PositionFeedbackInfo>& feedback, const uint64_t& timestamp, const EnhancedPositionServiceTypes::PositionFeedbackType& feedbackType, SetPositionFeedbackAsyncCallback callback) { + return delegate_->SetPositionFeedbackAsync(feedback, timestamp, feedbackType, callback); +} + +template <typename ... _AttributeExtensions> +std::string PositionFeedbackProxy<_AttributeExtensions...>::getAddress() const { + return delegate_->getAddress(); +} + +template <typename ... _AttributeExtensions> +const std::string& PositionFeedbackProxy<_AttributeExtensions...>::getDomain() const { + return delegate_->getDomain(); +} + +template <typename ... _AttributeExtensions> +const std::string& PositionFeedbackProxy<_AttributeExtensions...>::getServiceId() const { + return delegate_->getServiceId(); +} + +template <typename ... _AttributeExtensions> +const std::string& PositionFeedbackProxy<_AttributeExtensions...>::getInstanceId() const { + return delegate_->getInstanceId(); +} + +template <typename ... _AttributeExtensions> +bool PositionFeedbackProxy<_AttributeExtensions...>::isAvailable() const { + return delegate_->isAvailable(); +} + +template <typename ... _AttributeExtensions> +bool PositionFeedbackProxy<_AttributeExtensions...>::isAvailableBlocking() const { + return delegate_->isAvailableBlocking(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::ProxyStatusEvent& PositionFeedbackProxy<_AttributeExtensions...>::getProxyStatusEvent() { + return delegate_->getProxyStatusEvent(); +} + +template <typename ... _AttributeExtensions> +CommonAPI::InterfaceVersionAttribute& PositionFeedbackProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() { + return delegate_->getInterfaceVersionAttribute(); +} + + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_PROXY_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackProxyBase.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackProxyBase.h new file mode 100644 index 0000000..0a1e348 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackProxyBase.h @@ -0,0 +1,71 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * PositionFeedback = This interface allows the application implementing the + * map-matching algorithm to provide a position feedback to the + * EnahncedPositionService + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_PROXY_BASE_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_PROXY_BASE_H_ + +#include "PositionFeedback.h" + + +#include <org/genivi/EnhancedPositionService/EnhancedPositionServiceTypes.h> + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/InputStream.h> +#include <CommonAPI/OutputStream.h> +#include <CommonAPI/SerializableStruct.h> +#include <cstdint> +#include <string> +#include <unordered_map> +#include <vector> + +#include <CommonAPI/Proxy.h> +#include <functional> +#include <future> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +class PositionFeedbackProxyBase: virtual public CommonAPI::Proxy { + public: + + typedef std::function<void(const CommonAPI::CallStatus&, const EnhancedPositionServiceTypes::Version&)> GetVersionAsyncCallback; + typedef std::function<void(const CommonAPI::CallStatus&)> SetPositionFeedbackAsyncCallback; + + + + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + virtual void GetVersion(CommonAPI::CallStatus& callStatus, EnhancedPositionServiceTypes::Version& version) = 0; + virtual std::future<CommonAPI::CallStatus> GetVersionAsync(GetVersionAsyncCallback callback) = 0; + /** + * SetPositionFeedback = This method allows a client application to provide the + * EnhancedPositionService with a position feedback + */ + virtual void SetPositionFeedback(const std::vector<PositionFeedback::PositionFeedbackInfo>& feedback, const uint64_t& timestamp, const EnhancedPositionServiceTypes::PositionFeedbackType& feedbackType, CommonAPI::CallStatus& callStatus) = 0; + virtual std::future<CommonAPI::CallStatus> SetPositionFeedbackAsync(const std::vector<PositionFeedback::PositionFeedbackInfo>& feedback, const uint64_t& timestamp, const EnhancedPositionServiceTypes::PositionFeedbackType& feedbackType, SetPositionFeedbackAsyncCallback callback) = 0; +}; + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_PROXY_BASE_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackStub.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackStub.h new file mode 100644 index 0000000..df08f16 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackStub.h @@ -0,0 +1,119 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * PositionFeedback = This interface allows the application implementing the + * map-matching algorithm to provide a position feedback to the + * EnahncedPositionService + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_STUB_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_STUB_H_ + + + +#include <org/genivi/EnhancedPositionService/EnhancedPositionServiceTypes.h> + +#include "PositionFeedback.h" + +#if !defined (COMMONAPI_INTERNAL_COMPILATION) +#define COMMONAPI_INTERNAL_COMPILATION +#endif + +#include <CommonAPI/InputStream.h> +#include <CommonAPI/OutputStream.h> +#include <CommonAPI/SerializableStruct.h> +#include <cstdint> +#include <string> +#include <unordered_map> +#include <vector> + +#include <CommonAPI/Stub.h> + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +/** + * Receives messages from remote and handles all dispatching of deserialized calls + * to a stub for the service PositionFeedback. Also provides means to send broadcasts + * and attribute-changed-notifications of observable attributes as defined by this service. + * An application developer should not need to bother with this class. + */ +class PositionFeedbackStubAdapter: virtual public CommonAPI::StubAdapter, public PositionFeedback { + public: + + + + virtual void deactivateManagedInstances() = 0; +protected: + /** + * Defines properties for storing the ClientIds of clients / proxies that have + * subscribed to the selective broadcasts + */ +}; + + +/** + * Defines the necessary callbacks to handle remote set events related to the attributes + * defined in the IDL description for PositionFeedback. + * For each attribute two callbacks are defined: + * - a verification callback that allows to verify the requested value and to prevent setting + * e.g. an invalid value ("onRemoteSet<AttributeName>"). + * - an action callback to do local work after the attribute value has been changed + * ("onRemote<AttributeName>Changed"). + * + * This class and the one below are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class PositionFeedbackStubRemoteEvent { + public: + virtual ~PositionFeedbackStubRemoteEvent() { } + +}; + + +/** + * Defines the interface that must be implemented by any class that should provide + * the service PositionFeedback to remote clients. + * This class and the one above are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class PositionFeedbackStub: public virtual CommonAPI::Stub<PositionFeedbackStubAdapter, PositionFeedbackStubRemoteEvent> { +public: + virtual ~PositionFeedbackStub() { } + virtual const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) = 0; + + + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + /// This is the method that will be called on remote calls on the method GetVersion. + virtual void GetVersion(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Version& version) = 0; + /** + * SetPositionFeedback = This method allows a client application to provide the + * EnhancedPositionService with a position feedback + */ + /// This is the method that will be called on remote calls on the method SetPositionFeedback. + virtual void SetPositionFeedback(const std::shared_ptr<CommonAPI::ClientId> clientId, std::vector<PositionFeedback::PositionFeedbackInfo> feedback, uint64_t timestamp, EnhancedPositionServiceTypes::PositionFeedbackType feedbackType) = 0; + + using CommonAPI::Stub<PositionFeedbackStubAdapter, PositionFeedbackStubRemoteEvent>::initStubAdapter; + typedef CommonAPI::Stub<PositionFeedbackStubAdapter, PositionFeedbackStubRemoteEvent>::StubAdapterType StubAdapterType; + typedef CommonAPI::Stub<PositionFeedbackStubAdapter, PositionFeedbackStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType; + typedef PositionFeedbackStubRemoteEvent RemoteEventType; + typedef PositionFeedback StubInterface; +}; + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_STUB_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackStubDefault.cpp b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackStubDefault.cpp new file mode 100644 index 0000000..8b64ce1 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackStubDefault.cpp @@ -0,0 +1,64 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +#include <org/genivi/EnhancedPositionService/PositionFeedbackStubDefault.h> + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +PositionFeedbackStubDefault::PositionFeedbackStubDefault(): + remoteEventHandler_(this), + interfaceVersion_(PositionFeedback::getInterfaceVersion()) { +} + +const CommonAPI::Version& PositionFeedbackStubDefault::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) { + return interfaceVersion_; +} + +PositionFeedbackStubRemoteEvent* PositionFeedbackStubDefault::initStubAdapter(const std::shared_ptr<PositionFeedbackStubAdapter>& stubAdapter) { + CommonAPI::Stub<PositionFeedbackStubAdapter, PositionFeedbackStubRemoteEvent>::stubAdapter_ = stubAdapter; + return &remoteEventHandler_; +} + + +/** + * GetVersion = This method returns the API version implemented by the server + * application + */ +void PositionFeedbackStubDefault::GetVersion(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Version& version) { + // Call old style methods in default + GetVersion(version); +} +void PositionFeedbackStubDefault::GetVersion(EnhancedPositionServiceTypes::Version& version) { + // No operation in default +} + +/** + * SetPositionFeedback = This method allows a client application to provide the + * EnhancedPositionService with a position feedback + */ +void PositionFeedbackStubDefault::SetPositionFeedback(const std::shared_ptr<CommonAPI::ClientId> clientId, std::vector<PositionFeedback::PositionFeedbackInfo> feedback, uint64_t timestamp, EnhancedPositionServiceTypes::PositionFeedbackType feedbackType) { + // Call old style methods in default + SetPositionFeedback(feedback, timestamp, feedbackType); +} +void PositionFeedbackStubDefault::SetPositionFeedback(std::vector<PositionFeedback::PositionFeedbackInfo> feedback, uint64_t timestamp, EnhancedPositionServiceTypes::PositionFeedbackType feedbackType) { + // No operation in default +} + + + + +PositionFeedbackStubDefault::RemoteEventHandler::RemoteEventHandler(PositionFeedbackStubDefault* defaultStub): + defaultStub_(defaultStub) { +} + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackStubDefault.h b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackStubDefault.h new file mode 100644 index 0000000..c33497f --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/PositionFeedbackStubDefault.h @@ -0,0 +1,82 @@ +/* +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.6.v20140519. +* Used org.franca.core 0.8.11.201401091023. +* +* 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/. +*/ +/** + * PositionFeedback = This interface allows the application implementing the + * map-matching algorithm to provide a position feedback to the + * EnahncedPositionService + */ +#ifndef ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_STUB_DEFAULT_H_ +#define ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_STUB_DEFAULT_H_ + + +#include <org/genivi/EnhancedPositionService/PositionFeedbackStub.h> +#include <sstream> + +namespace org { +namespace genivi { +namespace EnhancedPositionService { + +/** + * Provides a default implementation for PositionFeedbackStubRemoteEvent and + * PositionFeedbackStub. Method callbacks have an empty implementation, + * remote set calls on attributes will always change the value of the attribute + * to the one received. + * + * Override this stub if you only want to provide a subset of the functionality + * that would be defined for this service, and/or if you do not need any non-default + * behaviour. + */ +class PositionFeedbackStubDefault : public virtual PositionFeedbackStub { +public: + PositionFeedbackStubDefault(); + + PositionFeedbackStubRemoteEvent* initStubAdapter(const std::shared_ptr<PositionFeedbackStubAdapter>& stubAdapter); + + const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId); + + + /** + * GetVersion = This method returns the API version implemented by the server + * application + */ + virtual void GetVersion(const std::shared_ptr<CommonAPI::ClientId> clientId, EnhancedPositionServiceTypes::Version& version); + virtual void GetVersion(EnhancedPositionServiceTypes::Version& version); + + /** + * SetPositionFeedback = This method allows a client application to provide the + * EnhancedPositionService with a position feedback + */ + virtual void SetPositionFeedback(const std::shared_ptr<CommonAPI::ClientId> clientId, std::vector<PositionFeedback::PositionFeedbackInfo> feedback, uint64_t timestamp, EnhancedPositionServiceTypes::PositionFeedbackType feedbackType); + virtual void SetPositionFeedback(std::vector<PositionFeedback::PositionFeedbackInfo> feedback, uint64_t timestamp, EnhancedPositionServiceTypes::PositionFeedbackType feedbackType); + + + + +protected: + class RemoteEventHandler: public virtual PositionFeedbackStubRemoteEvent { + public: + RemoteEventHandler(PositionFeedbackStubDefault* defaultStub); + + + private: + PositionFeedbackStubDefault* defaultStub_; + }; +private: + PositionFeedbackStubDefault::RemoteEventHandler remoteEventHandler_; + + + CommonAPI::Version interfaceVersion_; +}; + +} // namespace EnhancedPositionService +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_ENHANCEDPOSITIONSERVICE_Position_Feedback_STUB_DEFAULT_H_ diff --git a/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/README b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/README new file mode 100644 index 0000000..e74cc3a --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/gen/org/genivi/EnhancedPositionService/README @@ -0,0 +1,3 @@ +As soon as the CommonAPI command line generator is integrated in the build process, +the generated files will be automatically built inside of the build directory. +The directory 'gen' and its content will be deleted from the 'src' directory. diff --git a/enhanced-position-service/src/log.h b/enhanced-position-service/commonapi-service/src/log.h index 4d946fb..4d946fb 100644 --- a/enhanced-position-service/src/log.h +++ b/enhanced-position-service/commonapi-service/src/log.h diff --git a/enhanced-position-service/commonapi-service/src/res/README b/enhanced-position-service/commonapi-service/src/res/README new file mode 100644 index 0000000..20f5175 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/res/README @@ -0,0 +1 @@ +Copy the configuration file dbusAddresses.conf in the directory /etc/CommonApiDBus/ diff --git a/enhanced-position-service/commonapi-service/src/res/dbusAddresses.conf b/enhanced-position-service/commonapi-service/src/res/dbusAddresses.conf new file mode 100644 index 0000000..7854468 --- /dev/null +++ b/enhanced-position-service/commonapi-service/src/res/dbusAddresses.conf @@ -0,0 +1,12 @@ +[local:org.genivi.positioning.PositionFeedback:org.genivi.positioning.PositionFeedback] +dbus_connection=org.genivi.positioning +dbus_object=/org/genivi/positioning/PositionFeedback +dbus_interface=org.genivi.positioning.PositionFeedback +[local:org.genivi.positioning.EnhancedPosition:org.genivi.positioning.EnhancedPosition] +dbus_connection=org.genivi.positioning +dbus_object=/org/genivi/positioning/EnhancedPosition +dbus_interface=org.genivi.positioning.EnhancedPosition +[local:org.genivi.positioning.Configuration:org.genivi.positioning.Configuration] +dbus_connection=org.genivi.positioning +dbus_object=/org/genivi/positioning/Configuration +dbus_interface=org.genivi.positioning.Configuration diff --git a/enhanced-position-service/CMakeLists.txt b/enhanced-position-service/dbus-service/CMakeLists.txt index 2f47d8b..0862ad4 100644 --- a/enhanced-position-service/CMakeLists.txt +++ b/enhanced-position-service/dbus-service/CMakeLists.txt @@ -40,8 +40,8 @@ option(WITH_DEBUG message(STATUS) message(STATUS "---------------------------------------------------------") -set(gnss-service_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/../gnss-service/api") -set(gnss-service_LIBRARY_DIRS "${PROJECT_BINARY_DIR}/../gnss-service/src") +set(gnss-service_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/../../gnss-service/api") +set(gnss-service_LIBRARY_DIRS "${PROJECT_BINARY_DIR}/../../gnss-service/src") if(WITH_GPSD) set(gnss-service_LIBRARIES "gnss-service-use-gpsd") @@ -51,8 +51,8 @@ else() message(STATUS "Invalid cmake options!") endif() -set(sensors-service_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/../sensors-service/api") -set(sensors-service_LIBRARY_DIRS "${PROJECT_BINARY_DIR}/../sensors-service/src") +set(sensors-service_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/../../sensors-service/api") +set(sensors-service_LIBRARY_DIRS "${PROJECT_BINARY_DIR}/../../sensors-service/src") if(WITH_IPHONE) set(sensors-service_LIBRARIES "sensors-service-use-iphone") @@ -77,3 +77,4 @@ if(WITH_TESTS) endif() message(STATUS) + diff --git a/enhanced-position-service/dbus-service/api/.gitignore b/enhanced-position-service/dbus-service/api/.gitignore new file mode 100644 index 0000000..c52045f --- /dev/null +++ b/enhanced-position-service/dbus-service/api/.gitignore @@ -0,0 +1,2 @@ +include/ +Makefile diff --git a/enhanced-position-service/api/CMakeLists.txt b/enhanced-position-service/dbus-service/api/CMakeLists.txt index 8763ed1..8763ed1 100644 --- a/enhanced-position-service/api/CMakeLists.txt +++ b/enhanced-position-service/dbus-service/api/CMakeLists.txt diff --git a/enhanced-position-service/api/constants.xsl b/enhanced-position-service/dbus-service/api/constants.xsl index b9db1c7..b9db1c7 100644 --- a/enhanced-position-service/api/constants.xsl +++ b/enhanced-position-service/dbus-service/api/constants.xsl diff --git a/enhanced-position-service/api/enum.xsl b/enhanced-position-service/dbus-service/api/enum.xsl index 672d64d..672d64d 100644 --- a/enhanced-position-service/api/enum.xsl +++ b/enhanced-position-service/dbus-service/api/enum.xsl diff --git a/enhanced-position-service/api/genivi-positioning-configuration.xml b/enhanced-position-service/dbus-service/api/genivi-positioning-configuration.xml index 88bef22..88bef22 100644 --- a/enhanced-position-service/api/genivi-positioning-configuration.xml +++ b/enhanced-position-service/dbus-service/api/genivi-positioning-configuration.xml diff --git a/enhanced-position-service/api/genivi-positioning-constants.xml b/enhanced-position-service/dbus-service/api/genivi-positioning-constants.xml index 96c7608..96c7608 100644 --- a/enhanced-position-service/api/genivi-positioning-constants.xml +++ b/enhanced-position-service/dbus-service/api/genivi-positioning-constants.xml diff --git a/enhanced-position-service/api/genivi-positioning-enhancedposition.xml b/enhanced-position-service/dbus-service/api/genivi-positioning-enhancedposition.xml index f5e2f99..f5e2f99 100644 --- a/enhanced-position-service/api/genivi-positioning-enhancedposition.xml +++ b/enhanced-position-service/dbus-service/api/genivi-positioning-enhancedposition.xml diff --git a/enhanced-position-service/api/genivi-positioning-positionfeedback.xml b/enhanced-position-service/dbus-service/api/genivi-positioning-positionfeedback.xml index 6af0a9e..6af0a9e 100644 --- a/enhanced-position-service/api/genivi-positioning-positionfeedback.xml +++ b/enhanced-position-service/dbus-service/api/genivi-positioning-positionfeedback.xml diff --git a/enhanced-position-service/api/introspect.xsd b/enhanced-position-service/dbus-service/api/introspect.xsd index 76ed7ef..76ed7ef 100644 --- a/enhanced-position-service/api/introspect.xsd +++ b/enhanced-position-service/dbus-service/api/introspect.xsd diff --git a/enhanced-position-service/api/introspect.xsl b/enhanced-position-service/dbus-service/api/introspect.xsl index 786e211..786e211 100644 --- a/enhanced-position-service/api/introspect.xsl +++ b/enhanced-position-service/dbus-service/api/introspect.xsl diff --git a/enhanced-position-service/doc/GENIVI_EnhancedPositionService_ComponentSpecification.pdf b/enhanced-position-service/dbus-service/doc/GENIVI_EnhancedPositionService_ComponentSpecification.pdf Binary files differindex 5268419..5268419 100644 --- a/enhanced-position-service/doc/GENIVI_EnhancedPositionService_ComponentSpecification.pdf +++ b/enhanced-position-service/dbus-service/doc/GENIVI_EnhancedPositionService_ComponentSpecification.pdf diff --git a/enhanced-position-service/doc/testplan.txt b/enhanced-position-service/dbus-service/doc/testplan.txt index 17f4f55..17f4f55 100644 --- a/enhanced-position-service/doc/testplan.txt +++ b/enhanced-position-service/dbus-service/doc/testplan.txt diff --git a/enhanced-position-service/doc/tools/GENIVI_EnhancedPositionService_ComponentSpecification-part1.docx b/enhanced-position-service/dbus-service/doc/tools/GENIVI_EnhancedPositionService_ComponentSpecification-part1.docx Binary files differindex 3b6c7b6..3b6c7b6 100755 --- a/enhanced-position-service/doc/tools/GENIVI_EnhancedPositionService_ComponentSpecification-part1.docx +++ b/enhanced-position-service/dbus-service/doc/tools/GENIVI_EnhancedPositionService_ComponentSpecification-part1.docx diff --git a/enhanced-position-service/doc/tools/GENIVI_EnhancedPositionService_ComponentSpecification-part1.pdf b/enhanced-position-service/dbus-service/doc/tools/GENIVI_EnhancedPositionService_ComponentSpecification-part1.pdf Binary files differindex af0925d..af0925d 100755 --- a/enhanced-position-service/doc/tools/GENIVI_EnhancedPositionService_ComponentSpecification-part1.pdf +++ b/enhanced-position-service/dbus-service/doc/tools/GENIVI_EnhancedPositionService_ComponentSpecification-part1.pdf diff --git a/enhanced-position-service/doc/tools/README.txt b/enhanced-position-service/dbus-service/doc/tools/README.txt index bc7b868..bc7b868 100755 --- a/enhanced-position-service/doc/tools/README.txt +++ b/enhanced-position-service/dbus-service/doc/tools/README.txt diff --git a/enhanced-position-service/doc/tools/generate-doc.sh b/enhanced-position-service/dbus-service/doc/tools/generate-doc.sh index 57bb840..57bb840 100755 --- a/enhanced-position-service/doc/tools/generate-doc.sh +++ b/enhanced-position-service/dbus-service/doc/tools/generate-doc.sh diff --git a/enhanced-position-service/src/CMakeLists.txt b/enhanced-position-service/dbus-service/src/CMakeLists.txt index 8f18022..8f18022 100644 --- a/enhanced-position-service/src/CMakeLists.txt +++ b/enhanced-position-service/dbus-service/src/CMakeLists.txt diff --git a/enhanced-position-service/src/configuration.cpp b/enhanced-position-service/dbus-service/src/configuration.cpp index e047819..e047819 100644 --- a/enhanced-position-service/src/configuration.cpp +++ b/enhanced-position-service/dbus-service/src/configuration.cpp diff --git a/enhanced-position-service/src/configuration.h b/enhanced-position-service/dbus-service/src/configuration.h index 78c319a..78c319a 100644 --- a/enhanced-position-service/src/configuration.h +++ b/enhanced-position-service/dbus-service/src/configuration.h diff --git a/enhanced-position-service/src/enhanced-position.cpp b/enhanced-position-service/dbus-service/src/enhanced-position.cpp index 3258222..3258222 100644 --- a/enhanced-position-service/src/enhanced-position.cpp +++ b/enhanced-position-service/dbus-service/src/enhanced-position.cpp diff --git a/enhanced-position-service/src/enhanced-position.h b/enhanced-position-service/dbus-service/src/enhanced-position.h index 2561c53..2561c53 100644 --- a/enhanced-position-service/src/enhanced-position.h +++ b/enhanced-position-service/dbus-service/src/enhanced-position.h diff --git a/enhanced-position-service/dbus-service/src/log.h b/enhanced-position-service/dbus-service/src/log.h new file mode 100644 index 0000000..4d946fb --- /dev/null +++ b/enhanced-position-service/dbus-service/src/log.h @@ -0,0 +1,154 @@ +/************************************************************************** +* @licence app begin@ +* +* SPDX-License-Identifier: MPL-2.0 +* +* \ingroup GNSSService +* +* \copyright Copyright (C) BMW Car IT GmbH 2011 +* Copyright (C) 2013, XS Embedded GmbH +* +* \license +* This Source Code Form is subject to the terms of the +* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +* this file, You can obtain one at http://mozilla.org/MPL/2.0/. +* +* @licence end@ +**************************************************************************/ + +#ifndef INCLUDE_LOG +#define INCLUDE_LOG + +// turn-on via cmake define: +// $ cmake -DWITH_DLT=1 -DDEBUG_ENABLED=1 .. + +#if (!DLT_ENABLED) +/*****************************************************************************/ +// use printf +#include <stdio.h> + +// some type-name used instead of DLT context +typedef const char* NoDltContext; + +#define DLT_DECLARE_CONTEXT(CONTEXT) \ + NoDltContext CONTEXT; + +#define DLT_IMPORT_CONTEXT(CONTEXT) \ + extern NoDltContext CONTEXT; + +#define DLT_REGISTER_CONTEXT(CONTEXT, CONTEXT_ID, DESC) \ + CONTEXT = CONTEXT_ID; + +#define DLT_REGISTER_APP(CONTEXT, DESC) ; + +#define DLT_UNREGISTER_CONTEXT(CONTEXT) ; +#define DLT_UNREGISTER_APP() ; +#define dlt_free() ; + +// log calls +#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, ...) \ + fprintf(stderr, "[VERBO][%4s] " fmt "\n", context, __VA_ARGS__) + +#define LOG_DEBUG_MSG(context, msg) \ + fprintf(stderr, "[DEBUG][%4s] " msg "\n", context) +#define LOG_DEBUG(context, fmt, ...) \ + fprintf(stderr, "[DEBUG][%4s] " fmt "\n", context, __VA_ARGS__) + +#define LOG_INFO_MSG(context, msg) \ + fprintf(stderr, "[INFO ][%4s] " msg "\n", context) +#define LOG_INFO(context, fmt, ...) \ + fprintf(stderr, "[INFO ][%4s] " fmt "\n", context, __VA_ARGS__) + +#define LOG_WARNING_MSG(context, msg) \ + fprintf(stderr, "[WARN ][%4s] " msg "\n", context) +#define LOG_WARNING(context, fmt, ...) \ + fprintf(stderr, "[WARN ][%4s] " fmt "\n", context, __VA_ARGS__) +#endif + +#define LOG_ERROR_MSG(context, msg) \ + fprintf(stderr, "[ERROR][%4s] " msg "\n", context) +#define LOG_ERROR(context, fmt, ...) \ + fprintf(stderr, "[ERROR][%4s] " fmt "\n", context, __VA_ARGS__) + +#define LOG_FATAL_MSG(context, msg) \ + fprintf(stderr, "[FATAL][%4s] " msg "\n", context) +#define LOG_FATAL(context, fmt, ...) \ + fprintf(stderr, "[FATAL][%4s] " fmt "\n", context, __VA_ARGS__) + +#else /* DLT_ENABLED */ +/*****************************************************************************/ +// use DLT +#include "dlt.h" + +typedef const char* Context; + +#define LOG_VERBOSE_MSG(context, msg) \ + DLT_LOG(context, DLT_LOG_VERBOSE, DLT_STRING(msg)); +#define LOG_VERBOSE(context, fmt, ...) \ + { \ + char logBuffer[256]; \ + sprintf(logBuffer, fmt, __VA_ARGS__); \ + DLT_LOG(context, DLT_LOG_VERBOSE, DLT_STRING(logBuffer)); \ + } +#define LOG_DEBUG_MSG(context, msg) \ + DLT_LOG(context, DLT_LOG_DEBUG, DLT_STRING(msg)); +#define LOG_DEBUG(context, fmt, ...) \ + { \ + char logBuffer[256]; \ + sprintf(logBuffer, fmt, __VA_ARGS__); \ + DLT_LOG(context, DLT_LOG_DEBUG, DLT_STRING(logBuffer)); \ + } +#define LOG_INFO_MSG(context, msg) \ + DLT_LOG(context, DLT_LOG_INFO, DLT_STRING(msg)); +#define LOG_INFO(context, fmt, ...) \ + { \ + char logBuffer[256]; \ + sprintf(logBuffer, fmt, __VA_ARGS__); \ + DLT_LOG(context, DLT_LOG_INFO, DLT_STRING(logBuffer)); \ + } +#define LOG_WARNING_MSG(context, msg) \ + DLT_LOG(context, DLT_LOG_WARN, DLT_STRING(msg)); +#define LOG_WARNING(context, fmt, ...) \ + { \ + char logBuffer[256]; \ + sprintf(logBuffer, fmt, __VA_ARGS__); \ + DLT_LOG(context, DLT_LOG_WARN, DLT_STRING(logBuffer)); \ + } +#define LOG_ERROR_MSG(context, msg) \ + DLT_LOG(context, DLT_LOG_ERROR, DLT_STRING(msg)); +#define LOG_ERROR(context, fmt, ...) \ + { \ + char logBuffer[256]; \ + sprintf(logBuffer, fmt, __VA_ARGS__); \ + DLT_LOG(context, DLT_LOG_ERROR, DLT_STRING(logBuffer)); \ + } +#define LOG_FATAL_MSG(context, msg) \ + DLT_LOG(context, DLT_LOG_FATAL, DLT_STRING(msg)); +#define LOG_FATAL(context, fmt, ...) \ + { \ + char logBuffer[256]; \ + sprintf(logBuffer, fmt, __VA_ARGS__); \ + DLT_LOG(context, DLT_LOG_FATAL, DLT_STRING(logBuffer)); \ + } + +#endif /* DLT_ENABLED */ + +#endif /* INCLUDE_LOG */ diff --git a/enhanced-position-service/src/main.cpp b/enhanced-position-service/dbus-service/src/main.cpp index bc08563..bc08563 100644 --- a/enhanced-position-service/src/main.cpp +++ b/enhanced-position-service/dbus-service/src/main.cpp diff --git a/enhanced-position-service/src/position-feedback.cpp b/enhanced-position-service/dbus-service/src/position-feedback.cpp index 0538c0c..0538c0c 100644 --- a/enhanced-position-service/src/position-feedback.cpp +++ b/enhanced-position-service/dbus-service/src/position-feedback.cpp diff --git a/enhanced-position-service/src/position-feedback.h b/enhanced-position-service/dbus-service/src/position-feedback.h index 59c0490..59c0490 100644 --- a/enhanced-position-service/src/position-feedback.h +++ b/enhanced-position-service/dbus-service/src/position-feedback.h diff --git a/enhanced-position-service/test/CMakeLists.txt b/enhanced-position-service/dbus-service/test/CMakeLists.txt index 0ccc280..0ccc280 100644 --- a/enhanced-position-service/test/CMakeLists.txt +++ b/enhanced-position-service/dbus-service/test/CMakeLists.txt diff --git a/enhanced-position-service/test/compliance-test/CMakeLists.txt b/enhanced-position-service/dbus-service/test/compliance-test/CMakeLists.txt index 698faa7..918e579 100644 --- a/enhanced-position-service/test/compliance-test/CMakeLists.txt +++ b/enhanced-position-service/dbus-service/test/compliance-test/CMakeLists.txt @@ -22,8 +22,6 @@ cmake_minimum_required(VERSION 2.6.0) message(STATUS "ENHANCED-POSITION-SERVICE-COMPLIANCE-TEST") -message(STATUS "GEN_DIR" ${CMAKE_BINARY_DIR}/api) - find_package(PkgConfig) pkg_check_modules(DBUS REQUIRED dbus-1) diff --git a/enhanced-position-service/test/compliance-test/NOTE b/enhanced-position-service/dbus-service/test/compliance-test/NOTE index 27ef794..27ef794 100644 --- a/enhanced-position-service/test/compliance-test/NOTE +++ b/enhanced-position-service/dbus-service/test/compliance-test/NOTE diff --git a/enhanced-position-service/test/compliance-test/README b/enhanced-position-service/dbus-service/test/compliance-test/README index 1f817d7..1f817d7 100644 --- a/enhanced-position-service/test/compliance-test/README +++ b/enhanced-position-service/dbus-service/test/compliance-test/README diff --git a/enhanced-position-service/test/compliance-test/enhanced-position-service-compliance-test.c b/enhanced-position-service/dbus-service/test/compliance-test/enhanced-position-service-compliance-test.c index 9abd5e6..9abd5e6 100644 --- a/enhanced-position-service/test/compliance-test/enhanced-position-service-compliance-test.c +++ b/enhanced-position-service/dbus-service/test/compliance-test/enhanced-position-service-compliance-test.c diff --git a/enhanced-position-service/test/enhanced-position-client.cpp b/enhanced-position-service/dbus-service/test/enhanced-position-client.cpp index bba79ca..bba79ca 100644 --- a/enhanced-position-service/test/enhanced-position-client.cpp +++ b/enhanced-position-service/dbus-service/test/enhanced-position-client.cpp diff --git a/enhanced-position-service/test/enhanced-position-client.h b/enhanced-position-service/dbus-service/test/enhanced-position-client.h index 5bbe0f1..5bbe0f1 100644 --- a/enhanced-position-service/test/enhanced-position-client.h +++ b/enhanced-position-service/dbus-service/test/enhanced-position-client.h diff --git a/enhanced-position-service/dbus-service/test/log.h b/enhanced-position-service/dbus-service/test/log.h new file mode 100644 index 0000000..4d946fb --- /dev/null +++ b/enhanced-position-service/dbus-service/test/log.h @@ -0,0 +1,154 @@ +/************************************************************************** +* @licence app begin@ +* +* SPDX-License-Identifier: MPL-2.0 +* +* \ingroup GNSSService +* +* \copyright Copyright (C) BMW Car IT GmbH 2011 +* Copyright (C) 2013, XS Embedded GmbH +* +* \license +* This Source Code Form is subject to the terms of the +* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +* this file, You can obtain one at http://mozilla.org/MPL/2.0/. +* +* @licence end@ +**************************************************************************/ + +#ifndef INCLUDE_LOG +#define INCLUDE_LOG + +// turn-on via cmake define: +// $ cmake -DWITH_DLT=1 -DDEBUG_ENABLED=1 .. + +#if (!DLT_ENABLED) +/*****************************************************************************/ +// use printf +#include <stdio.h> + +// some type-name used instead of DLT context +typedef const char* NoDltContext; + +#define DLT_DECLARE_CONTEXT(CONTEXT) \ + NoDltContext CONTEXT; + +#define DLT_IMPORT_CONTEXT(CONTEXT) \ + extern NoDltContext CONTEXT; + +#define DLT_REGISTER_CONTEXT(CONTEXT, CONTEXT_ID, DESC) \ + CONTEXT = CONTEXT_ID; + +#define DLT_REGISTER_APP(CONTEXT, DESC) ; + +#define DLT_UNREGISTER_CONTEXT(CONTEXT) ; +#define DLT_UNREGISTER_APP() ; +#define dlt_free() ; + +// log calls +#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, ...) \ + fprintf(stderr, "[VERBO][%4s] " fmt "\n", context, __VA_ARGS__) + +#define LOG_DEBUG_MSG(context, msg) \ + fprintf(stderr, "[DEBUG][%4s] " msg "\n", context) +#define LOG_DEBUG(context, fmt, ...) \ + fprintf(stderr, "[DEBUG][%4s] " fmt "\n", context, __VA_ARGS__) + +#define LOG_INFO_MSG(context, msg) \ + fprintf(stderr, "[INFO ][%4s] " msg "\n", context) +#define LOG_INFO(context, fmt, ...) \ + fprintf(stderr, "[INFO ][%4s] " fmt "\n", context, __VA_ARGS__) + +#define LOG_WARNING_MSG(context, msg) \ + fprintf(stderr, "[WARN ][%4s] " msg "\n", context) +#define LOG_WARNING(context, fmt, ...) \ + fprintf(stderr, "[WARN ][%4s] " fmt "\n", context, __VA_ARGS__) +#endif + +#define LOG_ERROR_MSG(context, msg) \ + fprintf(stderr, "[ERROR][%4s] " msg "\n", context) +#define LOG_ERROR(context, fmt, ...) \ + fprintf(stderr, "[ERROR][%4s] " fmt "\n", context, __VA_ARGS__) + +#define LOG_FATAL_MSG(context, msg) \ + fprintf(stderr, "[FATAL][%4s] " msg "\n", context) +#define LOG_FATAL(context, fmt, ...) \ + fprintf(stderr, "[FATAL][%4s] " fmt "\n", context, __VA_ARGS__) + +#else /* DLT_ENABLED */ +/*****************************************************************************/ +// use DLT +#include "dlt.h" + +typedef const char* Context; + +#define LOG_VERBOSE_MSG(context, msg) \ + DLT_LOG(context, DLT_LOG_VERBOSE, DLT_STRING(msg)); +#define LOG_VERBOSE(context, fmt, ...) \ + { \ + char logBuffer[256]; \ + sprintf(logBuffer, fmt, __VA_ARGS__); \ + DLT_LOG(context, DLT_LOG_VERBOSE, DLT_STRING(logBuffer)); \ + } +#define LOG_DEBUG_MSG(context, msg) \ + DLT_LOG(context, DLT_LOG_DEBUG, DLT_STRING(msg)); +#define LOG_DEBUG(context, fmt, ...) \ + { \ + char logBuffer[256]; \ + sprintf(logBuffer, fmt, __VA_ARGS__); \ + DLT_LOG(context, DLT_LOG_DEBUG, DLT_STRING(logBuffer)); \ + } +#define LOG_INFO_MSG(context, msg) \ + DLT_LOG(context, DLT_LOG_INFO, DLT_STRING(msg)); +#define LOG_INFO(context, fmt, ...) \ + { \ + char logBuffer[256]; \ + sprintf(logBuffer, fmt, __VA_ARGS__); \ + DLT_LOG(context, DLT_LOG_INFO, DLT_STRING(logBuffer)); \ + } +#define LOG_WARNING_MSG(context, msg) \ + DLT_LOG(context, DLT_LOG_WARN, DLT_STRING(msg)); +#define LOG_WARNING(context, fmt, ...) \ + { \ + char logBuffer[256]; \ + sprintf(logBuffer, fmt, __VA_ARGS__); \ + DLT_LOG(context, DLT_LOG_WARN, DLT_STRING(logBuffer)); \ + } +#define LOG_ERROR_MSG(context, msg) \ + DLT_LOG(context, DLT_LOG_ERROR, DLT_STRING(msg)); +#define LOG_ERROR(context, fmt, ...) \ + { \ + char logBuffer[256]; \ + sprintf(logBuffer, fmt, __VA_ARGS__); \ + DLT_LOG(context, DLT_LOG_ERROR, DLT_STRING(logBuffer)); \ + } +#define LOG_FATAL_MSG(context, msg) \ + DLT_LOG(context, DLT_LOG_FATAL, DLT_STRING(msg)); +#define LOG_FATAL(context, fmt, ...) \ + { \ + char logBuffer[256]; \ + sprintf(logBuffer, fmt, __VA_ARGS__); \ + DLT_LOG(context, DLT_LOG_FATAL, DLT_STRING(logBuffer)); \ + } + +#endif /* DLT_ENABLED */ + +#endif /* INCLUDE_LOG */ diff --git a/enhanced-position-service/test/test-scripts/positioning-monitor.pl b/enhanced-position-service/dbus-service/test/test-scripts/positioning-monitor.pl index 624f3a4..e006b9b 100755 --- a/enhanced-position-service/test/test-scripts/positioning-monitor.pl +++ b/enhanced-position-service/dbus-service/test/test-scripts/positioning-monitor.pl @@ -22,7 +22,7 @@ $| = 1;
open(MON,"dbus-monitor|");
while (<MON>) {
- if (/^method call.*;\ interface=org\.genivi\.positioning/) {
+ if (/^method call.*;\ interface=org\.genivi\.EnhancedPositionService/) {
$serial=$_;
$serial=~s/.*serial=//;
$serial=~s/\ path=.*//;
@@ -45,7 +45,7 @@ while (<MON>) { $active=1;
print $_;
}
- } elsif (/^signal.*;\ interface=org\.genivi\.positioning/) {
+ } elsif (/^signal.*;\ interface=org\.genivi\.EnhancedPositionService/) {
$active=1;
print $_;
} elsif (/^ +/) {
diff --git a/enhanced-position-service/test/test-scripts/test-enhanced-position-service-tk-gui.py b/enhanced-position-service/dbus-service/test/test-scripts/test-enhanced-position-service-tk-gui.py index 6ef7fc0..6ef7fc0 100644 --- a/enhanced-position-service/test/test-scripts/test-enhanced-position-service-tk-gui.py +++ b/enhanced-position-service/dbus-service/test/test-scripts/test-enhanced-position-service-tk-gui.py diff --git a/enhanced-position-service/test/test-scripts/test-enhanced-position-service.py b/enhanced-position-service/dbus-service/test/test-scripts/test-enhanced-position-service.py index ee784aa..ee784aa 100755 --- a/enhanced-position-service/test/test-scripts/test-enhanced-position-service.py +++ b/enhanced-position-service/dbus-service/test/test-scripts/test-enhanced-position-service.py diff --git a/log-replayer/test/test-scripts/run-logreplayer.sh b/log-replayer/test/test-scripts/run-logreplayer.sh new file mode 100755 index 0000000..87ea60e --- /dev/null +++ b/log-replayer/test/test-scripts/run-logreplayer.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +########################################################################### +# @licence app begin@ +# SPDX-License-Identifier: MPL-2.0 +# +# Component Name: Positioning poC +# Author: Marco Residori +# +# Copyright (C) 2013, XS Embedded GmbH +# +# License: +# This Source Code Form is subject to the terms of the +# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +# this file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# @licence end@ +########################################################################### + +TOP_DIR=../../.. + +BIN_DIR=$TOP_DIR/build/log-replayer/src +LOGS_DIR=$TOP_DIR/log-replayer/logs +BIN=log-replayer +LOG=geneve-cologny.log + +CMD="$BIN_DIR/$BIN $LOGS_DIR/$LOG > /dev/null 2>&1" + +usage() { + echo "Usage: " + echo " run-logreplayer.sh [option]" + echo " -d daemonize" + echo " -k kill" + echo " -h help" + echo +} + +if [ $# -ge 1 ]; then + if [ $1 = "-d" ]; then + echo "Starting log-replayer..." + eval "$CMD" & + elif [ $1 = "-k" ]; then + killall log-replayer + elif [ $1 = "-h" ]; then + usage + fi +else + echo "Starting log-replayer..." + eval "$CMD" +fi + + + |