- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have seen several threads about MTU in android. Some claiming that the max MTU for android is 23 or so, others claiming it goes up to 512.
I have had some difficulty myself getting to the bottom of this. In fact, I am able to increase MTU considerably close to 512, however the reason for it is unclear.
In my android studio project, I have tried to negotiate the MTU in several locations throughout, with no success in changing MTU and increasing overall data transmision.
However, I find when insert negotiateMTU function into the OnConnectionStateChanged function, as soon as the device connects, I am able to change the MTU and get higher MTU and data transmission.
However, When I try to reduce the MTU, for example if I do not want so much data, I am not able to lower or change.
I should say, negotiateMTU funciton is not doing anything more than mBluetoothGatt.requestMtu(mtuVal); in java.
I would appreciate anyone's insight into this for changing MTU rate of the device. Not sure even if the problem is Psoc Creator Firmware or if this is Android.
Attached are PSOC Creator Firmware and Android Java Class which handles BLE services (search (OnConnectionStateChanged for example)
Solved! Go to Solution.
- Labels:
-
PSoC 4 Architecture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you check for the callback once the MTU has changed to check if it was successful or not? I don't see it in the snippet you shared.
public void onMtuChanged (BluetoothGatt gatt,
int mtu,
int status)
The status should be BluetoothGatt.GATT_SUCCESS if the MTU has been changed successfully.
Regards,
Dheeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you making modifications to the android source code present here: bleapp/AndroidStudio/BLE101 at master · cypresssemiconductorco/bleapp · GitHub
Please clarify to ensure we have the same setup.
Regards,
Dheeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you check for the callback once the MTU has changed to check if it was successful or not? I don't see it in the snippet you shared.
public void onMtuChanged (BluetoothGatt gatt,
int mtu,
int status)
The status should be BluetoothGatt.GATT_SUCCESS if the MTU has been changed successfully.
Regards,
Dheeraj