Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52840 PDK Eddystone beacon update

Hello.

I'm modifying the Eddystone Beacon Application example. For now, I can transmit my own Eddystone frame. This frame is static, and the board starts transmitting it because I use the following code:

int main(void)
{
    // Initialize.
    timers_init();
    leds_init();
    scheduler_init();
    power_management_init();
    ble_stack_init();
    conn_params_init();
    nrf_ble_es_init(on_es_evt);

    // Enter main loop.
    for (;;)
    {
        idle_state_handle();
    }
}

With "nrf_ble_es_init (on_es_evt)" the board starts transmitting the beacons. But I want change the transmitted frame (for example, when i push a button). I can't found any function for change the frame after calling "nrf_ble_es_init".

I tried using "es_slot_on_write", but this doesn't work (when I use this, the received frame is empty, it doesn't matter what new frame i use).

I can't found any real documentation about Eddystone library, only brief comments in the code.

I'm using nrf52840 PDK and nRF5 SDK v.15.

Any idea?

Thank you in advance

  • You can find the documentation about the Eddystone example here

    There is no API directly exposed for changing the advertised frame. The reason for this is that the frames are only supposed to be changed periodically as set by the Advertising Interval parameter set per frame slot.

    If you look at `adv_timing_callback` in `es_adv.c` you can see how the time-triggered frame changing works. Re-using some of that code will allow you to do it per button press.

Related