我尝试列出可用的ble设备,但列表为空
flutterBlue.startScan(timeout: Duration(seconds: 4));
var subscription = flutterBlue.scanResults.listen((results) {
for (ScanResult r in results) {
for (ScanResult r in results) {
print('${r.device.name} found! rssi: ${r.rssi}');
}
}
});
1条答案
按热度按时间5t7ly7z51#
这对我很有效
但是,由于某种原因,设备名称为空