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

Eddystone and ibeacon with Timeslot API

Hi,

(SDK 14.2 , S140 v5.0.2-alpha)

I followed the example in sdk v11 multiactivity_beacon : \examples\ble_peripheral\experimental_ble_app_multiactivity_beacon\hrs_advertiser 

to create my own beacon example. and i successed  to do both application (eddystone and ibeacon) with Timeslot, but separately.

explanation :

i use the softdevice for an other complex advertising so i use the timeslot to create ibeacon advertising format, then an other example to create eddystone format. and 

  * advertisement (SD) + ibeacon (Timeslot) ---> successed

  *advertisement (SD) + eddystone (Timeslot) ---> successed

 *advertisement(SD) +  ibeacon (Timeslot) + eddystone (Timeslot) ---> don't know how to do it !!!

my question is : can i merge the ibeacon (timeslot) and eddystone (timeslot) in one example ?

if yes, how can i proceed ? (like using timer to alternate between the two format)

 

attached : code of ibeacon and eddystone with timeslot.

thanks,

regards,

/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-deea3b8554a648f3ac3367a2674198a0/advertiser_5F00_beacon_5F00_timeslot.c

 

/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-deea3b8554a648f3ac3367a2674198a0/eddystone_5F00_timeslot.c

  • Hi,

     

    Yes, you can merge the two. The logic depends on how you want this to work, but what you can do is to alternate between ibeacon and eddystone frames in the timeslot, or switch between the protocols in every other timeslot.

    I'd recommend looking at the functions that are equal and combine them. After this, check the timeslot logic and do an alteration based on if the timeslot is supposed to be ibeacon or eddystone.

    Same logic applies to the sys_handlers.

     

    Best regards,

    Håkon

  • Hi Håkon,

    Thanks for reply, i followed your advise and effectively i switch between protocols in every timeslot, and it works, but there is a small problem, the advertising intervals for each format is not correct.

    explanation :

    i coded these adv intervals :

    adv_int sofdevice advertisement = 200 ms;

    adv_int ibeacon (timeslot) = 400 ms;

    adv_int eddystone (timeslot)= 1000 ms

    but with nrf connect i see these values : 

    adv_int sofdevice advertisement = 200 ms;

    adv_int ibeacon = 1400 ms;

    adv_int eddystone = 1400 ms

    it seems like there is a sum of adv_int ibeacon and adv_int eddystone somewhere, i checked the code but i don't have any idea where the sum could be ?

    i'll attach my final code, if you can check it and would you tell me where is the problem ?

    thanks,

    regards,

    /cfs-file/__key/communityserver-discussions-components-files/4/advertiser_5F00_beacon_5F00_timeslot.c

  • Hi Tar,

    I'm trying to implement the same on nrf52 using SDK 14 and sd v5.0.0. I'm unable to get advertisement (SD) + ibeacon (Timeslot)  configuration to work. Standalone the timeslot beacon works but when i enable SD advertising I only get the SD advertisement packet. Could you let me know if there are any other configurations to be changed?

    I have also referred to the sdk v11 multiactivity_beacon : \examples\ble_peripheral\experimental_ble_app_multiactivity_beacon\hrs_advertiser 

    Thanks

  • can you send me your code that i can verify it?

  • I've used the exact same code present in advertiser_timeslot.c of the example. I just changed the application code to broadcast the beacon message even if it is not connected. I did this by just calling app_beacon_start in the main function I've added the snippet for reference:

    int main(void)
    {
     
           
        uint32_t err_code;
        bool     erase_bonds;

        // Initialize.
        err_code = app_timer_init();
        APP_ERROR_CHECK(err_code);

        uart_init();
        log_init();

        buttons_leds_init(&erase_bonds);
        ble_stack_init();
        beacon_adv_init();
        gap_params_init();
        gatt_init();
        services_init();
        advertising_init();
        conn_params_init();

        NRF_LOG_INFO("UART Start!");
        err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);
        APP_ERROR_CHECK(err_code);
        
        app_beacon_start();
        // Enter main loop.
        for (;;)
        {
            power_manage();
        }
    }

Related