Merge branch 'release' of gitee.com:starlock-cn/app-starlock into release

This commit is contained in:
Daisy 2024-05-28 15:00:07 +08:00
commit 8df9c7e0ef

View File

@ -71,6 +71,7 @@ class BlueManage {
//
List<int> lastTimeData = <int>[];
int? dataLen;
Timer? scanSingleTimer;
static BlueManage? _manager;
@ -322,10 +323,13 @@ class BlueManage {
!isExistDevice &&
isCurrentDevice &&
mac != null) {
scanSingleTimer?.cancel();
//android
await doNotSearchBLE(mac, connectStateCallBack);
await Future<dynamic>.delayed(3.seconds);
startScanSingle(deviceName, 15, (List<ScanResult> scanDevices) => null);
scanSingleTimer = Timer(3.seconds, () {
scanSingleTimer?.cancel();
startScanSingle(deviceName, 15, (List<ScanResult> scanDevices) => null);
});
} else if (isAddEquipment == false && isExistDevice == false) {
//使
startScanSingle(deviceName, 15, (List<ScanResult> scanDevices) {
@ -436,7 +440,7 @@ class BlueManage {
//
Future<void> doNotSearchBLE(
String masAdds, ConnectStateCallBack connectStateCallBack) async {
// FlutterBluePlus.setLogLevel(LogLevel.debug);
await FlutterBluePlus.stopScan();
final BluetoothDevice device = BluetoothDevice.fromId(masAdds);
//
const int maxAttempts = 3;