<?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 to update advertised TX power?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/55296/how-to-update-advertised-tx-power</link><description>Using the 15.3 SDK and the 6.1 software device I am successfully changing the transmit power as needed. When not connected and advertising I would like to update the advertised TX power initialized with: 
 init.srdata.p_tx_power_level 
 I have read multiple</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Jan 2020 14:11:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/55296/how-to-update-advertised-tx-power" /><item><title>RE: How to update advertised TX power?</title><link>https://devzone.nordicsemi.com/thread/228588?ContentTypeID=1</link><pubDate>Fri, 10 Jan 2020 14:11:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be931a96-3adf-46cf-876f-d4b4cfce40ca</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Michael,&lt;/p&gt;
&lt;p&gt;As Susheel wrote, the only thing you need to do to update the advertising data in the scan response or advertising packet is to call&amp;nbsp;sd_ble_gap_adv_set_configure() with the new advertising buffer. So essentially you just build it like before, changing the tx_power field. Since you are just updating the advertising data, the third/last parameter should be NULL, to keep the old configuration. If you are currently advertising, you need to use a different memory buffer for the advertising set, since the SoftDevice does not allow updating an advertising buffer that is currently in use.&lt;/p&gt;
&lt;p&gt;You can refer to the attached file, which is the BLE blinky application for SDK 15.3, modified so that you can pus button 2 to change the Tx power and the Tx power that is advertised. This drops right into the BLE Blinky example application project if you want to test it.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-db6d827f98e447f1b927dad9eb53d751/main.c"&gt;devzone.nordicsemi.com/.../main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to update advertised TX power?</title><link>https://devzone.nordicsemi.com/thread/228493?ContentTypeID=1</link><pubDate>Fri, 10 Jan 2020 08:51:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:036015fb-e130-4b66-8d6a-a76287cebdd7</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Sorry Michael, I am sick at home and trying to answer questions that i already know. I have asked my colleagues to take a look at this. Sorry for the delays.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to update advertised TX power?</title><link>https://devzone.nordicsemi.com/thread/228434?ContentTypeID=1</link><pubDate>Thu, 09 Jan 2020 19:35:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62cf92ee-21c9-4917-97cf-ca9cc17965cb</guid><dc:creator>Michael M</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;I noticed you were back from the holidays and responding to new questions.&lt;/p&gt;
&lt;p&gt;Any progress on my example request of a month ago?&lt;/p&gt;
&lt;p&gt;Looking forward to hearing from you!&lt;/p&gt;
&lt;p&gt;Sincerely,&lt;/p&gt;
&lt;p&gt;Michael&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to update advertised TX power?</title><link>https://devzone.nordicsemi.com/thread/226504?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2019 09:15:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52602ef2-b070-483d-b58b-0fe7101c9412</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;We do not have any example to show you, but I can make a simple one like you initially requested but unfortunately I can only do that after i come back from the holidays after the new year. I will keep this case open in my queue until then as a reminder.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to update advertised TX power?</title><link>https://devzone.nordicsemi.com/thread/225700?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2019 14:47:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52c0003f-b116-4f3b-88c2-7b175684a2e2</guid><dc:creator>Michael M</dc:creator><description>&lt;p&gt;HI Susheel:&lt;/p&gt;
&lt;p&gt;I&amp;#39;m glad you now understand my question and thank you for answering so promptly.&lt;/p&gt;
&lt;p&gt;in my original question I stated, &amp;quot;&lt;span&gt;Given advertising the transmit power must be a rather routine situation I&amp;#39;m assuming there is some simple way to do the update.&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;If I understand your answer correctly, the only way to update the advertised transmit power is to create another advertising set??&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I really think there should be a simple call like &lt;em&gt;sd_ble_gap_adv_enable_actual_tx_power&lt;/em&gt;. &amp;nbsp; Just a suggestion!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;With regard to your assumption I&amp;#39;m using&amp;nbsp;sd_ble_gap_adv_set_configure initially, &lt;span style="text-decoration:underline;"&gt;I&amp;#39;m not&lt;/span&gt;. &amp;nbsp;In order to include TX Power in&amp;nbsp;the advertisement packet you&amp;nbsp;have to set &amp;nbsp;&lt;/span&gt;init.srdata.p_tx_power_level to some value which I&amp;#39;m doing in the advertising_init(). &amp;nbsp;Thereafter I have no need of additional advertising sets because the only data within the advertising packets I need to update is the TX Power .. hence my question.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;With regard to your pseudocode and your advice to look at&amp;nbsp;&lt;em&gt;ble_app_hrs:main.c &lt;/em&gt;&lt;/span&gt;as and example of using&amp;nbsp;&lt;span&gt;&lt;em&gt;sd_ble_gap_adv_set_configure&amp;nbsp;&lt;/em&gt;&lt;/span&gt;... It doesn&amp;#39;t exist!! &amp;nbsp;The following is a grep of the example looking for it.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;pwd
/Users/MM/Desktop/RF5_SDK_15.3.0/examples/ble_peripheral/ble_app_hrs
$ls
ble_app_hrs.eww	main.c		pca10040e	pca10056e
hex		pca10040	pca10056	pca10059
$grep &amp;quot;sd_ble_gap_adv_set_configure&amp;quot; *.[ch]
$&lt;/pre&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;Just to let you know the DevZone answers are rampant with responses to questions with links to things that don&amp;#39;t exist, broken links or irrelevant links for current SDKs. &amp;nbsp;You just added one more!&lt;/p&gt;
&lt;p&gt;So, could you provide an example of how I should update the advertised transmit power which exists?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to update advertised TX power?</title><link>https://devzone.nordicsemi.com/thread/225553?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2019 09:09:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:441c6e94-cfda-4c3b-9e87-051f0b985f95</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I assume that you already have used&amp;nbsp;sd_ble_gap_adv_set_configure to initally transmit a UUID+TX_POWER. I thought that you just wanted to know exactly when to update it. encoding your UUID+TX_Power is something you must have already done in your&amp;nbsp;advertising_init function&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to update advertised TX power?</title><link>https://devzone.nordicsemi.com/thread/225552?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2019 09:07:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b85c9e0-6230-4add-8645-64647cff84c2</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Ah, sorry about that, I totally misread your question.&lt;/p&gt;
&lt;p&gt;The default transmit power is always set to 0dBm which can also be the default value you include in your advertising packet.&lt;/p&gt;
&lt;p&gt;The application has to manually change the advertising power whenever needed and when the application does it, it can actually change the advertising parameters when it chagnes the TX power. For example a pseudocode could be&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void lost_connection()
{
    // attempt to increase the adv tx power to regain connection
    sd_ble_gap_tx_power_set

    // readjust the adv packet to reflect the above chagne    
    sd_ble_gap_adv_set_configure // look for the examples in ble_app_hrs:main.c
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to update advertised TX power?</title><link>https://devzone.nordicsemi.com/thread/225479?ContentTypeID=1</link><pubDate>Sat, 14 Dec 2019 00:24:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfa1fc39-d5b2-408b-9ec6-f2cd2bdf788a</guid><dc:creator>Michael M</dc:creator><description>&lt;p&gt;I think you misunderstood. &amp;nbsp;As I stated, &amp;quot;How to update ADVERTISED TX power?&amp;quot; &amp;nbsp;I understand setting the transmit power will change the transmit power for advertisements but what it doesn&amp;#39;t change is the content of the advertisement which in my case includes a custom service UUID and TX Power.&lt;/p&gt;
&lt;p&gt;I can&amp;nbsp;rephrase this:&amp;nbsp;how do I update the advertisement information contained in the advertisement packet to indicate properly the actual transmit power being used to transmit the advertisement??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to update advertised TX power?</title><link>https://devzone.nordicsemi.com/thread/224082?ContentTypeID=1</link><pubDate>Fri, 06 Dec 2019 08:32:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1758c3ea-b23d-485d-8f75-cf821b217c80</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;calling to&amp;nbsp;sd_ble_gap_tx_power_set&lt;span&gt;&amp;nbsp;should the tx power of the radio in any role. Just call this function and set to the tx power you need before starting to advertise&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>