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

Advertising with no timeout

Hi,

I'm developing an app which requires continuous advertising. I use following ble_gap_adv_params_t:

   ble_gap_adv_params_t adv_params;
    memset(&adv_params, 0, sizeof(adv_params));
    
    adv_params.type = BLE_GAP_ADV_TYPE_ADV_IND;
    adv_params.p_peer_addr = NULL;
    adv_params.fp = BLE_GAP_ADV_FP_ANY;
    adv_params.interval = 320;
    adv_params.timeout = 0;

Documentation says that if timeout equals 0 then advertising doesn't stop. However, when I call sd_ble_gap_adv_start(&adv_params) the function returns error_code = 0x07 (which indicates invalid parameters). Where is the bug? Or is there another way to accomplish continuous advertising other than restarting it in the timeout handler?

Related