Page 1 of 1

No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT

Posted: Fri Jun 02, 2023 11:25 am
by kpfleming
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.

Re: No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT

Posted: Thu Jun 08, 2023 8:35 am
by LindaZhang
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.

Re: No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT

Posted: Thu Jun 08, 2023 10:54 am
by kpfleming
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?

Re: No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT

Posted: Mon Jun 12, 2023 3:01 am
by LindaZhang
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

Posted: Mon Jun 12, 2023 10:23 am
by kpfleming
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.