Closed jAddict7 closed 5 years ago
var http = require('http');
http.createServer(function(req, res){
server.send_to('device_id', 'command');
res.end();
}).listen(3000);
how you set var server? for "server".send_to('device_id', 'command')
var server
is already created when we use the library
I am new to NodeJS, In the documentation an available option to send command is available,
'cmd':'other_command'
this.send_comand = function(cmd,data){ var msg = [this.device.uid,cmd,data]; this.device.send(this.format_data(msg)); }
But how to trigger this from http request to a specific connected device? Please do help. Thanks in advance.