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

Device Connection count changes

Hai, I want to connect central to a single  peripheral   and after certain operations, I want to connect central to more peripherals

  1. I tried with,

                          #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 1

                           and after some operations, I had changed  to

                           #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 8

                          but  my device (central) connecting to a single peripheral only not with many periphral

         2. even i tried with

                          #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 8

                           BLE_LBS_C_ARRAY_DEF(m_lbs_c, NRF_SDH_BLE_CENTRAL_LINK_COUNT); 
                           BLE_DB_DISCOVERY_ARRAY_DEF(m_db_disc, NRF_SDH_BLE_CENTRAL_LINK_COUNT); 
                           NRF_BLE_SCAN_DEF(m_scan); 
                           NRF_BLE_GQ_DEF(m_ble_gatt_queue, NRF_SDH_BLE_CENTRAL_LINK_COUNT,NRF_BLE_GQ_QUEUE_SIZE);

and after some operations, I had changed  to

                          #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 8

                          BLE_LBS_C_ARRAY_DEF(m_lbs_c, NRF_SDH_BLE_CENTRAL_LINK_COUNT); 
                          BLE_DB_DISCOVERY_ARRAY_DEF(m_db_disc, NRF_SDH_BLE_CENTRAL_LINK_COUNT); 
                          NRF_BLE_SCAN_DEF(m_scan); 
                          NRF_BLE_GQ_DEF(m_ble_gatt_queue, NRF_SDH_BLE_CENTRAL_LINK_COUNT,NRF_BLE_GQ_QUEUE_SIZE);

But  i getting error  like, " Initializer element is not a constant"

 Kindly help me, thank you

  • Yes, I am using that same event FDS_EVT_WRITE  and start scan again but now how can I change the  no of count link, 

    I had already  given as

    // <o> NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links.
    #ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
    #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 1
    #endif  

    in my sdk_config and

    BLE_LBS_C_ARRAY_DEF(m_lbs_c, NRF_SDH_BLE_CENTRAL_LINK_COUNT); /**< LED button client instances. */

    BLE_DB_DISCOVERY_ARRAY_DEF(m_db_disc, NRF_SDH_BLE_CENTRAL_LINK_COUNT); /**< Database discovery module instances. */
    NRF_BLE_SCAN_DEF(m_scan); /**< Scanning Module instance. */
    NRF_BLE_GQ_DEF(m_ble_gatt_queue, /**< BLE GATT Queue instance. */
    NRF_SDH_BLE_CENTRAL_LINK_COUNT,
    NRF_BLE_GQ_QUEUE_SIZE);  

    in my main file

    now after using the event FDS_EVT_WRITE and scan again ,i dont now how to change the Maximum number of central links. again

  • Hi,

    Just keep the NRF_SDH_BLE_CENTRAL_LINK_COUNT at 8. If you plan to connect to 8 devices, then you should set this define to 8 from the start.

  • Hai Sigurd, I will explain my bug in detail

    My Nrf52840 should connect with a maximum of only one device and  through the one device I will; write some data in FDS and only after the success message from the FDS write operation my nrf52840device able to connect with 8 peripheral  devices 

    Kindly note Before the FDS success message my device wants to connect with a single device and ONLY after the fds Success message my device wants to connect with multiple(8) device 

  • Hi,

    Venkat RAM said:
    Kindly note Before the FDS success message my device wants to connect with a single device and ONLY after the fds Success message my device wants to connect with multiple(8) device 

    Yes, I understand, just make sure that you don't start the BLE scanning again when you connect the first device. Only start the scanning again when you get the FDS success message.

Related