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, 9 insertions, 40 deletions
diff --git a/src/components/HMI/ffw/RPCClient.js b/src/components/HMI/ffw/RPCClient.js
index 954dfbe17..5df06334d 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);