mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-20 03:53:39 +02:00
Reorder switches.
This commit is contained in:
@@ -47,6 +47,15 @@ module.exports = function(options) {
|
||||
var wrapper = wire.Envelope.decode(data)
|
||||
channels.keepalive(channel)
|
||||
switch (wrapper.type) {
|
||||
case wire.MessageType.PROBE:
|
||||
var message = wire.ProbeMessage.decode(wrapper.message)
|
||||
adb.getPropertiesAsync(options.serial)
|
||||
.then(function(properties) {
|
||||
identity = devutil.makeIdentity(options.serial, properties)
|
||||
push.send([channel,
|
||||
wireutil.makeDeviceIdentityMessage(options.serial, identity)])
|
||||
})
|
||||
break
|
||||
case wire.MessageType.GROUP:
|
||||
var message = wire.GroupMessage.decode(wrapper.message)
|
||||
, groupChannel = message.channel
|
||||
@@ -58,15 +67,6 @@ module.exports = function(options) {
|
||||
wireutil.makeJoinGroupMessage(options.serial)])
|
||||
}
|
||||
break
|
||||
case wire.MessageType.PROBE:
|
||||
var message = wire.ProbeMessage.decode(wrapper.message)
|
||||
adb.getPropertiesAsync(options.serial)
|
||||
.then(function(properties) {
|
||||
identity = devutil.makeIdentity(options.serial, properties)
|
||||
push.send([channel,
|
||||
wireutil.makeDeviceIdentityMessage(options.serial, identity)])
|
||||
})
|
||||
break
|
||||
case wire.MessageType.SHELL_COMMAND:
|
||||
var message = wire.ShellCommandMessage.decode(wrapper.message)
|
||||
log.info('Running shell command "%s"', message.command.join(' '))
|
||||
|
||||
Reference in New Issue
Block a user