Android BLE Gatt Characteristic WRITE_TYPE_NO_RESPONSE not working

android, bluetooth-lowenergy

Solution

I did run into the same problem when I was trying to do some performance testing and found that when I used the WRITE_TYPE_DEFAULT specifically I stopped getting a response. There might be a bug with the android constants that is causing inverse behavior, but I am not quite not sure.

Problem

I have developed an Android app that connects to a CC2540 BLE peripheral. When I do a Characteristic write of type no response (WRITE_TYPE_NO_RESPONSE), I still get the callback onCharacteristicWrite at the app level. Is this behavior correct? I understand there is probably a low level acknowledgement that occurs between the Android device and the peripheral. But the reason I am asking is because this is causing an issue where I can only send a write once I have received this callback, which is slowing things down in the app. Any light on this behavior would be appreciated it. Thanks,

Original source