UFO Beacons Documentation

What is a BLE Beacon

Beacons are Bluetooth 4.0 devices which keep on broadcasting a set of information at a regular interval. This information includes parameter which helps the phone to determine the distance between itself and the beacons. Using this feature combined with other information we can determine the distance between the beacon and the phone. A simple software algorithm over the phone app can help determine if the phone is moving close to the set beacon or away. Using this distance ranging the smartphone can precisely know where it is so that an app can act on the specific location.

Beacon Formats

iBeacon and Eddystone are the primary beacon formats devised by Apple and Google respectively. The Eddystone format offers variants - Eddystone UID, Eddystone URL, Eddystone TLM and Eddystone EID.

Apple announced iBeacon (protocol/firmware) in December 2013.

  • iBeacon works with iOS, Android or any mobile device which supports Bluetooth 4.0 or higher
  • iBeacon transmits a UUID (16 digit string of numbers), Major (4 digits) and Minor (4 digits). That's it. Nothing else. They aren't mini-servers or tracking devices. Beacons themselves do not track anything. Apps do the tracking if that's what they are programmed to do.
  • iBeacon requires an app to receive that specific UUID to be able to engage.
  • The UUID is typically the same for all iBeacons working with a specific app. The "Major" and "Minor" IDs are used to identify each beacon uniquely.

The advertising packet format for an iBeacon as implemented by UFO Beacon is tabulated below -

iBeacon Advertising Packet

Byte Default value Description Properties
1 02 Data length - 2 bytes constant preamble
2 01 Data type - flags constant preamble
3 06 LE and BR/EDR flag constant preamble
4 1a Data length - 26 bytes constant preamble
5 ff Data type - manufacturer specific data constant preamble
6 4c Manufacturer data constant preamble
7 00 Manufacturer data constant preamble
8 02 Manufacturer data constant preamble
9 15 Manufacturer data constant preamble
10 4B Proximity UUID byte 1 Preconfigured and can be modified by User
11 54 Proximity UUID byte 2 Preconfigured and can be modified by User
12 50 Proximity UUID byte 3 Preconfigured and can be modified by User
13 4C Proximity UUID byte 4 Preconfigured and can be modified by User
14 55 Proximity UUID byte 5 Preconfigured and can be modified by User
15 46 Proximity UUID byte 6 Preconfigured and can be modified by User
16 4F Proximity UUID byte 7 Preconfigured and can be modified by User
17 00 Proximity UUID byte 8 Preconfigured and can be modified by User
18 00 Proximity UUID byte 9 Preconfigured and can be modified by User
19 00 Proximity UUID byte 10 Preconfigured and can be modified by User
20 00 Proximity UUID byte 11 Preconfigured and can be modified by User
21 00 Proximity UUID byte 12 Preconfigured and can be modified by User
22 00 Proximity UUID byte 13 Preconfigured and can be modified by User
23 00 Proximity UUID byte 14 Preconfigured and can be modified by User
24 00 Proximity UUID byte 15 Preconfigured and can be modified by User
25 01 Proximity UUID byte 16 Preconfigured and can be modified by User
26 XX Major byte 1 Value set for Major
27 XX Major byte 2 Value set for Major
28 XX Minor byte 1 Value set for Minor
29 XX Minor byte 2 Value set for Minor
30 XX Tx Power 2's Complement of Tx Power
Note : 4c 00 02 15 is Apple's identifier for iBeacon

Tx Power Table for iBeacon

Power Level DBm RSSI at 1 meter 2's Complement (in Hex)
1 -18 -92 0xA4
2 -12 -84 0xAC
3 -6 -72 0xB8
4 -3 -68 0xBC
5 -2 -67 0xBD
6 -1 -66 0xBE
7 0 -65 0xBF
8 +3 -60 0xC4

Scan response packet structure for iBeacon

Byte Default value Description Properties
1 04 Data Length - 4 bytes Device Name is fixed UFO
2 09 Data type - complete local name Fixed
3 55 Set device name Fixed
4 46 Set device name Fixed
5 4F Set device name Fixed
6 02 Data Length - 2 bytes Fixed
7 0A Data type - Tx power level Fixed
8 XX Tx Power value Set Tx power value
9 0C Data Length - 12 bytes Fixed
10 16 Data Type - Service Data Fixed
11 54 Service UUID Fixed
12 4B Service UUID Fixed
13 55 Mac ID 1st byte Device MAC ID - Fixed
14 46 Mac ID 2nd byte Device MAC ID - Fixed
15 4F Mac ID 3rd byte Device MAC ID - Fixed
16 XX Mac ID 4th byte Device MAC ID
17 XX Mac ID 5th byte Device MAC ID
18 XX Mac ID 6th byte Device MAC ID
19 XX Battery Voltage in Millivolt per bit format Battery Voltage
20 XX Battery Voltage in Millivolt per bit format Battery Voltage
21 XX Current Temperature in HEX Temperature with 1 degree resolution

Eddystone

The Eddystone protocol specification defines a Bluetooth low energy (BLE) message format for beacons. It describes the following 4 frame types that can be used individually or in combinations to create beacons that can be used for a wide variety of applications.

  1. Eddystone UID

    The Eddystone-UID frame broadcasts an opaque, unique 16-byte Beacon ID composed of a 10-byte namespace and a 6-byte instance. The namespace portion of the ID may be used to group a particular set of beacons, while the instance ID identifies individual devices in the group.

  2. Eddystone URL

    The Eddystone-URL frame broadcasts a URL using a compressed encoding format in order to fit more within the limited advertisement packet.The Eddystone-URL frame forms the backbone of the Physical Web, an effort to enable frictionless discovery of web content relating to one's surroundings.Once decoded, the URL can be used by any client with access to the internet.

  3. Eddystone TLM

    The Eddystone-TLM frame broadcasts telemetry information about the beacon itself such as battery voltage, device temperature, and counts of broadcast packets.

  4. Eddystone EID

    The Eddystone-EID frame broadcasts an encrypted ephemeral identifier that changes periodically at a rate determined during the initial registration with a web service. The broadcast ephemeral ID can be resolved remotely by the service with which it was registered, but to other observers appears to be changing randomly. This frame type is intended for use in security and privacy-enhanced devices.

The above message formats offer following possible combinations -

  • UID
  • URL
  • TLM
  • UID + TLM
  • URL + TLM
  • EID

The Eddystone advertising packet structures for each of the message formats are tabulated below -

Eddystone UID Advertising Packet

Byte Default value Description Properties
1 0x02 Data length - 2 bytes constant preamble
2 0x01 Data type - flags constant preamble
3 0x06 LE and BR/EDR flag constant preamble
4 0x03 Length constant preamble
5 0x03 Data type value constant preamble
6 0xAA Eddystone Service UUID constant preamble
7 0xFE Eddystone Service UUID constant preamble
8 XX Length constant preamble
9 0x16 Service Data data type value constant preamble
10 0xAA Eddystone Service UUID constant preamble
11 0xFE Eddystone Service UUID constant preamble
12 0x00 Frame Type Value for Eddystone UID constant preamble
13 XX TX Power 2's Complement of Calibrated TX Power at 0 m
14 4B 10-byte Namespace NID[0] Preconfigured and can be modified by User
15 54 10-byte Namespace NID[1] Preconfigured and can be modified by User
16 50 10-byte Namespace NID[2] Preconfigured and can be modified by User
17 4C 10-byte Namespace NID[3] Preconfigured and can be modified by User
18 55 10-byte Namespace NID[4] Preconfigured and can be modified by User
19 46 10-byte Namespace NID[5] Preconfigured and can be modified by User
20 4F 10-byte Namespace NID[6] Preconfigured and can be modified by User
21 00 10-byte Namespace NID[7] Preconfigured and can be modified by User
22 00 10-byte Namespace NID[8] Preconfigured and can be modified by User
23 00 10-byte Namespace NID[9] Preconfigured and can be modified by User
24 0x80 6-byte Instance BID[0] Preconfigured and can be modified by User
25 0x4F 6-byte Instance BID[1] Preconfigured and can be modified by User
26 0xC7 6-byte Instance BID[2] Preconfigured and can be modified by User
27 0x00 6-byte Instance BID[3] Preconfigured and can be modified by User
28 0x00 6-byte Instance BID[4] Preconfigured and can be modified by User
29 0x00 6-byte Instance BID[5] Preconfigured and can be modified by User
30 0x00 RFU Reserved for future use, must be 0x00
31 0x00 RFU Reserved for future use, must be 0x00

Eddystone URL Advertising Packet

Byte Default value Description Properties
1 0x02 Data length - 2 bytes constant preamble
2 0x01 Data type - flags constant preamble
3 0x06 LE and BR/EDR flag constant preamble
4 0x03 Length constant preamble
5 0x03 Data type value constant preamble
6 0xAA Eddystone Service UUID constant preamble
7 0xFE Eddystone Service UUID constant preamble
8 XX Length constant preamble
9 0x16 Service Data data type value constant preamble
10 0xAA Eddystone Service UUID constant preamble
11 0xFE Eddystone Service UUID constant preamble
12 0x10 Frame Type Value for Eddystone URL constant preamble
13 XX TX Power Calibrated TX Power at 0 m
14 XX URL Scheme Encoded Scheme Prefix
15 XX Byte 1 Encoded URL upto 17 bytes
16 XX Byte 2 Encoded URL upto 17 bytes
17 XX Byte 3 Encoded URL upto 17 bytes
18 XX Byte 4 Encoded URL upto 17 bytes
19 XX Byte 5 Encoded URL upto 17 bytes
20 XX Byte 6 Encoded URL upto 17 bytes
21 XX Byte 7 Encoded URL upto 17 bytes
22 XX Byte 8 Encoded URL upto 17 bytes
23 XX Byte 9 Encoded URL upto 17 bytes
24 XX Byte 10 Encoded URL upto 17 bytes
25 XX Byte 11 Encoded URL upto 17 bytes
26 XX Byte 12 Encoded URL upto 17 bytes
27 XX Byte 13 Encoded URL upto 17 bytes
28 XX Byte 14 Encoded URL upto 17 bytes
29 XX Byte 15 Encoded URL upto 17 bytes
30 XX Byte 16 Encoded URL upto 17 bytes
31 XX Byte 17 Encoded URL upto 17 bytes

Eddystone TLM Advertising Packet

Byte Default value Description Properties
1 0x02 Data length - 2 bytes constant preamble
2 0x01 Data type - flags constant preamble
3 0x06 LE and BR/EDR flag constant preamble
4 0x03 Length constant preamble
5 0x03 Data type value constant preamble
6 0xAA Eddystone Service UUID constant preamble
7 0xFE Eddystone Service UUID constant preamble
8 XX Length constant preamble
9 0x16 Service Data data type value constant preamble
10 0xAA Eddystone Service UUID constant preamble
11 0xFE Eddystone Service UUID constant preamble
12 0x20 Frame Type Value for Eddystone TLM constant preamble
13 0x00 TLM Version Unencrypted TLM packet
14 XX VBATT[0] Battery voltage, 1 mV/bit
15 XX VBATT[1]
16 XX TEMP[0] Beacon temperature
17 XX TEMP[1]
18 XX ADV_CNT[0] Advertising PDU count
19 XX ADV_CNT[1]
20 XX ADV_CNT[2]
21 XX ADV_CNT[3]
22 XX SEC_CNT[0] Time since power-on or reboot
23 XX SEC_CNT[1]
24 XX SEC_CNT[2]
25 XX SEC_CNT[3]

Eddystone EID Advertising Packet

Byte Default value Description Properties
1 0x02 Data length - 2 bytes constant preamble
2 0x01 Data type - flags constant preamble
3 0x06 LE and BR/EDR flag constant preamble
4 0x03 Length constant preamble
5 0x03 Data type value constant preamble
6 0xAA Eddystone Service UUID constant preamble
7 0xFE Eddystone Service UUID constant preamble
8 XX Length constant preamble
9 0x16 Service Data data type value constant preamble
10 0xAA Eddystone Service UUID constant preamble
11 0xFE Eddystone Service UUID constant preamble
12 0x30 Frame Type Value for Eddystone TLM constant preamble
13 XX TX Power Calibrated TX Power at 0 m
14 XX EID[0] 8-byte Ephemeral Identifier
15 XX EID[1]
16 XX EID[2]
17 XX EID[3]
18 XX EID[4]
19 XX EID[5]
20 XX EID[6]
21 XX EID[7]

Tx Power Table for Eddystone Beacons

Power Level Value DBm RSSI at 1 meter 2's Complement (in Hex)
TX_POWER_MODE_HIGH 3 +3 -62 0xEB
TX_POWER_MODE_MEDIUM 2 0 -65 0xE8
TX_POWER_MODE_LOW 1 -6 -74 0xDF
TX_POWER_MODE_LOWEST 0 -18 -92 0xCD

Scan response packet structure for Eddystone beacons

Byte Default value Description Properties
1 04 Data Length - 4 bytes Device Name is fixed UFO
2 08 Data type - complete local name Fixed
3 55 Set device name Fixed
4 46 Set device name Fixed
5 4F Set device name Fixed
6 09 Data Length - 9 bytes Fixed
7 FF Data Type Fixed
8 B1 Manufacturer's ID Fixed
9 04 Manufacturer's ID Fixed
10 55 Mac ID 1st byte Device MAC ID - Fixed
11 46 Mac ID 2nd byte Device MAC ID - Fixed
12 4F Mac ID 3rd byte Device MAC ID - Fixed
13 XX Mac ID 4th byte Device MAC ID
14 XX Mac ID 5th byte Device MAC ID
15 XX Mac ID 6th byte Device MAC ID