BluetoothClient icon indicating copy to clipboard operation
BluetoothClient copied to clipboard

可以考虑增加一下 ble的扫描过滤

Open Yuanarcheannovice opened this issue 1 year ago • 1 comments

// 设置扫描过滤器 if (!serviceUUID?.toString().isNullOrEmpty()) { val serviceUuid = ParcelUuid.fromString(serviceUUID?.toString()) val scanFilter = ScanFilter.Builder().setServiceUuid(serviceUuid).build() val filters = listOf(scanFilter) bluetoothAdapter!!.bluetoothLeScanner!!.startScan( filters, ScanSettings.Builder() .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY).build(), scanCallback ) } else { bluetoothAdapter!!.bluetoothLeScanner!!.startScan( null, ScanSettings.Builder() .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY).build(), scanCallback ) }

Yuanarcheannovice avatar Nov 19 '23 13:11 Yuanarcheannovice