Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce per-characteristic max_write_without_response_size #738

Closed
dlech opened this issue Jan 14, 2022 · 1 comment · Fixed by #969
Closed

Introduce per-characteristic max_write_without_response_size #738

dlech opened this issue Jan 14, 2022 · 1 comment · Fixed by #969
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

Comments

@dlech
Copy link
Collaborator

dlech commented Jan 14, 2022

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 is mtu_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 on BleakGATTCharacteristic objects that returns mtu_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.

@dlech
Copy link
Collaborator Author

dlech commented Aug 31, 2022

implemented in #962

@dlech dlech closed this as completed Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
1 participant