<?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>2 way beacon/connectable beacon</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/76452/2-way-beacon-connectable-beacon</link><description>Hello, DK:nrf52810 
 sdk:17.0.2 
 In my project i have to advertise accelerometer and gyro value through beacon so i have done with using https://devzone.nordicsemi.com/f/nordic-q-a/76400/nrf52-ble-beacon-with-accelerometer-data-advertising this support</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 Jun 2021 16:46:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/76452/2-way-beacon-connectable-beacon" /><item><title>RE: 2 way beacon/connectable beacon</title><link>https://devzone.nordicsemi.com/thread/316545?ContentTypeID=1</link><pubDate>Tue, 22 Jun 2021 16:46:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:716800a7-8cfe-4bb3-b12d-a5e41d9b6bf2</guid><dc:creator>N A Karmarkar</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;i have created new service in that program&lt;/p&gt;
&lt;p&gt;so now both advertising and connectable service satisfied..!!&lt;/p&gt;
&lt;p&gt;using this&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/how-to-update-advertising-data-dynamically-using-ble-advertising-library"&gt;https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/how-to-update-advertising-data-dynamically-using-ble-advertising-library&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 way beacon/connectable beacon</title><link>https://devzone.nordicsemi.com/thread/316429?ContentTypeID=1</link><pubDate>Tue, 22 Jun 2021 09:56:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cb2ec72-e48c-4aaf-bc5a-4d4db62da6e0</guid><dc:creator>awneil</dc:creator><description>[quote userid="105375" url="~/f/nordic-q-a/76452/2-way-beacon-connectable-beacon/316426#316426"]advertising not happend[/quote]
&lt;p&gt;So, again, what debugging have you done to find why the advertising has &amp;quot;not happened&amp;quot; ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/3757._5F00_Insert-Code-_2D00_-Nordic-2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 way beacon/connectable beacon</title><link>https://devzone.nordicsemi.com/thread/316426?ContentTypeID=1</link><pubDate>Tue, 22 Jun 2021 09:41:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4adb68b-3f37-43ca-b6a6-1ac781ad2787</guid><dc:creator>N A Karmarkar</dc:creator><description>&lt;p&gt;Hello awneil,&lt;/p&gt;
&lt;p&gt;this is the uart modified code as per ur example, advertising not happend&lt;/p&gt;
&lt;p&gt;#include &amp;lt;stdbool.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;#include &amp;lt;string.h&amp;gt;&lt;/p&gt;
&lt;p&gt;#include &amp;quot;nordic_common.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf.h&amp;quot;&lt;br /&gt;#include &amp;quot;ble_hci.h&amp;quot;&lt;br /&gt;#include &amp;quot;ble_advdata.h&amp;quot;&lt;br /&gt;#include &amp;quot;ble_advertising.h&amp;quot;&lt;br /&gt;#include &amp;quot;ble_conn_params.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_sdh.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_sdh_soc.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_sdh_ble.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_ble_gatt.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_ble_qwr.h&amp;quot;&lt;br /&gt;#include &amp;quot;app_timer.h&amp;quot;&lt;br /&gt;#include &amp;quot;ble_nus.h&amp;quot;&lt;br /&gt;#include &amp;quot;app_uart.h&amp;quot;&lt;br /&gt;#include &amp;quot;app_util_platform.h&amp;quot;&lt;br /&gt;#include &amp;quot;bsp_btn_ble.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_pwr_mgmt.h&amp;quot;&lt;/p&gt;
&lt;p&gt;#if defined (UART_PRESENT)&lt;br /&gt;#include &amp;quot;nrf_uart.h&amp;quot;&lt;br /&gt;#endif&lt;br /&gt;#if defined (UARTE_PRESENT)&lt;br /&gt;#include &amp;quot;nrf_uarte.h&amp;quot;&lt;br /&gt;#endif&lt;/p&gt;
&lt;p&gt;#include &amp;quot;nrf_log.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_log_ctrl.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_log_default_backends.h&amp;quot;&lt;/p&gt;
&lt;p&gt;//**********************************************************************************&lt;/p&gt;
&lt;p&gt;#include &amp;lt;stdbool.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;#include &amp;lt;string.h&amp;gt;&lt;/p&gt;
&lt;p&gt;#include &amp;quot;nordic_common.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf.h&amp;quot;&lt;br /&gt;#include &amp;quot;app_error.h&amp;quot;&lt;br /&gt;#include &amp;quot;ble.h&amp;quot;&lt;br /&gt;#include &amp;quot;ble_hci.h&amp;quot;&lt;br /&gt;#include &amp;quot;ble_srv_common.h&amp;quot;&lt;br /&gt;#include &amp;quot;ble_advdata.h&amp;quot;&lt;br /&gt;#include &amp;quot;ble_advertising.h&amp;quot;&lt;br /&gt;#include &amp;quot;ble_conn_params.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_sdh.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_sdh_soc.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_sdh_ble.h&amp;quot;&lt;br /&gt;#include &amp;quot;app_timer.h&amp;quot;&lt;br /&gt;#include &amp;quot;fds.h&amp;quot;&lt;br /&gt;#include &amp;quot;peer_manager.h&amp;quot;&lt;br /&gt;#include &amp;quot;peer_manager_handler.h&amp;quot;&lt;br /&gt;#include &amp;quot;bsp_btn_ble.h&amp;quot;&lt;br /&gt;//#include &amp;quot;sensorsim.h&amp;quot;&lt;br /&gt;#include &amp;quot;ble_conn_state.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_ble_gatt.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_ble_qwr.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_pwr_mgmt.h&amp;quot;&lt;/p&gt;
&lt;p&gt;#include &amp;quot;nrf_log.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_log_ctrl.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_log_default_backends.h&amp;quot;&lt;/p&gt;
&lt;p&gt;//**********************************************************************************&lt;/p&gt;
&lt;p&gt;#define APP_BLE_CONN_CFG_TAG 1 /**&amp;lt; A tag identifying the SoftDevice BLE configuration. */&lt;/p&gt;
&lt;p&gt;#define DEVICE_NAME &amp;quot;Nordic_UART&amp;quot; /**&amp;lt; Name of device. Will be included in the advertising data. */&lt;br /&gt;#define NUS_SERVICE_UUID_TYPE BLE_UUID_TYPE_VENDOR_BEGIN /**&amp;lt; UUID type for the Nordic UART Service (vendor specific). */&lt;/p&gt;
&lt;p&gt;#define APP_BLE_OBSERVER_PRIO 3 /**&amp;lt; Application&amp;#39;s BLE observer priority. You shouldn&amp;#39;t need to modify this value. */&lt;/p&gt;
&lt;p&gt;#define APP_ADV_INTERVAL 64 /**&amp;lt; The advertising interval (in units of 0.625 ms. This value corresponds to 40 ms). */&lt;/p&gt;
&lt;p&gt;#define APP_ADV_DURATION 18000 /**&amp;lt; The advertising duration (180 seconds) in units of 10 milliseconds. */&lt;/p&gt;
&lt;p&gt;#define MIN_CONN_INTERVAL MSEC_TO_UNITS(20, UNIT_1_25_MS) /**&amp;lt; Minimum acceptable connection interval (20 ms), Connection interval uses 1.25 ms units. */&lt;br /&gt;#define MAX_CONN_INTERVAL MSEC_TO_UNITS(75, UNIT_1_25_MS) /**&amp;lt; Maximum acceptable connection interval (75 ms), Connection interval uses 1.25 ms units. */&lt;br /&gt;#define SLAVE_LATENCY 0 /**&amp;lt; Slave latency. */&lt;br /&gt;#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS) /**&amp;lt; Connection supervisory timeout (4 seconds), Supervision Timeout uses 10 ms units. */&lt;br /&gt;#define FIRST_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(5000) /**&amp;lt; Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (5 seconds). */&lt;br /&gt;#define NEXT_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(30000) /**&amp;lt; Time between each call to sd_ble_gap_conn_param_update after the first call (30 seconds). */&lt;br /&gt;#define MAX_CONN_PARAMS_UPDATE_COUNT 3 /**&amp;lt; Number of attempts before giving up the connection parameter negotiation. */&lt;/p&gt;
&lt;p&gt;#define DEAD_BEEF 0xDEADBEEF /**&amp;lt; Value used as error code on stack dump, can be used to identify stack location on stack unwind. */&lt;/p&gt;
&lt;p&gt;#define UART_TX_BUF_SIZE 256 /**&amp;lt; UART TX buffer size. */&lt;br /&gt;#define UART_RX_BUF_SIZE 256 /**&amp;lt; UART RX buffer size. */&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;BLE_NUS_DEF(m_nus, NRF_SDH_BLE_TOTAL_LINK_COUNT); /**&amp;lt; BLE NUS service instance. */&lt;br /&gt;NRF_BLE_GATT_DEF(m_gatt); /**&amp;lt; GATT module instance. */&lt;br /&gt;NRF_BLE_QWR_DEF(m_qwr); /**&amp;lt; Context for the Queued Write module.*/&lt;br /&gt;BLE_ADVERTISING_DEF(m_advertising); /**&amp;lt; Advertising module instance. */&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;APP_TIMER_DEF(m_adv_data_update_timer);&lt;br /&gt;#define ADV_DATA_UPDATE_INTERVAL APP_TIMER_TICKS(5000L)&lt;/p&gt;
&lt;p&gt;#define MANUF_PAYLOAD_1 0x4E // N&lt;br /&gt;#define MANUF_PAYLOAD_2 0x4F // O&lt;br /&gt;#define MANUF_PAYLOAD_3 0x52 // R&lt;br /&gt;#define MANUF_PAYLOAD_4 0x44 // D&lt;br /&gt;#define MANUF_PAYLOAD_5 0x49 // I&lt;br /&gt;#define MANUF_PAYLOAD_6 0x43 // C&lt;/p&gt;
&lt;p&gt;#define PAYLOAD_SIZE 1&lt;br /&gt;#define TOP_INDEX 5&lt;/p&gt;
&lt;p&gt;#define APP_COMPANY_IDENTIFIER 0x0059 /**&amp;lt; Company identifier for Nordic Semiconductor ASA. as per www.bluetooth.org. */&lt;br /&gt; &lt;br /&gt;static ble_advdata_t new_advdata;&lt;br /&gt;static uint8_t manufacturing_data_payload_list [] =&lt;br /&gt;{&lt;br /&gt; MANUF_PAYLOAD_1,&lt;br /&gt; MANUF_PAYLOAD_2,&lt;br /&gt; MANUF_PAYLOAD_3,&lt;br /&gt; MANUF_PAYLOAD_4,&lt;br /&gt; MANUF_PAYLOAD_5,&lt;br /&gt; MANUF_PAYLOAD_6&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;static uint16_t m_conn_handle = BLE_CONN_HANDLE_INVALID; /**&amp;lt; Handle of the current connection. */&lt;br /&gt;static uint16_t m_ble_nus_max_data_len = BLE_GATT_ATT_MTU_DEFAULT - 3; /**&amp;lt; Maximum length of data (in bytes) that can be transmitted to the peer by the Nordic UART service module. */&lt;br /&gt;static ble_uuid_t m_adv_uuids[] = /**&amp;lt; Universally unique service identifier. */&lt;br /&gt;{&lt;br /&gt; {BLE_UUID_NUS_SERVICE, NUS_SERVICE_UUID_TYPE}&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for assert macro callback.&lt;br /&gt; *&lt;br /&gt; * @details This function will be called in case of an assert in the SoftDevice.&lt;br /&gt; *&lt;br /&gt; * @warning This handler is an example only and does not fit a final product. You need to analyse&lt;br /&gt; * how your product is supposed to react in case of Assert.&lt;br /&gt; * @warning On assert from the SoftDevice, the system can only recover on reset.&lt;br /&gt; *&lt;br /&gt; * @param[in] line_num Line number of the failing ASSERT call.&lt;br /&gt; * @param[in] p_file_name File name of the failing ASSERT call.&lt;br /&gt; */&lt;br /&gt;void assert_nrf_callback(uint16_t line_num, const uint8_t * p_file_name)&lt;br /&gt;{&lt;br /&gt; app_error_handler(DEAD_BEEF, line_num, p_file_name);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;/**@brief Function for initializing the timer module.&lt;br /&gt; */&lt;br /&gt;static void timers_init(void)&lt;br /&gt;{&lt;br /&gt; ret_code_t err_code = app_timer_init();&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;/**@brief Function for the GAP initialization.&lt;br /&gt; *&lt;br /&gt; * @details This function will set up all the necessary GAP (Generic Access Profile) parameters of&lt;br /&gt; * the device. It also sets the permissions and appearance.&lt;br /&gt; */&lt;br /&gt;static void gap_params_init(void)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code;&lt;br /&gt; ble_gap_conn_params_t gap_conn_params;&lt;br /&gt; ble_gap_conn_sec_mode_t sec_mode;&lt;/p&gt;
&lt;p&gt;BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;sec_mode);&lt;/p&gt;
&lt;p&gt;err_code = sd_ble_gap_device_name_set(&amp;amp;sec_mode,&lt;br /&gt; (const uint8_t *) DEVICE_NAME,&lt;br /&gt; strlen(DEVICE_NAME));&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;memset(&amp;amp;gap_conn_params, 0, sizeof(gap_conn_params));&lt;/p&gt;
&lt;p&gt;gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;&lt;br /&gt; gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;&lt;br /&gt; gap_conn_params.slave_latency = SLAVE_LATENCY;&lt;br /&gt; gap_conn_params.conn_sup_timeout = CONN_SUP_TIMEOUT;&lt;/p&gt;
&lt;p&gt;err_code = sd_ble_gap_ppcp_set(&amp;amp;gap_conn_params);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for handling Queued Write Module errors.&lt;br /&gt; *&lt;br /&gt; * @details A pointer to this function will be passed to each service which may need to inform the&lt;br /&gt; * application about an error.&lt;br /&gt; *&lt;br /&gt; * @param[in] nrf_error Error code containing information about what went wrong.&lt;br /&gt; */&lt;br /&gt;static void nrf_qwr_error_handler(uint32_t nrf_error)&lt;br /&gt;{&lt;br /&gt; APP_ERROR_HANDLER(nrf_error);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for handling the data from the Nordic UART Service.&lt;br /&gt; *&lt;br /&gt; * @details This function will process the data received from the Nordic UART BLE Service and send&lt;br /&gt; * it to the UART module.&lt;br /&gt; *&lt;br /&gt; * @param[in] p_evt Nordic UART Service event.&lt;br /&gt; */&lt;br /&gt;/**@snippet [Handling the data received over BLE] */&lt;br /&gt;static void nus_data_handler(ble_nus_evt_t * p_evt)&lt;br /&gt;{&lt;/p&gt;
&lt;p&gt;if (p_evt-&amp;gt;type == BLE_NUS_EVT_RX_DATA)&lt;br /&gt; {&lt;br /&gt; uint32_t err_code;&lt;/p&gt;
&lt;p&gt;NRF_LOG_DEBUG(&amp;quot;Received data from BLE NUS. Writing data on UART.&amp;quot;);&lt;br /&gt; NRF_LOG_HEXDUMP_DEBUG(p_evt-&amp;gt;params.rx_data.p_data, p_evt-&amp;gt;params.rx_data.length);&lt;/p&gt;
&lt;p&gt;for (uint32_t i = 0; i &amp;lt; p_evt-&amp;gt;params.rx_data.length; i++)&lt;br /&gt; {&lt;br /&gt; do&lt;br /&gt; {&lt;br /&gt; err_code = app_uart_put(p_evt-&amp;gt;params.rx_data.p_data[i]);&lt;br /&gt; if ((err_code != NRF_SUCCESS) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY))&lt;br /&gt; {&lt;br /&gt; NRF_LOG_ERROR(&amp;quot;Failed receiving NUS message. Error 0x%x. &amp;quot;, err_code);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; }&lt;br /&gt; } while (err_code == NRF_ERROR_BUSY);&lt;br /&gt; }&lt;br /&gt; if (p_evt-&amp;gt;params.rx_data.p_data[p_evt-&amp;gt;params.rx_data.length - 1] == &amp;#39;\r&amp;#39;)&lt;br /&gt; {&lt;br /&gt; while (app_uart_put(&amp;#39;\n&amp;#39;) == NRF_ERROR_BUSY);&lt;br /&gt; }&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;}&lt;br /&gt;/**@snippet [Handling the data received over BLE] */&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for initializing services that will be used by the application.&lt;br /&gt; */&lt;br /&gt;static void services_init(void)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code;&lt;br /&gt; ble_nus_init_t nus_init;&lt;br /&gt; nrf_ble_qwr_init_t qwr_init = {0};&lt;/p&gt;
&lt;p&gt;// Initialize Queued Write Module.&lt;br /&gt; qwr_init.error_handler = nrf_qwr_error_handler;&lt;/p&gt;
&lt;p&gt;err_code = nrf_ble_qwr_init(&amp;amp;m_qwr, &amp;amp;qwr_init);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;// Initialize NUS.&lt;br /&gt; memset(&amp;amp;nus_init, 0, sizeof(nus_init));&lt;/p&gt;
&lt;p&gt;nus_init.data_handler = nus_data_handler;&lt;/p&gt;
&lt;p&gt;err_code = ble_nus_init(&amp;amp;m_nus, &amp;amp;nus_init);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for handling an event from the Connection Parameters Module.&lt;br /&gt; *&lt;br /&gt; * @details This function will be called for all events in the Connection Parameters Module&lt;br /&gt; * which are passed to the application.&lt;br /&gt; *&lt;br /&gt; * @note All this function does is to disconnect. This could have been done by simply setting&lt;br /&gt; * the disconnect_on_fail config parameter, but instead we use the event handler&lt;br /&gt; * mechanism to demonstrate its use.&lt;br /&gt; *&lt;br /&gt; * @param[in] p_evt Event received from the Connection Parameters Module.&lt;br /&gt; */&lt;br /&gt;static void on_conn_params_evt(ble_conn_params_evt_t * p_evt)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code;&lt;/p&gt;
&lt;p&gt;if (p_evt-&amp;gt;evt_type == BLE_CONN_PARAMS_EVT_FAILED)&lt;br /&gt; {&lt;br /&gt; err_code = sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_CONN_INTERVAL_UNACCEPTABLE);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for handling errors from the Connection Parameters module.&lt;br /&gt; *&lt;br /&gt; * @param[in] nrf_error Error code containing information about what went wrong.&lt;br /&gt; */&lt;br /&gt;static void conn_params_error_handler(uint32_t nrf_error)&lt;br /&gt;{&lt;br /&gt; APP_ERROR_HANDLER(nrf_error);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for initializing the Connection Parameters module.&lt;br /&gt; */&lt;br /&gt;static void conn_params_init(void)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code;&lt;br /&gt; ble_conn_params_init_t cp_init;&lt;/p&gt;
&lt;p&gt;memset(&amp;amp;cp_init, 0, sizeof(cp_init));&lt;/p&gt;
&lt;p&gt;cp_init.p_conn_params = NULL;&lt;br /&gt; cp_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY;&lt;br /&gt; cp_init.next_conn_params_update_delay = NEXT_CONN_PARAMS_UPDATE_DELAY;&lt;br /&gt; cp_init.max_conn_params_update_count = MAX_CONN_PARAMS_UPDATE_COUNT;&lt;br /&gt; cp_init.start_on_notify_cccd_handle = BLE_GATT_HANDLE_INVALID;&lt;br /&gt; cp_init.disconnect_on_fail = false;&lt;br /&gt; cp_init.evt_handler = on_conn_params_evt;&lt;br /&gt; cp_init.error_handler = conn_params_error_handler;&lt;/p&gt;
&lt;p&gt;err_code = ble_conn_params_init(&amp;amp;cp_init);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for putting the chip into sleep mode.&lt;br /&gt; *&lt;br /&gt; * @note This function will not return.&lt;br /&gt; */&lt;br /&gt;static void sleep_mode_enter(void)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code = bsp_indication_set(BSP_INDICATE_IDLE);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;// Prepare wakeup buttons.&lt;br /&gt; err_code = bsp_btn_ble_sleep_mode_prepare();&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;// Go to system-off mode (this function will not return; wakeup will cause a reset).&lt;br /&gt; err_code = sd_power_system_off();&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for handling advertising events.&lt;br /&gt; *&lt;br /&gt; * @details This function will be called for advertising events which are passed to the application.&lt;br /&gt; *&lt;br /&gt; * @param[in] ble_adv_evt Advertising event.&lt;br /&gt; */&lt;br /&gt;static void on_adv_evt(ble_adv_evt_t ble_adv_evt)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code;&lt;/p&gt;
&lt;p&gt;switch (ble_adv_evt)&lt;br /&gt; {&lt;br /&gt; case BLE_ADV_EVT_FAST:&lt;br /&gt; err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; break;&lt;br /&gt; case BLE_ADV_EVT_IDLE:&lt;br /&gt; sleep_mode_enter();&lt;br /&gt; break;&lt;br /&gt; default:&lt;br /&gt; break;&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for handling BLE events.&lt;br /&gt; *&lt;br /&gt; * @param[in] p_ble_evt Bluetooth stack event.&lt;br /&gt; * @param[in] p_context Unused.&lt;br /&gt; */&lt;br /&gt;static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code;&lt;/p&gt;
&lt;p&gt;switch (p_ble_evt-&amp;gt;header.evt_id)&lt;br /&gt; {&lt;br /&gt; case BLE_GAP_EVT_CONNECTED:&lt;br /&gt; NRF_LOG_INFO(&amp;quot;Connected&amp;quot;);&lt;br /&gt; err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;&lt;br /&gt; err_code = nrf_ble_qwr_conn_handle_assign(&amp;amp;m_qwr, m_conn_handle);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;case BLE_GAP_EVT_DISCONNECTED:&lt;br /&gt; NRF_LOG_INFO(&amp;quot;Disconnected&amp;quot;);&lt;br /&gt; // LED indication will be changed when advertising starts.&lt;br /&gt; m_conn_handle = BLE_CONN_HANDLE_INVALID;&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;case BLE_GAP_EVT_PHY_UPDATE_REQUEST:&lt;br /&gt; {&lt;br /&gt; NRF_LOG_DEBUG(&amp;quot;PHY update request.&amp;quot;);&lt;br /&gt; ble_gap_phys_t const phys =&lt;br /&gt; {&lt;br /&gt; .rx_phys = BLE_GAP_PHY_AUTO,&lt;br /&gt; .tx_phys = BLE_GAP_PHY_AUTO,&lt;br /&gt; };&lt;br /&gt; err_code = sd_ble_gap_phy_update(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, &amp;amp;phys);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; } break;&lt;/p&gt;
&lt;p&gt;case BLE_GAP_EVT_SEC_PARAMS_REQUEST:&lt;br /&gt; // Pairing not supported&lt;br /&gt; err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;case BLE_GATTS_EVT_SYS_ATTR_MISSING:&lt;br /&gt; // No system attributes have been stored.&lt;br /&gt; err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;case BLE_GATTC_EVT_TIMEOUT:&lt;br /&gt; // Disconnect on GATT Client timeout event.&lt;br /&gt; err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gattc_evt.conn_handle,&lt;br /&gt; BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;case BLE_GATTS_EVT_TIMEOUT:&lt;br /&gt; // Disconnect on GATT Server timeout event.&lt;br /&gt; err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gatts_evt.conn_handle,&lt;br /&gt; BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;default:&lt;br /&gt; // No implementation needed.&lt;br /&gt; break;&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for the SoftDevice initialization.&lt;br /&gt; *&lt;br /&gt; * @details This function initializes the SoftDevice and the BLE event interrupt.&lt;br /&gt; */&lt;br /&gt;static void ble_stack_init(void)&lt;br /&gt;{&lt;br /&gt; ret_code_t err_code;&lt;/p&gt;
&lt;p&gt;err_code = nrf_sdh_enable_request();&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;// Configure the BLE stack using the default settings.&lt;br /&gt; // Fetch the start address of the application RAM.&lt;br /&gt; uint32_t ram_start = 0;&lt;br /&gt; err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &amp;amp;ram_start);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;// Enable BLE stack.&lt;br /&gt; err_code = nrf_sdh_ble_enable(&amp;amp;ram_start);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;// Register a handler for BLE events.&lt;br /&gt; NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for handling events from the GATT library. */&lt;br /&gt;void gatt_evt_handler(nrf_ble_gatt_t * p_gatt, nrf_ble_gatt_evt_t const * p_evt)&lt;br /&gt;{&lt;br /&gt; if ((m_conn_handle == p_evt-&amp;gt;conn_handle) &amp;amp;&amp;amp; (p_evt-&amp;gt;evt_id == NRF_BLE_GATT_EVT_ATT_MTU_UPDATED))&lt;br /&gt; {&lt;br /&gt; m_ble_nus_max_data_len = p_evt-&amp;gt;params.att_mtu_effective - OPCODE_LENGTH - HANDLE_LENGTH;&lt;br /&gt; NRF_LOG_INFO(&amp;quot;Data len is set to 0x%X(%d)&amp;quot;, m_ble_nus_max_data_len, m_ble_nus_max_data_len);&lt;br /&gt; }&lt;br /&gt; NRF_LOG_DEBUG(&amp;quot;ATT MTU exchange completed. central 0x%x peripheral 0x%x&amp;quot;,&lt;br /&gt; p_gatt-&amp;gt;att_mtu_desired_central,&lt;br /&gt; p_gatt-&amp;gt;att_mtu_desired_periph);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for initializing the GATT library. */&lt;br /&gt;void gatt_init(void)&lt;br /&gt;{&lt;br /&gt; ret_code_t err_code;&lt;/p&gt;
&lt;p&gt;err_code = nrf_ble_gatt_init(&amp;amp;m_gatt, gatt_evt_handler);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;err_code = nrf_ble_gatt_att_mtu_periph_set(&amp;amp;m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for handling events from the BSP module.&lt;br /&gt; *&lt;br /&gt; * @param[in] event Event generated by button press.&lt;br /&gt; */&lt;br /&gt;void bsp_event_handler(bsp_event_t event)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code;&lt;br /&gt; switch (event)&lt;br /&gt; {&lt;br /&gt; case BSP_EVENT_SLEEP:&lt;br /&gt; sleep_mode_enter();&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;case BSP_EVENT_DISCONNECT:&lt;br /&gt; err_code = sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);&lt;br /&gt; if (err_code != NRF_ERROR_INVALID_STATE)&lt;br /&gt; {&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; }&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;case BSP_EVENT_WHITELIST_OFF:&lt;br /&gt; if (m_conn_handle == BLE_CONN_HANDLE_INVALID)&lt;br /&gt; {&lt;br /&gt; err_code = ble_advertising_restart_without_whitelist(&amp;amp;m_advertising);&lt;br /&gt; if (err_code != NRF_ERROR_INVALID_STATE)&lt;br /&gt; {&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;default:&lt;br /&gt; break;&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for handling app_uart events.&lt;br /&gt; *&lt;br /&gt; * @details This function will receive a single character from the app_uart module and append it to&lt;br /&gt; * a string. The string will be be sent over BLE when the last character received was a&lt;br /&gt; * &amp;#39;new line&amp;#39; &amp;#39;\n&amp;#39; (hex 0x0A) or if the string has reached the maximum data length.&lt;br /&gt; */&lt;br /&gt;/**@snippet [Handling the data received over UART] */&lt;br /&gt;void uart_event_handle(app_uart_evt_t * p_event)&lt;br /&gt;{&lt;br /&gt; static uint8_t data_array[BLE_NUS_MAX_DATA_LEN];&lt;br /&gt; static uint8_t index = 0;&lt;br /&gt; uint32_t err_code;&lt;/p&gt;
&lt;p&gt;switch (p_event-&amp;gt;evt_type)&lt;br /&gt; {&lt;br /&gt; case APP_UART_DATA_READY:&lt;br /&gt; UNUSED_VARIABLE(app_uart_get(&amp;amp;data_array[index]));&lt;br /&gt; index++;&lt;/p&gt;
&lt;p&gt;if ((data_array[index - 1] == &amp;#39;\n&amp;#39;) ||&lt;br /&gt; (data_array[index - 1] == &amp;#39;\r&amp;#39;) ||&lt;br /&gt; (index &amp;gt;= m_ble_nus_max_data_len))&lt;br /&gt; {&lt;br /&gt; if (index &amp;gt; 1)&lt;br /&gt; {&lt;br /&gt; NRF_LOG_DEBUG(&amp;quot;Ready to send data over BLE NUS&amp;quot;);&lt;br /&gt; NRF_LOG_HEXDUMP_DEBUG(data_array, index);&lt;/p&gt;
&lt;p&gt;do&lt;br /&gt; {&lt;br /&gt; uint16_t length = (uint16_t)index;&lt;br /&gt; err_code = ble_nus_data_send(&amp;amp;m_nus, data_array, &amp;amp;length, m_conn_handle);&lt;br /&gt; if ((err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp;&lt;br /&gt; (err_code != NRF_ERROR_RESOURCES) &amp;amp;&amp;amp;&lt;br /&gt; (err_code != NRF_ERROR_NOT_FOUND))&lt;br /&gt; {&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; }&lt;br /&gt; } while (err_code == NRF_ERROR_RESOURCES);&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;index = 0;&lt;br /&gt; }&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;case APP_UART_COMMUNICATION_ERROR:&lt;br /&gt; APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;case APP_UART_FIFO_ERROR:&lt;br /&gt; APP_ERROR_HANDLER(p_event-&amp;gt;data.error_code);&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;default:&lt;br /&gt; break;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;/**@snippet [Handling the data received over UART] */&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for initializing the UART module.&lt;br /&gt; */&lt;br /&gt;/**@snippet [UART Initialization] */&lt;br /&gt;static void uart_init(void)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code;&lt;br /&gt; app_uart_comm_params_t const comm_params =&lt;br /&gt; {&lt;br /&gt; .rx_pin_no = RX_PIN_NUMBER,&lt;br /&gt; .tx_pin_no = TX_PIN_NUMBER,&lt;br /&gt; .rts_pin_no = RTS_PIN_NUMBER,&lt;br /&gt; .cts_pin_no = CTS_PIN_NUMBER,&lt;br /&gt; .flow_control = APP_UART_FLOW_CONTROL_DISABLED,&lt;br /&gt; .use_parity = false,&lt;br /&gt;#if defined (UART_PRESENT)&lt;br /&gt; .baud_rate = NRF_UART_BAUDRATE_115200&lt;br /&gt;#else&lt;br /&gt; .baud_rate = NRF_UARTE_BAUDRATE_115200&lt;br /&gt;#endif&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;APP_UART_FIFO_INIT(&amp;amp;comm_params,&lt;br /&gt; UART_RX_BUF_SIZE,&lt;br /&gt; UART_TX_BUF_SIZE,&lt;br /&gt; uart_event_handle,&lt;br /&gt; APP_IRQ_PRIORITY_LOWEST,&lt;br /&gt; err_code);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;br /&gt;/**@snippet [UART Initialization] */&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for initializing the Advertising functionality.&lt;br /&gt; */&lt;br /&gt;static void advertising_init(void)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code;&lt;br /&gt; ble_advertising_init_t init;&lt;/p&gt;
&lt;p&gt;memset(&amp;amp;init, 0, sizeof(init));&lt;/p&gt;
&lt;p&gt;init.advdata.name_type = BLE_ADVDATA_FULL_NAME;&lt;br /&gt; init.advdata.include_appearance = false;&lt;br /&gt; init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;&lt;/p&gt;
&lt;p&gt;init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);&lt;br /&gt; init.srdata.uuids_complete.p_uuids = m_adv_uuids;&lt;/p&gt;
&lt;p&gt;init.config.ble_adv_fast_enabled = true;&lt;br /&gt; init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;&lt;br /&gt; init.config.ble_adv_fast_timeout = APP_ADV_DURATION;&lt;br /&gt; init.evt_handler = on_adv_evt;&lt;/p&gt;
&lt;p&gt;err_code = ble_advertising_init(&amp;amp;m_advertising, &amp;amp;init);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;ble_advertising_conn_cfg_tag_set(&amp;amp;m_advertising, APP_BLE_CONN_CFG_TAG);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for initializing buttons and leds.&lt;br /&gt; *&lt;br /&gt; * @param[out] p_erase_bonds Will be true if the clear bonding button was pressed to wake the application up.&lt;br /&gt; */&lt;br /&gt;static void buttons_leds_init(bool * p_erase_bonds)&lt;br /&gt;{&lt;br /&gt; bsp_event_t startup_event;&lt;/p&gt;
&lt;p&gt;uint32_t err_code = bsp_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS, bsp_event_handler);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;err_code = bsp_btn_ble_init(NULL, &amp;amp;startup_event);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;*p_erase_bonds = (startup_event == BSP_EVENT_CLEAR_BONDING_DATA);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for initializing the nrf log module.&lt;br /&gt; */&lt;br /&gt;static void log_init(void)&lt;br /&gt;{&lt;br /&gt; ret_code_t err_code = NRF_LOG_INIT(NULL);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;NRF_LOG_DEFAULT_BACKENDS_INIT();&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for initializing power management.&lt;br /&gt; */&lt;br /&gt;static void power_management_init(void)&lt;br /&gt;{&lt;br /&gt; ret_code_t err_code;&lt;br /&gt; err_code = nrf_pwr_mgmt_init();&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for handling the idle state (main loop).&lt;br /&gt; *&lt;br /&gt; * @details If there is no pending log operation, then sleep until next the next event occurs.&lt;br /&gt; */&lt;br /&gt;static void idle_state_handle(void)&lt;br /&gt;{&lt;br /&gt; if (NRF_LOG_PROCESS() == false)&lt;br /&gt; {&lt;br /&gt; nrf_pwr_mgmt_run();&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for starting advertising.&lt;br /&gt; */&lt;br /&gt;static void advertising_start(void)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code = ble_advertising_start(&amp;amp;m_advertising, BLE_ADV_MODE_FAST);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;static void adv_data_update_timer_handler(void * p_context)&lt;br /&gt;{&lt;br /&gt; ret_code_t err_code;&lt;br /&gt; ble_advdata_manuf_data_t manuf_data;&lt;/p&gt;
&lt;p&gt;new_advdata.p_manuf_specific_data = &amp;amp;manuf_data;&lt;/p&gt;
&lt;p&gt;static uint8_t payload_index = 0;&lt;/p&gt;
&lt;p&gt;NRF_LOG_INFO(&amp;quot;Updating advertising data!&amp;quot;);&lt;br /&gt; &lt;br /&gt; manuf_data.company_identifier = APP_COMPANY_IDENTIFIER;&lt;/p&gt;
&lt;p&gt;manuf_data.data.p_data = manufacturing_data_payload_list + payload_index;&lt;br /&gt; manuf_data.data.size = PAYLOAD_SIZE;&lt;br /&gt; &lt;br /&gt; err_code = ble_advertising_advdata_update(&amp;amp;m_advertising, &amp;amp;new_advdata, NULL);&lt;br /&gt; APP_ERROR_CHECK(err_code); &lt;br /&gt; &lt;br /&gt; if(payload_index == TOP_INDEX)&lt;br /&gt; {&lt;br /&gt; payload_index = 0;&lt;br /&gt; }&lt;br /&gt; else&lt;br /&gt; {&lt;br /&gt; payload_index++;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;NRF_LOG_INFO(&amp;quot;Advertising data updated!&amp;quot;);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;static void application_timers_start(void)&lt;br /&gt;{&lt;br /&gt; ret_code_t err_code;&lt;br /&gt; err_code = app_timer_start(m_adv_data_update_timer, &lt;br /&gt; ADV_DATA_UPDATE_INTERVAL, &lt;br /&gt; NULL);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;/**@brief Application main function.&lt;br /&gt; */&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt; bool erase_bonds;&lt;/p&gt;
&lt;p&gt;// Initialize.&lt;br /&gt; uart_init();&lt;br /&gt; log_init();&lt;br /&gt; timers_init();&lt;br /&gt; buttons_leds_init(&amp;amp;erase_bonds);&lt;br /&gt; power_management_init();&lt;br /&gt; ble_stack_init();&lt;br /&gt; gap_params_init();&lt;br /&gt; gatt_init();&lt;br /&gt; services_init();&lt;br /&gt; advertising_init();&lt;br /&gt; conn_params_init();&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; &lt;br /&gt; conn_params_init();&lt;br /&gt; // peer_manager_init();&lt;/p&gt;
&lt;p&gt;// Start execution.&lt;br /&gt; printf(&amp;quot;\r\nUART started.\r\n&amp;quot;);&lt;br /&gt; NRF_LOG_INFO(&amp;quot;Debug logging for UART over RTT started.&amp;quot;);&lt;br /&gt; application_timers_start();&lt;br /&gt; advertising_start();&lt;/p&gt;
&lt;p&gt;// Enter main loop.&lt;br /&gt; for (;;)&lt;br /&gt; {&lt;br /&gt; idle_state_handle();&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**&lt;br /&gt; * @}&lt;br /&gt; */&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 way beacon/connectable beacon</title><link>https://devzone.nordicsemi.com/thread/316418?ContentTypeID=1</link><pubDate>Tue, 22 Jun 2021 09:09:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22249550-a5d6-45ee-8538-77d348faa27f</guid><dc:creator>awneil</dc:creator><description>[quote userid="105375" url="~/f/nordic-q-a/76452/2-way-beacon-connectable-beacon/316386#316386"]its not working[/quote]
&lt;p&gt;What, exactly, is &amp;quot;not working&amp;quot; ?&lt;/p&gt;
&lt;p&gt;What debugging have you done to find the problem(s) ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 way beacon/connectable beacon</title><link>https://devzone.nordicsemi.com/thread/316386?ContentTypeID=1</link><pubDate>Tue, 22 Jun 2021 07:07:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fab9782b-5732-4406-ae24-a8ecd52fca9f</guid><dc:creator>N A Karmarkar</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thank you for your reply&lt;br /&gt;so the example file i built and executed properly...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;but i tried this &lt;span&gt;example&amp;nbsp;&lt;/span&gt;with ble_app_uart so its not working..&lt;/p&gt;
&lt;p&gt;can you guide me what are the changes need to be done with ble_app_uart example to advertise in it.??&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;note: in that application uart data tx and rx also should work as well as should advertise 128 bit data&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 way beacon/connectable beacon</title><link>https://devzone.nordicsemi.com/thread/316178?ContentTypeID=1</link><pubDate>Mon, 21 Jun 2021 08:22:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c344d411-c2fb-4f39-a454-c553c4947894</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;Nagendra a karmarkar,&lt;/p&gt;
[quote user="nak"]2) when it requires i need to connect the device.[/quote]
&lt;p&gt;The difference between performance of beacons and connectable peripheral devices is primarily the difference in power consumption (aside from the obvious other feature differences). When advertising as non-connectable the peripheral does not need to listen for incoming connect requests after every advertisements. Please see &lt;a href="https://devzone.nordicsemi.com/nordic/power/w/opp/2/online-power-profiler-for-ble"&gt;the Online Power Profiler&lt;/a&gt; for more in-depth information about the difference in power consumption.&lt;/p&gt;
[quote user="nak"]&lt;p&gt;Please let me know how the advertising the data in it without connection&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;if u sent any example it would be useful for me thank you in advance&amp;nbsp;&lt;/p&gt;[/quote]
&lt;p&gt;Please see &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/how-to-update-advertising-data-dynamically-using-ble-advertising-library"&gt;this blogpost and included example&lt;/a&gt; for a demonstration how you may use the BLE advertising library to update your advertising data dynamically. You may then merge this functionality into the UART BLE example, for instance.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 way beacon/connectable beacon</title><link>https://devzone.nordicsemi.com/thread/316130?ContentTypeID=1</link><pubDate>Sat, 19 Jun 2021 14:56:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b78d5ca-0fb7-4729-a445-dba32c179f6d</guid><dc:creator>N A Karmarkar</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;thank you for your reply&lt;/p&gt;
&lt;p&gt;in my application i need to do 2 operation&lt;/p&gt;
&lt;p&gt;1) advertising sensor data with continues updated value&amp;nbsp;without connection (sensor value will change continuously )&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2) when it requires i need to connect the device.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;so, if uart example is the solution for my problem, Please let me know how the advertising the data in it without connection&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;if u sent any example it would be useful for me thank you in advance&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Nagendra a karmarkar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 way beacon/connectable beacon</title><link>https://devzone.nordicsemi.com/thread/315890?ContentTypeID=1</link><pubDate>Thu, 17 Jun 2021 13:03:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2f43ae3-7c88-4aa7-a3f6-fc97ec9a7ffa</guid><dc:creator>awneil</dc:creator><description>[quote userid="87869" url="~/f/nordic-q-a/76452/2-way-beacon-connectable-beacon/315843#315843"]take a look at the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_nus_eval.html"&gt;BLE Nordic UART example&lt;/a&gt;&amp;nbsp;from the SDK[/quote]
&lt;p&gt;+1&lt;/p&gt;
&lt;p&gt;Note that the &amp;quot;UART&amp;quot; here doesn&amp;#39;t mean that it&amp;#39;s in any way limited to a physical UART - its saying that, &lt;em&gt;just like a real UART&lt;/em&gt;, it can be used to send &lt;em&gt;&lt;strong&gt;any&lt;/strong&gt;&lt;/em&gt; arbitrary data...&lt;/p&gt;
&lt;p&gt;Or, if you want to get into developing your own BLE Characteristics &amp;amp; Services, see:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/tutorials/8/ble-services-a-beginners-tutorial/"&gt;https://devzone.nordicsemi.com/tutorials/8/ble-services-a-beginners-tutorial/&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial"&gt;https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;On Advertising:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/tutorials/5/"&gt;https://devzone.nordicsemi.com/tutorials/5/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 way beacon/connectable beacon</title><link>https://devzone.nordicsemi.com/thread/315843?ContentTypeID=1</link><pubDate>Thu, 17 Jun 2021 11:25:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70cce98c-5273-4517-9652-4908461dc975</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;What @awneil says is correct - this would not be a&amp;nbsp;&lt;em&gt;beacon&amp;nbsp;&lt;/em&gt;application per se, since beacons advertise as non-connectable.&lt;br /&gt;If you wish to see an example of how data transfer from a peripheral to a central could be implemented you should take a look at the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_nus_eval.html"&gt;BLE Nordic UART example&lt;/a&gt;&amp;nbsp;from the SDK. In the example, any data received over UART is transmitted to the connected device over BLE, and visa versa.&lt;br /&gt;You can then modify this to instead relay your sensor data, instead of the UART data.&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: 2 way beacon/connectable beacon</title><link>https://devzone.nordicsemi.com/thread/315804?ContentTypeID=1</link><pubDate>Thu, 17 Jun 2021 09:41:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb07b9f9-a063-4649-907c-fe340c8ad56e</guid><dc:creator>awneil</dc:creator><description>[quote userid="105375" url="~/f/nordic-q-a/76452/2-way-beacon-connectable-beacon"]If it is possible plz send me the proper procedure[/quote]
&lt;p&gt;Yes, it&amp;#39;s possible.&lt;/p&gt;
&lt;p&gt;you would have to establish a connection, then transfer data in the normal way.&lt;/p&gt;
&lt;p&gt;The distinguishing feature of a &amp;quot;Beacon&amp;quot; is usually that it&amp;#39;s broadcast only - it doesn&amp;#39;t accept connections.&lt;/p&gt;
&lt;p&gt;So a &amp;quot;connectable beacon&amp;quot; is really just a normal BLE peripheral device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>