Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions bumble/gatt_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,6 @@ def __init__(self, bearer: att.Bearer) -> None:
self._bearer_id = (
f'[0x{bearer.connection.handle:04X}|CID=0x{bearer.source_cid:04X}]'
)
# Fill the mtu.
bearer.on_att_mtu_update(att.ATT_DEFAULT_MTU)
self.connection = bearer.connection
else:
bearer.on(bearer.EVENT_DISCONNECTION, self.on_disconnection)
Expand Down
1 change: 0 additions & 1 deletion bumble/gatt_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ def on_channel(channel: l2cap.LeCreditBasedChannel):
channel.connection.handle,
channel.source_cid,
)
channel.att_mtu = att.ATT_DEFAULT_MTU
channel.sink = lambda pdu: self.on_gatt_pdu(
channel, att.ATT_PDU.from_bytes(pdu)
)
Expand Down
4 changes: 3 additions & 1 deletion bumble/l2cap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1647,7 +1647,9 @@ def __init__(
self.connection_result = None
self.disconnection_result = None
self.drained = asyncio.Event()
self.att_mtu = 0 # Filled by GATT client or server later.
# Core Specification Vol 3, Part G, 5.3.1 ATT_MTU
# ATT_MTU shall be set to the minimum of the MTU field values of the two devices.
self.att_mtu = min(mtu, peer_mtu)

self.drained.set()

Expand Down
Loading