stf icon indicating copy to clipboard operation
stf copied to clipboard

How can I send order to other devices?

Open dyxrdyxr opened this issue 9 years ago • 1 comments

I modify control-device.js

  var deviceControlArray = new Array()
  if (deviceControlArray.length == 0)
  {
    var devices = "";
    devices = oboe('/api/v1/devices')
    devices.node('devices[*]', function(device) {
     if (device.present)
      {
        deviceControlArray.push(device.channel)
      }
   })
 }

to get all devices then modify sendOneWay method

  function sendOneWay(action, data) {
    deviceControlArray.forEach(function(channel)
    {
        socket.emit(action, channel, data)
      
    })
}

now, I plug 2 devices on pc. When I touch/move device A on screen,device B on screen and real devices all move. But when I touch/move real device A, just device A on screen move, device B does not move. what do I modify to move all devices when I move real device? thanks very much!

dyxrdyxr avatar May 18 '17 06:05 dyxrdyxr

Choose a different channel. The default channel is for the current device only. I don't remember where exactly it is, but you should send the command to the user's group channel if you want it to go to all devices you're currently using.

sorccu avatar Jul 12 '17 12:07 sorccu