Bug 888552 - Use SET ps command to configure power save mode, r=vchang

This commit is contained in:
Michael Wu 2013-07-09 16:27:58 -04:00
Родитель 1d6572690c
Коммит ce066e521a
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -507,10 +507,14 @@ var WifiManager = (function() {
});
}
function setPowerModeCommand(mode, callback) {
function setPowerModeCommandICS(mode, callback) {
doBooleanCommand("DRIVER POWERMODE " + (mode === "AUTO" ? 0 : 1), "OK", callback);
}
function setPowerModeCommandJB(mode, callback) {
doBooleanCommand("SET ps " + (mode === "AUTO" ? 1 : 0), "OK", callback);
}
function getPowerModeCommand(callback) {
doStringCommand("DRIVER GETPOWER", function(reply) {
if (reply)
@ -1508,7 +1512,9 @@ var WifiManager = (function() {
manager.wpsPbc = wpsPbcCommand;
manager.wpsPin = wpsPinCommand;
manager.wpsCancel = wpsCancelCommand;
manager.setPowerMode = setPowerModeCommand;
manager.setPowerMode = (sdkVersion >= 16)
? setPowerModeCommandJB
: setPowerModeCommandICS;
manager.setSuspendOptimizations = setSuspendOptimizationsCommand;
manager.setStaticIpMode = setStaticIpMode;
manager.getRssiApprox = getRssiApproxCommand;