Re: [web-bluetooth] API which provides the negotiated MTU is required (#383)

> > Yes, but I don't think there is a D-Bus API to read this number.
> BlueZ issue requesting the feature: [bluez/bluez#199](

An update on this... a D-Bus API for this was added recently.

Unlike other platforms where the API provides a per-device value, BlueZ provides this on a per-characteristic basis. The rational being that Bluetooth 5.2 Enhanced Attribute Protocol (EATT) could result in characteristics having different individual MTU values.

So I propose that the Web Bluetooth API should also be a property/method on the characteristic object. The implementation on Linux/ChromOS can use the new BlueZ API while the Windows and Mac implementations can just return the device-level value for now and could be modified in the future if Microsoft or Apple adds new APIs for EATT.

Also, I think it makes sense to perhaps have an API like Apple's `maximumWriteValueLength()` rather than returning the MTU. If the problem we are solving with this is "what is the maximum number bytes can I pass to `writeWithoutResponse()` without getting an error", then it makes sense to return that number directly rather than expecting consumers of the API to know that you have to subtract 3 from the MTU to arrive at the correct answer.

GitHub Notification of comment by dlech
Please view or discuss this issue at using your GitHub account

Sent via github-notify-ml as configured in

Received on Saturday, 20 November 2021 16:14:54 UTC