Closed dhalbert closed 4 years ago
Looks good. Tested using two CLUEs and these simple test programs:
ADVERTISER:
from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.nordic import UARTService
ble = BLERadio()
uart_service = UARTService()
advertisement = ProvideServicesAdvertisement(uart_service)
ble._adapter.name = "CLUE_FOO"
ble.start_advertising(advertisement)
while True:
pass
SCANNER:
from adafruit_ble import BLERadio
ble = BLERadio()
print("scanning")
for advertisement in ble.start_scan():
print(advertisement.complete_name)
print("scan done")
Previously, the scanner returned nothing. Now it finds and returns the name specified in the advertiser. The None
returns are expected for this simple scanner that is not doing any filtering on return type.
Adafruit CircuitPython 5.1.0 on 2020-04-02; Adafruit CLUE nRF52840 Express with nRF52840
>>> import scan
scanning
None
CLUE_FOO
None
CLUE_FOO
None
CLUE_FOO
Also fixes this: https://forums.adafruit.com/viewtopic.php?f=50&t=164081
Fixes #75.
72 caused a regression in code that called
start_scan()
with noadvertising_types
.ble_simpletest.py
stopped working, for example.