<?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>Tx Power using SoftDevices S140 nrf52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58823/tx-power-using-softdevices-s140-nrf52840</link><description>Hi, 
 I am using SD calls to start an advertisement of BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED : 
 sd_ble_gap_adv_start(m_adv_handle, APP_BLE_CONN_CFG_TAG); 
 The call to set TX power: 
 err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Mar 2020 17:16:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58823/tx-power-using-softdevices-s140-nrf52840" /><item><title>RE: Tx Power using SoftDevices S140 nrf52840</title><link>https://devzone.nordicsemi.com/thread/239205?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 17:16:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:513240e6-4331-4bf9-9558-780e218d18a2</guid><dc:creator>TigerD</dc:creator><description>&lt;p&gt;I changed my program to use ble_advertising_start() to advertise. That solves my problem, because it has valid handle to set tx power.&lt;/p&gt;
&lt;p&gt;Thank You,&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Tx Power using SoftDevices S140 nrf52840</title><link>https://devzone.nordicsemi.com/thread/239166?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 14:39:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0b1ed7c-e345-4bb7-a6e7-08337eaff645</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;An error 12292dec corresponds with 0x3004. From the&amp;nbsp;&lt;a title="sd_ble_gap_tx_power_set" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html?cp=4_5_2_1_2_1_3_41#gad10e80ba20ddab42d1753fd1be2d8c26"&gt;sd_ble_gap_tx_power_set&lt;/a&gt;&amp;nbsp;API this is an&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group__ble__err.html#ga3f3e21cbd6cf24e72e5bf641098379aa"&gt;BLE_ERROR_INVALID_ADV_HANDLE&lt;/a&gt;.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The API docs for the &amp;#39;handle&amp;#39; parameter&amp;#39; says:&lt;br /&gt;&lt;span&gt;If role is&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group___b_l_e___g_a_p___e_n_u_m_e_r_a_t_i_o_n_s.html#ggad37de0f7735bbcfb50401ebc3fd15b16a316b26bf3dd9996431bc75b025084a92"&gt;BLE_GAP_TX_POWER_ROLE_ADV&lt;/a&gt;&lt;span&gt;, the advertising set identified with the advertising handle, will use the specified transmit power, and include it in the advertising packet headers if&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/structble__gap__adv__properties__t.html#ac72160c307508e992e9b8924bcafed8c"&gt;ble_gap_adv_properties_t::include_tx_power&lt;/a&gt;&lt;span&gt;&amp;nbsp;set.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I guess you&amp;#39;ve defined an advertising set when you set the advertisement data, you need to use this handle with&amp;nbsp;&lt;a title="sd_ble_gap_tx_power_set" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html?cp=4_5_2_1_2_1_3_41#gad10e80ba20ddab42d1753fd1be2d8c26"&gt;sd_ble_gap_tx_power_set&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Tx Power using SoftDevices S140 nrf52840</title><link>https://devzone.nordicsemi.com/thread/239115?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 13:10:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84438f51-b6af-4f12-bfa4-3b8db79698f5</guid><dc:creator>TigerD</dc:creator><description>&lt;p&gt;It is the same error 12292 from&lt;/p&gt;
&lt;p&gt;err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, BLE_GAP_ADV_SET_HANDLE_NOT_SET, 8 )&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BLE_CONN_HANDLE_INVALID&lt;/span&gt; is defined as 0xFF&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BLE_GAP_ADV_SET_HANDLE_NOT_SET&lt;/span&gt; is defined as 0xFFFF&lt;/p&gt;
&lt;p&gt;I guess there is no essential difference.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Tx Power using SoftDevices S140 nrf52840</title><link>https://devzone.nordicsemi.com/thread/239112?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 13:04:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b7332b4-3b9a-41df-a428-b74e2f71dd2b</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Sorry I meant to use&amp;nbsp;&lt;span&gt;BLE_GAP_ADV_SET_HANDLE_NOT_SET as the connection handle.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Tx Power using SoftDevices S140 nrf52840</title><link>https://devzone.nordicsemi.com/thread/238851?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 13:53:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f572c542-314f-446d-a308-16cd9aa79f1f</guid><dc:creator>TigerD</dc:creator><description>&lt;p&gt;I did. The call &lt;span&gt;sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, BLE_CONN_HANDLE_INVALID, -20 )&lt;/span&gt;, is before start advertisements.&lt;/p&gt;
&lt;p&gt;It generates 12292 run-time error.&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Tx Power using SoftDevices S140 nrf52840</title><link>https://devzone.nordicsemi.com/thread/238846?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 13:50:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c883fa04-b571-43f6-af9b-1a3842cc8df3</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Have you tried calling&amp;nbsp;&lt;span&gt;sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, BLE_CONN_HANDLE_INVALID, -20 )&amp;nbsp; before you start advertiments?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Tx Power using SoftDevices S140 nrf52840</title><link>https://devzone.nordicsemi.com/thread/238841?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 13:42:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3f4b190-a550-4739-8594-9c335ab8e10a</guid><dc:creator>TigerD</dc:creator><description>&lt;p&gt;Hi Haakonsh,&lt;/p&gt;
&lt;p&gt;My program is based on&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ..\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_beacon&lt;/p&gt;
&lt;p&gt;and using softDevice call to Advertise:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = sd_ble_gap_adv_start(m_adv_handle, APP_BLE_CONN_CFG_TAG);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The call to set&amp;nbsp; TX POWER&amp;nbsp; with BLE_GAP_TX_POWER_ROLE_SCAN_INIT&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_SCAN_INIT, BLE_CONN_HANDLE_INVALID, -20 );&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; doesn&amp;#39;t change the TX power for Advertising ( it is easily testable, e.g. using Android phone, it always reports the same RSSI from the unit, no matter what setting of the tx_power ( int the above case, it is -20).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;( I also tested with Proximity example, which is BLE API based, change tx power with BLE_GAP_TX_POWER_ROLE_ADV, will change the rssi from -50dBm to -100dBm, with 8 and -40 tx power settings respectively.)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But if the call set&amp;nbsp; TX POWER&amp;nbsp; with BLE_GAP_TX_POWER_ROLE_ADV&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, BLE_CONN_HANDLE_INVALID, -20 );&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The program generates run-time error with error code : &amp;nbsp;12292&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank You&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Tx Power using SoftDevices S140 nrf52840</title><link>https://devzone.nordicsemi.com/thread/238828?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 13:27:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1093fe63-0f29-4889-9b6c-17274e2f9828</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;That looks like the correct API usage to me.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;quot;&lt;span&gt;It seems that tx power is set not.&amp;quot;&lt;br /&gt;How do you know? Can you share any measurements with us?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>