<?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 make a simple unconnected Broadcaster ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/31308/how-to-make-a-simple-unconnected-broadcaster</link><description>Hello everyone, I would like to make an unconnected broadcaster to send data to the advertising channels ... I come from a X-NUCLEO-IDB05A1 board and that&amp;#39;s has been pretty simple. It is just need to use a function and determine the interval of broadcast</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 14 Mar 2018 10:24:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/31308/how-to-make-a-simple-unconnected-broadcaster" /><item><title>RE: How to make a simple unconnected Broadcaster ?</title><link>https://devzone.nordicsemi.com/thread/124339?ContentTypeID=1</link><pubDate>Wed, 14 Mar 2018 10:24:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fb85456-3a67-4219-91eb-832405c4eecc</guid><dc:creator>Sylvain</dc:creator><description>&lt;p&gt;I found a solution. For any people interested, you need to specify what is the AD type. So, specify the AD type as Manufacturer Specific Data with the following code :&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;data[0]=0x1E;
data[1]=BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA; //able to have 29 bytes for custom data&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;After that you can pass all the data you want to sent in this function (with a maximum of 29 Bytes):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;sd_ble_gap_adv_data_set(data,strlen(data),NULL,0);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the topics that help me :&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/7080/sd_ble_gap_adv_data_set"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/7080/sd_ble_gap_adv_data_set&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/8854/fully-custom-advertisement-data/32548#32548"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/8854/fully-custom-advertisement-data/32548#32548&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-advertising-a-beginners-tutorial"&gt;https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-advertising-a-beginners-tutorial&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/b/blog/posts/bluetooth-smart-and-the-nordics-softdevices-part-1"&gt;devzone.nordicsemi.com/.../bluetooth-smart-and-the-nordics-softdevices-part-1&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make a simple unconnected Broadcaster ?</title><link>https://devzone.nordicsemi.com/thread/124127?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2018 10:36:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd770190-fedc-4add-9514-3fad8ad35c28</guid><dc:creator>Sylvain</dc:creator><description>&lt;p&gt;Yes I have used this example as It&amp;#39;s said as in other post. But I have few trouble when I try to modify the payload. I juste want to send a payload like that :&lt;/p&gt;
&lt;pre&gt;#define PAYLOAD_LENGTH  0x04&lt;/pre&gt;
&lt;pre&gt;char payload [PAYLOAD_LENGTH] = {0xFF,0xFF,0xFF,0xFF};&lt;br /&gt;&lt;br /&gt;So I modified this function :&lt;/pre&gt;
&lt;pre&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void advertising_init(void)
{
    uint32_t      err_code;
    ble_advdata_t advdata;
    uint8_t       flags = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;

    ble_advdata_manuf_data_t manuf_specific_data;
    
    memset(&amp;amp;manuf_specific_data, 0, sizeof(manuf_specific_data));

    manuf_specific_data.data.p_data = (char *) payload;
    manuf_specific_data.data.size = PAYLOAD_LENGTH;
 

    //Build and set advertising data.
    memset(&amp;amp;advdata, 0, sizeof(advdata));

    advdata.name_type             = BLE_ADVDATA_NO_NAME;
    advdata.flags                 = flags;
    advdata.p_manuf_specific_data = &amp;amp;manuf_specific_data;

    //Set uniquely the advertising data not the scan response data
    err_code = ble_advdata_set(&amp;amp;advdata, NULL);
    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_NONCONN_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     = 0;       // Never time out.
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I receive the expected data but with other data ... Here&amp;#39;s the received data :&lt;br /&gt;&lt;br /&gt;[[0x02,0x01,0x04,0x07,0xFF,0x00,0x00,0xFF,0xFF,0xFF,0xFF]]&lt;br /&gt;&lt;br /&gt;And I don&amp;#39;t find where this data is set ...&lt;br /&gt;&lt;br /&gt;Can you help me ?&lt;br /&gt;&lt;br /&gt;Sylvain.&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make a simple unconnected Broadcaster ?</title><link>https://devzone.nordicsemi.com/thread/124119?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2018 10:17:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d59894d1-9134-429f-8122-76171077625d</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you only want to broadcast information and be non-connectable, I think the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/ble_sdk_app_beacon.html?cp=4_0_0_4_2_2_2" target="_blank" rel="noopener noreferrer"&gt;beacon example&lt;/a&gt; is what you are looking for.&amp;nbsp;Yes, you should be able to implement BLE beacons on the nRF52840. Have a look at this&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/question/109442/ble_app_beacon-and-nrf52840/" target="_blank" rel="noopener noreferrer"&gt;post&lt;/a&gt;&amp;nbsp;on devzone, there is also a beacon example attached. It is updated for SDK14.1 and should work with the nRF52840.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>