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

ble_uart_c enabling scan name filter and UUID filter

Hi, I have a problem in enabling both NAME filter and UUID filter in ble_uart_c SCANNER

I have enabled the both but

the device get connected only match with UUID but i need to connect the device when target name and UUID  get correct

static 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;

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

    if (strlen(m_target_periph_name) != 0)
    {
        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_ALL_FILTER, false);
    APP_ERROR_CHECK(err_code);

    
}

Parents Reply Children
No Data
Related