mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
Reaper decides if a device is present or not. Allows devices to "come back to life" if they start beating again.
This commit is contained in:
parent
2b84476c42
commit
736b6f769e
8 changed files with 149 additions and 26 deletions
|
@ -54,8 +54,8 @@ module.exports = function(options) {
|
|||
|
||||
devDealer.on('message', wirerouter()
|
||||
// Initial device message
|
||||
.on(wire.DevicePresentMessage, function(channel, message, data) {
|
||||
dbapi.saveDevice(message.serial, message)
|
||||
.on(wire.DeviceIntroductionMessage, function(channel, message, data) {
|
||||
dbapi.saveDeviceInitialState(message.serial, message)
|
||||
.then(function() {
|
||||
devDealer.send([
|
||||
message.provider.channel
|
||||
|
@ -67,6 +67,10 @@ module.exports = function(options) {
|
|||
})
|
||||
})
|
||||
// Workerless messages
|
||||
.on(wire.DevicePresentMessage, function(channel, message, data) {
|
||||
dbapi.setDevicePresent(message.serial)
|
||||
appDealer.send([channel, data])
|
||||
})
|
||||
.on(wire.DeviceAbsentMessage, function(channel, message, data) {
|
||||
dbapi.setDeviceAbsent(message.serial)
|
||||
appDealer.send([channel, data])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue