fix: keep WiFi LED on after STA detection
This commit is contained in:
@@ -51,12 +51,18 @@ class ProvisionManager extends EventEmitter {
|
||||
return;
|
||||
}
|
||||
|
||||
// 有线网络可用时,网络已就绪;但不自动开启 AP,不抢占 wlan0。
|
||||
// 网络已就绪时先启动 WS;hasInternet() 可能来自 WiFi,也可能来自有线,不能直接当作 wired。
|
||||
if (hasInternet()) {
|
||||
this._state = 'wired';
|
||||
log.info('provision', '有线网络就绪,启动 WS;不自动开启 AP');
|
||||
led.off();
|
||||
this._emitNetworkReady();
|
||||
if (isWifiStaConnected()) {
|
||||
this._state = 'sta';
|
||||
log.info('provision', 'WiFi STA 已连接,AP 不启动');
|
||||
this._emitNetworkReady();
|
||||
} else {
|
||||
this._state = 'wired';
|
||||
log.info('provision', '有线网络就绪,启动 WS;不自动开启 AP');
|
||||
led.off();
|
||||
this._emitNetworkReady();
|
||||
}
|
||||
this._startMonitor();
|
||||
return;
|
||||
}
|
||||
@@ -232,7 +238,7 @@ class ProvisionManager extends EventEmitter {
|
||||
this._stopAPServices();
|
||||
}
|
||||
this._state = 'sta';
|
||||
this.emit('network-ready');
|
||||
this._emitNetworkReady();
|
||||
}
|
||||
|
||||
if (this._state === 'sta' && !wifiUp) {
|
||||
|
||||
Reference in New Issue
Block a user