Constructor of SiRuDevice. By calling this function, device will join room indicated by roomName.
const device = new SiRuDevice(roomName, [options])
localhost
)set GET interface
device.get(path, callback)
set POST interface
device.post(path, callback)
set PUT interface
device.put(path, callback)
set delete interface
device.delete(path, callback)
device.publish(topic, data)
publish data to clients in the room. data is distinguished by topic.
data - string | object |
device.subscribe(topic)
subscribe topic
device.unsubscribe(topic)
unsubscribe topic
device.on('connect', () => {...})
fired when connected to skyway signaling server and join room procedure has completed.
device.on('meta', meta => { ... })
fired when meta data is received from each device in the room.
meta.uuid
must be specified. You can see example meta data in profile.yamldevice.on('message', (topic, message) => { ... })
When published data will be received for subscribed topic. This event will be fired
message - string | object |
device.on('stream', stream => { ... })
fired when media streaming is arrived from device.
request object which will be passed to REST interface as 1st argument.
response object which will be passed to REST interface as 2nd argument.
set status code for the response
res.setStatus(code)
send response to client
res.send(data)
data - string | number | object |
Copyright. NTT Communications All Rights Reserved.