We are connecting over BLE our mobile application to a remote device we make (not running Android).
It used to work just fine but we now have problems when using Samsung devices with Android 10.
It appears that we can connect to the device and send few small-ish messages, but when trying to send something a bit bigger (around 40 bytes), writing to the BLE characterisics fails. It also results in the BLE connection to be dropped, and impossible to reconnect without killing the app.
Out of curiosity we tried to set the MTU to 23 (instead of the usual 185 we are using normally) and sending the same messages now works again (we have a custom message splitting happening depending on the MTU). No disconnection neither.
The device that we have this problem is Galaxy S10e, the model is SM-G970U1, Android Version is 10.
We have reported this issue to Google, but they suggested us to ask in Samsung developer community as you have your own customized version of the AOSP source code. The issue from Google is https://issuetracker.google.com/issues/147728506
We are using requestMtu in BluetoothGatt to change the MTU to 185, and then onMtuChanged return mtu value is 185 and status Is GATT_SUCCESS.
When we sending the longer message which is about 40 bytes, the return value of writeCharacteristic of BluetoothGatt is true, but the onCharacteristicWrite callback will give us a 133 status code, which is not GATT_SUCCESS. Then the devices will disconnect.
What we expect is to be able to use a bigger MTU so that we can have a higher bandwidth.
If you need more information please let us know, and we are looking forward to hearing from you.