<?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>Concurrent Central/Peripheral UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19765/concurrent-central-peripheral-uart</link><description>Hi, 
 I&amp;#39;am actually trying to develop a BLE based remote, with NRF52832, S132. 
 This remote must be configured by a smartphone (the remote act as peripheral) and be able to control one equipement (and act as Central). 
 As i only need to use uart</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 31 Jul 2018 11:35:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19765/concurrent-central-peripheral-uart" /><item><title>RE: Concurrent Central/Peripheral UART</title><link>https://devzone.nordicsemi.com/thread/142140?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 11:35:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5dca90b-2320-49c2-aaff-93ff6d709f15</guid><dc:creator>kishor babu</dc:creator><description>&lt;p&gt;kk&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrent Central/Peripheral UART</title><link>https://devzone.nordicsemi.com/thread/141951?ContentTypeID=1</link><pubDate>Mon, 30 Jul 2018 13:48:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:481ef128-67fa-467d-b0ed-ad4f33318f63</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Please post your issue in a new question, you are moving outside the topic of this question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrent Central/Peripheral UART</title><link>https://devzone.nordicsemi.com/thread/141887?ContentTypeID=1</link><pubDate>Mon, 30 Jul 2018 11:27:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e1abe6a-267c-4918-87ec-635cb0b07769</guid><dc:creator>kishor babu</dc:creator><description>&lt;p&gt;Hi Jorgen,&lt;/p&gt;
&lt;p&gt;Now it is advertising and scanning.&lt;/p&gt;
&lt;p&gt;But in peripheral it is able to connect to the central but not able to receive or send the data.&lt;/p&gt;
&lt;p&gt;In central it is able to scan but when it is connected&amp;nbsp; to the peripheral LED 2(which is used to mention that it is connected)&amp;nbsp; is not glowing and instead the advertising LED 3 is turned off and i am not able to receive or send the data.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void ble_evt_dispatch(ble_evt_t * p_ble_evt)
{
    uint16_t conn_handle;
    uint16_t role;

    ble_conn_state_on_ble_evt(p_ble_evt);
    pm_on_ble_evt(p_ble_evt);

    // The connection handle should really be retrievable for any event type.
    conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
    role        = ble_conn_state_role(conn_handle);

    // Based on the role this device plays in the connection, dispatch to the right applications.
    if (role == BLE_GAP_ROLE_PERIPH)
    {
        // Manages peripheral LEDs.
			  printf(&amp;quot;peripheral\r\n&amp;quot;);
        on_ble_peripheral_evt(p_ble_evt);

        ble_advertising_on_ble_evt(p_ble_evt);
        ble_conn_params_on_ble_evt(p_ble_evt);

        // Dispatch to peripheral applications.
        ble_nus_on_ble_evt (&amp;amp;m_nus, p_ble_evt);
       
    }
    else if ((role == BLE_GAP_ROLE_CENTRAL) || (p_ble_evt-&amp;gt;header.evt_id == BLE_GAP_EVT_ADV_REPORT))
    {
		      printf(&amp;quot;in central\r\n&amp;quot;);    
         /** on_ble_central_evt will update the connection handles, so we want to execute it
         * after dispatching to the central applications upon disconnection. */
        if (p_ble_evt-&amp;gt;header.evt_id != BLE_GAP_EVT_DISCONNECTED)
        {
            on_ble_central_evt(p_ble_evt);
        }
		  	//on_ble_central_evt(p_ble_evt);
				//bsp_btn_ble_on_ble_evt(p_ble_evt);
				ble_db_discovery_on_ble_evt(&amp;amp;m_ble_db_discovery, p_ble_evt);
        ble_nus_c_on_ble_evt(&amp;amp;m_ble_nus_c, p_ble_evt);
      
        // If the peer disconnected, we update the connection handles last.
        if (p_ble_evt-&amp;gt;header.evt_id == BLE_GAP_EVT_DISCONNECTED)
        {
            on_ble_central_evt(p_ble_evt);
				
        }
		
				
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;should i need to make any changes in the dispatcher function mentioned above?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrent Central/Peripheral UART</title><link>https://devzone.nordicsemi.com/thread/141562?ContentTypeID=1</link><pubDate>Thu, 26 Jul 2018 16:02:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f84fe5a0-0c49-440c-b26b-3dd114ec1353</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Try &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/10729/my-device-is-freezing-and-restarting"&gt;debugging&lt;/a&gt; the application. Most likely some error code is putting the application into the error handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrent Central/Peripheral UART</title><link>https://devzone.nordicsemi.com/thread/141533?ContentTypeID=1</link><pubDate>Thu, 26 Jul 2018 12:59:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b588917-dd57-4ab0-9a96-5d7fcc1b6a98</guid><dc:creator>kishor babu</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt; */
static void ble_evt_dispatch(ble_evt_t * p_ble_evt)
{	
	  uint16_t conn_handle_nb;
	  uint16_t role;
	  
	  ble_conn_state_on_ble_evt(p_ble_evt);
	
	  conn_handle_nb = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
    role        = ble_conn_state_role(conn_handle_nb);
	
	  SEGGER_RTT_printf(0,&amp;quot;EVT conn handle num %u!!\r\n&amp;quot;, conn_handle_nb);
	
	 if(role != BLE_GAP_ROLE_INVALID)
		{
			    if (role == BLE_GAP_ROLE_PERIPH) //MAX
					{
							SEGGER_RTT_printf(0,&amp;quot;PERIPH\r\n&amp;quot;);
							on_ble_peripheral_evt(p_ble_evt);
							ble_advertising_on_ble_evt(p_ble_evt);
							ble_conn_params_on_ble_evt(p_ble_evt);
						//dispatch to peripheral application
						ble_nus_on_ble_evt(&amp;amp;m_nus, p_ble_evt);
					}
					
				else	if (role == BLE_GAP_ROLE_CENTRAL)
					{
							SEGGER_RTT_printf(0,&amp;quot;CENTRAL\r\n&amp;quot;);
							on_ble_central_evt(p_ble_evt);
							bsp_btn_ble_on_ble_evt(p_ble_evt);
							ble_db_discovery_on_ble_evt(&amp;amp;m_ble_db_discovery, p_ble_evt);
							ble_nus_c_on_ble_evt(&amp;amp;m_ble_nus_c,p_ble_evt);
					
					// If the peer disconnected, we update the connection handles last.
        if (p_ble_evt-&amp;gt;header.evt_id == BLE_GAP_EVT_DISCONNECTED)
        {
            on_ble_central_evt(p_ble_evt);
        }
		  }
					
					
		else 
		{
					SEGGER_RTT_printf(0,&amp;quot;INVALID\r\n&amp;quot;);
		}

}
		
}
		
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Is this the change you suggested to Maxim?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrent Central/Peripheral UART</title><link>https://devzone.nordicsemi.com/thread/141528?ContentTypeID=1</link><pubDate>Thu, 26 Jul 2018 12:36:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dde831e-90df-4cfa-93e2-f193c3ac3fa6</guid><dc:creator>kishor babu</dc:creator><description>&lt;p&gt;Hi Jorgen,&lt;/p&gt;
&lt;p&gt;Sorry for late reply, I flashed the correct softdevice only but still it is not working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrent Central/Peripheral UART</title><link>https://devzone.nordicsemi.com/thread/141328?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 12:56:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ef4d023-fbdc-4a08-80c4-f3315eeb83c8</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Did you flash the (correct) softdevice?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrent Central/Peripheral UART</title><link>https://devzone.nordicsemi.com/thread/141131?ContentTypeID=1</link><pubDate>Tue, 24 Jul 2018 11:45:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9177362-e33b-4ce1-9eaf-a36f7a1d9a50</guid><dc:creator>kishor babu</dc:creator><description>&lt;p&gt;Hi Jorgen,&lt;/p&gt;
&lt;p&gt;I am also trying to merge the both uart demos.&lt;/p&gt;
&lt;p&gt;i have downloaded the maxim code and added necessary files into it, it compiled all good and zero errors but it is not scanning or advertising.&lt;/p&gt;
&lt;p&gt;I am using nrf52832 board and sdk 12.3.&lt;/p&gt;
&lt;p&gt;could you please help me in this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrent Central/Peripheral UART</title><link>https://devzone.nordicsemi.com/thread/140916?ContentTypeID=1</link><pubDate>Mon, 23 Jul 2018 06:55:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a58d923-4d2c-4a1d-a08e-258ca5583605</guid><dc:creator>kishor babu</dc:creator><description>&lt;p&gt;Hi Maxim,&lt;/p&gt;
&lt;p&gt;I am also working on same sort of thing where i need implement UART service as central and peripheral at a time&amp;nbsp;&lt;/p&gt;
&lt;p&gt;could u send the working code for this?&lt;/p&gt;
&lt;p&gt;Thanks in advance,&lt;/p&gt;
&lt;p&gt;Kishor&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrent Central/Peripheral UART</title><link>https://devzone.nordicsemi.com/thread/76851?ContentTypeID=1</link><pubDate>Mon, 20 Feb 2017 07:20:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af0d6198-5345-46f5-bf47-1e9667e4a818</guid><dc:creator>Maxim</dc:creator><description>&lt;p&gt;Thanks a lot for your help Jørgen, it works perfectly with this !
And for the peripheral function we must add &lt;code&gt;ble_nus_on_ble_evt(&amp;amp;m_nus, p_ble_evt);&lt;/code&gt; on the dispatch peripheral to retreive the messages.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrent Central/Peripheral UART</title><link>https://devzone.nordicsemi.com/thread/76850?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2017 15:28:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fe56571-8621-4dc2-8b19-0575c2f94c90</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It does not look like you are handling received advertising reports in your application.&lt;/p&gt;
&lt;p&gt;When your central receives an advertising packet, the role will be set to &lt;code&gt;BLE_GAP_ROLE_INVALID&lt;/code&gt;, but the event ID will indicate &lt;code&gt;BLE_GAP_EVT_ADV_REPORT&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You should dispatch such events to the &lt;code&gt;on_ble_central_evt()&lt;/code&gt; handler. Have a look at for instance the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/ble_sdk_app_rscs_relay.html?cp=4_0_1_4_2_1_1"&gt;BLE Relay Example&lt;/a&gt; (concurrent central/peripheral) for more details about how this is done.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>