<?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>How to get rssi without connection via central device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23649/how-to-get-rssi-without-connection-via-central-device</link><description>I use nrf51822 sdk130 (central device) and nrf51822 sdk110(peripheral device). I want to get rssi value of the peripheral device using the central device without connection. Is it possible to read rssi value of peripheral device without connection?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Jul 2017 12:02:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23649/how-to-get-rssi-without-connection-via-central-device" /><item><title>RE: How to get rssi without connection via central device</title><link>https://devzone.nordicsemi.com/thread/92946?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2017 12:02:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e4c305f-7bc9-4b69-b93d-5dd708e07826</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;It doesn&amp;#39;t make much sense, the whole application is asynchronous:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Get some interrupt or event =&amp;gt; call some function (which might disable/enable more events).&lt;/li&gt;
&lt;li&gt;Wait for next event (whatever it is).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So just during boot set all initial events you are waiting for and then do in event handlers (button press or SD callbacks) what you want to do.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get rssi without connection via central device</title><link>https://devzone.nordicsemi.com/thread/92952?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2017 11:57:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d85bbcc8-b35e-40c8-ab4e-ac789c4e371a</guid><dc:creator>purgoufr</dc:creator><description>&lt;p&gt;I want to build a conditional structure. The first button press will process BLE_GAP_EVT_ADV_REPORT and BLE_GAP_EVT_CONNECTED.(so connection establish occur). The second button press will only process the BLE_GAP_EVT_ADV_REPORT and get the rss data( Not connected, just get rssi value).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get rssi without connection via central device</title><link>https://devzone.nordicsemi.com/thread/92944?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2017 08:39:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6ec208a-9f74-4c7b-b802-8c1f30d7ce0c</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Well you must then have something wrong in the code because if you scan only no connection is established, you will be just getting BLE_GAP_EVT_ADV_REPORT events. You can parse event data to get RSSI value out of it. Once you like it just simply call connect function which you normally call in button press handler. Don&amp;#39;t see a problem, sorry.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get rssi without connection via central device</title><link>https://devzone.nordicsemi.com/thread/92945?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2017 08:06:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c95e3dae-d9d6-4a5a-96b1-3c08fd721e97</guid><dc:creator>purgoufr</dc:creator><description>&lt;p&gt;I want to continuously get rssi value of the peripheral device using the central device without connection. Normally I start the scan_start function using button_handler function. Then connection establish occurs. But I dont want to do that. I want to Connect automatically device without press the button (without button_handler function). And I want the device not to reconnect until it leaves the bluetooth signal range.(think like KEYLESS GO - Mercedes). Is it possible?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get rssi without connection via central device</title><link>https://devzone.nordicsemi.com/thread/92950?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2017 06:39:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a4c61f6-fc36-4d55-816d-ddd4a66a3308</guid><dc:creator>purgoufr</dc:creator><description>&lt;p&gt;But I want to do this;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;scan_start();&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Get Rssi value&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If Rssi value &amp;gt; some_value&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Connect automatically device without press the button (without button_handler function)&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get rssi without connection via central device</title><link>https://devzone.nordicsemi.com/thread/92949?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2017 06:37:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65f09daa-2633-4858-b959-25846ca92cca</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Yes, looks good.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get rssi without connection via central device</title><link>https://devzone.nordicsemi.com/thread/92948?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2017 06:36:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7451fd0b-753d-4545-a728-cb90477a9b76</guid><dc:creator>purgoufr</dc:creator><description>&lt;p&gt;Normally process going like this;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void button_handler(uint8_t pin_no, uint8_t button_action)
{
    if(button_action == APP_BUTTON_PUSH || button_action == BSP_BUTTON_ACTION_LONG_PUSH || BSP_BUTTON_ACTION_RELEASE)
    {
        switch(pin_no)
        {
            case BUTTON_1:
                scan_start();
                break;
          
	default:
		break;
						
	}
   }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;THEN&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void on_ble_evt(ble_evt_t * p_ble_evt)
{
    uint32_t              err_code;
    const ble_gap_evt_t * p_gap_evt = &amp;amp;p_ble_evt-&amp;gt;evt.gap_evt;	 
	
    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
        case BLE_GAP_EVT_ADV_REPORT:
         .
         .
 
         case BLE_GAP_EVT_CONNECTED:
         .
         .
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get rssi without connection via central device</title><link>https://devzone.nordicsemi.com/thread/92947?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2017 06:34:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78504a16-80c6-4a9e-97d7-a33b7af16e61</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Yes, this will start the scanning, now you just need to handle incoming events. Good luck!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get rssi without connection via central device</title><link>https://devzone.nordicsemi.com/thread/92951?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2017 05:59:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07d70046-e17a-41cb-a4eb-8c2054e6c817</guid><dc:creator>purgoufr</dc:creator><description>&lt;p&gt;I try to read rssi like adc_value. I want to keep watching. I have two buttons. I just want to use first button manually. So try to connect every time I press it. When I press the second button(I only pressed the second button once), Central device always search peripheral device and  it always try to connect automatically if the rssi value is at a certain level. (Connect to the peripheral device without pressing the button.)&lt;/p&gt;
&lt;p&gt;scan_start function ;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void scan_start(void)
{
    uint32_t err_code;
	
    err_code = sd_ble_gap_scan_start(&amp;amp;m_scan_params);
    APP_ERROR_CHECK(err_code);
    
    err_code = bsp_indication_set(BSP_INDICATE_SCANNING);
    APP_ERROR_CHECK(err_code);
	
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get rssi without connection via central device</title><link>https://devzone.nordicsemi.com/thread/92954?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2017 17:50:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a3d9680-79ce-469e-ab99-df18c114e6cb</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;You probably deal with some specific FW code or example which I won&amp;#39;t help you with but the procedure you are describing is scanning. See &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v4.0.2/group___b_l_e___g_a_p___s_c_a_n___m_s_c.html?cp=2_3_0_1_1_2_1_3_13"&gt;following chapter in Infocenter&lt;/a&gt;, there is &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v4.0.2/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html?cp=2_3_0_1_1_2_1_2_30#ga3db84fa4870b155489187103906cf318"&gt;sd_ble_gap_scan_start()&lt;/a&gt; function which should cause &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v4.0.2/group___b_l_e___g_a_p___e_n_u_m_e_r_a_t_i_o_n_s.html#ggada486dd3c0cce897b23a887bed284fefa41ba498a9fda3e1cd345f4454a582bd9"&gt;BLE_GAP_EVT_ADV_REPORT&lt;/a&gt; events coming and as you can see in event data you can locate RSSI measured.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get rssi without connection via central device</title><link>https://devzone.nordicsemi.com/thread/92953?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2017 17:39:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93013c5b-b7dd-4be3-b1bf-cf925c42c86d</guid><dc:creator>purgoufr</dc:creator><description>&lt;p&gt;It automatically connects to the peripheral device when it enters the on_ble_evt function. But I do not want that. I want to read rssi value without entering the peripheral device.Normally, when I press the button, it enters &amp;quot;button_handler&amp;quot; function. Then it use &amp;quot;sd_ble_gap_scan_start(&amp;amp;m_scan_params);&amp;quot; function. After that ,Function for handling the Application&amp;#39;s BLE Stack events start automatically(on_ble_evt). Finally connection establihes. But I just want to learn rssi value of peripheral device,nothing else. Can you write some method or function to do that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get rssi without connection via central device</title><link>https://devzone.nordicsemi.com/thread/92943?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2017 13:50:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5f8dc30-c6cd-48ca-8732-8b8433952555</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Sure, each scanning event (when you receive ADV_xxx packet) has RSSI value in the event data structure.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>