|
|
@ -175,7 +175,7 @@ static void scan_evt_handler(scan_evt_t const * p_scan_evt) |
|
|
|
|
|
|
|
/**@brief Function for initializing the scanning and setting the filters. |
|
|
|
*/ |
|
|
|
static char m_target_periph_name[20] = "iflytop_test"; /**< Name of the device we try to connect to. This name is searched in the scan report data*/ |
|
|
|
static char m_target_periph_name[20] = "M1002"; /**< Name of the device we try to connect to. This name is searched in the scan report data*/ |
|
|
|
static void scan_init(void) |
|
|
|
{ |
|
|
|
ret_code_t err_code; |
|
|
@ -190,19 +190,17 @@ static void scan_init(void) |
|
|
|
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_NAME_FILTER, m_target_periph_name); |
|
|
|
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, false); |
|
|
|
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_filters_enable(&m_scan, NRF_BLE_SCAN_UUID_FILTER|NRF_BLE_SCAN_NAME_FILTER, false); |
|
|
|
// 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_UUID_FILTER|NRF_BLE_SCAN_NAME_FILTER, false); |
|
|
|
APP_ERROR_CHECK(err_code); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|