Skip to content

Commit

Permalink
compatibility with recent host ACL property changes
Browse files Browse the repository at this point in the history
  • Loading branch information
barbibulle committed Jan 5, 2024
1 parent c48e3f5 commit 00cd8fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/controller_loopback.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def on_l2cap_pdu(self, connection_handle: int, cid: int, pdu: bytes):
self.expected_cid += 1
if cid == 0:
self.start_timestamp = now
self.last_timestamp = now
else:
elapsed_since_start = now - self.start_timestamp
elapsed_since_last = now - self.last_timestamp
Expand All @@ -79,6 +78,9 @@ def on_l2cap_pdu(self, connection_handle: int, cid: int, pdu: bytes):
'cyan',
)
)

self.last_timestamp = now

if self.expected_cid == self.packet_count:
print(color('@@@ Received last packet', 'green'))
self.done.set()
Expand All @@ -97,7 +99,7 @@ async def run(self):

# make sure data can fit in one l2cap pdu
l2cap_header_size = 4
max_packet_size = host.hc_acl_data_packet_length - l2cap_header_size
max_packet_size = host.acl_packet_queue.max_packet_size - l2cap_header_size
if self.packet_size > max_packet_size:
print(
color(
Expand Down

0 comments on commit 00cd8fb

Please sign in to comment.