HCI H4: Simultaneous BLE Scanning/Advertising

danergo
Posts: 20
Joined: Fri Aug 06, 2021 2:50 pm

HCI H4: Simultaneous BLE Scanning/Advertising

Postby danergo » Wed Dec 17, 2025 7:54 am

I'm using an ESP32 on full UART @921kbps to provide Bluetooth capabilities for my Linux machine:
/usr/bin/btattach -S 921600 -B /dev/ttyS10

Linux machine then uses BlueZ to manage all BT-related functions.

Everything works smooth. :)

Most of the time the controller spends its duty in BLE Ad scanning (activated by BlueZ on HCI):

This is from a btmon output:
HCI Command: LE Set Scan Enable
I wish now not just scanning ads, but also advertising.

(How) Can I do it with ESP32 as a HCI BT processor or it will introduce massive problems?

Thank you!

lichurbagan
Posts: 60
Joined: Thu Nov 13, 2025 3:20 pm

Re: HCI H4: Simultaneous BLE Scanning/Advertising

Postby lichurbagan » Fri Dec 19, 2025 7:42 am

You can advertise and scan only if BlueZ controls both via HCI. You can do this only if your ESP32 controller firmware actually supports concurrent operations.
If the ESP32 is limited to legacy advertising, scanning and advertising are mutually exclusive, and advertising will stop once scanning is enabled.
Running ESP32-side advertising while BlueZ is scanning will break the HCI model and should be avoided.

Who is online

Users browsing this forum: Qwantbot and 5 guests