No esp_ble_gap_config_scan_rsp_data() ?

kurtzweber
Posts: 64
Joined: Tue Jan 10, 2017 1:09 pm

No esp_ble_gap_config_scan_rsp_data() ?

Postby kurtzweber » Sun Mar 25, 2018 2:02 pm

Hi

from what I could find, it seems that a function to set the scan response data is missing in the framework.
We do have the corresponding event:

ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT

and we also have a member (set_scan_rsp) in the esp_ble_adv_data_t struct that it seems to suggest that you can create a struct for the scan response packet... but I couldn't find a way to use it.

Of course you can use the corresponding "raw" version: esp_ble_gap_config_scan_rsp_data_raw().

Am I missing something?
Thanks

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: No esp_ble_gap_config_scan_rsp_data() ?

Postby chegewara » Sun Mar 25, 2018 5:15 pm

Hi,
to setup response advertising data its enough to set this value to true:
set_scan_rsp in the esp_ble_adv_data_t

If its set to false it will setup normal advertising data.

kurtzweber
Posts: 64
Joined: Tue Jan 10, 2017 1:09 pm

Re: No esp_ble_gap_config_scan_rsp_data() ?

Postby kurtzweber » Mon Mar 26, 2018 6:44 am

Hi

thanks for your response.
How can I pass the two structs to the driver? I have to call the function esp_ble_gap_config_adv_data(&adv_data) twice?

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: No esp_ble_gap_config_scan_rsp_data() ?

Postby chegewara » Mon Mar 26, 2018 2:32 pm

Yes, you need to call esp_ble_gap_config_adv_data twice. One time with adv_data as parameter and one time with scan_rsp_data.
https://github.com/espressif/esp-idf/bl ... emo.c#L327
https://github.com/espressif/esp-idf/bl ... emo.c#L333

And again, here is parameter that tells which one is scan response and which one is not:
https://github.com/espressif/esp-idf/bl ... emo.c#L100
https://github.com/espressif/esp-idf/bl ... emo.c#L116

All other parameters you can set as you wish.

kurtzweber
Posts: 64
Joined: Tue Jan 10, 2017 1:09 pm

Re: No esp_ble_gap_config_scan_rsp_data() ?

Postby kurtzweber » Mon Mar 26, 2018 3:17 pm

thanks again, it works fine!

Who is online

Users browsing this forum: Baidu [Spider] and 87 guests