Skip to content

Commit 7e88b98

Browse files
committed
aioble/server: Log warning on out-of-order indication.
1 parent 5b496e9 commit 7e88b98

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

micropython/bluetooth/aioble/aioble/server.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,11 @@ def _indicate_done(conn_handle, value_handle, status):
284284
# Timeout.
285285
return
286286
# See TODO in __init__ to support multiple concurrent indications.
287-
assert connection == characteristic._indicate_connection
288-
characteristic._indicate_status = status
289-
characteristic._indicate_event.set()
290-
287+
if connection == characteristic._indicate_connection:
288+
characteristic._indicate_status = status
289+
characteristic._indicate_event.set()
290+
else:
291+
log_warn("Received indication for unexpected connection")
291292

292293
class BufferedCharacteristic(Characteristic):
293294
def __init__(self, *args, max_len=20, append=False, **kwargs):

0 commit comments

Comments
 (0)