Merge branch 'release_hyx' into release
This commit is contained in:
commit
d5b2642efc
@ -263,18 +263,11 @@ class BlueManage {
|
||||
if (_adapterState == BluetoothAdapterState.on) {
|
||||
try {
|
||||
FlutterBluePlus.startScan(timeout: Duration(seconds: timeout));
|
||||
|
||||
final StreamSubscription<List<ScanResult>> subscription =
|
||||
FlutterBluePlus.scanResults.listen((List<ScanResult> results) {
|
||||
scanDevices.clear();
|
||||
for (final ScanResult scanResult in results) {
|
||||
// 判断名字为空的直接剔除
|
||||
// if (scanResult.device.advName.isEmpty) {
|
||||
// return;
|
||||
// }
|
||||
// AppLog.log("scanResult.device.advName:${scanResult.device.advName}"
|
||||
// " scanResult.advertisementData.serviceUuids:${scanResult.advertisementData.serviceUuids}"
|
||||
// " rssi:${scanResult.rssi}");
|
||||
if (((scanResult.advertisementData.serviceUuids.isNotEmpty
|
||||
? scanResult.advertisementData.serviceUuids[0]
|
||||
: '')
|
||||
@ -296,23 +289,7 @@ class BlueManage {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// String listStr = scanDevices
|
||||
// .where((element) =>
|
||||
// element.advertisementData.advName == 'TMH_dc8f928369ed' ||
|
||||
// element.device.platformName == 'TMH_dc8f928369ed')
|
||||
// .map((e) => 'advName:${e.advertisementData.advName} '
|
||||
// 'serviceUuids:${e.advertisementData.serviceUuids} '
|
||||
// '是否被重置:${e.advertisementData.serviceUuids[0].toString()[31]}')
|
||||
// .join(',')
|
||||
// .toString();
|
||||
// if (listStr.trim() != '') {
|
||||
// AppLog.log('--->扫描到的设备 ${listStr} ');
|
||||
// }
|
||||
|
||||
scanDevicesCallBack(scanDevices);
|
||||
// EventBusManager().eventBusFir(scanDevices);
|
||||
// FlutterBluePlus.stopScan();
|
||||
}, onError: (e) {
|
||||
AppLog.log(
|
||||
'扫描失败:$e',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user