This commit is contained in:
Nedifinita
2025-11-23 21:43:47 +08:00
parent fe2769f479
commit a47c6a5745
20 changed files with 88 additions and 209 deletions

View File

@@ -145,7 +145,9 @@ class BLEService {
if (isConnected ||
_isConnecting ||
_isManualDisconnect ||
_isAutoConnectBlocked) return;
_isAutoConnectBlocked) {
return;
}
for (var device in allFoundDevices) {
if (_shouldAutoConnectTo(device)) {
@@ -168,10 +170,13 @@ class BLEService {
final deviceAddress = device.remoteId.str;
if (_targetDeviceName.isNotEmpty &&
deviceName.toLowerCase() == _targetDeviceName.toLowerCase())
deviceName.toLowerCase() == _targetDeviceName.toLowerCase()) {
return true;
}
if (_lastKnownDeviceAddress != null &&
_lastKnownDeviceAddress == deviceAddress) return true;
_lastKnownDeviceAddress == deviceAddress) {
return true;
}
return false;
}