Revert "fix(provision): emit network-ready when AP mode gains internet (e.g. Ethernet)"
This reverts commit af03410528.
This commit is contained in:
@@ -26,8 +26,6 @@ class ProvisionManager extends EventEmitter {
|
|||||||
super();
|
super();
|
||||||
this._clawId = clawId || 'Setup';
|
this._clawId = clawId || 'Setup';
|
||||||
this._state = 'idle'; // 'idle' | 'ap' | 'connecting' | 'sta'
|
this._state = 'idle'; // 'idle' | 'ap' | 'connecting' | 'sta'
|
||||||
/** AP 态下首次检测到外网时打一次日志(如后接网线) */
|
|
||||||
this._loggedApInternet = false;
|
|
||||||
this._dns = null;
|
this._dns = null;
|
||||||
this._server = null;
|
this._server = null;
|
||||||
this._monitorTimer = null;
|
this._monitorTimer = null;
|
||||||
@@ -124,8 +122,6 @@ class ProvisionManager extends EventEmitter {
|
|||||||
_enterAP() {
|
_enterAP() {
|
||||||
if (this._state === 'ap') return;
|
if (this._state === 'ap') return;
|
||||||
|
|
||||||
this._loggedApInternet = false;
|
|
||||||
|
|
||||||
led.off(); // AP 模式:WiFi 未连接,WiFi 灯熄灭
|
led.off(); // AP 模式:WiFi 未连接,WiFi 灯熄灭
|
||||||
if (!hasInternet()) led.display.showAP(); // 无网时立即显示 AP,有线时等 WS 连接后再定
|
if (!hasInternet()) led.display.showAP(); // 无网时立即显示 AP,有线时等 WS 连接后再定
|
||||||
|
|
||||||
@@ -223,19 +219,6 @@ class ProvisionManager extends EventEmitter {
|
|||||||
this.emit('network-ready');
|
this.emit('network-ready');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 已在 AP、后接网线等获得外网:此前未发 network-ready,此处补齐(热点可保留供 WiFi 配网)
|
|
||||||
if (this._state === 'ap') {
|
|
||||||
if (!hasInternet()) {
|
|
||||||
this._loggedApInternet = false;
|
|
||||||
} else {
|
|
||||||
if (!this._loggedApInternet) {
|
|
||||||
log.info('provision', 'AP 模式下已具备外网(如已接网线),通知连云');
|
|
||||||
this._loggedApInternet = true;
|
|
||||||
}
|
|
||||||
this._emitNetworkReady();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 产品 WiFi 灯(OpenVFD wifi+eth):AP 全程强制熄灭,避免与其它逻辑竞态导致误亮
|
// 产品 WiFi 灯(OpenVFD wifi+eth):AP 全程强制熄灭,避免与其它逻辑竞态导致误亮
|
||||||
if (this._state === 'ap') {
|
if (this._state === 'ap') {
|
||||||
led.off();
|
led.off();
|
||||||
|
|||||||
Reference in New Issue
Block a user