feat:删除一些注释代码
This commit is contained in:
parent
4267e15193
commit
9164e23070
@ -263,18 +263,11 @@ class BlueManage {
|
|||||||
if (_adapterState == BluetoothAdapterState.on) {
|
if (_adapterState == BluetoothAdapterState.on) {
|
||||||
try {
|
try {
|
||||||
FlutterBluePlus.startScan(timeout: Duration(seconds: timeout));
|
FlutterBluePlus.startScan(timeout: Duration(seconds: timeout));
|
||||||
|
|
||||||
final StreamSubscription<List<ScanResult>> subscription =
|
final StreamSubscription<List<ScanResult>> subscription =
|
||||||
FlutterBluePlus.scanResults.listen((List<ScanResult> results) {
|
FlutterBluePlus.scanResults.listen((List<ScanResult> results) {
|
||||||
scanDevices.clear();
|
scanDevices.clear();
|
||||||
for (final ScanResult scanResult in results) {
|
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
|
if (((scanResult.advertisementData.serviceUuids.isNotEmpty
|
||||||
? scanResult.advertisementData.serviceUuids[0]
|
? 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);
|
scanDevicesCallBack(scanDevices);
|
||||||
// EventBusManager().eventBusFir(scanDevices);
|
|
||||||
// FlutterBluePlus.stopScan();
|
|
||||||
}, onError: (e) {
|
}, onError: (e) {
|
||||||
AppLog.log(
|
AppLog.log(
|
||||||
'扫描失败:$e',
|
'扫描失败:$e',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user