Android 蓝牙扫描 - 如何知道它何时完成?
Android Bluetooth scan - how to know when it's finished?
我正在使用 BluetoothLeScanner
to collect information about available devices. However, I need to know when the scan has finished. There are no methods in the callback 的 startScan
方法,这似乎表明了这一点。
我如何知道扫描何时完成?
您可以在完成扫描设备的功能后使用stopScan()。
所以它更像是扫描在您想要的时候完成,这取决于您是希望扫描根据时间标准停止还是在找到一些设备后停止。
这样做的决定点是 ScanCallback functions and results。
ScanResult 可以提供帮助。
我正在使用 BluetoothLeScanner
to collect information about available devices. However, I need to know when the scan has finished. There are no methods in the callback 的 startScan
方法,这似乎表明了这一点。
我如何知道扫描何时完成?
您可以在完成扫描设备的功能后使用stopScan()。
所以它更像是扫描在您想要的时候完成,这取决于您是希望扫描根据时间标准停止还是在找到一些设备后停止。
这样做的决定点是 ScanCallback functions and results。
ScanResult 可以提供帮助。