BLE Channel Map for scanning

Posts: 1
Joined: Fri Sep 28, 2018 2:37 pm

BLE Channel Map for scanning

Postby niflizn » Fri Sep 28, 2018 3:23 pm

On another controller we have implemented a small BLE-based mesh using advertising packets.
Low latency (<150ms) and low power is an issue, and we achieve this by letting the nodes synchronize so that they communicate in certain timeslots. Each node transmits an advertisement package with dynamic data in a specific timeslot, while the other nodes listen.

We would like to substitute one of the nodes with an ESP32-based implementation, but are uncertain how to make sure that the radio listens on the correct channel at the right time.

esp_err_t esp_ble_gap_start_advertising(esp_ble_adv_params_t *adv_params)
allows selection of which channels to use for the advertising through

However, there is not a similar option in
esp_err_t esp_ble_gap_set_scan_params(esp_ble_scan_params_t *scan_params)

On our original controller we have this option, but I have not been able to find something similar in ESP-IDF.

I suppose a radio receiver could be made, so that it receives on multiple channels simultaneously. This would render the channel map option obsolete with respect to scanning. However, I suspect this is not the case for the BT controller in ESP32, although I have not been able to find sufficiently detailed information regarding the ESP32 BT controller/radio implementation online.

So my question is this:
Is it possible to start a scan that catches a packet on a specific BLE advertising channel that we know will be sent within a specific short time interval (3msec +/- 1msec) ?

Posts: 1
Joined: Sat Jan 12, 2019 9:41 am

Re: BLE Channel Map for scanning

Postby PSM_EspressIF » Sat Jan 12, 2019 10:16 am

I'm trying to figure out how to choose BLE channel, used by the ESP32 for the current advertisement scan (37, 38 or 39).
I couldn't find any Scanning parameters for it but seems there is option for Advertising parameters as below.

File name: "esp_gap_ble_api.h" ; Line Number : 296
esp_ble_adv_channel_t channel_map; /*!< Advertising channel map */

Since the esp32 changes the channels for scanning in round robin (as far as I know), I'm currently trying to have channel Map parameter in BLE SCAN.!!!!! as per below

File name: "esp_gap_ble_api.h" ; Line Number : 360
/// Ble scan parameters
typedef struct {
esp_ble_scan_type_t scan_type; /*!< Scan type */
esp_ble_addr_type_t own_addr_type; /*!< Owner address type */
esp_ble_scan_filter_t scan_filter_policy; /*!< Scan filter policy */
uint16_t scan_interval; /*!< Scan interval. This is defined as the time interval from
when the Controller started its last LE scan until it begins the subsequent LE scan.
Range: 0x0004 to 0x4000 Default: 0x0010 (10 ms)
Time = N * 0.625 msec
Time Range: 2.5 msec to 10.24 seconds*/
uint16_t scan_window; /*!< Scan window. The duration of the LE scan. LE_Scan_Window
shall be less than or equal to LE_Scan_Interval
Range: 0x0004 to 0x4000 Default: 0x0010 (10 ms)
Time = N * 0.625 msec
Time Range: 2.5 msec to 10240 msec */
esp_ble_scan_duplicate_t scan_duplicate; /*!< The Scan_Duplicates parameter controls whether the Link Layer should filter out
duplicate advertising reports (BLE_SCAN_DUPLICATE_ENABLE) to the Host, or if the Link Layer should generate
advertising reports for each packet received */
} esp_ble_scan_params_t;

Is there any way for this?

Return to “ESP32 IDF”

Who is online

Users browsing this forum: Google [Bot] and 12 guests