-
Notifications
You must be signed in to change notification settings - Fork 290
Closed
Description
When investigating why my node sometime ends up in a still-connected state, despite my script crashing (like described here), I came across this line:
python/meshtastic/ble_interface.py
Line 166 in c397311
| client = BLEClient(device.address, disconnected_callback=lambda _: self.close) |
context:
# Bleak docs recommend always doing a scan before connecting (even if we know addr)
device = self.find_device(address)
client = BLEClient(device.address, disconnected_callback=lambda _: self.close)
client.connect()
client.discover()
return clientShould this be:
client = BLEClient(device.address, disconnected_callback=lambda _: self.close())Note that the lambda actually invokes the method, rather than returning it. According to the documentation, it does seem like the disconnected_callback should be a function expecting one argument that will be invoked (rather than to return the handler). So, I suspect this is a bug. Can you confirm?
cc: @thebentern and @geeksville as the last people to touch the line in #616
Metadata
Metadata
Assignees
Labels
No labels