Skip to content

Commit 7e1c9cf

Browse files
committed
aioble: Raise correct error if l2cap disconnects in middle of send.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
1 parent 68e3e07 commit 7e1c9cf

File tree

1 file changed

+1
-0
lines changed
  • micropython/bluetooth/aioble/aioble

1 file changed

+1
-0
lines changed

micropython/bluetooth/aioble/aioble/l2cap.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ async def send(self, buf, timeout_ms=None, chunk_size=None):
141141
if self._stalled:
142142
await self.flush(timeout_ms)
143143
# l2cap_send returns True if you can send immediately.
144+
self._assert_connected()
144145
self._stalled = not ble.l2cap_send(
145146
self._connection._conn_handle,
146147
self._cid,

0 commit comments

Comments
 (0)