SWRA491A September   2015  – October 2016 CC2640 , CC2640R2F , CC2650 , CC2650MODA

 

  1.   Implementing Eddystone™ Bluetooth® Smart Beacons Using the TI BLE-Stack™
    1.     Trademarks
    2. 1 Introduction
    3. 2 Abbreviations
    4. 3 Objective
    5. 4 Project Overview and Prerequisites
    6. 5 Design and Implementation
      1. 5.1 Operation Modes Overview
      2. 5.2 Regular Advertising Mode
        1. 5.2.1 Setting Advertising Parameters
        2. 5.2.2 Populating the Eddystone Frame Payload
      3. 5.3 URL Configuration Mode
        1. 5.3.1 Setting Advertising Parameters
        2. 5.3.2 URL Configuration Service
    7. 6 Test
    8. 7 Summary
    9. 8 References
  2.   Revision History

Populating the Eddystone Frame Payload

Data in UID and URL frames generally don’t need to be changed unless the beacon device has been updated during the last configuration mode operation. The Ranging Data subfield of UID frame and all subfields of URL frame except for Frame Type must be updated upon exiting configuration mode. Updates are implemented in SimpleEddystoneBeacon_applyConfiguration().

TI recommends a few algorithms to generate a 10-byte ID Namespace subfield and a 6-byte ID Instance subfield of UID by the Bluetooth core specification. This implementation example uses some meaningless numbers, but for an actual product, the number assignments in function SimpleEddystoneBeacon_initUID() must be replaced with proper algorithms.

For URL frame, SimpleEddystoneBeacon_encodeURL() facilitates conversion of regular null-terminated string URL into encoded numbers.

TLM frames require special handling compared to UID and URL frames, because the frame data must be updated with the most recent information each time a TLM frame is broadcasted. Updating the TLM payload is done in SimpleEddystoneBeacon_updateTLM().

The battery voltage VBATT subfield can be obtained from AONBatMonBatteryVoltageGet(). To use the battery monitor function, include aon_batmon.h of driverlib.

A constant value is currently used for the temperature TEMP subfield, because the CC2650 LaunchPad does not have a temperature sensor.

The ADV_CNT subfield needs an event from the stack, notifying the application upon completion of each advertising operation. HCI_EXT_AdvEventNoticeCmd() is the API to register an event that is sent upon completion of an ADV send out. Register SEB_ADV_COMPLETE_EVT and check it in the processing loop of stack events that come with the signature of 0xFFFF. The event SEB_ADV_COMPLETE_EVT is eventually processed in SimpleEddystoneBeacon_processAdvCompleteEvt(). This event processing function is not only for counting the number of ADVs, but also which type of Eddystone frame should be sent.

A 1-sec resolution clock tick counter is used, as an example, for SEC_CNT subfield, though the Eddystone spec requires 100-ms resolution. UTC_clock.c, originally used by the TimeApp example project, was added for this. Typically, a TLM frame is supposed to be sent intermittently, so in this example it is sent every 10 seconds by default, allowing for a 1-sec resolution.

When a local Eddystone frame is populated with all necessary information, it must be handed over to the BLE stack. GAPRole_SetParameter(), with the parameter ID GAPROLE_ADVERT_DATA, is used for that purpose.

All the procedures described in this section are handled by SimpleEddystoneBeacon_selectFrame().