Closed panguoxian closed 1 year ago
Hello :) Thank you for your issue.
I am sorry, I think I am confused, are you sure you are not referring to blessed kotlin repo? My library also is based on Kotlin, but has a different approach and philosophy.
Different methods and concepts.
I need to scan for unknown bluetooth devices nearby. How do this? i want to know your method.
I use scanForPeripherals(resultCallback: (BluetoothPeripheral, ScanResult) -> Unit, scanError: (ScanFailure) -> Unit ) function. but resultCallback has no callback.
Because the startScan function uses filter, but the filter is empty. So scanForPeripherals has no callback.
You can take a look on the README.md for this repo to see how you can install. You can handle Bluetooth permissions, turning on the Bluetooth hardware, yourself or you can let my library help… I suggest you use the library functions to handle these, they are also on the readme file.
As for how you can scan for all nearby devices you can check this. You don't have to pass filters if you don't want to, you can choose to scan for a given period or indeterminate. And you can choose to use a callback or use coroutines.
The sample app provided in this repo does the scanning for all nearby devices, you can check that for guidance.
Thank you for your reply
Hey, just checking Were you able to scan devices successfully?
I am closing this due to inactivity. Please let me know if you would like to re-open this issue.
I modified the startScan function of BluetoothCentralManager.kt Because the startScan function uses filter, but the filter is empty