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

direct advertising with whitelist

Hi

I want to connect to only a single master device by s110. I used the example parameter setting from "ble_app_hids_keyboard" for gap_params_init, advertising_init and finally called err_code = ble_advertising_start(BLE_ADV_MODE_FAST);

Here my adervitsing_init function:

define APP_ADV_FAST_INTERVAL 0x0028
define APP_ADV_SLOW_INTERVAL 0x0C80
APP_ADV_FAST_TIMEOUT 30
APP_ADV_SLOW_TIMEOUT 180

    uint32_t       err_code;
    uint8_t        adv_flags;
    ble_advdata_t  advdata;

    // Build and set advertising data
    memset(&advdata, 0, sizeof(advdata));

    adv_flags = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;
    advdata.name_type = BLE_ADVDATA_FULL_NAME;
    advdata.include_appearance = true;
    advdata.flags = adv_flags;
    advdata.uuids_complete.uuid_cnt = 1;
    advdata.uuids_complete.p_uuids = pAdvUuid;

    ble_adv_modes_config_t options =
    {
        BLE_ADV_WHITELIST_ENABLED,
        BLE_ADV_DIRECTED_ENABLED,
        BLE_ADV_DIRECTED_SLOW_DISABLED, 0,0,
        BLE_ADV_FAST_ENABLED, APP_ADV_FAST_INTERVAL, APP_ADV_FAST_TIMEOUT,
        BLE_ADV_SLOW_ENABLED, APP_ADV_SLOW_INTERVAL, APP_ADV_SLOW_TIMEOUT
    };

    err_code = ble_advertising_init(&advdata, NULL, &options, OnAdvertiseEvent, ble_advertising_error_handler);

unfortunately, when I call the ble_advertising_start(BLE_ADV_MODE_FAST) it returns with NRF_ERROR_INVALID_PARAM.

Do you have an idea what it could be? The whitelist is requested by "BLE_ADV_EVT_WHITELIST_REQUEST" and successful created...

Thanks, BR Armin

Related