<?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 set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72412/how-to-set-tx_power-using-sd_ble_gap_tx_power_set-on-nrf52832</link><description>Hi Everyone, 
 I am working on nrf52832, I am using sdk15.0.0 ble_peripheral /ble_app_beacon as reference. 
 I want to set TX_POWER using sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV,m_adv_handle,RADIO_TXPOWER_TXPOWER_Pos4dBm); 
 m_adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Apr 2021 07:10:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72412/how-to-set-tx_power-using-sd_ble_gap_tx_power_set-on-nrf52832" /><item><title>RE: How to set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/thread/303361?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2021 07:10:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1123cd04-704e-4d15-860c-da035ede0841</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. Then the problem here is this misunderstanding. The physical Tx power and the Tx power you signal are completely independent. To check the physical Tx power you need to measure. Alternatively, you could check the RSSI using nRF Connect. Note that there will typically be a lot of variation in these measurements unless you have proper equipment, but you could for instance check to see that you see a clear difference between when you call&amp;nbsp;sd_ble_gap_tx_power_set with 0 and -40 or similar.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/thread/303360?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2021 07:08:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40f700be-ea53-4c3e-8301-089858a67d31</guid><dc:creator>ande_dewal</dc:creator><description>&lt;p&gt;thanks for response,&lt;/p&gt;
&lt;p&gt;At scanner, get_tx_power gives me 0dbm.also i checked at debugging on segger studio in RADIO-&amp;gt;TX_POWER register . it always gives 0dbm. when i am using&amp;nbsp; below fun err_code = sd_ble_gap_tx_power_set(&amp;nbsp; BLE_GAP_TX_POWER_ROLE_ADV, m_adv_handle,RADIO_TXPOWER_TXPOWER_Pos4dBm);&lt;/p&gt;
&lt;p&gt;now, I am not set through scan response .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/thread/303355?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2021 06:51:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:861660ee-f779-4d24-9364-4b5621e7aad8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="ande_dewal"]still not set tx_power it always gives me 0dbm.&amp;nbsp;[/quote]
&lt;p&gt;How do you know that it is 0 dBm? How have you measured it? Could it be that the problem here is that you read the tx_value field of the advertising or scan response packet and misinterprets that as the actual Tx power? As mention before, those are two separate things altogether.&amp;nbsp;sd_ble_gap_tx_power_set() is used to change the physical Tx power. You can optionally include the Tx power in your scan reponse/advertising packet, but that is just data. Do you want to signal the Tx power? If so, you can add that here, but you still need to actually change it using&amp;nbsp;sd_ble_gap_tx_power_set().&lt;/p&gt;
[quote user="ande_dewal"]please help me for set tx_power for range .&amp;nbsp;[/quote]
&lt;p&gt;You set tx_power using&amp;nbsp;sd_ble_gap_tx_power_set() exactly as described in the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html?cp=4_7_4_1_2_1_3_41#gad10e80ba20ddab42d1753fd1be2d8c26"&gt;API documentation&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/thread/303332?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2021 05:07:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:266a2439-c9c4-4c9b-a2ce-817ff6ecc7dc</guid><dc:creator>ande_dewal</dc:creator><description>&lt;p&gt;thanks for reply,&lt;/p&gt;
&lt;p&gt;I tried using&amp;nbsp;&lt;span&gt;sd_ble_gap_tx_power_set()&amp;nbsp; but not set tx_power in my application. As our above discussion I called this function after the advertising_init() and before advertising_start(), still not set tx_power it always gives me 0dbm.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;advertising_init();
 
 err_code = sd_ble_gap_tx_power_set(  BLE_GAP_TX_POWER_ROLE_ADV, m_adv_handle,RADIO_TXPOWER_TXPOWER_Pos4dBm);
  APP_ERROR_CHECK(err_code);
 advertising_start();&lt;/pre&gt;please check this i am not understood ,what setting going wrong in my code. please help me for set tx_power for range .&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/thread/303175?ContentTypeID=1</link><pubDate>Tue, 06 Apr 2021 13:14:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:620d906a-c109-4dd7-bf91-17224843c07c</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;The&amp;nbsp;p_tx_power_level field points to the Tx power level field&amp;nbsp; in the advertising data. This is not directly related to the actual Tx power and does not set the Tx power for you. There is no problem specifying it here if you want the Tx power to be part of the advertising data, but this is just data. To adjust the physical Tx power, you must use&amp;nbsp;sd_ble_gap_tx_power_set() as we have allready discussed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/thread/303094?ContentTypeID=1</link><pubDate>Tue, 06 Apr 2021 10:29:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62f731a5-5af8-45ca-bd50-b369ca2c262c</guid><dc:creator>ande_dewal</dc:creator><description>&lt;p&gt;thanks for reply,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1)&lt;em&gt;i am trying to set tx_power through scan response parameter&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;em&gt;firstly i am setting tx_power through&amp;nbsp;sd_ble_gap_tx_power_set() but not set it gives always 0dbm. another way i tried to set tx power through scan response paramter.&amp;nbsp;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;em&gt;first change the structure member ,&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;em&gt;&lt;pre class="ui-code" data-mode="text"&gt;static ble_gap_adv_data_t m_adv_data =
{
    .adv_data =
    {
        .p_data = m_enc_advdata[0],
        .len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX
    },
    .scan_rsp_data =
    {
        .p_data = m_enc_srdata[0],
        .len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX
    }
};
&lt;/pre&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;em&gt;after that this setting in advertising_init function()&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;em&gt;&lt;pre class="ui-code" data-mode="text"&gt; //// Build and set scan response data.
    memset(&amp;amp;srdata, 0, sizeof(srdata));
    printf(&amp;quot;\n/#/#/#   D   #/#/#/\n&amp;quot;);
    srdata.p_tx_power_level = &amp;amp;m_tx_power;

    // Initialize advertising parameters (used when starting advertising).
    memset(&amp;amp;m_adv_params, 0, sizeof(m_adv_params));

    //printf(&amp;quot;\n/#/#/#   E   #/#/#/\n&amp;quot;);

    //printf(&amp;quot;after memset_adv_param %d\t&amp;quot;,&amp;amp;m_adv_params);
    // printf(&amp;quot;after memset_adv_param %d\n&amp;quot;,m_adv_params);
    m_adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED; //Beacon needs to be scannable to receive scan response
    m_adv_params.p_peer_addr     = NULL;    // Undirected advertisement.
    m_adv_params.filter_policy   = BLE_GAP_ADV_FP_ANY;
    m_adv_params.interval        = NON_CONNECTABLE_ADV_INTERVAL;
    m_adv_params.duration        = 0;       // Never time out.
    //m_adv_params.primary_phy     = BLE_GAP_PHY_CODED;
    //m_adv_params.secondary_phy   = BLE_GAP_PHY_CODED;

   //printf(&amp;quot;\n/#/#/#   F   #/#/#/\n&amp;quot;);
   err_code = ble_advdata_encode(&amp;amp;advdata, m_adv_data.adv_data.p_data, &amp;amp;m_adv_data.adv_data.len);
    printf(&amp;quot;err_code_encode : %d\n&amp;quot;,err_code);
    APP_ERROR_CHECK(err_code);
    err_code = ble_advdata_encode(&amp;amp;srdata, m_adv_data.scan_rsp_data.p_data, &amp;amp;m_adv_data.scan_rsp_data.len);
    APP_ERROR_CHECK(err_code);

   //printf(&amp;quot;\n/#/#/#   G   #/#/#/\n&amp;quot;);

   
  
   //printf(&amp;quot;\n/#/#/#   H   #/#/#/\n&amp;quot;);

    err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;m_adv_params);&lt;/pre&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;em&gt;while set the advertising_update() return err_code invalid state .please help me for solved this problem.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;em&gt;&lt;pre class="ui-code" data-mode="text"&gt;   //printf(&amp;quot;\n/#/#/#   b   #/#/#/\n&amp;quot;);

    manuf_specific_data.data.p_data = (uint8_t *) m_beacon_info1;
    manuf_specific_data.data.size   = APP_BEACON_INFO_LENGTH;
    //printf(&amp;quot;address of array %d\n&amp;quot;,&amp;amp;m_beacon_info1);
    // Build and set advertising data.
    memset(&amp;amp;advdata, 0, sizeof(advdata));
    
    //printf(&amp;quot;\n/#/#/#   c   #/#/#/\n&amp;quot;);


    //int8_t tx_power                 = 4;
    //advdata.p_tx_power_level        = &amp;amp;tx_power;

    //advdata.name_type             = BLE_ADVDATA_SHORT_NAME;
    //  advdata.short_name_len          = 5;
    advdata.flags                 = flags;
    advdata.p_manuf_specific_data = &amp;amp;manuf_specific_data;
     // Build and set scan response data.
    //memset(&amp;amp;srdata, 0, sizeof(srdata));
    //printf(&amp;quot;\n/#/#/#   D   #/#/#/\n&amp;quot;);
    //srdata.p_tx_power_level = &amp;amp;m_tx_power;
    //printf(&amp;quot;after memset_srdata %d\t&amp;quot;,&amp;amp;srdata);
    //printf(&amp;quot;after memset_srdata %d\n&amp;quot;,srdata);
    //srdata.name_type             = BLE_ADVDATA_FULL_NAME;
    
 /*swap adv data buffer - from API doc: &amp;quot;In order to update advertising 
    data while advertising,new advertising buffers must be provided&amp;quot;*/
    //m_adv_data.adv_data.p_data = (m_adv_data.adv_data.p_data == m_enc_advdata[0])         
     //                             ? m_enc_advdata[1] : m_enc_advdata[0];
    //adv_data_buf_swap();
     m_adv_data.adv_data.p_data = (m_adv_data.adv_data.p_data == m_enc_srdata[0])         
                                  ? m_enc_srdata[1] : m_enc_srdata[0];
    

   printf(&amp;quot;advertising new array data %d\n&amp;quot;,m_adv_data.adv_data.p_data == m_enc_advdata[0]);
   printf(&amp;quot;flag = %d\n&amp;quot;,falling_edge_detect);
   
   err_code = ble_advdata_encode(&amp;amp;advdata, m_adv_data.adv_data.p_data, &amp;amp;m_adv_data.adv_data.len);
   APP_ERROR_CHECK(err_code);
 
   //sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV , m_adv_handle,m_tx_power);
   //APP_ERROR_CHECK(err_code);

    //printf(&amp;quot;\n/#/#/#   d   #/#/#/\n&amp;quot;);
    // err_code = ble_advdata_encode(&amp;amp;srdata, m_adv_data.scan_rsp_data.p_data, &amp;amp;m_adv_data.scan_rsp_data.len);
    //APP_ERROR_CHECK(err_code);

  err_code = sd_ble_gap_adv_set_configure(&amp;amp;(m_adv_handle), &amp;amp;m_adv_data,NULL);
  printf(&amp;quot;et_error_cde %d\n&amp;quot;,err_code);
  APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/thread/303074?ContentTypeID=1</link><pubDate>Tue, 06 Apr 2021 09:53:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e6e6013-947b-4fc1-ae29-75f7b76672c8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="ande_dewal"]i am trying to set tx_power through scan response parameter,[/quote]
&lt;p&gt;I am not sure I understand. Do you mean set the actual Tx power or some data in the scan response packet that indicate the Tx power (typically measured at a specific distance)? Please elaborate.&lt;/p&gt;
[quote user="ande_dewal"]when data is update that time&amp;nbsp;&amp;nbsp;err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;m_adv_params); return invalid state error.[/quote]
&lt;p&gt;If you try to change the configuration of a currently active advertiser, you will get invalid state. In this case, you should stop advertising and start again. This is not the way to change Tx power though, so I am not sure what you want to do. If you are having a different problem now, then please backtrack and explain in detail from the beginning.&lt;/p&gt;
[quote user="ande_dewal"]but i need to set tx_power continuously not need to change.[/quote]
&lt;p&gt;Can you explain more? Do you want to set it once, or do you want to set it repeatedly? In any case, to change the Tx power you use&amp;nbsp;sd_ble_gap_tx_power_set() as we have discussed before and as described in the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html?cp=4_7_4_1_2_1_3_41#gad10e80ba20ddab42d1753fd1be2d8c26"&gt;API documentation&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/thread/303066?ContentTypeID=1</link><pubDate>Tue, 06 Apr 2021 09:44:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3658f236-8b14-4615-a101-82c0d0f33b78</guid><dc:creator>ande_dewal</dc:creator><description>&lt;p&gt;hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;i am trying to set tx_power through scan response parameter,&lt;/p&gt;
&lt;p&gt;Tx power set through that but not continuosly it gives me one time 0 and one time 4dbm.&lt;/p&gt;
&lt;p&gt;srdata.p_tx_power_level = &amp;amp;m_tx_power;&lt;/p&gt;
&lt;p&gt;printf(&amp;quot;after memset_srdata %d\t&amp;quot;,&amp;amp;srdata);&lt;/p&gt;
&lt;p&gt;this parameter set in advertising_init() function.&lt;/p&gt;
&lt;p&gt;when data is update that time&amp;nbsp;&amp;nbsp;err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;m_adv_params); return invalid state error.&lt;/p&gt;
&lt;p&gt;but i need to set tx_power continuously not need to change.&lt;/p&gt;
&lt;p&gt;I am trying to provide new array in advertising_upadate() but not set continuosly .&lt;/p&gt;
&lt;p&gt;please check the log file attached it. Mac_id of my device is Address: e9:98:e4:e3:ad:b1&lt;pre class="ui-code" data-mode="text"&gt;15:45:38.965 -&amp;gt; Advertised Device: Name: , Address: e9:98:e4:e3:ad:b1, manufacturer data: 59000215454d422d3101000001f410000020001cdc00000000 
15:45:38.965 -&amp;gt;  RSSI: -49 TxPower: 0
15:45:39.287 -&amp;gt; Devices found: 2
15:45:39.287 -&amp;gt; Scan done!
15:45:39.407 -&amp;gt; Advertised Device: Name: , Address: 47:af:bd:6d:6b:cf, manufacturer data: 0600010920026c3227c22cdd301dc276a5350e365f64a95c4923e9cda2 
15:45:39.407 -&amp;gt;  RSSI: -83 TxPower: 0
15:45:40.007 -&amp;gt; Advertised Device: Name: , Address: e9:98:e4:e3:ad:b1, manufacturer data: 59000215454d422d3101000001f510000020001cdc00000000, txPower: 4 
15:45:40.007 -&amp;gt;  RSSI: -49 TxPower: 4
15:45:40.287 -&amp;gt; Devices found: 2
15:45:40.287 -&amp;gt; Scan done!
15:45:40.407 -&amp;gt; Advertised Device: Name: , Address: 47:af:bd:6d:6b:cf, manufacturer data: 0600010920026c3227c22cdd301dc276a5350e365f64a95c4923e9cda2 
15:45:40.407 -&amp;gt;  RSSI: -83 TxPower: 0
15:45:41.007 -&amp;gt; Advertised Device: Name: , Address: e9:98:e4:e3:ad:b1, manufacturer data: 59000215454d422d3101000001f610000020001cdc00000000 
15:45:41.007 -&amp;gt;  RSSI: -49 TxPower: 0
15:45:41.287 -&amp;gt; Devices found: 2
15:45:41.287 -&amp;gt; Scan done!
15:45:41.407 -&amp;gt; Advertised Device: Name: , Address: 47:af:bd:6d:6b:cf, manufacturer data: 0600010920026c3227c22cdd301dc276a5350e365f64a95c4923e9cda2 
15:45:41.407 -&amp;gt;  RSSI: -82 TxPower: 0
15:45:42.007 -&amp;gt; Advertised Device: Name: , Address: e9:98:e4:e3:ad:b1, manufacturer data: 59000215454d422d3101000001f810000020001cdc00000000, txPower: 4 
15:45:42.007 -&amp;gt;  RSSI: -49 TxPower: 4
15:45:42.287 -&amp;gt; Devices found: 2
15:45:42.287 -&amp;gt; Scan done!
15:45:42.418 -&amp;gt; Advertised Device: Name: , Address: 47:af:bd:6d:6b:cf, manufacturer data: 0600010920026c3227c22cdd301dc276a5350e365f64a95c4923e9cda2 
15:45:42.418 -&amp;gt;  RSSI: -86 TxPower: 0
15:45:42.983 -&amp;gt; Advertised Device: Name: , Address: e9:98:e4:e3:ad:b1, manufacturer data: 59000215454d422d3101000001f910000020001cdc00000000 
15:45:42.983 -&amp;gt;  RSSI: -49 TxPower: 0
15:45:43.303 -&amp;gt; Devices found: 2
15:45:43.303 -&amp;gt; Scan done!
15:45:43.417 -&amp;gt; Advertised Device: Name: , Address: 47:af:bd:6d:6b:cf, manufacturer data: 0600010920026c3227c22cdd301dc276a5350e365f64a95c4923e9cda2 
15:45:43.417 -&amp;gt;  RSSI: -85 TxPower: 0
15:45:44.020 -&amp;gt; Advertised Device: Name: , Address: e9:98:e4:e3:ad:b1, manufacturer data: 59000215454d422d3101000001f910000020001cdc00000000, txPower: 4 
15:45:44.020 -&amp;gt;  RSSI: -50 TxPower: 4&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/thread/298963?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 11:12:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c12a506f-c82c-4b47-9ab0-f96764ca2d0f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user="ande_dewal"]after above setting&amp;nbsp;err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;m_adv_params); err_code return 6.[/quote]
&lt;p&gt;I did not intend to suggest that you make any changes in your call to&amp;nbsp;sd_ble_gap_adv_set_configure().&amp;nbsp; The point is just that you take the advertising handle you get from there (or even 0 as that is what it will be), and use that in the call to&amp;nbsp;sd_ble_gap_tx_power_set(). Regarding the error 6 is&amp;nbsp;NRF_ERROR_NOT_SUPPORTED, which means that the configuration or length you provide is invalid. If this was working in your code before, then just keep what you had.&amp;nbsp;&lt;/p&gt;
[quote user="ande_dewal"]please help me for setting tx_power using default&amp;nbsp; gap function.[/quote]
&lt;p&gt;The default (and only) function to set the Tx power is&amp;nbsp;sd_ble_gap_tx_power_set(), and to set the Tx power for advertising you use it as shown in my previous post.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/thread/298959?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 10:34:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e10811cd-7a26-4241-9d22-990f557dc664</guid><dc:creator>ande_dewal</dc:creator><description>&lt;p&gt;thanks for reply,&lt;/p&gt;
&lt;p&gt;after above setting&amp;nbsp;err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;m_adv_params); err_code return 6.&lt;/p&gt;
&lt;p&gt;please help me for setting tx_power using default&amp;nbsp; gap function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/thread/298326?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 10:40:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:408cf8ed-1523-4572-9f5a-a4f48828e7f1</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This diff shows&amp;nbsp;exactly how you can set the Tx power of the beacon example in SDK 15.0.0:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/main.c.diff"&gt;devzone.nordicsemi.com/.../main.c.diff&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/thread/298195?ContentTypeID=1</link><pubDate>Sat, 06 Mar 2021 05:14:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f649b02f-12bc-472d-9cee-05bd4c775860</guid><dc:creator>dewal</dc:creator><description>&lt;p&gt;thanks for reply,&lt;/p&gt;
&lt;p&gt;can you please provide any example for passing this parameter correctly.&lt;/p&gt;
&lt;p&gt;actually i am not understood which handler parameter need to set for this function work properly.&lt;/p&gt;
&lt;p&gt;please someone help me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/thread/298092?ContentTypeID=1</link><pubDate>Fri, 05 Mar 2021 13:13:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:107e4f92-3895-4665-8461-deda0d750667</guid><dc:creator>Einar Thorsrud</dc:creator><description>[quote user="dewal"]&lt;p&gt;i am passing below parameter,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;err_code = sd_ble_gap_adv_set_configure(&amp;amp;(m_adv_handle), &amp;amp;m_adv_data, &amp;amp;m_adv_params);&lt;/p&gt;
&lt;p&gt;Is this wrong?&lt;/p&gt;[/quote]
&lt;p&gt;Yes, from your original post I see this is&amp;nbsp;BLE_GAP_ADV_SET_HANDLE_NOT_SET, so it will not be valid. You need to use the advertising handle you get returned when you configure the advertiser.&lt;/p&gt;
[quote user="dewal"]&lt;p&gt;&lt;span&gt;I want to set TX_POWER using&amp;nbsp;sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV,m_adv_handle,RADIO_TXPOWER_TXPOWER_Pos4dBm);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This function called after the advertising_start() .&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is this right way to set the tx_power ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;If&amp;nbsp;m_adv_handle is set by the call to&amp;nbsp;sd_ble_gap_adv_set_configure(), then this should be OK. But you must keep that value and not set it to&amp;nbsp;BLE_GAP_ADV_SET_HANDLE_NOT_SET. The advertising handle will be 0, as only one set is supported, so you could also just hard code to that to see that it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/thread/298048?ContentTypeID=1</link><pubDate>Fri, 05 Mar 2021 11:59:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbfe0f56-3157-46e0-a1a0-e85e4d838e6b</guid><dc:creator>dewal</dc:creator><description>&lt;p&gt;thanks for reply,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;i am passing below parameter,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;err_code = sd_ble_gap_adv_set_configure(&amp;amp;(m_adv_handle), &amp;amp;m_adv_data, &amp;amp;m_adv_params);&lt;/p&gt;
&lt;p&gt;Is this wrong?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I want to set TX_POWER using&amp;nbsp;sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV,m_adv_handle,RADIO_TXPOWER_TXPOWER_Pos4dBm);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This function called after the advertising_start() .&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is this right way to set the tx_power ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set tx_power using sd_ble_gap_tx_power_set() on nrf52832?</title><link>https://devzone.nordicsemi.com/thread/298035?ContentTypeID=1</link><pubDate>Fri, 05 Mar 2021 11:38:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:618246bd-fb03-4020-9234-15e9cc8798fb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Error code 12292 = 0x3004 = BLE_ERROR_INVALID_ADV_HANDLE. The issue here is that you do not provide the correct advertising handle, which you get from the call to sd_ble_gap_adv_set_configure(). See &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/64343/error-code-beacon-for-sd_ble_gap_adv_set_configure-comes-as-0x3004-12292-in-dec/262556#262556"&gt;this post&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>