更换wifi扫描模式,从设备获取回传Wifi列表。
This commit is contained in:
@@ -325,6 +325,28 @@ public class EspProvisionManager {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过蓝牙请求 ESP32 扫描周围 WiFi
|
||||
* @param scanListener 扫描结果监听器
|
||||
*/
|
||||
public void scanWifiFromDevice(WiFiScanListener scanListener) {
|
||||
if (!checkConnected()) {
|
||||
if (scanListener != null) {
|
||||
scanListener.onWiFiScanFailed(new Exception("设备未连接"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (espDevice == null) {
|
||||
if (scanListener != null) {
|
||||
scanListener.onWiFiScanFailed(new Exception("设备实例为空"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
espDevice.scanNetworks(scanListener);
|
||||
}
|
||||
|
||||
public void disconnect() {
|
||||
boolean shouldNotify = connected || connecting || provisioning;
|
||||
mainHandler.removeCallbacks(connectRetryTask);
|
||||
|
||||
Reference in New Issue
Block a user