<?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 processing with nRF5340 Audio</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111654/ble-connection-processing-with-nrf5340-audio</link><description>I have a few questions about the sample source of nRF5340 Audio. 
 1. Where does the connection processing between the Gateway and Headset take place? 
 2. Where is the BLE bonding information set? 
 3. Is it possible to rewrite the bonding information</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Mar 2025 18:26:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111654/ble-connection-processing-with-nrf5340-audio" /><item><title>RE: BLE connection processing with nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/526637?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2025 18:26:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a34f18d-d306-4676-9791-f2ce19f09bb9</guid><dc:creator>SNJY</dc:creator><description>&lt;p&gt;Thanks Hung Bui for letting me know. I&amp;#39;ll create a new one.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection processing with nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/526559?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2025 13:27:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bbae43a-ecdb-4223-aa0d-312aa3da0673</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sanjay,&amp;nbsp;&lt;br /&gt;Torbjørn unfortunately has left Nordic. Please create a new ticket.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection processing with nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/526429?ContentTypeID=1</link><pubDate>Fri, 07 Mar 2025 22:45:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22e7f316-af98-4c44-ae48-0ea5bc21b60b</guid><dc:creator>SNJY</dc:creator><description>&lt;p&gt;hi &lt;a href="https://devzone.nordicsemi.com/members/ovrebekk"&gt;ovrebekk&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;I wanted to understand more on the same information.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can i continue in the same thread or should I raise a new ticket?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection processing with nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/488708?ContentTypeID=1</link><pubDate>Thu, 13 Jun 2024 14:03:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19752c41-665f-4210-915a-e3a7d7a91c1e</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
[quote user="Junichi"]1. Am I correct in thinking that the Headset (Server) sends an advertisement, the Gateway (Client) scans the advertisement and connects?[/quote]
&lt;p&gt;Correct.&lt;/p&gt;
[quote user="Junichi"]2. Where in the source is the key information for connecting with CIS set?[/quote]
&lt;p&gt;What particular information are you referring to?&amp;nbsp;&lt;/p&gt;
[quote user="Junichi"]3. If the device tree of the Headset and Gateway are different, can a connection be made even if only the Headset is built and flashed and only the Gateway is built and flashed using separate scripts?[/quote]
&lt;p&gt;This shouldn&amp;#39;t matter. In the default example the scanner will look for a specific advertising name, and if it finds it the connection will be established.&amp;nbsp;&lt;/p&gt;
[quote user="Junichi"]4. If I want to create several combinations of Gateway and Headset, how can I change the connection information so that it does not conflict with the others?[/quote]
&lt;p&gt;The easiest way to do this would be to change the advertising name on the peripheral side, and change the target name on the scanner side, to something unique. Then you can control which peripherals and scanners will connect, and which will not.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection processing with nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/488406?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2024 04:00:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:056aaf37-da15-4753-a2fa-e984da738b6b</guid><dc:creator>Junichi</dc:creator><description>&lt;p&gt;Please tell me the following about running nRF5340 Audio with CIS.&lt;/p&gt;
&lt;p&gt;1. Am I correct in thinking that the Headset (Server) sends an advertisement, the Gateway (Client) scans the advertisement and connects?&lt;/p&gt;
&lt;p&gt;2. Where in the source is the key information for connecting with CIS set?&lt;/p&gt;
&lt;p&gt;3. If the device tree of the Headset and Gateway are different, can a connection be made even if only the Headset is built and flashed and only the Gateway is built and flashed using separate scripts?&lt;/p&gt;
&lt;p&gt;4. If I want to create several combinations of Gateway and Headset, how can I change the connection information so that it does not conflict with the others?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection processing with nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/488352?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2024 13:39:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17b64f58-8a26-4227-af26-38efe55d2b93</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
[quote user="Junichi"]Which part of the source is responsible for sending the connection request?[/quote]
&lt;p&gt;Establishing connections in the central role is handled by the &lt;em&gt;bt_mgmt_scan_for_conn.c&lt;/em&gt; module, which can be found in the&amp;nbsp;&lt;span&gt;&lt;span dir="ltr"&gt;&lt;em&gt;src\bluetooth\bt_management\scanning\&lt;/em&gt; folder.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;The exact connection establishment is done by calling bt_conn_le_create(..), and if you search for it in the bt_mgmt_scan_for_conn.c file you can find it referenced in three other functions: &lt;em&gt;device_name_check()&lt;/em&gt;, &lt;em&gt;csip_found()&lt;/em&gt; and &lt;em&gt;bond_connect()&lt;/em&gt;.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;&lt;em&gt;bond_connect()&lt;/em&gt; is called when you receive a directed advertising message, which means you want to connect to a previously bonded device (you should never receive directed advertising messages for non bonded devices). You will also call this function if you have used all the bond slots, since in this case you can not bond any new devices.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;&lt;em&gt;csip_found()&lt;/em&gt; is used if you want to connect to a device which is part of a coordinated set, as defined by the Coordinated Set Identification Service (CSIS).&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;For all other devices the &lt;em&gt;device_name_check()&lt;/em&gt; function will be used to connect.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;Best regards&lt;br /&gt;Torbjørn&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection processing with nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/488211?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2024 04:31:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6598eab-1a79-418f-8bf4-f0cbe6188073</guid><dc:creator>Junichi</dc:creator><description>&lt;p&gt;For nRF5340 Audio, where are the bonding values ​​assigned?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection processing with nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/488100?ContentTypeID=1</link><pubDate>Mon, 10 Jun 2024 11:11:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abab7c8d-b30d-44c2-94e4-22730523aa92</guid><dc:creator>Junichi</dc:creator><description>&lt;p&gt;Which part of the source is responsible for sending the connection request?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection processing with nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/487436?ContentTypeID=1</link><pubDate>Wed, 05 Jun 2024 08:08:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:497ebd4f-e1ba-4b3d-a970-85536a680e15</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Which particular part of the connection process are you referring to?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As a peripheral device you don&amp;#39;t control when the connection process starts. Essentially what you do is to start some type of connectable advertising,&amp;nbsp;and wait for a scanner nearby to send a connection request, which will start the connection process. Once the connection is established it will trigger the &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/applications/nrf5340_audio/src/bluetooth/bt_management/bt_mgmt.c#L71"&gt;connected_cb(..) function&lt;/a&gt; in bt_mgmt.c, which controls what happens next.&lt;/p&gt;
&lt;p&gt;The low level handling of establishing and maintaining a connection is handled by the Bluetooth link layer directly, and as such is not visible in the application code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection processing with nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/487009?ContentTypeID=1</link><pubDate>Mon, 03 Jun 2024 01:34:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdeb809a-692a-4c8d-9cfa-847bbf14b1ec</guid><dc:creator>Junichi</dc:creator><description>&lt;p&gt;Is the connection process performed when bt_mgmt_init() is executed?&lt;/p&gt;
&lt;p&gt;Which function in bt_mgmt.c performs the connection process?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection processing with nRF5340 Audio</title><link>https://devzone.nordicsemi.com/thread/486907?ContentTypeID=1</link><pubDate>Fri, 31 May 2024 12:47:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06ad355f-8929-484f-a609-606b835cb4b3</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
[quote user=""]1. Where does the connection processing between the Gateway and Headset take place?[/quote]
&lt;p&gt;The handling of advertising occurs in bt_mgmt_adv.c, while the connection handling can be found in bt_mgmt.c.&amp;nbsp;&lt;/p&gt;
[quote user=""]2. Where is the BLE bonding information set?[/quote]
&lt;p&gt;BLE bonding is handled by the Bluetooth host, similar to other (no audio) Bluetooth applications.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The exact storage of keys is handled by the bt_keys_store(..) function, which is called from smp.c &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/subsys/bluetooth/host/smp.c#L1683"&gt;here&lt;/a&gt;. The function itself is implemented in keys.c &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/subsys/bluetooth/host/keys.c#L328"&gt;here&lt;/a&gt;, and uses the bt_settings module for the actual storage of data in flash.&amp;nbsp;&lt;/p&gt;
[quote user=""]3. Is it possible to rewrite the bonding information?[/quote]
&lt;p&gt;Yes, this is possible. The bt_mgmt_bonding_clear() function in bt_mgmt.h/c allows you to delete the existing bonding data, in order to make room for new bonds.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>