summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author <philippe colliot>2016-01-15 09:48:17 +0100
committer <philippe colliot>2016-01-15 09:48:17 +0100
commit9be8508170ae34680ab8107f04a6398db373ecc2 (patch)
tree70e45b11d9be7e1edb8baa1d327a89b605c289cf
parent8226583ad533da922ae41eafcf184cb3ee362640 (diff)
downloadpoi-service-9be8508170ae34680ab8107f04a6398db373ecc2.tar.gz
Some improvements of scripts and README
-rwxr-xr-xapi/franca/navigation/NavigationTypes.fidl2
-rw-r--r--api/franca/navigation/mapviewer/MapViewerSession.fidl7
-rw-r--r--api/franca/navigation/navigationcore/NavigationCoreSession.fidl9
-rw-r--r--src/navigation/CMakeLists.txt3
-rw-r--r--src/navigation/navigation-core/CMakeLists.txt4
-rw-r--r--src/navigation/navigation-core/configuration-server-plugin/CMakeLists.txt82
-rw-r--r--src/navigation/navigation-core/configuration-server-plugin/configuration-server-plugin-stub.cpp103
-rw-r--r--src/navigation/navigation-core/configuration-server-plugin/configuration-server-plugin-stub.h66
-rw-r--r--src/navigation/navigation-core/configuration-server-plugin/main.cpp77
-rwxr-xr-xsrc/poi-service/rebuild_all.sh57
-rw-r--r--test/poi-service/README72
-rwxr-xr-xtest/poi-service/rebuild_all.sh66
-rwxr-xr-xtest/poi-service/run_capi44
13 files changed, 536 insertions, 56 deletions
diff --git a/api/franca/navigation/NavigationTypes.fidl b/api/franca/navigation/NavigationTypes.fidl
index 5870507..043b966 100755
--- a/api/franca/navigation/NavigationTypes.fidl
+++ b/api/franca/navigation/NavigationTypes.fidl
@@ -86,7 +86,7 @@ typeCollection NavigationTypes {
struct Session {
Handle sessionHandle
- String client
+ String clientApp
}
enumeration Units {
METER = 50
diff --git a/api/franca/navigation/mapviewer/MapViewerSession.fidl b/api/franca/navigation/mapviewer/MapViewerSession.fidl
index 8f45ecf..9657f0b 100644
--- a/api/franca/navigation/mapviewer/MapViewerSession.fidl
+++ b/api/franca/navigation/mapviewer/MapViewerSession.fidl
@@ -32,8 +32,9 @@ interface MapViewerSession {
@description : client = name or identifier of the client application that requests a new session
The navigation core must internally associate this name to the returned session handle
This parameter can be used to identify the client application and determine if a given feature is enabled for it
+ NB: clientApp is used in place of client, due to a conflicting issue when build with CommonAPI
**>
- String client
+ String clientApp
}
out {
<** @description : sessionHandle **>
@@ -72,8 +73,8 @@ interface MapViewerSession {
<** @description : This method returns a list of all available sessions .**>
method getAllSessions {
out {
- <** @description : sessionsList = array[struct(sessionHandle,client)]
- client = name or identifier of the client application that requested the sessionHandle .**>
+ <** @description : sessionsList = array[struct(sessionHandle,clientApp)]
+ clientApp = name or identifier of the client application that requested the sessionHandle .**>
Session[] sessionsList
}
}
diff --git a/api/franca/navigation/navigationcore/NavigationCoreSession.fidl b/api/franca/navigation/navigationcore/NavigationCoreSession.fidl
index 4cdda2a..2bb4292 100644
--- a/api/franca/navigation/navigationcore/NavigationCoreSession.fidl
+++ b/api/franca/navigation/navigationcore/NavigationCoreSession.fidl
@@ -29,11 +29,12 @@ interface NavigationCoreSession {
method createSession {
in {
<**
- @description : client = name or identifier of the client application that requests a new session
+ @description : clientApp = name or identifier of the client application that requests a new session
The navigation core must internally associate this name to the returned session handle
This parameter can be used to identify the client application and determine if a given feature is enabled for it
+ NB: clientApp is used in place of client, due to a conflicting issue when build with CommonAPI
**>
- String client
+ String clientApp
}
out {
<** @description : sessionHandle **>
@@ -72,8 +73,8 @@ interface NavigationCoreSession {
<** @description : This method returns a list of all available sessions .**>
method getAllSessions {
out {
- <** @description : sessionsList = array[struct(sessionHandle,client)]
- client = name or identifier of the client application that requested the sessionHandle .**>
+ <** @description : sessionsList = array[struct(sessionHandle,clientApp)]
+ clientApp = name or identifier of the client application that requested the sessionHandle .**>
Session[] sessionsList
}
}
diff --git a/src/navigation/CMakeLists.txt b/src/navigation/CMakeLists.txt
index 445dd32..4ebd592 100644
--- a/src/navigation/CMakeLists.txt
+++ b/src/navigation/CMakeLists.txt
@@ -27,6 +27,8 @@ option(WITH_DEBUG
"Enable the debug messages" OFF)
option(WITH_SPEECH
"Enable the voice messages" OFF)
+option(WITH_PLUGIN_MIGRATION
+ "Enable navit plugin migration to commonapi" OFF)
option(YOCTO_CONFIG
"Build using Yocto" OFF)
option(NAVIT_DISABLE_QT
@@ -42,6 +44,7 @@ message(STATUS "WITH_FRANCA_DBUS_INTERFACE = ${WITH_FRANCA_DBUS_INTERFACE}")
message(STATUS "WITH_DBUS_INTERFACE = ${WITH_DBUS_INTERFACE}")
message(STATUS "WITH_DEBUG = ${WITH_DEBUG}")
message(STATUS "WITH_SPEECH = ${WITH_SPEECH}")
+message(STATUS "WITH_PLUGIN_MIGRATION = ${WITH_PLUGIN_MIGRATION}")
message(STATUS "YOCTO_CONFIG = ${YOCTO_CONFIG}")
message(STATUS "NAVIT_DISABLE_QT = ${NAVIT_DISABLE_QT}")
message(STATUS "NAVIT_SAMPLE_MAP = ${NAVIT_SAMPLE_MAP}")
diff --git a/src/navigation/navigation-core/CMakeLists.txt b/src/navigation/navigation-core/CMakeLists.txt
index f7119a4..6278c71 100644
--- a/src/navigation/navigation-core/CMakeLists.txt
+++ b/src/navigation/navigation-core/CMakeLists.txt
@@ -87,4 +87,8 @@ add_subdirectory(session-plugin)
add_subdirectory(enhancedposition-plugin)
+if (WITH_PLUGIN_MIGRATION)
+ set(FRANCA_DIR "${API_DIR}/franca")
+ add_subdirectory(configuration-server-plugin)
+endif()
diff --git a/src/navigation/navigation-core/configuration-server-plugin/CMakeLists.txt b/src/navigation/navigation-core/configuration-server-plugin/CMakeLists.txt
new file mode 100644
index 0000000..b93497d
--- /dev/null
+++ b/src/navigation/navigation-core/configuration-server-plugin/CMakeLists.txt
@@ -0,0 +1,82 @@
+###########################################################################
+# @licence app begin@
+# SPDX-License-Identifier: MPL-2.0
+#
+# Component Name: configuration-server-plugin
+#
+# Author: Philippe Colliot
+#
+# Copyright (C) 2015, PCA Peugeot Citroën
+#
+# License:
+# This Source Code Form is subject to the terms of the
+# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
+# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# @licence end@
+###########################################################################
+project(configuration-server-plugin)
+message(STATUS ${PROJECT_NAME})
+
+set(CMAKE_VERBOSE_MAKEFILE on)
+set(CMAKE_CXX_FLAGS "-Wall -std=c++0x")
+
+set(PARENT_API navigationcore)
+set(ROOT_API navigation)
+set(API_VERSION_MAJOR 0)
+set(API_VERSION_MINOR 1)
+set(API_VERSION "v${API_VERSION_MAJOR}_${API_VERSION_MINOR}")
+set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen")
+set(PRJ_SRC_GEN_PATH ${COMMONAPI_GEN_DIR}/${API_VERSION}/org/genivi/${ROOT_API}/${PARENT_API})
+set(PRJ_SRC_GEN_NAVIGATION_TYPES_PATH ${COMMONAPI_GEN_DIR}/org/genivi/${ROOT_API})
+
+# Packages
+find_package(PkgConfig REQUIRED)
+find_package(CommonAPI 3.1.2 REQUIRED)
+find_package(CommonAPI-DBus 3.1.2 REQUIRED)
+
+pkg_check_modules(DBUS "dbus-1 >= 1.4")
+pkg_check_modules(COMMONAPI "CommonAPI >= 3.1")
+pkg_check_modules(COMMONAPI_DBUS "CommonAPI-DBus >= 3.1")
+pkg_check_modules(GOBJECT gobject-2.0)
+pkg_check_modules(GLIB REQUIRED glib-2.0)
+
+# Source Files
+FILE(GLOB PRJ_LOCAL_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
+
+add_subdirectory(${FRANCA_DIR}/navigation/navigationcore "${CMAKE_CURRENT_BINARY_DIR}/franca")
+
+FILE(GLOB PRJ_STUB_GEN_SRCS ${PRJ_SRC_GEN_PATH}/*Stub*.cpp)
+FILE(GLOB PRJ_STUB_GEN_TYPES ${PRJ_SRC_GEN_NAVIGATION_TYPES_PATH}/*Types*.cpp)
+set(PRJ_SRCS ${PRJ_LOCAL_SRCS} ${PRJ_STUB_GEN_SRCS} ${PRJ_STUB_GEN_TYPES})
+
+include_directories(
+ ${PRJ_SRC_GEN_PATH}
+ ${DBUS_INCLUDE_DIRS}
+ ${COMMONAPI_GEN_DIR}
+ ${COMMONAPI_INCLUDE_DIRS}
+ ${COMMONAPI_DBUS_INCLUDE_DIRS}
+ ${GOBJECT_INCLUDE_DIRS}
+ ${GLIB_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${DBUS_LIBDIR}
+ ${COMMONAPI_LIBDIR}
+ ${COMMONAPI_DBUS_LIBDIR}
+ ${GOBJECT_LIBRARY_DIRS}
+ ${GLIB_LIBRARY_DIRS}
+)
+
+set(LIBRARIES
+ ${DBUS_LIBRARIES}
+ ${COMMONAPI_LIBRARIES}
+ ${COMMONAPI_DBUS_LIBRARIES}
+ ${GOBJECT_LIBRARIES}
+ ${GLIB_LIBRARIES}
+)
+
+# Build service
+add_executable(${PROJECT_NAME} ${PRJ_SRCS})
+target_link_libraries(${PROJECT_NAME} ${LIBRARIES})
+
diff --git a/src/navigation/navigation-core/configuration-server-plugin/configuration-server-plugin-stub.cpp b/src/navigation/navigation-core/configuration-server-plugin/configuration-server-plugin-stub.cpp
new file mode 100644
index 0000000..d9e15be
--- /dev/null
+++ b/src/navigation/navigation-core/configuration-server-plugin/configuration-server-plugin-stub.cpp
@@ -0,0 +1,103 @@
+/**
+* @licence app begin@
+* SPDX-License-Identifier: MPL-2.0
+*
+* \copyright Copyright (C) 2013-2015, PCA Peugeot Citroen
+*
+* \file configuration-server-plugin-stub.cpp
+*
+* \brief This file is part of the poi 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 "configuration-server-plugin-stub.h"
+
+NavigationCoreConfigurationServerStub::NavigationCoreConfigurationServerStub()
+{
+
+}
+
+NavigationCoreConfigurationServerStub::~NavigationCoreConfigurationServerStub()
+{
+
+}
+
+void NavigationCoreConfigurationServerStub::getVersion(const std::shared_ptr<CommonAPI::ClientId> _client, getVersionReply_t _reply)
+{
+
+}
+
+void NavigationCoreConfigurationServerStub::setLocale(const std::shared_ptr<CommonAPI::ClientId> _client, std::string _languageCode, std::string _countryCode, std::string _scriptCode, setLocaleReply_t _reply)
+{
+
+}
+
+void NavigationCoreConfigurationServerStub::getLocale(const std::shared_ptr<CommonAPI::ClientId> _client, getLocaleReply_t _reply)
+{
+
+}
+
+void NavigationCoreConfigurationServerStub::getSupportedLocales(const std::shared_ptr<CommonAPI::ClientId> _client, getSupportedLocalesReply_t _reply)
+{
+
+}
+
+void NavigationCoreConfigurationServerStub::setTimeFormat(const std::shared_ptr<CommonAPI::ClientId> _client, ::org::genivi::navigation::NavigationTypes::TimeFormat _format, setTimeFormatReply_t _reply)
+{
+
+}
+
+void NavigationCoreConfigurationServerStub::getTimeFormat(const std::shared_ptr<CommonAPI::ClientId> _client, getTimeFormatReply_t _reply)
+{
+
+}
+
+void NavigationCoreConfigurationServerStub::getSupportedTimeFormats(const std::shared_ptr<CommonAPI::ClientId> _client, getSupportedTimeFormatsReply_t _reply)
+{
+
+}
+
+void NavigationCoreConfigurationServerStub::setCoordinatesFormat(const std::shared_ptr<CommonAPI::ClientId> _client, NavigationCoreConfiguration::CoordinatesFormat _coordinatesFormat, setCoordinatesFormatReply_t _reply)
+{
+
+}
+
+void NavigationCoreConfigurationServerStub::getCoordinatesFormat(const std::shared_ptr<CommonAPI::ClientId> _client, getCoordinatesFormatReply_t _reply)
+{
+
+}
+
+void NavigationCoreConfigurationServerStub::getSupportedCoordinatesFormat(const std::shared_ptr<CommonAPI::ClientId> _client, getSupportedCoordinatesFormatReply_t _reply)
+{
+
+}
+
+void NavigationCoreConfigurationServerStub::setUnitsOfMeasurement(const std::shared_ptr<CommonAPI::ClientId> _client, NavigationCoreConfiguration::UnitsOfMeasurement _unitsOfMeasurementList, setUnitsOfMeasurementReply_t _reply)
+{
+
+}
+
+void NavigationCoreConfigurationServerStub::getUnitsOfMeasurement(const std::shared_ptr<CommonAPI::ClientId> _client, getUnitsOfMeasurementReply_t _reply)
+{
+
+}
+
+void NavigationCoreConfigurationServerStub::getSupportedUnitsOfMeasurement(const std::shared_ptr<CommonAPI::ClientId> _client, getSupportedUnitsOfMeasurementReply_t _reply)
+{
+
+}
+
diff --git a/src/navigation/navigation-core/configuration-server-plugin/configuration-server-plugin-stub.h b/src/navigation/navigation-core/configuration-server-plugin/configuration-server-plugin-stub.h
new file mode 100644
index 0000000..383e658
--- /dev/null
+++ b/src/navigation/navigation-core/configuration-server-plugin/configuration-server-plugin-stub.h
@@ -0,0 +1,66 @@
+/**
+* @licence app begin@
+* SPDX-License-Identifier: MPL-2.0
+*
+* \copyright Copyright (C) 2013-2015, PCA Peugeot Citroen
+*
+* \file configuration-server-plugin.h
+*
+* \brief This file is part of the poi 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 CONFIGURATIONSERVERSTUBIMPL_H_
+#define CONFIGURATIONSERVERSTUBIMPL_H_
+
+#include <CommonAPI/CommonAPI.hpp>
+
+#include <org/genivi/CommonTypes.hpp>
+#include <org/genivi/navigation/NavigationTypes.hpp>
+#include <org/genivi/navigation/navigationcore/NavigationCoreTypes.hpp>
+#include <v0_1/org/genivi/navigation/navigationcore/NavigationCoreConfigurationStubDefault.hpp>
+
+using namespace std;
+using namespace v0_1::org::genivi::navigation::navigationcore;
+using namespace org::genivi::navigation;
+using namespace org::genivi;
+
+
+class NavigationCoreConfigurationServerStub: public NavigationCoreConfigurationStubDefault {
+
+public:
+ NavigationCoreConfigurationServerStub();
+ ~NavigationCoreConfigurationServerStub();
+ void getVersion(const std::shared_ptr<CommonAPI::ClientId> _client, getVersionReply_t _reply);
+ void setLocale(const std::shared_ptr<CommonAPI::ClientId> _client, std::string _languageCode, std::string _countryCode, std::string _scriptCode, setLocaleReply_t _reply);
+ void getLocale(const std::shared_ptr<CommonAPI::ClientId> _client, getLocaleReply_t _reply);
+ void getSupportedLocales(const std::shared_ptr<CommonAPI::ClientId> _client, getSupportedLocalesReply_t _reply);
+ void setTimeFormat(const std::shared_ptr<CommonAPI::ClientId> _client, ::org::genivi::navigation::NavigationTypes::TimeFormat _format, setTimeFormatReply_t _reply);
+ void getTimeFormat(const std::shared_ptr<CommonAPI::ClientId> _client, getTimeFormatReply_t _reply);
+ void getSupportedTimeFormats(const std::shared_ptr<CommonAPI::ClientId> _client, getSupportedTimeFormatsReply_t _reply);
+ void setCoordinatesFormat(const std::shared_ptr<CommonAPI::ClientId> _client, NavigationCoreConfiguration::CoordinatesFormat _coordinatesFormat, setCoordinatesFormatReply_t _reply);
+ void getCoordinatesFormat(const std::shared_ptr<CommonAPI::ClientId> _client, getCoordinatesFormatReply_t _reply);
+ void getSupportedCoordinatesFormat(const std::shared_ptr<CommonAPI::ClientId> _client, getSupportedCoordinatesFormatReply_t _reply);
+ void setUnitsOfMeasurement(const std::shared_ptr<CommonAPI::ClientId> _client, NavigationCoreConfiguration::UnitsOfMeasurement _unitsOfMeasurementList, setUnitsOfMeasurementReply_t _reply);
+ void getUnitsOfMeasurement(const std::shared_ptr<CommonAPI::ClientId> _client, getUnitsOfMeasurementReply_t _reply);
+ void getSupportedUnitsOfMeasurement(const std::shared_ptr<CommonAPI::ClientId> _client, getSupportedUnitsOfMeasurementReply_t _reply);
+
+private:
+
+};
+
+#endif /* CONFIGURATIONSERVERSTUBIMPL_H_ */
diff --git a/src/navigation/navigation-core/configuration-server-plugin/main.cpp b/src/navigation/navigation-core/configuration-server-plugin/main.cpp
new file mode 100644
index 0000000..1755085
--- /dev/null
+++ b/src/navigation/navigation-core/configuration-server-plugin/main.cpp
@@ -0,0 +1,77 @@
+/**
+* @licence app begin@
+* SPDX-License-Identifier: MPL-2.0
+*
+* \copyright Copyright (C) 2013-2015, PCA Peugeot Citroen
+*
+* \file main.cpp
+*
+* \brief This file is part of the poi 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 <stdbool.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <iostream>
+#include <fstream>
+#include <cmath>
+#include <thread>
+#include <typeinfo>
+#include <glib.h>
+
+#include <CommonAPI/CommonAPI.hpp> //Defined in the Common API Runtime library
+#include "configuration-server-plugin-stub.h"
+
+int main(int argc , char** argv )
+{
+ // Set the global C and C++ locale to the user-configured locale,
+ // so we can use std::cout with UTF-8, via Glib::ustring, without exceptions.
+ std::locale::global(std::locale(""));
+
+ // Common API data init
+ std::shared_ptr < CommonAPI::Runtime > runtime = CommonAPI::Runtime::get();
+
+ const std::string &domain = "local";
+ const std::string &instance = "Configuration";
+
+ std::string connection = "Configuration";
+
+ std::shared_ptr<NavigationCoreConfigurationServerStub> myServiceConfiguration = std::make_shared<NavigationCoreConfigurationServerStub>();
+
+ bool successfullyRegistered = runtime->registerService(domain, instance, myServiceConfiguration, connection);
+ while (!successfullyRegistered) {
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
+ successfullyRegistered = runtime->registerService(domain, instance, myServiceConfiguration, connection);
+ }
+
+ GMainLoop * mainloop ;
+
+ // Create a new GMainLoop with default context and initial state of "not running "
+ mainloop = g_main_loop_new (g_main_context_default() , FALSE );
+
+ // Send a feedback to the user
+ cout << "configuration server started" << endl;
+
+ g_main_loop_run ( mainloop );
+
+ return EXIT_SUCCESS;
+}
+
diff --git a/src/poi-service/rebuild_all.sh b/src/poi-service/rebuild_all.sh
index 2ef165a..677fc3d 100755
--- a/src/poi-service/rebuild_all.sh
+++ b/src/poi-service/rebuild_all.sh
@@ -1,17 +1,46 @@
#!/bin/bash
-if [ ! $COMMONAPI_TOOL_DIR ]
-then
- echo 'Set the dir of the common api tools'
- echo 'export COMMONAPI_TOOL_DIR=<path>'
- exit 1
-fi
-
-if [ ! $COMMONAPI_DBUS_TOOL_DIR ]
-then
- echo 'Set the dir of the common api dbus tools'
- echo 'export COMMONAPI_DBUS_TOOL_DIR=<path>'
- exit 1
+debug="OFF"
+franca="OFF"
+dbus="ON"
+commonapi_tools_option=""
+
+while getopts df opt
+do
+ case $opt in
+ d)
+ debug="ON"
+ ;;
+ f)
+ franca="ON"
+ dbus="OFF"
+ ;;
+ \?)
+ echo "Usage:"
+ echo "$0 [-df]"
+ echo "-d: Enable the debug messages"
+ echo "-f: Build using the Franca interfaces"
+ exit 1
+ esac
+done
+set -e
+
+if [ $franca="ON" ]
+then
+ if [ ! $COMMONAPI_TOOL_DIR ]
+ then
+ echo 'Set the dir of the common api tools'
+ echo 'export COMMONAPI_TOOL_DIR=<path>'
+ exit 1
+ fi
+
+ if [ ! $COMMONAPI_DBUS_TOOL_DIR ]
+ then
+ echo 'Set the dir of the common api dbus tools'
+ echo 'export COMMONAPI_DBUS_TOOL_DIR=<path>'
+ exit 1
+ fi
+ commonapi_tools_option="-DCOMMONAPI_DBUS_TOOL_DIR="$COMMONAPI_DBUS_TOOL_DIR" -DCOMMONAPI_TOOL_DIR="$COMMONAPI_TOOL_DIR
fi
echo 'delete the build folder'
@@ -20,8 +49,8 @@ rm -rf build
mkdir build
cd build
-echo 'build with CommonAPI'
-cmake -DWITH_FRANCA_DBUS_INTERFACE=ON -DWITH_DBUS_INTERFACE=OFF -DCOMMONAPI_DBUS_TOOL_DIR=$COMMONAPI_DBUS_TOOL_DIR -DCOMMONAPI_TOOL_DIR=$COMMONAPI_TOOL_DIR -DWITH_DEBUG=ON . ../
+echo 'build poi-server'
+cmake -DWITH_FRANCA_DBUS_INTERFACE=$franca -DWITH_DBUS_INTERFACE=$dbus $commonapi_tools_option -DWITH_DEBUG=$debug ../
make
diff --git a/test/poi-service/README b/test/poi-service/README
index 4342517..46e5b6b 100644
--- a/test/poi-service/README
+++ b/test/poi-service/README
@@ -1,4 +1,4 @@
-Release date of the file: 24-11-2015
+Release date of the file: 15-01-2016
Status: OK
Project:
@@ -15,7 +15,7 @@ See also other navigation projects like navigation or proof of concepts implemen
What is in:
This folder contains scripts for building poi-supplier, poi-contentaccess-module and poi-client, generating the databases and launching the whole stuff (build poi-server if necessary)
-FYI: poi-server is located under src/poi-service
+FYI: poi-server is located under ../../src/poi-service
Author:
Philippe Colliot philippe.colliot@mpsa.com
@@ -56,30 +56,34 @@ cd positioning
git checkout <current version of positioning>
cd ../
-===============================
-How To Build
-===============================
+=============================================================================================
+How to for the proof of concept
+=============================================================================================
(you're supposed to have got additional code before)
-Create and enter the build folder:
+==========================================
+All-in-one script (for paris area)
+==========================================
+./rebuild_all.sh
+
+==========================================
+How-to step by step, with explanations
+==========================================
+---Create and enter the build folder---
mkdir ./build
cd build
-
-Build:
cmake ../
make
cd ..
-===============================
-How To Prepare the database and the configuration for a country
-===============================
+---Prepare the database and the configuration for a country---
NB: You need to build the poi-supplier first:
cd build
cmake -DWITH_DATABASE_SUPPLIER=ON ../
make
cd ..
-To launch the stuff for Paris:
+---To generate the database for Paris---
./prepare -c paris
NB:
@@ -106,15 +110,42 @@ You need to fix it by:
sudo su
dbus-uuidgen > /etc/machine-id
-===============================
+==========================================
How To Run
-===============================
-
+==========================================
./run
-===============================
-How To Build poi-common-manager-client (experimental)
-===============================
+---Test sequence can be---
+On main panel:
+CREATE
+
+On additional panel:
+REGISTER
+ADDandREG
+
+On main panel
+Categories
+all categories with Radius set to 2000
+bicycle with Radius set to 5000
+replace 'enter text to search' with 'Saint'
+SEARCH
+You see FINISHED with 32 records
+Result list
+TOP/PREV/NEXT to watch the result
+For a new search, click on CANCEL first
+
+=============================================================================================
+How to for the common api based proof of concept (for testing add/remove stuff into a database)
+=============================================================================================
+
+==========================================
+All-in-one script
+==========================================
+./rebuil_all.sh -f
+
+==========================================
+How-to step by step, with explanations
+==========================================
First you need to build the poi-manager-server, see the README in ../../src/poi-service
cd build
@@ -129,6 +160,8 @@ make
===============================
How To Run
===============================
+./run_capi
+NB: the configuration file ./resource/commonapi-dbus.ini is copied into $HOME
Launch the server (into ../../src/poi-service)
@@ -144,7 +177,8 @@ Launch the client
./bin/poi-manager-client -t
poi manager client started
-What is logged (no DLT started):
+---Test sequence can be---
+NB: no DLT started
DLT| WARNING: Loging disabled, FIFO /tmp/dlt cannot be opened with open()!
[CAPI][INFO] Using default binding 'dbus'
diff --git a/test/poi-service/rebuild_all.sh b/test/poi-service/rebuild_all.sh
index ac20e38..acf09ae 100755
--- a/test/poi-service/rebuild_all.sh
+++ b/test/poi-service/rebuild_all.sh
@@ -1,22 +1,51 @@
#!/bin/bash
-if [ ! $COMMONAPI_TOOL_DIR ]
-then
- echo 'Set the dir of the common api tools'
- echo 'export COMMONAPI_TOOL_DIR=<path>'
- exit 1
-fi
+debug="OFF"
+franca="OFF"
+dbus="ON"
+commonapi_tools_option=""
+
+while getopts df opt
+do
+ case $opt in
+ d)
+ debug="ON"
+ ;;
+ f)
+ franca="ON"
+ dbus="OFF"
+ ;;
+ \?)
+ echo "Usage:"
+ echo "$0 [-df]"
+ echo "-d: Enable the debug messages"
+ echo "-f: Build using the Franca interfaces"
+ exit 1
+ esac
+done
+set -e
+
+if [ $franca="ON" ]
+then
+ if [ ! $COMMONAPI_TOOL_DIR ]
+ then
+ echo 'Set the dir of the common api tools'
+ echo 'export COMMONAPI_TOOL_DIR=<path>'
+ exit 1
+ fi
-if [ ! $COMMONAPI_DBUS_TOOL_DIR ]
-then
- echo 'Set the dir of the common api dbus tools'
- echo 'export COMMONAPI_DBUS_TOOL_DIR=<path>'
- exit 1
+ if [ ! $COMMONAPI_DBUS_TOOL_DIR ]
+ then
+ echo 'Set the dir of the common api dbus tools'
+ echo 'export COMMONAPI_DBUS_TOOL_DIR=<path>'
+ exit 1
+ fi
+ commonapi_tools_option="-DCOMMONAPI_DBUS_TOOL_DIR="$COMMONAPI_DBUS_TOOL_DIR" -DCOMMONAPI_TOOL_DIR="$COMMONAPI_TOOL_DIR
fi
echo 'build the poi server'
cd ../../src/poi-service
-./rebuild_all.sh
+./rebuild_all.sh "$@"
cd ../../test/poi-service
echo 'build the poi client'
@@ -27,8 +56,15 @@ rm -rf build
mkdir build
cd build
-echo 'build with CommonAPI'
-cmake -DWITH_FRANCA_DBUS_INTERFACE=ON -DWITH_DATABASE_SUPPLIER=ON -DCOMMONAPI_DBUS_TOOL_DIR=$COMMONAPI_DBUS_TOOL_DIR -DCOMMONAPI_TOOL_DIR=$COMMONAPI_TOOL_DIR -DWITH_DEBUG=ON . ../
-
+echo 'build poi-client'
+# Important notice: for the time being, it's just poi manager client that can be built against common api,
+# so it's needed to set WITH_DBUS_INTERFACE=ON for positioning
+cmake -DWITH_DATABASE_SUPPLIER=ON -DWITH_FRANCA_DBUS_INTERFACE=$franca -DWITH_DBUS_INTERFACE=ON $commonapi_tools_option -DWITH_DEBUG=$debug ../
make
+cd ..
+
+echo 'populate the database with POIs of Paris'
+./prepare -c paris
+
+
diff --git a/test/poi-service/run_capi b/test/poi-service/run_capi
new file mode 100755
index 0000000..944d2ef
--- /dev/null
+++ b/test/poi-service/run_capi
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# @licence app begin@
+# SPDX-License-Identifier: MPL-2.0
+#
+# \copyright Copyright (C) 2013-2014, PCA Peugeot Citroen
+#
+# \file run
+#
+# \brief This file is part of the Build System.
+#
+# \author Philippe Colliot <philippe.colliot@mpsa.com>
+#
+# \version 1.0
+#
+# 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@
+
+CURDIR=$PWD
+
+POI_CLIENT_DIR=$CURDIR
+POI_CLIENT_BIN_DIR=$POI_CLIENT_DIR/bin
+POI_SERVER_DIR=$CURDIR/../../src/poi-service
+POI_SERVER_BIN_DIR=$POI_SERVER_DIR/bin
+
+cp $POI_CLIENT_DIR/resource/commonapi-dbus.ini $HOME
+export COMMONAPI_DBUS_DEFAULT_CONFIG=$HOME/commonapi-dbus.ini
+cp $POI_SERVER_DIR/resource/poi-database-managed.db $POI_SERVER_BIN_DIR/bin
+
+echo '------------------------start the proof of concept------------------------'
+$POI_SERVER_BIN_DIR/poi-manager-server -f $POI_SERVER_BIN_DIR/poi-database-managed.db &
+$POI_CLIENT_BIN_DIR/poi-manager-client -t &
+
+