<?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>Just Set Tx Power?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37928/just-set-tx-power</link><description>I just want to globally set the power level, and forget about it. 
 I have seen this post, and it still seems unclear how to do this - or if it&amp;#39;s even possible. 
 Is there a way that I can simply set this once at startup, and then it will never change</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 04 Oct 2018 11:33:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37928/just-set-tx-power" /><item><title>RE: Just Set Tx Power?</title><link>https://devzone.nordicsemi.com/thread/151644?ContentTypeID=1</link><pubDate>Thu, 04 Oct 2018 11:33:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc158c70-177a-4e04-a933-438ae215e00b</guid><dc:creator>awneil</dc:creator><description>[quote userid="7377" url="~/f/nordic-q-a/37928/just-set-tx-power/146239"]For the central it is the same, you only need to set it once with the scanner/initiator role (&lt;code&gt;BLE_GAP_TX_POWER_ROLE_SCAN_INIT&lt;/code&gt;),[/quote]
&lt;p&gt;So, in the Central, I just need to do that before my first call to&amp;nbsp;sd_ble_gap_scan_start() ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Just Set Tx Power?</title><link>https://devzone.nordicsemi.com/thread/146945?ContentTypeID=1</link><pubDate>Mon, 03 Sep 2018 10:54:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3714e191-eca9-417e-a458-99c0409be4f2</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;I see.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Just Set Tx Power?</title><link>https://devzone.nordicsemi.com/thread/146940?ContentTypeID=1</link><pubDate>Mon, 03 Sep 2018 10:28:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19f6d0f8-aef1-44a3-a917-974689495e7b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Yes, might look a bit strange. As the handle parameter can be used to pass both a connection handle (uint16_t) and an advertising handle (uint8_t), it has to be scaled for the larger one.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Just Set Tx Power?</title><link>https://devzone.nordicsemi.com/thread/146835?ContentTypeID=1</link><pubDate>Fri, 31 Aug 2018 20:17:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5811ee4-dcef-40c8-aacd-c17b09fa4203</guid><dc:creator>awneil</dc:creator><description>[quote userid="7377" url="~/f/nordic-q-a/37928/just-set-tx-power/146255"]&lt;code&gt;m_advertising.adv_handle&lt;/code&gt; in most SDK examples[/quote]
&lt;p&gt;In the v15.0.0 SDK NUS peripheral example,&amp;nbsp;&lt;code&gt;m_advertising.adv_handle&lt;/code&gt;&lt;span&gt;&amp;nbsp;is a&amp;nbsp;uint&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;8&lt;/strong&gt;&lt;/span&gt;_t&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But the handle parameter for&amp;nbsp;sd_ble_gap_tx_power_set() is&amp;nbsp;uint&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;16&lt;/strong&gt;&lt;/span&gt;_t&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Just Set Tx Power?</title><link>https://devzone.nordicsemi.com/thread/146255?ContentTypeID=1</link><pubDate>Wed, 29 Aug 2018 08:59:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b19cb9ce-7b45-495b-99de-046cebae653a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;The &lt;code&gt;handle &lt;/code&gt;parameter depends on the value of the &lt;code&gt;role&lt;/code&gt; parameter:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For the&amp;nbsp; &lt;code&gt;BLE_GAP_TX_POWER_ROLE_CONN&lt;/code&gt; role, the handle is the connection handle that you for instance get from the&amp;nbsp;&lt;code&gt;BLE_GAP_EVT_CONNECTED&lt;/code&gt; event. (Most SDK examples put this is a global variable called&amp;nbsp;&lt;code&gt;m_conn_handle&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;For the&amp;nbsp;&lt;code&gt;BLE_GAP_TX_POWER_ROLE_ADV&lt;/code&gt; role, the handle is the&amp;nbsp;advertising set handle. Assuming you use the SDK advertising module you can get this from the ble_advertising_tinstance you passed to&amp;nbsp;&lt;code&gt;ble_advertising_init()&lt;/code&gt; after it returns. It would be &lt;code&gt;ble_advertising_t::adv_handle &lt;/code&gt;(&lt;code&gt;m_advertising.adv_handle&lt;/code&gt; in most SDK examples). I have to admit that this is a bit weird, as the SoftDevice only support a single advertising set...&lt;/li&gt;
&lt;li&gt;For the&amp;nbsp;&lt;code&gt;BLE_GAP_TX_POWER_ROLE_SCAN_INIT&lt;/code&gt; role the handle is ignored, so you can set anything.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Just Set Tx Power?</title><link>https://devzone.nordicsemi.com/thread/146243?ContentTypeID=1</link><pubDate>Wed, 29 Aug 2018 08:23:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5afa3285-7489-43db-9943-d09359313be3</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;So where does the &amp;#39;&lt;strong&gt;handle&lt;/strong&gt;&amp;#39; parameter come from ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Just Set Tx Power?</title><link>https://devzone.nordicsemi.com/thread/146239?ContentTypeID=1</link><pubDate>Wed, 29 Aug 2018 08:10:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be8a4879-4378-46d6-a56b-7cae71fd46c4</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v6.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_37#gad10e80ba20ddab42d1753fd1be2d8c26"&gt;sd_ble_gap_tx_power_set()&lt;/a&gt;&lt;/code&gt; function was updated in version 6.0.0 of the SoftDevices, and now allows you to set the TX power per connection. This does not mean that you have to set it per connection, though.&lt;/p&gt;
&lt;p&gt;As a peripheral, any connection inherits the TX power that was set for the advertising role (&lt;code&gt;BLE_GAP_TX_POWER_ROLE_ADV&lt;/code&gt;), so you only need to set it once before the first connection is made to get the same behavior as before. For the central it is the same, you only need to set it once with the scanner/initiator role (&lt;code&gt;BLE_GAP_TX_POWER_ROLE_SCAN_INIT&lt;/code&gt;), and then this is used for the connection as well unless you make a new call to&amp;nbsp;&lt;code&gt;sd_ble_gap_tx_power_set()&lt;/code&gt; with the&amp;nbsp;&lt;code&gt;BLE_GAP_TX_POWER_ROLE_CONN&lt;/code&gt; and a connection handle.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>