56: BLE Scan
Header
| Field | Name | Description | Type |
|---|---|---|---|
| 5 | Method | Request a service to be perform an action Possible values:
| uint8 |
Payload
| Field | Name | Description | Type | Unit |
|---|---|---|---|---|
| 1 | Advertising Data | bytes | ||
| 2 | MAC | MAC Address of the access point, as 6 bytes | bytes | |
| 3 | RSSI | Signal strength | int8 | |
| 4 | Name | Device name, if available | ascii | |
| 5 | Scan Response | Raw scan response payload, if available | bytes | |
| 6 | Active Scan Request | Perform an active scan, valid only for SUBSCRIBE | bool | |
| 7 | Scan Interval | BLE scan interval in 0.625 ms controller units. Omit or set to 0 to retain the ESP default. | uint8 | |
| 8 | Scan Window | BLE scan window in 0.625 ms controller units. Omit or set to 0 to retain the ESP default. | uint8 |
Examples
Subscribe to BLE scan results
Protocol
3
3
Length
260
26 bytes
Type
560
56 (BLE Scan)
Header Count
30
3
Header Types
571
5, 7, 1
Method
13
3 (SUBSCRIBE)
Duration
41841100
3000 Unit: ms
Message ID
4212700
2004
Payload Count
00
0
Checksum
167130
33447
📡 Real example from RH2 P1 v2296 on 2025-10-14This example is captured from an RH2 device as part of normal communications over I2C with the ESP32 co-processor, where P1 subscribes to BLE scan results from Toit on the ESP32.
BLE scan result
Protocol
3
3
Length
640
64 bytes
Type
560
56 (BLE Scan)
Header Count
20
2
Header Types
31
3, 1
Response to
4212700
2004
Message ID
481000
81
Payload Count
30
3
Payload Types
123
1, 2, 3
Advertising Data
2833159254232215925400000000000000000000
3,3,159,254,23,22,159,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
MAC
6787878838130
78,78,78,83,8,130
RSSI
1168
-88
Checksum
937
9481
📡 Real example from RH2 ESP32 Toit on 2025-10-14This example is captured from an RH2 device as part of normal communications over I2C with the ESP32 co-processor, after BLE scan results were subscribed to from P2, and a BLE device was found, sent back to P1.
Code
For convenience, the following constants can be used to reference this message type.