-
Notifications
You must be signed in to change notification settings - Fork 57
timeout and state of advertising & keyboard leds info #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Thank you. Just a few changes.
adafruit_ble/__init__.py
Outdated
@@ -162,14 +162,16 @@ def __init__(self, adapter=None): | |||
self._current_advertisement = None | |||
self._connection_cache = {} | |||
|
|||
def start_advertising(self, advertisement, scan_response=None, interval=0.1): | |||
def start_advertising(self, advertisement, scan_response=None, interval=0.1, timeout=0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use timeout=None
to indicate no timeout. That is more Pythonic, and the way we do it in other similar API's. For instance, BLERadio.start_scan() uses timeout=None
.
adafruit_ble/__init__.py
Outdated
""" | ||
Starts advertising the given advertisement. | ||
|
||
:param buf scan_response: scan response data packet bytes. | ||
If ``None``, a default scan response will be generated that includes | ||
`BLERadio.name` and `BLERadio.tx_power`. | ||
:param float interval: advertising interval, in seconds | ||
:param int timeout: advertising timeout in seconds. | ||
If 0, no timeout. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if None
, no timeout.
Run the "black" formatter over the changed source files, to fix the build failure. |
Thanks for the review. Updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one more thing.
BTW, you can allow us to make simple edits to this or future PR's if you check a box. See: |
Thanks. Will do that next time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you for putting in these missing pieces!
Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 7.2.0 from 7.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_BLE#98 from makerdiary/master Updating https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad to 0.11.6 from 0.11.5: > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#37 from adafruit/default-params Updating https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal to 1.0.2 from 1.0.1: > Merge pull request adafruit/Adafruit_CircuitPython_MatrixPortal#5 from makermelissa/master
timeout
toBLERadio.start_advertising
BLERadio.advertising
propertyReportOut.report
property to get keyboard leds info