<?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>RSSI measurement for each peripheral s130 or 132</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19437/rssi-measurement-for-each-peripheral-s130-or-132</link><description>Hi,
I want to get the RSSI for each peripheral that is connected to an nRF52 when it is operating as a multi-link central to multiple peripherals. Helpful hints? Sample code? 
 Thanks!</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Feb 2017 10:46:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19437/rssi-measurement-for-each-peripheral-s130-or-132" /><item><title>RE: RSSI measurement for each peripheral s130 or 132</title><link>https://devzone.nordicsemi.com/thread/75494?ContentTypeID=1</link><pubDate>Wed, 08 Feb 2017 10:46:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97b92a96-568f-451f-9c70-a1dca580d864</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Example:
When a peripheral connects, let’s start the RSSI sampling.
In the function on_ble_evt(),when we get the event BLE_GAP_EVT_CONNECTED, let’s call the start function:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;case BLE_GAP_EVT_CONNECTED:
        {
            NRF_LOG_INFO(&amp;quot;Connection 0x%x established, starting DB discovery.\r\n&amp;quot;,
                         p_gap_evt-&amp;gt;conn_handle);
            APP_ERROR_CHECK_BOOL(p_gap_evt-&amp;gt;conn_handle &amp;lt; TOTAL_LINK_COUNT);

            err_code = ble_lbs_c_handles_assign(&amp;amp;m_ble_lbs_c[p_gap_evt-&amp;gt;conn_handle],
                                                p_gap_evt-&amp;gt;conn_handle,
                                                NULL);
            APP_ERROR_CHECK(err_code);
            sd_ble_gap_rssi_start(p_gap_evt-&amp;gt;conn_handle,3,0); // ADD THIS
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;then add a new case in the function on_ble_evt() for the rssi event:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;case BLE_GAP_EVT_RSSI_CHANGED:
            NRF_LOG_INFO(&amp;quot;Rssi is %d with conn_handle: %d\n&amp;quot;,p_gap_evt-&amp;gt;params.rssi_changed.rssi,p_gap_evt-&amp;gt;conn_handle); 
            break;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RSSI measurement for each peripheral s130 or 132</title><link>https://devzone.nordicsemi.com/thread/75495?ContentTypeID=1</link><pubDate>Wed, 08 Feb 2017 02:19:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9dabda6b-8dff-49eb-bd81-42d9d062c2e3</guid><dc:creator>Bill Saltzstein</dc:creator><description>&lt;p&gt;Thanks -- Got it all working the way I want!&lt;/p&gt;
&lt;p&gt;Thank you!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RSSI measurement for each peripheral s130 or 132</title><link>https://devzone.nordicsemi.com/thread/75493?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2017 11:50:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eac6238b-4baf-4a00-b32d-4c919a019693</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;In order to measure the RSSI on a connected peripheral, you can use the SoftDevice functions &lt;code&gt;sd_ble_gap_rssi_get()&lt;/code&gt;, &lt;code&gt;sd_ble_gap_rssi_start()&lt;/code&gt; and &lt;code&gt;sd_ble_gap_rssi_stop()&lt;/code&gt;. Provide the conn_handle for the peripheral you want to get the RSSI from. You can read more about these functions &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v2.0.1/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html?cp=3_7_2_1_0_2_1_2_23#ga51f25b5b74290f91aa92cb47dc8d4276"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>