|
|
|
@ -732,7 +732,13 @@ class PairingController extends GetxController with WidgetsBindingObserver { |
|
|
|
try { |
|
|
|
// 设置超时定时器 |
|
|
|
_bleTimeoutTimer?.cancel(); |
|
|
|
_bleTimeoutTimer = Timer(const Duration(seconds: 20), () { |
|
|
|
_bleTimeoutTimer = Timer(const Duration(seconds: 10), () async { |
|
|
|
final currentBleState = await _bleManager.getConnectionState(); |
|
|
|
if (currentBleState == 2) { |
|
|
|
_bleTimeoutTimer?.cancel(); |
|
|
|
_transition(PairingState.completed); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (_currentState.value == PairingState.waitingBle) { |
|
|
|
_setError(ErrorType.bleTimeout, |
|
|
|
'bleConnectionTimeoutRetry'.tr); //BLE连接超时,请重启耳机后再试 |
|
|
|
|