Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
en:mervis-ide:65-webpanel:webpanel-api [2017/06/21 11:11] m.chlupac ↷ Page moved and renamed from en:mervis-ide:70-webpanel-api to en:mervis-ide:65-webpanel:webpanel-api |
en:mervis-ide:65-webpanel:webpanel-api [2019/05/21 09:57] m.chlupac |
||
---|---|---|---|
Line 7: | Line 7: | ||
==== Request ==== | ==== Request ==== | ||
- | Data | + | **URL:** '' |
<code js>{ | <code js>{ | ||
- | ver : 1,// | + | |
- | //optional - only for non-authenticated access | + | //optional - only for non-authenticated access |
- | // | + | // |
- | c: {u: “karel”, p: “x”} | + | c: {u: "karel", p: "x"} |
- | + | ||
}</ | }</ | ||
Line 19: | Line 19: | ||
<code js>{ | <code js>{ | ||
- | ver : 1,// | + | |
- | code: | + | code: "ok", //return code |
- | msg: “”, //error message | + | msg: "" |
- | c : {u: “karel”, p:”x”} //must be used for further communication | + | c : {u: "karel", p:"x"} //must be used for further communication |
}</ | }</ | ||
Line 29: | Line 29: | ||
==== Request ==== | ==== Request ==== | ||
- | Data | + | **URL:** '' |
<code js>{ | <code js>{ | ||
- | ver : 1,// | + | |
- | //optional - only for non-authenticated access | + | //optional - only for non-authenticated access |
- | // | + | // |
- | c: {u: “karel”, p: “x”}, | + | c: {u: "karel", p: "x"}, |
- | //variable IDs | + | //variable IDs |
- | v: [ “svc:// | + | v: [ "svc:// |
- | “svc:// | + | "svc:// |
}</ | }</ | ||
* variable ID is unique string - in future, may be different for different platforms/ | * variable ID is unique string - in future, may be different for different platforms/ | ||
- | === Variable specification for RT2 === | + | === Variable specification for Mervis RT === |
* svc - protocol | * svc - protocol | ||
Line 52: | Line 53: | ||
the POST body can be: | the POST body can be: | ||
- | - JSON string (AngularJS default behaviour): | + | - JSON string (AngularJS default behaviour): <code js> |
- | <code js> | + | - converted into POST parameters (jQuery default behaviour):< |
- | - converted into POST parameters (jQuery default behaviour): | + | |
- | < | + | |
- | The best solution would be to support both versions. Easier is now the JSON string. | ||
==== Response ==== | ==== Response ==== | ||
<code js>{ | <code js>{ | ||
- | ver : 1,// | + | ver : 1,// |
- | code: | + | |
- | msg: “”, //error message | + | |
v: [{ | v: [{ | ||
- | | + | |
- | | + | |
- | | + | |
- | t: 654654321654 //timestamp UTC, milliseconds since 1970 | + | |
} | } | ||
] | ] | ||
Line 76: | Line 74: | ||
=== Encoding of values - version 1 === | === Encoding of values - version 1 === | ||
- | Ea | + | |
===== Command Request ===== | ===== Command Request ===== | ||
Line 82: | Line 80: | ||
==== Request ==== | ==== Request ==== | ||
+ | **URL:** '' | ||
<code js>{ | <code js>{ | ||
Line 87: | Line 86: | ||
// | // | ||
// | // | ||
- | c: {u: “karel”, p: “x”}, | + | c: {u: "karel", p: "x"}, |
v: [{ | v: [{ | ||
- | | + | |
// | // | ||
- | | + | |
- | | + | |
- | | + | |
// | // | ||
set: 5, | set: 5, | ||
- | // | + | // |
// | // | ||
- | | + | |
} | } | ||
] | ] | ||
Line 108: | Line 107: | ||
==== Request ==== | ==== Request ==== | ||
+ | |||
+ | **URL:** '' | ||
<code js>{ | <code js>{ | ||
Line 113: | Line 114: | ||
// | // | ||
// | // | ||
- | c: {u: “karel”, p: “x”}, | + | c: {u: "karel", p: "x"}, |
- | v: [ {i:“svc:// | + | v: [ {i:"svc:// |
from: XXXX, | from: XXXX, | ||
to: YYYY | to: YYYY | ||
}, | }, | ||
- | {i:“svc:// | + | {i:"svc:// |
from: XXXX, | from: XXXX, | ||
to: YYYY | to: YYYY | ||
Line 125: | Line 126: | ||
}</ | }</ | ||
+ | ==== Response ==== | ||
- | + | < | |
- | ===== Configuration Response ===== | + | "ver": 1, |
- | + | " | |
- | < | + | " |
- | ver : 1,//version | + | " |
- | platform: “uPLC”, | + | " |
- | maxVariablesInRequest: 5, | + | " |
- | maxRequestSize: 1500, //http body size in bytes | + | " |
- | preferedLanguage: “en-US” | + | " |
- | }</ | + | }, |
- | + | { | |
+ | " | ||
+ | " | ||
+ | }], | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | | ||
+ | }] | ||
+ | } | ||
+ | </ | ||
- | ====== Native/ | + | ===== Native/ |
Note: big endian encoding (v1) | Note: big endian encoding (v1) |