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

Setting Advertising Parameters

As shown in Table 2, there are five properties to be changed when toggling between regular advertising mode and URL configuration mode.

ADV Event Type can be configured using GAPRole_SetParameter(), with GAPROLE_ADV_EVENT_TYPE as the parameter ID and GAP_ADTYPE_ADV_NONCONN_IND as the value, because regular advertising mode is non-connectable.

ADV Type Flags is an item included in an advertising packet. The GAP_ADTYPE_FLAGS field of the struct variable eddystoneAdv for regular advertising mode is initialized with GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED, because regular advertising mode is non-discoverable.

ADV Interval is set by specifying minimum and maximum intervals for limited and general discoverable ADVs. Typically, all four parameters are set to the same value to get the desired interval as follows:

GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MIN, advInt); GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MAX, advInt); GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MIN, advInt); GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MAX, advInt);

That particular design should select advertising parameters that balance power usage with beacon power use. Using faster advertising intervals allows for quicker discovery by the smart device, while longer intervals allow for longer beacon battery life.

The value from the parameter corresponding with URLCFGSVC_BEACON_PERIOD of the URL configuration service is reflected on advInt. Unit conversion is necessary in this case because the value from the URL configuration service is in millisec, while GAP_SetParamValue() expects a number of 625-microsec ticks. See Section 5.3.2 for more details about URL configuration service. Basically the beacon period from the URL configuration service is supposed to be applied to URL frame advertising. However, it is used for UID as well in this implementation, because no external means to setup the interval for UID is defined in the Eddystone specification. The interval for TLM depends on the interval for UID/URL, because it is based on the number of UID/URL frames that have sent since the last TLM frame in this implementation.

Use the value from the parameters corresponding with URLCFGSVC_ADV_TX_PWR_LVLS and URLCFGSVC_TX_POWER_MODE of the URL configuration service to get the designated TX Power in dBm.

Once all of the above properties are set and the ADV data is updated, advertising is ready to start. Section 5.2.2 describes more about updating ADV data.

Lastly, non-connectable advertising mode is enabled to start sending out the packets at the given rate and power. GAPRole_SetParameter(), with the parameter ID GAPROLE_ADV_NONCONN_ENABLED, is used to start or stop advertising in regular advertising mode.

All the procedures described in this section are done in SimpleEddystoneBeacon_applyConfiguration() and SimpleEddystoneBeacon_startRegularAdv().