.
This commit is contained in:
@@ -5,8 +5,8 @@ define([
|
||||
'dstore/RequestMemory',
|
||||
'dstore/SimpleQuery',
|
||||
'dstore/Trackable',
|
||||
"dojox/socket",
|
||||
"dojo/_base/xhr",
|
||||
"hos/Socket",
|
||||
"dojo/request/xhr",
|
||||
"dojox/uuid/generateRandomUuid"
|
||||
], function(config, declare, Rest, RequestMemory, SimpleQuery, Trackable, Socket, xhr, generateRandomUuid){
|
||||
|
||||
@@ -51,8 +51,9 @@ define([
|
||||
});
|
||||
_store.sendCommand = function(id, cmd) {
|
||||
console.log("ToDo: send command", cmd ,"to " + id);
|
||||
var devurl = config.hos.deviceRepoUrl + "/" + id + "?method=command&value=" + encodeURIComponent(JSON.stringify(cmd));
|
||||
xhr.get({url: devurl}).then(function(data){
|
||||
//var devurl = config.hos.deviceRepoUrl + "/" + id + "?method=command&value=" + encodeURIComponent(JSON.stringify(cmd));
|
||||
var devurl = config.hos.deviceRepoUrl + "/" + id;
|
||||
xhr.post(devurl, {handleAs: 'json', data: {method: 'command', value: JSON.stringify(cmd)}}).then(function(data){
|
||||
// Do something with the handled data
|
||||
}, function(err){
|
||||
// Handle the error condition
|
||||
|
||||
Reference in New Issue
Block a user