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

Non-connectable advertisement while scanning as a Central

Is it possible to advertise in non-connectable mode while scanning/connecting/connected as a Central?

Parents
  • Yes, it is possible.

    You can use ble_advdata_set(..) to set the packet data and then start advertising with the SoftDevice call sd_ble_gap_adv_start(..). See the ble_app_beacon example for how to do this in more detail.

  • Did a quick test and saw no issues:

    advertising_init();    //from ble_app_template example
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);    //from ble_app_template example
    APP_ERROR_CHECK(err_code);
    
    nrf_delay_ms(5000);
    
    err_code = sd_ble_gap_adv_stop();
    APP_ERROR_CHECK(err_code);
    
    advertising_beacon_init();    //advertising_init() from ble_app_beacon example
    err_code = sd_ble_gap_adv_start(&m_adv_params);
    APP_ERROR_CHECK(err_code);
    

    As this discussion is not related to the original question anymore I suggest that you make a new question.

Reply
  • Did a quick test and saw no issues:

    advertising_init();    //from ble_app_template example
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);    //from ble_app_template example
    APP_ERROR_CHECK(err_code);
    
    nrf_delay_ms(5000);
    
    err_code = sd_ble_gap_adv_stop();
    APP_ERROR_CHECK(err_code);
    
    advertising_beacon_init();    //advertising_init() from ble_app_beacon example
    err_code = sd_ble_gap_adv_start(&m_adv_params);
    APP_ERROR_CHECK(err_code);
    

    As this discussion is not related to the original question anymore I suggest that you make a new question.

Children
No Data
Related