summaryrefslogtreecommitdiff
path: root/src/components/HMI/ffw/RPCClient.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/HMI/ffw/RPCClient.js')
-rw-r--r--src/components/HMI/ffw/RPCClient.js49
1 files changed, 40 insertions, 9 deletions
diff --git a/src/components/HMI/ffw/RPCClient.js b/src/components/HMI/ffw/RPCClient.js
index 5df06334d2..954dfbe17e 100644
--- a/src/components/HMI/ffw/RPCClient.js
+++ b/src/components/HMI/ffw/RPCClient.js
@@ -129,19 +129,34 @@ FFW.RPCClient = Em.Object
Em.Logger.log("Message received: " + evt.data);
- var jsonObj = JSON.parse(evt.data, SDL.RPCController.capabilitiesCheck);
+ 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');
- if (SDL.RPCController.capabilityCheckResult != null) {
- this.observer.errorResponsePull[jsonObj.id] = SDL.RPCController.capabilityCheckResult;
SDL.RPCController.capabilityCheckResult = null;
- 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);
+ } 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;
+ }
+ }
}
+
// handle component registration
if (jsonObj.id == this.registerRequestId && jsonObj.method == null && typeof jsonObj.result == 'number') {
if (jsonObj.error == null) {
@@ -274,6 +289,22 @@ 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);