diff options
Diffstat (limited to 'src/components/HMI/ffw/NavigationRPC.js')
-rw-r--r-- | src/components/HMI/ffw/NavigationRPC.js | 68 |
1 files changed, 58 insertions, 10 deletions
diff --git a/src/components/HMI/ffw/NavigationRPC.js b/src/components/HMI/ffw/NavigationRPC.js index 5f594079a..463dbfe97 100644 --- a/src/components/HMI/ffw/NavigationRPC.js +++ b/src/components/HMI/ffw/NavigationRPC.js @@ -172,6 +172,24 @@ FFW.Navigation = FFW.RPCObserver.create( { } case "Navigation.AlertManeuver": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + //Check if there is any available data to process the request + if ("softButtons" in request.params) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } else { + //If no available data sent error response and stop process current request + + this.sendError(this.errorResponsePull[request.id].code, request.id, request.method, + "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed."); + this.errorResponsePull[request.id] = null; + + return; + } + } + this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method); @@ -180,6 +198,12 @@ FFW.Navigation = FFW.RPCObserver.create( { } case "Navigation.ShowConstantTBT": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } + SDL.SDLModel.tbtActivate(request.params); this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, @@ -189,6 +213,24 @@ FFW.Navigation = FFW.RPCObserver.create( { } case "Navigation.UpdateTurnList": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + //Check if there is any available data to process the request + if ("turnList" in request.params || "softButtons" in request.params) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } else { + //If no available data sent error response and stop process current request + + this.sendError(this.errorResponsePull[request.id].code, request.id, request.method, + "Unsupported " + this.errorResponsePull[request.id].type + " type. Request was not processed."); + this.errorResponsePull[request.id] = null; + + return; + } + } + SDL.SDLModel.tbtTurnListUpdate(request.params); this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, @@ -198,11 +240,7 @@ FFW.Navigation = FFW.RPCObserver.create( { } case "Navigation.StartAudioStream": { - SDL.SDLModel.startAudioStream(request.params); - - this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"], - request.id, - request.method); + SDL.SDLModel.startAudioStream(request); break; } @@ -218,11 +256,7 @@ FFW.Navigation = FFW.RPCObserver.create( { } case "Navigation.StartStream": { - SDL.SDLModel.startStream(request.params); - - this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"], - request.id, - request.method); + SDL.SDLModel.startStream(request); break; } @@ -238,6 +272,12 @@ FFW.Navigation = FFW.RPCObserver.create( { } case "Navigation.SendLocation": { + // Werify if there is an ansupported data in request + if (this.errorResponsePull[request.id] != null) { + + this.errorResponsePull[request.id].code = SDL.SDLModel.resultCode["WARNINGS"]; + } + this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method); @@ -292,6 +332,14 @@ FFW.Navigation = FFW.RPCObserver.create( { */ sendNavigationResult: function(resultCode, id, method) { + if (this.errorResponsePull[id]) { + + this.sendError(this.errorResponsePull[id].code, id, method, + "Unsupported " + this.errorResponsePull[id].type + " type. Available data in request was processed."); + this.errorResponsePull[id] = null; + return; + } + Em.Logger.log("FFW.UI." + method + "Response"); if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) { |