aioble: Make l2cap chunk size configurable to allow optimization by app.

pull/528/head
Philip Peitsch 2022-08-23 18:19:19 +10:00 zatwierdzone przez Damien George
rodzic c4fada7f6f
commit a18d49cda7
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -132,10 +132,10 @@ class L2CAPChannel:
# Waits until the channel is free and then sends buf.
# If the buffer is larger than the MTU it will be sent in chunks.
async def send(self, buf, timeout_ms=None):
async def send(self, buf, timeout_ms=None, chunk_size=None):
self._assert_connected()
offset = 0
chunk_size = min(self.our_mtu * 2, self.peer_mtu)
chunk_size = min(self.our_mtu * 2, self.peer_mtu, chunk_size or self.peer_mtu)
mv = memoryview(buf)
while offset < len(buf):
if self._stalled: