<?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 - 2</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119689/ble-connection-processing-with-nrf5340-audio---2</link><description>This would be a continuation from a previous discussion on the topic of Bonding information and the process of bonding between the peripheral aka headset and central device aka gateway. I have read through the previous one and have a couple of more questions</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Mar 2025 22:22:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119689/ble-connection-processing-with-nrf5340-audio---2" /><item><title>RE: BLE connection processing with nRF5340 Audio - 2</title><link>https://devzone.nordicsemi.com/thread/528479?ContentTypeID=1</link><pubDate>Fri, 21 Mar 2025 22:22:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e29f6701-b58a-4595-8a1d-7be743b9ee5f</guid><dc:creator>SNJY</dc:creator><description>&lt;p&gt;An update on this,&lt;/p&gt;
&lt;p&gt;I was able to add custom string to one of the data types and append it to the advertisement packet. I did this by inserting the same information in the unicast_server_adv_populate() function using bt_mgmt_adv_buffer_put. I was under the assumption that adding the data in the main.c/ext_adv_populate() would do the trick but adding it to unicast_server.c/&lt;span&gt;unicast_server_adv_populate() made it work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int unicast_server_adv_populate(struct bt_data *adv_buf, uint8_t adv_buf_vacant)
{
.
.
.


size_t brdcast_name_size = strlen(CUSTOM_NAME);

ret = bt_mgmt_adv_buffer_put(adv_buf, &amp;amp;adv_buf_cnt, adv_buf_vacant,
			     brdcast_name_size, BT_DATA_BROADCAST_NAME,
			     (char *)CUSTOM_NAME);
if (ret) {
	return ret;
}


.
.
.
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Let me know if there is a better way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection processing with nRF5340 Audio - 2</title><link>https://devzone.nordicsemi.com/thread/528360?ContentTypeID=1</link><pubDate>Fri, 21 Mar 2025 09:34:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7621d25e-6153-43cc-ba8c-92279dfa6f20</guid><dc:creator>SNJY</dc:creator><description>&lt;p&gt;Hi Amanda,&lt;/p&gt;
&lt;p&gt;I was able to partially implement what i was aiming for. But I am stuck at something related and is required for my implementation.&lt;/p&gt;
&lt;p&gt;Since i have multiple peripherals, i have resorted to pairing and have removed the bonding process for now. I am implementing scan filters on the gateway to control which specific peripherals to connect to.&lt;/p&gt;
&lt;p&gt;For this implementation, i want to add a custom string to the advertisement packet of the peripheral which i can look for on the central side. In the unicast server sample, the advertisement packets are populated with uuids for a couple of services which also includes the manufacturer ID.&lt;/p&gt;
&lt;p&gt;I tried&amp;nbsp;appending data to the same buffer before it gets populated but when i add the custom data, the device throws error stating &amp;#39;Failed to set advertising data: -22&amp;#39; and &amp;#39;Failed to create extended advertisement: -22&amp;#39;&lt;/p&gt;
&lt;p&gt;I add the following snippet to the ext_adv_populate() function -&amp;nbsp;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ret = bt_mgmt_manufacturer_uuid_populate(&amp;amp;uuid_buf, CONFIG_BT_DEVICE_MANUFACTURER_ID);
if (ret) {
	LOG_ERR(&amp;quot;Failed to add adv data with manufacturer ID: %d&amp;quot;, ret);
	return ret;
}

/* USER CODE */

NET_BUF_SIMPLE_DEFINE_STATIC(str_buf, CONFIG_EXT_ADV_UUID_BUF_MAX);

ret = custom_name_populate(&amp;amp;str_buf);
if (ret) {
    LOG_ERR(&amp;quot;Failed to add adv data with name&amp;quot;, ret);
	return ret;
}

 ext_adv_buf[ext_adv_buf_cnt].type = BT_DATA_NAME_SHORTENED;
 ext_adv_buf[ext_adv_buf_cnt].data = str_buf.data;
 ext_adv_buf[ext_adv_buf_cnt].data_len = str_buf.len;
 ext_adv_buf_cnt++;
 
 /* USER CODE */
 
 ret = unicast_server_adv_populate(&amp;amp;ext_adv_buf[ext_adv_buf_cnt],
					  ext_adv_buf_size - ext_adv_buf_cnt);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could you please shed some light into what is wrong in the implementation?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection processing with nRF5340 Audio - 2</title><link>https://devzone.nordicsemi.com/thread/527252?ContentTypeID=1</link><pubDate>Thu, 13 Mar 2025 16:52:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92a44780-bee5-44ff-b04e-36d2a5955e4d</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;You can modify or replace that function if you don&amp;#39;t want to check the advertising data for the matching device name.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection processing with nRF5340 Audio - 2</title><link>https://devzone.nordicsemi.com/thread/527057?ContentTypeID=1</link><pubDate>Wed, 12 Mar 2025 22:58:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bff7577d-5cb3-43c6-bbea-dd374575759e</guid><dc:creator>SNJY</dc:creator><description>&lt;p&gt;I tried adapting the exercise for the existing nrf5340 unicast_client example. I also referred to &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/98934/simple-bluetooth-pairing-using-a-button-based-on-peripheral_uart-example-not-working/421736"&gt;another discussion&lt;/a&gt;&amp;nbsp;for an extended implementation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;While it might work seperately, i am not able to make it work with the unicast_client example.&lt;/p&gt;
&lt;p&gt;I figured that instead of using the filter, the unicast client passed the peripheral device name in&amp;nbsp;bt_mgmt_scan_start() which is eventually used to compare with any new device connection (in the device_name_check() function)&lt;/p&gt;
&lt;p&gt;Do i need to disable/bypass this complete loop if i am trying to implement filters in the central device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection processing with nRF5340 Audio - 2</title><link>https://devzone.nordicsemi.com/thread/526826?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2025 21:56:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:507b0391-ecab-4614-9740-19a2f8fddd22</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Check the&amp;nbsp;Exercises in that course.&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 - 2</title><link>https://devzone.nordicsemi.com/thread/526815?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2025 17:26:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2ebf6fa-825f-4957-8417-806a40adfbde</guid><dc:creator>SNJY</dc:creator><description>&lt;p&gt;Yes i am also looking into that, alternatively is there an example where this is applied?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection processing with nRF5340 Audio - 2</title><link>https://devzone.nordicsemi.com/thread/526814?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2025 17:24:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab5f8899-4d29-4116-bad8-f06fd902f69f</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;&lt;span&gt;I recommend checking out the&amp;nbsp;&lt;/span&gt;&lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-5-bluetooth-le-security-fundamentals/" rel="noopener noreferrer" target="_blank"&gt;Bluetooth Low Energy Fundamentals course&lt;/a&gt;,&lt;span&gt;&amp;nbsp;which covers these concepts in detail.&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 - 2</title><link>https://devzone.nordicsemi.com/thread/526806?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2025 16:32:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19421c12-340a-4ddf-bd55-4e81530233a4</guid><dc:creator>SNJY</dc:creator><description>&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;After setting a static ID by&amp;nbsp;&lt;span&gt;CONFIG_BT_PRIVACY=n, the local address&amp;nbsp;is retained over multiple connections as expected.&amp;nbsp;&lt;/span&gt;&lt;span&gt;I also want&amp;nbsp; to provide the connection details for the central to the peripheral. (if we can store the ID on the other device)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Assuming that we have multiple such pairs, how do i bond these pairs.One way i learnt is that&amp;nbsp;central can have an accept list to connect to known peripherals&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you provide the right direction?&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 - 2</title><link>https://devzone.nordicsemi.com/thread/526797?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2025 15:45:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8cfbc76b-1871-4e1d-bee3-4033bc982232</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user=""]Is the above understanding true?[/quote]
&lt;p&gt;That&amp;#39;s correct.&amp;nbsp;&lt;/p&gt;
[quote user=""]How is the ID retained in the peripheral?[/quote]
&lt;p&gt;&lt;span&gt;When using Resolvable Private Addresses (RPA) in Bluetooth LE, the device&amp;#39;s identity is retained through the Identity Resolving Key (IRK), which is exchanged during the bonding process.&lt;/span&gt;&lt;/p&gt;
[quote user=""]Is it possible to setup a static ID for the central and let the perihperal always try connecting to it? If so, how?[/quote]
&lt;p&gt;You can set&amp;nbsp;CONFIG_BT_PRIVACY=n in the prj.conf.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>