Introduce per-characteristic max_write_without_response_size
#738
Labels
Backend: Android
Backend: BlueZ
Issues and PRs relating to the BlueZ backend
Backend: Core Bluetooth
Issues and PRs relating to the Core Bluetooth backend
Backend: WinRT
Issues or PRs relating to the WinRT backend
A while back, we added a
BleakClient.mtu_size
property. This can be used to determine what is the largest size of data you can send using write without response which ismtu_size - 3
.There are a couple problems with this. One is that you have to know what MTU means and that you have to subtract 3 from it. The other is that the BlueZ backend doesn't currently doesn't have a proper way to get the negotiated MTU and defaults to the minimum value of 23.
However, BlueZ recently introduced a new MTU property on characteristics. BlueZ's reason for doing this is that with Bluetooth 5 there are enhanced attributes that allow different MTU sizes per characteristic.
So, I would like to propose adding a new
max_write_without_response_size
property onBleakGATTCharacteristic
objects that returnsmtu_size - 3
, or in the case of BlueZ, the "MTU" d-bus property minus 3. This makes it obvious what the value should be used for and will hopefully be future-proof if other OSes add support for enhanced attributes.The text was updated successfully, but these errors were encountered: