<?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>updating scan parameters</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50868/updating-scan-parameters</link><description>Hey guys. Is there any way we can change scan parameters at runtime. I want to update parameters from another device using uart, and when I tried to make scan interval and scan window a variable, the compiler throws an error saying it is constant and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 01 Feb 2021 07:51:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50868/updating-scan-parameters" /><item><title>RE: updating scan parameters</title><link>https://devzone.nordicsemi.com/thread/292123?ContentTypeID=1</link><pubDate>Mon, 01 Feb 2021 07:51:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f21aae22-7cba-4fc1-8ca6-7d5305cdff64</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Proton"]How do I apply the new ble_gap_scan_params_t and ble_gap_conn_params_t?[/quote]
&lt;p&gt;If you use the scan module (nrf_ble_scan) then you need to pass the scan parameters to&amp;nbsp;nrf_ble_scan_params_set() in order to update them (originally they are supplied with the call to&amp;nbsp;nrf_ble_scan_init(). There is no api to update the connection parameters when using the scan module, though. You could modify the scan module to also set the connection parameters again when you call&amp;nbsp;nrf_ble_scan_params_set() by adding it to the parameter list. Alternatively, as a less intrusive approach, you could write to the&amp;nbsp;nrf_ble_scan_t instance directly, copying your updated connection parameters to&amp;nbsp;nrf_ble_scan_t::conn_params.&lt;/p&gt;
[quote user="Proton"]What structure is PM_RA_PROTECTION_MIN_WAIT_INTERVAL in?[/quote]
&lt;p&gt;It is a sdk_config.h configuration define for the peer manager module that specifies the minimum time before a new pairing attempt can be initiated after a failed attempt (and this is doubled every time on subsequent failures).&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: updating scan parameters</title><link>https://devzone.nordicsemi.com/thread/291796?ContentTypeID=1</link><pubDate>Thu, 28 Jan 2021 13:11:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e91da932-50de-4872-9620-9a6f88146a63</guid><dc:creator>Proton</dc:creator><description>&lt;p&gt;Hey! The question is relevant for me as well.&lt;br /&gt;How do I apply the new ble_gap_scan_params_t and ble_gap_conn_params_t?&lt;br /&gt;&lt;br /&gt;What structure is PM_RA_PROTECTION_MIN_WAIT_INTERVAL in?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: updating scan parameters</title><link>https://devzone.nordicsemi.com/thread/203437?ContentTypeID=1</link><pubDate>Sun, 11 Aug 2019 01:43:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a53ed222-69e9-47a4-815a-3e10550de86b</guid><dc:creator>BinderT</dc:creator><description>&lt;p&gt;remove static from:&lt;br /&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ble_gap_scan_params_t m_scan_param =
	{
		.active        = 0x01,
		.interval      = SCAN_INTERVAL,
		.window        = SCAN_WINDOW,
		.filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL,
		.timeout       = SCAN_DURATION,
		.scan_phys     = BLE_GAP_PHY_1MBPS,
		.extended      = false,
	};
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static ble_gap_scan_params_t m_scan_param =
	{
		.active        = 0x01,
		.interval      = SCAN_INTERVAL,
		.window        = SCAN_WINDOW,
		.filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL,
		.timeout       = SCAN_DURATION,
		.scan_phys     = BLE_GAP_PHY_1MBPS,
		.extended      = false,
	};
m_scan_param.interval = var;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>