diff options
author | asanoaozora <fifitaneki@hotmail.com> | 2016-09-13 10:59:41 +0200 |
---|---|---|
committer | asanoaozora <fifitaneki@hotmail.com> | 2016-09-13 10:59:41 +0200 |
commit | b0b9dcd407b493079ba97db14505cf49a688ec3d (patch) | |
tree | ef0a291e390a6e96b460565866f54f50592ecb21 | |
parent | 5f95f1e69c313e492ab91b1bd643f637657d50fd (diff) | |
download | poi-service-b0b9dcd407b493079ba97db14505cf49a688ec3d.tar.gz |
add error management into Franca files, change code and scripts, test OK
28 files changed, 306 insertions, 196 deletions
diff --git a/api/franca/CMakeLists.txt b/api/franca/CMakeLists.txt index ee3c795..51fbac0 100644 --- a/api/franca/CMakeLists.txt +++ b/api/franca/CMakeLists.txt @@ -32,7 +32,7 @@ option(COMMONAPI_DBUS_TOOL_DIR get_directory_property(hasParent PARENT_DIRECTORY) if(hasParent) - set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen" PARENT_SCOPE) + set(COMMONAPI_GEN_DIR "${COMMONAPI_GEN_DIR}" PARENT_SCOPE) else() set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen") endif() diff --git a/api/franca/hmi/CMakeLists.txt b/api/franca/hmi/CMakeLists.txt index 5da841e..b3c4af8 100644 --- a/api/franca/hmi/CMakeLists.txt +++ b/api/franca/hmi/CMakeLists.txt @@ -24,4 +24,12 @@ cmake_minimum_required (VERSION 2.8.1) project(franca-hmi) +get_directory_property(hasParent PARENT_DIRECTORY) + +if(hasParent) + set(COMMONAPI_GEN_DIR "${COMMONAPI_GEN_DIR}" PARENT_SCOPE) +else() + set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen") +endif() + add_subdirectory(speechservice) diff --git a/api/franca/hmi/speechservice/CMakeLists.txt b/api/franca/hmi/speechservice/CMakeLists.txt index fb2dfd5..39dac66 100644 --- a/api/franca/hmi/speechservice/CMakeLists.txt +++ b/api/franca/hmi/speechservice/CMakeLists.txt @@ -24,6 +24,14 @@ cmake_minimum_required (VERSION 2.8.1) project(franca-speechoutput) +get_directory_property(hasParent PARENT_DIRECTORY) + +if(hasParent) + set(COMMONAPI_GEN_DIR "${COMMONAPI_GEN_DIR}" PARENT_SCOPE) +else() + set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen") +endif() + option(COMMONAPI_TOOL_DIR "Absolute path to CommonAPI tool" "") option(COMMONAPI_DBUS_TOOL_DIR diff --git a/api/franca/navigation/CMakeLists.txt b/api/franca/navigation/CMakeLists.txt index 44b854e..e910489 100644 --- a/api/franca/navigation/CMakeLists.txt +++ b/api/franca/navigation/CMakeLists.txt @@ -24,6 +24,14 @@ cmake_minimum_required (VERSION 2.8.1) project(franca-navigation) +get_directory_property(hasParent PARENT_DIRECTORY) + +if(hasParent) + set(COMMONAPI_GEN_DIR "${COMMONAPI_GEN_DIR}" PARENT_SCOPE) +else() + set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen") +endif() + add_subdirectory(freetextsearchservice) add_subdirectory(mapviewer) add_subdirectory(navigationcore) diff --git a/api/franca/navigation/freetextsearchservice/CMakeLists.txt b/api/franca/navigation/freetextsearchservice/CMakeLists.txt index ec1cb82..fdfd97f 100644 --- a/api/franca/navigation/freetextsearchservice/CMakeLists.txt +++ b/api/franca/navigation/freetextsearchservice/CMakeLists.txt @@ -24,6 +24,14 @@ cmake_minimum_required (VERSION 2.8.1) project(franca-freetextsearch) +get_directory_property(hasParent PARENT_DIRECTORY) + +if(hasParent) + set(COMMONAPI_GEN_DIR "${COMMONAPI_GEN_DIR}" PARENT_SCOPE) +else() + set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen") +endif() + option(COMMONAPI_TOOL_DIR "Absolute path to CommonAPI tool" "") option(COMMONAPI_DBUS_TOOL_DIR diff --git a/api/franca/navigation/mapviewer/CMakeLists.txt b/api/franca/navigation/mapviewer/CMakeLists.txt index 7e8049d..c861873 100644 --- a/api/franca/navigation/mapviewer/CMakeLists.txt +++ b/api/franca/navigation/mapviewer/CMakeLists.txt @@ -24,6 +24,14 @@ cmake_minimum_required (VERSION 2.8.1) project(franca-mapviewer) +get_directory_property(hasParent PARENT_DIRECTORY) + +if(hasParent) + set(COMMONAPI_GEN_DIR "${COMMONAPI_GEN_DIR}" PARENT_SCOPE) +else() + set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen") +endif() + option(COMMONAPI_TOOL_DIR "Absolute path to CommonAPI tool" "") option(COMMONAPI_DBUS_TOOL_DIR diff --git a/api/franca/navigation/mapviewer/MapViewerControl.fidl b/api/franca/navigation/mapviewer/MapViewerControl.fidl index 2749ccb..a7df0c3 100755 --- a/api/franca/navigation/mapviewer/MapViewerControl.fidl +++ b/api/franca/navigation/mapviewer/MapViewerControl.fidl @@ -295,7 +295,6 @@ interface MapViewerControl { <** @description : createMapViewInstance = This method creates a new map instance - notify(MAPVIEWERCONTROL_ERROR_NOMOREMAPVIEWINSTANCEHANDLES) is emitted if no more map view instance handles are available **> method createMapViewInstance { in { @@ -319,11 +318,14 @@ interface MapViewerControl { **> Handle mapViewInstanceHandle } + error { + OK + MAPVIEWERCONTROL_ERROR_NOMOREMAPVIEWINSTANCEHANDLES //no more map view instance handles are available + } } <** @description : releaseMapViewInstance = This method releases (i.e. destroys) a given map instance. Only invisible map instances can be released - notify(MAPVIEWERCONTROL_ERROR_MAPVIEWINSTANCENOTAVAILABLE) is emitted if an application tries to delete a map view instance handle that is not available **> method releaseMapViewInstance { in { @@ -338,6 +340,10 @@ interface MapViewerControl { **> Handle mapViewInstanceHandle } + error { + OK + MAPVIEWERCONTROL_ERROR_MAPVIEWINSTANCENOTAVAILABLE //an application tries to delete a map view instance handle that is not available + } } <** @@ -1958,14 +1964,4 @@ interface MapViewerControl { SelectedMapElement [] selectedElements } } - - <** - @description : notify = This signal is emitted when something wrong occured when invoking the API - **> - broadcast notify { - out { - Notification notification - } - } - }
\ No newline at end of file diff --git a/api/franca/navigation/mapviewer/Session.fidl b/api/franca/navigation/mapviewer/Session.fidl index 9fbe92e..7f38ecb 100644 --- a/api/franca/navigation/mapviewer/Session.fidl +++ b/api/franca/navigation/mapviewer/Session.fidl @@ -27,7 +27,6 @@ interface Session { } <** @description : createSession = This method creates a new session and retrieves a handle . - notify(SESSION_ERROR_NOMORESESSIONHANDLES) is emitted if no more session handles are available **> method createSession { in { @@ -43,16 +42,23 @@ interface Session { <** @description : sessionHandle **> Handle sessionHandle } + error { + OK + SESSION_ERROR_NOMORESESSIONHANDLES //no more session handles are available + } } <** @description : deleteSession = This method deletes a session and its associated resources . - notify(SESSION_ERROR_SESSIONNOTAVAILABLE) is emitted if an application tries to delete a session handle that is not available **> method deleteSession { in { <** @description : sessionHandle **> Handle sessionHandle } + error { + OK + SESSION_ERROR_SESSIONNOTAVAILABLE //an application tries to delete a session handle that is not available + } } <** @description : This method returns whether a given session handle is available or not (for example because it was deleted) .**> @@ -83,14 +89,4 @@ interface Session { Handle sessionHandle } } - - <** - @description : notify = This signal is emitted when something wrong occured when invoking the API - **> - broadcast notify { - out { - Notification notification - } - } - } diff --git a/api/franca/navigation/navigationcore/CMakeLists.txt b/api/franca/navigation/navigationcore/CMakeLists.txt index 91cc5cc..8a3a11b 100644 --- a/api/franca/navigation/navigationcore/CMakeLists.txt +++ b/api/franca/navigation/navigationcore/CMakeLists.txt @@ -24,6 +24,14 @@ cmake_minimum_required (VERSION 2.8.1) project(franca-navigationcore) +get_directory_property(hasParent PARENT_DIRECTORY) + +if(hasParent) + set(COMMONAPI_GEN_DIR "${COMMONAPI_GEN_DIR}" PARENT_SCOPE) +else() + set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen") +endif() + option(COMMONAPI_TOOL_DIR "Absolute path to CommonAPI tool" "") option(COMMONAPI_DBUS_TOOL_DIR diff --git a/api/franca/navigation/navigationcore/Guidance.fidl b/api/franca/navigation/navigationcore/Guidance.fidl index e4c4f18..4e760e2 100644 --- a/api/franca/navigation/navigationcore/Guidance.fidl +++ b/api/franca/navigation/navigationcore/Guidance.fidl @@ -267,9 +267,12 @@ interface Guidance { <**
@description : playVoiceManeuver = This method plays or repeats the last voice guidance
- notify(GUIDANCE_ERROR_VOICENOTALLOWED) is emitted if the voice generation is inactive
**>
method playVoiceManeuver {
+ error {
+ OK
+ GUIDANCE_ERROR_VOICENOTALLOWED //the voice generation is inactive
+ }
}
<**
@@ -333,7 +336,6 @@ interface Guidance { <**
@description : getManeuversList = This method retrieves the list of next maneuvers
- notify(GUIDANCE_ERROR_NOMANEUVER) is emitted in case there's no maneuver until the destination
**>
method getManeuversList {
in {
@@ -357,6 +359,10 @@ interface Guidance { Maneuver[] maneuversList
}
+ error {
+ OK
+ GUIDANCE_ERROR_NOMANEUVER //there's no maneuver until the destination
+ }
}
<**
@@ -379,7 +385,6 @@ interface Guidance { <**
@description : skipNextManeuver = This method allows to jump behind the current maneuver
- notify(GUIDANCE_ERROR_NOMANEUVER) is emitted in case there's no maneuver until the destination
**>
method skipNextManeuver {
in {
@@ -389,6 +394,10 @@ interface Guidance { **>
Handle sessionHandle
}
+ error {
+ OK
+ GUIDANCE_ERROR_NOMANEUVER //there's no maneuver until the destination
+ }
}
<**
@@ -411,7 +420,6 @@ interface Guidance { <**
@description : setVoiceGuidanceSettings = This method sets the voice guidance settings
- notify(GUIDANCE_ERROR_VOICENOTALLOWED) is emitted if the voice generation is inactive
**>
method setVoiceGuidanceSettings {
in {
@@ -421,6 +429,10 @@ interface Guidance { **>
PromptMode promptMode
}
+ error {
+ OK
+ GUIDANCE_ERROR_VOICENOTALLOWED //the voice generation is inactive
+ }
}
<**
@@ -535,13 +547,4 @@ interface Guidance { RouteChangedCause changeCause
}
}
-
- <**
- @description : notify = This signal is emitted when something wrong occured when invoking the API
- **>
- broadcast notify {
- out {
- Notification notification
- }
- }
}
\ No newline at end of file diff --git a/api/franca/navigation/navigationcore/LocationInput.fidl b/api/franca/navigation/navigationcore/LocationInput.fidl index 14f714d..1b57845 100644 --- a/api/franca/navigation/navigationcore/LocationInput.fidl +++ b/api/franca/navigation/navigationcore/LocationInput.fidl @@ -80,7 +80,6 @@ interface LocationInput { <**
@description : createLocationInput = This method creates a new location input and retrieves a handle
- notify(LOCATIONINPUT_ERROR_NOMORELOCATIONINPUTHANDLES) is emitted if no more location input handles are available
**>
method createLocationInput {
in {
@@ -97,11 +96,14 @@ interface LocationInput { **>
LocationHandle locationInputHandle
}
+ error {
+ OK
+ LOCATIONINPUT_ERROR_NOMORELOCATIONINPUTHANDLES //no more location input handles are available
+ }
}
<**
@description : deleteLocationInput = This method deletes a location input and its associated resources
- notify(LOCATIONINPUT_ERROR_LOCATIONINPUTNOTAVAILABLE) is emitted if an application tries to delete a location input handle that is not available
**>
method deleteLocationInput {
in {
@@ -116,6 +118,10 @@ interface LocationInput { **>
LocationHandle locationInputHandle
}
+ error {
+ OK
+ LOCATIONINPUT_ERROR_LOCATIONINPUTNOTAVAILABLE //an application tries to delete a location input handle that is not available
+ }
}
<**
@@ -488,13 +494,4 @@ interface LocationInput { ValidationStatus [] validationStatusList
}
}
-
- <**
- @description : notify = This signal is emitted when something wrong occured when invoking the API
- **>
- broadcast notify {
- out {
- Notification notification
- }
- }
}
\ No newline at end of file diff --git a/api/franca/navigation/navigationcore/MapMatchedPosition.fidl b/api/franca/navigation/navigationcore/MapMatchedPosition.fidl index cd56c8d..82f52f9 100644 --- a/api/franca/navigation/navigationcore/MapMatchedPosition.fidl +++ b/api/franca/navigation/navigationcore/MapMatchedPosition.fidl @@ -250,7 +250,6 @@ interface MapMatchedPosition { <**
@description : getPosition = This method returns the current position
- notify(MAPMATCHEDPOSITION_ERROR_NOPOSITION) is emitted if no position is available
**>
method getPosition {
in {
@@ -259,6 +258,10 @@ interface MapMatchedPosition { out {
PositionItemDict position
}
+ error {
+ OK
+ MAPMATCHEDPOSITION_ERROR_NOPOSITION //no position is available
+ }
}
<**
@@ -278,8 +281,6 @@ interface MapMatchedPosition { <**
@description : getCurrentAddress = This method returns the current address
- notify(MAPMATCHEDPOSITION_ERROR_NOMAP) is emitted if no map is available
- notify(MAPMATCHEDPOSITION_ERROR_OUTOFKNOWNMAP) is emitted if the vehicle is located in a position outside of the known map
**>
method getCurrentAddress {
in {
@@ -288,6 +289,11 @@ interface MapMatchedPosition { out {
AddressItemDict address
}
+ error {
+ OK
+ MAPMATCHEDPOSITION_ERROR_NOMAP //no map is available
+ MAPMATCHEDPOSITION_ERROR_OUTOFKNOWNMAP //the vehicle is located in a position outside of the known map
+ }
}
<**
@@ -393,13 +399,4 @@ interface MapMatchedPosition { Int32 direction
}
}
-
- <**
- @description : notify = This signal is emitted when something wrong occured when invoking the API
- **>
- broadcast notify {
- out {
- Notification notification
- }
- }
}
\ No newline at end of file diff --git a/api/franca/navigation/navigationcore/Routing.fidl b/api/franca/navigation/navigationcore/Routing.fidl index 03a741c..ddca1ff 100644 --- a/api/franca/navigation/navigationcore/Routing.fidl +++ b/api/franca/navigation/navigationcore/Routing.fidl @@ -150,25 +150,25 @@ interface Routing { }
enumeration RouteSegmentType extends BasicEnum {
- LINK_ID = 320 //Base 0x0140
- START_LATITUDE = 321
- END_LATITUDE = 322
- START_LONGITUDE = 323
- END_LONGITUDE = 324
- START_ALTITUDE = 325
- END_ALTITUDE = 326
- ROAD_NAME = 327
- DISTANCE = 328
- TIME = 329
- MANEUVER = 330
- INSTRUCTION = 331
- BORDER_CROSSING = 332
- ADDITIONAL_INFORMATION = 333
- ROAD_NUMBER = 334
- START_OFFSET = 335
- INTERMEDIATE_POINTS = 288
- HIGHWAY_EXIT = 116
- SPEED = 164
+ LINK_ID = 320 //value of type UInt8[], that represents a link-ID in a format whose interpretation is left to the navigationcore
+ START_LATITUDE = 321 //value of type Double, that expresses the latitude of the starting point in format %3.6f. Range [-90:+90]. Example: 48.053250
+ END_LATITUDE = 322 //value idem of START_LATITUDE, it can be omitted, if it coincides with the latitude of the start point of the next segment
+ START_LONGITUDE = 323 //value of type Double, that expresses the longitude of the starting point in format %3.6f. Range [-180:+180]. Example: 8.321000
+ END_LONGITUDE = 324 //
+ START_ALTITUDE = 325 //
+ END_ALTITUDE = 326 //
+ ROAD_NAME = 327 //
+ DISTANCE = 328 //
+ TIME = 329 //
+ MANEUVER = 330 //
+ INSTRUCTION = 331 //
+ BORDER_CROSSING = 332 //
+ ADDITIONAL_INFORMATION = 333 //
+ ROAD_NUMBER = 334 //
+ START_OFFSET = 335 //
+ INTERMEDIATE_POINTS = 288 //
+ HIGHWAY_EXIT = 116 //
+ SPEED = 164 //
}
//TODO: Incomplete
@@ -180,6 +180,7 @@ interface Routing { Int32 int32Value
Int16 int16Value
UInt32 uInt32Value
+ UInt16 uInt16Value
}
map RouteSegment {
@@ -205,7 +206,6 @@ interface Routing { <**
@description : This method creates a route
- notify(ROUTING_ERROR_NOMOREROUTEHANDLES) is emitted if no more routing handles are available
**>
method createRoute {
in {
@@ -222,12 +222,14 @@ interface Routing { **>
Handle routeHandle
}
+ error {
+ OK
+ ROUTING_ERROR_NOMOREROUTEHANDLES //no more routing handles are available
+ }
}
<**
@description : This method deletes a route and its associated resources
- notify(ROUTING_ERROR_ROUTENOTAVAILABLE) is emitted if an application tries to delete a route handle that is not available
- notify(ROUTING_ERROR_OPERATIONNOTALLOWED) is emitted if an application tries to delete a route which is not created manually (e.g. an alternative route calculated in the background)
**>
method deleteRoute {
in {
@@ -242,11 +244,15 @@ interface Routing { **>
Handle routeHandle
}
+ error {
+ OK
+ ROUTING_ERROR_ROUTENOTAVAILABLE //an application tries to delete a route handle that is not available
+ ROUTING_ERROR_OPERATIONNOTALLOWED //an application tries to delete a route which is not created manually (e.g. an alternative route calculated in the background)
+ }
}
<**
@description : This method sets the cost model
- notify(ROUTING_ERROR_OPERATIONNOTALLOWED) is emitted if an application tries to set a cost model for a route which is not created manually (e.g. an alternative route calculated in the background)
**>
method setCostModel {
in {
@@ -266,6 +272,10 @@ interface Routing { **>
CostModel costModel
}
+ error {
+ OK
+ ROUTING_ERROR_OPERATIONNOTALLOWED // is emitted if an application tries to set a cost model for a route which is not created manually (e.g. an alternative route calculated in the background)
+ }
}
<**
@@ -299,8 +309,6 @@ interface Routing { <**
@description : This method sets a list of route preferences
- notify(ROUTING_ERROR_OPERATIONNOTALLOWED) is emitted if an application tries to set route preferences for a route which is not created manually (e.g. an alternative route calculated in the background)
- notify(ROUTING_ERROR_ROUTEPREFERENCENOTSUPPORTED) is emitted if an application tries to set a route preference which is not supported (e.g. (USE,CRIME_AREA)). The preferences which are not supported are product dependent.
**>
method setRoutePreferences {
in {
@@ -324,6 +332,12 @@ interface Routing { ConditionPreference[] conditionPreferenceList
}
+ error {
+ OK
+ ROUTING_ERROR_OPERATIONNOTALLOWED //an application tries to set route preferences for a route which is not created manually (e.g. an alternative route calculated in the background)
+ ROUTING_ERROR_ROUTEPREFERENCENOTSUPPORTED //an application tries to set a route preference which is not supported (e.g. (USE,CRIME_AREA)). The preferences which are not supported are product dependent.
+
+ }
}
<**
@@ -399,7 +413,6 @@ interface Routing { <**
@description : This method sets a list of means of transportation that must be considered when calculating a route
- notify(ROUTING_ERROR_OPERATIONNOTALLOWED) is emitted if an application tries to set transportation means for a route which is not created manually (e.g. an alternative route calculated in the background)
**>
method setTransportationMeans {
in {
@@ -416,6 +429,10 @@ interface Routing { TransportationMeans[] transportationMeansList
}
+ error {
+ OK
+ ROUTING_ERROR_OPERATIONNOTALLOWED //an application tries to set transportation means for a route which is not created manually (e.g. an alternative route calculated in the background)
+ }
}
<**
@@ -445,7 +462,6 @@ interface Routing { <**
@description : setExcludedAreas = This method sets the areas to be excluded when calculating a route
- notify(ROUTING_ERROR_OPERATIONNOTALLOWED) is emitted if an application tries to set excluded areas for a route which is not created manually (e.g. an alternative route calculated in the background)
**>
method setExcludedAreas {
in {
@@ -462,6 +478,10 @@ interface Routing { Polygon[] excludedAreas
}
+ error {
+ OK
+ ROUTING_ERROR_OPERATIONNOTALLOWED //an application tries to set excluded areas for a route which is not created manually (e.g. an alternative route calculated in the background)
+ }
}
<**
@@ -482,9 +502,6 @@ interface Routing { <**
@description : setWaypoints = This method sets a list of waypoints
- notify(ROUTING_ERROR_WAYPOINTCANNOTBECHANGED) is emitted when a client application tries to change the waypoints while the route guidance is active
- notify(ROUTING_ERROR_TOOMANYWAYPOINTS) is emitted when a client application tries to set a number of waypoints that exceeds the system capabilities
- notify(ROUTING_ERROR_OPERATIONNOTALLOWED) is emitted if an application tries to set waypoints for a route which is not created manually (e.g. an alternative route calculated in the background)
**>
method setWaypoints {
in {
@@ -506,6 +523,12 @@ interface Routing { WayPoint[] waypointsList
}
+ error {
+ OK
+ ROUTING_ERROR_WAYPOINTCANNOTBECHANGED //a client application tries to change the waypoints while the route guidance is active
+ ROUTING_ERROR_TOOMANYWAYPOINTS //a client application tries to set a number of waypoints that exceeds the system capabilities
+ ROUTING_ERROR_OPERATIONNOTALLOWED //an application tries to set waypoints for a route which is not created manually (e.g. an alternative route calculated in the background)
+ }
}
<**
@@ -532,7 +555,6 @@ interface Routing { <**
@description : calculateRoute = This method starts a route calculation
- notify(ROUTING_ERROR_OPERATIONNOTALLOWED) is emitted if an application tries to calculate a route which is not created manually (e.g. an alternative route calculated in the background)
**>
method calculateRoute {
in {
@@ -547,6 +569,10 @@ interface Routing { **>
Handle routeHandle
}
+ error {
+ OK
+ ROUTING_ERROR_OPERATIONNOTALLOWED //an application tries to calculate a route which is not created manually (e.g. an alternative route calculated in the background)
+ }
}
<**
@@ -569,7 +595,6 @@ interface Routing { <**
@description : calculateRoutes = This method allows a client to calculate alternative routes that differs from a list of already calculated routes
- notify(ROUTING_ERROR_OPERATIONNOTALLOWED) is emitted if an application tries to calculate an alternative to a route which is not created manually (e.g. an alternative route calculated in the background)
**>
method calculateRoutes {
in {
@@ -583,6 +608,10 @@ interface Routing { out {
Handle[] alternativeRoutesList
}
+ error {
+ OK
+ ROUTING_ERROR_OPERATIONNOTALLOWED //an application tries to calculate an alternative to a route which is not created manually (e.g. an alternative route calculated in the background)
+ }
}
<**
@@ -795,14 +824,4 @@ interface Routing { Handle[] routeHandlesList
}
}
-
- <**
- @description : notify = This signal is emitted when something wrong occured when invoking the API
- **>
- broadcast notify {
- out {
- Notification notification
- }
- }
-
}
\ No newline at end of file diff --git a/api/franca/navigation/navigationcore/Session.fidl b/api/franca/navigation/navigationcore/Session.fidl index 9da1b40..0898a12 100644 --- a/api/franca/navigation/navigationcore/Session.fidl +++ b/api/franca/navigation/navigationcore/Session.fidl @@ -27,7 +27,6 @@ interface Session { } <** @description : createSession = This method creates a new session and retrieves a handle . - notify(SESSION_ERROR_NOMORESESSIONHANDLES) is emitted if no more session handles are available **> method createSession { in { @@ -43,16 +42,23 @@ interface Session { <** @description : sessionHandle **> Handle sessionHandle } + error { + OK + SESSION_ERROR_NOMORESESSIONHANDLES //no more session handles are available + } } <** @description : deleteSession = This method deletes a session and its associated resources . - notify(SESSION_ERROR_SESSIONNOTAVAILABLE) is emitted if an application tries to delete a session handle that is not available **> method deleteSession { in { <** @description : sessionHandle **> Handle sessionHandle } + error { + OK + SESSION_ERROR_SESSIONNOTAVAILABLE //an application tries to delete a session handle that is not available + } } <** @description : This method returns whether a given session handle is available or not (for example because it was deleted) .**> @@ -83,14 +89,4 @@ interface Session { Handle sessionHandle } } - - <** - @description : notify = This signal is emitted when something wrong occured when invoking the API - **> - broadcast notify { - out { - Notification notification - } - } - } diff --git a/api/franca/navigation/poiservice/CMakeLists.txt b/api/franca/navigation/poiservice/CMakeLists.txt index 1323e47..154bd57 100644 --- a/api/franca/navigation/poiservice/CMakeLists.txt +++ b/api/franca/navigation/poiservice/CMakeLists.txt @@ -24,6 +24,14 @@ cmake_minimum_required (VERSION 2.8.1) project(franca-poiservice) +get_directory_property(hasParent PARENT_DIRECTORY) + +if(hasParent) + set(COMMONAPI_GEN_DIR "${COMMONAPI_GEN_DIR}" PARENT_SCOPE) +else() + set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen") +endif() + option(COMMONAPI_TOOL_DIR "Absolute path to CommonAPI tool" "") option(COMMONAPI_DBUS_TOOL_DIR diff --git a/src/navigation/build.sh b/src/navigation/build.sh index af333f4..9b35d20 100755 --- a/src/navigation/build.sh +++ b/src/navigation/build.sh @@ -78,7 +78,7 @@ if [ "$clean" = 1 ] then if [ "$capi" = 0 ] then - cmake -DWITH_PLUGIN_MIGRATION=0 ../ + cmake -DWITH_PLUGIN_MIGRATION=OFF ../ else cmake -DWITH_PLUGIN_MIGRATION=ON -DWITH_DBUS_INTERFACE=OFF $commonapi_tools_option ../ echo 'fix a bug in the generation of CommonAPI hpp' diff --git a/src/navigation/map-viewer/mapviewercontrol-server-plugin/genivi_mapviewer_mapviewercontrol.cxx b/src/navigation/map-viewer/mapviewercontrol-server-plugin/genivi_mapviewer_mapviewercontrol.cxx index fd87ab4..d63a924 100644 --- a/src/navigation/map-viewer/mapviewercontrol-server-plugin/genivi_mapviewer_mapviewercontrol.cxx +++ b/src/navigation/map-viewer/mapviewercontrol-server-plugin/genivi_mapviewer_mapviewercontrol.cxx @@ -211,13 +211,14 @@ static void positionVehicleNavitUpdate(std::shared_ptr<MapMatchedPositionProxyDe { std::vector< MapMatchedPosition::PositionItemKey > valuesToReturn; CommonAPI::CallStatus status; + MapMatchedPosition::getPositionError _error; MapMatchedPosition::PositionItemDict _position; valuesToReturn.push_back(MapMatchedPosition::PositionItemKey::LATITUDE); valuesToReturn.push_back(MapMatchedPosition::PositionItemKey::LONGITUDE); valuesToReturn.push_back(MapMatchedPosition::PositionItemKey::SPEED); valuesToReturn.push_back(MapMatchedPosition::PositionItemKey::HEADING); - pos->getPosition(valuesToReturn,status,_position); + pos->getPosition(valuesToReturn,status,_error,_position); if (_position.find(MapMatchedPosition::PositionItemKey::SPEED) != _position.end()) { struct attr position_speed={attr_position_speed}; double speed; @@ -346,17 +347,18 @@ class MapViewerControlServerStub : public MapViewerControlStubDefault */ void createMapViewInstance(const std::shared_ptr<CommonAPI::ClientId> _client, ::v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle, MapViewerControl::Dimension _mapViewSize, MapViewerControl::MapViewType _mapViewType, createMapViewInstanceReply_t _reply) { + MapViewerControl::createMapViewInstanceError _error = MapViewerControl::createMapViewInstanceError::OK; dbg(lvl_debug,"enter\n"); if (_mapViewType != MapViewerControl::MapViewType::MAIN_MAP) - throw DBus::ErrorInvalidArgs("Unsupported mapViewType"); + _error = MapViewerControl::createMapViewInstanceError::MAPVIEWERCONTROL_ERROR_NOMOREMAPVIEWINSTANCEHANDLES; NavigationTypes::Handle _mapViewInstanceHandle=FIRST_SESSION_HANDLE; while ((mp_handles.count(_mapViewInstanceHandle)>0 ) && (mp_handles[_mapViewInstanceHandle] != NULL)) { _mapViewInstanceHandle++; if (_mapViewInstanceHandle == MAX_SESSION_HANDLE) - throw DBus::ErrorLimitsExceeded("Out of mapviewinstance handles"); + _error = MapViewerControl::createMapViewInstanceError::MAPVIEWERCONTROL_ERROR_NOMOREMAPVIEWINSTANCEHANDLES; } mp_handles[_mapViewInstanceHandle]=new MapViewerControlObj(this, _mapViewInstanceHandle, _mapViewSize); - _reply(_mapViewInstanceHandle); + _reply(_error,_mapViewInstanceHandle); } /** @@ -365,6 +367,7 @@ class MapViewerControlServerStub : public MapViewerControlStubDefault */ void releaseMapViewInstance(const std::shared_ptr<CommonAPI::ClientId> _client, ::v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle, ::v4::org::genivi::navigation::NavigationTypes::Handle _mapViewInstanceHandle, releaseMapViewInstanceReply_t _reply) { + MapViewerControl::releaseMapViewInstanceError _error = MapViewerControl::releaseMapViewInstanceError::OK; if (mp_handles.find(_mapViewInstanceHandle) != mp_handles.end()) { MapViewerControlObj *obj=mp_handles[_mapViewInstanceHandle]; @@ -372,10 +375,10 @@ class MapViewerControlServerStub : public MapViewerControlStubDefault mp_handles[_mapViewInstanceHandle]=NULL; } else { - throw DBus::ErrorInvalidArgs("Invalid mapviewinstance handle"); + _error = MapViewerControl::releaseMapViewInstanceError::MAPVIEWERCONTROL_ERROR_MAPVIEWINSTANCENOTAVAILABLE; } - _reply(); + _reply(_error); } /** @@ -1503,7 +1506,8 @@ MapViewerControlObj::DisplayRoute(NavigationTypes::Handle SessionHandle, Navigat if (m_navigationcore_session == NavigationTypes::BasicEnum::INVALID) { CommonAPI::CallStatus status; - mp_navigationCoreSessionClientProxy->myServiceNavigationCoreSession->createSession(std::string("MapViewerControl"),status,m_navigationcore_session); + Session::createSessionError _error; + mp_navigationCoreSessionClientProxy->myServiceNavigationCoreSession->createSession(std::string("MapViewerControl"),status,_error, m_navigationcore_session); } DisplayedRoute *route=new DisplayedRoute(this,m_navigationcore_session,RouteHandle,m_mapset); diff --git a/src/navigation/map-viewer/session-server-plugin/genivi_mapviewer_session.cxx b/src/navigation/map-viewer/session-server-plugin/genivi_mapviewer_session.cxx index 141b9b0..cb7d59e 100644 --- a/src/navigation/map-viewer/session-server-plugin/genivi_mapviewer_session.cxx +++ b/src/navigation/map-viewer/session-server-plugin/genivi_mapviewer_session.cxx @@ -74,28 +74,30 @@ class SessionServerStub : public SessionStubDefault * description: createSession = This method creates a new session and retrieves a handle . */ void createSession(const std::shared_ptr<CommonAPI::ClientId> _client, std::string _clientApp, createSessionReply_t _reply){ + Session::createSessionError _error = Session::createSessionError::OK; dbg(lvl_debug,"enter\n"); NavigationTypes::Handle _sessionHandle=1; while (mp_handles[_sessionHandle]) { _sessionHandle++; if (_sessionHandle == MAX_SESSION_HANDLES) - throw DBus::Error("org.genivi.navigationcore.Session.Error.NoMoreSessionHandles","Out of session handles"); + _error = Session::createSessionError::SESSION_ERROR_NOMORESESSIONHANDLES; } mp_handles[_sessionHandle]=new std::string(_clientApp); - _reply(_sessionHandle); + _reply(_error,_sessionHandle); } /** * description: deleteSession = This method deletes a session and its associated resources . */ void deleteSession(const std::shared_ptr<CommonAPI::ClientId> _client, ::v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle, deleteSessionReply_t _reply){ + Session::deleteSessionError _error = Session::deleteSessionError::OK; dbg(lvl_debug,"enter\n"); if (!mp_handles[_sessionHandle]) - throw DBus::Error("org.genivi.navigationcore.Session.Error.NotAvailableSessionHandle","Session handle invalid"); + _error = Session::deleteSessionError::SESSION_ERROR_SESSIONNOTAVAILABLE; delete(mp_handles[_sessionHandle]); mp_handles[_sessionHandle]=NULL; fireSessionDeletedEvent(_sessionHandle); - _reply(); + _reply(_error); } /** diff --git a/src/navigation/navigation-core/guidance-server-plugin/genivi_navigationcore_guidance.cxx b/src/navigation/navigation-core/guidance-server-plugin/genivi_navigationcore_guidance.cxx index b29c718..42cb7d3 100644 --- a/src/navigation/navigation-core/guidance-server-plugin/genivi_navigationcore_guidance.cxx +++ b/src/navigation/navigation-core/guidance-server-plugin/genivi_navigationcore_guidance.cxx @@ -277,13 +277,14 @@ class GuidanceServerStub : public GuidanceStubDefault * description: playVoiceManeuver = This method plays or repeats the last voice guidance */ void playVoiceManeuver(const std::shared_ptr<CommonAPI::ClientId> _client, playVoiceManeuverReply_t _reply){ + Guidance::playVoiceManeuverError _error = Guidance::playVoiceManeuverError::OK; if (!mp_guidance) { dbg(lvl_debug,"no guidance active\n"); - throw DBus::ErrorFailed("no guidance active"); + _error = Guidance::playVoiceManeuverError::GUIDANCE_ERROR_VOICENOTALLOWED; } mp_guidance->PlayVoiceManeuver(); - _reply(); + _reply(_error); } /** @@ -320,15 +321,16 @@ class GuidanceServerStub : public GuidanceStubDefault * description: getManeuversList = This method retrieves the list of next maneuvers */ void getManeuversList(const std::shared_ptr<CommonAPI::ClientId> _client, uint16_t _requestedNumberOfManeuvers, uint32_t _maneuverOffset, getManeuversListReply_t _reply){ + Guidance::getManeuversListError _error = Guidance::getManeuversListError::OK; if (!mp_guidance) { dbg(lvl_debug,"no guidance active\n"); - throw DBus::ErrorFailed("no guidance active"); + _error = Guidance::getManeuversListError::GUIDANCE_ERROR_NOMANEUVER; } uint16_t _numberOfManeuvers; std::vector<Guidance::Maneuver> _maneuversList; mp_guidance->GetManeuversList(_requestedNumberOfManeuvers, _maneuverOffset, _numberOfManeuvers, _maneuversList); - _reply(_numberOfManeuvers,_maneuversList); + _reply(_error,_numberOfManeuvers,_maneuversList); } /** @@ -365,8 +367,9 @@ class GuidanceServerStub : public GuidanceStubDefault * description: setVoiceGuidanceSettings = This method sets the voice guidance settings */ void setVoiceGuidanceSettings(const std::shared_ptr<CommonAPI::ClientId> _client, Guidance::PromptMode _promptMode, setVoiceGuidanceSettingsReply_t _reply){ + Guidance::setVoiceGuidanceSettingsError _error = Guidance::setVoiceGuidanceSettingsError::OK; mp_guidance->SetVoiceGuidanceSettings(_promptMode); - _reply(); + _reply(_error); } /** diff --git a/src/navigation/navigation-core/locationinput-server-plugin/genivi_navigationcore_locationinput.cxx b/src/navigation/navigation-core/locationinput-server-plugin/genivi_navigationcore_locationinput.cxx index 37b52f2..f0f675b 100644 --- a/src/navigation/navigation-core/locationinput-server-plugin/genivi_navigationcore_locationinput.cxx +++ b/src/navigation/navigation-core/locationinput-server-plugin/genivi_navigationcore_locationinput.cxx @@ -118,16 +118,17 @@ public: * handle */ void createLocationInput(const std::shared_ptr<CommonAPI::ClientId> _client, ::v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle, createLocationInputReply_t _reply){ + LocationInput::createLocationInputError _error = LocationInput::createLocationInputError::OK; uint32_t LocationInputHandle; dbg(lvl_debug,"enter\n"); LocationInputHandle=FIRST_LOCATION_HANDLE; while ((mp_handles.count(LocationInputHandle)>0 ) && (mp_handles[LocationInputHandle] != NULL)) { LocationInputHandle++; if (LocationInputHandle == MAX_LOCATION_HANDLES) - throw DBus::ErrorLimitsExceeded("Out of location handles"); + _error=LocationInput::createLocationInputError::LOCATIONINPUT_ERROR_NOMORELOCATIONINPUTHANDLES; } mp_handles[LocationInputHandle]=new LocationInputObj(this, LocationInputHandle); - _reply(LocationInputHandle); + _reply(_error,LocationInputHandle); } /** @@ -135,6 +136,7 @@ public: * resources */ void deleteLocationInput(const std::shared_ptr<CommonAPI::ClientId> _client, ::v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle, ::v4::org::genivi::navigation::NavigationTypes::LocationHandle _locationInputHandle, deleteLocationInputReply_t _reply){ + LocationInput::deleteLocationInputError _error = LocationInput::deleteLocationInputError::OK; dbg(lvl_debug,"enter\n"); if (mp_handles.find(_locationInputHandle) != mp_handles.end()) { @@ -143,10 +145,10 @@ public: mp_handles[_locationInputHandle]=NULL; } else { - throw DBus::ErrorInvalidArgs("location handle invalid"); + _error = LocationInput::deleteLocationInputError::LOCATIONINPUT_ERROR_LOCATIONINPUTNOTAVAILABLE; } - _reply(); + _reply(_error); } /** diff --git a/src/navigation/navigation-core/mapmatchedposition-server-plugin/genivi_navigationcore_mapmatchedposition.cxx b/src/navigation/navigation-core/mapmatchedposition-server-plugin/genivi_navigationcore_mapmatchedposition.cxx index 5c752a3..1be2bc2 100644 --- a/src/navigation/navigation-core/mapmatchedposition-server-plugin/genivi_navigationcore_mapmatchedposition.cxx +++ b/src/navigation/navigation-core/mapmatchedposition-server-plugin/genivi_navigationcore_mapmatchedposition.cxx @@ -233,6 +233,7 @@ class MapMatchedPositionServerStub : public MapMatchedPositionStubDefault * description: getPosition = This method returns the current position */ void getPosition(const std::shared_ptr<CommonAPI::ClientId> _client, std::vector<MapMatchedPosition::PositionItemKey> _valuesToReturn, getPositionReply_t _reply){ + MapMatchedPosition::getPositionError _error = MapMatchedPosition::getPositionError::OK; dbg(lvl_debug,"enter\n"); MapMatchedPosition::PositionItemDict map; struct attr attr; @@ -256,7 +257,7 @@ class MapMatchedPositionServerStub : public MapMatchedPositionStubDefault break; } } - _reply(map); + _reply(_error,map); } /** @@ -270,6 +271,7 @@ class MapMatchedPositionServerStub : public MapMatchedPositionStubDefault * description: getAddress = This method returns the current address */ void getCurrentAddress(const std::shared_ptr<CommonAPI::ClientId> _client, std::vector<MapMatchedPosition::AddressItemKey> _valuesToReturn, getCurrentAddressReply_t _reply){ + MapMatchedPosition::getCurrentAddressError _error = MapMatchedPosition::getCurrentAddressError::OK; MapMatchedPosition::AddressItemDict ret; std::vector< MapMatchedPosition::AddressItemKey >::const_iterator it; for (it = _valuesToReturn.begin(); it < _valuesToReturn.end(); it++) { @@ -277,7 +279,7 @@ class MapMatchedPositionServerStub : public MapMatchedPositionStubDefault ret[*it]= std::string(mp_street_name); } } - _reply(ret); + _reply(_error, ret); } /** diff --git a/src/navigation/navigation-core/routing-server-plugin/genivi_navigationcore_routing.cxx b/src/navigation/navigation-core/routing-server-plugin/genivi_navigationcore_routing.cxx index 0355d01..5f1426d 100644 --- a/src/navigation/navigation-core/routing-server-plugin/genivi_navigationcore_routing.cxx +++ b/src/navigation/navigation-core/routing-server-plugin/genivi_navigationcore_routing.cxx @@ -159,39 +159,42 @@ class RoutingServerStub : public RoutingStubDefault * description: This method creates a route */ void createRoute(const std::shared_ptr<CommonAPI::ClientId> _client, ::v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle, createRouteReply_t _reply){ + Routing::createRouteError _error = Routing::createRouteError::OK; dbg(lvl_debug,"enter\n"); NavigationTypes::Handle routeHandle=1; while (mp_handles[routeHandle]) { routeHandle++; if (routeHandle == MAX_ROUTE_HANDLES) - throw DBus::ErrorLimitsExceeded("Out of route handles"); + _error = Routing::createRouteError::ROUTING_ERROR_NOMOREROUTEHANDLES; } mp_handles[routeHandle]=new RoutingObj(this, _sessionHandle, routeHandle); - _reply(routeHandle); + _reply(_error, routeHandle); } /** * description: This method deletes a route and its associated resources */ void deleteRoute(const std::shared_ptr<CommonAPI::ClientId> _client, ::v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle, ::v4::org::genivi::navigation::NavigationTypes::Handle _routeHandle, deleteRouteReply_t _reply){ + Routing::deleteRouteError _error = Routing::deleteRouteError::OK; RoutingObj *obj=mp_handles[_routeHandle]; if (!obj) - throw DBus::ErrorInvalidArgs("Route handle invalid"); + _error = Routing::deleteRouteError::ROUTING_ERROR_ROUTENOTAVAILABLE; delete(obj); mp_handles[_routeHandle]=NULL; fireRouteDeletedEvent(_routeHandle); - _reply(); + _reply(_error); } /** * description: This method sets the cost model */ void setCostModel(const std::shared_ptr<CommonAPI::ClientId> _client, ::v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle, ::v4::org::genivi::navigation::NavigationTypes::Handle _routeHandle, Routing::CostModel _costModel, setCostModelReply_t _reply){ + Routing::setCostModelError _error = Routing::setCostModelError::OK; RoutingObj *obj=mp_handles[_routeHandle]; if (!obj) - throw DBus::ErrorInvalidArgs("Route handle invalid"); + _error = Routing::setCostModelError::ROUTING_ERROR_OPERATIONNOTALLOWED; obj->SetCostModel(_sessionHandle, _costModel); - _reply(); + _reply(_error); } /** @@ -222,11 +225,12 @@ class RoutingServerStub : public RoutingStubDefault * description: This method sets a list of route preferences */ void setRoutePreferences(const std::shared_ptr<CommonAPI::ClientId> _client, ::v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle, ::v4::org::genivi::navigation::NavigationTypes::Handle _routeHandle, std::string _countryCode, std::vector<Routing::RoutePreference> _roadPreferenceList, std::vector<Routing::ConditionPreference> _conditionPreferenceList, setRoutePreferencesReply_t _reply){ + Routing::setRoutePreferencesError _error = Routing::setRoutePreferencesError::OK; RoutingObj *obj=mp_handles[_routeHandle]; if (!obj) - throw DBus::ErrorInvalidArgs("Route handle invalid"); + _error = Routing::setRoutePreferencesError::ROUTING_ERROR_OPERATIONNOTALLOWED; obj->SetRoutePreferences(_sessionHandle, _countryCode, _roadPreferenceList); - _reply(); + _reply(_error); } /** @@ -297,8 +301,9 @@ class RoutingServerStub : public RoutingStubDefault * calculating a route */ void setTransportationMeans(const std::shared_ptr<CommonAPI::ClientId> _client, ::v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle, ::v4::org::genivi::navigation::NavigationTypes::Handle _routeHandle, std::vector<Routing::TransportationMeans> _transportationMeansList, setTransportationMeansReply_t _reply){ + Routing::setTransportationMeansError _error = Routing::setTransportationMeansError::OK; throw DBus::ErrorNotSupported("Not yet supported"); - _reply(); + _reply(_error); } /** @@ -322,8 +327,9 @@ class RoutingServerStub : public RoutingStubDefault * route */ void setExcludedAreas(const std::shared_ptr<CommonAPI::ClientId> _client, ::v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle, ::v4::org::genivi::navigation::NavigationTypes::Handle _routeHandle, std::vector< ::v4::org::genivi::navigation::NavigationTypes::Polygon> _excludedAreas, setExcludedAreasReply_t _reply){ + Routing::setExcludedAreasError _error = Routing::setExcludedAreasError::OK; throw DBus::ErrorNotSupported("Not yet supported"); - _reply(); + _reply(_error); } /** @@ -338,12 +344,13 @@ class RoutingServerStub : public RoutingStubDefault * description: setWaypoints = This method sets a list of waypoints */ void setWaypoints(const std::shared_ptr<CommonAPI::ClientId> _client, ::v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle, ::v4::org::genivi::navigation::NavigationTypes::Handle _routeHandle, bool _startFromCurrentPosition, std::vector<Routing::WayPoint> _waypointsList, setWaypointsReply_t _reply){ + Routing::setWaypointsError _error = Routing::setWaypointsError::OK; dbg(lvl_debug,"enter\n"); RoutingObj *obj=mp_handles[_routeHandle]; if (!obj) - throw DBus::ErrorInvalidArgs("Route handle invalid"); + _error = Routing::setWaypointsError::ROUTING_ERROR_OPERATIONNOTALLOWED; obj->SetWaypoints(_sessionHandle, _startFromCurrentPosition, _waypointsList); - _reply(); + _reply(_error); } /** @@ -364,12 +371,13 @@ class RoutingServerStub : public RoutingStubDefault * description: calculateRoute = This method starts a route calculation */ void calculateRoute(const std::shared_ptr<CommonAPI::ClientId> _client, ::v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle, ::v4::org::genivi::navigation::NavigationTypes::Handle _routeHandle, calculateRouteReply_t _reply){ + Routing::calculateRouteError _error = Routing::calculateRouteError::OK; dbg(lvl_debug,"enter\n"); RoutingObj *obj=mp_handles[_routeHandle]; if (!obj) - throw DBus::ErrorInvalidArgs("Route handle invalid"); + _error = Routing::calculateRouteError::ROUTING_ERROR_OPERATIONNOTALLOWED; obj->CalculateRoute(_sessionHandle); - _reply(); + _reply(_error); } /** diff --git a/src/navigation/navigation-core/session-server-plugin/genivi_navigationcore_session.cxx b/src/navigation/navigation-core/session-server-plugin/genivi_navigationcore_session.cxx index 5c9e58d..4de1a7f 100644 --- a/src/navigation/navigation-core/session-server-plugin/genivi_navigationcore_session.cxx +++ b/src/navigation/navigation-core/session-server-plugin/genivi_navigationcore_session.cxx @@ -75,28 +75,30 @@ class SessionServerStub : public SessionStubDefault * description: createSession = This method creates a new session and retrieves a handle . */ void createSession(const std::shared_ptr<CommonAPI::ClientId> _client, std::string _clientApp, createSessionReply_t _reply){ + Session::createSessionError _error = Session::createSessionError::OK; dbg(lvl_debug,"enter\n"); NavigationTypes::Handle _sessionHandle=1; while (mp_handles[_sessionHandle]) { _sessionHandle++; if (_sessionHandle == MAX_SESSION_HANDLES) - throw DBus::Error("org.genivi.navigationcore.Session.Error.NoMoreSessionHandles","Out of session handles"); + _error = Session::createSessionError::SESSION_ERROR_NOMORESESSIONHANDLES; } mp_handles[_sessionHandle]=new std::string(_clientApp); - _reply(_sessionHandle); + _reply(_error,_sessionHandle); } /** * description: deleteSession = This method deletes a session and its associated resources . */ void deleteSession(const std::shared_ptr<CommonAPI::ClientId> _client, ::v4::org::genivi::navigation::NavigationTypes::Handle _sessionHandle, deleteSessionReply_t _reply){ + Session::deleteSessionError _error = Session::deleteSessionError::OK; dbg(lvl_debug,"enter\n"); if (!mp_handles[_sessionHandle]) - throw DBus::Error("org.genivi.navigationcore.Session.Error.NotAvailableSessionHandle","Session handle invalid"); + _error = Session::deleteSessionError::SESSION_ERROR_SESSIONNOTAVAILABLE; delete(mp_handles[_sessionHandle]); mp_handles[_sessionHandle]=NULL; fireSessionDeletedEvent(_sessionHandle); - _reply(); + _reply(_error); } /** diff --git a/src/speech/main.cpp b/src/speech/main.cpp index 3cf0856..bddada8 100644 --- a/src/speech/main.cpp +++ b/src/speech/main.cpp @@ -63,6 +63,7 @@ static const uint32_t MAX_CHUNK_LENGTH = 1024; /**< max length of a single promp static const uint32_t MAX_MARKER_LENGTH = 32; /**< marker tag inside the prompt chunk */ static const uint32_t PROCESS_CHUNKS_LOOP = 100; static cst_voice* mp_voice; +static cst_audio_streaming_info* mp_asi; static pthread_mutex_t mutex; static std::string m_chunkBuffer; /** max size = MAX_CHUNK_SIZE*MAX_SLOT_COUNT */ @@ -92,6 +93,12 @@ static std::string m_chunkBuffer; /** max size = MAX_CHUNK_SIZE*MAX_SLOT_COUNT * return(true); } + static int fliteCallback(const cst_wave *w, int start, int size, + int last, cst_audio_streaming_info_struct *asi) + { + printf("\n>>> [server] fliteCallback()\n"); + } + class SpeechOutputServerStub : public SpeechOutputStubDefault { @@ -110,7 +117,11 @@ public: flite_init(); mp_voice = register_cmu_us_kal(NULL); +/* mp_asi = new_audio_streaming_info(); + mp_asi->asc = fliteCallback; + feat_set(mp_voice->features,"streaming_info",audio_streaming_info_val(mp_asi)); +*/ } ~SpeechOutputServerStub() { diff --git a/test/navigation/test-guidance-capi.py b/test/navigation/test-guidance-capi.py index 412adce..0730e04 100755 --- a/test/navigation/test-guidance-capi.py +++ b/test/navigation/test-guidance-capi.py @@ -67,10 +67,10 @@ MAIN_MAP = 0x0010 NUMBER_OF_SEGMENTS = 1000 #add signal receivers -def catchall_routing_routeCalculationProgressUpdate_handler(routeHandle, status, percentage): +def routing_routeCalculationProgressUpdate_handler(routeHandle, status, percentage): print 'Route Calculation: ' + str(int(percentage)) + ' %' -def catchall_routing_routeCalculationSuccessful_handler(routeHandle,unfullfilledPreferences): +def routing_routeCalculationSuccessful_handler(routeHandle,unfullfilledPreferences): global g_guidance_active print 'Route Calculation Successfull: ' + str(routeHandle) #get route overview @@ -105,7 +105,7 @@ def catchall_routing_routeCalculationSuccessful_handler(routeHandle,unfullfilled # display_route(routeHandle) launch_guidance(routeHandle) -def catchall_session_sessionDeleted_handler(sessionHandle): +def session_sessionDeleted_handler(sessionHandle): print('Session handle deleted: '+str(sessionHandle)) if sessionHandle == g_navigationcore_session_handle: print 'Test PASSED' @@ -113,10 +113,10 @@ def catchall_session_sessionDeleted_handler(sessionHandle): print 'Test FAILED' loop.quit() -def catchall_routing_routeDeleted_handler(routeHandle): +def routing_routeDeleted_handler(routeHandle): print('Route handle deleted: '+str(routeHandle)) -def catchall_guidance_guidanceStatusChanged_handler(guidanceStatus,routeHandle): +def guidance_guidanceStatusChanged_handler(guidanceStatus,routeHandle): global g_guidance_active print('Guidance status changed: '+str(guidanceStatus)) if guidanceStatus != GENIVI_NAVIGATIONCORE_ACTIVE and g_guidance_active == True: @@ -129,17 +129,17 @@ def catchall_guidance_guidanceStatusChanged_handler(guidanceStatus,routeHandle): g_routing_interface.deleteRoute(dbus.UInt32(g_navigationcore_session_handle),dbus.UInt32(routes[i].getElementsByTagName("handle")[0].childNodes[0].data)) g_navigationcore_session_interface.deleteSession(dbus.UInt32(g_navigationcore_session_handle)) -def catchall_guidance_positionOnRouteChanged_handler(offsetOnRoute): +def guidance_positionOnRouteChanged_handler(offsetOnRoute): print "Offset on route: " +str(offsetOnRoute) ret = g_guidance_interface.getDestinationInformation() print "Travel time: " +str(ret[1]) ret = g_guidance_interface.getManeuversList(dbus.UInt16(1),dbus.UInt32(0)) - print "Number of maneuvers: " +str(ret[0]) - print "Next road to turn: " +str(ret[1][0][1]) + print "Number of maneuvers: " +str(ret[1]) + print "Next road to turn: " +str(ret[2][0][1]) g_mapmatchedposition_interface.setSimulationMode(dbus.UInt32(g_navigationcore_session_handle),dbus.Boolean(False)) g_guidance_interface.stopGuidance(dbus.UInt32(g_navigationcore_session_handle)) -def catchall_mapmatchedposition_simulationStatusChanged_handler(simulationStatus): +def mapmatchedposition_simulationStatusChanged_handler(simulationStatus): print "Simulation status: " +str(simulationStatus) #timeout @@ -168,7 +168,8 @@ def launch_route_calculation(route): g_current_route = route print 'Route name: '+routes[g_current_route].getElementsByTagName("name")[0].childNodes[0].data #get route handle - g_route_handle = g_routing_interface.createRoute(dbus.UInt32(g_navigationcore_session_handle)) + ret = g_routing_interface.createRoute(dbus.UInt32(g_navigationcore_session_handle)) + g_route_handle=ret[1] routes[g_current_route].getElementsByTagName("handle")[0].childNodes[0].data = g_route_handle print 'Route handle: ' + str(g_route_handle) start = routes[g_current_route].getElementsByTagName("start")[0].childNodes[0].data @@ -197,7 +198,8 @@ def createMapView(): global g_mapviewer_maphandle #get mapviewer session handle - g_mapviewer_sessionhandle = g_mapviewer_session_interface.createSession(dbus.String('test mapviewer')) + ret = g_mapviewer_session_interface.createSession(dbus.String('test mapviewer')) + g_mapviewer_sessionhandle=ret[1] print 'Mapviewer session handle: ' + str(g_mapviewer_sessionhandle) g_mapviewer_sessionstatus = g_mapviewer_session_interface.getSessionStatus(dbus.UInt32(g_mapviewer_sessionhandle)); @@ -207,10 +209,11 @@ def createMapView(): print 'Mapviewer active sessions = ' + str(len(g_mapviewer_sessionlist)) #get mapviewer handle - g_mapviewer_maphandle = g_mapviewercontrol_interface.createMapViewInstance( \ + ret = g_mapviewercontrol_interface.createMapViewInstance( \ dbus.UInt32(g_mapviewer_sessionhandle), \ dbus.Struct((dbus.UInt16(HORIZONTAL_SIZE),dbus.UInt16(VERTICAL_SIZE))), \ dbus.Int32(MAIN_MAP)) + g_mapviewer_maphandle=ret[1] print 'MapView handle: ' + str(g_mapviewer_maphandle) @@ -266,31 +269,31 @@ if __name__ == '__main__': #connect to session bus bus = dbus.SessionBus() -bus.add_signal_receiver(catchall_routing_routeCalculationProgressUpdate_handler, \ +bus.add_signal_receiver(routing_routeCalculationProgressUpdate_handler, \ dbus_interface = "org.genivi.navigation.navigationcore.Routing", \ signal_name = "routeCalculationProgressUpdate") -bus.add_signal_receiver(catchall_routing_routeCalculationSuccessful_handler, \ +bus.add_signal_receiver(routing_routeCalculationSuccessful_handler, \ dbus_interface = "org.genivi.navigation.navigationcore.Routing", \ signal_name = "routeCalculationSuccessful") -bus.add_signal_receiver(catchall_routing_routeDeleted_handler, \ +bus.add_signal_receiver(routing_routeDeleted_handler, \ dbus_interface = "org.genivi.navigation.navigationcore.Routing", \ signal_name = "routeDeleted") -bus.add_signal_receiver(catchall_session_sessionDeleted_handler, \ +bus.add_signal_receiver(session_sessionDeleted_handler, \ dbus_interface = "org.genivi.navigation.navigationcore.Session", \ signal_name = "sessionDeleted") -bus.add_signal_receiver(catchall_guidance_guidanceStatusChanged_handler, \ +bus.add_signal_receiver(guidance_guidanceStatusChanged_handler, \ dbus_interface = "org.genivi.navigation.navigationcore.Guidance", \ signal_name = "guidanceStatusChanged") -bus.add_signal_receiver(catchall_guidance_positionOnRouteChanged_handler, \ +bus.add_signal_receiver(guidance_positionOnRouteChanged_handler, \ dbus_interface = "org.genivi.navigation.navigationcore.Guidance", \ signal_name = "positionOnRouteChanged") -bus.add_signal_receiver(catchall_mapmatchedposition_simulationStatusChanged_handler, \ +bus.add_signal_receiver(mapmatchedposition_simulationStatusChanged_handler, \ dbus_interface = "org.genivi.navigation.navigationcore.MapMatchedPosition", \ signal_name = "simulationStatusChanged") @@ -313,7 +316,8 @@ g_mapmatchedposition_obj = bus.get_object('org.genivi.navigation.navigationcore. g_mapmatchedposition_interface = dbus.Interface(g_mapmatchedposition_obj, dbus_interface='org.genivi.navigation.navigationcore.MapMatchedPosition') #get navigationcore session handle -g_navigationcore_session_handle = g_navigationcore_session_interface.createSession(dbus.String("test guidance")) +ret = g_navigationcore_session_interface.createSession(dbus.String("test guidance")) +g_navigationcore_session_handle=ret[1] print 'Navigation core session handle: ' + str(g_navigationcore_session_handle) #createMapView() diff --git a/test/navigation/test-location-input-capi.py b/test/navigation/test-location-input-capi.py index 0a56ce9..2ec0723 100755 --- a/test/navigation/test-location-input-capi.py +++ b/test/navigation/test-location-input-capi.py @@ -20,7 +20,7 @@ * * 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/. +* this file, You can obtain one at http://mozilla.org/MPL/2.0/. * List of changes: * 04-02-2016, Philippe Colliot, Update to the new API ('i' for enumerations and 'yv' for variants), add status handler * @@ -432,7 +432,10 @@ def timeout(): # Exit def exit(): - location_input_interface.deleteLocationInput(dbus.UInt32(session_handle),dbus.UInt32(location_input_handle)) + error=location_input_interface.deleteLocationInput(dbus.UInt32(session_handle),dbus.UInt32(location_input_handle)) + print('Delete location input: '+str(int(error))) + error=session_interface.deleteSession(dbus.UInt32(session_handle)) + print('Delete session: '+str(int(error))) loop.quit() def startSearch(address_index): @@ -461,13 +464,15 @@ session = bus.get_object('org.genivi.navigation.navigationcore.Session_Session', session_interface = dbus.Interface(session, dbus_interface='org.genivi.navigation.navigationcore.Session') # Get SessionHandle -session_handle = session_interface.createSession(dbus.String('test location input')) +ret = session_interface.createSession(dbus.String('test location input')) +session_handle=ret[1] print ('Session handle = ' + str(session_handle)) location_input_obj = bus.get_object('org.genivi.navigation.navigationcore.LocationInput_LocationInput', '/LocationInput') location_input_interface = dbus.Interface(location_input_obj, dbus_interface='org.genivi.navigation.navigationcore.LocationInput') # Get LocationInputHandle -location_input_handle = location_input_interface.createLocationInput(dbus.UInt32(session_handle)) +ret = location_input_interface.createLocationInput(dbus.UInt32(session_handle)) +location_input_handle = ret[1] print ('LocationInput handle = ' + str(location_input_handle)) attributes = location_input_interface.getSupportedAddressAttributes() diff --git a/test/navigation/test-map-viewer-control-capi.py b/test/navigation/test-map-viewer-control-capi.py index 56e3929..ecdf6f8 100755 --- a/test/navigation/test-map-viewer-control-capi.py +++ b/test/navigation/test-map-viewer-control-capi.py @@ -55,7 +55,8 @@ session = bus.get_object('org.genivi.navigation.mapviewer.Session_Session','/Ses session_interface = dbus.Interface(session, dbus_interface='org.genivi.navigation.mapviewer.Session') #get session handle -sessionhandle = session_interface.createSession(dbus.String('test mapviewer')) +ret = session_interface.createSession(dbus.String('test mapviewer')) +sessionhandle=ret[1] print 'Session handle: ' + str(sessionhandle) sessionstatus = session_interface.getSessionStatus(dbus.UInt32(sessionhandle)); @@ -68,11 +69,11 @@ MapViewerControl_obj = bus.get_object('org.genivi.navigation.mapviewer.MapViewer MapViewerControl_interface = dbus.Interface(MapViewerControl_obj, dbus_interface='org.genivi.navigation.mapviewer.MapViewerControl') #get mapviewer handle -mapviewerhandle = MapViewerControl_interface.createMapViewInstance( \ +ret = MapViewerControl_interface.createMapViewInstance( \ dbus.UInt32(sessionhandle), \ dbus.Struct((dbus.UInt16(HORIZONTAL_SIZE),dbus.UInt16(VERTICAL_SIZE))), \ dbus.Int32(MAIN_MAP)) - +mapviewerhandle=ret[1] print 'MapView handle: ' + str(mapviewerhandle) # Bern @@ -113,7 +114,11 @@ if round(lon1,4) != round(lon2,4) : if round(alt1,4) != round(alt2,4) : print '\nTest Failed:' + str(round(alt1,4)) + '!=' + str(round(alt2,4)) + '\n' -time.sleep(1) +ret=MapViewerControl_interface.getMapViewScale(dbus.UInt32(mapviewerhandle)) +print('Scale ID: '+str(int(ret[0]))) +print('MapScaleType: '+str(int(ret[1]))) + +time.sleep(3) print 'Zoom in' MapViewerControl_interface.setMapViewScaleByDelta( \ @@ -121,7 +126,7 @@ MapViewerControl_interface.setMapViewScaleByDelta( \ dbus.UInt32(mapviewerhandle), \ dbus.Int16(1)) -time.sleep(2) +time.sleep(3) print 'Zoom in' MapViewerControl_interface.setMapViewScaleByDelta( \ @@ -129,7 +134,7 @@ MapViewerControl_interface.setMapViewScaleByDelta( \ dbus.UInt32(mapviewerhandle), \ dbus.Int16(1)) -time.sleep(2) +time.sleep(3) print 'Zoom out' MapViewerControl_interface.setMapViewScaleByDelta( \ @@ -137,7 +142,7 @@ MapViewerControl_interface.setMapViewScaleByDelta( \ dbus.UInt32(mapviewerhandle), \ dbus.Int16(-1)) -time.sleep(2) +time.sleep(3) print 'Zoom out' MapViewerControl_interface.setMapViewScaleByDelta( \ @@ -145,7 +150,7 @@ MapViewerControl_interface.setMapViewScaleByDelta( \ dbus.UInt32(mapviewerhandle), \ dbus.Int16(-1)) -time.sleep(2) +time.sleep(3) MapViewerControl_interface.releaseMapViewInstance( \ dbus.UInt32(sessionhandle), \ diff --git a/test/navigation/test-route-calculation-capi.py b/test/navigation/test-route-calculation-capi.py index 45c7fbf..34f142a 100755 --- a/test/navigation/test-route-calculation-capi.py +++ b/test/navigation/test-route-calculation-capi.py @@ -97,7 +97,7 @@ if __name__ == '__main__': bus = dbus.SessionBus() #add signal receivers -def catchall_route_calculation_signals_handler(routeHandle, status, percentage): +def route_calculation_signals_handler(routeHandle, status, percentage): print 'Route Calculation: ' + str(int(percentage)) + ' %' if int(percentage) == 100: #get route overview @@ -133,7 +133,7 @@ def catchall_route_calculation_signals_handler(routeHandle, status, percentage): g_routing_interface.deleteRoute(dbus.UInt32(g_session_handle),dbus.UInt32(routes[i].getElementsByTagName("handle")[0].childNodes[0].data)) g_session_interface.deleteSession(dbus.UInt32(g_session_handle)) -def catchall_session_signals_handler(sessionHandle): +def session_signals_handler(sessionHandle): print('Session handle deleted: '+str(sessionHandle)) if sessionHandle == g_session_handle: print 'Test PASSED' @@ -141,18 +141,18 @@ def catchall_session_signals_handler(sessionHandle): print 'Test FAILED' loop.quit() -def catchall_route_deleted_signals_handler(routeHandle): +def route_deleted_signals_handler(routeHandle): print('Route handle deleted: '+str(routeHandle)) -bus.add_signal_receiver(catchall_route_calculation_signals_handler, \ +bus.add_signal_receiver(route_calculation_signals_handler, \ dbus_interface = "org.genivi.navigation.navigationcore.Routing", \ signal_name = "routeCalculationProgressUpdate") -bus.add_signal_receiver(catchall_route_deleted_signals_handler, \ +bus.add_signal_receiver(route_deleted_signals_handler, \ dbus_interface = "org.genivi.navigation.navigationcore.Routing", \ signal_name = "routeDeleted") -bus.add_signal_receiver(catchall_session_signals_handler, \ +bus.add_signal_receiver(session_signals_handler, \ dbus_interface = "org.genivi.navigation.navigationcore.Session", \ signal_name = "sessionDeleted") @@ -170,7 +170,8 @@ def launch_route_calculation(route): g_current_route = route print 'Route name: '+routes[g_current_route].getElementsByTagName("name")[0].childNodes[0].data #get route handle - g_route_handle = g_routing_interface.createRoute(dbus.UInt32(g_session_handle)) + ret = g_routing_interface.createRoute(dbus.UInt32(g_session_handle)) + g_route_handle=ret[1] routes[g_current_route].getElementsByTagName("handle")[0].childNodes[0].data = g_route_handle print 'Route handle: ' + str(g_route_handle) start = routes[g_current_route].getElementsByTagName("start")[0].childNodes[0].data @@ -197,7 +198,8 @@ session = bus.get_object('org.genivi.navigation.navigationcore.Session_Session', g_session_interface = dbus.Interface(session, dbus_interface='org.genivi.navigation.navigationcore.Session') #get session handle -g_session_handle = g_session_interface.createSession(dbus.String("test route calculation")) +ret = g_session_interface.createSession(dbus.String("test route calculation")) +g_session_handle=ret[1] print 'Session handle: ' + str(g_session_handle) routing_obj = bus.get_object('org.genivi.navigation.navigationcore.Routing_Routing','/Routing') |