1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 19:42:01 +02:00

Reorder switches.

This commit is contained in:
Simo Kinnunen 2014-01-28 17:10:28 +09:00
parent 50a9de1875
commit f056e0d2ca

View file

@ -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(' '))