Skip to content

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

Merged
merged 5 commits into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions adafruit_ble/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ def __init__(self, adapter=None):
self._current_advertisement = None
self._connection_cache = {}

def start_advertising(self, advertisement, scan_response=None, interval=0.1, timeout=0):
def start_advertising(
self, advertisement, scan_response=None, interval=0.1, timeout=None
):
"""
Starts advertising the given advertisement.

Expand All @@ -171,7 +173,7 @@ def start_advertising(self, advertisement, scan_response=None, interval=0.1, tim
`BLERadio.name` and `BLERadio.tx_power`.
:param float interval: advertising interval, in seconds
:param int timeout: advertising timeout in seconds.
If 0, no timeout.
If None, no timeout.
"""
advertisement_bytes = bytes(advertisement)
scan_response_bytes = b""
Expand All @@ -181,6 +183,7 @@ def start_advertising(self, advertisement, scan_response=None, interval=0.1, tim
scan_response.tx_power = self.tx_power
if scan_response:
scan_response_bytes = bytes(scan_response)
timeout = 0 if timeout is None else timeout
self._adapter.start_advertising(
advertisement_bytes,
scan_response=scan_response_bytes,
Expand Down Expand Up @@ -327,5 +330,5 @@ def address_bytes(self):

@property
def advertising(self):
"""The adverstising state"""
"""The advertising state"""
return self._adapter.advertising
1 change: 1 addition & 0 deletions adafruit_ble/services/standard/hid.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def __init__(self, service, report_id, usage_page, usage, *, max_length):

@property
def report(self):
"""The HID OUT report"""
return self._characteristic.value


Expand Down