<?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 the scan response datafor the center?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38260/how-to-get-the-scan-response-datafor-the-center</link><description>Hi, 
 I&amp;#39;m using the S132 v6.0 and SDK v15.0 to work with nRF52832. I found the it just get the advertising data. If the device put some data into the scan response, when I use 52832 to scan, how to get the scan response data? Thanks.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 19 Sep 2018 08:47:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38260/how-to-get-the-scan-response-datafor-the-center" /><item><title>RE: How to get the scan response datafor the center?</title><link>https://devzone.nordicsemi.com/thread/149364?ContentTypeID=1</link><pubDate>Wed, 19 Sep 2018 08:47:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:509eb126-9391-4ac9-8ff1-4304f2d13639</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;S132 version 6.0 and version 6.1 should behave the same in this regard, and both work as they should on my desk. I have updated&amp;nbsp;my previous post to print data and included example projects for both SDK 15.0.0 and SDK 15.2.0 so that you can test both.&lt;/p&gt;
&lt;p&gt;Note that a BLE peripheral will typically reply with an empty scan response if no scan response has been configured. So empty scan responses are expected (though not from a peripheral you know has scan response data). Perhaps you could log the BLE address of the advertiser to verify whether the empty scan responses come from your peripheral (where there should be scan response data) or not? You could for example&amp;nbsp;do something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;            NRF_LOG_INFO(&amp;quot;Peer addr: %02x:%02x:%02x:%02x:%02x:%02x.&amp;quot;,
                         p_adv_report-&amp;gt;peer_addr.addr[5],
                         p_adv_report-&amp;gt;peer_addr.addr[4],
                         p_adv_report-&amp;gt;peer_addr.addr[3],
                         p_adv_report-&amp;gt;peer_addr.addr[2],
                         p_adv_report-&amp;gt;peer_addr.addr[1],
                         p_adv_report-&amp;gt;peer_addr.addr[0]);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the scan response datafor the center?</title><link>https://devzone.nordicsemi.com/thread/149202?ContentTypeID=1</link><pubDate>Tue, 18 Sep 2018 11:27:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a878f6f-aead-4d37-81c2-16054fd17da1</guid><dc:creator>Alice</dc:creator><description>&lt;p&gt;I use the scanner to work on sdk15.2 and S132v6.1,&amp;nbsp; I could get the scan response data. However, I if I use the same way to make the scanner to work on sdk 15.0 and S132v6.0,then scan the same&amp;nbsp;&lt;span&gt;advertiser, I could see that the bit scan_response of ble_gap_adv_report_type_t is 1, but I just get the&amp;nbsp;&amp;nbsp;advertising data, I couldn&amp;#39;t get the&amp;nbsp;scan_response data.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is there any problem with s132v6.0? Could you help me have a try? Thanks&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the scan response datafor the center?</title><link>https://devzone.nordicsemi.com/thread/149047?ContentTypeID=1</link><pubDate>Mon, 17 Sep 2018 13:02:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7617726-3769-4088-968c-1ef28ddf6ece</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I don&amp;#39;t see any problems with your code, neither the scanner nor the advertiser.&lt;/p&gt;
&lt;p&gt;For reference (and if you would like to test with a known working example), I stripped down a central project to only do active scanning and logging whether an advertisement packet or scan response packet was received. The two relevant functions are here:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void scan_start(void)
{
    ret_code_t ret;

    m_scan_param.active         = 1;
    m_scan_param.interval       = SCAN_INTERVAL;
    m_scan_param.window         = SCAN_WINDOW;
    m_scan_param.timeout        = SCAN_DURATION;
    m_scan_param.scan_phys      = BLE_GAP_PHY_1MBPS;
    m_scan_param.filter_policy  = BLE_GAP_SCAN_FP_ACCEPT_ALL;

    ret = sd_ble_gap_scan_start(&amp;amp;m_scan_param, &amp;amp;m_scan_buffer);
    APP_ERROR_CHECK(ret);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
{
    ret_code_t            err_code;
    ble_gap_evt_adv_report_t const * p_adv_report = &amp;amp;p_ble_evt-&amp;gt;evt.gap_evt.params.adv_report;

    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
        case BLE_GAP_EVT_ADV_REPORT:

            if (p_adv_report-&amp;gt;type.scan_response)
            {
                if (p_adv_report-&amp;gt;data.len &amp;gt; 0)
                {
                    NRF_LOG_INFO(&amp;quot;Scan response received:&amp;quot;);
                    NRF_LOG_RAW_HEXDUMP_INFO(p_adv_report-&amp;gt;data.p_data, p_adv_report-&amp;gt;data.len);
                }
                else
                {
                    NRF_LOG_INFO(&amp;quot;Empty scan response received.&amp;quot;);
                }
            }
            else
            {
                NRF_LOG_INFO(&amp;quot;Advertising packet received:&amp;quot;);
                NRF_LOG_RAW_HEXDUMP_INFO(p_adv_report-&amp;gt;data.p_data, p_adv_report-&amp;gt;data.len);
            }

            // Continue scanning.
            sd_ble_gap_scan_start(NULL, &amp;amp;m_scan_buffer);
            break;
        default:
            break;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here are full projects for SDK 15.0 (&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-790908f48b264c6e971c7ac5bfb48dbc/ble_5F00_active_5F00_scanner_5F00_sdk_5F00_15.0.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_active_5F00_scanner_5F00_sdk_5F00_15.0.zip&lt;/a&gt;) and SDK 15.2 (&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_active_5F00_scanner_5F00_sdk_5F005F00_15.2.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_active_5F00_scanner_5F00_sdk_5F005F00_15.2.zip&lt;/a&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the scan response datafor the center?</title><link>https://devzone.nordicsemi.com/thread/148985?ContentTypeID=1</link><pubDate>Mon, 17 Sep 2018 09:56:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2cb9356d-3fb8-47d6-9777-04d641f74804</guid><dc:creator>Alice</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6087.code.txt"&gt;devzone.nordicsemi.com/.../6087.code.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is the code for the&amp;nbsp;&lt;span&gt;ble_advertising_init and the scan report.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the scan response datafor the center?</title><link>https://devzone.nordicsemi.com/thread/148966?ContentTypeID=1</link><pubDate>Mon, 17 Sep 2018 09:11:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c411304-931f-4646-bfa7-ba117fe69ff5</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;You should not have to do anything more. Can you upload the code for your advertiser and scanner?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the scan response datafor the center?</title><link>https://devzone.nordicsemi.com/thread/148932?ContentTypeID=1</link><pubDate>Mon, 17 Sep 2018 08:01:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:043ab6c9-6980-4cae-912c-4ddcb9c0e981</guid><dc:creator>Alice</dc:creator><description>&lt;p&gt;Yes, I&amp;#39;m sure about it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the scan response datafor the center?</title><link>https://devzone.nordicsemi.com/thread/148601?ContentTypeID=1</link><pubDate>Thu, 13 Sep 2018 11:46:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5050ff35-817f-4a5b-ae0c-86b602fbaf76</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;That&amp;#39;s strange. Have you made sure to configure the peripheral so that it has scan response data (essentially just populate&amp;nbsp;ble_advertising_init_t::srdata)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the scan response datafor the center?</title><link>https://devzone.nordicsemi.com/thread/148538?ContentTypeID=1</link><pubDate>Thu, 13 Sep 2018 08:14:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a6866b5-c2a6-4893-b7b5-f1c1083786b3</guid><dc:creator>Alice</dc:creator><description>&lt;p&gt;Does S132v6.0 could do it? I have set&lt;span&gt;&amp;nbsp;the&amp;nbsp;active field of the&amp;nbsp;ble_gap_scan_params_t instance to 1, but I couldn&amp;#39;t get the scan response data. The bit scan_response of ble_gap_adv_report_type_t is always 0.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the scan response datafor the center?</title><link>https://devzone.nordicsemi.com/thread/147730?ContentTypeID=1</link><pubDate>Fri, 07 Sep 2018 08:36:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4f26755-cc76-4690-bb22-80414082eb68</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You have to do active scanning in order to get the scan response. To do that, simply set the&amp;nbsp;active field of the&amp;nbsp;ble_gap_scan_params_t instance to 1 before you pass it in the call to&amp;nbsp;sd_ble_gap_scan_start(). Then you will get the scan response data in a&amp;nbsp;&lt;span&gt;BLE_GAP_EVT_ADV_REPORT event in the same way as you get normal advertising data. You can see which type it is by checking the&amp;nbsp;type field in the&amp;nbsp;ble_gap_evt_adv_report_t.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>