<?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>Changing Advertisement and connection intervals at run time? NCS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83985/changing-advertisement-and-connection-intervals-at-run-time-ncs</link><description>Hi all, 
 I have an BLE application where i wish to measure the devices power consumption. I am trying to measure the affect of changing the connection interval, MTU size and advertisement interval. I&amp;#39;d like to connect with default parameters, then once</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Jan 2022 17:17:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83985/changing-advertisement-and-connection-intervals-at-run-time-ncs" /><item><title>RE: Changing Advertisement and connection intervals at run time? NCS</title><link>https://devzone.nordicsemi.com/thread/349625?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 17:17:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48e36f55-e71a-48e1-a6ef-1eca200fe0f3</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;After the connection is established, you could start the legacy advertiser again with default parameters by setting BT_ADV_PERSIST. The default connection parameters are defined in compile time and the behavior can be changed in host which is available as open source.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing Advertisement and connection intervals at run time? NCS</title><link>https://devzone.nordicsemi.com/thread/349474?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 09:47:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55c777c2-61ce-4d6b-aec1-75eb80718e98</guid><dc:creator>cosmotic_instant</dc:creator><description>&lt;p&gt;Thank you for the response.&lt;/p&gt;
&lt;p&gt;I forgot to mention that my device is a peripheral device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Using Zephyr, bt_le_adv_resume() gets called in the Bluetooth&amp;nbsp;stack as opposed to something that i can call. That&amp;#39;s my problem here. Is how do i tap in to the stack to change these values. When the controller disconnects from my peripheral,&amp;nbsp;bt_le_adv_resume() is called. I want to change the values it reads in t o set up the advertising. The only place i have seen user callable code from adv.c in any example is adv.c. If advertising is already occurring&amp;nbsp;maybe i can call stop, and start again, but it seems a shame to when&amp;nbsp;bt_le_adv_resume() gets called when the disconnection&amp;nbsp;occurs. Seems rather hacky to the immediately call Stop and start functions. I assume it&amp;#39;s resuming from already having been stopped (i cannot find the code when adv_stop is called when a connection occurs), so i should be able to change the values the adv.c resume function reads before restarting the advertisement, but i don&amp;#39;t know how to access them...&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing Advertisement and connection intervals at run time? NCS</title><link>https://devzone.nordicsemi.com/thread/349345?ContentTypeID=1</link><pubDate>Mon, 24 Jan 2022 16:09:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71c5cd71-1d30-4d9f-b4c7-60556b65e2ab</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&amp;nbsp;&lt;br /&gt;If you want to update connection parameters of the current connection please look at&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/bluetooth/connection_mgmt.html#c.bt_conn_le_param_update"&gt;bt_conn_le_param_update&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/bluetooth/connection_mgmt.html#c.bt_conn_le_data_len_update"&gt;bt_conn_le_data_len_update&lt;/a&gt;. In case you want to update parameters after connection is terminated, your application should have a decision on the parameters, disconnect, and create new connection with desired parameters with&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/bluetooth/connection_mgmt.html#c.bt_conn_le_create"&gt;bt_conn_le_create&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In addition to bt_le_adv_start() and bt_le_adv_resume(), you can also find bt_le_adv_stop() in adv.c file. bt_le_adv_stop() is also present in bt_rpc_gap_client.c.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>