No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT

kpfleming
Posts: 3
Joined: Fri Jun 02, 2023 11:22 am

No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT

Postby kpfleming » Fri Jun 02, 2023 11:25 am

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.

LindaZhang
Posts: 8
Joined: Sat Oct 08, 2022 3:49 am

Re: No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT

Postby LindaZhang » Thu Jun 08, 2023 8:35 am

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.

kpfleming
Posts: 3
Joined: Fri Jun 02, 2023 11:22 am

Re: No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT

Postby kpfleming » Thu Jun 08, 2023 10:54 am

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?

LindaZhang
Posts: 8
Joined: Sat Oct 08, 2022 3:49 am

Re: No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT

Postby LindaZhang » Mon Jun 12, 2023 3:01 am

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.

kpfleming
Posts: 3
Joined: Fri Jun 02, 2023 11:22 am

Re: No callback parameter documented for ESP_GATTC_READ_MULTIPLE_EVT

Postby kpfleming » Mon Jun 12, 2023 10:23 am

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 30 guests