修复蓝牙扫描界面不自动扫描的bug
This commit is contained in:
@@ -189,6 +189,7 @@ class MHTBlueToothController extends GetControllerEx<MHTBlueToothModel> {
|
|||||||
return res;
|
return res;
|
||||||
} else {
|
} else {
|
||||||
model.deviceDataStatus = [];
|
model.deviceDataStatus = [];
|
||||||
|
return ApiResponse(code:1, msg: "".tr);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("获取设备状态异常: $e");
|
print("获取设备状态异常: $e");
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _startScanning() async {
|
void _startScanning() async {
|
||||||
|
try {
|
||||||
if (!mounted || isScanning || !mhtBlueToothController.shouldScan.value)
|
if (!mounted || isScanning || !mhtBlueToothController.shouldScan.value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -204,6 +205,13 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
ef.log("$e");
|
||||||
|
} finally {
|
||||||
|
setState(() {
|
||||||
|
isScanning = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _startPeriodicScan() {
|
void _startPeriodicScan() {
|
||||||
|
|||||||
Reference in New Issue
Block a user