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

nrf52810 central and multi peripheral

Hi,

I came up with one application where i will be using one master and multilateral . with one master i want to scan  all the the available peripherals and display it on display and  will scroll down in my display then will connect to one required peripheral. so i dont want auto pairing , i want manual pairing to be done. so please suggest which program to use to achieve this above application?

please suggest        .

thanks in advance

pktron

Parents Reply
  • Unfortunately, we don't have any examples that does this, so you have to implement this yourself. I suggest you to take a look at the ble_app_hrs_c example from the SDK. After BLE_GAP_EVT_ADV_REPORT event, you can use data from adv_report to print out the peripherals on a display. When you pick a peripheral to connect to(on a button press for example), run this code:

                    // Stop scanning.
                    (void) sd_ble_gap_scan_stop();
    
    
                    // Initiate connection.
                    err_code = sd_ble_gap_connect(&p_gap_evt->params.adv_report.peer_addr,
                                                  &m_scan_param,
                                                  &m_connection_param,
                                                  APP_BLE_CONN_CFG_TAG);
    
                    if (err_code != NRF_SUCCESS)
                    {
                        NRF_LOG_ERROR("Connection Request Failed, reason %d.", err_code);
                    }

    This is roughly how you can do it.

Children
No Data
Related