<?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>The influence of Bluetooth name and setting tx power level in nRF52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79324/the-influence-of-bluetooth-name-and-setting-tx-power-level-in-nrf52832</link><description>Hello, 
 When I set the tx power in the broadcast initialization, I found that there are restrictions on the setting of the Bluetooth name, as follows 
 
 My device name: 
 
 Then I saw the bluetooth information in the phone as follows 
 
 But comment</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Sep 2021 07:32:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79324/the-influence-of-bluetooth-name-and-setting-tx-power-level-in-nrf52832" /><item><title>RE: The influence of Bluetooth name and setting tx power level in nRF52832</title><link>https://devzone.nordicsemi.com/thread/328504?ContentTypeID=1</link><pubDate>Wed, 08 Sep 2021 07:32:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c3ed5c5-f361-4735-8893-74f7562bc1e7</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="wfagly"]so that the problem of the length of the Bluetooth name is solved. Thanks![/quote]
&lt;p&gt;Great, I am happy to hear that the issue is now resolved!&lt;/p&gt;
[quote user="wfagly"]I put the transmit power data in the broadcast return packet,[/quote]
&lt;p&gt;Yes, you may divide the data over the advertising and scan response&amp;#39;s - both of which have a 31 byte limit.&lt;/p&gt;
[quote user="wfagly"]Or use Bluetooth 5.0 and all broadcast packets, so that the broadcast data can reach 255 bytes.[/quote]
&lt;p&gt;Using extended advertising should indeed also resolve the data size constraint.&lt;br /&gt;&lt;br /&gt;Please do not hesitate to open another ticket if you should encounter any issues or questions in the future.&lt;br /&gt;&lt;br /&gt;Good luck with your development!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The influence of Bluetooth name and setting tx power level in nRF52832</title><link>https://devzone.nordicsemi.com/thread/328473?ContentTypeID=1</link><pubDate>Wed, 08 Sep 2021 01:57:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d21aee95-deab-401b-b7f6-5a3dd8fd3b88</guid><dc:creator>Mikey</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;	init.config.ble_adv_primary_phy      = BLE_GAP_PHY_1MBPS;
    init.config.ble_adv_secondary_phy    = BLE_GAP_PHY_2MBPS;
    init.config.ble_adv_extended_enabled = true;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Or use Bluetooth 5.0 and all broadcast packets, so that the broadcast data can reach 255 bytes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The influence of Bluetooth name and setting tx power level in nRF52832</title><link>https://devzone.nordicsemi.com/thread/328472?ContentTypeID=1</link><pubDate>Wed, 08 Sep 2021 01:42:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bf1bde3-29dc-4072-9ce8-86b584a7b10c</guid><dc:creator>Mikey</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;init.srdata.p_tx_power_level 	= &amp;amp;tx_power_level;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Hello, I put the transmit power data in the broadcast return packet, so that the problem of the length of the Bluetooth name is solved. Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The influence of Bluetooth name and setting tx power level in nRF52832</title><link>https://devzone.nordicsemi.com/thread/328286?ContentTypeID=1</link><pubDate>Tue, 07 Sep 2021 04:56:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c497c868-54e6-41ef-855c-b960cbce50ff</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="wfagly"]Sorry, I tried it yesterday but it didn&amp;#39;t work, but today I learned that the browser plug-in affected the insertion of my code.[/quote]
&lt;p&gt;No worries at all, thank you for formatting the code and making it readable! :)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;So, back to your issue; I still believe that it is caused by the advertising data exceeding the 31 byte advertising payload limit.&lt;br /&gt;What is the total size of your advertising packet, with the above code?&lt;br /&gt;Please also keep in mind that every new datafield (i.e name, uuid&amp;#39;s, appearance, manufacturer specific, etc) requires 2 bytes of overhead. So, if you have a 8 byte manufacturing specific data payload(2 bytes company identifier, and 6 bytes arbitrary data), it will take up 10 bytes of your total 31 available bytes.&lt;br /&gt;&lt;br /&gt;Did you add the DEBUG define to your preprocessor defines like I asked?&lt;br /&gt;If so, are you getting any error messages in your logger when this behavior occurs?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The influence of Bluetooth name and setting tx power level in nRF52832</title><link>https://devzone.nordicsemi.com/thread/328283?ContentTypeID=1</link><pubDate>Tue, 07 Sep 2021 03:54:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a41788f-27d0-40b5-aba6-aa172a7949f7</guid><dc:creator>Mikey</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 * @brief Function for initializing the Advertising functionality.
 */
static void advertising_init(void)
{
    uint32_t               err_code;
    ble_advertising_init_t init;
    int8_t tx_power_level = TX_POWER_LEVEL;

    memset(&amp;amp;init, 0, sizeof(init));

    init.advdata.name_type          = BLE_ADVDATA_FULL_NAME;
    init.advdata.include_appearance = false;
    init.advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;
    init.advdata.p_tx_power_level 	= &amp;amp;tx_power_level;

    init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.srdata.uuids_complete.p_uuids  = m_adv_uuids;

    uint8_t my_adv_manuf_data[6] = {0};
    memcpy(my_adv_manuf_data, &amp;quot;123456&amp;quot;, 6);
    ble_advdata_manuf_data_t manuf_specific_data;
    manuf_specific_data.company_identifier = 0x0059;
    manuf_specific_data.data.p_data = my_adv_manuf_data;
    manuf_specific_data.data.size   = sizeof(my_adv_manuf_data);
    init.advdata.p_manuf_specific_data = &amp;amp;manuf_specific_data;

    init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout  = APP_ADV_DURATION;
    init.evt_handler = on_adv_evt;


    err_code = ble_advertising_init(&amp;amp;m_advertising, &amp;amp;init);
    APP_ERROR_CHECK(err_code);

    ble_advertising_conn_cfg_tag_set(&amp;amp;m_advertising, APP_BLE_CONN_CFG_TAG);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Sorry, I tried it yesterday but it didn&amp;#39;t work, but today I learned that the browser plug-in affected the insertion of my code. I also added a 6-digit random key to the broadcast data&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The influence of Bluetooth name and setting tx power level in nRF52832</title><link>https://devzone.nordicsemi.com/thread/328250?ContentTypeID=1</link><pubDate>Mon, 06 Sep 2021 15:03:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b4ee1d2-89a2-41dd-8f76-9a1480fdb11f</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;br /&gt;&lt;br /&gt;Please use the&amp;nbsp;&lt;em&gt;Insert -&amp;gt; Code&amp;nbsp;&lt;/em&gt;option when sharing code here on DevZone. The code you have posted above is not readable without considerable effort.&lt;/p&gt;
[quote user="wfagly"]I tried to add ble_advdata_encode() and the software restarts indefinitely[/quote]
&lt;p&gt;This sounds like a non-NRF_SUCCESS error code is passed to an APP_ERROR_CHECK somewhere. Could you make sure to have DEBUG defined in your preprocessor defines, like shown in the included image?&lt;br /&gt;&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/3515.enabling_5F00_debug_5F00_SES.PNG" /&gt;&lt;br /&gt;This will make your logger output a detailed error message whenever a non-NRF_SUCCESS error code is passed to an APP_ERROR_CHECK.&lt;br /&gt;&lt;br /&gt;Were you not already calling ble_advdata_encode previously, before configuring the advertising data? Which example are you using as the base of your project?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The influence of Bluetooth name and setting tx power level in nRF52832</title><link>https://devzone.nordicsemi.com/thread/328205?ContentTypeID=1</link><pubDate>Mon, 06 Sep 2021 13:00:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46ae9807-7c3a-4555-b38c-fc4e80d9d13d</guid><dc:creator>Mikey</dc:creator><description>&lt;p&gt;/** * @brief Function for initializing the Advertising functionality. */ static void advertising_init(void) { uint32_t err_code; ble_advdata_t addata; ble_advertising_init_t init; int8_t tx_power_level = TX_POWER_LEVEL; memset(&amp;amp;init, 0, sizeof(init)); init.advdata.name_type = BLE_ADVDATA_FULL_NAME; init.advdata.include_appearance = false; init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE; init.advdata.p_tx_power_level = &amp;amp;tx_power_level; init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]); init.srdata.uuids_complete.p_uuids = m_adv_uuids; uint8_t my_adv_manuf_data[6] = {0}; memcpy(my_adv_manuf_data, &amp;quot;123456&amp;quot;, 6); ble_advdata_manuf_data_t manuf_specific_data; manuf_specific_data.company_identifier = 0x0059; manuf_specific_data.data.p_data = my_adv_manuf_data; manuf_specific_data.data.size = sizeof(my_adv_manuf_data); init.advdata.p_manuf_specific_data = &amp;amp;manuf_specific_data; init.config.ble_adv_fast_enabled = true; init.config.ble_adv_fast_interval = APP_ADV_INTERVAL; init.config.ble_adv_fast_timeout = APP_ADV_DURATION; init.evt_handler = on_adv_evt; m_advertising.adv_data.adv_data.len = 64; err_code = ble_advertising_init(&amp;amp;m_advertising, &amp;amp;init); APP_ERROR_CHECK(err_code); ble_advertising_conn_cfg_tag_set(&amp;amp;m_advertising, APP_BLE_CONN_CFG_TAG); }&lt;/p&gt;
&lt;p&gt;I tried to add ble_advdata_encode() and the software restarts indefinitely&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The influence of Bluetooth name and setting tx power level in nRF52832</title><link>https://devzone.nordicsemi.com/thread/328177?ContentTypeID=1</link><pubDate>Mon, 06 Sep 2021 11:55:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f57aa26-9598-441c-930d-4a370475e8af</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;This is likely cause by the 31 advertising byte limit being exceeded when you add the TX data field.&lt;br /&gt;Including the TX data increases the payload size, which might cause it to exceed the hard 31 byte limit. The ble_advdata_encode function will then truncate the advertising name - by shaving characters off of the name - in order to make it fit into the 31 byte limit. Please see the warning of &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Fgroup__ble__sdk__lib__advdata.html&amp;amp;anchor=ga8534b0db1e46d3cdd4db0dc593071b74"&gt;the ble_advdata_encode function&amp;#39;s API reference for more information about this&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>