BLE Connection initialization from Central to Peripheral

Hello,

I study the UART Central-Peripheral example (NUS) out of the box based on Visual Code IDE. I would like to understand on the Central part:

Where exactly in code I can see the act of connection initiation and how central device decides to which peripheral

it wants to connect. I use the SDK and Tool-chain v.3.

Thank you in advance.

Andrei

Parents
  • Hi,

    First of all, if you haven't already please check out: https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/ 

    Unfortunately we don't have any example directly for central role, but hopefully understanding peripheral role, and then look at the source code for the examples for both peripheral and central role, you can find how they interact, e.g. starting points can be:

    https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/peripheral_uart/README.html 
    https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/central_uart/README.html 

    Kenneth

  • Dear Kenneth,

    Thank you for your response to my question. Regarding your propositions, I already finished the Bluetooth Low Energy Fundamentals course and I checked the README pages of Central UART, Peripheral UART and Central role samples.

    I use the Visual Studio Code IDE, as I started my learning of BLE from proposed courses from Nordic Academy: Fundamental and BLE fundamental. Then I wanted to use the Central_UART and Peripherial_UART as the base of my development.

    I also explored the Central Example from the SDK. In Central example I can clearly see using of 

    static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t typestruct net_buf_simple *ad) function which in its turn calls the 
        err = bt_conn_le_create(addr, BT_CONN_LE_CREATE_CONN,
                    BT_LE_CONN_PARAM_DEFAULT, &default_conn); creating the BLE connection to Peripheral role device.
    Unfortunately, in Central_UART example that I want to use as the base of our development I cannot find that easily any function responsible to connection initialization as bt_conn_le_create(). So I would like you to point me how the connection from Central_UART to Peripheral_UART is initialized in code. Please explain how Central_UART decides to which Peripheral it wants to connect? Where in the code this happens? I would like to find in the code bt_conn_le_create() or its equivalent in Central_UART example from the SDK. I use SDK version 3.0.1. 
    Thank you in advance,
    Andrei
Reply
  • Dear Kenneth,

    Thank you for your response to my question. Regarding your propositions, I already finished the Bluetooth Low Energy Fundamentals course and I checked the README pages of Central UART, Peripheral UART and Central role samples.

    I use the Visual Studio Code IDE, as I started my learning of BLE from proposed courses from Nordic Academy: Fundamental and BLE fundamental. Then I wanted to use the Central_UART and Peripherial_UART as the base of my development.

    I also explored the Central Example from the SDK. In Central example I can clearly see using of 

    static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t typestruct net_buf_simple *ad) function which in its turn calls the 
        err = bt_conn_le_create(addr, BT_CONN_LE_CREATE_CONN,
                    BT_LE_CONN_PARAM_DEFAULT, &default_conn); creating the BLE connection to Peripheral role device.
    Unfortunately, in Central_UART example that I want to use as the base of our development I cannot find that easily any function responsible to connection initialization as bt_conn_le_create(). So I would like you to point me how the connection from Central_UART to Peripheral_UART is initialized in code. Please explain how Central_UART decides to which Peripheral it wants to connect? Where in the code this happens? I would like to find in the code bt_conn_le_create() or its equivalent in Central_UART example from the SDK. I use SDK version 3.0.1. 
    Thank you in advance,
    Andrei
Children
Related