capacitor-community/bluetooth-le

Negotiated MTU size keeps changing after each new connection

JoshuaBThompson opened this issue · 1 comments

Describe the bug
Whenever I connect to my BLE peripheral from my web app using the capacitor ble plugin the negotiated mtu size keeps changing and gets larger and larger. This does not happen when I connect with google chromes Web Bluetooth sample code online (see Additional Context for link)

To Reproduce
Steps to reproduce the behavior:

  1. npm run server and open web browser / localhost
  2. click connect button on web app
  3. connect to available BLE peripheral (in this case an ESP32 microcontroller running micropython)
  4. peripheral tries to negotiate 128 bytes (for ex)
  5. Print out the negotiated mtu size
  6. first time I print out the mtu it's 31
  7. disconnect and then reconnect, mtu size is now 100
  8. disconnect and then reconnect, mtu size is now something like 123
  9. Keep repeating and mtu size keeps increasing by 23 bytes

Expected behavior

  • mtu size negotiated should be 128 bytes and not keep increasing on each connection

Plugin version:

  • @capacitor-community/bluetooth-le: [e.g. 0.4.0]
  • @capacitor-community/bluetooth-le: "1.8.3"

Desktop (please complete the following information):

  • OS: Mac OS Monterey 12.2.1
  • Browser: Chrome
  • Version: 109.0.5414.119 (Official Build) (x86_64)

Additional context
I've used google Web Bluetooth sample connect to connect to my BLE peripheral and the mtu size is accurate (I negotiate mtu size of 100 for example) and does not change

ex: https://googlechrome.github.io/samples/web-bluetooth/device-disconnect.html

closing this ticket, has been resolve