|
|
@ -172,7 +172,9 @@ static void scan_evt_handler(scan_evt_t const * p_scan_evt) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static char m_target_periph_name0[20] = "M1002"; /**< Name of the device we try to connect to. This name is searched in the scan report data*/ |
|
|
|
static char m_target_periph_name1[20] = "M1001"; /**< Name of the device we try to connect to. This name is searched in the scan report data*/ |
|
|
|
static char m_target_periph_name2[20] = "iflytop"; /**< Name of the device we try to connect to. This name is searched in the scan report data*/ |
|
|
|
/**@brief Function for initializing the scanning and setting the filters. |
|
|
|
*/ |
|
|
|
static void scan_init(void) |
|
|
@ -188,11 +190,17 @@ static void scan_init(void) |
|
|
|
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_UUID_FILTER, &m_nus_uuid); |
|
|
|
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_UUID_FILTER, false); |
|
|
|
APP_ERROR_CHECK(err_code); |
|
|
|
APP_ERROR_CHECK(nrf_ble_scan_filter_set(&m_scan, SCAN_NAME_FILTER, m_target_periph_name0)); |
|
|
|
APP_ERROR_CHECK(nrf_ble_scan_filter_set(&m_scan, SCAN_NAME_FILTER, m_target_periph_name1)); |
|
|
|
APP_ERROR_CHECK(nrf_ble_scan_filter_set(&m_scan, SCAN_NAME_FILTER, m_target_periph_name2)); |
|
|
|
|
|
|
|
// err_code = nrf_ble_scan_filters_enable(&m_scan, NRF_BLE_SCAN_NAME_FILTER, false); |
|
|
|
// APP_ERROR_CHECK(err_code); |
|
|
|
|
|
|
|
err_code = nrf_ble_scan_filters_enable(&m_scan, NRF_BLE_SCAN_NAME_FILTER, false); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|