diff options
author | <philippe colliot> | 2015-08-04 11:57:45 +0200 |
---|---|---|
committer | <philippe colliot> | 2015-08-04 11:57:45 +0200 |
commit | 86c047d1c415e506069e222f621e8c13735f9c20 (patch) | |
tree | 3e5e61c96f42e71b387bf97bee3e29b3a45b0282 /src/poi-service | |
parent | 7408b8e55d16d8fd81acaa4ce08420c34385ee15 (diff) | |
download | poi-service-86c047d1c415e506069e222f621e8c13735f9c20.tar.gz |
[POISERVICE] POI manager based on CommonAPI has been successfully tested
Diffstat (limited to 'src/poi-service')
-rw-r--r-- | src/poi-service/poi-common/poi-common-data-model.h | 2 | ||||
-rw-r--r-- | src/poi-service/poi-manager-server/poi-manager-server-stub.cpp | 16 | ||||
-rw-r--r-- | src/poi-service/resource/poi-database-managed.db | bin | 36864 -> 36864 bytes |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/poi-service/poi-common/poi-common-data-model.h b/src/poi-service/poi-common/poi-common-data-model.h index de68ffd..e3db5e4 100644 --- a/src/poi-service/poi-common/poi-common-data-model.h +++ b/src/poi-service/poi-common/poi-common-data-model.h @@ -123,7 +123,7 @@ typedef struct #define SEARCH_CENTER_LOCATION_LATITUDE 48.76 #define SEARCH_CENTER_LOCATION_LONGITUDE 2.22 #define SEARCH_CENTER_LOCATION_ALTITUDE 100 -#define SEARCH_RADIUS 200 //in tens of meters +#define SEARCH_RADIUS 300 //in tens of meters #define SEARCH_STRING "Sweet" #define LANGUAGE_CODE "fra" 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 b32d4b3..b8a04d7 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 @@ -1189,6 +1189,7 @@ sqlRequest::SQL_REQUEST_ERRORS sqlRequest::searchPoi(const string &categoryName, sqlQuery += search_string; sqlQuery += "%');"; query_result = mp_database->query(sqlQuery.c_str()); + // read the result of the query if (query_result.size() == 0) //get the amount of poi searched { @@ -1404,6 +1405,8 @@ void PoiManagerServerStub::poiSearchStarted(const std::shared_ptr<CommonAPI::Cli NavigationTypes::Coordinate3D leftBottomLocation, rightTopLocation; std::vector<POIServiceTypes::POI_ID> poiIDList; + poiIDList.clear(); // by default no hints + //For the moment, just search for one category categoryAndRadius = _poiCategories.at(0); @@ -1419,7 +1422,7 @@ void PoiManagerServerStub::poiSearchStarted(const std::shared_ptr<CommonAPI::Cli if (index>=m_availableCategoryTable.size()) { //no id found, error to be sent - fireSearchStatusChangedEvent(_poiSearchHandle,POIServiceTypes::SearchStatusState::INVALID); + fireSearchStatusChangedEvent(_poiSearchHandle,POIServiceTypes::SearchStatusState::INVALID,poiIDList); return; } @@ -1434,18 +1437,21 @@ void PoiManagerServerStub::poiSearchStarted(const std::shared_ptr<CommonAPI::Cli m_search_handle = _poiSearchHandle; //for the moment, only one handle is managed - fireSearchStatusChangedEvent(_poiSearchHandle,POIServiceTypes::SearchStatusState::SEARCHING); - mp_sqlRequest->searchPoi(categoryName,_inputString, leftBottomLocation, rightTopLocation, poiIDList); - fireSearchStatusChangedEvent(_poiSearchHandle,POIServiceTypes::SearchStatusState::FINISHED); + fireSearchStatusChangedEvent(_poiSearchHandle,POIServiceTypes::SearchStatusState::FINISHED,poiIDList); } void PoiManagerServerStub::poiSearchCanceled(const std::shared_ptr<CommonAPI::ClientId> _client, ::org::genivi::navigation::NavigationTypes::Handle _poiSearchHandle, poiSearchCanceledReply_t _reply) { + std::vector<POIServiceTypes::POI_ID> poiIDList; + m_search_handle = NO_HANDLE; - fireSearchStatusChangedEvent(_poiSearchHandle,POIServiceTypes::SearchStatusState::NOT_STARTED); + + poiIDList.clear(); + + fireSearchStatusChangedEvent(_poiSearchHandle,POIServiceTypes::SearchStatusState::NOT_STARTED,poiIDList); } void PoiManagerServerStub::resultListRequested(const std::shared_ptr<CommonAPI::ClientId> _client, uint8_t _camId, ::org::genivi::navigation::NavigationTypes::Handle _poiSearchHandle, std::vector< ::v0_1::org::genivi::navigation::poiservice::POIServiceTypes::AttributeID> _attributes, resultListRequestedReply_t _reply) diff --git a/src/poi-service/resource/poi-database-managed.db b/src/poi-service/resource/poi-database-managed.db Binary files differindex ce25fc2..0e7b022 100644 --- a/src/poi-service/resource/poi-database-managed.db +++ b/src/poi-service/resource/poi-database-managed.db |