<?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>Question about BLE_GAP_TX_POWER_ROLE_CONN</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65051/question-about-ble_gap_tx_power_role_conn</link><description>Documentation states “When a connection is created it will inherit the transmit power from the initiator or advertiser leading to the connection.” In my BLE event handler, in the case GAP_BLE_EVT_CONNECTED, I do the following: 
 uint8_t the_handle = p_ble_evt</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Aug 2020 07:04:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65051/question-about-ble_gap_tx_power_role_conn" /><item><title>RE: Question about BLE_GAP_TX_POWER_ROLE_CONN</title><link>https://devzone.nordicsemi.com/thread/265656?ContentTypeID=1</link><pubDate>Fri, 21 Aug 2020 07:04:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d0cca61-e5a1-43cd-b6a1-5bff416f991c</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/jpmorganjeremy"&gt;JPMorganJeremy&lt;/a&gt; is correct here. You can also check out &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37928/just-set-tx-power"&gt;this thread&lt;/a&gt;, where the TX power settings are discussed in detail as well.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about BLE_GAP_TX_POWER_ROLE_CONN</title><link>https://devzone.nordicsemi.com/thread/265629?ContentTypeID=1</link><pubDate>Fri, 21 Aug 2020 00:25:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db59fa57-e2e0-4460-a65a-cefa4235fad8</guid><dc:creator>JPMorganJeremy</dc:creator><description>&lt;p&gt;&lt;span&gt;&amp;quot;When a connection is created it will inherit the transmit power from the initiator or advertiser leading to the connection&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This just means that you don&amp;#39;t necessarily have to set the TX power for the connection, rather you would just have to set it once, as an advertiser (peripheral) or scanner (Central). Then, the TX Power during connection will be inherited from what you set previously.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So in a central&amp;#39;s main you could:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void tx_power_set(void)
{
    ret_code_t err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_SCAN_INIT, 0, TX_POWER_LEVEL);
    APP_ERROR_CHECK(err_code);
}


int main(void)
{

    app_init()
    tx_power_set();

    for (;;)
    {
        idle_state_handle();

    }
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Notice the role is SCAN, so you scan with that TX Power level, and when you connect, the same power level is inherited, so there is no need to&amp;nbsp;&lt;/span&gt;&lt;span&gt;set it for the connection as well.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;In a peripheral&amp;#39;s main, you could:&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void tx_power_set(void)
{
    ret_code_t err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, m_advertising.adv_handle, TX_POWER_LEVEL);
    APP_ERROR_CHECK(err_code);
}


int main(void)
{

    app_init()
    tx_power_set();

    for (;;)
    {
        idle_state_handle();

    }
}&lt;/pre&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The role here is ADV, so the peripheral advertises with this TX Power level, and inherits the same level for the connection.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The Central doesn&amp;#39;t control/set the peripheral&amp;#39;s TX Power or vice versa, they are each responsible for setting it themselves.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Hope this makes sense&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>