mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
Rename "roles" to "units". Put units in their own folders.
This commit is contained in:
parent
7d9d64ddcb
commit
3a9b193f68
63 changed files with 105 additions and 105 deletions
50
lib/units/device/plugins/solo.js
Normal file
50
lib/units/device/plugins/solo.js
Normal file
|
@ -0,0 +1,50 @@
|
|||
var syrup = require('syrup')
|
||||
|
||||
var logger = require('../../../util/logger')
|
||||
var wire = require('../../../wire')
|
||||
var wireutil = require('../../../wire/util')
|
||||
|
||||
module.exports = syrup.serial()
|
||||
.dependency(require('../support/sub'))
|
||||
.dependency(require('../support/push'))
|
||||
.dependency(require('../support/router'))
|
||||
.dependency(require('./identity'))
|
||||
.define(function(options, sub, push, router, identity) {
|
||||
var log = logger.createLogger('device:plugins:solo')
|
||||
var channel = wireutil.makePrivateChannel()
|
||||
|
||||
log.info('Subscribing to permanent channel "%s"', channel)
|
||||
sub.subscribe(channel)
|
||||
|
||||
router.on(wire.ProbeMessage, function() {
|
||||
push.send([
|
||||
wireutil.global
|
||||
, wireutil.envelope(new wire.DeviceIdentityMessage(
|
||||
options.serial
|
||||
, identity.platform
|
||||
, identity.manufacturer
|
||||
, identity.operator
|
||||
, identity.model
|
||||
, identity.version
|
||||
, identity.abi
|
||||
, identity.sdk
|
||||
, new wire.DeviceDisplayMessage(identity.display)
|
||||
, new wire.DevicePhoneMessage(identity.phone)
|
||||
, identity.product
|
||||
))
|
||||
])
|
||||
})
|
||||
|
||||
return {
|
||||
channel: channel
|
||||
, poke: function() {
|
||||
push.send([
|
||||
wireutil.global
|
||||
, wireutil.envelope(new wire.DevicePokeMessage(
|
||||
options.serial
|
||||
, channel
|
||||
))
|
||||
])
|
||||
}
|
||||
}
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue