No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT
No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT
I'd like to use the READ_MULTIPLE function, but the documentation (for version 4.4.3) doesn't describe the structure of the parameter supplied to the callback.
-
- Posts: 8
- Joined: Sat Oct 08, 2022 3:49 am
Re: No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT
Hi, the params of the event ESP_GATTC_READ_MULTIPLE_EVT is struct gattc_read_char_evt_param (same as ESP_GATTC_READ_CHAR_EVT). Related header file will be updated soon.
In addition, you can deal with this event by adding it to the function gattc_profile_event_handler. See the example https://github.com/espressif/esp-idf/tr ... att_client for more details.
In addition, you can deal with this event by adding it to the function gattc_profile_event_handler. See the example https://github.com/espressif/esp-idf/tr ... att_client for more details.
Re: No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT
If I'm understanding this correctly, if I issue a read_multiple request, I will receive one READ_MULTIPLE_EVT for each characteristic that is read?
I tried that once already and the handle reported in the callback didn't match any of the handles that I had requested in the read_multiple request. Is the handle in the callback parameter actually an index into the esp_gattc_multi_t structure, instead of the real GATT handle?
I tried that once already and the handle reported in the callback didn't match any of the handles that I had requested in the read_multiple request. Is the handle in the callback parameter actually an index into the esp_gattc_multi_t structure, instead of the real GATT handle?
-
- Posts: 8
- Joined: Sat Oct 08, 2022 3:49 am
Re: No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT
Hi, if you issue a read multiple request, you will receive only one ESP_GATTC_READ_MULTIPLE_EVT for all characteristics. The callback param contains the value of each characteristic (set of values, no longer than ATT_MTU-1) but doesn't contain the handle of each characteristic.
Re: No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT
OK, thank you, that is very helpful. It appears that in fact the 'handle' argument in the callback parameter is the number of responses that have been provided.
Who is online
Users browsing this forum: No registered users and 18 guests