Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is ENABLE_INDICATION_VALUE and ENABLE_NOTIFICATION_VALUE in Client Characteristic Configuration Descriptor in ble?

I have been working on an app to read and write data from another BLE device. I don't have any issues going on from the app point of view. Just some of the conceptual doubts I need to clarify. So:

  1. Why do we need the cccd for enabling notification?

  2. Once passing the ENABLE_INDICATION_VALUE, does it enables the notification in the peripheral device?

  3. What is the major difference between ENABLE_INDICATION_VALUE and ENABLE_NOTIFICATION_VALUE while both do the same task that is, sending continuous data to the central device?

like image 525
Animesh Jena Avatar asked Dec 19 '22 01:12

Animesh Jena


1 Answers

  1. The client needs to configure the server if it should enable notifications/indications. Otherwise it won't send anything.

  2. No. The 16-bit descriptor value is a bit field. Currently only two bits are defined: Notification and Indication. You could set both bits and then you should get both a notification and an indication if the server behaves correctly.

  3. A server can send notifications whenever it wants. Possibly even multiple notifications per connection event, which gives high performance. A server can only have one outstanding indication. The client needs to confirm the reception of an indication before the server can send a new one. This gives slow performance compared to notifications. Note that, in my opinion, using indications with Android or iOS as client is kind of useless because the confirmation is sent back by the Bluetooth stack before the app has handled the indication completely. So the confirmation is a "false" confirmation.

like image 168
Emil Avatar answered Jan 05 '23 15:01

Emil