Android BLE Gatt Characteristic WRITE_TYPE_NO_RESPONSE not working

I developed an Android app that connects to a CC2540 BLE peripheral device.

When I make a typical โ€œno responseโ€ record (WRITE_TYPE_NO_RESPONSE), I still get the application level onCharacteristicWrite callback. Is this behavior right?

I understand that there is probably a low level confirmation that occurs between the Android device and the peripheral device.

But the reason I ask is because it causes a problem where I can only send once as soon as I received this callback, which slows down the application.

Any light on this behavior will be appreciated by him.

Thanks,

+7
android bluetooth-lowenergy
source share
2 answers

I ran into the same problem when I was trying to do performance testing, and found that when I used WRITE_TYPE_DEFAULT, I stopped getting a response. There may be an error with android constants causing the opposite behavior, but I'm not quite sure.

+6
source share

you can only do 1 transfer at a time at a low level, so you need a callback to let you know when the stack is ready to send another command. If you try to send several one after another without waiting for the interface to be ready, you can seriously destroy the BLE stack! This was happening on earlier iOS CoreBluetooth. If one application splits the BLE stack, then the phone needs to be reset or Bluetooth must be turned off and back on the reset stack. The callback simply tells you that the stack is sending the request over the air interface, not that it was acknowledged by the receiver. For this, you would use a different api, which will cause the BLE Stack to retransmit several times (depending on how the connection parameters were agreed).

The BLE specification clearly states that only 1 transmission can be made at a time.

If you just sketch the API with write requ

+3
source share

All Articles