<?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>Central and a custom peripheral device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21233/central-and-a-custom-peripheral-device</link><description>Hi, 
 Can the central device ( ble_app_hrs_c for example) scan for and connect to a custom peripheral device (not nRF based)?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 20 Apr 2017 10:46:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21233/central-and-a-custom-peripheral-device" /><item><title>RE: Central and a custom peripheral device</title><link>https://devzone.nordicsemi.com/thread/83074?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2017 10:46:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d49a866a-9a6a-475c-86f5-a46f577f0530</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Great. Can you then mark the right answer and close the question?:)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central and a custom peripheral device</title><link>https://devzone.nordicsemi.com/thread/83076?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2017 08:53:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a5bc06c-78a4-43c1-b3a8-b7f60c7e393d</guid><dc:creator>Matija Tudan</dc:creator><description>&lt;p&gt;@endnode thanks for the info. I found it really easy to scan for a custom peripheral device with the &lt;code&gt;ble_app_hrs_c&lt;/code&gt; example. Just disable the whitelist and enable active scanning mode in the &lt;code&gt;scan_start()&lt;/code&gt; function:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;m_scan_param.active   = 1;
m_scan_param.use_whitelist  = 0;
m_whitelist_disabled = true;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central and a custom peripheral device</title><link>https://devzone.nordicsemi.com/thread/83067?ContentTypeID=1</link><pubDate>Mon, 10 Apr 2017 14:36:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eae55cb4-5cc4-44ae-ae42-d3b60aee6841</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;@mtudan btw.I cannot compile &lt;code&gt;ble_central\ble_app_hrs_c&lt;/code&gt; from nRF5 SDK v13.0.0 because code size exceeds limit in Keil for free/evaluation license but I took &lt;code&gt;ble_central\ble_app_uart_c&lt;/code&gt; project and by adding following code to line #422 of &lt;code&gt;main.c&lt;/code&gt; (right after &lt;code&gt;case BLE_GAP_EVT_ADV_REPORT: {&lt;/code&gt; ) I can now observe load of adv. reports captured in the console.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    printf(&amp;quot;on_ble_evt(BLE_GAP_EVT_ADV_REPORT):\r\n&amp;quot;);
    if (p_gap_evt-&amp;gt;params.adv_report.dlen &amp;gt; 0) {
        printf(&amp;quot;[0x%02X&amp;quot;, p_gap_evt-&amp;gt;params.adv_report.data[0]);
    }
    for(uint32_t index = 1; index &amp;lt; p_gap_evt-&amp;gt;params.adv_report.dlen; index++) {
        printf(&amp;quot;:0x%02X&amp;quot;, p_gap_evt-&amp;gt;params.adv_report.data[index]);
    }
    if (p_gap_evt-&amp;gt;params.adv_report.dlen &amp;gt; 0) {
        printf(&amp;quot;]\r\n&amp;quot;);
    }
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central and a custom peripheral device</title><link>https://devzone.nordicsemi.com/thread/83075?ContentTypeID=1</link><pubDate>Mon, 10 Apr 2017 12:10:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1039ad7b-fbd9-4bde-8140-3deea125703b</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Reflashing only the central application wouldn&amp;#39;t remove the bonds that have the information used in the whitelist. You need to either erase the complete flash, or hold Button 2 on the nRF5x DK on reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central and a custom peripheral device</title><link>https://devzone.nordicsemi.com/thread/83073?ContentTypeID=1</link><pubDate>Sun, 09 Apr 2017 08:45:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3be6377d-7721-4b7e-8d9d-a42a046c07d7</guid><dc:creator>Matija Tudan</dc:creator><description>&lt;p&gt;The FW on a peripheral device doesn&amp;#39;t have to be the heart rate example, any other peripheral example will do the same thing.
Yes, I&amp;#39;ve added &lt;code&gt;NRF_LOG_xxx&lt;/code&gt; inside of the &lt;code&gt;case BLE_GAP_EVT_ADV_REPORT:&lt;/code&gt;, at the beginning of the &lt;code&gt;on_ble_evt()&lt;/code&gt; function and inside of the &lt;code&gt;ble_evt_dispatch()&lt;/code&gt; function. I see this logs only when the nRF peripheral device is turned on (with any of the peripheral examples), so I assume it has to be something with the SoftDevice?
Re-flashing the central FW didn&amp;#39;t help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central and a custom peripheral device</title><link>https://devzone.nordicsemi.com/thread/83072?ContentTypeID=1</link><pubDate>Sat, 08 Apr 2017 20:26:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72b898f6-3d91-4a30-9648-4738384a8e80</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;This example has pretty complex functionality as it bonds with the peer and establishes security (from what I see). Isn&amp;#39;t it so that you&amp;#39;ve connected these two boards/FWs together once and then scanner/central looks for its peer only? I see there is whitelist used at some point which would explain that it sees only particular peer (running sensor example). If you re-flash the board, do you see different adv. reports? Have you added some &lt;code&gt;NRF_LOG_xxx&lt;/code&gt; right after &lt;code&gt;case BLE_GAP_EVT_ADV_REPORT:&lt;/code&gt; ? Because if not then you won&amp;#39;t see all reports on UART, there are logging functions only for these which matches one of conditions (specific hardcoded Adv. address, Device Name or Service UUID in Adv. data...)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central and a custom peripheral device</title><link>https://devzone.nordicsemi.com/thread/83071?ContentTypeID=1</link><pubDate>Sat, 08 Apr 2017 20:08:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5dae5bca-b41f-466d-84b0-b30404b69086</guid><dc:creator>Matija Tudan</dc:creator><description>&lt;p&gt;Well that&amp;#39;s not how the central works in my case. The &lt;code&gt;BLE_GAP_EVT_ADV_REPORT&lt;/code&gt; event happens only when I turn on the nRF peripheral device with the &lt;code&gt;ble_app_hrs&lt;/code&gt; example (or any other peripheral example). With any other BLE peripheral device, even with the matching advertising name, address or UUID, the &lt;code&gt;ble_evt_dispatch()&lt;/code&gt; function never gets called...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central and a custom peripheral device</title><link>https://devzone.nordicsemi.com/thread/83070?ContentTypeID=1</link><pubDate>Sat, 08 Apr 2017 12:31:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca7588a2-c592-47f3-814b-a5f71129202b</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;No, it is called by your BLE stack (Nordic Soft Device) when any relevant event happens. There is no way to find out if adv. device is running from Nordic chip or not (you can put some string into data and claim it as proof but I can take any other BLE chip and fake it, in general no way to tell the difference).&lt;/p&gt;
&lt;p&gt;To &lt;code&gt;ble_app_hrs_c&lt;/code&gt; example: what I see in nRF SDK v13.0.0 is that once it starts scanning it gets &lt;code&gt;BLE_GAP_EVT_ADV_REPORT&lt;/code&gt; and there it looks for any device which has either specific Adv. address or Device Name AD object in the data or Service UUID in the data. So as long as your peripheral meets one of these criteria &lt;code&gt;ble_app_hrs_c&lt;/code&gt; example should find it and connect to it. And if you enable logging on that event you will see Adv. reports from ANY BLE peripheral in the range (again regardless if it is Nordic example running on Nordic chip or anything else...)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central and a custom peripheral device</title><link>https://devzone.nordicsemi.com/thread/83069?ContentTypeID=1</link><pubDate>Sat, 08 Apr 2017 12:21:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67ab75db-a591-42b0-9ca0-06dadeb2cb14</guid><dc:creator>Matija Tudan</dc:creator><description>&lt;p&gt;How to achieve that? Because the &lt;code&gt;ble_evt_dispatch()&lt;/code&gt; function gets called only with the nRF based peripheral.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central and a custom peripheral device</title><link>https://devzone.nordicsemi.com/thread/83068?ContentTypeID=1</link><pubDate>Sat, 08 Apr 2017 12:09:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03f7c557-c685-4304-8734-9d9254774ec5</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Sure it can.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>