I developed an application for android and another application on the TI cc2650. It's a BLE application. In this app the SP acts as the Central device and the CC2650 acts as the peripheral.
At the beginning, on the android side after discovering the services and subscribing to the characteristic on which i read values from the cc2650, I am calling requestMtu(myDesiredNewMtu)
, after which the cc2650 responds with the event ATT_MtuUpdatedEvt
with the negotiated MTU and then on the android side I get the callback onMtuChanged()
in the BluetoothGattCallback
with the final MTU value and with status (usually success).
But for the current situation I would like the CC2650 to begin the MTU negotiation. So I send from the CC2650 ATT_ExchangeMTUReq
with the desired MTU and what happens is that the android responds with "OK the new MTU is good, let's work with it (ATT_ExchangeMTURsp with the negotiated MTU)" but then the callback
on the android onMtuChanged()
is NOT CALLED!
So I have no idea what's the final negotiated MTU to work with??
Yes!
That's how Android's APIs are built currently, unfortunately...
You could have a notification characteristic where you send the MTU to the Android device as a workaround. But why do you need to do the MTU negotiation from the peripheral side? Doing it from the Android side should be the preferred way.