<?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>Read data from single peripheral at multilink nus central</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51128/read-data-from-single-peripheral-at-multilink-nus-central</link><description>Hi 
 I have done multilink with uart and getting data from multiple ble_uart peripheral. now i have to read data from only one peripheral . what will do for that. 
 I am using nrf52832 
 SDK15.0 
 
 Regards</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 Aug 2019 12:40:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51128/read-data-from-single-peripheral-at-multilink-nus-central" /><item><title>RE: Read data from single peripheral at multilink nus central</title><link>https://devzone.nordicsemi.com/thread/204770?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2019 12:40:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4bcae55-5e78-4504-816e-90cb1b2f046d</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You save the connection handle of the peripheral that you want to listen in&amp;nbsp;BLE_GAP_EVT_CONNECTED something like below&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;case BLE_GAP_EVT_CONNECTED:
   m_whitelist_peripheral_conn_handle = p_gap_evt-&amp;gt;conn_handle;
   
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and when you get the gatt event, you just compare the incoming event connection handle with this one before processing the data.&lt;/p&gt;
&lt;p&gt;For example, if you are listening through notifications, then you will have something like below&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; static void on_hvx(ble_hrs_c_t * p_ble_hrs_c, const ble_evt_t * p_ble_evt)
{
     if (m_whitelist_peripheral_conn_handle == p_ble_evt-&amp;gt;evt.gattc_evt.conn_handle)
        {
            process_your_data(); // in your case, send this to UART
        }
        
     // if not, just ignore the incoming data from others.
}


&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read data from single peripheral at multilink nus central</title><link>https://devzone.nordicsemi.com/thread/204686?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2019 09:28:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:112058f5-a3a4-4332-8e4e-472873c830c1</guid><dc:creator>sree</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I connected two peripheral to central device. Both peripheral send data to central. central also print received data from both peripheral into terminal. But i want to select data from one specified peripheral and print only that data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read data from single peripheral at multilink nus central</title><link>https://devzone.nordicsemi.com/thread/204643?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2019 07:10:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cde74af9-2837-41c7-a7c4-b4cf23877dd2</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;This must be very simple to implement, but why would you connect to many peripherals if you only want to listen to one?&lt;/p&gt;
&lt;p&gt;If you have any usecase to do it in this way, your app could then compare the incoming event connection handle with the connection handle you saved for the peripheral you want to listen to. Ignore the incoming data from any other peripheral.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>