Hi,
I'm running through the various GATT server examples, YouTube, forums, etc.... but can't see how to do the following:
1. Read the value of a characteristic from my IDF code
2. Change the value of a characteristic from my IDF code, and have that updated out to the client (notification)
Is there a sample project out there that can point me in the right direction?
Thanks.
BLE GATT - Read/Change Char value from IDF side
Re: BLE GATT - Read/Change Char value from IDF side
I've found what I need:
But these require the attribute handle (attr_handle), how do I get the handle when I have created the attributes via the table method:
Any pointers appreciated.
Code: Select all
esp_err_t esp_ble_gatts_set_attr_value(uint16_t attr_handle, uint16_t length, const uint8_t *value)
esp_gatt_status_t esp_ble_gatts_get_attr_value(uint16_t attr_handle, uint16_t *length, const uint8_t **value)
Code: Select all
esp_err_t create_attr_ret = esp_ble_gatts_create_attr_tab(gatt_db, gatts_if, HRS_IDX_NB, SVC_INST_ID);
Re: BLE GATT - Read/Change Char value from IDF side
I'm using Kolban's open source library to do just that.
https://github.com/nkolban/esp32-snippe ... /cpp_utils
John A
https://github.com/nkolban/esp32-snippe ... /cpp_utils
John A
Re: BLE GATT - Read/Change Char value from IDF side
Thanks chegewara and fly123, I'm getting there now.
Si.
Si.
Who is online
Users browsing this forum: No registered users and 96 guests