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

BLE manual connect and Disconnect

Dear Nordic Team, 

Thanks for supporting.

I am working in ble_app_uart_c example in this example is automatically connect with its peripheral. But i need to connect and disconnect manually like  nRF_UART android app. please support anyone.

My HW = DK52

SDK = SDK15.2.0

Parents
  • @ as per your suggestion set init_scan.connect_if_match = false scan the device list then try to connect like below 

    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, &GI8u_Device_List[GI8u_Device_ID-1][0]); 
    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);

    after calling this function the system goes to reset. I thing filter setting may be wrong ?. please help further process.

Reply
  • @ as per your suggestion set init_scan.connect_if_match = false scan the device list then try to connect like below 

    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, &GI8u_Device_List[GI8u_Device_ID-1][0]); 
    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);

    after calling this function the system goes to reset. I thing filter setting may be wrong ?. please help further process.

Children
Related