<?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 BLE scan result</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68084/how-to-get-ble-scan-result</link><description>Hi, 
 I am using nrf52832 development board with sdk 17.0.2 and S132 softdevice. My requirement is to scan and advertise at the same time. I am using the ble_app_template as a base code and added the &amp;#39;nrf_ble_scan_init(&amp;amp;m_scan, NULL, NULL)&amp;#39; and &amp;#39; nrf_ble_scan_start</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Nov 2020 10:25:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68084/how-to-get-ble-scan-result" /><item><title>RE: How to get BLE scan result</title><link>https://devzone.nordicsemi.com/thread/279664?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2020 10:25:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8a4811f-74f9-4f23-a28c-b8eff246be57</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;That calls for a different thread &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt; There are several different ways to exchange data in BLE, and the APIs you use depend on what way you want to do it. If you want to exchange a lot of data efficiently, then notifications is often the most appropriate, and that is done with&amp;nbsp;sd_ble_gatts_hvx() after the peer has enabled notifications by writing to the CCCD. You can refer to for instance the&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_nus_eval.html"&gt; UART/Serial Port Emulation over BLE example&lt;/a&gt;&amp;nbsp;and NUS service implementation (&amp;lt;SDK&amp;gt;\components\ble\ble_services\ble_nus\ble_nus.c) for details if this is the approach you want.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get BLE scan result</title><link>https://devzone.nordicsemi.com/thread/279653?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2020 09:26:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c3ca57b-d808-4437-bb9f-8d2fe55c4eb6</guid><dc:creator>Vimalnath</dc:creator><description>&lt;p&gt;okay. what is the API call for sending data to the central by the peripheral device when connected and vice versa?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get BLE scan result</title><link>https://devzone.nordicsemi.com/thread/279640?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2020 08:48:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb48ca2a-2604-4c87-8ad8-7ea2661f0115</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;The advertisement packet&amp;nbsp;contains the address, but it is part of the header and not the payload.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get BLE scan result</title><link>https://devzone.nordicsemi.com/thread/279617?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2020 05:24:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:094b0d3a-37a6-4f6c-b542-303d0abd227a</guid><dc:creator>Vimalnath</dc:creator><description>&lt;p&gt;Okay, this is much better. But I have another doubt. I have a BLE advertising device which advertises some information, but the packets doesn&amp;#39;t contain mac address, still I am able to get the mac address in the &amp;#39;p_adv_report-&amp;gt;peer_addr.addr&amp;#39;. How&amp;#39;s that possible. If the advt packets doesn&amp;#39;t have that information from where the stack is getting it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get BLE scan result</title><link>https://devzone.nordicsemi.com/thread/279212?ContentTypeID=1</link><pubDate>Tue, 10 Nov 2020 11:37:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e94744bd-e147-4172-bc0f-82f4df19b03b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Yes, that is what I attempted to do. You write that you get scan responses, and then you just have to wait in order to get from all the active scanners that is within range.&lt;/p&gt;
&lt;p&gt;If the question is about what data you can filter on, then you can filter on whatever is in the advertising report (&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.2.0/structble__gap__evt__adv__report__t.html"&gt;ble_gap_evt_adv_report_t&lt;/a&gt;). That is the actual payload of the advertising packet or scan response packet, the address and some other metadata. You can filter on those manually, as you write.&lt;/p&gt;
&lt;p&gt;Just so there is no confusion I would like to stress that the nRF will not filter out multiple packets from the same address, or link the&amp;nbsp;advertisement packet and scan response packet together. So if you need that, you have to do that filtering yourself (BLE address is part of both events).&lt;/p&gt;
&lt;p&gt;If this does not&amp;nbsp;answer the question, then please clarify what it is you need to know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get BLE scan result</title><link>https://devzone.nordicsemi.com/thread/279197?ContentTypeID=1</link><pubDate>Tue, 10 Nov 2020 11:03:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25b75f0f-71a6-4eee-b022-59fd3e5bed1c</guid><dc:creator>Vimalnath</dc:creator><description>&lt;p&gt;Okay I understood. Can you respond to my requirements which I have mentioned in my recent post?&lt;/p&gt;
[quote userid="94310" url="~/f/nordic-q-a/68084/how-to-get-ble-scan-result/279188#279188"] My requirement is that my scanner(BLE) should scan all the nearby devices and get the scan response data, advertisement data, mac addr and device name so that I can manually filter them.[/quote]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get BLE scan result</title><link>https://devzone.nordicsemi.com/thread/279193?ContentTypeID=1</link><pubDate>Tue, 10 Nov 2020 10:43:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f7f5923-0c39-4f40-bf4a-29f4d2bdaf3f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is no way you can control this specifically. The nRF will send a scan request when possible if configured to do so, but this is by nature a bit random, so you may get many scan responses from one device before you receive one from the other (depending on advertising intervals, signal strenght, time on the nRF side etc.). Given enough time you should be able to get a scan response from all active advertisers within range, though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get BLE scan result</title><link>https://devzone.nordicsemi.com/thread/279188?ContentTypeID=1</link><pubDate>Tue, 10 Nov 2020 10:38:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a567e9b-709b-4b70-b989-e0151219735f</guid><dc:creator>Vimalnath</dc:creator><description>&lt;p&gt;I have added the&amp;nbsp;&lt;span&gt;BLE_GAP_EVT_ADV_REPORT&amp;nbsp;case in ble event. I am able to get the sr_data(scan response data) if I make the&amp;nbsp;m_scan_param.active&amp;nbsp; = 1; but the device is not scanning all the BLE devices.(Note: all my BLE devices have scan response data). It scan&amp;#39;s one device multiple times and the other device occasionally. My requirement is that my scanner(BLE) should scan all the nearby devices and get the scan response data, advertisement data, mac addr and device name so that I can manually filter them.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get BLE scan result</title><link>https://devzone.nordicsemi.com/thread/279043?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2020 14:22:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6368a489-2707-4058-b329-e23c8742db9c</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you added any filter with&amp;nbsp;nrf_ble_scan_filters_enable() and&amp;nbsp;nrf_ble_scan_filter_set() (see for instance &amp;lt;nRF5 SDK&amp;gt;\examples\ble_central\ble_app_hrs_c\main.c)? If so you would get a&amp;nbsp;NRF_BLE_SCAN_EVT_FILTER_MATCH event when the filter matched. I not and you want to get all advertising packets you could handle the&amp;nbsp;BLE_GAP_EVT_ADV_REPORT event. You will get a pointer to a&amp;nbsp;ble_gap_evt_adv_report_t with that event, giving you all the information from the advertising packet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>