iBeacon Service

Last Updated on : 2026-04-27 01:21:02Copy for LLMView as MarkdownDownload PDF

Overview

iBeacon is a location-aware feature introduced in iOS 7. It is not physical hardware, but rather a protocol that enables the concept of physical "beacons". Developed by Apple, it is natively supported by iOS and deeply integrated with the mobile operating system.

Devices with Bluetooth Low Energy (BLE) communication capabilities broadcast identification information, and receiving apps perform actions based on the data.

When a phone enters the signal range, it receives the broadcast ID (UUID, Major, and Minor) from the signal source. The app parses the received ID to push notifications or other information to the user.

Application scenarios

Common iBeacon application scenarios include:

Scenario Description
Find phone
Tigger iBeacon broadcast to wake up the app and play a sound for short-range phone locating.
Indoor positioning Enable area ranging and estimate distance using RSS signal to locate objects indoors.
Smart lock Register the geofence service and wake it up with iBeacon. It can automatically unlock when entering the fence area and automatically lock when leaving.
Personal safety alarm Trigger an alarm when encountering robbers or other threats to personal safety. The device emits a loud alarm and activates the mobile app to report SOS messages.
Probe thermometer Detect hazardous elements in food. Trigger iBeacon broadcast to activate the app and send alerts.
Outdoor SOS first aid Use devices such as flashlights or watches. Trigger iBeacon broadcast to activate nearby apps and send SOS signals.
Beacon data reception Deploy multiple beacons in malls or public spaces to trigger app events for marketing or broadcasting.

Features

iBeacon protocol commands:

Command Description
0xA8 iBeacon feature settings

Configure iBeacon (CMD-0xA8)

  • Applicable firmware: Telink-based general firmware.
  • Support standalone iBeacon broadcast or alternating broadcast (iBeacon and pairing broadcast). Use standalone mode for anti-loss scenarios. Use alternating mode to wake up apps, for example, SOS alerts or autolock.
  • The module does not store standalone iBeacon configurations. Actions will not resume after a restart. The module saves alternating iBeacon configurations to Flash memory and resumes the actions after a restart.
  • Reset or unbind clears all iBeacon configurations.

The MCU sends the following data:

No. Length (byte) Field Description
0
1
2 Header 0x55
0xAA
2 1 Version No. 0x00
3 1 CMD 0xA8
4
5
2 Data length 0x00
0x06
6 to 11 6 CFG See the following table.
12 1 CRC8 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

CFG format:

1 byte 1 byte 2 bytes 2 bytes
1 2 3 to 4 4 to 5
operation config_type ibeacon_interval timeout
  • operation:

    • 0x00: Turn off standalone iBeacon.
    • 0x01: Turn on standalone iBeacon (mode 1).
    • 0x02: Turn off alternating iBeacon broadcast.
    • 0x03: Turn on alternating iBeacon broadcast (mode 2).
  • config_type:

    • 0x00: Use the default configuration. Set ibeacon_interval and timeout to 0x00.
    • 0x01: Use the custom configuration. See the fields ibeacon_interval and timeout.
  • ibeacon_interval: The iBeacon advertising interval in low power mode is ibeacon_interval × 100 ms, with a configurable range of 100 ms to 2,000 ms. It is fixed to 100 ms in standard power mode.

    With iBeacon turned on, the advertising interval is as follows:

    • The advertising interval in standard power mode is 100 ms.
    • The advertising interval in low power mode is 500 ms by default, and the timeout is 5 seconds.
    • The iBeacon interval is independent of the advertising interval set by the command 0xE2. With iBeacon turned on, the device advertises with the ibeacon_interval in low power mode.
    • With mode 1 enabled, the device advertises the iBeacon content with the ibeacon_interval.
    • With mode 2 enabled, the device advertises the iBeacon content and Tuya-specific content in turn with the ibeacon_interval. The interval for switching between advertising contents is 1 second (fixed, not configurable). Make sure ibeacon_interval is less than one second.
  • timeout: The iBeacon timeout duration in seconds. The iBeacon service automatically disables after 1 × timeout seconds. The range is 1s to 3,600s. When the timeout is 0xFFFF, it will never time out.

Example

  • Standalone iBeacon: 55 AA 00 A8 00 06 01 00 00 00 00 00 AE
  • Alternating iBeacon: 55 AA 00 A8 00 06 03 00 00 00 00 00 B0

The module returns the following data:

No. Length (byte) Field Description
0
1
2 Header 0x55
0xAA
2 1 Version No. 0x00
3 1 CMD 0xA8
4
5
2 Data length 0x00
0x01
6 1 State Return value
7 1 CRC8 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Return value of state:

  • 0x00: Success
  • Other values: Failure