Commit Graph

18 Commits

Author SHA1 Message Date
uier 8f00e82fac l2cap: Simplify abort and disconnection response handling
Also includes the test_disconnection_collision unit test.
2026-06-17 04:37:59 +00:00
uier 5bff934868 l2cap: Resolve teardown hang on disconnect collision or abort
Resolve a teardown hang in LeCreditBasedChannel. When a disconnection
collision occurs (both DUT and peer call disconnect simultaneously) or the
channel is aborted during disconnection, the connection state transitions
to DISCONNECTED before the peer's response arrives (or is ignored).
In these cases, the `disconnection_result` future remained unresolved,
causing any awaiting teardown task to hang.

This patch ensures that calling abort() or receiving a disconnection request
while in the DISCONNECTING state correctly resolves `disconnection_result` and
cleans up the channel.

Verification:
Verified with a new unit test `test_abort_while_disconnecting` added to
`tests/l2cap_test.py` that stubs a non-responsive peer and calls abort()
during the DISCONNECTING state transition, confirming it completes immediately.
2026-06-16 18:03:26 +00:00
uier 3c8fe5637d tests: Fix pytest 9.1 compat by removing trailing commas in parametrize and setting asyncio_mode 2026-06-16 12:18:12 +00:00
Josh Wu b153d0fcde L2CAP: Fix Enhanced Retransmission Segmentation 2026-01-07 23:49:57 +08:00
Gilles Boccon-Gibod 7c7b792cf9 remove unused import 2025-12-30 13:22:27 -08:00
Josh Wu 618e977f20 L2CAP: Enhanced Credit-based Flow Control Mode 2025-12-23 19:51:55 +08:00
Josh Wu 456cb59b48 L2CAP: FCS Implementation 2025-12-01 16:10:45 +08:00
Josh Wu 57e05781ad L2CAP: Enhanced Retransmission Mode 2025-11-24 16:17:11 +08:00
Gilles Boccon-Gibod 7aba36302a use isort when formatting 2025-08-21 16:38:58 -07:00
Josh Wu f41b7746d2 Add L2CAP credit based packets definitions 2025-08-13 11:59:24 +08:00
Josh Wu 822f97fa84 Fix L2CAP errors 2025-07-30 12:00:20 +08:00
Josh Wu 858788f05e Migrate L2CAP packets to dataclasses 2025-07-20 18:30:02 +08:00
Gilles Boccon-Gibod a877283360 add rfcomm options and fix l2cap mtu negotiation 2024-02-05 08:56:59 -08:00
Josh Wu 5a85765360 Cleanup legacy L2CAP API 2023-10-11 14:33:44 +08:00
Josh Wu 901eb55b0e Add SDP self tests 2023-08-24 01:27:07 +08:00
Gilles Boccon-Gibod 135df0dcc0 format with Black 2022-12-10 09:40:12 -08:00
Gilles Boccon-Gibod 867e8c13dc lower the number of test cases for l2cap in order to speed up the test 2022-11-14 17:26:09 -08:00
Gilles Boccon-Gibod ce9004f0ac Add L2CAP CoC support (squashed)
[85542e0] fix test
[3748781] add ASAH sink example
[e782e29] add app
[83daa30] wip
[7f138a0] add test
[f732108] allow different address syntax
[9d0bbf8] rename deprecated methods
[eb303d5] add LE CoC support
2022-11-07 16:45:37 -08:00