diff options
author | asanoaozora <fifitaneki@hotmail.com> | 2018-04-24 16:53:51 +0200 |
---|---|---|
committer | asanoaozora <fifitaneki@hotmail.com> | 2018-04-24 16:53:51 +0200 |
commit | b91cad74053f066a3a6289ac8a91d64ed76326c1 (patch) | |
tree | 19fdc8c2966957f9a96eb9edbba8fbec356f9d79 | |
parent | b2649d35df7501fe426218a8eca931c2a81c8ad4 (diff) | |
download | positioning-b91cad74053f066a3a6289ac8a91d64ed76326c1.tar.gz |
move fidls to dedicated folders, start implementation of enhp wamp
it makes the api management more understandable and also the Franca
generation
26 files changed, 934 insertions, 26 deletions
diff --git a/api/franca/enhancedpositionservice/CMakeLists.txt b/api/franca/enhancedpositionservice/CMakeLists.txt new file mode 100644 index 0000000..eb4ee54 --- /dev/null +++ b/api/franca/enhancedpositionservice/CMakeLists.txt @@ -0,0 +1,81 @@ +########################################################################### +# @licence app begin@ +# SPDX-License-Identifier: MPL-2.0 +# +# Component Name: franca enhanced position service generation +# +# Author: Philippe Colliot +# +# Copyright (C) 2018, PSA Groupe +# +# Note: +# The current file is an adaptation of the example file +# http://git.projects.genivi.org/?p=ipc/common-api-tools.git;a=blob;f=CommonAPI-Examples/E01HelloWorld/CMakeLists.txt +# +# 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@ +########################################################################### + +cmake_minimum_required (VERSION 2.8.1) + +project(franca-enhancedpositionservice) + +get_directory_property(hasParent PARENT_DIRECTORY) + +if(hasParent) + set(COMMONAPI_GEN_DIR "${COMMONAPI_GEN_DIR}" PARENT_SCOPE) +else() + set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen") +endif() + +option(COMMONAPI_TOOL_GENERATOR + "Absolute path to CommonAPI code generator" "") +option(COMMONAPI_DBUS_TOOL_GENERATOR + "Absolute path to CommonAPI-DBus code generator" "") +option(COMMONAPI_WAMP_TOOL_GENERATOR + "Absolute path to CommonAPI-Wamp code generator" "") +option(WITH_WAMP_GENERATION + "Generate Wamp files" OFF) + +set(COMMONAPI_FIDL_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + +find_package(PkgConfig REQUIRED) + +include(FindPkgConfig) + +# generate code from fidl +if(NOT COMMONAPI_GEN_DIR) + message (FATAL_ERROR "Set the variable -DCOMMONAPI_GEN_DIR=<path>") +endif() + +file(GLOB FIDL_FILES "${COMMONAPI_FIDL_DIR}/*.fidl") + +if (COMMONAPI_TOOL_GENERATOR) + execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} + COMMAND ${COMMONAPI_TOOL_GENERATOR} -sk -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) +else () + message (FATAL_ERROR "Set the variable -DCOMMONAPI_TOOL_GENERATOR=<tool>") +endif () + +if (WITH_WAMP_GENERATION) + if (COMMONAPI_WAMP_TOOL_GENERATOR) + foreach(RAW_FILE ${FIDL_FILES}) + execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} + COMMAND java -jar ${COMMONAPI_WAMP_TOOL_GENERATOR} -f ${RAW_FILE} -d ${COMMONAPI_GEN_DIR} ) + endforeach() + else () + message (FATAL_ERROR "Set the variable -DCOMMONAPI_WAMP_TOOL_GENERATOR=<tool>") + endif () +else() + if (COMMONAPI_DBUS_TOOL_GENERATOR) + execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} + COMMAND ${COMMONAPI_DBUS_TOOL_GENERATOR} -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) + else () + message (FATAL_ERROR "Set the variable -DCOMMONAPI_DBUS_TOOL_GENERATOR=<tool>") + endif () +endif() + diff --git a/api/franca/enhancedpositionservice/Configuration.fidl b/api/franca/enhancedpositionservice/Configuration.fidl new file mode 100755 index 0000000..0bc9b57 --- /dev/null +++ b/api/franca/enhancedpositionservice/Configuration.fidl @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: MPL-2.0
+ Component Name: EnhancedPositionService
+ Compliance Level: Abstract Component
+ Copyright (C) 2012, BMW Car IT GmbH, Continental Automotive GmbH, PCA Peugeot Citroën, XS Embedded GmbH
+ License:
+ This Source Code Form is subject to the terms of the
+ Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*/
+
+package org.genivi.enhancedpositionservice
+
+import org.genivi.enhancedpositionservice.EnhancedPositionServiceTypes.* from "EnhancedPositionServiceTypes.fidl"
+
+<** @description : Configuration = This interface allows a client application to set and retrieve configuration options **>
+interface Configuration {
+ version {
+ major 5
+ minor 0
+ }
+
+ <** @description : SatSystem = satellite system (GPS, GLONASS, ...) **>
+ attribute SatelliteSystem SatSystem
+
+ <** @description : UpdateInterval = update interval **>
+ attribute Int32 UpdateInterval
+
+ <** @description : GetVersion = This method returns the API version implemented by the server application **>
+ method GetVersion {
+ out {
+ Version ^version
+ }
+ }
+
+ <** @description : GetSupportedSatelliteSystems = This method returns a list of supported satellite systems **>
+ method GetSupportedSatelliteSystems {
+ out {
+ <** @description : satelliteSystems = list of supported satellite systems **>
+ SatelliteSystem[] satelliteSystems
+ }
+ }
+
+
+}
diff --git a/api/franca/enhancedpositionservice/EnhancedPosition.fidl b/api/franca/enhancedpositionservice/EnhancedPosition.fidl new file mode 100755 index 0000000..2733b3d --- /dev/null +++ b/api/franca/enhancedpositionservice/EnhancedPosition.fidl @@ -0,0 +1,78 @@ +/* SPDX-License-Identifier: MPL-2.0
+ Component Name: EnhancedPositionService
+ Compliance Level: Abstract Component
+ Copyright (C) 2012, BMW Car IT GmbH, Continental Automotive GmbH, PCA Peugeot Citroën, XS Embedded GmbH
+ License:
+ This Source Code Form is subject to the terms of the
+ Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*/
+
+package org.genivi.enhancedpositionservice
+
+import org.genivi.enhancedpositionservice.EnhancedPositionServiceTypes.* from "EnhancedPositionServiceTypes.fidl"
+
+<** @description : EnhancedPosition = This interface offers functionalities to retrieve the enhanced position of the vehicle **>
+interface EnhancedPosition {
+ version {
+ major 5
+ minor 0
+ }
+
+ <** @description : GetVersion = This method returns the API version implemented by the server application **>
+ method GetVersion {
+ out {
+ Version ^version
+ }
+ }
+
+ <** @description : GetPositionInfo = This method returns a given set of positioning data (e.g. Position, Course, Accuracy, Status, ... )
+ Note: If a requested value is invalid, it's not returned to the client application
+ **>
+ method GetPositionInfo {
+ in {
+ <** @description : valuesToReturn = Bitmask obtained as result of a bitwise OR operation on the keys corresponding to the values to be returned **>
+ Bitmask valuesToReturn
+ }
+ out {
+ <** @description : timestamp = Timestamp of the acquisition of the position data [ms] **>
+ Timestamp timestamp
+ <** @description : data = Position data **>
+ PositionInfo data
+ }
+ }
+
+ <**
+ @description : GetSatelliteInfo = This method returns information about the current satellite constellation
+ Note: If a requested value is invalid, it's not returned to the client application
+ **>
+ method GetSatelliteInfo {
+ out {
+ <** @description : timestamp = Timestamp of the acquisition of the satellite detail data [ms] **>
+ Timestamp timestamp
+ <** @description : satelliteInfo = satellite information **>
+ SatelliteInfo satelliteInfo
+ }
+ }
+
+ <** @description : GetTime = This method returns UTC time and date.
+ Note: If a requested value is invalid, it's not returned to the client application
+ **>
+ method GetTime {
+ out {
+ <** @description : timestamp = Timestamp of the acquisition of the UTC date/time [ms] **>
+ Timestamp timestamp
+ <** @description : time = UTC date/time **>
+ TimeInfo time
+ }
+ }
+
+ <** @description : PositionUpdate = This signal is called to 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 **>
+ Bitmask changedValues
+ }
+ }
+
+}
diff --git a/api/franca/enhancedpositionservice/EnhancedPositionServiceTypes.fidl b/api/franca/enhancedpositionservice/EnhancedPositionServiceTypes.fidl new file mode 100755 index 0000000..fd748ae --- /dev/null +++ b/api/franca/enhancedpositionservice/EnhancedPositionServiceTypes.fidl @@ -0,0 +1,183 @@ +/* SPDX-License-Identifier: MPL-2.0
+ Component Name: EnhancedPositionService
+ Compliance Level: Abstract Component
+ Copyright (C) 2012, BMW Car IT GmbH, Continental Automotive GmbH, PCA Peugeot Citroën, XS Embedded GmbH
+ License:
+ This Source Code Form is subject to the terms of the
+ Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*/
+
+package org.genivi.enhancedpositionservice
+
+typeCollection EnhancedPositionServiceTypes {
+
+ version {
+ major 5
+ minor 0
+ }
+
+ typedef Timestamp is UInt64
+
+ <** @description: bitmask obtained as a result of an OR operation on enum values of type PositionInfoKey **>
+ typedef Bitmask is UInt64
+
+ <** @description: version **>
+ struct Version {
+ <** @description : when the major changes, then backward compatibility with previous releases is not granted **>
+ UInt16 maj
+ <** @description : when the minor changes, then backward compatibility with previous releases is granted, but something changed in the implementation of the API (e.g. new methods may have been added) **>
+ UInt16 min
+ <** @description : when the micro changes, then backward compatibility with previous releases is granted (bug fixes or documentation modifications) **>
+ UInt16 mic
+ <** @description : release date (e.g. 21-06-2011) **>
+ String date
+ }
+
+ <** @description : Value = generic value (mapped to a dbus variant ('v') data type)**>
+ union Value {
+ UInt64 uInt64Value
+ Double doubleValue
+ Float floatValue
+ String stringValue
+ }
+
+ enumeration PositionInfoKey {
+ LATITUDE = 1
+ LONGITUDE = 2
+ ALTITUDE = 4
+ HEADING = 8
+ SPEED = 16
+ CLIMB = 32
+ ROLL_RATE = 64
+ PITCH_RATE = 128
+ YAW_RATE = 256
+ PDOP = 512
+ HDOP = 1024
+ VDOP = 2048
+ USED_SATELLITES = 4096
+ TRACKED_SATELLITES = 8192
+ VISIBLE_SATELLITES = 16384
+ SIGMA_HPOSITION = 32768
+ SIGMA_ALTITUDE = 65536
+ SIGMA_HEADING = 131072
+ SIGMA_SPEED = 262144
+ SIGMA_CLIMB = 524288
+ GNSS_FIX_STATUS = 1048576
+ DR_STATUS = 2097152
+ RELIABILTY_INDEX = 4194304
+ }
+
+ <** @description : PositionInfo = array of tuples (key,value)
+ key = enumeration PositionInfoKey
+ key = LATITUDE, value = value of type 'Double', that expresses the latitude of the current position. Range [-90:+90]. Example: 48.053250
+ key = LONGITUDE, value = value of type 'Double', that expresses the longitude of the current position. Range [-180:+180]. Example: 8.324500
+ key = ALTITUDE, value = value of type 'Double', that expresses the altitude above the sea level of the current position in meters
+ key = HEADING, value = value of type 'Double', that expresses the course angle in degree. Range [0:360]. 0 = north, 90 = east, 180 = south, 270 = west
+ key = SPEED, value = value of type 'Double', that expresses speed measured in m/s. A negative value indicates that the vehicle is moving backwards
+ key = CLIMB, value = value of type 'Double', that expresses the road gradient in degrees
+ key = ROLL_RATE, value = value of type 'Double', rotation rate around the X-axis in degrees/s. Range [-100:+100]
+ key = PITCH_RATE, value = value of type 'Double', rotation rate around the Y-axis in degrees/s. Range [-100:+100]
+ key = YAW_RATE, value = value of type 'Double', rotation rate around the Z-axis in degrees/s. Range [-100:+100]
+ key = PDOP, value = value of type 'Double', that represents the positional (3D) dilution of precision
+ key = HDOP, value = value of type 'Double', that represents the horizontal (2D) dilution of precision
+ key = VDOP, value = value of type 'Double', that represents vertical (altitude) dilution of precision
+ key = USED_SATELLITES, value = value of type 'UInt8', that represents the number of used satellites
+ key = TRACKED_SATELLITES, value = value of type 'UInt8', that represents the number of tracked satellites
+ key = VISIBLE_SATELLITES, value = value of type 'UInt8', that represents the number of visible satellites
+ key = SIGMA_HPOSITION, value = value of type 'Double', that represents the standard deviation for the horizontal position in m
+ key = SIGMA_ALTITUDE, value = value of type 'Double', that represents the standard deviation for altitude in m
+ key = SIGMA_HEADING, value = value of type 'Double', that represents the standard deviation for altitude in degrees
+ key = SIGMA_SPEED, value = value of type 'Double', that represents the standard error estimate of the speed in m/s</line>
+ key = SIGMA_CLIMB, value = value of type 'Double', that represents the standard error estimate of the climb in degrees</line>
+ key = GNSS_FIX_STATUS, value = value of type 'UInt16', that represents an enum(NO_FIX(0x01),TIME_FIX(0x01),2D_FIX(0x02),3D_FIX(0x03), ... )
+ key = DR_STATUS, value = value of type 'Boolean', where TRUE means that a dead-reckoning algorithm has been used to calculate the current position
+ **>
+ map PositionInfo {
+ PositionInfoKey to Value
+ }
+
+ enumeration SatelliteSystem {
+ GPS = 1
+ GLONASS = 2
+ GALILEO = 3
+ COMPASS = 4
+ }
+
+ <** @description : SatelliteInfo = array(struct(system,satelliteId,azimuth,elevation,cNo,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
+ cNo = C/No (SNR) in dBHz. Range 0 to 99, 0 when not tracking
+ inUse = flag indicating if the satellite is used for the fix (inUse=true)
+ **>
+ struct SatelliteInfo {
+ SatelliteSystem system
+ UInt32 satellitId
+ UInt32 azimuth
+ UInt32 elevation
+ UInt32 cNo
+ Boolean inUse
+ }
+
+ <** @description: since the hexadecimal format is not supported by Franca yet
+ the bitmask below is expressed using numbers in decimal format.
+ Example: 0x01000000 = 16777216 **>
+ enumeration TimeInfoKey {
+ YEAR = 16777216
+ MONTH = 33554432
+ DAY = 67108864
+ HOUR = 134217728
+ MINUTE = 268435456
+ SECOND = 536870912
+ MS = 1073741824
+ }
+
+ <** @description : 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
+ **>
+ map TimeInfo {
+ TimeInfoKey to Value
+ }
+
+ enumeration PositionFeedbackKey {
+ LATITUDE = 1
+ LONGITUDE = 2
+ ALTITUDE = 4
+ HEADING = 8
+ SPEED = 16
+ CLIMB = 32
+ RELIABILTY_INDEX = 64
+ }
+
+ enumeration PositionFeedbackType {
+ MAP_MATCHED_FEEDBACK = 1
+ TEST_FEEDBACK = 2
+ }
+
+ <**
+ @description : 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
+ **>
+ map PositionFeedbackInfo {
+ PositionFeedbackType to Value
+ }
+
+}
+
+
diff --git a/api/franca/enhancedpositionservice/PositionFeedback.fidl b/api/franca/enhancedpositionservice/PositionFeedback.fidl new file mode 100755 index 0000000..5e391f9 --- /dev/null +++ b/api/franca/enhancedpositionservice/PositionFeedback.fidl @@ -0,0 +1,54 @@ +/* SPDX-License-Identifier: MPL-2.0
+ Component Name: EnhancedPositionService
+ Compliance Level: Abstract Component
+ Copyright (C) 2012, BMW Car IT GmbH, Continental Automotive GmbH, PCA Peugeot Citroën, XS Embedded GmbH
+ License:
+ This Source Code Form is subject to the terms of the
+ Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+ this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*/
+
+package org.genivi.enhancedpositionservice
+
+import org.genivi.enhancedpositionservice.EnhancedPositionServiceTypes.* from "EnhancedPositionServiceTypes.fidl"
+
+<**
+ @description : PositionFeedback = This interface allows the application implementing the map-matching algorithm to provide a position feedback to the EnhancedPositionService
+**>
+
+interface PositionFeedback {
+ version {
+ major 5
+ minor 0
+ }
+
+ <**
+ @description : GetVersion = This method returns the API version implemented by the server application
+ **>
+ method GetVersion {
+ out {
+ Version ^version
+ }
+ }
+
+ <**
+ @description : SetPositionFeedback = This method allows a client application to provide the EnhancedPositionService with a position feedback
+ **>
+ method SetPositionFeedback {
+ in {
+ PositionFeedbackInfo feedback
+
+ <**
+ @description : timestamp = timestamp in ms
+ **>
+ UInt64 timestamp
+
+ <**
+ @description : feedbackType = enum(INVALID,MAP_MATCHED_FEEDBACK,TEST_FEEDBACK, ... )
+ **>
+ PositionFeedbackType feedbackType
+ }
+ }
+
+
+}
diff --git a/api/franca/gnssservice/CMakeLists.txt b/api/franca/gnssservice/CMakeLists.txt new file mode 100644 index 0000000..9c9dffc --- /dev/null +++ b/api/franca/gnssservice/CMakeLists.txt @@ -0,0 +1,81 @@ +########################################################################### +# @licence app begin@ +# SPDX-License-Identifier: MPL-2.0 +# +# Component Name: franca gnss service generation +# +# Author: Philippe Colliot +# +# Copyright (C) 2018, PSA Groupe +# +# Note: +# The current file is an adaptation of the example file +# http://git.projects.genivi.org/?p=ipc/common-api-tools.git;a=blob;f=CommonAPI-Examples/E01HelloWorld/CMakeLists.txt +# +# 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@ +########################################################################### + +cmake_minimum_required (VERSION 2.8.1) + +project(franca-gnssservice) + +get_directory_property(hasParent PARENT_DIRECTORY) + +if(hasParent) + set(COMMONAPI_GEN_DIR "${COMMONAPI_GEN_DIR}" PARENT_SCOPE) +else() + set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen") +endif() + +option(COMMONAPI_TOOL_GENERATOR + "Absolute path to CommonAPI code generator" "") +option(COMMONAPI_DBUS_TOOL_GENERATOR + "Absolute path to CommonAPI-DBus code generator" "") +option(COMMONAPI_WAMP_TOOL_GENERATOR + "Absolute path to CommonAPI-Wamp code generator" "") +option(WAMP_GENERATION + "Generate Wamp files" OFF) + +set(COMMONAPI_FIDL_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + +find_package(PkgConfig REQUIRED) + +include(FindPkgConfig) + +# generate code from fidl +if(NOT COMMONAPI_GEN_DIR) + message (FATAL_ERROR "Set the variable -DCOMMONAPI_GEN_DIR=<path>") +endif() + +file(GLOB FIDL_FILES "${COMMONAPI_FIDL_DIR}/*.fidl") + +if (COMMONAPI_TOOL_GENERATOR) + execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} + COMMAND ${COMMONAPI_TOOL_GENERATOR} -sk -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) +else () + message (FATAL_ERROR "Set the variable -DCOMMONAPI_TOOL_GENERATOR=<tool>") +endif () + +if (WITH_WAMP_GENERATION) + if (COMMONAPI_WAMP_TOOL_GENERATOR) + foreach(RAW_FILE ${FIDL_FILES}) + execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} + COMMAND java -jar ${COMMONAPI_WAMP_TOOL_GENERATOR} -f ${RAW_FILE} -d ${COMMONAPI_GEN_DIR} ) + endforeach() + else () + message (FATAL_ERROR "Set the variable -DCOMMONAPI_WAMP_TOOL_GENERATOR=<tool>") + endif () +else() + if (COMMONAPI_DBUS_TOOL_GENERATOR) + execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} + COMMAND ${COMMONAPI_DBUS_TOOL_GENERATOR} -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) + else () + message (FATAL_ERROR "Set the variable -DCOMMONAPI_DBUS_TOOL_GENERATOR=<tool>") + endif () +endif() + diff --git a/gnss-service/api/franca/GnssService.fidl b/api/franca/gnssservice/GnssService.fidl index 9f64cf1..040e981 100644 --- a/gnss-service/api/franca/GnssService.fidl +++ b/api/franca/gnssservice/GnssService.fidl @@ -8,9 +8,9 @@ this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.genivi.GnssService +package org.genivi.gnssservice -import org.genivi.GnssService.GnssServiceTypes.* from "GnssServiceTypes.fidl" +import org.genivi.gnssservice.GnssServiceTypes.* from "GnssServiceTypes.fidl" <** @description : Gnss = This interface offers functionalities to retrieve the GNSS position of the vehicle **> interface Gnss { diff --git a/gnss-service/api/franca/GnssServiceConfiguration.fidl b/api/franca/gnssservice/GnssServiceConfiguration.fidl index d3ffe1d..139d9ed 100644 --- a/gnss-service/api/franca/GnssServiceConfiguration.fidl +++ b/api/franca/gnssservice/GnssServiceConfiguration.fidl @@ -8,9 +8,9 @@ this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.genivi.GnssService +package org.genivi.gnssservice -import org.genivi.GnssService.GnssServiceTypes.* from "GnssServiceTypes.fidl" +import org.genivi.gnssservice.GnssServiceTypes.* from "GnssServiceTypes.fidl" <** @description : Gnss = This interface offers functionalities to retrieve the GNSS position of the vehicle **> interface Configuration { diff --git a/gnss-service/api/franca/GnssServiceTypes.fidl b/api/franca/gnssservice/GnssServiceTypes.fidl index 00b8c89..6ca2216 100644 --- a/gnss-service/api/franca/GnssServiceTypes.fidl +++ b/api/franca/gnssservice/GnssServiceTypes.fidl @@ -8,7 +8,7 @@ this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.genivi.GnssService +package org.genivi.gnssservice typeCollection GnssServiceTypes { version { diff --git a/sensors-service/api/franca/Acceleration.fidl b/api/franca/sensorsservice/Acceleration.fidl index 84130d8..0bda018 100644 --- a/sensors-service/api/franca/Acceleration.fidl +++ b/api/franca/sensorsservice/Acceleration.fidl @@ -8,9 +8,9 @@ this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.genivi.SensorsService +package org.genivi.sensorsservice -import org.genivi.SensorsService.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" +import org.genivi.sensorsservice.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" <** @description : Acceleration = This interface offers functionalities to retrieve the Acceleration of the vehicle **> interface Acceleration { diff --git a/sensors-service/api/franca/AccelerationConfiguration.fidl b/api/franca/sensorsservice/AccelerationConfiguration.fidl index f658f1f..c4d85b4 100644 --- a/sensors-service/api/franca/AccelerationConfiguration.fidl +++ b/api/franca/sensorsservice/AccelerationConfiguration.fidl @@ -8,9 +8,9 @@ this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.genivi.SensorsService +package org.genivi.sensorsservice -import org.genivi.SensorsService.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" +import org.genivi.sensorsservice.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" <** @description : AccelerationConfiguration = This interface offers functionalities to retrieve the configuration of the Acceleration interface of the vehicle **> interface AccelerationConfiguration { diff --git a/api/franca/sensorsservice/CMakeLists.txt b/api/franca/sensorsservice/CMakeLists.txt new file mode 100644 index 0000000..8cd3aaa --- /dev/null +++ b/api/franca/sensorsservice/CMakeLists.txt @@ -0,0 +1,81 @@ +########################################################################### +# @licence app begin@ +# SPDX-License-Identifier: MPL-2.0 +# +# Component Name: franca sensors service generation +# +# Author: Philippe Colliot +# +# Copyright (C) 2018, PSA Groupe +# +# Note: +# The current file is an adaptation of the example file +# http://git.projects.genivi.org/?p=ipc/common-api-tools.git;a=blob;f=CommonAPI-Examples/E01HelloWorld/CMakeLists.txt +# +# 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@ +########################################################################### + +cmake_minimum_required (VERSION 2.8.1) + +project(franca-sensorsservice) + +get_directory_property(hasParent PARENT_DIRECTORY) + +if(hasParent) + set(COMMONAPI_GEN_DIR "${COMMONAPI_GEN_DIR}" PARENT_SCOPE) +else() + set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen") +endif() + +option(COMMONAPI_TOOL_GENERATOR + "Absolute path to CommonAPI code generator" "") +option(COMMONAPI_DBUS_TOOL_GENERATOR + "Absolute path to CommonAPI-DBus code generator" "") +option(COMMONAPI_WAMP_TOOL_GENERATOR + "Absolute path to CommonAPI-Wamp code generator" "") +option(WAMP_GENERATION + "Generate Wamp files" OFF) + +set(COMMONAPI_FIDL_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + +find_package(PkgConfig REQUIRED) + +include(FindPkgConfig) + +# generate code from fidl +if(NOT COMMONAPI_GEN_DIR) + message (FATAL_ERROR "Set the variable -DCOMMONAPI_GEN_DIR=<path>") +endif() + +file(GLOB FIDL_FILES "${COMMONAPI_FIDL_DIR}/*.fidl") + +if (COMMONAPI_TOOL_GENERATOR) + execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} + COMMAND ${COMMONAPI_TOOL_GENERATOR} -sk -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) +else () + message (FATAL_ERROR "Set the variable -DCOMMONAPI_TOOL_GENERATOR=<tool>") +endif () + +if (WITH_WAMP_GENERATION) + if (COMMONAPI_WAMP_TOOL_GENERATOR) + foreach(RAW_FILE ${FIDL_FILES}) + execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} + COMMAND java -jar ${COMMONAPI_WAMP_TOOL_GENERATOR} -f ${RAW_FILE} -d ${COMMONAPI_GEN_DIR} ) + endforeach() + else () + message (FATAL_ERROR "Set the variable -DCOMMONAPI_WAMP_TOOL_GENERATOR=<tool>") + endif () +else() + if (COMMONAPI_DBUS_TOOL_GENERATOR) + execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} + COMMAND ${COMMONAPI_DBUS_TOOL_GENERATOR} -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) + else () + message (FATAL_ERROR "Set the variable -DCOMMONAPI_DBUS_TOOL_GENERATOR=<tool>") + endif () +endif() + diff --git a/sensors-service/api/franca/Gyroscope.fidl b/api/franca/sensorsservice/Gyroscope.fidl index 447ca76..9107d66 100644 --- a/sensors-service/api/franca/Gyroscope.fidl +++ b/api/franca/sensorsservice/Gyroscope.fidl @@ -8,9 +8,9 @@ this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.genivi.SensorsService +package org.genivi.sensorsservice -import org.genivi.SensorsService.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" +import org.genivi.sensorsservice.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" <** @description : Gyroscope = This interface offers functionalities to retrieve the gyroscope data of the vehicle **> interface Gyroscope { diff --git a/sensors-service/api/franca/GyroscopeConfiguration.fidl b/api/franca/sensorsservice/GyroscopeConfiguration.fidl index 19a1d65..df55d90 100644 --- a/sensors-service/api/franca/GyroscopeConfiguration.fidl +++ b/api/franca/sensorsservice/GyroscopeConfiguration.fidl @@ -8,9 +8,9 @@ this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.genivi.SensorsService +package org.genivi.sensorsservice -import org.genivi.SensorsService.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" +import org.genivi.sensorsservice.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" <** @description : GyroscopeConfiguration = This interface offers functionalities to retrieve the configuration of the Gyroscope interface of the vehicle **> interface GyroscopeConfiguration { diff --git a/sensors-service/api/franca/MetaData.fidl b/api/franca/sensorsservice/MetaData.fidl index 9821b33..c1ab9de 100644 --- a/sensors-service/api/franca/MetaData.fidl +++ b/api/franca/sensorsservice/MetaData.fidl @@ -8,9 +8,9 @@ this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.genivi.SensorsService +package org.genivi.sensorsservice -import org.genivi.SensorsService.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" +import org.genivi.sensorsservice.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" <** @description : MetaData = This interface offers functionalities to retrieve the MetaData of SensorsService **> interface MetaData { diff --git a/sensors-service/api/franca/Odometer.fidl b/api/franca/sensorsservice/Odometer.fidl index ed6fa90..99ffe1b 100644 --- a/sensors-service/api/franca/Odometer.fidl +++ b/api/franca/sensorsservice/Odometer.fidl @@ -8,9 +8,9 @@ this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.genivi.SensorsService +package org.genivi.sensorsservice -import org.genivi.SensorsService.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" +import org.genivi.sensorsservice.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" <** @description : Odometer = This interface offers functionalities to retrieve the travelled distance of the vehicle **> interface Odometer { diff --git a/sensors-service/api/franca/ReverseGear.fidl b/api/franca/sensorsservice/ReverseGear.fidl index 948de5a..0f204bb 100644 --- a/sensors-service/api/franca/ReverseGear.fidl +++ b/api/franca/sensorsservice/ReverseGear.fidl @@ -8,9 +8,9 @@ this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.genivi.SensorsService +package org.genivi.sensorsservice -import org.genivi.SensorsService.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" +import org.genivi.sensorsservice.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" <** @description : ReverseGear = This interface offers functionalities to retrieve the current status of the reverse gear of the vehicle. **> interface ReverseGear { diff --git a/sensors-service/api/franca/SensorsServiceTypes.fidl b/api/franca/sensorsservice/SensorsServiceTypes.fidl index cf0fe47..3e3e77c 100644 --- a/sensors-service/api/franca/SensorsServiceTypes.fidl +++ b/api/franca/sensorsservice/SensorsServiceTypes.fidl @@ -8,7 +8,7 @@ this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.genivi.SensorsService +package org.genivi.sensorsservice typeCollection SensorsServiceTypes { version { diff --git a/sensors-service/api/franca/VehicleSpeed.fidl b/api/franca/sensorsservice/VehicleSpeed.fidl index 59d4c80..1929e98 100644 --- a/sensors-service/api/franca/VehicleSpeed.fidl +++ b/api/franca/sensorsservice/VehicleSpeed.fidl @@ -8,9 +8,9 @@ this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.genivi.SensorsService +package org.genivi.sensorsservice -import org.genivi.SensorsService.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" +import org.genivi.sensorsservice.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" <** @description : VehicleSpeed = This interface offers functionalities to retrieve current speed of the vehicle **> interface VehicleSpeed { diff --git a/sensors-service/api/franca/Wheel.fidl b/api/franca/sensorsservice/Wheel.fidl index 846e462..5c280fd 100644 --- a/sensors-service/api/franca/Wheel.fidl +++ b/api/franca/sensorsservice/Wheel.fidl @@ -8,9 +8,9 @@ this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.genivi.SensorsService +package org.genivi.sensorsservice -import org.genivi.SensorsService.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" +import org.genivi.sensorsservice.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" <** @description : Wheel = This interface offers functionalities to retrieve the wheel rotation data of the vehicle Wheel rotation data may be provided as wheel ticks, as wheel speed diff --git a/sensors-service/api/franca/WheelConfiguration.fidl b/api/franca/sensorsservice/WheelConfiguration.fidl index e2139d4..76cc10f 100644 --- a/sensors-service/api/franca/WheelConfiguration.fidl +++ b/api/franca/sensorsservice/WheelConfiguration.fidl @@ -8,9 +8,9 @@ this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.genivi.SensorsService +package org.genivi.sensorsservice -import org.genivi.SensorsService.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" +import org.genivi.sensorsservice.SensorsServiceTypes.* from "SensorsServiceTypes.fidl" <** @description : WheelConfiguration = This interface offers functionalities to retrieve the configuration of the Wheel sensor interface of the vehicle **> interface WheelConfiguration { diff --git a/enhanced-position-service/franca/enhp-wamp/.gitignore b/enhanced-position-service/franca/enhp-wamp/.gitignore new file mode 100644 index 0000000..5a59f21 --- /dev/null +++ b/enhanced-position-service/franca/enhp-wamp/.gitignore @@ -0,0 +1,3 @@ +/build +/bin + diff --git a/enhanced-position-service/franca/enhp-wamp/CMakeLists.txt b/enhanced-position-service/franca/enhp-wamp/CMakeLists.txt new file mode 100644 index 0000000..fc960a9 --- /dev/null +++ b/enhanced-position-service/franca/enhp-wamp/CMakeLists.txt @@ -0,0 +1,95 @@ +########################################################################### +# @licence app begin@ +# SPDX-License-Identifier: MPL-2.0 +# +# Component Name: enhp-wamp +# +# Author: Philippe Colliot +# +# Copyright (C) 2018, PSA GROUPE +# +# License: +# This Source Code Form is subject to the terms of the +# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +# this file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# @licence end@ +########################################################################### +project(enhp-wamp) +cmake_minimum_required(VERSION 2.8) + +set(PROJECT_NAME_SERVICE ${PROJECT_NAME}Service) +set(PROJECT_NAME_LIBRARY ${PROJECT_NAME}-wamp) + +message(STATUS ${PROJECT_NAME}) + +option(WAMP_GENERATION + "Generate Wamp files" ON) + +set(CMAKE_VERBOSE_MAKEFILE on) +set(CMAKE_CXX_FLAGS "-Wall -O0 -std=c++0x -D_GLIBCXX_USE_NANOSLEEP -pthread") + +set(FRANCA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../api/franca") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin) + +# Packages +find_package(CommonAPI REQUIRED CONFIG NO_CMAKE_PACKAGE_REGISTRY) +find_package(CommonAPI-WAMP REQUIRED CONFIG NO_CMAKE_PACKAGE_REGISTRY) + +message(STATUS "CommonAPI_CONSIDERED_CONFIGS: ${CommonAPI_CONSIDERED_CONFIGS}") +message(STATUS "COMMONAPI_INCLUDE_DIRS: ${COMMONAPI_INCLUDE_DIRS}") +message(STATUS "CommonAPI-WAMP_CONSIDERED_CONFIGS: ${CommonAPI-WAMP_CONSIDERED_CONFIGS}") +message(STATUS "COMMONAPI_WAMP_INCLUDE_DIRS: ${COMMONAPI_WAMP_INCLUDE_DIRS}") + +include(FindPkgConfig) + +# Add the Franca files (that will generate the CommonAPI stuff) +set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen") +add_subdirectory(${FRANCA_DIR}/enhancedpositionservice "${CMAKE_CURRENT_BINARY_DIR}/franca") + +# Path to the generated files +set(API_VERSION_ENHP v5) +set(PRJ_SRC_GEN_ENHP_PATH ${COMMONAPI_GEN_DIR}/${API_VERSION_ENHP}/org/genivi/enhancedpositionservice) + +# Source Files +FILE(GLOB PRJ_WAMP_LIB_SRCS + ${PRJ_SRC_GEN_ENHP_PATH}/*Wamp*.cpp + ) +FILE(GLOB PRJ_STUB_GEN_SRCS + ${PRJ_SRC_GEN_ENHP_PATH}/*StubDefault.cpp + ) +FILE(GLOB PRJ_STUB_IMPL_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/*Stub*.cpp + ) +FILE(GLOB PRJ_CURRENT_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/*Service.cpp + ) + +set(PRJ_SERVICE_SRCS ${PRJ_CURRENT_SRCS} ${PRJ_STUB_GEN_SRCS} ${PRJ_STUB_IMPL_SRCS}) + +include_directories( + ${COMMONAPI_GEN_DIR} + ${COMMONAPI_INCLUDE_DIRS} + ${COMMONAPI_WAMP_INCLUDE_DIRS} + ${WAMP_INCLUDE_DIRS} +) + +link_directories( + ${COMMONAPI_LIBDIR} + ${COMMONAPI_WAMP_LIBDIR} + ${WAMP_LIBDIR} +) + +set(LINK_LIBRARIES -Wl,--no-as-needed -Wl,--as-needed CommonAPI) + +# Build service +add_executable(${PROJECT_NAME_SERVICE} ${PRJ_SERVICE_SRCS}) +target_link_libraries(${PROJECT_NAME_SERVICE} ${LINK_LIBRARIES}) + +# Build gluecode.so +add_library (${PROJECT_NAME_LIBRARY} SHARED ${PRJ_WAMP_LIB_SRCS}) +target_link_libraries(${PROJECT_NAME_LIBRARY} CommonAPI-WAMP ${WAMP_LIBRARIES}) + +install(TARGETS ${PROJECT_NAME_SERVICE} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) +install(TARGETS ${PROJECT_NAME_LIBRARY} DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) diff --git a/enhanced-position-service/franca/enhp-wamp/EnhancedPositionService.cpp b/enhanced-position-service/franca/enhp-wamp/EnhancedPositionService.cpp new file mode 100644 index 0000000..e179d76 --- /dev/null +++ b/enhanced-position-service/franca/enhp-wamp/EnhancedPositionService.cpp @@ -0,0 +1,70 @@ +/** +* @licence app begin@ +* SPDX-License-Identifier: MPL-2.0 +* +* \copyright Copyright (C) 2018, PSA Groupe +* +* \file EnhancedPositionService.cpp +* +* \brief This file is part of the enhp Wamp proof of concept. +* +* \author Philippe Colliot <philippe.colliot@mpsa.com> +* +* \version 0.1 +* +* This Source Code Form is subject to the terms of the +* Mozilla Public License (MPL), 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/. +* +* For further information see http://www.genivi.org/. +* +* List of changes: +* <date>, <name>, <description of change> +* +* @licence end@ +*/ + +#include <iostream> +#include <thread> + +#include <CommonAPI/CommonAPI.hpp> + +#include "EnhancedPositionStubImpl.hpp" + +#define REGISTER_COUNTER 10 +#define REGISTER_SLEEP 50 +#define LOOP_GNSS 500 + +using namespace v5::org::genivi::enhancedpositionservice; + +int main(int argc, const char * const argv[]) +{ + CommonAPI::Runtime::setProperty("LibraryBase", "EnhancedPositionService"); + + std::shared_ptr<CommonAPI::Runtime> runtime = CommonAPI::Runtime::get(); + + std::string domain = "local"; + std::string instanceEnhp = "ENHP"; + + // create service and register it at runtime + std::shared_ptr<EnhancedPositionStubImpl> serviceEnhp = std::make_shared<EnhancedPositionStubImpl>(); + uint8_t counter=0; + bool successfullyRegistered = runtime->registerService(domain, instanceEnhp, serviceEnhp); + while (!successfullyRegistered) { + if(++counter>REGISTER_COUNTER){ + std::cout << "unable to register service: "<< instanceEnhp << std::endl; + return EXIT_FAILURE; + } + std::this_thread::sleep_for(std::chrono::milliseconds(REGISTER_SLEEP)); + successfullyRegistered = runtime->registerService(domain, instanceEnhp, serviceEnhp); + } + + std::cout << "Waiting for calls... (Abort with CTRL+C)" << std::endl; + while (true) { + std::this_thread::sleep_for(std::chrono::milliseconds(LOOP_GNSS)); + } + + return 0; +} + diff --git a/enhanced-position-service/franca/enhp-wamp/EnhancedPositionStubImpl.cpp b/enhanced-position-service/franca/enhp-wamp/EnhancedPositionStubImpl.cpp new file mode 100644 index 0000000..dc3f729 --- /dev/null +++ b/enhanced-position-service/franca/enhp-wamp/EnhancedPositionStubImpl.cpp @@ -0,0 +1,75 @@ +/** +* @licence app begin@ +* SPDX-License-Identifier: MPL-2.0 +* +* \copyright Copyright (C) 2018, PSA Groupe +* +* \file EnhancedPositionStubImpl.cpp +* +* \brief This file is part of the enhp Wamp proof of concept. +* +* \author Philippe Colliot <philippe.colliot@mpsa.com> +* +* \version 0.1 +* +* This Source Code Form is subject to the terms of the +* Mozilla Public License (MPL), 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/. +* +* For further information see http://www.genivi.org/. +* +* List of changes: +* <date>, <name>, <description of change> +* +* @licence end@ +*/ + +#include "EnhancedPositionStubImpl.hpp" + +namespace v5 { +namespace org { +namespace genivi { +namespace enhancedpositionservice { + +EnhancedPositionStubImpl::EnhancedPositionStubImpl() : EnhancedPositionStubDefault(){ + std::cout << "EnhancedPositionStubImpl constructor called" << std::endl; +// m_PositionInfo[EnhancedPositionServiceTypes::PositionInfoKey::LATITUDE]=47.31608607; +// m_PositionInfo[EnhancedPositionServiceTypes::PositionInfoKey::LONGITUDE]=6.23329262; +// m_PositionInfo[EnhancedPositionServiceTypes::PositionInfoKey::ALTITUDE]=337; +} + +EnhancedPositionStubImpl::~EnhancedPositionStubImpl(){ + +} + +void EnhancedPositionStubImpl::GetPositionInfo(const std::shared_ptr<CommonAPI::ClientId> _client, EnhancedPositionServiceTypes::Bitmask _valuesToReturn, GetPositionInfoReply_t _reply){ + EnhancedPositionServiceTypes::Timestamp _timestamp; + EnhancedPositionServiceTypes::PositionInfo _data; + + _reply(_timestamp,_data); +} + +void EnhancedPositionStubImpl::GetSatelliteInfo(const std::shared_ptr<CommonAPI::ClientId> _client, GetSatelliteInfoReply_t _reply){ + EnhancedPositionServiceTypes::Timestamp _timestamp; + EnhancedPositionServiceTypes::SatelliteInfo _satelliteInfo; + _reply(_timestamp,_satelliteInfo); +} + +void EnhancedPositionStubImpl::GetTime(const std::shared_ptr<CommonAPI::ClientId> _client, GetTimeReply_t _reply){ + EnhancedPositionServiceTypes::Timestamp _timestamp; + EnhancedPositionServiceTypes::TimeInfo _time; + _reply(_timestamp,_time); +} + +static const CommonAPI::Version version(0, 0); + +const CommonAPI::Version& EnhancedPositionStubImpl::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) { + return version; + +} + +} // namespace enhancedpositionservice +} // namespace genivi +} // namespace org +} // namespace v5 diff --git a/enhanced-position-service/franca/enhp-wamp/EnhancedPositionStubImpl.hpp b/enhanced-position-service/franca/enhp-wamp/EnhancedPositionStubImpl.hpp new file mode 100644 index 0000000..1ab543f --- /dev/null +++ b/enhanced-position-service/franca/enhp-wamp/EnhancedPositionStubImpl.hpp @@ -0,0 +1,63 @@ +/** +* @licence app begin@ +* SPDX-License-Identifier: MPL-2.0 +* +* \copyright Copyright (C) 2018, PSA Groupe +* +* \file EnhancedPositionStubImpl.hpp +* +* \brief This file is part of the enhp Wamp proof of concept. +* +* \author Philippe Colliot <philippe.colliot@mpsa.com> +* +* \version 0.1 +* +* This Source Code Form is subject to the terms of the +* Mozilla Public License (MPL), 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/. +* +* For further information see http://www.genivi.org/. +* +* List of changes: +* <date>, <name>, <description of change> +* +* @licence end@ +*/ + +#ifndef EnhancedPositionStubImpl_H_ +#define EnhancedPositionStubImpl_H_ + +#include "v5/org/genivi/enhancedpositionservice/EnhancedPositionStubDefault.hpp" + +namespace v5 { +namespace org { +namespace genivi { +namespace enhancedpositionservice { + +class EnhancedPositionStubImpl : public EnhancedPositionStubDefault { +public: + EnhancedPositionStubImpl(); + + virtual ~EnhancedPositionStubImpl(); + + virtual const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId); + + virtual void GetPositionInfo(const std::shared_ptr<CommonAPI::ClientId> _client, ::v5::org::genivi::enhancedpositionservice::EnhancedPositionServiceTypes::Bitmask _valuesToReturn, GetPositionInfoReply_t _reply); + + virtual void GetSatelliteInfo(const std::shared_ptr<CommonAPI::ClientId> _client, GetSatelliteInfoReply_t _reply); + + virtual void GetTime(const std::shared_ptr<CommonAPI::ClientId> _client, GetTimeReply_t _reply); + + EnhancedPositionServiceTypes::PositionInfo m_PositionInfo; + EnhancedPositionServiceTypes::SatelliteInfo m_constSatelliteInfo; + EnhancedPositionServiceTypes::TimeInfo m_constTimeInfo; +private: + +}; + +} // namespace enhancedpositionservice +} // namespace genivi +} // namespace org +} // namespace v5 +#endif /* EnhancedPositionStubImpl */ |