|
本帖最后由 chxf2007 于 2022-3-18 18:24 编辑
0><info> app:BLE central template example started.0><info> app: Scan FILTER MATCH MAC.
0<info> app: Connecting to target 16917ADA70C3
这些的步骤都没有执行
NRF_BLE_SCAN_EVT_FILTER_MATCH,则输出"Scan timed out.", 定时器是在那里开启
这些都没有触发
static ble_gap_addr_t m_target_periph_addr =
{
.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC,
// .addr = {0x29,0x00, 0x18,0x12,0x20,0x20}
.addr = {0x20,0x20, 0x12,0x18,0x00,0x29} // This matches what nRF Connect shows via Scan, for peripheral
};
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);
err_code = nrf_ble_scan_filter_set(&m_scan, SCAN_ADDR_FILTER, &m_target_periph_addr.addr);
APP_ERROR_CHECK(err_code);
err_code = nrf_ble_scan_filters_enable(&m_scan, NRF_BLE_SCAN_ADDR_FILTER, false);
APP_ERROR_CHECK(err_code);
}
|
|