<?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>Proximity testing nRF51422</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36376/proximity-testing-nrf51422</link><description>hi, 
 
 I’m new to nRF5x BLE devices. 
 I need to create a code for a project where i’m using a nRF51-DK device. So, I’m trying to demonstrate that the further the nRF51-DK is from the phone the less number of LEDs that light up, while closer the devices</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 17 Jul 2018 08:59:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36376/proximity-testing-nrf51422" /><item><title>RE: Proximity testing nRF51422</title><link>https://devzone.nordicsemi.com/thread/140346?ContentTypeID=1</link><pubDate>Tue, 17 Jul 2018 08:59:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf4bbb2d-c4b3-4a7c-acfb-709ce5a81758</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;&lt;span style="font-weight:400;"&gt;No, it is not. The approach I provided uses the current connection in order to get the RSSI value, it does that by using the connection handle. The connection handle will be received after the event BLE_GAP_EVT_CONNECTED occurs, thus after a connection between the microcontroller and the phone is formed.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;In order to get the RSSI value before establishing a connection, you will need &amp;nbsp;to use advertising. Advertising means that one device will advertise blindly and another device will listen and receive the advertisement packet. Then you can get the RSSI value from the &lt;/span&gt;&lt;span style="font-weight:400;"&gt;advertising report event structure, ble_gap_evt_adv_report_t (&lt;/span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/10668/rssi-without-connection"&gt;&lt;span style="font-weight:400;"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/10668/rssi-without-connection&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight:400;"&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;In this way only one device will get the RSSI value, and I guess you would want it to be the microcontroller (to turn on LEDs), then you would want to use the phone as advertiser and your &lt;/span&gt;&lt;span style="font-weight:400;"&gt;nRF51-DK as a scanner. However, there are some disadvantages with a setup like this: &lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/23605/smartphone-as-peripheral"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/23605/smartphone-as-peripheral&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;I hope this helps.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proximity testing nRF51422</title><link>https://devzone.nordicsemi.com/thread/140285?ContentTypeID=1</link><pubDate>Mon, 16 Jul 2018 18:50:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bea6480e-8f33-4093-83f2-9973e4c394ef</guid><dc:creator>seatac</dc:creator><description>&lt;p&gt;Thank you for you response Simon,&lt;/p&gt;
&lt;p&gt;Is this the same approach I would take if I wanted to get the RSSI before they are connected?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proximity testing nRF51422</title><link>https://devzone.nordicsemi.com/thread/140216?ContentTypeID=1</link><pubDate>Mon, 16 Jul 2018 13:22:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ae7b2fd-12a9-400b-9187-3c1fbcbb441b</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;The &amp;quot;Received Signal Strength Indicator&amp;quot; (RSSI) level will give a rough estimate of the distance between the phone and the&amp;nbsp;&lt;span&gt;nRF51-DK. The further away the phone is, the lower the RSSI value will be. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Initially you will need to call sd_ble_gap_rssi_start(..), which will start to report the signal strength to the application. Whenever the RSSI value changes, a new event is reported.&lt;/p&gt;
&lt;p&gt;In order to get the the RSSI value, the function sd_ble_gap_rssi_get(..) needs to be called, which&amp;nbsp;will get the signal strength for the last connection event.&lt;/p&gt;
&lt;p&gt;The mentioned functions are part of the Generic Access Profile, and can be found&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF5_SDK/nRF51_SDK_v8.x.x/doc/8.1.0/s130/html/a01260.html"&gt;here&lt;/a&gt;&amp;nbsp;(for softdevice S130)&lt;/p&gt;
&lt;p&gt;Best Regards Simon Iversen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>