summaryrefslogtreecommitdiff
path: root/src/components/HMI/ffw
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/HMI/ffw')
-rw-r--r--src/components/HMI/ffw/BasicCommunicationRPC.js18
-rw-r--r--src/components/HMI/ffw/NavigationRPC.js56
-rw-r--r--src/components/HMI/ffw/RPCClient.js49
-rw-r--r--src/components/HMI/ffw/RPCObserver.js235
-rw-r--r--src/components/HMI/ffw/TTSRPC.js64
-rw-r--r--src/components/HMI/ffw/UIRPC.js172
-rw-r--r--src/components/HMI/ffw/VRRPC.js29
7 files changed, 566 insertions, 57 deletions
diff --git a/src/components/HMI/ffw/BasicCommunicationRPC.js b/src/components/HMI/ffw/BasicCommunicationRPC.js
index 4c541bf727..0bc2b06233 100644
--- a/src/components/HMI/ffw/BasicCommunicationRPC.js
+++ b/src/components/HMI/ffw/BasicCommunicationRPC.js
@@ -1004,6 +1004,24 @@ FFW.BasicCommunication = FFW.RPCObserver
},
/**
+ * OnAwakeSDL from HMI returns SDL to normal operation
+ * after OnExitAllApplications(SUSPEND)
+ */
+ OnAwakeSDL: function() {
+
+ Em.Logger.log("FFW.BasicCommunication.OnAwakeSDL");
+
+ // send request
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "BasicCommunication.OnAwakeSDL"
+ };
+ this.client.send(JSONMessage);
+ },
+
+
+
+ /**
* Used by HMI when User chooses to exit application.
*
* @params {Number}
diff --git a/src/components/HMI/ffw/NavigationRPC.js b/src/components/HMI/ffw/NavigationRPC.js
index 5f594079a1..a3fb289dc6 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,
@@ -238,6 +280,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 +340,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"]) {
diff --git a/src/components/HMI/ffw/RPCClient.js b/src/components/HMI/ffw/RPCClient.js
index 954dfbe17e..5df06334d2 100644
--- a/src/components/HMI/ffw/RPCClient.js
+++ b/src/components/HMI/ffw/RPCClient.js
@@ -129,34 +129,19 @@ FFW.RPCClient = Em.Object
Em.Logger.log("Message received: " + evt.data);
- var jsonObj = JSON.parse(evt.data);
-
- JSON.parse(evt.data, SDL.RPCController.capabilitiesCheck);
-
- if (jsonObj.method == 'UI.Show' && SDL.RPCController.capabilityCheckResult == 'UNSUPPORTED_RESOURCE' && Object.size(jsonObj.params) != 3 && jsonObj.params.showStrings.length != 0) {
-
- this.observer.errorResponsePull[jsonObj.id] = SDL.SDLModel.resultCode["WARNINGS"];
-
- Em.Logger.error('Image of STATIC type is not supported on HMI. Other information was successfully displayed');
+ var jsonObj = JSON.parse(evt.data, SDL.RPCController.capabilitiesCheck);
+ if (SDL.RPCController.capabilityCheckResult != null) {
+ this.observer.errorResponsePull[jsonObj.id] = SDL.RPCController.capabilityCheckResult;
SDL.RPCController.capabilityCheckResult = null;
- } else {
-
- switch (SDL.RPCController.capabilityCheckResult) {
- case 'UNSUPPORTED_RESOURCE': {
-
- this.observer.errorResponsePull[jsonObj.id] = SDL.SDLModel.resultCode["UNSUPPORTED_RESOURCE"];
-
- Em.Logger.error('Unsupported incoming resource! In method ' + jsonObj.method);
-
- SDL.RPCController.capabilityCheckResult = null;
-
- break;
- }
- }
+ this.observer.checkImage(jsonObj.params);
+ this.observer.checkSoftButtons(jsonObj.params);
+ this.observer.checkChoice(jsonObj.params);
+ this.observer.checkChunk(jsonObj.params);
+ this.observer.checkHelpItems(jsonObj.params);
+ this.observer.checkTurnList(jsonObj.params);
}
-
// handle component registration
if (jsonObj.id == this.registerRequestId && jsonObj.method == null && typeof jsonObj.result == 'number') {
if (jsonObj.error == null) {
@@ -289,22 +274,6 @@ FFW.RPCClient = Em.Object
if (this.socket.readyState == this.socket.OPEN) {
- if (this.observer.errorResponsePull[obj.id] && this.observer.errorResponsePull[obj.id] !== 0 && obj.result) {
- var method = obj.result.method;
-
- delete obj.result;
-
- obj.error = {
- "code": this.observer.errorResponsePull[obj.id],
- "message": this.observer.errorResponsePull[obj.id] == 21 ? "Image of STATIC type is not supported on HMI. Other information was successfully displayed" : "Unsupported incoming resource!",
- "data": {
- "method": method
- }
- }
-
- delete this.observer.errorResponsePull[obj.id];
- }
-
var strJson = JSON.stringify(obj);
Em.Logger.log(strJson);
diff --git a/src/components/HMI/ffw/RPCObserver.js b/src/components/HMI/ffw/RPCObserver.js
index 6f598cbeb0..76b002aa8b 100644
--- a/src/components/HMI/ffw/RPCObserver.js
+++ b/src/components/HMI/ffw/RPCObserver.js
@@ -71,11 +71,244 @@ FFW.RPCObserver = Em.Object
// parse JSON string and set necessary properties
},
- onRPCRequest: function(request) {
+ onRPCRequest: function(request, error) {
// parse JSON string and send back necessary data
},
+ /**
+ * Check for unsupported image type
+ * Return false if unsupported image type was found and delete unsupported resource
+ * @param params
+ * @returns {boolean}
+ */
+ checkImage: function(params){
+ if ("graphic" in params) {
+ if (params.graphic.imageType === "STATIC") {
+ delete params.graphic;
+ return false;
+ }
+ }
+ if ("secondaryGraphic" in params) {
+ if (params.secondaryGraphic.imageType === "STATIC") {
+ delete params.secondaryGraphic;
+ return false;
+ }
+ }
+ if ("image" in params) {
+ if (params.image.imageType === "STATIC") {
+ delete params.image;
+ return false;
+ }
+ }
+ if ("secondaryImage" in params) {
+ if (params.image.imageType === "STATIC") {
+ delete params.image;
+ return false;
+ }
+ }
+ if ("turnIcon" in params) {
+ if (params.turnIcon.imageType === "STATIC") {
+ delete params.turnIcon;
+ return false;
+ }
+ }
+ if ("nextTurnIcon" in params) {
+ if (params.nextTurnIcon.imageType === "STATIC") {
+ delete params.nextTurnIcon;
+ return false;
+ }
+ }
+ if ("cmdIcon" in params) {
+ if (params.cmdIcon.imageType === "STATIC") {
+ delete params.cmdIcon;
+ return false;
+ }
+ }
+ if ("menuIcon" in params) {
+ if (params.menuIcon.imageType === "STATIC") {
+ delete params.menuIcon;
+ return false;
+ }
+ }
+ if ("syncFileName" in params) {
+ if (params.syncFileName.imageType === "STATIC") {
+ delete params.syncFileName;
+ return false;
+ }
+ }
+ if ("locationImage" in params) {
+ if (params.locationImage.imageType === "STATIC") {
+ delete params.locationImage;
+ return false;
+ }
+ }
+ return true;
+ },
+
+ /**
+ * Check for unsupported image type
+ * If unsupported image type was found delete unsupported resource
+ * @param params
+ */
+ checkSoftButtons: function(params){
+
+ if ("softButtons" in params) {
+ for (var i = params.softButtons.length-1; i >= 0 ; i--) {
+ if (!this.checkImage(params.softButtons[i])) {
+ if (!("text" in params.softButtons[i])) {
+
+ params.softButtons.splice(i, 1);
+ }
+ }
+ }
+
+ if (params.softButtons.length == 0) {
+ delete params.softButtons;
+ }
+ }
+ },
+
+ /**
+ * Check for unsupported image type
+ * If unsupported image type was found delete unsupported resource
+ * @param params
+ */
+ checkTurnList: function(params){
+
+ if ("turnList" in params) {
+ for (var i = params.turnList.length-1; i >= 0 ; i--) {
+ if (!this.checkImage(params.turnList[i])) {
+ if (!("navigationText" in params.turnList[i])) {
+
+ params.turnList.splice(i, 1);
+ }
+ }
+ }
+
+ if (params.turnList.length == 0) {
+ delete params.turnList;
+ }
+ }
+ },
+
+ /**
+ * Check for unsupported tts type
+ * If unsupported tts type was found delete unsupported resource
+ * @param params
+ */
+ checkChunk: function(params){
+
+ if ("ttsName" in params) {
+ for (var i = params.ttsName.length-1; i >= 0 ; i--) {
+ if (params.ttsName[i].type != "TEXT") {
+
+ params.ttsName.splice(i, 1);
+ }
+ }
+
+ if (params.ttsName.length == 0) {
+ delete params.ttsName;
+ }
+ }
+ if ("helpPrompt" in params) {
+ for (var i = params.helpPrompt.length-1; i >= 0 ; i--) {
+ if (params.helpPrompt[i].type != "TEXT") {
+
+ params.helpPrompt.splice(i, 1);
+ }
+ }
+
+ if (params.helpPrompt.length == 0) {
+ delete params.helpPrompt;
+ }
+ }
+ if ("initialPrompt" in params) {
+ for (var i = params.initialPrompt.length-1; i >= 0 ; i--) {
+ if (params.initialPrompt[i].type != "TEXT") {
+
+ params.initialPrompt.splice(i, 1);
+ }
+ }
+
+ if (params.initialPrompt.length == 0) {
+ delete params.initialPrompt;
+ }
+ }
+ if ("timeoutPrompt" in params) {
+ for (var i = params.timeoutPrompt.length-1; i >= 0 ; i--) {
+ if (params.timeoutPrompt[i].type != "TEXT") {
+
+ params.timeoutPrompt.splice(i, 1);
+ }
+ }
+
+ if (params.timeoutPrompt.length == 0) {
+ delete params.timeoutPrompt;
+ }
+ }
+ if ("ttsChunks" in params) {
+ for (var i = params.ttsChunks.length-1; i >= 0 ; i--) {
+ if (params.ttsChunks[i].type != "TEXT") {
+
+ params.ttsChunks.splice(i, 1);
+ }
+ }
+
+ if (params.ttsChunks.length == 0) {
+ delete params.ttsChunks;
+ }
+ }
+ },
+
+ /**
+ * Check for unsupported choiceSet type
+ * If unsupported choiceSet type was found delete unsupported resource
+ * @param params
+ */
+ checkChoice: function(params){
+
+ if ("choiceSet" in params) {
+ for (var i = params.choiceSet.length-1; i >= 0 ; i--) {
+ if (this.checkImage(params.choiceSet[i])) {
+ if (!("menuName" in params.choiceSet[i])
+ || !("secondaryText" in params.choiceSet[i])
+ || !("tertiaryText" in params.choiceSet[i])) {
+
+ params.choiceSet.splice(i, 1);
+ }
+ }
+ }
+
+ if (params.choiceSet.length == 0) {
+ delete params.choiceSet;
+ }
+ }
+ },
+
+ /**
+ * Check for unsupported vrHelp type
+ * If unsupported vrHelp type was found delete unsupported resource
+ * @param params
+ */
+ checkHelpItems: function(params){
+
+ if ("vrHelp" in params) {
+ for (var i = params.vrHelp.length-1; i >= 0 ; i--) {
+ if (this.checkImage(params.vrHelp[i])) {
+ if (!("text" in params.vrHelp[i])) {
+
+ params.vrHelp.splice(i, 1);
+ }
+ }
+ }
+
+ if (params.vrHelp.length == 0) {
+ delete params.vrHelp;
+ }
+ }
+ },
+
validationCheck: function(request) {
if (request && request.method) {
diff --git a/src/components/HMI/ffw/TTSRPC.js b/src/components/HMI/ffw/TTSRPC.js
index 6939aa4938..0e0b92acd4 100644
--- a/src/components/HMI/ffw/TTSRPC.js
+++ b/src/components/HMI/ffw/TTSRPC.js
@@ -151,6 +151,24 @@ FFW.TTS = FFW.RPCObserver.create( {
switch (request.method) {
case "TTS.Speak": {
+ // 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 ("ttsChunks" 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;
+ }
+ }
+
if (SDL.TTSPopUp.active) {
FFW.TTS.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, "TTS.Speak", "TTS in progress. Rejected.");
} else {
@@ -162,6 +180,25 @@ FFW.TTS = FFW.RPCObserver.create( {
}
case "TTS.SetGlobalProperties": {
+ // 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 ("helpPrompt" in request.params
+ || "timeoutPrompt" 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.setProperties(request.params);
this.sendTTSResult(SDL.SDLModel.resultCode["SUCCESS"],
@@ -248,6 +285,25 @@ FFW.TTS = FFW.RPCObserver.create( {
}
case "TTS.ChangeRegistration": {
+ // 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 ("ttsName" in request.params
+ || "language" 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.changeRegistrationTTSVR(request.params.language, request.params.appID);
this.sendTTSResult(SDL.SDLModel.resultCode["SUCCESS"],
@@ -328,6 +384,14 @@ FFW.TTS = FFW.RPCObserver.create( {
*/
sendTTSResult: 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." + method + "Response");
if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
diff --git a/src/components/HMI/ffw/UIRPC.js b/src/components/HMI/ffw/UIRPC.js
index 43ee73a850..ff0aa73013 100644
--- a/src/components/HMI/ffw/UIRPC.js
+++ b/src/components/HMI/ffw/UIRPC.js
@@ -168,6 +168,25 @@ FFW.UI = FFW.RPCObserver.create({
case "UI.Alert":
{
+ // 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 (request.params.alertStrings.length > 0
+ || "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;
+ }
+ }
+
if (SDL.SDLModel.onUIAlert(request.params, request.id)) {
SDL.SDLController.onSystemContextChange(request.params.appID);
}
@@ -177,6 +196,28 @@ FFW.UI = FFW.RPCObserver.create({
case "UI.Show":
{
+ // 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 (request.params.showStrings.length > 0
+ || "graphic" in request.params
+ || "secondaryGraphic" in request.params
+ || "softButtons" in request.params
+ || "customPresets" 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.TurnByTurnView.deactivate();
SDL.SDLController.getApplicationModel(request.params.appID).onSDLUIShow(request.params);
this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
@@ -185,14 +226,29 @@ FFW.UI = FFW.RPCObserver.create({
}
case "UI.SetGlobalProperties":
{
- SDL.SDLModel.setProperties(request.params);
- this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
+ // Werify if there is an ansupported data in request
+ if (this.errorResponsePull[request.id] != null) {
- break;
- }
- case "UI.ResetGlobalProperties":
- {
+ //Check if there is any available data to process the request
+ if ("menuTitle" in request.params
+ || "keyboardProperties" in request.params
+ || "vrHelp" in request.params
+ || "menuIcon" 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.setProperties(request.params);
this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
@@ -201,6 +257,25 @@ FFW.UI = FFW.RPCObserver.create({
case "UI.AddCommand":
{
+ // 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 ("cmdIcon" in request.params
+ || "menuParams" 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.SDLController.getApplicationModel(request.params.appID).addCommand(request);
break;
@@ -230,6 +305,26 @@ FFW.UI = FFW.RPCObserver.create({
case "UI.PerformInteraction":
{
+ // 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 ("choiceSet" in request.params
+ && request.params
+ && request.params.interactionLayout != "KEYBOARD") {
+
+ 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;
+ }
+ }
+
if (SDL.SDLModel.uiPerformInteraction(request)) {
SDL.SDLController.onSystemContextChange();
}
@@ -772,6 +867,20 @@ FFW.UI = FFW.RPCObserver.create({
case "UI.SetAppIcon":
{
+ // 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 (!("syncFileName" in request.params)) {
+
+ 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.onSDLSetAppIcon(request.params, request.id, request.method);
break;
@@ -1320,6 +1429,14 @@ FFW.UI = FFW.RPCObserver.create({
*/
sendUIResult: 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." + method + "Response");
if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
@@ -1351,16 +1468,8 @@ FFW.UI = FFW.RPCObserver.create({
switch (resultCode) {
case SDL.SDLModel.resultCode["SUCCESS"]: {
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "result": {
- "code": resultCode, // type (enum) from SDL protocol
- "method": 'UI.Alert'
- }
- };
- this.client.send(JSONMessage);
+
+ this.sendUIResult(resultCode, id, 'UI.Alert');
break;
}
@@ -1394,6 +1503,7 @@ FFW.UI = FFW.RPCObserver.create({
if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
+ this.sendUIResult(resultCode, id, 'UI.Alert');
// send repsonse
var JSONMessage = {
"jsonrpc": "2.0",
@@ -1530,6 +1640,36 @@ FFW.UI = FFW.RPCObserver.create({
Em.Logger.log("FFW.UI.PerformInteractionResponse");
+ if (this.errorResponsePull[requestID]) {
+
+ if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": requestID,
+ "error": {
+ "code": this.errorResponsePull[requestID].code,
+ "message": "Unsupported " + this.errorResponsePull[requestID].type + " type. Available data in request was processed.",
+ "data": {
+ "method": "UI.PerformInteraction"
+ }
+ }
+ };
+
+ if (commandID) {
+ JSONMessage.error.data.choiceID = commandID;
+ }
+
+ if (manualTextEntry != null) {
+ JSONMessage.error.data.manualTextEntry = manualTextEntry;
+ }
+ }
+
+ this.client.send(JSONMessage);
+ this.errorResponsePull[requestID] = null;
+ return;
+ }
+
if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
// send repsonse
var JSONMessage = {
diff --git a/src/components/HMI/ffw/VRRPC.js b/src/components/HMI/ffw/VRRPC.js
index 680c9a87dc..55a51b68cb 100644
--- a/src/components/HMI/ffw/VRRPC.js
+++ b/src/components/HMI/ffw/VRRPC.js
@@ -247,6 +247,27 @@ FFW.VR = FFW.RPCObserver.create( {
case "VR.PerformInteraction":
{
+ // 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 ("helpPrompt" in request.params
+ || "initialPrompt" in request.params
+ || "timeoutPrompt" in request.params
+ || "grammarID" 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.vrPerformInteraction(request);
break;
@@ -366,6 +387,14 @@ FFW.VR = FFW.RPCObserver.create( {
*/
sendVRResult: 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." + method + "Response");
if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {