<?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>Turn off relay mode / friend mode in runtime?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110977/turn-off-relay-mode-friend-mode-in-runtime</link><description>Hello, 
 I have a project with a node that on battery is an LPN node and on USB power the node is a relay &amp;amp; friend node. 
 As a result, I will need to switch between them in run-time, how would I go about this? 
 I am able to set LPN state using 
 
 How</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 May 2024 15:54:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110977/turn-off-relay-mode-friend-mode-in-runtime" /><item><title>RE: Turn off relay mode / friend mode in runtime?</title><link>https://devzone.nordicsemi.com/thread/482580?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 15:54:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c53f12f9-4d16-4787-8bc0-71001b550d6e</guid><dc:creator>Shahin97</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/elfving"&gt;Elfving&lt;/a&gt;&amp;nbsp;Perfect explanation, quick response too!, I will add this into my project and let you know if I have further questions&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turn off relay mode / friend mode in runtime?</title><link>https://devzone.nordicsemi.com/thread/482514?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 12:17:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d794ed7-b571-417f-9ab2-508482cf06cc</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;code&gt;bt_mesh_lpn_set()&lt;/code&gt; and &lt;code&gt;bt_mesh_friend_set()&lt;/code&gt; are the correct ways to change the LPN and Friend features at runtime. When the LPN state is enabled, the node will send a friend request (granted it is provisioned) with possible &lt;a title="https://github.com/zephyrproject-rtos/zephyr/blob/32b69f53aa3af9a6efd366ac9dc0b1775609154d/subsys/bluetooth/mesh/lpn.c#l80-l82" href="https://github.com/zephyrproject-rtos/zephyr/blob/32b69f53aa3af9a6efd366ac9dc0b1775609154d/subsys/bluetooth/mesh/lpn.c#L80-L82" rel="noopener noreferrer" target="_blank"&gt;criterias for determining which friend node it may choose&lt;/a&gt;. Capable friend nodes in range will respond with a friend offer, and the LPN will attempt to poll the friend once friendship is established. If no friendships were established, the LPN node will retry sending a friend request after a &lt;a title="https://github.com/zephyrproject-rtos/zephyr/blob/32b69f53aa3af9a6efd366ac9dc0b1775609154d/subsys/bluetooth/mesh/lpn.c#l56" href="https://github.com/zephyrproject-rtos/zephyr/blob/32b69f53aa3af9a6efd366ac9dc0b1775609154d/subsys/bluetooth/mesh/lpn.c#L56" rel="noopener noreferrer" target="_blank"&gt;specified time&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When the LPN feature is disabled, all friendships will be cleared. Similarly, disabling the friend feature terminates any active friendships.&lt;/p&gt;
&lt;p&gt;For relays, enabling &lt;code&gt;CONFIG_BT_MESH_RELAY_ENABLED&lt;/code&gt; causes the relay feature to be enabled on (re)boot. You can freely change the state of the relay feature and retransmit parameters during runtime using &lt;code&gt;bt_mesh_relay_set()&lt;/code&gt;. (You can do this independent of whether it is enabled by default)&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>