This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

beacon config mode

Hi. I'use nrf51822 beacon kit and android nrf beacon app.

I'm modify nrf51822 beacon example source code,

I hope

1.I eliminated the button 2.After I turn on the device,into config mode automatically. 3.After the config is done, advertising.

My source code is..

bool config_mode = true;

if(config_mode)

{
    gap_params_init();

    services_init();
    advertising_init(beacon_mode_config);
    conn_params_init();
    sec_params_init();       
}
else
{
    advertising_init(beacon_mode_normal);
}    
// Start execution.
advertising_start();

for (;;)
{
    app_sched_execute();
    power_manage();
}

after turning on the device, Why I can't searching in my android app?

Rigards.

Parents
  • If sd_ble_gap_adv_start returns something else than NRF_SUCCESS, APP_ERROR_CHECK will call the app_error_handler function to handle the error.

    If it returns an error, it is usually because you have provided it with unacceptable parameters. Compare the returned error code with the errors listed above the function in the API documentation (the function can be found by using Find in Files):

    /**@brief Start advertising (GAP Discoverable, Connectable modes, Broadcast Procedure).
     *
     * @param[in] p_adv_params Pointer to advertising parameters structure.
     *
     * @return @ref NRF_SUCCESS The BLE stack has started advertising.
     * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
     * @return @ref NRF_ERROR_INVALID_STATE Invalid state to perform operation.
     * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check the accepted ranges and limits.
     * @return @ref BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid Bluetooth address supplied.
     * @return @ref BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST Discoverable mode and whitelist incompatible.
     */
    SVCALL(SD_BLE_GAP_ADV_START, uint32_t, sd_ble_gap_adv_start(ble_gap_adv_params_t const * const p_adv_params));
    

    The returned error code will be in hexadecimal format, use "Go To Definition Of '...'" to find the error code of the different errors. You can use CTRL+- to navigate backwards.

  • I'm sorry I'm late. I was in a car accident. Where can I make sure that any error return?

Reply Children
No Data
Related