diff options
-rw-r--r-- | api/.gitignore | 8 | ||||
-rw-r--r-- | api/franca/FuelStopAdvisor.fidl | 221 | ||||
-rw-r--r-- | src/CMakeLists.txt | 7 | ||||
-rwxr-xr-x | src/clone_and_build.sh | 6 | ||||
-rw-r--r-- | src/fuel-stop-advisor/CMakeLists.txt | 15 | ||||
-rw-r--r-- | src/tripcomputer/ctripcomputer.cpp (renamed from src/fuel-stop-advisor/ctripcomputer.cpp) | 0 | ||||
-rw-r--r-- | src/tripcomputer/ctripcomputer.h (renamed from src/fuel-stop-advisor/ctripcomputer.h) | 0 | ||||
-rw-r--r-- | src/tripcomputer/ctripcomputertypes.h (renamed from src/fuel-stop-advisor/ctripcomputertypes.h) | 0 |
8 files changed, 245 insertions, 12 deletions
diff --git a/api/.gitignore b/api/.gitignore new file mode 100644 index 0000000..65a2c4a --- /dev/null +++ b/api/.gitignore @@ -0,0 +1,8 @@ +#folder used for downloading external APIs +.project +.classpath +CMakeCache.txt +cmake_install.cmake +Makefile +include/ + diff --git a/api/franca/FuelStopAdvisor.fidl b/api/franca/FuelStopAdvisor.fidl new file mode 100644 index 0000000..dd48aa8 --- /dev/null +++ b/api/franca/FuelStopAdvisor.fidl @@ -0,0 +1,221 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright (C) 2014, PCA Peugeot Citro�n, XS Embedded GmbH, TomTom International B.V., Continental Automotive GmbH, BMW Car IT GmbH, Alpine Electronics R&D Europe GmbH, AISIN AW CO., LTD., Neusoft Technology Solutions GmbH, Jaguar Land Rover Limited, Visteon Corporation, Elektrobit Automotive GmbH +// 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.demonstrator + +<** + @description : FuelStopAdvisor = This interface offers functionalities to access the fuel stop advisor features + This interface is defined for the FSA demonstrator and not included into the GENIVI compliance +**> +interface FuelStopAdvisor { + version { + major 1 + minor 0 + } + + enumeration BasicEnum { + INVALID = 0 + } + + enumeration TripNumber { + TRIP1 = 0 + TRIP2 = 1 + } + + enumeration UnitAttribute { + ODOMETER = 32 + FUEL_LEVEL = 33 + TANK_DISTANCE = 34 + INSTANT_FUEL_CONSUMPTION_PER_DISTANCE = 35 + ENHANCED_TANK_DISTANCE = 36 + DISTANCE = 48 + TIME = 49 + AVERAGE_FUEL_CONSUMPTION_PER_DISTANCE = 50 + AVERAGE_SPEED = 51 + ALL = 1 + } + + enumeration Unit extends BasicEnum { + METRICS = 16 + NON_METRICS = 17 + } + + map Units { + UnitAttribute to Unit + } + + enumeration InstantDataAttribute extends BasicEnum { + ODOMETER = 32 + FUEL_LEVEL = 33 + INSTANT_SPEED = 34 + INSTANT_FUEL_CONSUMPTION_PER_DISTANCE = 35 + } + + union InstantDataValue { + UInt16 uint16Value + UInt32 uint32Value + } + + map InstantData { + InstantDataAttribute to InstantDataValue + } + + enumeration TripDataAttribute extends BasicEnum { + DISTANCE = 48 + TIME = 49 + AVERAGE_FUEL_CONSUMPTION_PER_DISTANCE = 50 + AVERAGE_SPEED = 51 + TANK_DISTANCE = 52 + ENHANCED_TANK_DISTANCE = 53 + } + + union TripDataValue { + UInt16 uint16Value + UInt32 uint32Value + } + + map TripData { + TripDataAttribute to TripDataValue + } + + <** @description: version.**> + struct Version { + <** @description : when the major changes, then backward compatibility with previous releases is not granted.**> + UInt16 ^versionMajor + <** @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 ^versionMinor + <** @description : when the micro changes, then backward compatibility with previous releases is granted (bug fixes or documentation modifications).**> + UInt16 ^versionMicro + <** @description : release date (e.g. 21-06-2011).**> + String date + } + + <** + @description : getVersion = This method returns the API version implemented by the server application + **> + method getVersion { + out { + Version ^version + } + } + + <** + @description : setUnits = This method sets the calculation unit for a given value + **> + method setUnits { + in { + <** @description : for each key, the value of type 'q' expresses the unit used **> + Units unit + } + } + + <** + @description : getInstantData = This method returns a given set of global (not related to a trip number) trip computer data (e.g. odometer, fuel level, tank distance... ) + **> + method getInstantData { + out { + <** + @description : data = dictionary[key,value] + key = key = enum(INVALID,ODOMETER,FUEL_LEVEL,INSTANT_FUEL_CONSUMPTION_PER_DISTANCE,...,ALL) + key = ODOMETER, value = value of type 'u', that expresses the total distance counter in: METRIC->tenth of kilometers NON_METRIC->tenth of miles + key = INSTANT_SPEED, value = value of type 'q', that expresses the instant speed in METRIC->tenth of kilometers per hour or in NON_METRIC->tenth of miles per hour + key = FUEL_LEVEL, value = value of type 'q', that expresses fuel level in: METRIC->tenth of liters NON_METRIC->hundreth of gallon + key = INSTANT_FUEL_CONSUMPTION_PER_DISTANCE, value = value of type 'q', that expresses the instant fuel consumption per distance in METRIC->tenth of liters per 100 kilometers or the instant distance per fuel consumption in NON_METRIC->tenth of miles per gallon + **> + InstantData data + } + } + + <** + @description : getTripData = This method returns the data of a given trip number + **> + method getTripData { + in { + <** @description : number= value of type 'y' that expresses the trip number (start number is 0) **> + TripNumber number + } + out { + <** @description : + data = dictionary[key,value] + key = enum(INVALID,DISTANCE,TIME,AVERAGE_FUEL_CONSUMPTION_PER_DISTANCE,AVERAGE_SPEED,TANK_DISTANCE,ENHANCED_TANK_DISTANCE,...,ALL) + key = DISTANCE, value = value of type 'q', that expresses the distance since the last reset of the trip computer in METRIC->tenth of kilometers or in NON_METRIC->tenth of miles + key = TIME, value = value of type 'u', that expresses the elapsed time since the last reset of the trip computer in seconds + key = AVERAGE_FUEL_CONSUMPTION_PER_DISTANCE, value = value of type 'q', that expresses the average fuel consumption per distance since the last reset of the trip computer in METRIC->tenth of liters per 100 kilometers or the average distance per fuel consumption in NON_METRIC->tenth of miles per gallon + key = AVERAGE_SPEED, value = value of type 'q', that expresses the average speed since the last reset of the trip computer in METRIC->tenth of kilometers per hour or in NON_METRIC->tenth of miles per hour + key = TANK_DISTANCE, value = value of type 'q', that expresses the tank distance since the last reset of the trip computer in METRIC->kilometers or in NON_METRIC->miles + key = ENHANCED_TANK_DISTANCE, value = value of type 'q', that expresses the tank distance since the last reset of the trip computer in METRIC->kilometers or in NON_METRIC->miles + **> + TripData data + } + } + + <** + @description : getSupportedTripNumbers = This method returns the number of supported trips + **> + method getSupportedTripNumbers { + out { + UInt8 tripNumbers + } + } + + <** + @description : setFuelAdvisorSettings = This method configures the fuel stop advisor settings + **> + method setFuelAdvisorSettings { + in { + <** @description : advisorMode = flag. TRUE means that the advisor is activated **> + Boolean advisorMode + + <** @description : distanceThreshold= value of type 'y' that expresses the distance threshold in METRIC->kilometers or in NON_METRIC->miles **> + UInt8 distanceThreshold + } + } + + <** + @description : getFuelAdvisorSettings = This method gets the fuel stop advisor settings + **> + method getFuelAdvisorSettings { + out { + <** @description : advisorMode = flag. TRUE means that the advisor is activated **> + Boolean advisorMode + + <** @description : distanceThreshold= value of type 'y' that expresses the distance threshold in METRIC->kilometers or in NON_METRIC->miles **> + UInt8 distanceThreshold + + <** @description : destinationCantBeReached= TRUE means that there's a risk of not reaching the destination **> + Boolean destinationCantBeReached + } + } + + <** + @description : setRouteHandle = This method configures the route handle for the enhanced tank distance + **> + method setRouteHandle { + in { + UInt32 routeHandle + } + } + + <** + @description : releaseRouteHandle = This method release the route handle for the enhanced tank distance + **> + method releaseRouteHandle { + in { + UInt32 routeHandle + } + } + + <** + @description : fuelStopAdvisorWarning = This signal is emitted to notify a client application whether there's a risk of not reaching the destination + **> + broadcast fuelStopAdvisorWarning { + out { + <** @description : destinationCantBeReached= TRUE means that there's a risk of not reaching the destination, FALSE means that there's no risk yet **> + Boolean destinationCantBeReached + } + } + +}
\ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5c71a01..6e016c1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,15 +20,15 @@ cmake_minimum_required(VERSION 2.8) option(WITH_DEBUG "Enable the debug messages" OFF) -option(WITH_FRANCA_DBUS_INTERFACE - "Build using the Franca interfaces" OFF) +option(WITH_PLUGIN_MIGRATION + "Enable navit plugin migration to commonapi" OFF) option(AMB_ON_DBUS_SESSION "Run amb on dbus session" ON) option(WITH_HTML_MIGRATION "Enable migration to the html based hmi" OFF) message(STATUS "WITH_DEBUG = ${WITH_DEBUG}") -message(STATUS "WITH_FRANCA_DBUS_INTERFACE = ${WITH_FRANCA_DBUS_INTERFACE}") +message(STATUS "WITH_PLUGIN_MIGRATION = ${WITH_PLUGIN_MIGRATION}") message(STATUS "AMB_ON_DBUS_SESSION = ${AMB_ON_DBUS_SESSION}") message(STATUS "WITH_HTML_MIGRATION = ${WITH_HTML_MIGRATION}") @@ -40,6 +40,7 @@ set(AUTOMOTIVE_MESSAGE_BROKER_BIN_DIR "${AUTOMOTIVE_MESSAGE_BROKER_DIR}/src/${AU set(AUTOMOTIVE_MESSAGE_BROKER_LIB_DIR "${AUTOMOTIVE_MESSAGE_BROKER_BIN_DIR}/lib") set(PATCH_DIR "${CMAKE_CURRENT_SOURCE_DIR}/patches") set(NAVIT_PNG_BIN_DIR "${CMAKE_CURRENT_BINARY_DIR}/navigation/navit/navit/xpm") +set(TRIPCOMPUTER_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tripcomputer") if(NOT EXISTS ${AUTOMOTIVE_MESSAGE_BROKER_DIR}) if(NOT ${AMB_ON_DBUS_SESSION}) diff --git a/src/clone_and_build.sh b/src/clone_and_build.sh index af0848d..0f00f85 100755 --- a/src/clone_and_build.sh +++ b/src/clone_and_build.sh @@ -1,8 +1,8 @@ #!/bin/bash -navigation_version='5ca0a6e28cf8dfcba41c299cc2b5340c7a0444f3' -positioning_version='9e65831eed02cc8a1b2e2e73787d6007b54214b4' -navit_version='42f9d3484516c88c7cdf647817a6d6a2acac53c2' +navigation_version='1cfa51e76ba173166c113eccf6a61a5904ff7e7d' +positioning_version='f341b4a2cb216d6204136794d33076170ab1bf80' +navit_version='0a8f85666a3b849d70ed450d74bed3cf85466630' echo "version of navigation is: $navigation_version" echo "version of positioning is: $positioning_version" diff --git a/src/fuel-stop-advisor/CMakeLists.txt b/src/fuel-stop-advisor/CMakeLists.txt index 82b60fc..2148ab6 100644 --- a/src/fuel-stop-advisor/CMakeLists.txt +++ b/src/fuel-stop-advisor/CMakeLists.txt @@ -24,11 +24,14 @@ pkg_search_module(DBUS_CPP_GLIB dbus-c++-glib-1) pkg_search_module(DBUS_CPP dbus-c++-1) pkg_search_module(GLIB glib-2.0) -include_directories(${GLIB_INCLUDE_DIRS}) -include_directories(${DBUS_CPP_INCLUDE_DIRS}) -include_directories(${DBUS_CPP_GLIB_INCLUDE_DIRS}) - -include_directories(${CMAKE_CURRENT_BINARY_DIR} ${DBUS_GENERATED_INCLUDE_DIR_PARENT_SCOPE}/navigation-core) +include_directories( + ${GLIB_INCLUDE_DIRS} + ${DBUS_CPP_INCLUDE_DIRS} + ${DBUS_CPP_GLIB_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${DBUS_GENERATED_INCLUDE_DIR_PARENT_SCOPE}/navigation-core + ${TRIPCOMPUTER_DIR} + ) message(STATUS "WITH_DEBUG = ${WITH_DEBUG}") @@ -64,7 +67,7 @@ foreach (RAW_FILE ${XML_TO_DBUS_CONSTANT}) ) endforeach() -add_executable(fuel-stop-advisor fuel-stop-advisor.cpp fuel-stop-advisor_adaptor.h constants.h ${DBUS_GENERATED_INCLUDE_DIR_PARENT_SCOPE}/navigation-core/genivi-navigationcore-routing_proxy.h amb_proxy.h ${DBUS_GENERATED_INCLUDE_DIR_PARENT_SCOPE}/navigation-core/genivi-navigationcore-constants.h ctripcomputer.cpp ctripcomputer.h ctripcomputertypes.h) +add_executable(fuel-stop-advisor fuel-stop-advisor.cpp ${TRIPCOMPUTER_DIR}/ctripcomputer.cpp) set(LIBRARIES ${DBUS_CPP_LIBRARIES} diff --git a/src/fuel-stop-advisor/ctripcomputer.cpp b/src/tripcomputer/ctripcomputer.cpp index 01db594..01db594 100644 --- a/src/fuel-stop-advisor/ctripcomputer.cpp +++ b/src/tripcomputer/ctripcomputer.cpp diff --git a/src/fuel-stop-advisor/ctripcomputer.h b/src/tripcomputer/ctripcomputer.h index 4f29566..4f29566 100644 --- a/src/fuel-stop-advisor/ctripcomputer.h +++ b/src/tripcomputer/ctripcomputer.h diff --git a/src/fuel-stop-advisor/ctripcomputertypes.h b/src/tripcomputer/ctripcomputertypes.h index ab2436d..ab2436d 100644 --- a/src/fuel-stop-advisor/ctripcomputertypes.h +++ b/src/tripcomputer/ctripcomputertypes.h |