react-native-ble-plx icon indicating copy to clipboard operation
react-native-ble-plx copied to clipboard

Bug Report: MTU prop on device does not seem to reflect correct data

Open da1z opened this issue 3 years ago • 1 comments

Prerequisites

  • [ y] I am running the latest version
  • [ y] I checked the documentation and found no answer
  • [ y] I checked to make sure that this issue has not already been filed

Expected Behavior

Correct mtu returned

Current Behavior

mtu value always 23

Steps to Reproduce

Please provide detailed steps for reproducing the issue. I am testing on ios

  1. connect to device
  2. log device.mtu
  3. you see 23

but I can send messages from peripheral large then 23, up to 500+ length without issues. Am I missing something? i tried connect with requestMtu but it does not change behavior too

da1z avatar Jun 16 '22 22:06 da1z

Hi, I'm encountering the same issue here.

In fact the problem is:

Whatever MTU I request, I'm getting 23. But according to the real communication speed, the negociated MTU seems higher.

The behavior is the following:

device.connect().then((d) => {
  console.log(d.mtu)
});

Result: > 23

device.connect({ requestMTU: 512 }).then((d) => {
  console.log(d.mtu)
});

Result: > 23

Android or iOS, same behavior.

But, I'm sending big files and :

mathieumousnier avatar Aug 31 '22 08:08 mathieumousnier

  • MTU by default is 23
  • iOS devices negotiate automatically MTU value when you connect the device
  • For Android devices, you have to use requestMTU command to change it