Merge pull request #666 from canatella/fix-l2cap-signaling-packet-identifiers

Fix L2CAP signaling packet identifiers
This commit is contained in:
Gilles Boccon-Gibod
2025-04-08 14:49:43 -04:00
committed by GitHub

View File

@@ -1521,6 +1521,9 @@ class ChannelManager:
def next_identifier(self, connection: Connection) -> int:
identifier = (self.identifiers.setdefault(connection.handle, 0) + 1) % 256
# 0x00 is an invalid ID (BT Core Spec, Vol 3, Part A, Sect 4
if identifier == 0:
identifier = 1
self.identifiers[connection.handle] = identifier
return identifier