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

Parents Reply Children
  • 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();
        }
    }

  • Hi,

    the two advertisements are done but you don't ses it because they are on the same MAC adress, if you want to see those two simultaneously, you must have an other MAC adress, for that you must activate privacy in gap_params_init() function, and it must work,

        
        ble_gap_privacy_params_t ble_gap_privacy_params = {0};
        
        ble_gap_privacy_params.privacy_mode = BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY;
        ble_gap_privacy_params.private_addr_type = BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE;
        ble_gap_privacy_params.private_addr_cycle_s = 900; //adress change cycle
        ble_gap_privacy_params.p_device_irk = NULL;
    
    
        err_code = sd_ble_gap_privacy_set(&ble_gap_privacy_params);
        APP_ERROR_CHECK(err_code);

  • Hi Tar,

    Thanks for the support, it works but don't see it as a separate device.

    This is the only advertisement I get.

    This is my gap_params_init() function

    static void gap_params_init(void)
    {
        uint32_t                err_code;
        ble_gap_conn_params_t   gap_conn_params;
        ble_gap_conn_sec_mode_t sec_mode;
     
        ble_gap_privacy_params_t ble_gap_privacy_params = {0};
        
        ble_gap_privacy_params.privacy_mode = BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY;
        ble_gap_privacy_params.private_addr_type = BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE;
        ble_gap_privacy_params.private_addr_cycle_s = 900; //adress change cycle
        ble_gap_privacy_params.p_device_irk = NULL;


        err_code = sd_ble_gap_privacy_set(&ble_gap_privacy_params);
        APP_ERROR_CHECK(err_code);
            

        BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);

        err_code = sd_ble_gap_device_name_set(&sec_mode,
                                              (const uint8_t *) DEVICE_NAME,
                                              strlen(DEVICE_NAME));
        APP_ERROR_CHECK(err_code);

        memset(&gap_conn_params, 0, sizeof(gap_conn_params));

        gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
        gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
        gap_conn_params.slave_latency     = SLAVE_LATENCY;
        gap_conn_params.conn_sup_timeout  = CONN_SUP_TIMEOUT;

        err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
        APP_ERROR_CHECK(err_code);
                                              

    }

Related