We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e24cff commit b394623Copy full SHA for b394623
1 file changed
micropython/bluetooth/aioble/aioble/l2cap.py
@@ -133,14 +133,14 @@ def available(self):
133
# Waits until the channel is free and then sends buf.
134
# If the buffer is larger than the MTU it will be sent in chunks.
135
async def send(self, buf, timeout_ms=None, chunk_size=None):
136
- self._assert_connected()
137
offset = 0
138
chunk_size = min(self.our_mtu * 2, self.peer_mtu, chunk_size or self.peer_mtu)
139
mv = memoryview(buf)
140
while offset < len(buf):
141
if self._stalled:
142
await self.flush(timeout_ms)
143
# l2cap_send returns True if you can send immediately.
+ self._assert_connected()
144
self._stalled = not ble.l2cap_send(
145
self._connection._conn_handle,
146
self._cid,
0 commit comments