add rfcomm options and fix l2cap mtu negotiation

This commit is contained in:
Gilles Boccon-Gibod
2024-02-02 15:17:27 -08:00
parent 6d91e7e79b
commit a877283360
7 changed files with 99 additions and 22 deletions

View File

@@ -416,7 +416,7 @@ class Device(HID):
data = bytearray()
data.append(report_id)
data.extend(ret.data)
if len(data) < self.l2cap_ctrl_channel.mtu: # type: ignore[union-attr]
if len(data) < self.l2cap_ctrl_channel.peer_mtu: # type: ignore[union-attr]
self.send_control_data(report_type=report_type, data=data)
else:
self.send_handshake_message(Message.Handshake.ERR_INVALID_PARAMETER)