This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PERIPHERAL_LINK_COUNT and CENTRAL_LINK_COUNT in ble_app_multilink_central

Hello!

When looking at the central example ble_app_multilink_central in sdk_config.h, I found out that all links are considered central, with NRF_SDH_BLE_PERIPHERAL_LINK_COUNT=0. (On the contrary, in ble_app_multiperipheral, there are no central link, NRF_SDH_BLE_CENTRAL_LINK_COUNT=0)

Yet to my understanding, I would expect to find NRF_SDH_BLE_CENTRAL_LINK_COUNT=1 (the ble_app_multilink_central) and NRF_SDH_BLE_PERIPHERAL_LINK_COUNT=N (the N peripherals running ble_app_blinky), and using functions like ble_conn_state_peripheral_conn_count() instead of ble_conn_state_central_conn_count(). So my question would be why isn't it the case? And is there any advantage/disadvantage to consider every node as central like this?

I also tried changing the code to allocate "NRF_SDH_BLE_PERIPHERAL_LINK_COUNT" services instead of CENTRAL, and changing the defines in sdk_config.h to only accept 1 central and several peripherals, yet when the second device tries to connect, the code crashes as it seems to try to connect as a central while still being expected to work like a peripheral...

I know some questions have already been asked about PERIPHERAL/CENTRAL_LINK_COUNT, but I didn't find much about this, so I thought I'd ask!

Thank you and have a nice day!

  • Hello,

    Sorry if I'm misreading the question, but there seems to be some misconceptions about what GAP role a BLE device can have. The BLE Multi-link Example only has the GAP central role and all connections from this device will therefore have to be a central connection.

    You can only connect to a peripheral device such as "BLE Blinky" if you are a central device.

    "There are four main GAP roles that a BLE device operates in:

    • Central: a device that discovers BLE peripherals and broadcasters with the capability of connecting to peripherals.
    • Peripheral: a device that advertises its existence with the capability of accepting connections from a central.
    • Broadcaster: a device that sends out advertising packets without allowing any connections.
    • Observer: a device that discovers peripherals and broadcasters, but without the capability of accepting connections from a central." [Source https://www.novelbits.io/bluetooth-low-energy-advertisements-part-1/ ]

  • Hi,

    Thank you very much for the reply, and sorry if my question wasn't very clear!

    I know (at least a little) about GAP roles. But from your answer, I think I see what I misunderstood:

    For some reason I thought the CENTRAL_LINK_COUNT was the number of connections from this device TO a central (meaning the number of connections where the device acts as a peripheral).

    I don't even know why I didn't think about it that way... Thanks again!

Related