| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Experimental: Eddystone Beacon Application
This example requires one of the following SoftDevices: S130, S132

Important: Before you run this example, make sure to program the SoftDevice.

The Eddystone Beacon Application is an example that demonstrates advertising with the Eddystone protocol. See the Eddystone GitHub repository for the protocol specification and further information.

The Eddystone protocol describes different formats for advertising packets, called frame types, that can be used to create beacons. The following three frame types are supported by this example application:

- Eddystone-UID for broadcasting unique 16-byte beacon IDs
- Eddystone-URL for broadcasting a URL in a compressed encoding format
- Eddystone-TLM for broadcasting telemetry information about the beacon

Currently, the example supports using only one frame type at a time. By default, the active frame type is the URL frame type. To switch to the UID frame type, do the following changes to the example code:

1. Uncomment the eddystone_uid_data array:
   //static uint8_t eddystone_uid_data[] = /**< Information advertised by the Eddystone UID frame type. */
   //{
   // APP_EDDYSTONE_UID_FRAME_TYPE, // Eddystone UID frame type.
   // APP_EDDYSTONE_RSSI, // RSSI value at 0 m.
   // APP_EDDYSTONE_UID_NAMESPACE, // 10-byte namespace value. Similar to Beacon Major.
   // APP_EDDYSTONE_UID_ID, // 6-byte ID value. Similar to Beacon Minor.
   // APP_EDDYSTONE_UID_RFU // Reserved for future use.
   //};
2. In the advertising_init function, replace `eddystone_url_data` with `eddystone_uid_data`:
   eddystone_data_array.p_data = (uint8_t *) eddystone_url_data; // Pointer to the data to advertise.
   eddystone_data_array.size = sizeof(eddystone_url_data); // Size of the data to advertise.

To switch to the TLM frame type, do the same changes for `eddystone_tlm_data` instead of `eddystone_url_data`.

You can find the source code and the project file of the example in the following folder: `<InstallFolder>\examples\ble_peripheral\experimental_ble_app_eddystone`

# Testing

Test the Eddystone Beacon Application with the Master Control Panel by performing the following steps:

1. Compile and program the application.
2. Start discovery in Master Control Panel.
3. Observe that the beacon application is recognized:
   - In the Master Control Panel PC application, the advertising data contains the following information:

     Field | Value
     --- | ---
     Flags | GeneralDiscoverable, BrEdrNotSupported
     ServicesCompleteListUUID16 | 0xFEAA
     ServiceData | Uuid:0xFEAA Data: 10-EE-00-6E-6F-72-64-69-63-73-65-6D-69-00

   - In the Master Control Panel Android app, the beacon is recognized as Eddystone:
     Eddystone beacon in nRF Master Control Panel