diff --git a/lib/modules/ota_upgrade/controllers/ota_upgrade_controller.dart b/lib/modules/ota_upgrade/controllers/ota_upgrade_controller.dart index 3fe3f689c..7adfc296b 100644 --- a/lib/modules/ota_upgrade/controllers/ota_upgrade_controller.dart +++ b/lib/modules/ota_upgrade/controllers/ota_upgrade_controller.dart @@ -216,11 +216,6 @@ class OtaUpgradeController extends GetxController { // 版本检查 bool isUpdate = _isNewVersionAvailable(product.version!); - if (isUpdate) { - await _bleManager.setEnterOta(true); - await Future.delayed(const Duration(seconds: 2)); - jlota.init(); - } isUpdateAvailable.value = isUpdate; } catch (e) { @@ -337,6 +332,10 @@ class OtaUpgradeController extends GetxController { // 修改后的startDownload方法 Future startDownload() async { + await _bleManager.setEnterOta(true); + await Future.delayed(const Duration(seconds: 2)); + jlota.init(); + isDownloading.value = true; showDetailedStatus.value = true; detailedStatus.value = '准备下载固件包...'; diff --git a/local_plugins/ota/ios/Classes/BleManager/JLBleManager.m b/local_plugins/ota/ios/Classes/BleManager/JLBleManager.m index cb22ecfa8..08cd5b8c5 100644 --- a/local_plugins/ota/ios/Classes/BleManager/JLBleManager.m +++ b/local_plugins/ota/ios/Classes/BleManager/JLBleManager.m @@ -48,7 +48,7 @@ NSString *FLT_BLE_RCSP_R = @"AE02"; //命令“读”通道 - (instancetype)init { self = [super init]; if (self) { - _isPaired = YES; + _isPaired = NO; _pairStatus = NO; _bleManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil]; diff --git a/pubspec.yaml b/pubspec.yaml index db31dc5c8..2439e4cff 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: voitrans description: "Voitrans - AI Voice Assistant." publish_to: "none" -version: 1.0.2+7 +version: 1.0.3+8 environment: sdk: ">=3.3.0 <4.0.0"