<?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>NRF52832 - advertising data</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40104/nrf52832---advertising-data</link><description>About this example 
 https://github.com/NordicPlayground/nrf51-ble-tutorial-advertising 
 It&amp;#180;s advertising the data 
 uint8_t data_response[] = &amp;quot;Many_bytes_of_data&amp;quot; with the MAC and RSSI 
 without connection. 
 
 How can advertising dynamic data without</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Nov 2018 07:47:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40104/nrf52832---advertising-data" /><item><title>RE: NRF52832 - advertising data</title><link>https://devzone.nordicsemi.com/thread/156415?ContentTypeID=1</link><pubDate>Thu, 08 Nov 2018 07:47:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2dee5a2-0737-4f9d-a143-f5d5dd062248</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;You could use the method I proposed to edit advertising data, I&amp;#39;m unsure about your use of SysTick_Handler(), as mention in this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/21067/nrf52-use-systick-or-rtc"&gt;question&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I propose that you either use &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Flib_timer.html&amp;amp;cp=4_0_0_3_51"&gt;app timer library&lt;/a&gt; or &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fgroup__nrf__rtc.html&amp;amp;resultof=%22%52%54%43%22%20%22%72%74%63%22%20"&gt;Real Time Counter&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;- Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 - advertising data</title><link>https://devzone.nordicsemi.com/thread/156110?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 10:26:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41f844be-69c2-4304-9d5b-fb89a5929e97</guid><dc:creator>Miguel</dc:creator><description>&lt;p&gt;I find out that&amp;nbsp;i&lt;strong&gt;dle_state_handle()&amp;nbsp;&lt;/strong&gt;make systick interrupt occurs&amp;nbsp;each 250ms...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 - advertising data</title><link>https://devzone.nordicsemi.com/thread/156059?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 07:20:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32a0b496-afa4-4a19-b685-e1c65ba75618</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Try:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t msTicks = 0; /* Variable to store millisecond ticks */
 
/* SysTick interrupt Handler. */
void SysTick_Handler(void)  {
     if(++msTicks == 1000) {
         LEDS_INVERT(BSP_LED_1_MASK); /* light LED 2 very 1 second */
         g_setAdvData = true;
         msTicks = 0;
     }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;msTicks is milliseconds, so you need to set the if sentence equal to 1000 ms (which is 1 second)&lt;/p&gt;
&lt;p&gt;- Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 - advertising data</title><link>https://devzone.nordicsemi.com/thread/156026?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 17:21:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f16c4422-e21c-4ac6-97c0-3de7ff7f336a</guid><dc:creator>Miguel</dc:creator><description>&lt;p&gt;Andreas&lt;/p&gt;
&lt;p&gt;Sorry, i hadnt seen that you had change the&amp;nbsp;advertising_init() to accept my Propaganda variable!&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;It&amp;acute;s working! Thanks!&lt;/p&gt;
&lt;p&gt;Btw, i had to put&lt;/p&gt;
&lt;p&gt;uint32_t msTicks = 0; /* Variable to store millisecond ticks */&lt;br /&gt; &lt;br /&gt;/* SysTick interrupt Handler. */&lt;br /&gt;void SysTick_Handler(void) {&lt;br /&gt; &lt;strong&gt;if(++msTicks &amp;gt;5) {&lt;/strong&gt;&lt;br /&gt; LEDS_INVERT(BSP_LED_1_MASK); /* light LED 2 very 1 second */&lt;br /&gt; g_setAdvData = true;&lt;br /&gt; msTicks = 0;&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;To trigger interrupt each 1 second...is that right ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 - advertising data</title><link>https://devzone.nordicsemi.com/thread/155996?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 14:47:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8efd0ebe-48ea-44eb-9025-42ff0593421b</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi again.&lt;/p&gt;
&lt;p&gt;I apologize for any confusion I&amp;#39;ve caused, I assumed you used SDK 15.0, and I also had some help solving your issue, and I missed a crucial point regarding what that solution did with your function Set_AdvData().&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The solution i was gives uses advertising_init() to update your advertising counter instead of your Set_AdvData() function.&lt;/p&gt;
&lt;p&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;

    manuf_specific_data.company_identifier = APP_COMPANY_IDENTIFIER;

    manuf_specific_data.data.p_data = (uint8_t *) m_beacon_info;
    if (g_setAdvData)
    {
        manuf_specific_data.data.p_data[3] = 0xED;
    }
    manuf_specific_data.data.size   = APP_BEACON_INFO_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;

    // Initialize advertising parameters (used when starting advertising).
    memset(&amp;amp;m_adv_params, 0, sizeof(m_adv_params));

    m_adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;
    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.

    err_code = ble_advdata_encode(&amp;amp;advdata, m_adv_data.adv_data.p_data, &amp;amp;m_adv_data.adv_data.len);
    ble_advertising_init();
    APP_ERROR_CHECK(err_code);

    err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;m_adv_params);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thats why it&amp;#39;s commented out.&lt;/p&gt;
&lt;p&gt;Just remove the ble_advertising_init(); I&amp;#39;m unsure how that code snip found its way into the code.&lt;/p&gt;
&lt;p&gt;- Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 - advertising data</title><link>https://devzone.nordicsemi.com/thread/155968?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 13:17:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f050aa5f-b435-434a-af96-382791cd6f56</guid><dc:creator>Miguel</dc:creator><description>&lt;p&gt;Hi Andreas&lt;/p&gt;
&lt;p&gt;Two questions!&lt;/p&gt;
&lt;p&gt;1) Getting error&lt;/p&gt;
&lt;p&gt;undefined ble_advertising_init(); not exist, i am using SDK 15.2.0&lt;/p&gt;
&lt;p&gt;2) and why you commented my Set_AdvData() ?&lt;/p&gt;
&lt;p&gt;//Set_AdvData();&lt;/p&gt;
&lt;p&gt;This way wont update my advertising counter :(&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 - advertising data</title><link>https://devzone.nordicsemi.com/thread/155950?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 12:44:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f99ff8d-c08c-4edc-958b-e7119c576298</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;As my previous reply show, I made some small modifications to Set_AdvData(), SysTick_Handler(), and main().&lt;/p&gt;
&lt;p&gt;In Set_AdvData() I&amp;#39;ve added sd_ble_gap_adv_stop(m_adv_handle); at the top, because you can&amp;#39;t modify your advertising buffer while you are advertising. And I&amp;#39;ve added a advertising_start(); at the end of Set_AdvData() to start advertising again.&lt;/p&gt;
&lt;p&gt;In SysTick_Handler() I set your timer to 5 seconds instead of 5 ms.&lt;/p&gt;
&lt;p&gt;In main() I modified your if(g_setAdvData) sentence.&lt;/p&gt;
&lt;p&gt;The modified code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;//Propaganda
uint8_t Propaganda = 0;

static void Set_AdvData()
{
  sd_ble_gap_adv_stop(m_adv_handle);
  ret_code_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;

    manuf_specific_data.company_identifier = APP_COMPANY_IDENTIFIER;

    // Prepare the scan response manufacturer specific data packet
    ble_advdata_manuf_data_t  manuf_data_response;
    uint8_t                     data_response[] = {0x08,0x00,0x03,0x08,0x00,0x03,0x08,0x00,0x03};
    //Change Data Advertising..
    ++Propaganda;
    data_response[0]=Propaganda;
    data_response[1]=Propaganda;
    data_response[2]=Propaganda;
    data_response[3]=Propaganda;
    data_response[4]=Propaganda;
    data_response[5]=Propaganda;
    data_response[6]=Propaganda;
    data_response[7]=Propaganda;
    data_response[8]=Propaganda;
    data_response[9]=Propaganda;

    manuf_specific_data.company_identifier  = 0x0059;
    manuf_specific_data.data.p_data         = data_response;
    manuf_specific_data.data.size           = sizeof(data_response);
    
    // 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;

    // Initialize advertising parameters (used when starting advertising).
    memset(&amp;amp;m_adv_params, 0, sizeof(m_adv_params));

    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);
    
    advertising_start();
}

#define SYSTICK_COUNT_ENABLE        1
#define SYSTICK_INTERRUPT_ENABLE    2
  
uint32_t msTicks = 0; /* Variable to store millisecond ticks */
 
/* SysTick interrupt Handler. */
void SysTick_Handler(void)  {
     if(++msTicks == 5000) {
         LEDS_INVERT(BSP_LED_1_MASK); /* light LED 2 very 1 second */
         g_setAdvData = true;
         msTicks = 0;
     }
}

int main(void)
{
    // Initialize.
    log_init();
    timers_init();
    leds_init();
    power_management_init();
    ble_stack_init();
    advertising_init();

    // Start execution.
    NRF_LOG_INFO(&amp;quot;Beacon example started.&amp;quot;);
    advertising_start();

    uint32_t returnCode;
    returnCode = SysTick_Config(SystemCoreClock / 1000);

    // Enter main loop.
    for (;; )
    {
       if(g_setAdvData) {
       sd_ble_gap_adv_stop(m_adv_handle);
          advertising_init();
          advertising_start();
          //Set_AdvData();
          g_setAdvData = false;
      }
        idle_state_handle();
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps you.&lt;/p&gt;
&lt;p&gt;- Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 - advertising data</title><link>https://devzone.nordicsemi.com/thread/155946?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 12:33:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b454706a-84c4-44e1-8152-f33016fed975</guid><dc:creator>Miguel</dc:creator><description>&lt;p&gt;Andreas, i guess that was mobile APP side problem! I changed to Adafruity scanner and now i am successfully receiveing the advertsing...without stops...&lt;/p&gt;
&lt;p&gt;I was using the Nordic Ble Scanner, but after a while, stop to receive advertising... i guess that is some app setup that is wrong...&lt;/p&gt;
&lt;p&gt;But, please, see if my Set_AdvData() is right!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 - advertising data</title><link>https://devzone.nordicsemi.com/thread/155944?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 12:27:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b693808-229f-4e2c-9fa1-555780cc6728</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi again.&lt;/p&gt;
&lt;p&gt;Try this code:&lt;/p&gt;
&lt;p&gt;(The timer is set to 5 seconds instead of 5 ms)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
/**
 * Copyright (c) 2014 - 2018, Nordic Semiconductor ASA
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form, except as embedded into a Nordic
 *    Semiconductor ASA integrated circuit in a product or a software update for
 *    such product, must reproduce the above copyright notice, this list of
 *    conditions and the following disclaimer in the documentation and/or other
 *    materials provided with the distribution.
 *
 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
 *    contributors may be used to endorse or promote products derived from this
 *    software without specific prior written permission.
 *
 * 4. This software, with or without modification, must only be used with a
 *    Nordic Semiconductor ASA integrated circuit.
 *
 * 5. Any software provided in binary form under this license must not be reverse
 *    engineered, decompiled, modified and/or disassembled.
 *
 * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA &amp;quot;AS IS&amp;quot; AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
/** @file
 *
 * @defgroup ble_sdk_app_beacon_main main.c
 * @{
 * @ingroup ble_sdk_app_beacon
 * @brief Beacon Transmitter Sample Application main file.
 *
 * This file contains the source code for an Beacon transmitter sample application.
 */

#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;quot;nordic_common.h&amp;quot;
#include &amp;quot;bsp.h&amp;quot;
#include &amp;quot;nrf_soc.h&amp;quot;
#include &amp;quot;nrf_sdh.h&amp;quot;
#include &amp;quot;nrf_sdh_ble.h&amp;quot;
#include &amp;quot;ble_advdata.h&amp;quot;
#include &amp;quot;app_timer.h&amp;quot;
#include &amp;quot;nrf_pwr_mgmt.h&amp;quot;

#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;


#define APP_BLE_CONN_CFG_TAG            1                                  /**&amp;lt; A tag identifying the SoftDevice BLE configuration. */

#define NON_CONNECTABLE_ADV_INTERVAL    MSEC_TO_UNITS(100, UNIT_0_625_MS)  /**&amp;lt; The advertising interval for non-connectable advertisement (100 ms). This value can vary between 100ms to 10.24s). */

#define APP_BEACON_INFO_LENGTH          0x17                               /**&amp;lt; Total length of information advertised by the Beacon. */
#define APP_ADV_DATA_LENGTH             0x15                               /**&amp;lt; Length of manufacturer specific data in the advertisement. */
#define APP_DEVICE_TYPE                 0x02                               /**&amp;lt; 0x02 refers to Beacon. */
#define APP_MEASURED_RSSI               0xC3                               /**&amp;lt; The Beacon&amp;#39;s measured RSSI at 1 meter distance in dBm. */
#define APP_COMPANY_IDENTIFIER          0x0059                             /**&amp;lt; Company identifier for Nordic Semiconductor ASA. as per www.bluetooth.org. */
#define APP_MAJOR_VALUE                 0x01, 0x02                         /**&amp;lt; Major value used to identify Beacons. */
#define APP_MINOR_VALUE                 0x03, 0x04                         /**&amp;lt; Minor value used to identify Beacons. */
#define APP_BEACON_UUID                 0x01, 0x12, 0x23, 0x34, \
                                        0x45, 0x56, 0x67, 0x78, \
                                        0x89, 0x9a, 0xab, 0xbc, \
                                        0xcd, 0xde, 0xef, 0xf0            /**&amp;lt; Proprietary UUID for Beacon. */

#define DEAD_BEEF                       0xDEADBEEF                         /**&amp;lt; Value used as error code on stack dump, can be used to identify stack location on stack unwind. */

#if defined(USE_UICR_FOR_MAJ_MIN_VALUES)
#define MAJ_VAL_OFFSET_IN_BEACON_INFO   18                                 /**&amp;lt; Position of the MSB of the Major Value in m_beacon_info array. */
#define UICR_ADDRESS                    0x10001080                         /**&amp;lt; Address of the UICR register used by this example. The major and minor versions to be encoded into the advertising data will be picked up from this location. */
#endif

static ble_gap_adv_params_t m_adv_params;                                  /**&amp;lt; Parameters to be passed to the stack when starting advertising. */
static uint8_t              m_adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET; /**&amp;lt; Advertising handle used to identify an advertising set. */
static uint8_t              m_enc_advdata[BLE_GAP_ADV_SET_DATA_SIZE_MAX];  /**&amp;lt; Buffer for storing an encoded advertising set. */

// one-shot flag for setting adv data
static volatile bool g_setAdvData = false;

/**@brief Struct that contains pointers to the encoded advertising data. */
static ble_gap_adv_data_t m_adv_data =
{
    .adv_data =
    {
        .p_data = m_enc_advdata,
        .len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX
    },
    .scan_rsp_data =
    {
        .p_data = NULL,
        .len    = 0

    }
};


static uint8_t m_beacon_info[APP_BEACON_INFO_LENGTH] =                    /**&amp;lt; Information advertised by the Beacon. */
{
    APP_DEVICE_TYPE,     // Manufacturer specific information. Specifies the device type in this
                         // implementation.
    APP_ADV_DATA_LENGTH, // Manufacturer specific information. Specifies the length of the
                         // manufacturer specific data in this implementation.
    APP_BEACON_UUID,     // 128 bit UUID value.
    APP_MAJOR_VALUE,     // Major arbitrary value that can be used to distinguish between Beacons.
    APP_MINOR_VALUE,     // Minor arbitrary value that can be used to distinguish between Beacons.
    APP_MEASURED_RSSI    // Manufacturer specific information. The Beacon&amp;#39;s measured TX power in
                         // this implementation.
};


/**@brief Callback function for asserts in the SoftDevice.
 *
 * @details This function will be called in case of an assert in the SoftDevice.
 *
 * @warning This handler is an example only and does not fit a final product. You need to analyze
 *          how your product is supposed to react in case of Assert.
 * @warning On assert from the SoftDevice, the system can only recover on reset.
 *
 * @param[in]   line_num   Line number of the failing ASSERT call.
 * @param[in]   file_name  File name of the failing ASSERT call.
 */
void assert_nrf_callback(uint16_t line_num, const uint8_t * p_file_name)
{
    app_error_handler(DEAD_BEEF, line_num, p_file_name);
}

/**@brief Function for initializing the Advertising functionality.
 *
 * @details Encodes the required advertising data and passes it to the stack.
 *          Also builds a structure to be passed to the stack when starting advertising.
 */
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;

    manuf_specific_data.company_identifier = APP_COMPANY_IDENTIFIER;

    manuf_specific_data.data.p_data = (uint8_t *) m_beacon_info;
    if (g_setAdvData)
    {
        manuf_specific_data.data.p_data[3] = 0xED;
    }
    manuf_specific_data.data.size   = APP_BEACON_INFO_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;

    // Initialize advertising parameters (used when starting advertising).
    memset(&amp;amp;m_adv_params, 0, sizeof(m_adv_params));

    m_adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;
    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.

    err_code = ble_advdata_encode(&amp;amp;advdata, m_adv_data.adv_data.p_data, &amp;amp;m_adv_data.adv_data.len);
    ble_advertising_init();
    APP_ERROR_CHECK(err_code);

    err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;m_adv_params);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for starting advertising.
 */
static void advertising_start(void)
{
    ret_code_t err_code;

    err_code = sd_ble_gap_adv_start(m_adv_handle, APP_BLE_CONN_CFG_TAG);
    APP_ERROR_CHECK(err_code);

    err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for initializing the BLE stack.
 *
 * @details Initializes the SoftDevice and the BLE event interrupt.
 */
static void ble_stack_init(void)
{
    ret_code_t err_code;

    err_code = nrf_sdh_enable_request();
    APP_ERROR_CHECK(err_code);

    // Configure the BLE stack using the default settings.
    // Fetch the start address of the application RAM.
    uint32_t ram_start = 0;
    err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &amp;amp;ram_start);
    APP_ERROR_CHECK(err_code);

    // Enable BLE stack.
    err_code = nrf_sdh_ble_enable(&amp;amp;ram_start);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for initializing logging. */
static void log_init(void)
{
    ret_code_t err_code = NRF_LOG_INIT(NULL);
    APP_ERROR_CHECK(err_code);

    NRF_LOG_DEFAULT_BACKENDS_INIT();
}

/**@brief Function for initializing LEDs. */
static void leds_init(void)
{
    ret_code_t err_code = bsp_init(BSP_INIT_LEDS, NULL);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for initializing timers. */
static void timers_init(void)
{
    ret_code_t err_code = app_timer_init();
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for initializing power management.
 */
static void power_management_init(void)
{
    ret_code_t err_code;
    err_code = nrf_pwr_mgmt_init();
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for handling the idle state (main loop).
 *
 * @details If there is no pending log operation, then sleep until next the next event occurs.
 */
static void idle_state_handle(void)
{
    if (NRF_LOG_PROCESS() == false)
    {
        nrf_pwr_mgmt_run();
    }
}

//Propaganda
uint8_t Propaganda = 0;

static void Set_AdvData()
{
  sd_ble_gap_adv_stop(m_adv_handle);
  ret_code_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;

    manuf_specific_data.company_identifier = APP_COMPANY_IDENTIFIER;

    // Prepare the scan response manufacturer specific data packet
    ble_advdata_manuf_data_t  manuf_data_response;
    uint8_t                     data_response[] = {0x08,0x00,0x03,0x08,0x00,0x03,0x08,0x00,0x03};
    //Change Data Advertising..
    ++Propaganda;
    data_response[0]=Propaganda;
    data_response[1]=Propaganda;
    data_response[2]=Propaganda;
    data_response[3]=Propaganda;
    data_response[4]=Propaganda;
    data_response[5]=Propaganda;
    data_response[6]=Propaganda;
    data_response[7]=Propaganda;
    data_response[8]=Propaganda;
    data_response[9]=Propaganda;

    manuf_specific_data.company_identifier  = 0x0059;
    manuf_specific_data.data.p_data         = data_response;
    manuf_specific_data.data.size           = sizeof(data_response);
    
    // 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;

    // Initialize advertising parameters (used when starting advertising).
    memset(&amp;amp;m_adv_params, 0, sizeof(m_adv_params));

    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);
    
    advertising_start();
}





#define SYSTICK_COUNT_ENABLE        1
#define SYSTICK_INTERRUPT_ENABLE    2
  
uint32_t msTicks = 0; /* Variable to store millisecond ticks */
 
/* SysTick interrupt Handler. */
void SysTick_Handler(void)  {
     if(++msTicks == 5000) {
         LEDS_INVERT(BSP_LED_1_MASK); /* light LED 2 very 1 second */
         g_setAdvData = true;
         msTicks = 0;
     }
}

/**
 * @brief Function for application main entry.
 */
int main(void)
{
    // Initialize.
    log_init();
    timers_init();
    leds_init();
    power_management_init();
    ble_stack_init();
    advertising_init();

    // Start execution.
    NRF_LOG_INFO(&amp;quot;Beacon example started.&amp;quot;);
    advertising_start();

    uint32_t returnCode;
    returnCode = SysTick_Config(SystemCoreClock / 1000);

    // Enter main loop.
    for (;; )
    {
       if(g_setAdvData) {
       sd_ble_gap_adv_stop(m_adv_handle);
          advertising_init();
          advertising_start();
          //Set_AdvData();
          g_setAdvData = false;
      }
        idle_state_handle();
    }
}

/**
 * @}
 */
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;- Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 - advertising data</title><link>https://devzone.nordicsemi.com/thread/155835?ContentTypeID=1</link><pubDate>Sat, 03 Nov 2018 22:31:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e07bd5e0-947e-45f3-ab7a-1339b7a012f6</guid><dc:creator>Miguel</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**
 * Copyright (c) 2014 - 2018, Nordic Semiconductor ASA
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form, except as embedded into a Nordic
 *    Semiconductor ASA integrated circuit in a product or a software update for
 *    such product, must reproduce the above copyright notice, this list of
 *    conditions and the following disclaimer in the documentation and/or other
 *    materials provided with the distribution.
 *
 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
 *    contributors may be used to endorse or promote products derived from this
 *    software without specific prior written permission.
 *
 * 4. This software, with or without modification, must only be used with a
 *    Nordic Semiconductor ASA integrated circuit.
 *
 * 5. Any software provided in binary form under this license must not be reverse
 *    engineered, decompiled, modified and/or disassembled.
 *
 * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA &amp;quot;AS IS&amp;quot; AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
/** @file
 *
 * @defgroup ble_sdk_app_beacon_main main.c
 * @{
 * @ingroup ble_sdk_app_beacon
 * @brief Beacon Transmitter Sample Application main file.
 *
 * This file contains the source code for an Beacon transmitter sample application.
 */

#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;quot;nordic_common.h&amp;quot;
#include &amp;quot;bsp.h&amp;quot;
#include &amp;quot;nrf_soc.h&amp;quot;
#include &amp;quot;nrf_sdh.h&amp;quot;
#include &amp;quot;nrf_sdh_ble.h&amp;quot;
#include &amp;quot;ble_advdata.h&amp;quot;
#include &amp;quot;app_timer.h&amp;quot;
#include &amp;quot;nrf_pwr_mgmt.h&amp;quot;

#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;


#define APP_BLE_CONN_CFG_TAG            1                                  /**&amp;lt; A tag identifying the SoftDevice BLE configuration. */

#define NON_CONNECTABLE_ADV_INTERVAL    MSEC_TO_UNITS(100, UNIT_0_625_MS)  /**&amp;lt; The advertising interval for non-connectable advertisement (100 ms). This value can vary between 100ms to 10.24s). */

#define APP_BEACON_INFO_LENGTH          0x17                               /**&amp;lt; Total length of information advertised by the Beacon. */
#define APP_ADV_DATA_LENGTH             0x15                               /**&amp;lt; Length of manufacturer specific data in the advertisement. */
#define APP_DEVICE_TYPE                 0x02                               /**&amp;lt; 0x02 refers to Beacon. */
#define APP_MEASURED_RSSI               0xC3                               /**&amp;lt; The Beacon&amp;#39;s measured RSSI at 1 meter distance in dBm. */
#define APP_COMPANY_IDENTIFIER          0x0059                             /**&amp;lt; Company identifier for Nordic Semiconductor ASA. as per www.bluetooth.org. */
#define APP_MAJOR_VALUE                 0x01, 0x02                         /**&amp;lt; Major value used to identify Beacons. */
#define APP_MINOR_VALUE                 0x03, 0x04                         /**&amp;lt; Minor value used to identify Beacons. */
#define APP_BEACON_UUID                 0x01, 0x12, 0x23, 0x34, \
                                        0x45, 0x56, 0x67, 0x78, \
                                        0x89, 0x9a, 0xab, 0xbc, \
                                        0xcd, 0xde, 0xef, 0xf0            /**&amp;lt; Proprietary UUID for Beacon. */

#define DEAD_BEEF                       0xDEADBEEF                         /**&amp;lt; Value used as error code on stack dump, can be used to identify stack location on stack unwind. */

#if defined(USE_UICR_FOR_MAJ_MIN_VALUES)
#define MAJ_VAL_OFFSET_IN_BEACON_INFO   18                                 /**&amp;lt; Position of the MSB of the Major Value in m_beacon_info array. */
#define UICR_ADDRESS                    0x10001080                         /**&amp;lt; Address of the UICR register used by this example. The major and minor versions to be encoded into the advertising data will be picked up from this location. */
#endif

static ble_gap_adv_params_t m_adv_params;                                  /**&amp;lt; Parameters to be passed to the stack when starting advertising. */
static uint8_t              m_adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET; /**&amp;lt; Advertising handle used to identify an advertising set. */
static uint8_t              m_enc_advdata[BLE_GAP_ADV_SET_DATA_SIZE_MAX];  /**&amp;lt; Buffer for storing an encoded advertising set. */

/**@brief Struct that contains pointers to the encoded advertising data. */
static ble_gap_adv_data_t m_adv_data =
{
    .adv_data =
    {
        .p_data = m_enc_advdata,
        .len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX
    },
    .scan_rsp_data =
    {
        .p_data = NULL,
        .len    = 0

    }
};


static uint8_t m_beacon_info[APP_BEACON_INFO_LENGTH] =                    /**&amp;lt; Information advertised by the Beacon. */
{
    APP_DEVICE_TYPE,     // Manufacturer specific information. Specifies the device type in this
                         // implementation.
    APP_ADV_DATA_LENGTH, // Manufacturer specific information. Specifies the length of the
                         // manufacturer specific data in this implementation.
    APP_BEACON_UUID,     // 128 bit UUID value.
    APP_MAJOR_VALUE,     // Major arbitrary value that can be used to distinguish between Beacons.
    APP_MINOR_VALUE,     // Minor arbitrary value that can be used to distinguish between Beacons.
    APP_MEASURED_RSSI    // Manufacturer specific information. The Beacon&amp;#39;s measured TX power in
                         // this implementation.
};


/**@brief Callback function for asserts in the SoftDevice.
 *
 * @details This function will be called in case of an assert in the SoftDevice.
 *
 * @warning This handler is an example only and does not fit a final product. You need to analyze
 *          how your product is supposed to react in case of Assert.
 * @warning On assert from the SoftDevice, the system can only recover on reset.
 *
 * @param[in]   line_num   Line number of the failing ASSERT call.
 * @param[in]   file_name  File name of the failing ASSERT call.
 */
void assert_nrf_callback(uint16_t line_num, const uint8_t * p_file_name)
{
    app_error_handler(DEAD_BEEF, line_num, p_file_name);
}

/**@brief Function for initializing the Advertising functionality.
 *
 * @details Encodes the required advertising data and passes it to the stack.
 *          Also builds a structure to be passed to the stack when starting advertising.
 */
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;

    manuf_specific_data.company_identifier = APP_COMPANY_IDENTIFIER;

    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.name_type             = BLE_ADVDATA_NO_NAME;
    advdata.flags                 = flags;
    advdata.p_manuf_specific_data = &amp;amp;manuf_specific_data;

    // Initialize advertising parameters (used when starting advertising).
    memset(&amp;amp;m_adv_params, 0, sizeof(m_adv_params));

    m_adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;
    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.

    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);

    err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;m_adv_params);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for starting advertising.
 */
static void advertising_start(void)
{
    ret_code_t err_code;

    err_code = sd_ble_gap_adv_start(m_adv_handle, APP_BLE_CONN_CFG_TAG);
    APP_ERROR_CHECK(err_code);

    err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for initializing the BLE stack.
 *
 * @details Initializes the SoftDevice and the BLE event interrupt.
 */
static void ble_stack_init(void)
{
    ret_code_t err_code;

    err_code = nrf_sdh_enable_request();
    APP_ERROR_CHECK(err_code);

    // Configure the BLE stack using the default settings.
    // Fetch the start address of the application RAM.
    uint32_t ram_start = 0;
    err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &amp;amp;ram_start);
    APP_ERROR_CHECK(err_code);

    // Enable BLE stack.
    err_code = nrf_sdh_ble_enable(&amp;amp;ram_start);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for initializing logging. */
static void log_init(void)
{
    ret_code_t err_code = NRF_LOG_INIT(NULL);
    APP_ERROR_CHECK(err_code);

    NRF_LOG_DEFAULT_BACKENDS_INIT();
}

/**@brief Function for initializing LEDs. */
static void leds_init(void)
{
    ret_code_t err_code = bsp_init(BSP_INIT_LEDS, NULL);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for initializing timers. */
static void timers_init(void)
{
    ret_code_t err_code = app_timer_init();
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for initializing power management.
 */
static void power_management_init(void)
{
    ret_code_t err_code;
    err_code = nrf_pwr_mgmt_init();
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for handling the idle state (main loop).
 *
 * @details If there is no pending log operation, then sleep until next the next event occurs.
 */
static void idle_state_handle(void)
{
    if (NRF_LOG_PROCESS() == false)
    {
        nrf_pwr_mgmt_run();
    }
}

//Propaganda
uint8_t Propaganda = 0;

static void Set_AdvData()
{
  ret_code_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;

    manuf_specific_data.company_identifier = APP_COMPANY_IDENTIFIER;

    // Prepare the scan response manufacturer specific data packet
    ble_advdata_manuf_data_t  manuf_data_response;
    uint8_t                     data_response[] = {0x08,0x00,0x03,0x08,0x00,0x03,0x08,0x00,0x03};
    //Change Data Advertising..
    ++Propaganda;
    data_response[0]=Propaganda;
    data_response[1]=Propaganda;
    data_response[2]=Propaganda;
    data_response[3]=Propaganda;
    data_response[4]=Propaganda;
    data_response[5]=Propaganda;
    data_response[6]=Propaganda;
    data_response[7]=Propaganda;
    data_response[8]=Propaganda;
    data_response[9]=Propaganda;

    manuf_specific_data.company_identifier  = 0x0059;
    manuf_specific_data.data.p_data         = data_response;
    manuf_specific_data.data.size           = sizeof(data_response);
    
    // 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;

    // Initialize advertising parameters (used when starting advertising).
    memset(&amp;amp;m_adv_params, 0, sizeof(m_adv_params));

    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);
}



// one-shot flag for setting adv data
static volatile bool g_setAdvData = false;

#define SYSTICK_COUNT_ENABLE        1
#define SYSTICK_INTERRUPT_ENABLE    2
  
uint8_t msTicks = 0; /* Variable to store millisecond ticks */
 
/* SysTick interrupt Handler. */
void SysTick_Handler(void)  {
     if(++msTicks == 5) {
         LEDS_INVERT(BSP_LED_1_MASK); /* light LED 2 very 1 second */
         g_setAdvData = true;
         msTicks = 0;
     }
}

/**
 * @brief Function for application main entry.
 */
int main(void)
{
    // Initialize.
    log_init();
    timers_init();
    leds_init();
    power_management_init();
    ble_stack_init();
    advertising_init();

    // Start execution.
    NRF_LOG_INFO(&amp;quot;Beacon example started.&amp;quot;);
    advertising_start();

    uint32_t returnCode;
    returnCode = SysTick_Config(SystemCoreClock / 1000);

    // Enter main loop.
    for (;; )
    {
       if(g_setAdvData) {
          Set_AdvData();
          g_setAdvData = false;
      }
        idle_state_handle();
    }
}

/**
 * @}
 */
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Could you help me ? After a while, the software stop to make advertising...can you give me some tip ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 - advertising data</title><link>https://devzone.nordicsemi.com/thread/155765?ContentTypeID=1</link><pubDate>Fri, 02 Nov 2018 13:23:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f101491b-37f0-46dc-93b7-45c83beddb36</guid><dc:creator>Miguel</dc:creator><description>&lt;p&gt;thanks for fast reply&lt;/p&gt;
&lt;p&gt;in my code advertising_init()&amp;nbsp; i can successfully advertising manufacturer &lt;strong&gt;data_response[]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;but in&lt;/p&gt;
&lt;p&gt;static void Set_AdvData()&lt;br /&gt;{&lt;br /&gt; ret_code_t ret_code;&lt;br /&gt; static ble_gap_adv_data_t new_data;&lt;br /&gt; &lt;br /&gt; ret_code = ble_advertising_advdata_update(&amp;amp;&lt;strong&gt;m_advertising&lt;/strong&gt;, &amp;amp;new_data, true);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;wich are the parameters to me update the&amp;nbsp;&lt;strong&gt;data_response[] ?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&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;

    manuf_specific_data.company_identifier = APP_COMPANY_IDENTIFIER;

    // Prepare the scan response manufacturer specific data packet
    ble_advdata_manuf_data_t  manuf_data_response;
    uint8_t                     data_response[] = {0x06,0x48,0x41};
    manuf_specific_data.company_identifier  = 0x0059;
    manuf_specific_data.data.p_data         = data_response;
    manuf_specific_data.data.size           = sizeof(data_response);
    
    // 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;

    // Initialize advertising parameters (used when starting advertising).
    memset(&amp;amp;m_adv_params, 0, sizeof(m_adv_params));

    m_adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;
    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.

    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);

    err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;m_adv_params);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 - advertising data</title><link>https://devzone.nordicsemi.com/thread/155735?ContentTypeID=1</link><pubDate>Fri, 02 Nov 2018 11:38:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:203be636-dbb8-465c-a370-6a272b51f840</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;You can do this by using &lt;strong&gt;two&lt;/strong&gt; data buffers, so that you avoid re-using an active buffer, because that is not allowed by &lt;strong&gt;sd_ble_gap_adv_set_configure()&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;If you use SDK 15.2, you can take a look at &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/group__ble__advertising.html?cp=4_0_0_6_2_0_10#gaed156c3a650acabf79890fa9da01dec2"&gt;ble_advertising_advdata_update()&lt;/a&gt;, which can be used to update the advertising data. The update will be effective even if the advertising has already been started.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ret_code_t ble_advertising_advdata_update(ble_advertising_t  * const p_advertising,
                                          ble_gap_adv_data_t * const p_new_advdata_buf,
                                          bool                       permanent)
{
    if (permanent)
    {
        memcpy(&amp;amp;p_advertising-&amp;gt;adv_data, p_new_advdata_buf, sizeof(p_advertising-&amp;gt;adv_data));
        p_advertising-&amp;gt;p_adv_data = &amp;amp;p_advertising-&amp;gt;adv_data;
    }
    else
    {
        p_advertising-&amp;gt;p_adv_data = p_new_advdata_buf;
    }

    return sd_ble_gap_adv_set_configure(&amp;amp;p_advertising-&amp;gt;adv_handle,
                                        p_advertising-&amp;gt;p_adv_data,
                                        NULL);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If &lt;em&gt;permanent&lt;/em&gt; is set to true, the advertising data will be permanently updated inside the module. Otherwise, the previous advertising data will be restored when there is a transition to the next advertising mode.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;- Andreas&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>