<?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 scan devices based name patterns?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63288/how-to-scan-devices-based-name-patterns</link><description>I have nRF52840 as the central and nRF52832 as the devices. I have the device names as TELCO_456, TELCO_457, TELCO_458 in the connectable advertisement packet. I have disabled auto connect in the central and I want a scan interrupt when these peripheral</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Aug 2020 18:18:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63288/how-to-scan-devices-based-name-patterns" /><item><title>RE: How to scan devices based name patterns?</title><link>https://devzone.nordicsemi.com/thread/266589?ContentTypeID=1</link><pubDate>Wed, 26 Aug 2020 18:18:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11cc77fa-7c07-406a-a9ee-dd0194151ee7</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I am happy you found my solution helpful!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to scan devices based name patterns?</title><link>https://devzone.nordicsemi.com/thread/266527?ContentTypeID=1</link><pubDate>Wed, 26 Aug 2020 13:52:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fae77860-866d-46bb-9b2b-65244fe5e7a1</guid><dc:creator>kmassa5</dc:creator><description>&lt;p&gt;This works and solved my problem, thanks so much Simon!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to scan devices based name patterns?</title><link>https://devzone.nordicsemi.com/thread/258686?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2020 22:42:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c78d6f6d-fda5-4079-b9d2-d1ee8e31f10e</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Could you modify the function &lt;em&gt;nRF5SDK17009d13099\nRF5_SDK_17.0.0_9d13099\components\ble\common\ble_advdata.c--&amp;gt;ble_advdata_name_find(..)&lt;/em&gt; accordingly:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;bool ble_advdata_name_find(uint8_t const * p_encoded_data,
                           uint16_t        data_len,
                           char    const * p_target_name)
{
    uint16_t        parsed_name_len;
    uint8_t const * p_parsed_name;
    uint16_t        data_offset          = 0;

    if (p_target_name == NULL)
    {
        return false;
    }


    parsed_name_len = ble_advdata_search(p_encoded_data,
                                         data_len,
                                         &amp;amp;data_offset,
                                         BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME);

    p_parsed_name = &amp;amp;p_encoded_data[data_offset];

    if (   (data_offset != 0)
        &amp;amp;&amp;amp; (parsed_name_len != 0)
        /*&amp;amp;&amp;amp; (strlen(p_target_name) == parsed_name_len)*/ //Comment out
        /*&amp;amp;&amp;amp; (memcmp(p_target_name, p_parsed_name, parsed_name_len) == 0))*/ //Comment out
        &amp;amp;&amp;amp; (memcmp(p_target_name, p_parsed_name, strlen(p_target_name)) == 0) //Added
    {
        return true;
    }

    return false;
}&lt;/pre&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Then you add the name &amp;quot;TELCO_&amp;quot;&amp;nbsp;&lt;span&gt;using the function&amp;nbsp;&lt;/span&gt;&lt;em&gt;nrf_ble_scan_filter_set()&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I have not tested this, but I think it should work.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to scan devices based name patterns?</title><link>https://devzone.nordicsemi.com/thread/258103?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 12:43:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:974a7f3b-2acc-4ebd-96c4-16e5bb51404d</guid><dc:creator>Jagadeep Ram</dc:creator><description>&lt;p&gt;Obviously it is the latter. I want to get scan interrupt when a device having a name &amp;quot;TELCO_&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to scan devices based name patterns?</title><link>https://devzone.nordicsemi.com/thread/258095?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 12:25:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c211ad8c-2e25-4b5e-b5d0-41ba6b12edf5</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Do you want to add a scan filter for the names &amp;quot;&lt;span&gt;TELCO_456&amp;quot;, &amp;quot;TELCO_457&amp;quot; and &amp;quot;TELCO_458&amp;quot; specifically or do you want to add a scan filter for &amp;quot;TELCO_&amp;lt;anything&amp;gt;&amp;quot;. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If the former is the case, you can achieve this by using the nrf_ble_scan library (&lt;em&gt;nRF5_SDK_16.0.0_98a08e2\components\ble\nrf_ble_scan&lt;/em&gt;) and using the function&amp;nbsp;&lt;/span&gt;&lt;em&gt;nrf_ble_scan_filter_set() &lt;/em&gt;and set&amp;nbsp;NRF_BLE_SCAN_NAME_CNT appropriately in the sdk_config.h file (&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/40186/scanning-module-scan-for-multiple-device-names"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/40186/scanning-module-scan-for-multiple-device-names&lt;/a&gt;). Look at the example&amp;nbsp;&lt;em&gt;nRF5_SDK_16.0.0_98a08e2\examples\ble_central_and_peripheral\experimental\ble_app_multirole_lesc\main.c&amp;nbsp;&lt;/em&gt;for guidance how to do this.&lt;/p&gt;
&lt;p&gt;If the latter is the case, the nrf_ble_scan library probably needs to be modified slightly. Please tell me and I will instruct how to do this.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>