Jakeler / ble-serial

"RFCOMM for BLE" a UART over Bluetooth low energy (4+) bridge for Linux, Mac and Windows
https://blog.ja-ke.tech/tags/#bluetooth
MIT License
251 stars 37 forks source link

Extract scanner into a library #67

Closed jhfoo closed 1 year ago

jhfoo commented 1 year ago

Is your feature request related to a problem? Please describe. This works very well as a CLI tool. If the scanning module can be refactored into a library it can be easily integrated into a larger application.

Describe the solution you'd like Refactor ble-serial.scan.main.py to return a dictionary of scanned devices from general_scan() and deep_scan().

Describe alternatives you've considered Right now the alternative is to run the CLI as a process and parse the output, which should work but is clunky.

Additional context I know enough to read the flow but not good enough to match your coding style and write a PR.

Jakeler commented 1 year ago

Done, for usage check out the example: https://github.com/Jakeler/ble-serial/blob/master/examples/ble_scan_standalone.py