diff options
-rw-r--r-- | src/poi-service/README.md | 21 | ||||
-rw-r--r-- | src/poi-service/poi-manager-server/CMakeLists.txt | 8 | ||||
-rw-r--r-- | src/poi-service/poi-manager-server/README.md | 14 | ||||
-rw-r--r-- | src/poi-service/poi-manager-server/poi-manager-server-stub.cpp | 4 | ||||
-rwxr-xr-x | src/poi-service/poi-manager-server/run.sh | 2 | ||||
-rw-r--r-- | test/navigation/bustle.mk | 6 | ||||
-rwxr-xr-x | test/navigation/test-poi-capi.py | 166 | ||||
-rw-r--r-- | test/poi-service/poi-manager-client/CMakeLists.txt | 8 | ||||
-rw-r--r-- | test/poi-service/poi-manager-client/README.md | 13 | ||||
-rw-r--r-- | test/poi-service/poi-manager-client/commonapi-dbus.ini | 9 | ||||
-rw-r--r-- | test/poi-service/poi-manager-client/commonapi4dbus.ini | 4 | ||||
-rw-r--r-- | test/poi-service/poi-manager-client/main.cpp | 87 | ||||
-rwxr-xr-x | test/poi-service/test-poi-capi.py | 30 |
13 files changed, 111 insertions, 261 deletions
diff --git a/src/poi-service/README.md b/src/poi-service/README.md index a0e8c29..a8ebd94 100644 --- a/src/poi-service/README.md +++ b/src/poi-service/README.md @@ -28,13 +28,21 @@ or to build updated parts ## How To Run ```./bin/poi-server -f ./resource/poi-database-sample.db``` -## How to for the CommonAPI based version (draft) -The former version of the POCs is based on GLib DBus. A migration to CommonAPI is under progress. +## How to for the CommonAPI based version -###Prerequisites -You need CommonAPI 3.1.5 and Franca 0.9.1 installed +## Prerequisites +You need CommonAPI 3.1.9 and Franca 0.9.1 installed For the Ubuntu 64 bits, due to the use of symbol versioning LIBDBUS_1_0 by CommonAPI-DBus, the patched version of DBus has to be >= 1.10.0 -NB: the patch common-api-dbus-runtime/src/dbus-patches/capi-dbus-add-support-for-custom-marshalling.patch failed a little bit, it's needed to update the dbus/dbus-string.h manually +NB: In case you migrate from 3.1.5 to 3.1.9, due to a cmake issue (wrong management of micro version), it's necessary to do: +``` +sudo mv /usr/local/lib/cmake/CommonAPI-3.1.5 /usr/local/lib/cmake/oldCommonAPI-3.1.5 +``` +Symbolic links are also not well managed, so you need to fix it: +``` +sudo ln -sfn /usr/local/lib/libCommonAPI.so.3.1.9 /usr/local/lib/libCommonAPI.so.3 +sudo ln -sfn /usr/local/lib/libCommonAPI-DBus.so.3.1.9 /usr/local/lib/libCommonAPI-DBus.so.3 +``` +NB: the patch common-api-dbus-runtime/src/dbus-patches/capi-dbus-add-support-for-custom-marshalling.patch may fail a little bit, in that case it's needed to update the dbus/dbus-string.h manually ### How to build First it's required to set some paths: @@ -49,9 +57,6 @@ to clean and rebuild all (including invoking cmake) or to build updated parts ```./build.sh -m``` -NB: in case you didn't build the whole code yet, you can also invoke -```./clone_and_build.sh -m``` - ## How To Test ```./run-capi &``` ```../../test/poi-service/test-poi-capi.py``` diff --git a/src/poi-service/poi-manager-server/CMakeLists.txt b/src/poi-service/poi-manager-server/CMakeLists.txt index 2ea667b..4fe46ce 100644 --- a/src/poi-service/poi-manager-server/CMakeLists.txt +++ b/src/poi-service/poi-manager-server/CMakeLists.txt @@ -41,12 +41,12 @@ endif() # Packages find_package(PkgConfig REQUIRED) -find_package(CommonAPI 3.1.5 REQUIRED) -find_package(CommonAPI-DBus 3.1.5 REQUIRED) +find_package(CommonAPI) +find_package(CommonAPI-DBus) #pkg_check_modules(DBUS "dbus-1 >= 1.8.4") // #to be fixed, it doesn't work so the paths are set manually (see above) -pkg_check_modules(COMMONAPI "CommonAPI >= 3.1.5") -pkg_check_modules(COMMONAPI_DBUS "CommonAPI-DBus >= 3.1.5") +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) diff --git a/src/poi-service/poi-manager-server/README.md b/src/poi-service/poi-manager-server/README.md index df99baa..2c65a93 100644 --- a/src/poi-service/poi-manager-server/README.md +++ b/src/poi-service/poi-manager-server/README.md @@ -9,9 +9,19 @@ NB: The client part is located under ../../test/poi-manager-client Desktop: Tested under Ubuntu 16.04 LTS 64 bits ## Prerequisites -You need CommonAPI 3.1.5 and Franca 0.9.1 installed +You need CommonAPI 3.1.9 and Franca 0.9.1 installed For the Ubuntu 64 bits, due to the use of symbol versioning LIBDBUS_1_0 by CommonAPI-DBus, the patched version of DBus has to be >= 1.10.0 -NB: the patch common-api-dbus-runtime/src/dbus-patches/capi-dbus-add-support-for-custom-marshalling.patch failed a little bit, it's needed to update the dbus/dbus-string.h manually +NB: In case you migrate from 3.1.5 to 3.1.9, due to a cmake issue (wrong management of micro version), it's necessary to do: +``` +sudo mv /usr/local/lib/cmake/CommonAPI-3.1.5 /usr/local/lib/cmake/oldCommonAPI-3.1.5 +``` +Symbolic links are also not well managed, so you need to fix it: +``` +sudo ln -sfn /usr/local/lib/libCommonAPI.so.3.1.9 /usr/local/lib/libCommonAPI.so.3 +sudo ln -sfn /usr/local/lib/libCommonAPI-DBus.so.3.1.9 /usr/local/lib/libCommonAPI-DBus.so.3 +``` + +NB: the patch common-api-dbus-runtime/src/dbus-patches/capi-dbus-add-support-for-custom-marshalling.patch may fail a little bit, in that case it's needed to update the dbus/dbus-string.h manually ## How to build First it's required to set some paths: diff --git a/src/poi-service/poi-manager-server/poi-manager-server-stub.cpp b/src/poi-service/poi-manager-server/poi-manager-server-stub.cpp index 2beec13..07f4c93 100644 --- a/src/poi-service/poi-manager-server/poi-manager-server-stub.cpp +++ b/src/poi-service/poi-manager-server/poi-manager-server-stub.cpp @@ -1241,13 +1241,13 @@ void PoiManagerServerStub::getVersion(const std::shared_ptr<CommonAPI::ClientId> void PoiManagerServerStub::setLocale(const std::shared_ptr<CommonAPI::ClientId> _client, std::string _languageCode, std::string _countryCode, std::string _scriptCode, setLocaleReply_t _reply) { - std::vector<uint16_t> changedSettings; + std::vector<POIServiceTypes::Settings> changedSettings; m_languageCode = _languageCode; m_countryCode = _countryCode; m_scriptCode = _scriptCode; - changedSettings.push_back(POIServiceTypes::ConfigurationChangedReason::LOCALES); + changedSettings.push_back(POIServiceTypes::Settings::LOCALE); fireConfigurationChangedEvent(changedSettings); } diff --git a/src/poi-service/poi-manager-server/run.sh b/src/poi-service/poi-manager-server/run.sh index eb6337a..4175d33 100755 --- a/src/poi-service/poi-manager-server/run.sh +++ b/src/poi-service/poi-manager-server/run.sh @@ -3,4 +3,4 @@ RESOURCE=../resource cp $RESOURCE/poi-database-managed.db ./bin COMMONAPI_DEFAULT_CONFIG=$RESOURCE/commonapi4dbus.ini \ COMMONAPI_DBUS_DEFAULT_CONFIG=$RESOURCE/commonapi-dbus.ini \ -./bin/poi-manager-server -f ./bin/poi-database-managed.db & +./bin/poi-manager-server -f ./bin/poi-database-managed.db diff --git a/test/navigation/bustle.mk b/test/navigation/bustle.mk index a26dc6b..605eac1 100644 --- a/test/navigation/bustle.mk +++ b/test/navigation/bustle.mk @@ -23,11 +23,11 @@ # <date>, <name>, <description of change> # # @licence end@ -bustle_URL="http://anongit.freedesktop.org/git/bustle.git" -bustle_VERSION=61ac45d195476edb810a1c2345c886fdc51a20cc +bustle_URL="https://github.com/wjt/bustle.git" +bustle_VERSION=0a426c396ee890bbde67791dbf8d2c21b9cc6a3c bustle_SRC=$(SRC_DIR)/bustle bustle_BIN=$(BIN_DIR)/bustle -bustle_DEPS+= gtk2.0-dev haskell-platform libghc-gtk-dev libghc-glade-dev libpcap-dev language-pack-de language-pack-fr gtk2hs-buildtools libdbus-1-dev +bustle_DEPS+= gtk2.0-dev haskell-platform libghc-gtk-dev libpcap-dev language-pack-de language-pack-fr gtk2hs-buildtools libdbus-1-dev DEPS+=$(bustle_DEPS) ALL+=bustle diff --git a/test/navigation/test-poi-capi.py b/test/navigation/test-poi-capi.py deleted file mode 100755 index f1f6c33..0000000 --- a/test/navigation/test-poi-capi.py +++ /dev/null @@ -1,166 +0,0 @@ -#!/usr/bin/python - -""" -************************************************************************** -* @licence app begin@ -* SPDX-License-Identifier: MPL-2.0 -* -* \copyright Copyright (C) 2016, PSA GROUP -* -* \file test-poi-capi.py -* -* \brief This simple test shows how the poi search -* could be easily tested using a python script -* -* \author Philippe Colliot <philippe.colliot@mpsa.com> -* -* \version 1.0 -* -* 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/. -* List of changes: -* -* @licence end@ -************************************************************************** -""" - -import dbus -import gobject -import dbus.mainloop.glib -import time - -import pdb; -#pdb.set_trace() -#constants as defined in the Navigation API -GENIVI_Configuration_Settings_LOCALE = 37 -GENIVI_SearchStatusState_FINISHED = 1298 -GENIVI_SearchStatusState_NOT_STARTED = 1296 - -#constants used into the script -TIME_OUT = 10000 -LATITUDE_PARIS = 48.8578 -LONGITUDE_PARIS = 2.3380 -ALTITUDE_PARIS = 30.0 -ID_HOTEL = 2 -ID_STATION = 6 -ATTRIBUTE_SOURCE = 0 -ATTRIBUTE_PHONE = 2 -RADIUS_HOTEL = 100 #in tenth of meter ! -RADIUS_STATION = 500 -STRING_TO_SEARCH = "Saint-Germain" - -def catch_poi_configurationChanged_signal_handler(changedSettings): - for changedSetting in changedSettings: - if changedSetting == GENIVI_Configuration_Settings_LOCALE: - ret=g_poiConfiguration_interface.getLocale() - print("language: " + ret[0]) - print("country: " + ret[1]) - print("script: " + ret[2]) - -def catch_poi_poiStatus_signal_handler(poiSearchHandle,statusValue): - if poiSearchHandle == g_searchHandle: - if statusValue == GENIVI_SearchStatusState_FINISHED: - print("Search finished") - elif statusValue == GENIVI_SearchStatusState_NOT_STARTED: - g_poiSearch_interface.deletePoiSearchHandle(poiSearchHandle) - print("Test PASSED") - loop.quit() - -def catch_poi_resultListChanged_signal_handler(poiSearchHandle,resultListSize): - poiList=[] - if poiSearchHandle == g_searchHandle and resultListSize != 0: - ret=g_poiSearch_interface.requestResultList(dbus.UInt32(poiSearchHandle),dbus.UInt16(0),dbus.UInt16(resultListSize),[ATTRIBUTE_SOURCE,ATTRIBUTE_PHONE]) - if ret[0] == GENIVI_SearchStatusState_FINISHED and ret[1] >= 0: - print("Results: "+str(int(ret[1]))) - for result in ret[2]: - poiList.append(result[0]) - ret=g_poiSearch_interface.getPoiDetails(poiList) - for resultDetail in ret: - if resultDetail[1][0] == ID_HOTEL: - print("Hotel: " +resultDetail[0][1]) - elif resultDetail[1][0] == ID_STATION: - print("Station: " +resultDetail[0][1]) - g_poiSearch_interface.cancelPoiSearch(dbus.UInt32(poiSearchHandle)) - -#timeout -def timeout(): - print ('Timeout Expired') - print ('\nTest FAILED') - loop.quit() - -if __name__ == '__main__': - dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - -print("Search for hotel and station with keyword: "+ STRING_TO_SEARCH) - -#connect to session bus -bus = dbus.SessionBus() - -bus.add_signal_receiver(catch_poi_configurationChanged_signal_handler, \ - dbus_interface = "org.genivi.navigation.poiservice.POIConfiguration.v4_0", \ - signal_name = "configurationChanged") - -bus.add_signal_receiver(catch_poi_poiStatus_signal_handler, \ - dbus_interface = "org.genivi.navigation.poiservice.POISearch.v4_0", \ - signal_name = "poiStatus") - -bus.add_signal_receiver(catch_poi_resultListChanged_signal_handler, \ - dbus_interface = "org.genivi.navigation.poiservice.POISearch.v4_0", \ - signal_name = "resultListChanged") - -poiConfiguration = bus.get_object('org.genivi.navigation.poiservice.POIConfiguration.v4_0_POIConfiguration','/POIConfiguration') -g_poiConfiguration_interface = dbus.Interface(poiConfiguration, dbus_interface='org.genivi.navigation.poiservice.POIConfiguration.v4_0') - -poiContentAccess = bus.get_object('org.genivi.navigation.poiservice.POIContentAccess.v4_0_POIContentAccess','/POIContentAccess') -g_poiContentAccess_interface = dbus.Interface(poiContentAccess, dbus_interface='org.genivi.navigation.poiservice.POIContentAccess.v4_0') - -poiSearch = bus.get_object('org.genivi.navigation.poiservice.POISearch.v4_0_POISearch','/POISearch') -g_poiSearch_interface = dbus.Interface(poiSearch, dbus_interface='org.genivi.navigation.poiservice.POISearch.v4_0') - -g_poiConfiguration_interface.setLocale(dbus.String("fra"),dbus.String("FRA"),dbus.String("Latn")) - -categories=[] -ret=g_poiSearch_interface.getAvailableCategories() -for categoryAndName in ret: - if categoryAndName[0] == ID_HOTEL or categoryAndName[0] == ID_STATION: - print("Category ID: " + str(int(categoryAndName[0]))) - categories.append(categoryAndName[0]) - print("Name: " + categoryAndName[1]) - -attributes_hotel=[] -attributes_station=[] -attributesDetails=[] -ret=g_poiSearch_interface.getCategoriesDetails(categories) -for results in ret: - if results[0][0] == ID_HOTEL: - for attribute in results[1]: - attributes_hotel.append(attribute[0]) - attributesDetails.append(dbus.Struct([dbus.UInt32(attribute[0]),dbus.UInt32(ID_HOTEL),dbus.Int32(1280),dbus.Struct([dbus.Byte(2),dbus.String("")]),dbus.Int32(1314),dbus.Boolean(False)])) - elif results[0][0] == ID_STATION: - for attribute in results[1]: - attributes_station.append(attribute[0]) - attributesDetails.append(dbus.Struct([dbus.UInt32(attribute[0]),dbus.UInt32(ID_STATION),dbus.Int32(1280),dbus.Struct([dbus.Byte(2),dbus.String("")]),dbus.Int32(1314),dbus.Boolean(False)])) - -ret=g_poiSearch_interface.getRootCategory() - -g_searchHandle=g_poiSearch_interface.createPoiSearchHandle() -print("Search handle: " + str(int(g_searchHandle))) - -lat = LATITUDE_PARIS -lon = LONGITUDE_PARIS -alt = ALTITUDE_PARIS - -g_poiSearch_interface.setCenter(g_searchHandle,dbus.Struct([lat,lon,alt])) - -g_poiSearch_interface.setCategories(g_searchHandle,[dbus.Struct([dbus.UInt32(ID_HOTEL),dbus.UInt32(RADIUS_HOTEL)]),dbus.Struct([dbus.UInt32(ID_STATION),dbus.UInt32(RADIUS_STATION)])]) - -g_poiSearch_interface.setAttributes(g_searchHandle,attributesDetails) - -g_poiSearch_interface.startPoiSearch(g_searchHandle,dbus.String(STRING_TO_SEARCH),dbus.Int32(1376)) - - -#main loop -gobject.timeout_add(TIME_OUT, timeout) -loop = gobject.MainLoop() -loop.run() diff --git a/test/poi-service/poi-manager-client/CMakeLists.txt b/test/poi-service/poi-manager-client/CMakeLists.txt index 4ca7451..c06f869 100644 --- a/test/poi-service/poi-manager-client/CMakeLists.txt +++ b/test/poi-service/poi-manager-client/CMakeLists.txt @@ -43,12 +43,12 @@ endif() # Packages find_package(PkgConfig REQUIRED) -find_package(CommonAPI 3.1.5 REQUIRED) -find_package(CommonAPI-DBus 3.1.5 REQUIRED) +find_package(CommonAPI) +find_package(CommonAPI-DBus) #pkg_check_modules(DBUS "dbus-1 >= 1.8.4") // #to be fixed, it doesn't work so the paths are set manually (see above) -pkg_check_modules(COMMONAPI "CommonAPI >= 3.1.5") -pkg_check_modules(COMMONAPI_DBUS "CommonAPI-DBus >= 3.1.5") +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) diff --git a/test/poi-service/poi-manager-client/README.md b/test/poi-service/poi-manager-client/README.md index 7380743..3990040 100644 --- a/test/poi-service/poi-manager-client/README.md +++ b/test/poi-service/poi-manager-client/README.md @@ -9,9 +9,18 @@ NB: The server part is located under ../../src/poi-manager-service Desktop: Tested under Ubuntu 16.04 LTS 64 bits ## Prerequisites -You need CommonAPI 3.1.5 and Franca 0.9.1 installed +You need CommonAPI 3.1.9 and Franca 0.9.1 installed For the Ubuntu 64 bits, due to the use of symbol versioning LIBDBUS_1_0 by CommonAPI-DBus, the patched version of DBus has to be >= 1.10.0 -NB: the patch common-api-dbus-runtime/src/dbus-patches/capi-dbus-add-support-for-custom-marshalling.patch failed a little bit, it's needed to update the dbus/dbus-string.h manually +NB: In case you migrate from 3.1.5 to 3.1.9, due to a cmake issue (wrong management of micro version), it's necessary to do: +``` +sudo mv /usr/local/lib/cmake/CommonAPI-3.1.5 /usr/local/lib/cmake/oldCommonAPI-3.1.5 +``` +Symbolic links are also not well managed, so you need to fix it: +``` +sudo ln -sfn /usr/local/lib/libCommonAPI.so.3.1.9 /usr/local/lib/libCommonAPI.so.3 +sudo ln -sfn /usr/local/lib/libCommonAPI-DBus.so.3.1.9 /usr/local/lib/libCommonAPI-DBus.so.3 +``` +NB: the patch common-api-dbus-runtime/src/dbus-patches/capi-dbus-add-support-for-custom-marshalling.patch may fail a little bit, in that case it's needed to update the dbus/dbus-string.h manually ## How to build First it's required to set some paths: diff --git a/test/poi-service/poi-manager-client/commonapi-dbus.ini b/test/poi-service/poi-manager-client/commonapi-dbus.ini deleted file mode 100644 index 087c481..0000000 --- a/test/poi-service/poi-manager-client/commonapi-dbus.ini +++ /dev/null @@ -1,9 +0,0 @@ -[local:org.genivi.navigation.poiservice.POIContentAccessModule:POIContentAccessModuleService] -service=org.genivi.navigation.poiservice -path=/org/genivi/navigation/poiservice/POIContentAccessModule -interface=org.genivi.navigation.poiservice.POIContentAccessModule -[local:org.genivi.navigation.poiservice.POIContentAccess:POIContentAccessService] -service=org.genivi.navigation.poiservice -path=/org/genivi/navigation/poiservice/POIContentAccess -interface=org.genivi.navigation.poiservice.POIContentAccess - diff --git a/test/poi-service/poi-manager-client/commonapi4dbus.ini b/test/poi-service/poi-manager-client/commonapi4dbus.ini deleted file mode 100644 index 1e5b30b..0000000 --- a/test/poi-service/poi-manager-client/commonapi4dbus.ini +++ /dev/null @@ -1,4 +0,0 @@ -[default] -binding=dbus - - diff --git a/test/poi-service/poi-manager-client/main.cpp b/test/poi-service/poi-manager-client/main.cpp index 2b54576..8f15d48 100644 --- a/test/poi-service/poi-manager-client/main.cpp +++ b/test/poi-service/poi-manager-client/main.cpp @@ -64,7 +64,7 @@ public: void getServerStatus(); - void ConfigurationChanged(const std::vector< uint16_t >& changedSettings); + void ConfigurationChanged(const std::vector<POIServiceTypes::Settings> &changedSettings); void CategoriesRemoved(const std::vector< CommonTypes::CategoryID >& categories); @@ -236,7 +236,7 @@ void contentManager::getServerStatus() } -void contentManager::ConfigurationChanged(const std::vector< uint16_t >& changedSettings) +void contentManager::ConfigurationChanged(const std::vector< POIServiceTypes::Settings >& changedSettings) { size_t index; @@ -487,12 +487,12 @@ void populateWindow(GtkWidget *window,contentManager *clientContentManager) GtkWidget *button; GtkWidget *box; - gtk_window_set_title (GTK_WINDOW (window), "Poi Manager Client"); + gtk_window_set_title(GTK_WINDOW (window), "Poi Manager Client"); g_signal_connect (window, "delete-event", G_CALLBACK (deleteWindow), NULL); - gtk_container_set_border_width (GTK_CONTAINER (window), 10); + gtk_container_set_border_width(GTK_CONTAINER (window), 10); box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); @@ -503,51 +503,51 @@ void populateWindow(GtkWidget *window,contentManager *clientContentManager) g_signal_connect (button, "clicked", G_CALLBACK (onCreateCategory), clientContentManager); - gtk_box_pack_start (GTK_BOX(box), button, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); - gtk_widget_show (button); + gtk_widget_show(button); - button = gtk_button_new_with_label ("Delete category"); + button = gtk_button_new_with_label("Delete category"); - g_signal_connect (button, "clicked", - G_CALLBACK (onDeleteCategory), clientContentManager); + g_signal_connect(button, "clicked", + G_CALLBACK(onDeleteCategory), clientContentManager); - gtk_box_pack_start(GTK_BOX (box), button, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); - gtk_widget_show (button); + gtk_widget_show(button); - gtk_widget_show (box); + gtk_widget_show(box); - button = gtk_button_new_with_label ("Create POI"); + button = gtk_button_new_with_label("Create POI"); - g_signal_connect (button, "clicked", - G_CALLBACK (onCreatePoi), clientContentManager); + g_signal_connect(button, "clicked", + G_CALLBACK(onCreatePoi), clientContentManager); - gtk_box_pack_start (GTK_BOX(box), button, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); - gtk_widget_show (button); + gtk_widget_show(button); - button = gtk_button_new_with_label ("Delete POI"); + button = gtk_button_new_with_label("Delete POI"); - g_signal_connect (button, "clicked", - G_CALLBACK (onDeletePoi), clientContentManager); + g_signal_connect(button, "clicked", + G_CALLBACK(onDeletePoi), clientContentManager); - gtk_box_pack_start(GTK_BOX (box), button, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); - gtk_widget_show (button); + gtk_widget_show(button); - button = gtk_button_new_with_label ("Search"); + button = gtk_button_new_with_label("Search"); - g_signal_connect (button, "clicked", - G_CALLBACK (onSearch), clientContentManager); + g_signal_connect(button, "clicked", + G_CALLBACK(onSearch), clientContentManager); - gtk_box_pack_start (GTK_BOX(box), button, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); - gtk_widget_show (button); + gtk_widget_show(button); - gtk_widget_show (box); + gtk_widget_show(box); - gtk_widget_show (window); + gtk_widget_show(window); } /** @@ -560,12 +560,12 @@ void populateWindow(GtkWidget *window,contentManager *clientContentManager) */ void print_usage (FILE* stream, int exit_code) { - fprintf (stream, "Use: %s options [database]\n",program_name); - fprintf (stream, + fprintf(stream, "Use: %s options [database]\n",program_name); + fprintf(stream, " -h --help Display this message.\n" " -f --file database Open the database.\n" " -t --test Test.\n"); - exit (exit_code); + exit(exit_code); } /** @@ -613,12 +613,12 @@ int main(int argc , char** argv ) program_name = argv[0]; do { - next_option = getopt_long (argc, argv, short_options, + next_option = getopt_long(argc, argv, short_options, long_options, NULL); - switch (next_option) + switch(next_option) { case 'h': /* -h --help */ - print_usage (stdout, 0); + print_usage(stdout, 0); break; case 't': /* -t --test */ @@ -626,10 +626,10 @@ int main(int argc , char** argv ) clientContentManager = new contentManager(myProxy); // Create the interface panel - gtk_init (&argc, &argv); + gtk_init(&argc, &argv); // Create a new window - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + window = gtk_window_new(GTK_WINDOW_TOPLEVEL); // Connect the client to the popup window (for feedback on signals) clientContentManager->connectPopupWindow(window); @@ -641,7 +641,7 @@ int main(int argc , char** argv ) myProxy->getCategoriesRemovedEvent().subscribe([&](const std::vector<CommonTypes::CategoryID>& categories) { clientContentManager->CategoriesRemoved(categories); }); - myProxy->getConfigurationChangedEvent().subscribe([&](const std::vector< uint16_t >& changedSettings) { + myProxy->getConfigurationChangedEvent().subscribe([&](const std::vector< POIServiceTypes::Settings >& changedSettings) { clientContentManager->ConfigurationChanged(changedSettings); }); myProxy->getPOIAddedEvent().subscribe([&](const std::vector< POIServiceTypes::POI_ID >& pois) { @@ -663,11 +663,13 @@ int main(int argc , char** argv ) // loop listening gtk_main(); + delete clientContentManager; + break; case 'f': /* -f --file database*/ database_filename = argv[2]; if (!is_readable(database_filename)) - print_usage (stderr, 1); + print_usage(stderr, 1); else { // Manage the database content @@ -675,15 +677,18 @@ int main(int argc , char** argv ) } break; case '?': /* Invalid option. */ - print_usage (stderr, 1); + print_usage(stderr, 1); break; case -1: /* End of options. */ break; default: /* Error */ - print_usage (stderr, 1); + print_usage(stderr, 1); } } while (next_option != -1); + myProxy.reset(); + runtime.reset(); + return EXIT_SUCCESS; } diff --git a/test/poi-service/test-poi-capi.py b/test/poi-service/test-poi-capi.py index 68e696f..2732468 100755 --- a/test/poi-service/test-poi-capi.py +++ b/test/poi-service/test-poi-capi.py @@ -30,12 +30,12 @@ import gobject import dbus.mainloop.glib import time -import pdb; +#import pdb; #pdb.set_trace() #constants as defined in the Navigation API GENIVI_Configuration_Settings_LOCALE = 37 -GENIVI_SearchStatusState_FINISHED = 1298 -GENIVI_SearchStatusState_NOT_STARTED = 1296 +GENIVI_SearchStatusState_FINISHED = 512 +GENIVI_SearchStatusState_NOT_STARTED = 510 #constants used into the script TIME_OUT = 10000 @@ -98,25 +98,25 @@ print("Search for hotel and station with keyword: "+ STRING_TO_SEARCH) bus = dbus.SessionBus() bus.add_signal_receiver(catch_poi_configurationChanged_signal_handler, \ - dbus_interface = "org.genivi.navigation.poiservice.POIConfiguration", \ + dbus_interface = "org.genivi.navigation.poiservice.POIConfiguration.v4_0", \ signal_name = "configurationChanged") bus.add_signal_receiver(catch_poi_poiStatus_signal_handler, \ - dbus_interface = "org.genivi.navigation.poiservice.POISearch", \ + dbus_interface = "org.genivi.navigation.poiservice.POISearch.v4_0", \ signal_name = "poiStatus") bus.add_signal_receiver(catch_poi_resultListChanged_signal_handler, \ - dbus_interface = "org.genivi.navigation.poiservice.POISearch", \ + dbus_interface = "org.genivi.navigation.poiservice.POISearch.v4_0", \ signal_name = "resultListChanged") -poiConfiguration = bus.get_object('org.genivi.navigation.poiservice.POIConfiguration_POIConfiguration','/POIConfiguration') -g_poiConfiguration_interface = dbus.Interface(poiConfiguration, dbus_interface='org.genivi.navigation.poiservice.POIConfiguration') +poiConfiguration = bus.get_object('org.genivi.navigation.poiservice.POIConfiguration.v4_0_POIConfiguration','/POIConfiguration') +g_poiConfiguration_interface = dbus.Interface(poiConfiguration, dbus_interface='org.genivi.navigation.poiservice.POIConfiguration.v4_0') -poiContentAccess = bus.get_object('org.genivi.navigation.poiservice.POIContentAccess_POIContentAccess','/POIContentAccess') -g_poiContentAccess_interface = dbus.Interface(poiContentAccess, dbus_interface='org.genivi.navigation.poiservice.POIContentAccess') +poiContentAccess = bus.get_object('org.genivi.navigation.poiservice.POIContentAccess.v4_0_POIContentAccess','/POIContentAccess') +g_poiContentAccess_interface = dbus.Interface(poiContentAccess, dbus_interface='org.genivi.navigation.poiservice.POIContentAccess.v4_0') -poiSearch = bus.get_object('org.genivi.navigation.poiservice.POISearch_POISearch','/POISearch') -g_poiSearch_interface = dbus.Interface(poiSearch, dbus_interface='org.genivi.navigation.poiservice.POISearch') +poiSearch = bus.get_object('org.genivi.navigation.poiservice.POISearch.v4_0_POISearch','/POISearch') +g_poiSearch_interface = dbus.Interface(poiSearch, dbus_interface='org.genivi.navigation.poiservice.POISearch.v4_0') g_poiConfiguration_interface.setLocale(dbus.String("fra"),dbus.String("FRA"),dbus.String("Latn")) @@ -136,11 +136,11 @@ for results in ret: if results[0][0] == ID_HOTEL: for attribute in results[1]: attributes_hotel.append(attribute[0]) - attributesDetails.append(dbus.Struct([dbus.UInt32(attribute[0]),dbus.UInt32(ID_HOTEL),dbus.Int32(1280),dbus.Struct([dbus.Byte(2),dbus.String("")]),dbus.Int32(1314),dbus.Boolean(False)])) + attributesDetails.append(dbus.Struct([dbus.UInt32(attribute[0]),dbus.UInt32(ID_HOTEL),dbus.Int32(500),dbus.Struct([dbus.Byte(2),dbus.String("")]),dbus.Int32(522),dbus.Boolean(False)])) elif results[0][0] == ID_STATION: for attribute in results[1]: attributes_station.append(attribute[0]) - attributesDetails.append(dbus.Struct([dbus.UInt32(attribute[0]),dbus.UInt32(ID_STATION),dbus.Int32(1280),dbus.Struct([dbus.Byte(2),dbus.String("")]),dbus.Int32(1314),dbus.Boolean(False)])) + attributesDetails.append(dbus.Struct([dbus.UInt32(attribute[0]),dbus.UInt32(ID_STATION),dbus.Int32(500),dbus.Struct([dbus.Byte(2),dbus.String("")]),dbus.Int32(522),dbus.Boolean(False)])) ret=g_poiSearch_interface.getRootCategory() @@ -157,7 +157,7 @@ g_poiSearch_interface.setCategories(g_searchHandle,[dbus.Struct([dbus.UInt32(ID_ g_poiSearch_interface.setAttributes(g_searchHandle,attributesDetails) -g_poiSearch_interface.startPoiSearch(g_searchHandle,dbus.String(STRING_TO_SEARCH),dbus.Int32(1376)) +g_poiSearch_interface.startPoiSearch(g_searchHandle,dbus.String(STRING_TO_SEARCH),dbus.Int32(560)) #main loop |