Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to connect Multiperipherals to one Central?

Hi,

I want to connect Multi peripherals to one central and want to send the device name(peripheral which is connected) through the uart.

How do i get the device name which is connected?

Also i Want to know Can the central connect to more peripherals at the same time? 

  • I was looking for the same and my solution was (sdk_17, ble_app_multilink_central):

    #define NRF_BLE_SCAN_NAME_CNT = 2  //which overrides the def in sdk_config.h

    static char const *m_target_periph_name[NRF_BLE_SCAN_NAME_CNT] = {"Nordic Blinky 1", "Nordic Blinky 2"};

    Then in scan_init() replace 

    err_code = nrf_ble_scan_filter_set(&m_scan, SCAN_NAME_FILTER, m_target_periph_name);
    APP_ERROR_CHECK(err_code);

    with

    for (int i=0; i< NRF_BLE_SCAN_NAME_CNT; i++){
         err_code = nrf_ble_scan_filter_set(&m_scan, SCAN_NAME_FILTER, m_target_periph_name[i]);
        APP_ERROR_CHECK(err_code);
    }

Related