<?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>How do I advertise both manufacturer and custom service?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113653/how-do-i-advertise-both-manufacturer-and-custom-service</link><description>I want to advertise a custom service so my central can filter for it and have a device name and manufacturer. I have the following code but can only seem to do either the manufacturer or the custom service but not at the same time.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 Aug 2024 13:31:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113653/how-do-i-advertise-both-manufacturer-and-custom-service" /><item><title>RE: How do I advertise both manufacturer and custom service?</title><link>https://devzone.nordicsemi.com/thread/497643?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2024 13:31:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ccd3ce7-a3c5-4dea-b2f8-3b55e761c1cd</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Hi Leo, sorry for the delay.&lt;/p&gt;
&lt;p&gt;You can advertise both manufacturer data and custom service data at the same time by including both in your `bt_data` array. However, you need to be aware of the maximum advertisement data size. The total size of advertisement data cannot exceed 31 bytes due to the Bluetooth specification. If you have more data, you may need to use the scan response to fit the additional data.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static const struct bt_data ad[] = {

    BT_DATA_BYTES(BT_DATA_FLAGS, BT_LE_AD_NO_BREDR),

    BT_DATA_BYTES(BT_DATA_UUID16_ALL, 0xaa, 0xfe),

    BT_DATA_BYTES(BT_DATA_SVC_DATA16,

              0xaa, 0xfe, /* Eddystone UUID */

              0x10, /* Eddystone-URL frame type */

              0x00, /* Calibrated Tx power at 0m */

              0x00, /* URL Scheme Prefix http://www. */

              &amp;#39;z&amp;#39;, &amp;#39;e&amp;#39;, &amp;#39;p&amp;#39;, &amp;#39;h&amp;#39;, &amp;#39;y&amp;#39;, &amp;#39;r&amp;#39;,

              &amp;#39;p&amp;#39;, &amp;#39;r&amp;#39;, &amp;#39;o&amp;#39;, &amp;#39;j&amp;#39;, &amp;#39;e&amp;#39;, &amp;#39;c&amp;#39;, &amp;#39;t&amp;#39;,

              0x08) /* .org */

};

/* Set Scan Response data */

static const struct bt_data sd[] = {

    BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),

};

err = bt_le_adv_start(BT_LE_ADV_NCONN_IDENTITY, ad, ARRAY_SIZE(ad),

                  sd, ARRAY_SIZE(sd));

    if (err) {

        printk(&amp;quot;Advertising failed to start (err %d)\n&amp;quot;, err);

        return;

    }


&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In this example, &lt;code style="margin-bottom:8px;margin-top:8px;white-space:pre;" dir="ltr"&gt;ad&lt;/code&gt; is the advertising data and &lt;code style="margin-bottom:8px;margin-top:8px;white-space:pre;" dir="ltr"&gt;sd&lt;/code&gt; is the scan response data. &lt;code style="margin-bottom:8px;margin-top:8px;white-space:pre;" dir="ltr"&gt;bt_le_adv_start&lt;/code&gt; starts advertising with both the advertising data and the scan response data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I advertise both manufacturer and custom service?</title><link>https://devzone.nordicsemi.com/thread/496981?ContentTypeID=1</link><pubDate>Mon, 05 Aug 2024 12:58:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:485ada26-4f8c-4850-be84-774620eb69f6</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Hi Leo,&lt;/p&gt;
&lt;p&gt;I have started looking into this and will get back to you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>