<?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>Update advertising packet with battery level in nrf52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45701/update-advertising-packet-with-battery-level-in-nrf52832</link><description>Dear Sir, 
 
 I am using nrf52832. 
 SDK 15 
 soft device s132. 
 
 I need to add the battery level also to the advertising packet. 
 Currently I have done code to read the battery level using SAADC. 
 
 
 
 And I have used a timer to update the battery</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 12 Apr 2019 04:37:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45701/update-advertising-packet-with-battery-level-in-nrf52832" /><item><title>RE: Update advertising packet with battery level in nrf52832</title><link>https://devzone.nordicsemi.com/thread/181738?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 04:37:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46e5f774-61f7-4df1-9f72-811cdf261a3d</guid><dc:creator>Fred</dc:creator><description>&lt;p&gt;I guess you&amp;#39;re correct. See &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fmigration.html" rel="noopener noreferrer" target="_blank"&gt;this&lt;/a&gt; migration guide.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update advertising packet with battery level in nrf52832</title><link>https://devzone.nordicsemi.com/thread/181730?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 02:44:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6d48286-0ec7-4455-923c-7a3a85d51ee9</guid><dc:creator>GK</dc:creator><description>&lt;p&gt;Dear Sir,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your reply.&lt;/p&gt;
&lt;p&gt;But in SDK15 this function is not available in ble_gap.h, I think.&lt;/p&gt;
&lt;p&gt;Please correct me if I am wrong.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update advertising packet with battery level in nrf52832</title><link>https://devzone.nordicsemi.com/thread/181212?ContentTypeID=1</link><pubDate>Wed, 10 Apr 2019 06:15:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f660ced4-1362-4dbb-9463-4a6ed1250f05</guid><dc:creator>Fred</dc:creator><description>&lt;p&gt;My mistake, sorry. It&amp;#39;s available in ble_gap.h.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update advertising packet with battery level in nrf52832</title><link>https://devzone.nordicsemi.com/thread/181210?ContentTypeID=1</link><pubDate>Wed, 10 Apr 2019 06:11:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d3d7533-ce7a-4581-ad77-d75b4011eabb</guid><dc:creator>GK</dc:creator><description>&lt;p&gt;Hi, Thank you for your reply. I think the fuction &amp;quot;sd_ble_gap_adv_data_set()&amp;quot; is not avaialble in SDK15. I could not find the function declaration in the file (ble_advdata.h.) you specified.Please confirm it and let me know if I am wrong.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update advertising packet with battery level in nrf52832</title><link>https://devzone.nordicsemi.com/thread/180142?ContentTypeID=1</link><pubDate>Thu, 04 Apr 2019 05:45:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4be574f8-507a-4275-a728-4eb0a8f64c63</guid><dc:creator>Fred</dc:creator><description>&lt;p&gt;That function is&amp;nbsp;available by including ble_advdata.h. About the location, that depends on your application of course. Given the fact that you&amp;#39;re using a timer to update the battery level, I guess that you&amp;#39;re continuously advertising? You could try calling the function in the timeout of your battery update (be sure to check the return of the function). If you&amp;#39;re only advertise for a certain moment and then stop, you could call the function just be fore you restart advertising.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update advertising packet with battery level in nrf52832</title><link>https://devzone.nordicsemi.com/thread/180136?ContentTypeID=1</link><pubDate>Thu, 04 Apr 2019 03:51:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c41e1bcf-e18e-4b56-94bc-26a01dc54590</guid><dc:creator>GK</dc:creator><description>&lt;p&gt;Hi, Thank you for your response.&lt;/p&gt;
&lt;p&gt;But is this function&amp;quot;sd_ble_gap_adv_data_set()&amp;quot;&amp;nbsp; available in SDK15?..&lt;/p&gt;
&lt;p&gt;I am a little confused about the locatin at which the functions to be called..&lt;/p&gt;
&lt;p&gt;If possible please provide the main.c file for the same.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanking you in advance.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;with regards,&lt;/p&gt;
&lt;p&gt;Geetha&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update advertising packet with battery level in nrf52832</title><link>https://devzone.nordicsemi.com/thread/180106?ContentTypeID=1</link><pubDate>Wed, 03 Apr 2019 18:55:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8958d559-e4ee-4d70-b160-7d9e9747e93c</guid><dc:creator>Fred</dc:creator><description>&lt;p&gt;In my application I add so called &amp;quot;Manufacturer Specific Data&amp;quot; to the advertising packet to store status information like the battery level. You can add this data during initialization of the advertising:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ble_advertising_init_t init;
memset(&amp;amp;init, 0, sizeof(init));

ble_advdata_manuf_data_t manuf_data;    //Variable to hold manufacturer specific data
manuf_data.company_identifier = 0xFFFF; // See https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
manuf_data.data.p_data        = &amp;amp;m_adv_data[APP_ADV_STATUS_IDX];
manuf_data.data.size          = 6; // Or whatever size your data has.
init.advdata.p_manuf_specific_data = &amp;amp;manuf_data;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can then update the advertising data by manipulating the manufacturing data:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ret_code_t err_code = sd_ble_gap_adv_data_set( m_adv_data, sizeof(m_adv_data), NULL, 0 );
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>