<?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>scan and parse manufacturer specific data (zephyr)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84753/scan-and-parse-manufacturer-specific-data-zephyr</link><description>Hi. 
 Hope someone could help me on how to scan and parse the Manufacturer Specific Data that comes after the Company ID. I am using zephyr with nRF52840. 
 Thanks!</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Feb 2022 09:55:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84753/scan-and-parse-manufacturer-specific-data-zephyr" /><item><title>RE: scan and parse manufacturer specific data (zephyr)</title><link>https://devzone.nordicsemi.com/thread/353544?ContentTypeID=1</link><pubDate>Thu, 17 Feb 2022 09:55:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac155bcc-2b57-4d7e-9403-afc1e7ca9742</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;My colleague has provided you with what should be a working example in your&lt;a href="https://devzone.nordicsemi.com/support-private/support/283905"&gt; private ticket&lt;/a&gt;, and has requested that you continue the discussion there.&lt;/p&gt;
&lt;p&gt;For any other DevZone users finding this thread, modify the Zephyr beacon sample accordingly:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static char mfg_data[] = &amp;quot;simon_manuf&amp;quot;;

static const struct bt_data ad[] = {
	BT_DATA(BT_DATA_MANUFACTURER_DATA, mfg_data, sizeof(mfg_data)),
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Program that onto I.E. an nRF52840 DK or Dongle, then modify the observer sample like this and program that onto another DK:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static bool data_cb(struct bt_data *data, void *user_data)
{
	char *name = user_data;
	uint8_t len;

	switch (data-&amp;gt;type) {
	case BT_DATA_MANUFACTURER_DATA:
		len = MIN(data-&amp;gt;data_len, NAME_LEN - 1);
		memcpy(name, data-&amp;gt;data, len);
		name[len] = &amp;#39;\0&amp;#39;;
		return false;
	default:
		return true;
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: scan and parse manufacturer specific data (zephyr)</title><link>https://devzone.nordicsemi.com/thread/353438?ContentTypeID=1</link><pubDate>Wed, 16 Feb 2022 16:07:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80e6775d-cf6f-48ba-8acf-36f10cef167c</guid><dc:creator>Oli</dc:creator><description>&lt;p&gt;What I am trying to do is in this thread:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/58478/parsing-adv-data---manufacturer-data-parsing"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/58478/parsing-adv-data---manufacturer-data-parsing&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But the difference is that I am using zephyr. The screenshot that he presented was accurate. I want also to parse the same data. The above thread was also not answered.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am sure that the advertising devices are transmitting manufacturer specific data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yes. I print the data using a the terminal but it is garbage data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Oli&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: scan and parse manufacturer specific data (zephyr)</title><link>https://devzone.nordicsemi.com/thread/353301?ContentTypeID=1</link><pubDate>Wed, 16 Feb 2022 09:36:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7dab524-4ac4-4fb1-b9b2-c34879bc841a</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What do you see on the central side when the bt_data_parse() when using the &amp;quot;ad&amp;quot; parameter that is supposed to parse the advertising data as given to the bt_le_scan_cb_t callback? Do you print this data so you should be able to see the advertising data on a terminal for example? And are you certain that the advertising device is transmitting its manufacturer specific data? As far as I know, the bt_data_parse function should be the way to help you see additional advertiisng data.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: scan and parse manufacturer specific data (zephyr)</title><link>https://devzone.nordicsemi.com/thread/353172?ContentTypeID=1</link><pubDate>Tue, 15 Feb 2022 16:46:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:827d2013-e91f-4011-93ad-5dd240860417</guid><dc:creator>Oli</dc:creator><description>&lt;p&gt;It will just be a scanner retrieving the advertising data. I have used the function&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/bluetooth/gap.html?highlight=parse%20data#c.bt_data_parse"&gt;bt_data_parse&lt;/a&gt;&lt;span&gt;() but I still cannot get the Manufacturer Data.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: scan and parse manufacturer specific data (zephyr)</title><link>https://devzone.nordicsemi.com/thread/353124?ContentTypeID=1</link><pubDate>Tue, 15 Feb 2022 14:06:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0006aa9-88ca-42c5-881f-e772afc5fc0f</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;First off, is the central device going to connect to the peripheral device or will it just be a scanner retrieving advertising data from nearby peripherals? Have you added the manufacturer specific data as part of the advertising data in your peripheral application?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The best way to parse advertising data is to use the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/bluetooth/gap.html?highlight=parse%20data#c.bt_data_parse"&gt;bt_data_parse&lt;/a&gt;() helper function on the received adv data &lt;span&gt;given to the bt_le_scan_cb_t callback.&amp;nbsp;You can check out the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/bluetooth/central_hr/README.html"&gt;central_hr sample project &lt;/a&gt;for an example on how this function can be used.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>