forked from auracaster/bumble_mirror
Fix L2CAP signaling packet identifiers
According to the Bluetooth Core Spec, Volume 3, Part A, Section 4, 0x00 is an invalid identifier:
4. Signaling packet formats
...
Identifier (1 octet)
... Signaling identifier 0x00 is an invalid identifier and shall never be used in any command.
This commit is contained in:
@@ -1521,6 +1521,9 @@ class ChannelManager:
|
|||||||
|
|
||||||
def next_identifier(self, connection: Connection) -> int:
|
def next_identifier(self, connection: Connection) -> int:
|
||||||
identifier = (self.identifiers.setdefault(connection.handle, 0) + 1) % 256
|
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
|
self.identifiers[connection.handle] = identifier
|
||||||
return identifier
|
return identifier
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user