summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorasanoaozora <fifitaneki@hotmail.com>2016-09-13 10:59:41 +0200
committerasanoaozora <fifitaneki@hotmail.com>2016-09-13 10:59:41 +0200
commitb0b9dcd407b493079ba97db14505cf49a688ec3d (patch)
treeef0a291e390a6e96b460565866f54f50592ecb21 /src
parent5f95f1e69c313e492ab91b1bd643f637657d50fd (diff)
downloadpoi-service-b0b9dcd407b493079ba97db14505cf49a688ec3d.tar.gz
add error management into Franca files, change code and scripts, test OK
Diffstat (limited to 'src')
-rwxr-xr-xsrc/navigation/build.sh2
-rw-r--r--src/navigation/map-viewer/mapviewercontrol-server-plugin/genivi_mapviewer_mapviewercontrol.cxx18
-rw-r--r--src/navigation/map-viewer/session-server-plugin/genivi_mapviewer_session.cxx10
-rw-r--r--src/navigation/navigation-core/guidance-server-plugin/genivi_navigationcore_guidance.cxx13
-rw-r--r--src/navigation/navigation-core/locationinput-server-plugin/genivi_navigationcore_locationinput.cxx10
-rw-r--r--src/navigation/navigation-core/mapmatchedposition-server-plugin/genivi_navigationcore_mapmatchedposition.cxx6
-rw-r--r--src/navigation/navigation-core/routing-server-plugin/genivi_navigationcore_routing.cxx36
-rw-r--r--src/navigation/navigation-core/session-server-plugin/genivi_navigationcore_session.cxx10
-rw-r--r--src/speech/main.cpp11
9 files changed, 75 insertions, 41 deletions
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() {