Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:mervis-ide:65-webpanel:webpanel-api [2017/06/30 08:31] m.chlupac [Request] |
en:mervis-ide:65-webpanel:webpanel-api [2019/05/21 10:13] m.chlupac [Request] |
||
---|---|---|---|
Line 7: | Line 7: | ||
==== Request ==== | ==== Request ==== | ||
- | < | + | **URL:** '' |
+ | |||
+ | < | ||
ver : 1,//version | ver : 1,//version | ||
//optional - only for non-authenticated access | //optional - only for non-authenticated access | ||
// | // | ||
- | c: {u: “karel”, p: “x”} | + | c: {u: "karel", p: "x"} |
}</ | }</ | ||
==== Response ==== | ==== Response ==== | ||
- | < | + | < |
ver : 1,//version | ver : 1,//version | ||
- | code: “ok”, //return 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 27: | Line 29: | ||
==== Request ==== | ==== Request ==== | ||
- | < | + | **URL:** '' |
+ | |||
+ | < | ||
ver : 1,//version | ver : 1,//version | ||
//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/ | ||
+ | |||
+ | === Example === | ||
+ | |||
+ | <code javascript> | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
=== Variable specification for Mervis RT === | === Variable specification for Mervis RT === | ||
Line 49: | Line 68: | ||
the POST body can be: | the POST body can be: | ||
- | - JSON string (AngularJS default behaviour): < | + | - JSON string (AngularJS default behaviour): < |
- 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 ==== | ||
- | < | + | < |
ver : 1,//version | ver : 1,//version | ||
code: " | code: " | ||
Line 72: | Line 90: | ||
* Each value is transmitted as a big endian binary representation of the specified variable (and its offset and length). | * Each value is transmitted as a big endian binary representation of the specified variable (and its offset and length). | ||
+ | |||
+ | === Example === | ||
+ | |||
+ | <code javascript> | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | : " | ||
+ | " | ||
+ | }, { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | }</ | ||
+ | |||
===== Command Request ===== | ===== Command Request ===== | ||
Line 77: | Line 122: | ||
==== Request ==== | ==== Request ==== | ||
+ | **URL:** '' | ||
- | < | + | < |
ver : 1,//version | ver : 1,//version | ||
// | // | ||
// | // | ||
- | c: {u: “karel”, p: “x”}, | + | c: {u: "karel", p: "x"}, |
v: [{ | v: [{ | ||
- | | + | |
// | // | ||
- | | + | |
- | | + | |
- | | + | |
// | // | ||
set: 5, | set: 5, | ||
- | // | + | // |
// | // | ||
- | | + | |
} | } | ||
] | ] | ||
Line 104: | Line 150: | ||
==== Request ==== | ==== Request ==== | ||
- | < | + | **URL:** '' |
+ | |||
+ | < | ||
ver : 1,//version | ver : 1,//version | ||
// | // | ||
// | // | ||
- | 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 120: | Line 168: | ||
}</ | }</ | ||
+ | ==== Response ==== | ||
- | + | < | |
- | ===== Configuration Response ===== | + | "ver": 1, |
- | + | " | |
- | < | + | " |
- | ver : 1,//version | + | " |
- | | + | " |
- | | + | |
- | | + | " |
- | | + | " |
- | }</ | + | |
- | + | { | |
+ | " | ||
+ | " | ||
+ | | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | | ||
+ | }] | ||
+ | } | ||
+ | </ | ||