BBF — Bluetooth Beacon Scan
Performs an on-demand BLE (Bluetooth Low Energy) beacon scan for a configurable duration and returns the list of discovered devices.
Format
- Set:
>SBBFxx< - Query:
>QBBF< - Response:
>RBBFxx;y;name1,A1,addr1;name2,A2,addr2;...<
Parameters
| Parameter | Type | Description |
|---|---|---|
xx | Integer (01–99) | Scan duration in seconds. Value 00 is invalid. |
Response Fields
| Field | Description |
|---|---|
xx | Configured scan duration in seconds (zero-padded). |
y | Scan status: 1 = scan is still running, 0 = scan has finished. |
name | Device advertised name. It is empty if device does not broadcast a name. |
A | Address type: 0 = public address, 1 = random address. |
addr | 12-character lowercase hexadecimal Bluetooth address (no colons). |
The response lists up to 20 unique beacons. Duplicate addresses are suppressed automatically.
Examples
Start a 10-second scan:
>SBBF10<
>RBBF10;ID=351234567890123<
Query while scan is still running:
>QBBF<
>RBBF10;1;ID=351234567890123<
Query after the scan finishes (two beacons found):
>QBBF<
>RBBF10;0;P RHT 90251E,0,703bf221d4d5;,1,6f24996da077;ID=351234567890123<
Notes
- A new scan clears the previous results.
- Issuing
>SBBFxx<while a scan is already active returns errorER51(already in progress). - Results are held in memory only and are not persisted across reboots.