<?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>Simple Observing of nearby devices</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11709/simple-observing-of-nearby-devices</link><description>Hi, I have an nRF51822 with s130 doing normal advertising and a Nordic UART service. Is there an example somewhere of doing some simple observation with it at the same time? 
 Ideally I&amp;#39;d just have start_listening and end_listening functions, and would</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Aug 2019 05:02:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11709/simple-observing-of-nearby-devices" /><item><title>RE: Simple Observing of nearby devices</title><link>https://devzone.nordicsemi.com/thread/204895?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 05:02:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c633373-a565-4a29-9ffb-4a6136806370</guid><dc:creator>guma</dc:creator><description>&lt;p&gt;Hi Gordan&lt;/p&gt;
&lt;p&gt;I have to advertise and scan the advertising packet and display rssi.&lt;/p&gt;
&lt;p&gt;I have succesfully completed advertising. To simple code for scan i was looking for and came across your solution.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I want to know on peripheral i have beacon cide with device name.&lt;/p&gt;
&lt;p&gt;on central : ble app uart code is that okay.?&lt;/p&gt;
&lt;p&gt;kindly let me know .&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Observing of nearby devices</title><link>https://devzone.nordicsemi.com/thread/44273?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2016 10:51:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f951653d-595c-46b0-a47b-3f9bb880b67f</guid><dc:creator>Rasul Kishov</dc:creator><description>&lt;p&gt;Useful! Thank you. Saved me so much time and RAM :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Observing of nearby devices</title><link>https://devzone.nordicsemi.com/thread/44272?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2016 09:33:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28a824cf-7851-42a3-b009-df8c971bdabd</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Thanks for posting your solution. That will be helpful for others with similar questions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Observing of nearby devices</title><link>https://devzone.nordicsemi.com/thread/44271?ContentTypeID=1</link><pubDate>Thu, 04 Feb 2016 14:12:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1adea9a-d0e5-4351-aee3-60cb24cbd7d6</guid><dc:creator>Gordon</dc:creator><description>&lt;p&gt;Ok, in case anyone else is interested in this - with Einar&amp;#39;s help:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define SCAN_INTERVAL              0x00A0                             /**&amp;lt; Determines scan interval in units of 0.625 millisecond. */
#define SCAN_WINDOW                0x0050                             /**&amp;lt; Determines scan window in units of 0.625 millisecond. */


static void on_ble_evt(ble_evt_t * p_ble_evt) {
switch (p_ble_evt-&amp;gt;header.evt_id) {
  // ...
  case BLE_GAP_EVT_ADV_REPORT: {
    // Advertising data received
    const ble_gap_evt_adv_report_t *p_adv = &amp;amp;p_ble_evt-&amp;gt;evt.gap_evt.params.adv_report;
    printf(&amp;quot;RSSI: %d\n&amp;quot;, p_adv-&amp;gt;rssi);
    // also data, address, etc in p_adv
    break;
  }
}

ble_gap_scan_params_t     m_scan_param;
// non-selective scan
m_scan_param.active       = 0;            // Active scanning set.
m_scan_param.selective    = 0;            // Selective scanning not set.
m_scan_param.interval     = SCAN_INTERVAL;// Scan interval.
m_scan_param.window       = SCAN_WINDOW;  // Scan window.
m_scan_param.p_whitelist  = NULL;         // No whitelist provided.
m_scan_param.timeout      = 0x0000;       // No timeout.

err_code = sd_ble_gap_scan_start(&amp;amp;m_scan_param);

// and stop with
err_code = sd_ble_gap_scan_stop();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This seems to work, however the advertising window of 50ms / 100ms means that you do tend to miss things. Is it ok to put the window up to 100ms as well? It seems to work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Observing of nearby devices</title><link>https://devzone.nordicsemi.com/thread/44270?ContentTypeID=1</link><pubDate>Thu, 04 Feb 2016 12:52:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c214fc96-a7bd-4f9c-8795-bfda90a38948</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Yes, that is correct. As long as you only scan for peripherals and never initiate a connection, you can set CENTRAL_LINK_COUNT to 0 in order to reduce the amount of RAM required by the SoftDevice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Observing of nearby devices</title><link>https://devzone.nordicsemi.com/thread/44269?ContentTypeID=1</link><pubDate>Thu, 04 Feb 2016 11:34:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d6b6569-ea5d-4400-a873-8be9c22baf1e</guid><dc:creator>Gordon</dc:creator><description>&lt;p&gt;Thanks - so &lt;code&gt;sd_ble_gap_scan_start&lt;/code&gt; is the magic function that&amp;#39;s needed by the look of it, and you get a &lt;code&gt;BLE_GAP_EVT_ADV_REPORT&lt;/code&gt; in &lt;code&gt;on_ble_central_evt&lt;/code&gt;? Does the softdevice have to have &lt;code&gt;CENTRAL_LINK_COUNT&amp;gt;0&lt;/code&gt;? Ideally not since there would be no link as such?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Observing of nearby devices</title><link>https://devzone.nordicsemi.com/thread/44268?ContentTypeID=1</link><pubDate>Thu, 04 Feb 2016 10:15:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff49dea9-b169-4501-a8e7-b33543413405</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;There is just one concurrent BLE Central &amp;amp; Peripheral example in SDK 11, the experimental &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/ble_sdk_app_rscs_relay.html"&gt;BLE Relay Example&lt;/a&gt;. It is probably a bit more complex than what you need, but it demonstrates how the device can act as a peripheral (both advertising and keeping connections) and as a central (including scanning).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>