summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorasanoaozora <fifitaneki@hotmail.com>2017-12-21 11:20:30 +0100
committerasanoaozora <fifitaneki@hotmail.com>2017-12-21 11:20:30 +0100
commita3a65e6d544d0af6ee4e1dbbc5414d38fb04be15 (patch)
tree3435abedae54fbf139a03bf4c73231e1c6c0ead8 /src
parente24dfc26410683b59efa7500e325a4ffe724849e (diff)
downloadpoi-service-a3a65e6d544d0af6ee4e1dbbc5414d38fb04be15.tar.gz
start implementation of Franca2Wamp for FTS
Diffstat (limited to 'src')
-rw-r--r--src/freetextsearch-service-wamp/CMakeLists.txt135
-rw-r--r--src/freetextsearch-service-wamp/FreeTextSearchStubImpl.cpp241
-rw-r--r--src/freetextsearch-service-wamp/FreeTextSearchStubImpl.hpp78
-rw-r--r--src/freetextsearch-service-wamp/main.cpp52
-rw-r--r--src/freetextsearch-service-wamp/workdir/.crossbar/.gitignore3
-rw-r--r--src/freetextsearch-service-wamp/workdir/.crossbar/config.json131
-rw-r--r--src/freetextsearch-service-wamp/workdir/commonapi.ini11
-rwxr-xr-xsrc/freetextsearch-service-wamp/workdir/runRESTClient.sh11
-rwxr-xr-xsrc/freetextsearch-service-wamp/workdir/runServer.sh3
-rw-r--r--src/freetextsearch-service/CMakeLists.txt2
-rw-r--r--src/freetextsearch-service/FreeTextSearchStubImpl.hpp6
11 files changed, 669 insertions, 4 deletions
diff --git a/src/freetextsearch-service-wamp/CMakeLists.txt b/src/freetextsearch-service-wamp/CMakeLists.txt
new file mode 100644
index 0000000..d4e036c
--- /dev/null
+++ b/src/freetextsearch-service-wamp/CMakeLists.txt
@@ -0,0 +1,135 @@
+###########################################################################
+# @licence app begin@
+# SPDX-License-Identifier: MPL-2.0
+#
+# Component Name: freetextsearch-server
+#
+# Author: Philippe Colliot
+#
+# Copyright (C) 2016, 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(freetextsearch-server-wamp)
+message(STATUS ${PROJECT_NAME})
+
+cmake_minimum_required(VERSION 2.8)
+
+option(DBUS_LIB_PATH
+ "Path to the patched DBus library")
+option(FRANCA_WAMP_GENERATOR
+ "Franca to Wamp generator")
+
+set(CMAKE_VERBOSE_MAKEFILE on)
+set(CMAKE_CXX_FLAGS "-Wall -O0 -std=c++0x -D_GLIBCXX_USE_NANOSLEEP -pthread")
+
+set(API_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../api")
+set(FRANCA_DIR "${API_DIR}/franca")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
+
+set(PARENT_API freetextsearchservice)
+set(ROOT_API navigation)
+set(API_VERSION_MAJOR 1)
+set(API_VERSION "v${API_VERSION_MAJOR}")
+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})
+
+# DBus Path
+if(DBUS_LIB_PATH)
+ message(STATUS "DBUS_LIB_PATH = " ${DBUS_LIB_PATH})
+ set(DBUS_INCLUDE_DIRS ${DBUS_LIB_PATH}/include/dbus-1.0 ${DBUS_LIB_PATH}/lib/dbus-1.0/include)
+ set(DBUS_LIBDIR ${DBUS_LIB_PATH}/lib)
+ set(DBUS_LIBRARIES ${DBUS_LIB_PATH}/lib/libdbus-1.so)
+else()
+ message(FATAL_ERROR "Please specify the path to your patched DBus library using -DDBUS_LIB_PATH=yourPath")
+endif()
+
+# Franca to wamp generator
+file(GLOB FIDL_FILES
+ ${FRANCA_DIR}/CommonTypes.fidl
+ ${FRANCA_DIR}/navigation/NavigationTypes.fidl
+ ${FRANCA_DIR}/navigation/freetextsearchservice/*.fidl
+ )
+if(FRANCA_WAMP_GENERATOR)
+ foreach(RAW_FILE ${FIDL_FILES})
+ message(STATUS "Generate Wamp stuff for: " ${RAW_FILE})
+ execute_process(
+ COMMAND java -jar ${FRANCA_WAMP_GENERATOR} -f ${RAW_FILE} -o ${COMMONAPI_GEN_DIR}
+ )
+ endforeach()
+else()
+ message(FATAL_ERROR "Please specify the Franca Wamp generator using -DFRANCA_WAMP_GENERATOR=<generator>")
+endif()
+
+# Packages
+find_package(PkgConfig REQUIRED)
+find_package(CommonAPI 3.1.9 REQUIRED)
+find_package(CommonAPI-DBus 3.1.9 REQUIRED)
+find_package(CommonAPI-WAMP REQUIRED)
+
+pkg_check_modules(COMMONAPI "CommonAPI >= 3.1.9")
+pkg_check_modules(COMMONAPI_DBUS "CommonAPI-DBus >= 3.1.9")
+pkg_check_modules(SQLITE3 REQUIRED sqlite3)
+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/freetextsearchservice "${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)
+FILE(GLOB PRJ_WAMP_LIB_SRCS ${PRJ_SRC_GEN_PATH}/*Wamp*.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}
+ ${COMMONAPI_WAMP_INCLUDE_DIRS}
+ ${WAMP_INCLUDE_DIRS}
+ ${GOBJECT_INCLUDE_DIRS}
+ ${GLIB_INCLUDE_DIRS}
+ ${SQLITE3_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${DBUS_LIBDIR}
+ ${COMMONAPI_LIBDIR}
+ ${COMMONAPI_DBUS_LIBDIR}
+ ${COMMONAPI_WAMP_LIBDIR}
+ ${WAMP_LIBDIR}
+ ${GOBJECT_LIBRARY_DIRS}
+ ${GLIB_LIBRARY_DIRS}
+ ${SQLITE3_LIBRARY_DIRS}
+)
+
+set(LIBRARIES
+ ${DBUS_LIBRARIES}
+ ${COMMONAPI_LIBRARIES}
+ ${COMMONAPI_DBUS_LIBRARIES}
+ ${GOBJECT_LIBRARIES}
+ ${GLIB_LIBRARIES}
+ ${SQLITE3_LIBRARIES}
+)
+
+# Build service
+set(LINK_LIBRARIES -Wl,--no-as-needed -Wl,--as-needed CommonAPI)
+add_executable(${PROJECT_NAME} ${PRJ_SRCS})
+target_link_libraries(${PROJECT_NAME} ${LINK_LIBRARIES})
+install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+
+# Build gluecode.so
+add_library (${PROJECT_NAME}-wamp SHARED ${PRJ_WAMP_LIB_SRCS})
+target_link_libraries(${PROJECT_NAME}-wamp CommonAPI-WAMP ${WAMP_LIBRARIES})
+
diff --git a/src/freetextsearch-service-wamp/FreeTextSearchStubImpl.cpp b/src/freetextsearch-service-wamp/FreeTextSearchStubImpl.cpp
new file mode 100644
index 0000000..ef5b302
--- /dev/null
+++ b/src/freetextsearch-service-wamp/FreeTextSearchStubImpl.cpp
@@ -0,0 +1,241 @@
+/**
+ * @licence app begin@
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * \copyright Copyright (C) 2015, 2016 TomTom International B.V.
+ * \copyright Copyright (C) 2016, PCA Peugeot Citroen
+ * \author Peter Goedegebure (Peter.Goedegebure@tomtom.com)
+ * \author Philippe Colliot <philippe.colliot@mpsa.com>
+ * \author Morteza Damavandpeyma <Morteza.Damavandpeyma@tomtom.com>
+ * 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 "FreeTextSearchStubImpl.hpp"
+
+using namespace v4::org::genivi::navigation;
+using namespace v1::org::genivi::navigation::freetextsearchservice;
+using namespace v4::org::genivi;
+
+NavigationTypes::Handle nextHandle = 1;
+
+void FreeTextSearchStubImpl::getVersion(
+ const std::shared_ptr<CommonAPI::ClientId> _client,
+ getVersionReply_t _reply)
+{
+ std::cout << "getVersion called." << std::endl;
+
+ CommonTypes::Version* version = new CommonTypes::Version(0, 1, 0, "today");
+ _reply(*version);
+}
+
+void FreeTextSearchStubImpl::ftsRequest(
+ const std::shared_ptr<CommonAPI::ClientId> _client,
+ FreeTextSearch::FtsString _inputString,
+ NavigationTypes::Coordinate2D _searchLocation,
+ FreeTextSearch::ShapeList _searchShapes, FreeTextSearch::PageSize _pageSize,
+ FreeTextSearch::SearchOptions _searchOptions,
+ FreeTextSearch::FtsString _searchConditions,
+ FreeTextSearch::FuzzyLevel _fuzzyLevel, ftsRequestReply_t _reply)
+{
+ std::cout << "ftsRequest called." << std::endl;
+ iSearchIsInProgress = true;
+
+ // Create new session handle.
+ iSessionHandle++;
+
+ // Start from first page
+ iPageId = 0;
+
+ _reply(FreeTextSearch::ftsRequestError::OK, iSessionHandle, iPageId);
+
+ // Note: inputString is ignored, use fixed results.
+ // Note: searchLocation is ignored, use fixed results.
+ // TODO: introduce a value for 'not specified' for searchLocation (Coordinate2D).
+ // Note: searchShapes is ignored, use fixed results.
+ // Note: pageSize is ignored, use fixed size of 2. First page: 2 addresses (moreAvailable), 1 POI (no moreAvailable).
+ // Note: searchOptions is ignored, use fixed results.
+ // Note: searchConditions is ignored, use fixed results,
+ // Note: fuzzyLevel is ignored, used fixed results.
+
+ FreeTextSearch::Addresses addresses;
+ FreeTextSearch::Address* addressPtr;
+ FreeTextSearch::FtsStringList* places;
+ FreeTextSearch::FtsStringList* postalCodes;
+ FreeTextSearch::StreetDetails* streetDetailsPtr;
+
+ addressPtr = new FreeTextSearch::Address();
+ NavigationTypes::LocationHandle locationHandle1 = 1234;
+ addressPtr->setLocationHandle(locationHandle1);
+ addressPtr->setCountryCode("NLD");
+ addressPtr->setStateCode("");
+ places = new FreeTextSearch::FtsStringList();
+ places->push_back("Eindhoven");
+ addressPtr->setPlaces(*places);
+ postalCodes = new FreeTextSearch::FtsStringList();
+ postalCodes->push_back("5657 EB");
+ addressPtr->setPostalCodes(*postalCodes);
+ streetDetailsPtr = new FreeTextSearch::StreetDetails();
+ streetDetailsPtr->setStreetName("Luchthavenweg");
+ streetDetailsPtr->setHouseNumber("48");
+ streetDetailsPtr->setHouseNumberFromInput("");
+ FreeTextSearch::AddressDetails addressDetails(*streetDetailsPtr);
+ addressPtr->setAddressDetails(addressDetails);
+ addressPtr->setMapCode("L2D.3Z");
+ NavigationTypes::Coordinate2D* coordinate1 = new NavigationTypes::Coordinate2D(51.455664, 5.396336);
+ addressPtr->setCoordinate(*coordinate1);
+ addressPtr->setDistance(4566);
+ addressPtr->setScore(1000);
+ addressPtr->setFuzzyMatch(false);
+ addresses.push_back(*addressPtr);
+
+ addressPtr = new FreeTextSearch::Address();
+ NavigationTypes::LocationHandle locationHandle2 = 9876;
+ addressPtr->setLocationHandle(locationHandle2);
+ addressPtr->setCountryCode("NLD");
+ addressPtr->setStateCode("");
+ places = new FreeTextSearch::FtsStringList();
+ places->push_back("'s Hertogenbosch");
+ addressPtr->setPlaces(*places);
+ postalCodes = new FreeTextSearch::FtsStringList();
+ postalCodes->push_back("<postal code>");
+ addressPtr->setPostalCodes(*postalCodes);
+ streetDetailsPtr = new FreeTextSearch::StreetDetails();
+ streetDetailsPtr->setStreetName("<street>");
+ streetDetailsPtr->setHouseNumber("<housenumber>");
+ streetDetailsPtr->setHouseNumberFromInput("");
+ FreeTextSearch::AddressDetails addressDetails2(*streetDetailsPtr);
+ addressPtr->setAddressDetails(addressDetails2);
+ addressPtr->setMapCode("<map code>");
+ NavigationTypes::Coordinate2D* coordinate2 = new NavigationTypes::Coordinate2D(52.434356, 17.555336);
+ addressPtr->setCoordinate(*coordinate2);
+ addressPtr->setDistance(196534);
+ addressPtr->setScore(578);
+ addressPtr->setFuzzyMatch(true);
+ addresses.push_back(*addressPtr);
+
+ fireFtsResultAddressesSelective(iSessionHandle, iPageId, addresses, true);
+
+ FreeTextSearch::POIs pois;
+ FreeTextSearch::POI* poiPtr;
+ poiPtr = new FreeTextSearch::POI();
+ NavigationTypes::LocationHandle locationHandle3 = 102934;
+ poiPtr->setLocationHandle(locationHandle3);
+ FreeTextSearch::POICategoryCode poiCategoryCode = 754;
+ poiPtr->setCategoryCode(poiCategoryCode);
+ FreeTextSearch::FtsStringList* brandNames;
+ brandNames = new FreeTextSearch::FtsStringList();
+ brandNames->push_back("TomTom");
+ brandNames->push_back("Bandit");
+ poiPtr->setBrandNames(*brandNames);
+ poiPtr->setPoiName("TomTom Eindhoven");
+ poiPtr->setAddress("Luchthavenweg 48, 5657 EB Eindhoven");
+ places = new FreeTextSearch::FtsStringList();
+ places->push_back("Eindhoven");
+ poiPtr->setPlace(*places);
+ postalCodes = new FreeTextSearch::FtsStringList();
+ postalCodes->push_back("5657 EB");
+ poiPtr->setPostalCode(*postalCodes);
+ poiPtr->setMapCode("L2D.3Z");
+ poiPtr->setCountryCode("NLD");
+ poiPtr->setStateCode("");
+ poiPtr->setTelephone("+31 40 84 44899");
+ poiPtr->setCoordinate(*coordinate1);
+ poiPtr->setDistance(1000);
+ poiPtr->setScore(1);
+ poiPtr->setFuzzyMatch(false);
+ poiPtr->setHasParents(false);
+ poiPtr->setHasChildren(false);
+ poiPtr->setDetourDistance(100);
+ poiPtr->setDetourTime(200);
+
+ pois.push_back(*poiPtr);
+ fireFtsResultPoisSelective(iSessionHandle, iPageId, pois, false);
+
+ FreeTextSearch::POICategories poiCategories;
+ fireFtsResultPoiSuggestionsSelective(iSessionHandle, iPageId, poiCategories);
+
+ fireFtsDoneSelective(iSessionHandle, iPageId, FreeTextSearch::FtsStatus::OK);
+ iSearchIsInProgress = false;
+}
+
+void FreeTextSearchStubImpl::ftsNextPage(
+ const std::shared_ptr<CommonAPI::ClientId> _client,
+ NavigationTypes::Handle _sessionHandle,
+ FreeTextSearch::SearchOptions _searchOptions, ftsNextPageReply_t _reply)
+{
+ std::cout << "ftsNextPage called." << std::endl;
+ if (iSearchIsInProgress)
+ {
+ std::cout << "There is a search in progress" << std::endl;
+ _reply(FreeTextSearch::ftsNextPageError::Literal::AlreadyInProgress, -1);
+ return;
+ }
+
+ iSearchIsInProgress = true;
+ // Note: searchOptions are ignored; always 1 address returned.
+
+ // Get the next page.
+ iPageId++;
+ _reply(FreeTextSearch::ftsNextPageError::Literal::OK, iPageId);
+
+ FreeTextSearch::Addresses addresses;
+ FreeTextSearch::Address* addressPtr;
+ addressPtr = new FreeTextSearch::Address();
+ NavigationTypes::LocationHandle locationHandle = 74658;
+ addressPtr->setLocationHandle(locationHandle);
+ addressPtr->setCountryCode("NLD");
+ addressPtr->setStateCode("");
+ FreeTextSearch::FtsStringList* places;
+ places = new FreeTextSearch::FtsStringList();
+ places->push_back("Amsterdam");
+ addressPtr->setPlaces(*places);
+ FreeTextSearch::FtsStringList* postalCodes;
+ postalCodes = new FreeTextSearch::FtsStringList();
+ postalCodes->push_back("<postal code>");
+ addressPtr->setPostalCodes(*postalCodes);
+ addressPtr->setMapCode("<map code>");
+ FreeTextSearch::StreetDetails* streetDetailsPtr;
+ streetDetailsPtr = new FreeTextSearch::StreetDetails();
+ streetDetailsPtr->setStreetName("<a street in Amsterdam>");
+ streetDetailsPtr->setHouseNumber("<housenumber>");
+ streetDetailsPtr->setHouseNumberFromInput("");
+ FreeTextSearch::AddressDetails addressDetails(*streetDetailsPtr);
+ addressPtr->setAddressDetails(addressDetails);
+ NavigationTypes::Coordinate2D* coordinate = new NavigationTypes::Coordinate2D(50.123456, 9.838374);
+ addressPtr->setCoordinate(*coordinate);
+ addressPtr->setDistance(3009);
+ addressPtr->setScore(33);
+ addressPtr->setFuzzyMatch(false);
+ addresses.push_back(*addressPtr);
+ fireFtsResultAddressesSelective(iSessionHandle, iPageId, addresses, false);
+
+ fireFtsDoneSelective(iSessionHandle, iPageId, FreeTextSearch::FtsStatus::OK);
+ iSearchIsInProgress = false;
+}
+
+void FreeTextSearchStubImpl::ftsCancel(
+ const std::shared_ptr<CommonAPI::ClientId> _client,
+ NavigationTypes::Handle _sessionHandle, ftsCancelReply_t _reply)
+{
+ std::cout << "ftsCancel called." << std::endl;
+ _reply(FreeTextSearch::ftsCancelError::Literal::OK);
+}
+
+void FreeTextSearchStubImpl::deleteLocationHandles(
+ const std::shared_ptr<CommonAPI::ClientId> _client,
+ FreeTextSearch::LocationHandleList _locationHandleList,
+ deleteLocationHandlesReply_t _reply)
+{
+ std::cout << "deleteLocationHandles called." << std::endl;
+ _reply();
+}
+
diff --git a/src/freetextsearch-service-wamp/FreeTextSearchStubImpl.hpp b/src/freetextsearch-service-wamp/FreeTextSearchStubImpl.hpp
new file mode 100644
index 0000000..0562b62
--- /dev/null
+++ b/src/freetextsearch-service-wamp/FreeTextSearchStubImpl.hpp
@@ -0,0 +1,78 @@
+/**
+ * @licence app begin@
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * \copyright Copyright (C) 2015, 2016 TomTom International B.V.
+ * \copyright Copyright (C) 2016, PCA Peugeot Citroen
+ * \author Peter Goedegebure (Peter.Goedegebure@tomtom.com)
+ * \author Philippe Colliot <philippe.colliot@mpsa.com>
+ * \author Morteza Damavandpeyma <Morteza.Damavandpeyma@tomtom.com>
+ * 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 FREETEXTSEARCHSTUBIMPL_H_
+#define FREETEXTSEARCHSTUBIMPL_H_
+
+#include <CommonAPI/CommonAPI.hpp>
+#include <v4/org/genivi/CommonTypes.hpp>
+#include <v4/org/genivi/navigation/NavigationTypes.hpp>
+#include <v1/org/genivi/navigation/freetextsearchservice/FreeTextSearch.hpp>
+#include <v1/org/genivi/navigation/freetextsearchservice/FreeTextSearchStubDefault.hpp>
+
+namespace v1 {
+namespace org {
+namespace genivi {
+namespace navigation {
+namespace freetextsearchservice {
+
+class FreeTextSearchStubImpl: public FreeTextSearchStubDefault
+{
+
+public:
+ void getVersion(const std::shared_ptr<CommonAPI::ClientId> _client,
+ getVersionReply_t _reply) override;
+
+ void ftsRequest(const std::shared_ptr<CommonAPI::ClientId> _client,
+ FreeTextSearch::FtsString _inputString,
+ v4::org::genivi::navigation::NavigationTypes::Coordinate2D _searchLocation,
+ FreeTextSearch::ShapeList _searchShapes,
+ FreeTextSearch::PageSize _pageSize,
+ FreeTextSearch::SearchOptions _searchOptions,
+ FreeTextSearch::FtsString _searchConditions,
+ FreeTextSearch::FuzzyLevel _fuzzyLevel, ftsRequestReply_t _reply)
+ override;
+
+ void ftsNextPage(const std::shared_ptr<CommonAPI::ClientId> _client,
+ v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle,
+ FreeTextSearch::SearchOptions _searchOptions, ftsNextPageReply_t _reply)
+ override;
+
+ void ftsCancel(const std::shared_ptr<CommonAPI::ClientId> _client,
+ v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle, ftsCancelReply_t _reply) override;
+
+ void deleteLocationHandles(const std::shared_ptr<CommonAPI::ClientId> _client,
+ FreeTextSearch::LocationHandleList _locationHandleList,
+ deleteLocationHandlesReply_t _reply) override;
+private:
+ v4::org::genivi::navigation::NavigationTypes::Handle iSessionHandle = 0;
+ FreeTextSearch::PageId iPageId = 0;
+ bool iSearchIsInProgress = false;
+
+};
+} // namespace freetextsearchservice
+} // namespace navigation
+} // namespace genivi
+} // namespace org
+} // namespace v1
+
+#endif /* FREETEXTSEARCHSTUBIMPL_H_ */
diff --git a/src/freetextsearch-service-wamp/main.cpp b/src/freetextsearch-service-wamp/main.cpp
new file mode 100644
index 0000000..4f3d058
--- /dev/null
+++ b/src/freetextsearch-service-wamp/main.cpp
@@ -0,0 +1,52 @@
+/**
+* @licence app begin@
+* SPDX-License-Identifier: MPL-2.0
+*
+* \copyright Copyright (C) 2015, 2016 TomTom International B.V.
+* \copyright Copyright (C) 2016, PCA Peugeot Citroen
+* \author Peter Goedegebure (Peter.Goedegebure@tomtom.com)
+* \author Philippe Colliot <philippe.colliot@mpsa.com>
+* \author Morteza Damavandpeyma <Morteza.Damavandpeyma@tomtom.com>
+* 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 <thread>
+#include <iostream>
+
+#include <CommonAPI/CommonAPI.hpp>
+#include "FreeTextSearchStubImpl.hpp"
+
+int main()
+{
+ CommonAPI::Runtime::setProperty("LibraryBase", "FreeTextSearch");
+
+ std::shared_ptr<CommonAPI::Runtime> runtime = CommonAPI::Runtime::get();
+
+ std::string domain = "local";
+ std::string instance = "org.genivi.navigation.freetextsearchservice";
+ std::string connection = "service";
+
+ // create service and register it at runtime
+ std::shared_ptr<v1::org::genivi::navigation::freetextsearchservice::FreeTextSearchStubImpl> myService =
+ std::make_shared<v1::org::genivi::navigation::freetextsearchservice::FreeTextSearchStubImpl>();
+ runtime->registerService(domain, instance, myService);
+ std::cout << "Successfully Registered FTS Service!" << std::endl;
+
+ while (true) {
+ std::cout << "Waiting for calls... (Abort with CTRL+C)" << std::endl;
+ std::this_thread::sleep_for(std::chrono::seconds(60));
+ }
+
+ return 0;
+}
+
diff --git a/src/freetextsearch-service-wamp/workdir/.crossbar/.gitignore b/src/freetextsearch-service-wamp/workdir/.crossbar/.gitignore
new file mode 100644
index 0000000..a6c0313
--- /dev/null
+++ b/src/freetextsearch-service-wamp/workdir/.crossbar/.gitignore
@@ -0,0 +1,3 @@
+key.priv
+key.pub
+node.pid
diff --git a/src/freetextsearch-service-wamp/workdir/.crossbar/config.json b/src/freetextsearch-service-wamp/workdir/.crossbar/config.json
new file mode 100644
index 0000000..0635149
--- /dev/null
+++ b/src/freetextsearch-service-wamp/workdir/.crossbar/config.json
@@ -0,0 +1,131 @@
+{
+ "version": 2,
+ "workers": [
+ {
+ "type": "router",
+ "realms": [
+ {
+ "name": "realm1",
+ "roles": [
+ {
+ "name": "public",
+ "permissions": [
+ {
+ "uri": "",
+ "match": "prefix",
+ "allow": {
+ "call": true,
+ "register": true,
+ "publish": true,
+ "subscribe": true
+ },
+ "disclose": {
+ "caller": false,
+ "publisher": false
+ },
+ "cache": true
+ }
+ ]
+ },
+ {
+ "name": "user",
+ "permissions": [
+ {
+ "uri": "",
+ "match": "prefix",
+ "allow": {
+ "call": true,
+ "register": true,
+ "publish": true,
+ "subscribe": true
+ },
+ "disclose": {
+ "caller": false,
+ "publisher": false
+ },
+ "cache": true
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "transports": [
+ {
+ "type": "web",
+ "endpoint": {
+ "type": "tcp",
+ "port": 8080
+ },
+ "paths": {
+ "/": {
+ "type": "static",
+ "directory": "../web"
+ },
+ "ws": {
+ "type": "websocket",
+ "auth": {
+ "anonymous": {
+ "type": "static",
+ "role": "public"
+ }
+ }
+ },
+ "call": {
+ "type": "caller",
+ "realm": "realm1",
+ "role": "public",
+ "options": {
+ "debug": true
+ }
+ }
+ }
+ },
+ {
+ "type": "rawsocket",
+ "endpoint": {
+ "type": "tcp",
+ "port": 8000
+ },
+ "auth": {
+ "anonymous": {
+ "type": "static",
+ "role": "public"
+ },
+ "wampcra": {
+ "type": "static",
+ "users": {
+ "homer": {
+ "secret": "secret123",
+ "role": "user"
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "rawsocket",
+ "endpoint": {
+ "type": "unix",
+ "path": "/tmp/crossbar.sock"
+ },
+ "auth": {
+ "anonymous": {
+ "type": "static",
+ "role": "public"
+ },
+ "wampcra": {
+ "type": "static",
+ "users": {
+ "homer": {
+ "secret": "secret123",
+ "role": "user"
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/freetextsearch-service-wamp/workdir/commonapi.ini b/src/freetextsearch-service-wamp/workdir/commonapi.ini
new file mode 100644
index 0000000..2458c3c
--- /dev/null
+++ b/src/freetextsearch-service-wamp/workdir/commonapi.ini
@@ -0,0 +1,11 @@
+[default]
+binding=wamp
+
+[logging]
+console=true
+level=verbose
+dlt=false
+
+
+[stub]
+local:org.genivi.navigation.freetextsearchservice:v0_7:org.genivi.navigation.freetextsearchservice=../../build/libFreeTextSearch-wamp.so
diff --git a/src/freetextsearch-service-wamp/workdir/runRESTClient.sh b/src/freetextsearch-service-wamp/workdir/runRESTClient.sh
new file mode 100755
index 0000000..487b8c2
--- /dev/null
+++ b/src/freetextsearch-service-wamp/workdir/runRESTClient.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# NOTE: the first argument (here: 7) is the client id for the communication
+# the second and third argument are the actual arguments for the add2() method
+# the return value will be another struct containing the sum and the difference of the add2 arguments
+
+curl -H "Content-Type: application/json" \
+ -d '{"procedure": "local:org.genivi.navigation.freetextsearchservice:v0_7:org.genivi.navigation.freetextsearchservice.add2", "args": [7, 33, 22]}' \
+ http://127.0.0.1:8080/call
+
+echo
diff --git a/src/freetextsearch-service-wamp/workdir/runServer.sh b/src/freetextsearch-service-wamp/workdir/runServer.sh
new file mode 100755
index 0000000..75be95b
--- /dev/null
+++ b/src/freetextsearch-service-wamp/workdir/runServer.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+../../build/FreeTextSearchService
diff --git a/src/freetextsearch-service/CMakeLists.txt b/src/freetextsearch-service/CMakeLists.txt
index 028365f..9ca9886 100644
--- a/src/freetextsearch-service/CMakeLists.txt
+++ b/src/freetextsearch-service/CMakeLists.txt
@@ -32,7 +32,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(PARENT_API freetextsearchservice)
set(ROOT_API navigation)
-set(API_VERSION_MAJOR 0)
+set(API_VERSION_MAJOR 1)
set(API_VERSION "v${API_VERSION_MAJOR}")
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})
diff --git a/src/freetextsearch-service/FreeTextSearchStubImpl.hpp b/src/freetextsearch-service/FreeTextSearchStubImpl.hpp
index a6fbce3..2badb58 100644
--- a/src/freetextsearch-service/FreeTextSearchStubImpl.hpp
+++ b/src/freetextsearch-service/FreeTextSearchStubImpl.hpp
@@ -26,10 +26,10 @@
#include <CommonAPI/CommonAPI.hpp>
#include <v4/org/genivi/CommonTypes.hpp>
#include <v4/org/genivi/navigation/NavigationTypes.hpp>
-#include <v0/org/genivi/navigation/freetextsearchservice/FreeTextSearch.hpp>
-#include <v0/org/genivi/navigation/freetextsearchservice/FreeTextSearchStubDefault.hpp>
+#include <v1/org/genivi/navigation/freetextsearchservice/FreeTextSearch.hpp>
+#include <v1/org/genivi/navigation/freetextsearchservice/FreeTextSearchStubDefault.hpp>
-using namespace v0::org::genivi::navigation::freetextsearchservice;
+using namespace v1::org::genivi::navigation::freetextsearchservice;
using namespace v4::org::genivi::navigation;
using namespace v4::org::genivi;