<?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>I want to sense bluetooth RF without connecting/pairing/bonding</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17830/i-want-to-sense-bluetooth-rf-without-connecting-pairing-bonding</link><description>I want to sense bluetooth from any distance the radio can detect and without connecting, pairing or bonding. Simply turn led2 on while the nrf51822 senses RF and when it no longer senses
RF simply turn led2 off!. No interaction is needed except for the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 18 Nov 2016 15:36:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17830/i-want-to-sense-bluetooth-rf-without-connecting-pairing-bonding" /><item><title>RE: I want to sense bluetooth RF without connecting/pairing/bonding</title><link>https://devzone.nordicsemi.com/thread/68697?ContentTypeID=1</link><pubDate>Fri, 18 Nov 2016 15:36:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f17b13c9-0381-470f-90ac-891b3c90c3d4</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you create a central/observer, you will get a &lt;code&gt;BLE_GAP_EVT_ADV_REPORT&lt;/code&gt; event in your BLE event handler. You can use this to set the LED each time you receive an advertising packet from any device. If you want to limit the LED indication to a single device within range, you have to parse the package for devicename/device address. To switch off the LED, you can create a single-shot timer, that will turn off the LED after a given amount of time after receving the advertisement report. Remember to stop the timer if you receive a new advertisement packet. You need to set the timout for the timer long enough to make sure you cover the longest advertisement interval of devices within range to make ensure the led will not turn off between receiving advertisement packets.&lt;/p&gt;
&lt;p&gt;You can take a look at the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.0.0/ble_sdk_app_hrc.html?cp=4_0_0_4_2_0_0"&gt;BLE Heart Rate Collector Example&lt;/a&gt; in our SDK. Here is an example of what your BLE event handler can contain:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void on_ble_evt(ble_evt_t * p_ble_evt)
{
    uint32_t                err_code;

	if (p_ble_evt-&amp;gt;header.evt_id == BLE_GAP_EVT_ADV_REPORT)
	{
		err_code = app_timer_stop(m_ble_activity_timer_id);
		APP_ERROR_CHECK(err_code);
		
		nrf_drv_gpiote_out_clear(LED_3); // Turn LED on

		err_code = app_timer_start(m_ble_activity_timer_id, APP_TIMER_TICKS(timer_timeout, APP_TIMER_PRESCALER), NULL);
		APP_ERROR_CHECK(err_code);

	}
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You also need to add the other variables and create the timer and timer handler:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;APP_TIMER_DEF(m_ble_activity_timer_id);
static timer_timeout = 1000;

static void ble_activity_timer_handler(void * p_context)
{
    nrf_drv_gpiote_out_set(LED_3); 	// Turn LED off
}

int main(void)
{
    uint32_t err_code = app_timer_create(&amp;amp;m_ble_activity_timer_id,
										 APP_TIMER_MODE_SINGLE_SHOT,
										 ble_activity_timer_handler);
    APP_ERROR_CHECK(err_code);

}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It looks from your code like you are using mBed. I&amp;#39;m not sure about how to do this in mBed, but the principle should be the same. You can take a look at the &lt;a href="https://developer.mbed.org/teams/Bluetooth-Low-Energy/code/BLE_Observer/"&gt;BLE_Observer example&lt;/a&gt;, which should help you well on the way!&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>