WebBluetoothCG / web-bluetooth

Bluetooth support for the Web.
http://www.w3.org/community/web-bluetooth/
Other
1.38k stars 187 forks source link

API which provides the negotiated MTU is required #383

Open ghost opened 6 years ago

ghost commented 6 years ago

Bluetooth mesh runs over Bluetooth LE and defines a proxy node and associated proxy protocol to allow standard (non-mesh) Bluetooth LE clients to talk to a mesh network.

The proxy protocol requires you to know the MTU which was negotiated behind the scenes by client and server so that packets can be filled and segmentation used when messages exceed the size of the MTU. MTU negotiation happens silently behind the scenes in Web Bluetooth and there's no API that lets you find out what the outcome of that negotiation was. This is needed for the reasons given. Please consider adding an API such as getNeogitatedMTU().

Thanks

-- [edit: Related chromium Issue 1164621: WebBluetooth: not implemented "Exchange MTU" step]

beaufortfrancois commented 5 months ago

It is yes. See https://source.chromium.org/chromium/chromium/src/+/main:device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java;l=142;drc=f96971d6a2869bd124d87baa06c1aa2b0a0cc20c

tetap commented 5 months ago

It is yes. See https://source.chromium.org/chromium/chromium/src/+/main:device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java;l=142;drc=f96971d6a2869bd124d87baa06c1aa2b0a0cc20c

Blindly specifying a fixedMTU is not a reasonable treatment, and not all BLE devices support that MTU value. How about making the negotiation method public, even if the function is limited to certain platforms. These platform differences can be handled by exceptions.