Browse Source

Merge branch 'new_dev' of https://github.com/deepcloud2048/deep_voice into new_dev

newdev_shunjiawei
fdp 1 year ago
parent
commit
8eaf37aaba
  1. 10
      lib/modules/pairing/controllers/pairing_controller.dart
  2. 4
      local_plugins/ble_service/android/src/main/kotlin/com/yunqiinnovation/ble_service/BleServicePlugin.kt
  3. 2
      local_plugins/ble_service/lib/ble_service.dart

10
lib/modules/pairing/controllers/pairing_controller.dart

@ -940,12 +940,10 @@ class PairingController extends GetxController with WidgetsBindingObserver {
await Future.delayed(Duration(seconds: 1));
}
_bleManager.stopScan();
if (product != null && product.devicetype != 0) {
//ble设备 必须要扫描到结果
return 0;
} else {
return 1;
}
// if (product != null && product.devicetype != 1) {
// //ble设备 必须要扫描到结果
// return 0;
// }
}
return 0;
//可以跳转1

4
local_plugins/ble_service/android/src/main/kotlin/com/yunqiinnovation/ble_service/BleServicePlugin.kt

@ -315,6 +315,10 @@ class BleServicePlugin : FlutterPlugin, MethodCallHandler, ActivityAware,
val connected = BleService.startScan(uuids)
result.success(connected)
}
"stopScan" -> {
val connected = BleService.stopScan()
result.success(connected)
}
"getDeviceInfo" -> {
val address = call.argument<String>("address")?:""
val info = BleService.getDeviceInfo(address);

2
local_plugins/ble_service/lib/ble_service.dart

@ -329,7 +329,7 @@ class BleService {
/// 断开连接
Future<bool> stopScan() async {
try {
final result = await _methodChannel.invokeMethod<bool>('stopScan');
final result = await _methodChannel.invokeMethod<bool>('stopscan');
return result ?? false;
} catch (e) {
print('开启扫描ble设备失败: $e');

Loading…
Cancel
Save