Channel Information of GAP Scan Events

FredoTorpedo
Posts: 3
Joined: Fri Oct 09, 2020 2:10 pm

Channel Information of GAP Scan Events

Postby FredoTorpedo » Fri Oct 09, 2020 2:23 pm

Hello there,

I'm new to the ESP32 and microcotroller community and this is my first post.

I'm using the Observer Example of Espressif to gather Beacon data with the ESP32 WROOM.
I'm using the ESP-IDF with VSCode. The BT Stack I'm using is BLUEDROID.
And it works pretty well though.

Today I was trying to figure out if its possible to gather information about the channel on which an advertisement packages was received, but I could not find any information on how to do that.
It also was not possible to figure out on which channel the ESP is actually listening.

Is there a workflow for this feature? Does it even exist?
If not does anybody know if somthing like that is planned in the near future?


Thanks for your help in advance.

Cheers,
FredoTorpedo

ESP_XieWX
Posts: 27
Joined: Fri Jun 22, 2018 7:39 am

Re: Channel Information of GAP Scan Events

Postby ESP_XieWX » Thu Oct 29, 2020 9:35 am

Scanning channel, the bottom layer will automatically switch, the application layer is unable to obtain the scanning channel information

FredoTorpedo
Posts: 3
Joined: Fri Oct 09, 2020 2:10 pm

Re: Channel Information of GAP Scan Events

Postby FredoTorpedo » Tue Dec 05, 2023 4:54 pm

I solved it with this: Tested it with an advertising ESP and a receiving ESP. Couldn't receive when the channel setting did not match.
typedef enum

Code: Select all

{
   SCAN_ALL_CHANNEL = 0,
   ONLY_SCAN_CHANNEL_37,
   ONLY_SCAN_CHANNEL_38,
   ONLY_SCAN_CHANNEL_39,
}
scan_mode_config_t;
extern scan_mode_config_t scan_channel_setting(scan_mode_config_t scan_mode);
Before calling the API(esp_ble_gap_start_scanning), Call function(scan_channel_setting) to set scan channel.
Source: https://github.com/espressif/esp-idf/is ... -705937243

Who is online

Users browsing this forum: No registered users and 125 guests