BLE notification & Indications
Posted: Thu Feb 16, 2017 2:45 pm
Hi,
Starting from bluetooth/gatt_server example I have make some modifications to achieve a 'propietary' service that is composed of a characteristic and its client characteristic configuration descriptor (cccd).
From the client side I am able to read/write values into CCCD to enable notifications or indications correctly.
Using "esp_ble_gatts_send_indicate" function I can send notifications or indications depending on the "bool need_confirm" parameter value. Regardless of cccd value I can send notifications or indications. There is no control between cccd value and the ability to use or send notifications or indications.
1 . -This control must be done at application level? I am not 100% sure if CCCD are optional or not so that is one of my doubts. The stack has to control if a client is subscribed to a characteristic or is the app the one who has to do this kind of work?
I have also tried to set the characteristic with and without the notify and/or indicate properties set. And If I set the characteristic without any of those properties (ESP_GATT_CHAR_PROP_BIT_NOTIFY | ESP_GATT_CHAR_PROP_BIT_INDICATE props are not set) but I try to send a notification or indication with "esp_ble_gatts_send_indicate" there is no problem and the data arrives at the client. It has no sense that if that characteristic does not have notify or indicate properties set the "esp_ble_gatts_send_indicate" function still sends data, it must return a state or status error.
2.- This functionality is not implemented, is a bug or the application must control also this situation?
Can you clarify these doubts about notification/indication? Thanks in advance.
Starting from bluetooth/gatt_server example I have make some modifications to achieve a 'propietary' service that is composed of a characteristic and its client characteristic configuration descriptor (cccd).
From the client side I am able to read/write values into CCCD to enable notifications or indications correctly.
Using "esp_ble_gatts_send_indicate" function I can send notifications or indications depending on the "bool need_confirm" parameter value. Regardless of cccd value I can send notifications or indications. There is no control between cccd value and the ability to use or send notifications or indications.
1 . -This control must be done at application level? I am not 100% sure if CCCD are optional or not so that is one of my doubts. The stack has to control if a client is subscribed to a characteristic or is the app the one who has to do this kind of work?
I have also tried to set the characteristic with and without the notify and/or indicate properties set. And If I set the characteristic without any of those properties (ESP_GATT_CHAR_PROP_BIT_NOTIFY | ESP_GATT_CHAR_PROP_BIT_INDICATE props are not set) but I try to send a notification or indication with "esp_ble_gatts_send_indicate" there is no problem and the data arrives at the client. It has no sense that if that characteristic does not have notify or indicate properties set the "esp_ble_gatts_send_indicate" function still sends data, it must return a state or status error.
2.- This functionality is not implemented, is a bug or the application must control also this situation?
Can you clarify these doubts about notification/indication? Thanks in advance.