Revert "Implement set Wifi on/off."

This reverts commit 4c7af64d0d958a9db6de0bc3fddfa1aa0edb1cdd.
This commit is contained in:
Valverde Antonio
2014-06-27 16:01:23 +09:00
parent 9a07c1bb77
commit 9a31fbbfca
8 changed files with 0 additions and 80 deletions

View File

@@ -34,7 +34,6 @@ module.exports = function(options) {
.dependency(require('./device/plugins/connect'))
.dependency(require('./device/plugins/account'))
.dependency(require('./device/plugins/ringer'))
.dependency(require('./device/plugins/wifi'))
.define(function(options, solo) {
if (process.send) {
// Only if we have a parent process

View File

@@ -521,20 +521,6 @@ module.exports = syrup.serial()
})
}
plugin.setWifiEnabled = function(enabled) {
return runServiceCommand(
apk.wire.MessageType.SET_WIFI_ENABLED
, new apk.wire.SetWifiEnabledRequest(enabled)
)
.timeout(10000)
.then(function(data) {
var response = apk.wire.SetWifiEnabledResponse.decode(data)
if (!response.success) {
throw new Error('Unable to set Wifi')
}
})
}
function runServiceCommand(type, cmd) {
var resolver = Promise.defer()
var id = Math.floor(Math.random() * 0xFFFFFF)

View File

@@ -1,35 +0,0 @@
var syrup = require('syrup')
var logger = require('../../../util/logger')
var wire = require('../../../wire')
var wireutil = require('../../../wire/util')
module.exports = syrup.serial()
.dependency(require('./service'))
.dependency(require('../support/router'))
.dependency(require('../support/push'))
.define(function(options, service, router, push) {
var log = logger.createLogger('device:plugins:wifi')
router.on(wire.WifiSetEnabledMessage, function(channel, message) {
var reply = wireutil.reply(options.serial)
log.info('Setting Wifi "%s"', message.enabled)
service.setWifiEnabled(message.enabled)
.timeout(30000)
.then(function() {
push.send([
channel
, reply.okay()
])
})
.error(function(err) {
log.error('Setting wifi enabled failed', err.stack)
push.send([
channel
, reply.fail(err.message)
])
})
})
})

View File

@@ -341,16 +341,6 @@ module.exports = function(options) {
)
])
})
.on('wifi.set', function(channel, responseChannel, data) {
joinChannel(responseChannel)
push.send([
channel
, wireutil.transaction(
responseChannel
, new wire.WifiSetEnabledMessage(data.enabled)
)
])
})
.on('group.invite', function(channel, responseChannel, data) {
joinChannel(responseChannel)
push.send([

View File

@@ -56,7 +56,6 @@ enum MessageType {
ConnectStopMessage = 54;
AccountRemoveMessage = 55;
RingerSetMessage = 56;
WifiSetEnabledMessage = 57;
}
message Envelope {
@@ -392,10 +391,6 @@ message RingerSetMessage {
required int32 mode = 1;
}
message WifiSetEnabledMessage {
required bool enabled = 1;
}
// Events, these must be kept in sync with STFService/wire.proto
message AirplaneModeEvent {