<?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>Set a name in beacon example SDK 12</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21955/set-a-name-in-beacon-example-sdk-12</link><description>Hey guys, 
 I have followed this tutorial that shows how to modify advertising data, and more particularly the name. 
 What I want to do is set a name in the beacon example of the SKD 12. With this example, nRF Connect sees my device as &amp;quot;N/A&amp;quot;.
So here</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 15 Jun 2019 08:09:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21955/set-a-name-in-beacon-example-sdk-12" /><item><title>RE: Set a name in beacon example SDK 12</title><link>https://devzone.nordicsemi.com/thread/193004?ContentTypeID=1</link><pubDate>Sat, 15 Jun 2019 08:09:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2909f8db-2154-4d04-8f36-7c17088e083a</guid><dc:creator>Archana Fugare</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;In your answer you added this code in advertising_init() function:&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;m_adv_params.type = BLE_GAP_ADV_TYPE_ADV_SCAN_IND; &lt;br /&gt;m_adv_params.p_peer_addr = NULL; // Undirected advertisement. &lt;br /&gt;m_adv_params.fp = BLE_GAP_ADV_FP_ANY; &lt;br /&gt;m_adv_params.interval = NON_CONNECTABLE_ADV_INTERVAL; &lt;br /&gt;m_adv_params.timeout = APP_CFG_NON_CONN_ADV_TIMEOUT;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here I think the&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;APP_CFG_NON_CONN_ADV_TIMEOUT and&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;BLE_GAP_ADV_TYPE_ADV_SCAN_IND are the #define in code, I want to know that what value have to set in #define.&lt;br /&gt;Please help me.&lt;br /&gt;&lt;br /&gt;err_code = ble_advdata_set(&amp;amp;advdata, &amp;amp;srdata);&lt;br /&gt;also please give the defination of above function i.e.&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;ble_advdata_set(&amp;amp;advdata, &amp;amp;srdata);&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;&lt;br /&gt;&lt;br /&gt; Regards,&lt;br /&gt; Archana&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Set a name in beacon example SDK 12</title><link>https://devzone.nordicsemi.com/thread/86164?ContentTypeID=1</link><pubDate>Wed, 10 May 2017 14:42:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce31c9d0-4ae5-4257-8045-5029b568ccaf</guid><dc:creator>F0cks</dc:creator><description>&lt;p&gt;Thanks for your answer! I was trying to reduce packet by removing major, minor values and RSSI.
I use this place now to send adc values. Maybe there is a better way. But like this and with your solution, all is working as expected!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Set a name in beacon example SDK 12</title><link>https://devzone.nordicsemi.com/thread/86163?ContentTypeID=1</link><pubDate>Wed, 10 May 2017 14:20:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd2db89f-4630-4022-90cb-e9a2e75e67b9</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;In the beacon example the advertising data packet is already filled up with other data, so there is not enough room for the device name. As explained in the tutorial, an advertising packet can consist of no more than 31 bytes. You are therefore getting the error &lt;code&gt;NRF_ERROR_DATA_SIZE&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Note that Beacons typically don&amp;#39;t have a name, because there is little room left in the advertise packet after including the beacon payload. Beacons usually signal their intent and meaning by the URL or ID that they contain, and don&amp;#39;t really need a local name.&lt;/p&gt;
&lt;p&gt;But, you can put the device name into the scan response packet like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void advertising_init(void)
{
    uint32_t      err_code;
    ble_advdata_t advdata;
    ble_advdata_t srdata;
    uint8_t       flags = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;

    ble_advdata_manuf_data_t manuf_specific_data;

    manuf_specific_data.company_identifier = APP_COMPANY_IDENTIFIER;

#if defined(USE_UICR_FOR_MAJ_MIN_VALUES)
    // If USE_UICR_FOR_MAJ_MIN_VALUES is defined, the major and minor values will be read from the
    // UICR instead of using the default values. The major and minor values obtained from the UICR
    // are encoded into advertising data in big endian order (MSB First).
    // To set the UICR used by this example to a desired value, write to the address 0x10001080
    // using the nrfjprog tool. The command to be used is as follows.
    // nrfjprog --snr &amp;lt;Segger-chip-Serial-Number&amp;gt; --memwr 0x10001080 --val &amp;lt;your major/minor value&amp;gt;
    // For example, for a major value and minor value of 0xabcd and 0x0102 respectively, the
    // the following command should be used.
    // nrfjprog --snr &amp;lt;Segger-chip-Serial-Number&amp;gt; --memwr 0x10001080 --val 0xabcd0102
    uint16_t major_value = ((*(uint32_t *)UICR_ADDRESS) &amp;amp; 0xFFFF0000) &amp;gt;&amp;gt; 16;
    uint16_t minor_value = ((*(uint32_t *)UICR_ADDRESS) &amp;amp; 0x0000FFFF);

    uint8_t index = MAJ_VAL_OFFSET_IN_BEACON_INFO;

    m_beacon_info[index++] = MSB_16(major_value);
    m_beacon_info[index++] = LSB_16(major_value);

    m_beacon_info[index++] = MSB_16(minor_value);
    m_beacon_info[index++] = LSB_16(minor_value);
#endif

    manuf_specific_data.data.p_data = (uint8_t *) m_beacon_info;
    manuf_specific_data.data.size   = APP_BEACON_INFO_LENGTH;

    // Build and set advertising data.
    memset(&amp;amp;advdata, 0, sizeof(advdata));    
    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));
    srdata.name_type             = BLE_ADVDATA_FULL_NAME;

    err_code = ble_advdata_set(&amp;amp;advdata, &amp;amp;srdata);
    APP_ERROR_CHECK(err_code);

    // Initialize advertising parameters (used when starting advertising).
    memset(&amp;amp;m_adv_params, 0, sizeof(m_adv_params));

    m_adv_params.type        = BLE_GAP_ADV_TYPE_ADV_SCAN_IND;
    m_adv_params.p_peer_addr = NULL;                             // Undirected advertisement.
    m_adv_params.fp          = BLE_GAP_ADV_FP_ANY;
    m_adv_params.interval    = NON_CONNECTABLE_ADV_INTERVAL;
    m_adv_params.timeout     = APP_CFG_NON_CONN_ADV_TIMEOUT;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that I have made the beacon scannable by changing  the type from &lt;code&gt;BLE_GAP_ADV_TYPE_ADV_NONCONN_IND&lt;/code&gt; to &lt;code&gt;BLE_GAP_ADV_TYPE_ADV_SCAN_IND&lt;/code&gt;, and that if you are making a &lt;a href="https://developer.apple.com/ibeacon/"&gt;iBeacon&lt;/a&gt; the iBeacon spec specifically states that &lt;code&gt;ADV_NONCONN_IND&lt;/code&gt; must be used.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>