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

Advertise connectable Eddystone slots

Hi,

The eddystone example enter to connectable mode by press a button, but our customer don't want to press button one by one,  they hope the beacon can advertise eddystone slots(UID and TLM and URL) in connectable mode, so they can modify UID or URL by BLE remotely.  Can I modify the eddystone example to achieve this function?  
I tried to modify the eddystone example in nRF5_SDK_17.0.0_9d13099, only modified adv_timing_callback()  in the file es_adv.c, change the second parameters from true to false in function get_adv_parmas() , change the parameters in invoke_callback(), and then test, the beacon still advertise in non-conntable mode, and can not be connected.

Which functions should I modify?and what should I pay attention to?  Look forward to your reply, thank you in advance.

/**@brief Function handling events from @ref es_adv_timing.c.
 *
 * @param[in] p_evt Advertisement timing event.
 */
static void adv_timing_callback(const es_adv_timing_evt_t * p_evt)
{
    ret_code_t            err_code;
    ble_gap_adv_params_t  non_connectable_adv_params;
    const es_slot_reg_t * p_reg = es_slot_get_registry();

    // As new advertisement data will be loaded, stop advertising.
    err_code = sd_ble_gap_adv_stop(*mp_adv_handle);
    if (err_code != NRF_ERROR_INVALID_STATE && err_code != BLE_ERROR_INVALID_ADV_HANDLE)
    {
        APP_ERROR_CHECK(err_code);
    }

    // If a non-eTLM frame is to be advertised.
    if (p_evt->evt_id == ES_ADV_TIMING_EVT_ADV_SLOT)
    {
        err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, 0, p_reg->slots[p_evt->slot_no].radio_tx_pwr);
        if (err_code != BLE_ERROR_INVALID_ADV_HANDLE)
        {
            APP_ERROR_CHECK(err_code);
        }

        es_adv_frame_fill_non_connectable_adv_data(p_evt->slot_no, false, &m_adv_data);
       
    }

    // If an eTLM frame is to be advertised
    else if (p_evt->evt_id == ES_ADV_TIMING_EVT_ADV_ETLM)
    {
        err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, 0, p_reg->slots[p_reg->tlm_slot].radio_tx_pwr);
        APP_ERROR_CHECK(err_code);

        es_adv_frame_fill_non_connectable_adv_data(p_evt->slot_no, true, &m_adv_data);
    }

//  invoke_callback(ES_ADV_EVT_NON_CONN_ADV);
    invoke_callback(ES_ADV_EVT_CONNECTABLE_ADV_STARTED);  //add for connectable mode
   
    get_adv_params(&non_connectable_adv_params, false, m_remain_connectable); //modify for connectable mode,from true to false
    adv_start(&non_connectable_adv_params);
}

Sincerely,

Susan

Parents Reply Children
  • Hi run,

    I tried the sdk 17.0.2, and try to modify other parameters, and then it can advertise connectable eddystone.

    and I go back to sdk 17.0.0, do the same modification, it can also advertise connectable eddystone.

    if we continute to use sdk17.0.0, do it has any risk ? Actually, We have produced a batch of beacons with the sdk17.0.0.

    In addtion, what is the range of MAX_CONN_INTERVAL, if I set to 2000ms, the beacon will raise a fatal error.

    Do you have the suggest value for MAX_CONN_INTERVAL for this use case?

    Looking forward to your reply, thank you very much.

    Best wishes,

    Susan

  • Hi,

    Where does it assert? Can I guess there is a check that the interval should not be to big? Most likely a limitation with eddystone, but as mentioned Eddystone is no longer supported.

Related