<?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>An advertisement data that contains manufacturing data</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107547/an-advertisement-data-that-contains-manufacturing-data</link><description>Hi 
 As shown in the title, I want to add manufacturing data( BT_DATA_MANUFACTURER_DATA ) to the advertisement data. 
 The *.conf seems to only define the device name... 
 
 I want to be able to modify manufacturing data dynamically. 
 let me know if</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 31 Jan 2024 00:32:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107547/an-advertisement-data-that-contains-manufacturing-data" /><item><title>RE: An advertisement data that contains manufacturing data</title><link>https://devzone.nordicsemi.com/thread/466853?ContentTypeID=1</link><pubDate>Wed, 31 Jan 2024 00:32:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77ed31e2-8291-4b60-a0ab-7dadcb16f5cd</guid><dc:creator>SunHuang</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi Edvin&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Your explanation has been very enlightening, thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An advertisement data that contains manufacturing data</title><link>https://devzone.nordicsemi.com/thread/466739?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2024 11:52:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:381113f4-6158-4dcc-9fbc-6bf73dcaa02e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am glad to hear that you figured it out.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I just want to mention that there are separate configs for peripheral and central connections. As long as you only support peripheral connections, then&amp;nbsp;CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT will determine how many peripheral connections you can have. This will default to 1 if CONFIG_BT_CENTRAL is enabled.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An advertisement data that contains manufacturing data</title><link>https://devzone.nordicsemi.com/thread/466657?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2024 06:27:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2df7428b-bbdb-4c96-99b5-bd8c72b14d83</guid><dc:creator>SunHuang</dc:creator><description>&lt;p&gt;&lt;span&gt;The problem has been solved. If there is any mistake in my method, please tell me.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Just add CONFIG_BT_MAX_CONN in multiprotocol_rpmsg and set the value to 2. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The device advertises&amp;nbsp;after I connect to the device.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An advertisement data that contains manufacturing data</title><link>https://devzone.nordicsemi.com/thread/466647?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2024 02:19:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a4c9414-ecaf-4524-ac40-628ab689093d</guid><dc:creator>SunHuang</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi Edvin&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;thank you for your information&lt;span&gt;,&amp;nbsp;&lt;/span&gt;I used &lt;span&gt;option&amp;nbsp;&lt;/span&gt;1 and sure it works&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In addition, I expect that the BLE peripheral(&lt;span&gt;nus&lt;/span&gt;) can connect to multiple devices at any point in time&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;But when I restarted the Advertising, it failed.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1706581172931v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1706581127160v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;example:C:\ncs\v2.5.1\nrf\samples\matter\lock&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An advertisement data that contains manufacturing data</title><link>https://devzone.nordicsemi.com/thread/466452?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 11:11:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cee3712c-2b55-4b4b-a0e9-89b920aad002</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;As I see it, you have two options.&lt;/p&gt;
&lt;p&gt;1: Advertise with your custom data only whenever you are not advertising your Matter services (so when your Matter service advertising data times out, or stops due to another reason, like a connection or something).&lt;/p&gt;
&lt;p&gt;2: Modify modules\lib\matter\src\platform\Zephyr\BLEmanagerImpl.cpp and add more data to the advertising data used during the Matter service advertising.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;These are the two options that our Matter team provided.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If neither of these are suitable, you would need to implement something that alternates advertising with the Matter service and your custom advertisements. You can look at the ncs\nrf\samples\bluetooth\multiple_adv_sets for reference. However I am not sure exactly how to do that, since the advertising of the matter stack seems to be quite far down in the stack, so it will be difficult to do without changing anything in the Matter files.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An advertisement data that contains manufacturing data</title><link>https://devzone.nordicsemi.com/thread/466377?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2024 02:17:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77e2d610-b21e-44b7-b449-393eaf5a6c85</guid><dc:creator>SunHuang</dc:creator><description>&lt;p&gt;Hi Edvin&lt;/p&gt;
&lt;p&gt;I can understand your reply, but I&amp;#39;m not sure that PrepareAdvertisingRequest()&amp;nbsp; is allowed to be modified.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An advertisement data that contains manufacturing data</title><link>https://devzone.nordicsemi.com/thread/465784?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2024 12:25:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf14ec50-c830-471c-a292-1dc47437505d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;After digging a while through the Matter advertising implementation, I see that it definitely has an impact on the advertising data. The reason the device name stays is that the Matter stack will use the device name as well.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;After talking to our Matter team, I got some info on how the BLE advertising part of the Matter stack works.&lt;/p&gt;
&lt;p&gt;Basically, the Matter advertisements is it&amp;#39;s own set. It doesn&amp;#39;t matter what you put in your own advertising packets using the Bluetooth Stack directly. When you start advertising your Matter service, it will override whatever you were doing. If you want to keep your advertisements while using the Matter stack, you need to use it&amp;#39;s API. The way that the Matter stack uses BLE advertisements is that it has several sets of advertisements, and it can only advertise one set at the time. The priority of the Matter advertising set is always the highest one. When it stops advertising with it&amp;#39;s Matter set, it will then start with the next advertising set in the queue, with the highest priority.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;It was designed in such a way, because the Matter advertising times out after 15 minutes, and sometimes the user may want to advertise longer or permanently (e.g. we do this in the NUS or DFU over BT SMP pusporses). It is not a problem that during the first 15 minutes we do not advertise NUS or SMP data, because the support for these services can be discovered using GATT discovery anyway.&lt;/p&gt;
&lt;p&gt;The customer would need to modify modules\lib\matter\src\platform\Zephyr\BLEManagerImpl.cpp and add more data to the advertising data used during the Matter service advertising if they want to add custom data to the Matter service advertising set. In theory the advertising arbiter could try to combine the advertising data from N requests as long as they fit in 31 bytes, but we haven&amp;#39;t done this so far.&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So it is possible to add some custom data, but it is not straight forward. You can have a look at the&amp;nbsp;&lt;span&gt;BLEManagerImpl.cpp and see if you can fit any more custom data without overflowing the 31 byte limit. I think&amp;nbsp;PrepareAdvertisingRequest() is the place to start. If that doesn&amp;#39;t work, you will need to use a different advertising set, but you will not be able to use this at the same time as you are advertising your Matter service.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An advertisement data that contains manufacturing data</title><link>https://devzone.nordicsemi.com/thread/465696?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2024 00:51:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63a82cba-63c3-4619-99c2-0c861724dacc</guid><dc:creator>SunHuang</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Edvin&lt;/p&gt;
&lt;p&gt;I created a custom service similar to Nordic UART Service (NUS) and it broadcasts the device name&lt;span&gt;(7 bytes)&lt;/span&gt; and manufacturing data(12 bytes) correctly.&lt;/p&gt;
&lt;p&gt;But when I switch to matter broadcast, the &lt;span&gt;manufacturing data&lt;/span&gt; disappears, only the device name remains.&lt;/p&gt;
&lt;p&gt;I think they should be stored in different data structures，and&amp;nbsp;I know that &amp;quot;bt_set_name&amp;quot; function can change the device name of matter&amp;nbsp;&lt;span&gt;broadcast.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The manufacturer data specification documented in 5.4.2.8 Manufacturer-specific data from Matter-Core-Specification, Version 1.2.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An advertisement data that contains manufacturing data</title><link>https://devzone.nordicsemi.com/thread/465474?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2024 06:02:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:444d04c2-98f1-41c8-b4c2-310e74345c8e</guid><dc:creator>SunHuang</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Edvin&lt;/p&gt;
&lt;p&gt;I created a custom service similar to Nordic UART Service (NUS) and it broadcasts the device name&lt;span&gt;(7 bytes)&lt;/span&gt; and manufacturing data(12 bytes) correctly.&lt;/p&gt;
&lt;p&gt;But when I switch to matter broadcast, the &lt;span&gt;manufacturing data&lt;/span&gt; disappears, only the device name remains.&lt;/p&gt;
&lt;p&gt;I think they should be stored in different data structures，and&amp;nbsp;I know that &amp;quot;bt_set_name&amp;quot; function can change the device name of matter&amp;nbsp;&lt;span&gt;broadcast.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An advertisement data that contains manufacturing data</title><link>https://devzone.nordicsemi.com/thread/465326?ContentTypeID=1</link><pubDate>Mon, 22 Jan 2024 13:17:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef55c5da-0b30-4a8a-bcfd-379e718ca5b9</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;How much data are you trying to push out through the advertising packet?&lt;/p&gt;
&lt;p&gt;The Flags are only a couple of bytes, and then you have 12 bytes of manufacturer specific data. What is the CONFIG_BT_DEVICE_NAME? How many ascii-characters?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Remember that all BLE advertising is limited to 31 bytes, so if your device name is 20 characters, that leaves only 11 bytes for the rest. See if you can get the manufacturer specific data if you remove the BT_DATA_NAME_COMPLETE from your advertising data (as a test).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If it doesn&amp;#39;t work, what is the return value from bt_le_adv_start()? Try printing it to your log.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An advertisement data that contains manufacturing data</title><link>https://devzone.nordicsemi.com/thread/465209?ContentTypeID=1</link><pubDate>Mon, 22 Jan 2024 02:31:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62ad6fbe-004f-4be1-a3e8-a5b22c9d1625</guid><dc:creator>SunHuang</dc:creator><description>&lt;p&gt;Hi Edvin&lt;/p&gt;
&lt;p&gt;The problem I am currently encountering is that the advertisement data of matter cannot be accompanied by &lt;span&gt;manufacturing data&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;when I turn on the discoverable over Bluetooth LE(Matter), the manufacturing data were disappeared&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1705890134570v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The dynamically changing &lt;span&gt;advertisement data&lt;/span&gt; part should have been completed, but it seems that only work with &amp;quot;general&amp;quot; BLE broadcasts&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void Sunion::BleService::SetManufData(uint8_t *buff)
{
	int err = 0;
    bt_le_adv_param advParams;
    advParams.id           = BT_ID_DEFAULT;
    advParams.options      = BT_LE_ADV_OPT_CONNECTABLE | BT_LE_ADV_OPT_ONE_TIME;
    advParams.interval_min = mAdvertisingRequest.minInterval;
    advParams.interval_max = mAdvertisingRequest.maxInterval;

	const bt_data scanResponseData[]    = { BT_DATA(BT_DATA_UUID128_ALL, kBTUuid, sizeof(kBTUuid)) };
	const bt_data * scanResponseDataPtr = sizeof(kBTUuid) &amp;gt; 0 ? scanResponseData : nullptr;
	const size_t scanResponseDataLen    = sizeof(kBTUuid) &amp;gt; 0 ? sizeof(scanResponseData) / sizeof(scanResponseData[0]) : 0u;

	const char *name = bt_get_name();
    const bt_data advertisingData[] = { BT_DATA(BT_DATA_FLAGS, &amp;amp;kAdvertisingFlags, sizeof(kAdvertisingFlags)),
                                        BT_DATA(BT_DATA_NAME_COMPLETE, name, strlen(CONFIG_BT_DEVICE_NAME)),
										BT_DATA(BT_DATA_MANUFACTURER_DATA, buff, 12) };


    // Restart advertising
    err = bt_le_adv_stop();
    // VerifyOrReturnError(err == 0, MapErrorZephyr(err));

    err = bt_le_adv_start(&amp;amp;advParams, advertisingData, sizeof(advertisingData) / sizeof(advertisingData[0]), scanResponseDataPtr,
                          scanResponseDataLen);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An advertisement data that contains manufacturing data</title><link>https://devzone.nordicsemi.com/thread/465094?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 15:08:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32090ccc-7d87-4b99-a85a-bd971b02ec2d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;By dynamically, I assume you mean during runtime?&lt;/p&gt;
&lt;p&gt;If so, you can have a look at this little side project I did once.&lt;/p&gt;
&lt;p&gt;In &lt;a href="https://github.com/edvinand/OmegaV_BLE_Course/blob/main/kahoot/kahoot_p/src/main.c"&gt;main.c&lt;/a&gt; I only used the function simple_ad_start(), which is defined in the file &lt;a href="https://github.com/edvinand/OmegaV_BLE_Course/blob/main/kahoot/kahoot_p/src/custom_files/remote.c"&gt;remote.c&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It is a bit messy, but I hope it may give an idea for you to start with.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>