For Android phones, it is not possible to change the MTU size from default (23 bytes).
Can you please let me know how you verified the write is success after disabling the write long? Did you read back the GATT DB written value? Is it was showing the data which > 20 bytes? Please check it, it would not have updated the GATT DB .
I forgot to mention, that I disabled the Write Long Support in my BLE event callback function by not handling the corresponding events. And yes, I verified this by reading back the written values.
Is the Write Long Support somewhere handled in the stack?
I am also searching for information around this topic. I question the statment you have made regarding android not being able to handle MTU > 23. For example in Cypress' own CySmart Phone app, I can see clearly MTU sending data in larger chunks than 20 for sure (see attached).
I have verified PSOC Creator code works with CySmart laptop application & USB dongle. MTU =500, chunks of data;
I have also verified on android CySmart App that the MTU is negotiated and chunks of data are ~500 I believe. Definitely > 20.
In android App however, some difficulty. When I set MTU value to any number < 20, it seems to function. I change the value using the command mBluetoothGatt.requestMtu(mtu), where MTU is some integer.
When I set the value > 20, 23 for example, I get an error. The way I get the values from the characteristic, are I dynamically instantiate an array of length MTU, and I cycle through a for loop MTU times filling this array with
When I reach ii > 20, I get the error that it is null.
Perhaps there is a better way to do this? But I am also not sure why the characteristic is returning a null value after request.
I guess my question is what does Cypress do in Android CySmart app to handle MTU request?