I am writing gatt_client application, which will read multiple characteristics from service provided by external peripheral.
Well i went through API's, I am able to read the first characteristic of the service, but i am not able to read/write second and third characteristics of same service.
Please someone help me to do the same. Is there any separate API's to read 2nd onward characteristics ?
Read multiple characteristics from service
Re: Read multiple characteristics from service
When you wish to read the value of a characteristic, you can call the esp_ble_gattc_read_char() API. When called, this will send the request to the BLE server asynchronously.
When the response is ready, you receive an ESP_GATTC_READ_CHAR_EVT event which includes the response value. You can call esp_ble_gattc_read_char() any number of times with any number of characteristics owned by the remote service.
For me, I found all the plumbing of this level of BLE programming too much of an overhead and use some C++ classes that encapsulate the BLE story. For me, this simplifies much. See https://esp32.com/viewtopic.php?f=13&t=2330
When the response is ready, you receive an ESP_GATTC_READ_CHAR_EVT event which includes the response value. You can call esp_ble_gattc_read_char() any number of times with any number of characteristics owned by the remote service.
For me, I found all the plumbing of this level of BLE programming too much of an overhead and use some C++ classes that encapsulate the BLE story. For me, this simplifies much. See https://esp32.com/viewtopic.php?f=13&t=2330
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Who is online
Users browsing this forum: No registered users and 63 guests