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

Scanning filter fail

Hello everyone,

I'm programming for nRF52833, using SDK17. When I program for scanning filter (SCAN_NAME_FILTER and SCAN_UUID_FILTER) and debug, I got these errors. I don't know where these errors came from. Can anyone help me with this??

Here is my code and my errors.

Hope for your reply as soon as possible!!

Thanks

Best regards,

static ble_uuid_t const m_nus_uuid =
{
    .uuid = BLE_UUID_NUS_SERVICE,
    .type = NUS_SERVICE_UUID_TYPE
};


static char const m_target_periph_name[] = "BLE_DEMO_24"; 

void scan_init(void)
{
    ret_code_t          err_code;
    nrf_ble_scan_init_t init_scan;

    memset(&init_scan, 0, sizeof(init_scan));

    init_scan.connect_if_match = true;
    init_scan.conn_cfg_tag     = APP_BLE_CONN_CFG_TAG;
    init_scan.p_scan_param     = &m_scan_params;


    err_code = nrf_ble_scan_init(&m_scan, &init_scan, scan_evt_handler);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_scan_filter_set(&m_scan, SCAN_NAME_FILTER, m_target_periph_name);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_scan_filter_set(&m_scan, SCAN_UUID_FILTER, &m_nus_uuid);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_scan_filters_enable(&m_scan, NRF_BLE_SCAN_NAME_FILTER | NRF_BLE_SCAN_UUID_FILTER, false);
    APP_ERROR_CHECK(err_code);

}

Parents Reply
  • Hi,

    You need to set this number in your application's sdk_config.h file. If you only have one central role at a time, then you set NRF_SDH_BLE_CENTRAL_LINK_COUNT to 1. You can se a higher number if you like. The only problem is that the SoftDevice will need more RAM in this case, but it is not a problem unless your device is RAM constrained.

    As mentioned before you need to update the application RAM start address and size when doing this. just enable debug logging and do as instructed in the log (see here for more details about adjusting RAM start address/size based on SoftDevice configuration.)

Children
Related