diff --git a/lib/roles/device/plugins/solo.js b/lib/roles/device/plugins/solo.js index 87ce2a2d..957199b6 100644 --- a/lib/roles/device/plugins/solo.js +++ b/lib/roles/device/plugins/solo.js @@ -8,7 +8,9 @@ module.exports = syrup() .dependency(require('../support/sub')) .dependency(require('../support/push')) .dependency(require('../support/channels')) - .define(function(options, sub, push, channels) { + .dependency(require('../support/router')) + .dependency(require('./identity')) + .define(function(options, sub, push, channels, router, identity) { var log = logger.createLogger('device:plugins:solo') var channel = wireutil.makePrivateChannel() @@ -16,6 +18,34 @@ module.exports = syrup() sub.subscribe(channel) channels.register(channel, Infinity) + router.on(wire.ProbeMessage, function(channel, message) { + 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.id + , identity.display.width + , identity.display.height + , identity.display.orientation + , identity.display.xdpi + , identity.display.ydpi + , identity.display.fps + , identity.display.density + , identity.display.secure + , identity.display.url + ) + )) + ]) + }) + return { channel: channel , poke: function() { diff --git a/lib/wire/util.js b/lib/wire/util.js index a5bc7e9f..989b5fa5 100644 --- a/lib/wire/util.js +++ b/lib/wire/util.js @@ -38,30 +38,6 @@ var wireutil = { ) .encodeNB() } -, makeDeviceIdentityMessage: function(serial, identity) { - return wireutil.envelope(new wire.DeviceIdentityMessage( - serial - , identity.platform - , identity.manufacturer - , identity.operator - , identity.model - , identity.version - , identity.abi - , identity.sdk - , new wire.DeviceDisplayMessage( - identity.display.id - , identity.display.width - , identity.display.height - , identity.display.orientation - , identity.display.xdpi - , identity.display.ydpi - , identity.display.fps - , identity.display.density - , identity.display.secure - , identity.display.url - ) - )) - } } module.exports = wireutil