<?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>Long Range Mode Issue(Nrf52840)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51560/long-range-mode-issue-nrf52840</link><description>Hi, 
 
 We have a bluetooth product which uses Nrf52840 as the MCU. It composes of a peripheral and a central device of which connect with each other via bluetooth and they work perfect so far. 
 When power on, the central start scanning whereas the peripheral</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 Sep 2019 02:29:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51560/long-range-mode-issue-nrf52840" /><item><title>RE: Long Range Mode Issue(Nrf52840)</title><link>https://devzone.nordicsemi.com/thread/211085?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 02:29:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72168a99-ae07-412d-b83d-23c639f0164b</guid><dc:creator>BK</dc:creator><description>&lt;p&gt;Thanks, Edvin, that really helps!&amp;nbsp; :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Long Range Mode Issue(Nrf52840)</title><link>https://devzone.nordicsemi.com/thread/206882?ContentTypeID=1</link><pubDate>Thu, 29 Aug 2019 13:03:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47aac1a3-dcb5-4ab1-8472-d3f776989cf4</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Check out ble_gap.h line 2467 - 2479. There it says that if sd_ble_gap_scan_start() returns NRF_ERROR_INVALID_LENGTH:&lt;/p&gt;
&lt;p&gt;* @retval ::NRF_ERROR_INVALID_LENGTH The provided buffer length is invalid. See @ref BLE_GAP_SCAN_BUFFER_MIN.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;A search for BLE_GAP_SCAN_BUFFER_MIN points to line 347 in ble_gap.h line 347. Line 341-346 says:&lt;/p&gt;
&lt;p&gt;/**@defgroup BLE_GAP_SCAN_BUFFER_SIZE GAP Minimum scanner buffer size&lt;br /&gt; *&lt;br /&gt; * Scan buffers are used for storing advertising data received from an advertiser.&lt;br /&gt; * If ble_gap_scan_params_t::extended is set to 0, @ref BLE_GAP_SCAN_BUFFER_MIN is the minimum scan buffer length.&lt;br /&gt; * else the minimum scan buffer size is @ref BLE_GAP_SCAN_BUFFER_EXTENDED_MIN.&lt;br /&gt; * @{ */&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So it looks like your scan buffer is to short. The scan buffer is set in: main.c:&lt;/p&gt;
&lt;p&gt;NRF_BLE_SCAN_DEF(m_scan);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/**&amp;lt; Scanning Module instance. */&lt;/p&gt;
&lt;p&gt;A macro that declares&amp;nbsp;nrf_ble_scan_t m_scan in nrf_ble_scan.h.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In nrf_ble_scan.h you can also see that the scan_buffer_data, the buffer where the scanned advertisements are stored is set with a length of&amp;nbsp;NRF_BLE_SCAN_BUFFER, which is probably defined to 31 in your sdk_config.h.&lt;/p&gt;
&lt;p&gt;Try to increase this to BLE_GAP_SCAN_BUFFER_EXTENDED_MIN, or 255.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you increase the NRF_BLE_SCAN_BUFFER in sdk_config.h from 31 to 255, does sd_ble_gap_scan_start() still return NRF_ERROR_INVALID_LENGTH?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>