Home > Net >  Web Bluetooth - Windows 11 disconnection
Web Bluetooth - Windows 11 disconnection

Time:10-22

I have a web app which uses web bluetooth api. GATT server is running on STM32 microcontroller. Web app works good on Android devices, but it keeps disconnecting on Windows 11 in a Chrome browser. I used WireShark to track BLE packets. The disconnection reason is following: "Remote user terminated connection (0x13)".

enter image description here

I have tested web bluetooth on the same windows device with a different GATT server running on my Android phone. In this case it worked well. What can be an issue?

CodePudding user response:

The peripheral is sending a malformed GATT packet.

Packet 163, Read By Group Response, contains 156 bytes of Attribute Protocol data. It contains a list of services, each is 20 bytes, consisting of (start handle, end handle, service uuid). The list contains 7 valid entries. After that follows an entry which is truncated to 14 bytes. That entry should not be present in the list since it does not fit. So, it seems the GATT server software running on the peripheral is buggy.

The client is supposed to continue the search by sending a new Read By Group Request containing a start handle that is 1 of the last retrieved end handle.

  • Related