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
  • That is how many concurrent central links + scanner/observer you can have. So if you just need to scan, then you can set this to 1. If you need to scan or have an active connection as a central role you can also set this to one. If you for instance need to maintain 3 connections while scanning, you set this to 4, etc. Remember that you typically also need to increase NRF_SDH_BLE_TOTAL_LINK_COUNT when increasing NRF_SDH_BLE_CENTRAL_LINK_COUNT.

Children
Related