Browse Source

修改开发板蓝牙链接功能

master
zhaohe 1 year ago
parent
commit
ecff8b6c09
  1. 18
      examples/ble_central/ble_app_uart_c/main.c
  2. 10656
      examples/ble_central/ble_app_uart_c/pca10100/s122/arm5_no_packs/JLinkLog.txt
  3. 4
      examples/ble_central/ble_app_uart_c/pca10100/s122/arm5_no_packs/ble_app_uart_c_pca10100_s122.uvoptx
  4. 2
      examples/ble_central/ble_app_uart_c/pca10100/s122/config/sdk_config.h

18
examples/ble_central/ble_app_uart_c/main.c

@ -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);
}

10656
examples/ble_central/ble_app_uart_c/pca10100/s122/arm5_no_packs/JLinkLog.txt
File diff suppressed because it is too large
View File

4
examples/ble_central/ble_app_uart_c/pca10100/s122/arm5_no_packs/ble_app_uart_c_pca10100_s122.uvoptx

@ -75,7 +75,7 @@
<OPTFL>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget>
<IsCurrentTarget>0</IsCurrentTarget>
</OPTFL>
<CpuCode>5</CpuCode>
<DebugOpt>
@ -235,7 +235,7 @@
<OPTFL>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>0</IsCurrentTarget>
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
<CpuCode>5</CpuCode>
<DebugOpt>

2
examples/ble_central/ble_app_uart_c/pca10100/s122/config/sdk_config.h

@ -309,7 +309,7 @@
// <o> NRF_BLE_SCAN_NAME_CNT - Number of name filters.
#ifndef NRF_BLE_SCAN_NAME_CNT
#define NRF_BLE_SCAN_NAME_CNT 0
#define NRF_BLE_SCAN_NAME_CNT 10
#endif
// <o> NRF_BLE_SCAN_SHORT_NAME_CNT - Number of short name filters.

Loading…
Cancel
Save