change MTU of PSOC4

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
JeCr_2235141
Level 2
Level 2
10 replies posted 5 replies posted 10 questions asked

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)

0 Likes
1 Solution
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

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

View solution in original post

0 Likes
2 Replies
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

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

0 Likes
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

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

0 Likes