<?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>Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/32990/development-board-nrf52832-with-multilink-uart</link><description>Hello everybody ! 
 Here I am designing a system with 3 development boards nrf52832, where a card called &amp;quot;central&amp;quot; is connected to the computer by USB and this board will then communicate with the other 2 boards &amp;quot;device&amp;quot; with the code from this this tutorial</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 14 Aug 2019 15:55:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/32990/development-board-nrf52832-with-multilink-uart" /><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/204147?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2019 15:55:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bb0d8a7-0aa7-4d2e-9eb7-c86ecf9aeef1</guid><dc:creator>cavalihno</dc:creator><description>&lt;p&gt;Hi, have you resolve problem. Today I have the same situation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/128897?ContentTypeID=1</link><pubDate>Thu, 19 Apr 2018 06:53:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e551657a-5b13-468a-801d-1ce8802dbb9f</guid><dc:creator>MootSeeker</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/yoann_5f00_f"&gt;Yoann_F&lt;/a&gt;,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve created a programm with your Tutorial and it worked, Thanks!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now I have the problem on the Central, when I try to compile your code, I&amp;#39;ve got this error:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;..\..\..\main.c(130): error: #165: too few arguments in function call&amp;nbsp;&amp;nbsp;&lt;br /&gt; ret = sd_ble_gap_scan_start(&amp;amp;m_scan_params);&lt;br /&gt;..\..\..\main.c(191): error: #171: invalid type conversion&lt;br /&gt; adv_data.p_data = (uint8_t *)p_gap_evt-&amp;gt;params.adv_report.data;&lt;br /&gt;..\..\..\main.c(192): error: #136: struct &amp;quot;&amp;lt;unnamed&amp;gt;&amp;quot; has no field &amp;quot;dlen&amp;quot;&amp;nbsp;&lt;br /&gt; adv_data.size = p_gap_evt-&amp;gt;params.adv_report.dlen;&lt;br /&gt;..\..\..\main.c(220): warning: #181-D: argument is incompatible with corresponding format string conversion&lt;br /&gt; printf(&amp;quot;\rFound peripheral %s&amp;quot;, (uint32_t)dev_name.p_data);&lt;br /&gt;..\..\..\main.c(261): warning: #224-D: the format string requires additional arguments&lt;br /&gt; printf(&amp;quot;Connection 0x%x established, starting DB discovery.&amp;quot;);&lt;br /&gt;..\..\..\main.c(283): warning: #223-D: function &amp;quot;ble_conn_state_n_centrals&amp;quot; declared implicitly&lt;br /&gt; if (ble_conn_state_n_centrals() == NRF_SDH_BLE_CENTRAL_LINK_COUNT)&lt;br /&gt;..\..\..\main.c(304): warning: #223-D: function &amp;quot;ble_conn_state_n_centrals&amp;quot; declared implicitly&lt;br /&gt; if (ble_conn_state_n_centrals() == 0)&lt;br /&gt;..\..\..\main.c(590): warning: #177-D: variable &amp;quot;length&amp;quot; was declared but never referenced&lt;br /&gt; uint16_t length = (uint16_t)index;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you know how I can fix it ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And Thanks for your help &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/128056?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 12:26:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adeaeec0-d5f5-4a03-9b76-6ce7b8ba5a52</guid><dc:creator>MootSeeker</dc:creator><description>&lt;p&gt;Thanks, I will try it &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/128055?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 12:25:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1971d4a-9202-45f5-b1cb-6112232fba33</guid><dc:creator>Yoann_F</dc:creator><description>&lt;p&gt;ble_app_template with this tutorial :&amp;nbsp;&lt;a href="https://github.com/bjornspockeli/custom_ble_service_example"&gt;https://github.com/bjornspockeli/custom_ble_service_example&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/128051?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 12:16:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edf3f804-fffd-43e0-bc2d-0bcf2ab1ea95</guid><dc:creator>MootSeeker</dc:creator><description>&lt;p&gt;Which example you have used?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/128047?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 12:12:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8eb85356-4fc6-4aff-8cbe-97082829c2be</guid><dc:creator>Yoann_F</dc:creator><description>&lt;p&gt;no I use another example to establish a connection, you just need to change the &amp;quot;static char const m_target_periph_name [] =&amp;quot; what you want &amp;quot;;&amp;quot;&lt;/p&gt;
&lt;p&gt;Have you added the &amp;quot;nrf_sdh.h&amp;quot; to your project?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/127947?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 06:33:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c88153d-ae69-49fa-9a3c-f4ca1dfee4eb</guid><dc:creator>MootSeeker</dc:creator><description>&lt;p&gt;For the Peripherals, have you used the blink example?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If I use the Code above I will get the&amp;nbsp;error:&amp;nbsp; #5: cannot open source input file &amp;quot;nrf_sdh.h&amp;quot;: No such file or directory&lt;/p&gt;
&lt;p&gt;Do you know why it can&amp;#39;t find this file ? I copied your code in the Multilink example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/127373?ContentTypeID=1</link><pubDate>Mon, 09 Apr 2018 09:21:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1eeff1d1-860c-4eab-b70c-7f85a8e8cd41</guid><dc:creator>Yoann_F</dc:creator><description>&lt;p&gt;&lt;span&gt;At the moment my shipping code is not ready yet.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/127191?ContentTypeID=1</link><pubDate>Fri, 06 Apr 2018 10:16:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:461c6649-485c-4e01-bf86-d7dd80adaeda</guid><dc:creator>MootSeeker</dc:creator><description>&lt;p&gt;If you send your Data with the gattc_write function, how you recived?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have something like a example code which would help?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/127183?ContentTypeID=1</link><pubDate>Fri, 06 Apr 2018 09:32:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c709a449-5d19-4c96-8e61-30306df5d9e1</guid><dc:creator>Yoann_F</dc:creator><description>&lt;p&gt;&lt;span title=""&gt;No I do not use the NUS, just the UART for communication between my PC and my development board.&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span title=""&gt;Then yes I would also like to communicate with my device: I will use for this, in my opinion, sd_ble_gattc_write (,).&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/127164?ContentTypeID=1</link><pubDate>Fri, 06 Apr 2018 08:46:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8743c51f-53bf-4a8f-9352-d31cec993241</guid><dc:creator>MootSeeker</dc:creator><description>&lt;p&gt;So you can send a String from the Peripheral to the Central ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/127163?ContentTypeID=1</link><pubDate>Fri, 06 Apr 2018 08:43:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13107886-8bf5-4a2e-82fb-e659711a6bec</guid><dc:creator>Yoann_F</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi !&lt;br /&gt;I added some of the UART to the multilink.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/127162?ContentTypeID=1</link><pubDate>Fri, 06 Apr 2018 08:40:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68c08421-cd25-4911-baf2-2214e5da0cd4</guid><dc:creator>MootSeeker</dc:creator><description>&lt;p&gt;Hi Yoann_F,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;do you added the Uart part to the Multilink or some parts of the Multilink to the Uart example?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/126972?ContentTypeID=1</link><pubDate>Thu, 05 Apr 2018 07:58:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bbaea2e-af6f-43eb-90e1-84ef61bbc22a</guid><dc:creator>Yoann_F</dc:creator><description>&lt;p&gt;Yes that&amp;#39;s it.&lt;br /&gt;Oh ok. Error 8 means that it is initialized ^^ I thought it meant that the UART was &amp;quot;busy&amp;quot;.&lt;br /&gt;When you say that I can ignore the error, do you want to say that I can comment on APP_ERROR_CHECK (err_code)? Because when I had this error, the&amp;nbsp;rest of my program was blocked.&lt;br /&gt;Since I left with another code for my project so it&amp;#39;s ok :)&lt;br /&gt;Thanks for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/126932?ContentTypeID=1</link><pubDate>Wed, 04 Apr 2018 20:40:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:318fa27a-d376-45ce-b7d5-09c1a0a8def5</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;do I understand it correctly that it&amp;#39;s&amp;nbsp;APP_ERROR_CHECK(err_code); in&amp;nbsp;uart_init() that returns error code 8?&lt;/p&gt;
&lt;p&gt;If yes, then it may be&amp;nbsp;nrf_drv_uart_init() that return error code 8 (=NRF_ERROR_INVALID_STATE), this means that the UART driver is already initialized. You should be able to ignore this error code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/126643?ContentTypeID=1</link><pubDate>Tue, 03 Apr 2018 11:42:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11bf2501-9143-4e34-b473-f6814e4f3938</guid><dc:creator>Yoann_F</dc:creator><description>&lt;p&gt;Here are the different steps of design:&lt;br /&gt;1 - Take the example ble_app_multilink_central for the central board: connection with the other 2 peripheral boards, its OK&lt;br /&gt;2 - Add uart_init () and uart_event_handle (): problem error 8&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/126641?ContentTypeID=1</link><pubDate>Tue, 03 Apr 2018 11:38:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:432975b3-79f0-482c-831e-a29461226244</guid><dc:creator>rraa</dc:creator><description>&lt;p&gt;~&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/126635?ContentTypeID=1</link><pubDate>Tue, 03 Apr 2018 11:12:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:045d5ab0-eeae-4643-a025-fd0340354907</guid><dc:creator>rraa</dc:creator><description>&lt;p&gt;Did you ever connect&amp;nbsp; central device 2 peripheral devices same time?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Development board nRF52832 with multilink + UART</title><link>https://devzone.nordicsemi.com/thread/126627?ContentTypeID=1</link><pubDate>Tue, 03 Apr 2018 10:05:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40d0ab17-c44e-48c9-82cd-f0da3f335482</guid><dc:creator>Yoann_F</dc:creator><description>&lt;p&gt;&lt;span&gt;Here is part of my code:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;quot;nordic_common.h&amp;quot;
#include &amp;quot;nrf_sdh.h&amp;quot;
#include &amp;quot;nrf_sdh_ble.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;app_timer.h&amp;quot;
#include &amp;quot;app_uart.h&amp;quot;
#include &amp;quot;app_util_platform.h&amp;quot;
#include &amp;quot;bsp_btn_ble.h&amp;quot;
#include &amp;quot;ble.h&amp;quot;
#include &amp;quot;ble_hci.h&amp;quot;
#include &amp;quot;ble_advdata.h&amp;quot;
#include &amp;quot;ble_advertising.h&amp;quot;
#include &amp;quot;ble_conn_params.h&amp;quot;
#include &amp;quot;ble_db_discovery.h&amp;quot;
#include &amp;quot;ble_lbs_c.h&amp;quot;
#include &amp;quot;ble_conn_state.h&amp;quot;
#include &amp;quot;nrf_ble_gatt.h&amp;quot;

#if defined (UART_PRESENT)
#include &amp;quot;nrf_uart.h&amp;quot;
#endif
#if defined (UARTE_PRESENT)
#include &amp;quot;nrf_uarte.h&amp;quot;
#endif

#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 that refers to the BLE stack configuration we set with @ref sd_ble_cfg_set. Default tag is @ref APP_BLE_CONN_CFG_TAG. */
#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. */

#define CENTRAL_SCANNING_LED      BSP_BOARD_LED_0
#define CENTRAL_CONNECTED_LED     BSP_BOARD_LED_1
#define LEDBUTTON_LED             BSP_BOARD_LED_2                       /**&amp;lt; LED to indicate a change of state of the the Button characteristic on the peer. */
#define LEDTEST                   BSP_BOARD_LED_3                       /**&amp;lt; LED to indicate a change of state of the the Button characteristic on the peer. */

#define LEDBUTTON_BUTTON          BSP_BUTTON_0                          /**&amp;lt; Button that will write to the LED characteristic of the peer. */
#define BUTTON_DETECTION_DELAY    APP_TIMER_TICKS(50)                   /**&amp;lt; Delay from a GPIOTE event until a button is reported as pushed (in number of timer ticks). */

#define SCAN_INTERVAL             0x00A0                                /**&amp;lt; Determines scan interval in units of 0.625 millisecond. */
#define SCAN_WINDOW               0x0050                                /**&amp;lt; Determines scan window in units of 0.625 millisecond. */
#define SCAN_TIMEOUT              0x0000                                /**&amp;lt; Timout when scanning. 0x0000 disables timeout. */

#define MIN_CONNECTION_INTERVAL   MSEC_TO_UNITS(7.5, UNIT_1_25_MS)      /**&amp;lt; Determines minimum connection interval in milliseconds. */
#define MAX_CONNECTION_INTERVAL   MSEC_TO_UNITS(30, UNIT_1_25_MS)       /**&amp;lt; Determines maximum connection interval in milliseconds. */
#define SLAVE_LATENCY             0                                     /**&amp;lt; Determines slave latency in terms of connection events. */
#define SUPERVISION_TIMEOUT       MSEC_TO_UNITS(4000, UNIT_10_MS)       /**&amp;lt; Determines supervision time-out in units of 10 milliseconds. */

#define UUID16_SIZE               2                                     /**&amp;lt; Size of a UUID, in bytes. */


NRF_BLE_GATT_DEF(m_gatt);                                               /**&amp;lt; GATT module instance. */
BLE_LBS_C_ARRAY_DEF(m_lbs_c, NRF_SDH_BLE_CENTRAL_LINK_COUNT);           /**&amp;lt; LED Button client instances. */
BLE_DB_DISCOVERY_ARRAY_DEF(m_db_disc, NRF_SDH_BLE_CENTRAL_LINK_COUNT);  /**&amp;lt; Database discovery module instances. */

static char const m_target_periph_name[] = &amp;quot;L_PERIPH&amp;quot;;             /**&amp;lt; Name of the device we try to connect to. This name is searched for in the scan report data*/
static char const m_target_periph_name2[] = &amp;quot;R_PERIPH&amp;quot;;             /**&amp;lt; Name of the device we try to connect to. This name is searched for in the scan report data*/

#define UART_TX_BUF_SIZE        256                                     /**&amp;lt; UART TX buffer size. */
#define UART_RX_BUF_SIZE        256                                     /**&amp;lt; UART RX buffer size. */

static ble_gap_scan_params_t const m_scan_params =
{
    .active   = 0,
    .interval = SCAN_INTERVAL,
    .window   = SCAN_WINDOW,
    .timeout  = SCAN_TIMEOUT,
    #if (NRF_SD_BLE_API_VERSION &amp;lt;= 2)
        .selective   = 0,
        .p_whitelist = NULL,
    #endif
    #if (NRF_SD_BLE_API_VERSION &amp;gt;= 3)
        .use_whitelist  = 0,
        .adv_dir_report = 0,
    #endif
};

static ble_gap_conn_params_t const m_connection_param =
{
    (uint16_t)MIN_CONNECTION_INTERVAL,
    (uint16_t)MAX_CONNECTION_INTERVAL,
    (uint16_t)SLAVE_LATENCY,
    (uint16_t)SUPERVISION_TIMEOUT
};

void assert_nrf_callback(uint16_t line_num, const uint8_t * p_file_name)
{
    app_error_handler(0xDEADBEEF, line_num, p_file_name);
}

static void leds_init(void)
{
    bsp_board_leds_init();
}

static uint32_t adv_report_parse(uint8_t type, uint8_array_t * p_advdata, uint8_array_t * p_typedata)
{
    uint32_t  index = 0;
    uint8_t * p_data;

    p_data = p_advdata-&amp;gt;p_data;

    while (index &amp;lt; p_advdata-&amp;gt;size)
    {
        uint8_t field_length = p_data[index];
        uint8_t field_type   = p_data[index + 1];

        if (field_type == type)
        {
            p_typedata-&amp;gt;p_data = &amp;amp;p_data[index + 2];
            p_typedata-&amp;gt;size   = field_length - 1;
            return NRF_SUCCESS;
        }
        index += field_length + 1;
    }
    return NRF_ERROR_NOT_FOUND;
}

static void scan_start(void)
{
    ret_code_t ret;

    (void) sd_ble_gap_scan_stop();
    
    printf(&amp;quot;Start scanning for device name %s.&amp;quot;, (uint32_t)m_target_periph_name);
    ret = sd_ble_gap_scan_start(&amp;amp;m_scan_params);
    APP_ERROR_CHECK(ret);
    printf(&amp;quot;\rscan error : %d&amp;quot;, ret);    

    ret = bsp_indication_set(BSP_INDICATE_SCANNING);
    APP_ERROR_CHECK(ret);
}

static void lbs_c_evt_handler(ble_lbs_c_t * p_lbs_c, ble_lbs_c_evt_t * p_lbs_c_evt)
{
    switch (p_lbs_c_evt-&amp;gt;evt_type)
    {
        case BLE_LBS_C_EVT_DISCOVERY_COMPLETE:
        {
            ret_code_t err_code;

            //NRF_LOG_INFO(&amp;quot;LED Button service discovered on conn_handle 0x%x&amp;quot;,
                 //        p_lbs_c_evt-&amp;gt;conn_handle);

            err_code = app_button_enable();
            APP_ERROR_CHECK(err_code);

            // LED Button service discovered. Enable notification of Button.
            err_code = ble_lbs_c_button_notif_enable(p_lbs_c);
            APP_ERROR_CHECK(err_code);
        } break; // BLE_LBS_C_EVT_DISCOVERY_COMPLETE

        case BLE_LBS_C_EVT_BUTTON_NOTIFICATION:
        {
            //NRF_LOG_INFO(&amp;quot;Link 0x%x, Button state changed on peer to 0x%x&amp;quot;,
             //            p_lbs_c_evt-&amp;gt;conn_handle,
               //          p_lbs_c_evt-&amp;gt;params.button.button_state);

            if (p_lbs_c_evt-&amp;gt;params.button.button_state)
            {
                bsp_board_led_on(LEDBUTTON_LED);
            }
            else
            {
                bsp_board_led_off(LEDBUTTON_LED);
            }
        } break; // BLE_LBS_C_EVT_BUTTON_NOTIFICATION

        default:
            // No implementation needed.
            break;
    }
}

static void on_adv_report(ble_evt_t const * p_ble_evt)
{
    uint32_t      err_code;
    uint8_array_t adv_data;
    uint8_array_t dev_name;
    bool          do_connect = false;

    // For readibility.
    ble_gap_evt_t  const * p_gap_evt  = &amp;amp;p_ble_evt-&amp;gt;evt.gap_evt;
    ble_gap_addr_t const * peer_addr  = &amp;amp;p_gap_evt-&amp;gt;params.adv_report.peer_addr;

    // Prepare advertisement report for parsing.
    adv_data.p_data = (uint8_t *)p_gap_evt-&amp;gt;params.adv_report.data;
    adv_data.size   = p_gap_evt-&amp;gt;params.adv_report.dlen;

    // Search for advertising names.
    bool found_name = false;
    err_code = adv_report_parse(BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME,
                                &amp;amp;adv_data,
                                &amp;amp;dev_name);
    if (err_code != NRF_SUCCESS)
    {
        // Look for the short local name if it was not found as complete.
        err_code = adv_report_parse(BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME, &amp;amp;adv_data, &amp;amp;dev_name);
        if (err_code != NRF_SUCCESS)
        {
            // If we can&amp;#39;t parse the data, then exit.
            return;
        }
        else
        {
            found_name = true;
        }
    }
    else
    {
        found_name = true;
    }

    if (found_name)
    {   
        printf(&amp;quot;\rFound peripheral %s&amp;quot;, (uint32_t)dev_name.p_data);
            if (
                (memcmp(m_target_periph_name, dev_name.p_data, dev_name.size) == 0)
                || (memcmp(m_target_periph_name2, dev_name.p_data, dev_name.size) == 0) )
            {
                printf(&amp;quot;\rFaire la connexion...avec %s ou %s&amp;quot;,m_target_periph_name,m_target_periph_name2);
                do_connect = true;
            }
    }

    if (do_connect)
    {
        // Initiate connection.
        err_code = sd_ble_gap_connect(peer_addr, &amp;amp;m_scan_params, &amp;amp;m_connection_param, APP_BLE_CONN_CFG_TAG);
        printf(&amp;quot;\rerr_code : do_connect = %d &amp;quot;, err_code);
        if (err_code != NRF_SUCCESS)
        {
            //NRF_LOG_ERROR(&amp;quot;Connection Request Failed, reason %d&amp;quot;, err_code);
        }
    }
}


/**@brief Function for handling BLE events.
 *
 * @param[in]   p_ble_evt   Bluetooth stack event.
 * @param[in]   p_context   Unused.
 */
static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
{
    printf(&amp;quot;\rEvenement sur le BLE&amp;quot;);
    ret_code_t err_code;

    // For readability.
    ble_gap_evt_t const * p_gap_evt = &amp;amp;p_ble_evt-&amp;gt;evt.gap_evt;
    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
        // Upon connection, check which peripheral has connected, initiate DB
        // discovery, update LEDs status and resume scanning if necessary.
        case BLE_GAP_EVT_CONNECTED:
        {   
            printf(&amp;quot;Connection 0x%x established, starting DB discovery.&amp;quot;);
            //NRF_LOG_INFO(&amp;quot;Connection 0x%x established, starting DB discovery.&amp;quot;,
                     //    p_gap_evt-&amp;gt;conn_handle);

            APP_ERROR_CHECK_BOOL(p_gap_evt-&amp;gt;conn_handle &amp;lt; NRF_SDH_BLE_CENTRAL_LINK_COUNT);

            err_code = ble_lbs_c_handles_assign(&amp;amp;m_lbs_c[p_gap_evt-&amp;gt;conn_handle],
                                                p_gap_evt-&amp;gt;conn_handle,
                                                NULL);
            APP_ERROR_CHECK(err_code);

            err_code = ble_db_discovery_start(&amp;amp;m_db_disc[p_gap_evt-&amp;gt;conn_handle],
                                              p_gap_evt-&amp;gt;conn_handle);
            if (err_code != NRF_ERROR_BUSY)
            {
                APP_ERROR_CHECK(err_code);
            }
            bsp_board_led_invert(LED_4);

            // Update LEDs status, and check if we should be looking for more
            // peripherals to connect to.
            bsp_board_led_on(CENTRAL_CONNECTED_LED);
            if (ble_conn_state_n_centrals() == NRF_SDH_BLE_CENTRAL_LINK_COUNT)
            {
                bsp_board_led_off(CENTRAL_SCANNING_LED);
                printf(&amp;quot;left and right peripheral were found ! Stop Scan !&amp;quot;);
            }
            else
            {
                // Resume scanning.
                bsp_board_led_on(CENTRAL_SCANNING_LED);
                scan_start();
            }
        } break; // BLE_GAP_EVT_CONNECTED

        // Upon disconnection, reset the connection handle of the peer which disconnected, update
        // the LEDs status and start scanning again.
        case BLE_GAP_EVT_DISCONNECTED:
        {
            //NRF_LOG_INFO(&amp;quot;LBS central link 0x%x disconnected (reason: 0x%x)&amp;quot;,
                      //   p_gap_evt-&amp;gt;conn_handle,
                        // p_gap_evt-&amp;gt;params.disconnected.reason);

            if (ble_conn_state_n_centrals() == 0)
            {
                err_code = app_button_disable();
                APP_ERROR_CHECK(err_code);

                // Turn off connection indication LED
                bsp_board_led_off(CENTRAL_CONNECTED_LED);
            }

            // Start scanning
            scan_start();

            // Turn on LED for indicating scanning
            bsp_board_led_on(CENTRAL_SCANNING_LED);

        } break;

        case BLE_GAP_EVT_ADV_REPORT:
            on_adv_report(p_ble_evt);
            break;

        case BLE_GAP_EVT_TIMEOUT:
        {
            // We have not specified a timeout for scanning, so only connection attemps can timeout.
            if (p_gap_evt-&amp;gt;params.timeout.src == BLE_GAP_TIMEOUT_SRC_CONN)
            {
                //NRF_LOG_DEBUG(&amp;quot;Connection request timed out.&amp;quot;);
            }
        } break;

        case BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST:
        {
            //NRF_LOG_DEBUG(&amp;quot;BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST.&amp;quot;);
            // Accept parameters requested by peer.
            err_code = sd_ble_gap_conn_param_update(p_gap_evt-&amp;gt;conn_handle,
                                        &amp;amp;p_gap_evt-&amp;gt;params.conn_param_update_request.conn_params);
            APP_ERROR_CHECK(err_code);
        } break;

#ifndef S140
        case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
        {
            //NRF_LOG_DEBUG(&amp;quot;PHY update request.&amp;quot;);
            ble_gap_phys_t const phys =
            {
                .rx_phys = BLE_GAP_PHY_AUTO,
                .tx_phys = BLE_GAP_PHY_AUTO,
            };
            err_code = sd_ble_gap_phy_update(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, &amp;amp;phys);
            APP_ERROR_CHECK(err_code);
        } break;
#endif

        case BLE_GATTC_EVT_TIMEOUT:
        {
            // Disconnect on GATT Client timeout event.
           // NRF_LOG_DEBUG(&amp;quot;GATT Client Timeout.&amp;quot;);
            err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gattc_evt.conn_handle,
                                             BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
            APP_ERROR_CHECK(err_code);
        } break;

        case BLE_GATTS_EVT_TIMEOUT:
        {
            // Disconnect on GATT Server timeout event.
            //NRF_LOG_DEBUG(&amp;quot;GATT Server Timeout.&amp;quot;);
            err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gatts_evt.conn_handle,
                                             BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
            APP_ERROR_CHECK(err_code);
        } break;

        default:
            // No implementation needed.
            break;
    }
}


/**@brief LED Button collector initialization. */
static void lbs_c_init(void)
{
    ret_code_t       err_code;
    ble_lbs_c_init_t lbs_c_init_obj;

    lbs_c_init_obj.evt_handler = lbs_c_evt_handler;

    for (uint32_t i = 0; i &amp;lt; NRF_SDH_BLE_CENTRAL_LINK_COUNT; i++)
    {
        err_code = ble_lbs_c_init(&amp;amp;m_lbs_c[i], &amp;amp;lbs_c_init_obj);
        APP_ERROR_CHECK(err_code);
    }
}


/**@brief Function for initializing the BLE stack.
 *
 * @details Initializes the SoftDevice and the BLE event interrupts.
 */
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);

    // Register a handler for BLE events.
    NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);
}


/**@brief Function for writing to the LED characteristic of all connected clients.
 *
 * @details Based on if the button is pressed or released, this function writes a high or low
 *          LED status to the server.
 *
 * @param[in] button_action The button action (press/release).
 *            Determines if the LEDs of the servers will be ON or OFF.
 *
 * @return If successful NRF_SUCCESS is returned. Otherwise, the error code from @ref ble_lbs_led_status_send.
 */
static ret_code_t led_status_send_to_all(uint8_t button_action)
{
    ret_code_t err_code;

    for (uint32_t i = 0; i&amp;lt; NRF_SDH_BLE_CENTRAL_LINK_COUNT; i++)
    {
        err_code = ble_lbs_led_status_send(&amp;amp;m_lbs_c[i], button_action);
        if (err_code != NRF_SUCCESS &amp;amp;&amp;amp;
            err_code != BLE_ERROR_INVALID_CONN_HANDLE &amp;amp;&amp;amp;
            err_code != NRF_ERROR_INVALID_STATE)
        {
            return err_code;
        }
    }
        return NRF_SUCCESS;
}


/**@brief Function for handling events from the button handler module.
 *
 * @param[in] pin_no        The pin that the event applies to.
 * @param[in] button_action The button action (press/release).
 */
static void button_event_handler(uint8_t pin_no, uint8_t button_action)
{
    ret_code_t err_code;

    switch (pin_no)
    {
        case LEDBUTTON_BUTTON:
            err_code = led_status_send_to_all(button_action);
            if (err_code == NRF_SUCCESS)
            {
                //NRF_LOG_INFO(&amp;quot;LBS write LED state %d&amp;quot;, button_action);
            }
            break;

        default:
            APP_ERROR_HANDLER(pin_no);
            break;
    }
}


/**@brief Function for initializing the button handler module.
 */
static void buttons_init(void)
{
    ret_code_t err_code;

   // The array must be static because a pointer to it will be saved in the button handler module.
    static app_button_cfg_t buttons[] =
    {
        {LEDBUTTON_BUTTON, false, BUTTON_PULL, button_event_handler}
    };

    err_code = app_button_init(buttons, ARRAY_SIZE(buttons), BUTTON_DETECTION_DELAY);
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for handling database discovery events.
 *
 * @details This function is callback function to handle events from the database discovery module.
 *          Depending on the UUIDs that are discovered, this function should forward the events
 *          to their respective services.
 *
 * @param[in] p_event  Pointer to the database discovery event.
 */
static void db_disc_handler(ble_db_discovery_evt_t * p_evt)
{
    //NRF_LOG_DEBUG(&amp;quot;call to ble_lbs_on_db_disc_evt for instance %d and link 0x%x!&amp;quot;,
      //            p_evt-&amp;gt;conn_handle,
     //             p_evt-&amp;gt;conn_handle);

    ble_lbs_on_db_disc_evt(&amp;amp;m_lbs_c[p_evt-&amp;gt;conn_handle], p_evt);
}


/** @brief Database discovery initialization.
 */
static void db_discovery_init(void)
{
    ret_code_t err_code = ble_db_discovery_init(db_disc_handler);
    APP_ERROR_CHECK(err_code);
}


/** @brief Function to sleep until a BLE event is received by the application.
 */
static void power_manage(void)
{
    ret_code_t err_code = sd_app_evt_wait();
    APP_ERROR_CHECK(err_code);
}


/** @brief Function for initializing the log module.
*/
static void log_init(void)
{
    ret_code_t err_code = NRF_LOG_INIT(NULL);
    APP_ERROR_CHECK(err_code);
    printf(&amp;quot;\rlog : %d&amp;quot;,err_code);

    NRF_LOG_DEFAULT_BACKENDS_INIT();
}


/** @brief Function for initializing the timer.
 */
static void timer_init(void)
{
    ret_code_t err_code = app_timer_init();
    APP_ERROR_CHECK(err_code);
}


/**@brief Function for initializing the GATT module.
 */
static void gatt_init(void)
{
    ret_code_t err_code;

    err_code = nrf_ble_gatt_att_mtu_periph_set(&amp;amp;m_gatt, 64);
    APP_ERROR_CHECK(err_code);
}


/**@brief   Function for handling app_uart events.
 *
 * @details This function will receive a single character from the app_uart module and append it to
 *          a string. The string will be be sent over BLE when the last character received was a
 *          &amp;#39;new line&amp;#39; &amp;#39;\n&amp;#39; (hex 0x0A) or if the string has reached the maximum data length.
 */
/**@snippet [Handling the data received over UART] */
void uart_event_handle(app_uart_evt_t * p_event)
{   
//    NRF_LOG_INFO(&amp;quot;UART EVENT&amp;quot;);
    static uint8_t data_array[5];
    static uint8_t index = 0;
    uint32_t       err_code;

    switch (p_event-&amp;gt;evt_type)
    {
        case APP_UART_DATA_READY:
            UNUSED_VARIABLE(app_uart_get(&amp;amp;data_array[index]));
            index++;

            if ((data_array[index - 1] == &amp;#39;\n&amp;#39;) || (index &amp;gt;= ( 5 )))
            {
         //       NRF_LOG_DEBUG(&amp;quot;Ready to send data over BLE NUS&amp;quot;);
         //       NRF_LOG_HEXDUMP_DEBUG(data_array, index);

                do
                {
                    uint16_t length = (uint16_t)index;
                    //err_code = ble_nus_string_send(&amp;amp;m_nus, data_array, &amp;amp;length);
                    if ( (err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY) )
                    {
                        APP_ERROR_CHECK(err_code);
                    }
                } while (err_code == NRF_ERROR_BUSY);

                index = 0;
            }
            break;

        case APP_UART_COMMUNICATION_ERROR:
            APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);
            break;

        case APP_UART_FIFO_ERROR:
            APP_ERROR_HANDLER(p_event-&amp;gt;data.error_code);
            break;

        default:
            break;
    }
}
/**@snippet [Handling the data received over UART] */


/**@brief  Function for initializing the UART module.
 */
/**@snippet [UART Initialization] */
static void uart_init(void)
{
    uint32_t                     err_code;
    const app_uart_comm_params_t comm_params =
    {
        RX_PIN_NUMBER,
        TX_PIN_NUMBER,
        RTS_PIN_NUMBER,
        CTS_PIN_NUMBER,
        APP_UART_FLOW_CONTROL_DISABLED,
        false,
        UART_BAUDRATE_BAUDRATE_Baud115200
    };
    APP_UART_FIFO_INIT( &amp;amp;comm_params,
                       UART_RX_BUF_SIZE,
                       UART_TX_BUF_SIZE,
                       uart_event_handle,
                       APP_IRQ_PRIORITY_LOWEST,
                       err_code);
    APP_ERROR_CHECK(err_code);
    printf(&amp;quot;error log : %d&amp;quot;,err_code);
}
/**@snippet [UART Initialization] */

int main(void)
{
    uint32_t err_code;

    // Initialize.
    err_code = app_timer_init();
    APP_ERROR_CHECK(err_code);

    uart_init();
    log_init();
    
    timer_init();
    leds_init();
    buttons_init();
    ble_stack_init();
    gatt_init();
    db_discovery_init();
    lbs_c_init();
    ble_conn_state_init();
    
    printf(&amp;quot;\rinit over\r&amp;quot;);


    // Start scanning for peripherals and initiate connection to devices which  advertise.
    scan_start();

    // Turn on the LED to signal scanning.
    bsp_board_led_on(CENTRAL_SCANNING_LED);

    for (;;)
    {
        if (!NRF_LOG_PROCESS())
        {
            power_manage();
        }
    }
}
&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span title=""&gt;I noticed that when I comment gatt_init () in the main function, I can then display the printf ().&lt;/span&gt;&lt;br /&gt;&lt;span title=""&gt;Problem: with the modifications made, the &amp;quot;central&amp;quot; no longer connects to the 2 devices and in addition I still can not communicate between PC and nRF52DK card...&lt;/span&gt;&lt;br /&gt;&lt;span title=""&gt;Hoping, that a person can help me.&lt;/span&gt; &lt;span title=""&gt;Thank you !&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>