| Supported Targets | ESP32-H4 | ESP32-S31 |
|---|
BIG Receiver
(See the README.md file in the upper level examples directory for more information about examples.)
Overview
This example demonstrates a raw BLE Isochronous Broadcast Receiver — it joins a Broadcast Isochronous Group (BIG) directly at the ISO transport layer over the NimBLE host, without any BLE Audio profile (BAP/CAP) on top.
The device acts as the receiver (BIG sync sink): it scans for an extended advertiser by device name, synchronises to the peer's periodic advertising train, parses the BIGInfo report, and then issues LE BIG Create Sync to join two BIS sub-events. An HCI output data path is installed on each BIS and incoming SDUs are accounted for by a small RX-metrics helper.
The payloads received are application-supplied dummy data produced by big_broadcaster; this example does not decode LE-Audio / LC3 — the coding format on the data path is ESP_BLE_ISO_CODING_FORMAT_TRANSPARENT.
Requirements
- A board with BLE 5.2 and ISO support (e.g. ESP32-H4, ESP32-S31)
- Peer device running the paired example
Configuration
idf.py menuconfig
No build-time options — runtime defaults are baked into source.
Notable hard-coded parameters in main/main.c:
TARGET_DEVICE_NAME—"BIG Broadcaster"(matched against the AD complete-name field)TARGET_BROADCAST_CODE—"1234"(must match the broadcaster)SCAN_INTERVAL/SCAN_WINDOW— 100 ms / 100 ms (passive)PA_SYNC_TIMEOUT— 10 sBIG_SYNC_TIMEOUT— 1 sBIS_ISO_CHAN_COUNT— 2
Security & Pairing
The shared init at ../common_components/example_init/ble_iso_example_init.c configures Just-Works pairing (LE Secure Connections, no MITM, BLE_SM_IO_CAP_NO_IO) with bonding enabled, and leaves gatts_register_cb = NULL (no GATT services). These settings are not exercised by this example — the receiver passively syncs to PA + BIS without ATT or pairing.
Build & Flash
idf.py set-target esp32h4
idf.py -p PORT flash monitor
(Exit serial monitor with Ctrl-].)
Example Flow
- NVS, NimBLE host, and the ISO common layer are initialised; a GAP application callback is registered for ISO-related GAP events.
- Passive extended scanning is started via
ble_gap_disc(). - On each
EXT_SCAN_RECVthe AD payload is parsed; if the complete-name field equals"BIG Broadcaster"and the report carries a non-zero periodic-advertising interval,ble_gap_periodic_adv_sync_create()is called. - On
PA_SYNCsuccess the extended scan is cancelled (BIGInfo arrives over the PA channel anyway). - On the first
BIGINFO_RECVevent the receiver fillsesp_ble_iso_big_sync_param_t(both BIS inbis_bitfield, broadcast code"1234", MSE =nsefrom BIGInfo) and callsesp_ble_iso_big_sync()— the HCILE BIG Create Synccommand. - When each BIS becomes ready, the connected callback resets that BIS's RX metrics and installs an HCI output data path (
ESP_BLE_ISO_DATA_PATH_DIR_OUTPUT, transparent coding). - Each
recvcallback updates the per-BIS counters; one log line is emitted everyLOG_INTERVAL_PACKETSSDUs. - On BIS disconnect or PA-sync-lost the receiver clears its sync state and restarts extended scanning.
Expected Log
Tag: BIG_SNC.
Discovery and PA sync:
I (xxx) BIG_SNC: Scanning for broadcaster...
I (xxx) BIG_SNC: PA synced: handle <h> sid <s> phy <p> peer xx:xx:xx:xx:xx:xx
BIS bring-up:
I (xxx) BIG_SNC: [BIS #0] Connected
I (xxx) BIG_SNC: [BIS #1] Connected
Steady-state (logged every LOG_INTERVAL_PACKETS SDUs by the shared RX helper):
I (xxx) BIG_SNC: [BIS #0] RX: <N> packets
I (xxx) BIG_SNC: [BIS #1] RX: <N> packets
Teardown / re-sync (broadcaster disappears or restarts; reason 0x08 is the typical timeout, 0x3D is the rare MIC-fail race documented in source):
I (xxx) BIG_SNC: [BIS #0] Disconnected, reason 0x08
I (xxx) BIG_SNC: [BIS #1] Disconnected, reason 0x08
I (xxx) BIG_SNC: PA sync lost: sync_handle <h> reason 0x<rr>
I (xxx) BIG_SNC: Scanning for broadcaster...
Peer Pairing
Run big_broadcaster on a second board.
- Flash and run
big_broadcasteron board A; it begins extended + periodic advertising and creates the BIG. - Flash and run
big_receiveron board B; it logsScanning for broadcaster...and waits. - Board B matches the AD name
"BIG Broadcaster", creates a PA sync, logsPA synced, and stops the extended scan. - On the first BIGInfo report, board B issues
LE BIG Create Syncwith broadcast code"1234"and both BIS selected; both sides log[BIS #0/1] Connected. - Per-BIS RX-packet milestones are logged on B at the same cadence that A logs TX milestones.
- Resetting board A causes B to log a BIS disconnect and
PA sync lost, then automatically restart scanning to re-pair.