adafruit / Adafruit_CircuitPython_BLE

Bluetooth Low Energy (BLE) library for CircuitPython
MIT License
127 stars 58 forks source link

Wrap _bleio exceptions which might get thrown to user code #42

Open dhalbert opened 4 years ago

dhalbert commented 4 years ago

Add adafruit_ble bindings for _ble.*Exception so that user code can catch them without importing _bleio.

@kattni has need of this for a BLE central program, and so would most other folks.

dglaude commented 4 years ago

This is also needed for adafruit/Adafruit_CircuitPython_BLE_Magic_Light that use _bleio just to catch disconnection. It's both in the Readme and the example.

except _bleio.ConnectionError:

Any other proper way to do that is welcome.