Closed jonhunterking66 closed 4 years ago
xtensa-esp32-elf-gcc --version
When using a BLE interrogator I cannot receive notifications when using the esp_ble_gatts_send_indicate function
I expect that when I enable notifcations on the BLE scanner app after connection the value will updated as I call esp_ble_gatts_send_indicate
There is no change in value, all I receive is the string built in from the gatts server service table demo [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
Add the following code to the end of the main function:
uint8_t data[20] = {0x66, 0x66}; while (true){ ets_delay_us(100000); ret = esp_ble_gatts_send_indicate(heart_rate_profile_tab[IDX_CHAR_VAL_A].gatts_if, heart_rate_profile_tab[IDX_CHAR_VAL_A].conn_id, heart_rate_handle_table[IDX_CHAR_VAL_A], sizeof(data),data, false); if (ret){ ESP_LOGE(GATTS_TABLE_TAG, "Send indication, error code = %x", ret); return; } data[0] = data[0] + 1; }
Here is the link to the example: https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/bluedroid/ble/gatt_server_service_table
The code I added is above.
Any help is appreciated.
Hi, because the Bluetooth protocol stack runs in freeRTOS, you should use vTaskDelay instead of ets_delay_us, otherwise it will stop the work of BT Stack.
Environment
xtensa-esp32-elf-gcc --version
to find it): 8.2.0Problem Description
When using a BLE interrogator I cannot receive notifications when using the esp_ble_gatts_send_indicate function
Expected Behavior
I expect that when I enable notifcations on the BLE scanner app after connection the value will updated as I call esp_ble_gatts_send_indicate
Actual Behavior
There is no change in value, all I receive is the string built in from the gatts server service table demo [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
Steps to repropduce
Add the following code to the end of the main function:
Here is the link to the example: https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/bluedroid/ble/gatt_server_service_table
The code I added is above.
Any help is appreciated.