Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compatibility with recent host ACL property changes #395

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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