Skip to content
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

Valid values for timeout of BLERadio.start_scan() seem to be ignored #3942

Closed
catequalsgood opened this issue Jan 6, 2021 · 1 comment · Fixed by #3964
Closed

Valid values for timeout of BLERadio.start_scan() seem to be ignored #3942

catequalsgood opened this issue Jan 6, 2021 · 1 comment · Fixed by #3964

Comments

@catequalsgood
Copy link

Issue #3826 was fixed in 6.0.1 but the fix seems to have introduced a new bug. Any timeout value >= 0.1 seems to be ignored now (no timeout). I had the code below running for 14 min and it did not precede past "Scanning for an Adafruit Server advertisement...". I checked 6.0.0 again and the behaviour there is as expected.
I tested this on a Feather Sense using 6.1.0 RC as well as 6.0.1.

import time

import adafruit_ble
from adafruit_ble_adafruit.adafruit_service import AdafruitServerAdvertisement
import supervisor

ble = adafruit_ble.BLERadio()

connection = None

print("Scanning for an Adafruit Server advertisement...")
for adv in ble.start_scan(AdafruitServerAdvertisement, timeout=1.0):
    print("about to connect")
    connection = ble.connect(adv)
    print("connected")
    break

ble.stop_scan()

supervisor.reload()
@tannewt tannewt added this to the 6.x.x - Bug Fixes milestone Jan 7, 2021
@dhalbert dhalbert self-assigned this Jan 10, 2021
@dhalbert
Copy link
Collaborator

Also reported by @dglaude in #3963.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants