<?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>Advertising Manufacturer data wrong after connect-&amp;gt;disconnect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35131/advertising-manufacturer-data-wrong-after-connect--disconnect</link><description>I implemented manufacturer specific advertising to transmit important data without having to connect to the ble peripheral. These data can change over time so I need to be able to update them. 
 I adapted advertising_init. I also programmed a function</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Jun 2018 12:29:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35131/advertising-manufacturer-data-wrong-after-connect--disconnect" /><item><title>RE: Advertising Manufacturer data wrong after connect-&gt;disconnect</title><link>https://devzone.nordicsemi.com/thread/136903?ContentTypeID=1</link><pubDate>Wed, 20 Jun 2018 12:29:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79c8f216-75d4-48a6-899e-61e5031b26e4</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Sorry for the delay.&lt;/p&gt;
&lt;p&gt;When you want to update the advertising data (both advertisement packet and/or scan response packet) without stopping the advertisement, you are correct in using the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/group__ble__sdk__lib__advdata.html#ga180ff4057a0763688c734e98ab8d976b"&gt;ble_advdata_set()&lt;/a&gt; function. &lt;br /&gt;This will in turn call the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v5.0.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html?cp=2_3_1_1_1_2_1_2_2#gaddbb12e078d536ef2e93b41d77ff6243"&gt;sd_ble_gap_adv_data_set()&lt;/a&gt; to pass encoded advertising data to the stack.&lt;/p&gt;
&lt;p&gt;When it comes to disable whitelist, you can take a look at this function; &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/group__ble__advertising.html#ga878a5f30eac47f2a2b9293ed0528aa01"&gt;ble_advertising_restart_without_whitelist() &lt;/a&gt;&lt;br /&gt;Note that this will restart the advertisment.&lt;/p&gt;
&lt;p&gt;If you have any problems using these functions, you could try debugging your application to find out more exactly what going wrong.&lt;br /&gt;If you can&amp;#39;t find the answer to your issue by searching around devzone, you are more than welcome to post follow-up questions here, and I&amp;#39;ll do my best to help you solve them. &lt;br /&gt;Posting your code might help shed som light on what the issue might be.&lt;/p&gt;
&lt;p&gt;Best regards, &lt;br /&gt;Joakim.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertising Manufacturer data wrong after connect-&gt;disconnect</title><link>https://devzone.nordicsemi.com/thread/136085?ContentTypeID=1</link><pubDate>Thu, 14 Jun 2018 08:22:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca9a4917-7aac-497f-9e77-a2d23ba1966c</guid><dc:creator>ckoechli</dc:creator><description>&lt;p&gt;I might have found the origin of the problem:&lt;/p&gt;
&lt;p&gt;To update the advertising information, I was calling the functions &lt;em&gt;advertising_stop&lt;/em&gt; to stop it,&amp;nbsp;&lt;em&gt;ble_advdata_set&lt;/em&gt;&amp;nbsp; (ble_advdata.c) to update the manufacturer data and&amp;nbsp; &lt;em&gt;advertising_start&lt;/em&gt; (main.c of the ble_app_template example) to restart advertising.&lt;/p&gt;
&lt;p&gt;The latter function calls &amp;nbsp;&lt;em&gt;ble_advertising_start&lt;/em&gt; passing &lt;em&gt;m_advertising&lt;/em&gt; as a parameter. I then noticed that&lt;em&gt; m_advertising&lt;/em&gt; was not updated by &lt;em&gt;ble_advdata_set &lt;/em&gt;probably causing the trouble.&lt;/p&gt;
&lt;p&gt;I also use the same advertising update function to suspend whitelisting (with m_advertising.whitelist_temporarily_disabled = true; ) and display a flag in the manufacturer data to tell the user that the peripheral is bondable.&lt;/p&gt;
&lt;p&gt;In order to solve the problem, I replaced the call to&amp;nbsp;&lt;em&gt;ble_advdata_set&lt;/em&gt; with a call to&lt;em&gt; advertising_init&lt;/em&gt;. I find it a bit ugly but at least it works.&lt;/p&gt;
&lt;p&gt;I realy need to:&lt;/p&gt;
&lt;p&gt;- enable and disable whitelisting&lt;/p&gt;
&lt;p&gt;- update the manufacturer data&lt;/p&gt;
&lt;p&gt;Is there a way to do it without stoping and restarting advertising ?&lt;/p&gt;
&lt;p&gt;if not is there a way to do a cleaner implementation without rewriting the ble_advertising functions ?&lt;/p&gt;
&lt;p&gt;Christian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertising Manufacturer data wrong after connect-&gt;disconnect</title><link>https://devzone.nordicsemi.com/thread/135058?ContentTypeID=1</link><pubDate>Thu, 07 Jun 2018 06:49:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df8e534a-9fed-4e64-9366-89771cfa9538</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;So the advertising is stopped when you establish a connection. And it seems that when you disconnect and your application receives the disconnection event, the advertising is restarted using the original advertisment data.&lt;/p&gt;
&lt;p&gt;I would take a look at how the disconnection event is handled, and make sure that the advertisment is started using the correct data.&lt;/p&gt;
&lt;p&gt;Also, as a side note; When posting a question on devzone, it is often easier to help solve your issue when information about which SDK, device, softdevice etc. is included in the question.&lt;/p&gt;
&lt;p&gt;Let me know if you have any further questions.&lt;/p&gt;
&lt;p&gt;Best regards, &lt;br /&gt;Joakim.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>