<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>BLE Connection initialization from Central to Peripheral</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/121938/ble-connection-initialization-from-central-to-peripheral</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Jun 2025 08:33:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/121938/ble-connection-initialization-from-central-to-peripheral" /><item><title>RE: BLE Connection initialization from Central to Peripheral</title><link>https://devzone.nordicsemi.com/thread/537994?ContentTypeID=1</link><pubDate>Wed, 04 Jun 2025 08:33:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e4e5039-d007-4c48-83b8-96e5a6ee6caf</guid><dc:creator>AndreiZi</dc:creator><description>&lt;p&gt;I found the explanation here:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/building-a-ble-application-on-ncs-sdk---contrasting-to-softdevice-based-ble-applications---part-2-central-role"&gt;https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/building-a-ble-application-on-ncs-sdk---contrasting-to-softdevice-based-ble-applications---part-2-central-role&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;little bit outdated but still relevant.&lt;/p&gt;
&lt;p&gt;In original Central_UART sample application connection is initialized automatically to a Peripheral_UART device matching the filter because of&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;bt_scan_init_param&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;scan_init&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="background-color:#ffff00;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color:#ffff00;"&gt;connect_if_match = true,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;bt_scan_init&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;scan_init&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Kind regards,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Andrei&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Connection initialization from Central to Peripheral</title><link>https://devzone.nordicsemi.com/thread/537846?ContentTypeID=1</link><pubDate>Tue, 03 Jun 2025 11:13:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e62e5c80-9838-4d16-8084-53d50d470dba</guid><dc:creator>AndreiZi</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Kenneth,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I do want to use the central_uart example as a base. So, can you please explain in a few sentences how it is initialize the connection to a peripheral and how it choose which one to connect? Or just point me where it is explained.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Andrei&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Connection initialization from Central to Peripheral</title><link>https://devzone.nordicsemi.com/thread/537843?ContentTypeID=1</link><pubDate>Tue, 03 Jun 2025 11:05:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1afdd041-4fc1-46b5-a7a0-c8128a902753</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The central_uart example use the scan module.&lt;/p&gt;
&lt;p&gt;If you want to use the bt api directly check out for instance&amp;nbsp;\zephyr\samples\bluetooth\central\&lt;/p&gt;
&lt;p&gt;In general just search for main.c files that include&amp;nbsp;bt_conn_le_create().&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Connection initialization from Central to Peripheral</title><link>https://devzone.nordicsemi.com/thread/537795?ContentTypeID=1</link><pubDate>Tue, 03 Jun 2025 08:12:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff4e5253-ac48-49e6-9807-5a0e1274f1b5</guid><dc:creator>AndreiZi</dc:creator><description>&lt;p&gt;Dear&amp;nbsp;&lt;span&gt;Kenneth,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for your response to my question. Regarding your propositions, I already&amp;nbsp;finished the&amp;nbsp;Bluetooth Low Energy Fundamentals course and I checked the README pages of Central UART, Peripheral UART and Central role samples.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;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.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I also&amp;nbsp;explored&amp;nbsp;the Central Example from the SDK. In Central example I can clearly see using of&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;static&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;device_found&lt;/strong&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;bt_addr_le_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;addr&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;int8_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;rssi&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;uint8_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;type&lt;/span&gt;&lt;span&gt;,&amp;nbsp;&lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;net_buf_simple&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;ad&lt;/span&gt;&lt;span&gt;&lt;span&gt;) function which in its turn calls the&amp;nbsp;&lt;/span&gt;&lt;/span&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;err&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;strong&gt;bt_conn_le_create&lt;/strong&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;addr&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;BT_CONN_LE_CREATE_CONN&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;BT_LE_CONN_PARAM_DEFAULT&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;default_conn&lt;/span&gt;&lt;span&gt;); creating the BLE connection to Peripheral role device.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Unfortunately, in&amp;nbsp;Central_UART&amp;nbsp;example that I want to use as the base of our development I cannot find that easily any function responsible to connection initialization as&amp;nbsp;&lt;strong&gt;bt_conn_le_create().&amp;nbsp;&lt;/strong&gt;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&amp;nbsp;&lt;strong&gt;bt_conn_le_create()&lt;/strong&gt; or its equivalent in Central_UART example from the SDK. I use SDK version 3.0.1.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Thank you in advance,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Andrei&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Connection initialization from Central to Peripheral</title><link>https://devzone.nordicsemi.com/thread/537712?ContentTypeID=1</link><pubDate>Mon, 02 Jun 2025 15:31:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13c6cbf0-662d-4fc6-9118-b430be6ac91c</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;First of all, if you haven&amp;#39;t already please check out:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/"&gt;https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Unfortunately we don&amp;#39;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:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/peripheral_uart/README.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/peripheral_uart/README.html&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/central_uart/README.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/central_uart/README.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>