This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Stopping Eddystone advertisements

I am using Thingy (nrf52832) to advertise Eddystone UID and TLM packets in bursts. On a given event advertising starts with an interval of 200ms, then stops after specified amount of time. This sort of works. The problem is that after stopping, TLM packets are still advertised every ~10 seconds. I want to fully stop the advertising when the burst is complete.

I am using the eddystone library from Thingy SDK v2.1.0, and used the example "ble_app_eddystone" from NRF52 SDK v13.1.0 for guidance.

To stop advertising, I am using the following function from es_adv.h:

static void adv_stop(void)
{
ret_code_t err_code;

err_code = sd_ble_gap_adv_stop();
if (err_code != NRF_ERROR_INVALID_STATE)
{
APP_ERROR_CHECK(err_code);
}

es_adv_timing_stop();
}

As I understand it, this function should stop the eddystone advertising timers and disable advertising in the softdevice.

I noticed that when the intended advertisements are completed the eddystone event callback is called. This does not occur when the uninteded advertisements are sent, which leads me to believe that advertising in the softdevice has not been disabled.

I have tried playing around with the parameters in es_app_config.h to see if I can stop or change the frequency of the unintended advertising, without any success.

Any ideas?

  • When I call adv_stop() the default frame (which I have configured to be UID) stops. However, I've added an additional frame (TLM), and this frame is still advertised (at a lower frequency) after calling adv_stop(). I know the chip is not resetting, as I use an RTT debugger to monitor the activity.

    Maybe I have added the TLM frame in the wrong way. I used the function 'configure_slot(uint8_t slot_no, uint8_t length, uint8_t * p_frame_data) ' to set it up. 

    Anyways, I have setup the timeslot functionality instead. This works like a charm! I'm not going to spend more time debugging my issue with the other eddystone library, so will mark your first reply as the correct one.

    Thanks for the help!

Related