Skip to content

56: BLE Scan ​

FieldNameDescriptionType
5MethodRequest a service to be perform an action
Possible values:
  • 1: SET— Set one or more values that are provided in the message payload.
  • 2: GET— Get values for the associated message type.
  • 3: SUBSCRIBE— Subscribe to values for the associated message type. Can be used in conjunction with other header fields to define the subscription parameters, such as Interval, Duration, Timeout, Storage Level and Message Level. If no interval is provided, messages will be sent as and when new data is available. Some data, such as GPS position, may require a set interval to be provided.
  • 5: UNSUBSCRIBE— Unsubscribe from a previous subscription.
uint8
This is an extract of header fields that are relevant to this message type, you can find them all documented in the Headers section.

Payload ​

FieldNameDescriptionTypeUnit
1Advertising Databytes
2MACMAC Address of the access point, as 6 bytesbytes
3RSSISignal strengthint8
4NameDevice name, if availableascii
5Scan ResponseRaw scan response payload, if availablebytes
6Active Scan RequestPerform an active scan, valid only for SUBSCRIBEbool
7Scan IntervalBLE scan interval in 0.625 ms controller units. Omit or set to 0 to retain the ESP default.uint8
8Scan WindowBLE 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
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

Code ​

For convenience, the following constants can be used to reference this message type.