Send BLE notifications Automatically with BLE create table method
Posted: Wed May 22, 2019 5:30 pm
Hello,
I am using the method of create a Bluetooth service.
I have two characteristics, and one of those characteristics has the notifications descriptor (0x2902) snippet below.
How do I notify subscribers of a characteristic that the characteristic has changed (i.e. has been written to)? Is there an API call, e.g. esp_ble_gatts_set_attr_value(), that will automatically send the notification to the connected devices?
I have seen examples using, but that would mean that I have to handle sending the notification in my event handler? Wouldn't that defeat the purpose of ESP_GATT_AUTO_RSP?
I am using the
Code: Select all
esp_ble_gatts_create_attr_tab
I have two characteristics, and one of those characteristics has the notifications descriptor (0x2902) snippet below.
Code: Select all
static uint16_t sCharValueNotifications = 0b01;
...
// Client Characteristic Configuration Descriptor - Enable notifications
[BLE_HANDLE_CHAR_DESCR_NOTIFICATIONS] = {
{ESP_GATT_AUTO_RSP},
{
ESP_UUID_LEN_16,
(uint8_t *)&sUUIDReservedClientConfig,
ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
sizeof(sCharValueNotifications),
sizeof(sCharValueNotifications),
(uint8_t*)&sCharValueNotifications
}
}
I have seen examples using
Code: Select all
esp_ble_gatts_send_indicate