1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-06 03:50:04 +02:00

First attempt at running shell commands with potentially streaming output. Still missing: multiple device support, command cancellation.

This commit is contained in:
Simo Kinnunen 2014-01-22 20:56:06 +09:00
parent 51ebf42dd3
commit 242f6f17de
5 changed files with 153 additions and 30 deletions

View file

@ -18,8 +18,8 @@ module.exports = function(options) {
appDealer.connect(endpoint)
})
appDealer.on('message', function(channel, id, cmd) {
devDealer.send([].slice.call(arguments))
appDealer.on('message', function(channel, data) {
devDealer.send([channel, data])
})
// Device side
@ -42,6 +42,18 @@ module.exports = function(options) {
case wire.MessageType.DEVICE_PROPERTIES:
var message = wire.DevicePropertiesMessage.decode(wrapper.message)
break
case wire.MessageType.DEVICE_DATA:
var message = wire.DeviceDataMessage.decode(wrapper.message)
appDealer.send([channel, data])
break
case wire.MessageType.DEVICE_DONE:
var message = wire.DeviceDoneMessage.decode(wrapper.message)
appDealer.send([channel, data])
break
case wire.MessageType.DEVICE_FAIL:
var message = wire.DeviceFailMessage.decode(wrapper.message)
appDealer.send([channel, data])
break
}
})
}