<?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>Measure the length of the advertisement buffer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58166/measure-the-length-of-the-advertisement-buffer</link><description>Hi, 
 
 How do I measure the length of the created advertisement buffer? I want to add two UUIDs in the packet and the device is resetting. I guess the length is the issue. 
 
 // YOUR_JOB: Use UUIDs for service(s) used in your application. static ble_uuid_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Feb 2020 15:59:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58166/measure-the-length-of-the-advertisement-buffer" /><item><title>RE: Measure the length of the advertisement buffer</title><link>https://devzone.nordicsemi.com/thread/236049?ContentTypeID=1</link><pubDate>Mon, 24 Feb 2020 15:59:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a24ee1c6-b6cc-4fef-aa05-3107b232e2c7</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]the device is resetting[/quote]
&lt;p&gt;Usually&amp;nbsp;that happens because you entered the&amp;nbsp;&lt;span&gt;app_error_fault_handler(). If you are using SES, use the Debug configuration:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-ad36e0f0ed40442a90b297f7aeb1f616/pastedimage1582559279014v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
[quote user=""]How do I measure the length of the created advertisement buffer?[/quote]
&lt;p&gt;&lt;span&gt;As far as I know&lt;/span&gt;, there is no function to get the current length. If you try to add too much data,&amp;nbsp;ble_advertising_init() will return&amp;nbsp;NRF_ERROR_DATA_SIZE.&lt;/p&gt;
[quote user=""]This does not work. If I comment out the second UUID, then only it works.[/quote]
&lt;p&gt;&lt;span&gt;&lt;/span&gt;Try adding the UUIDs to the scan response data instead of advdata, snippet from advertising_init():&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.srdata.uuids_complete.p_uuids  = m_adv_uuids;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>