<?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>BLE callback when mesh protocol is used</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97828/ble-callback-when-mesh-protocol-is-used</link><description>Hello, 
 Currently, I&amp;#39;m working on a mesh application based on a light sample. and I have two questions 
 1- is it possible to implement ble callback in the application to catch when Ble device is connected/disconnected with a device for example a smartphone</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 17 Mar 2023 22:45:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97828/ble-callback-when-mesh-protocol-is-used" /><item><title>RE: BLE callback when mesh protocol is used</title><link>https://devzone.nordicsemi.com/thread/416127?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2023 22:45:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27f575de-2f62-4f8e-9d0c-db78e88e0793</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Mustafa,&lt;/p&gt;
[quote user=""]1- is it possible to implement ble callback in the application to catch when Ble device is connected/disconnected with a device&amp;nbsp;for example a smartphone?&amp;nbsp;[/quote]
&lt;p&gt;Yes.&amp;nbsp;You can refer to &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/nrf/samples/bluetooth/mesh/ble_peripheral_lbs_coex/README.html"&gt;the Mesh and (BLE) Peripheral Coexistence sample&lt;/a&gt;. Look for &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.3.0/samples/bluetooth/mesh/ble_peripheral_lbs_coex/src/lb_service_handler.c#L45-L63"&gt;how the connected() function is registered as a callback in lb_service_handler.c&lt;/a&gt;.&lt;/p&gt;
[quote user=""]2- if I want to use the benefit of a mesh network ( re-transmit messages between nodes until they reach their destination) do I need to enable the relay feature?[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you need &amp;quot;retransmit messages between nodes until they reach their destination&amp;quot; then yes you need the relay feature. However,&amp;nbsp;&lt;/p&gt;
[quote user=""]in&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case the&amp;nbsp;relay&amp;nbsp;feature is enabled in lpn node[/quote]
&lt;p&gt;The relay feature&amp;nbsp;don&amp;#39;t work on Low-Power Nodes (LPNs).&amp;nbsp;LPNs achieve low-power by going to sleep, only wake up some times and rely on Friend Nodes to tell them what they miss while they were sleeping. When they sleep, they cannot relay any messages. If they don&amp;#39;t sleep,&amp;nbsp;I guess they can still perform the Low-Power Node features, but for no benefit.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;I have an inkling that you may be expecting the Bluetooth Mesh can relay normal BLE traffic. Could this be the case? If so, please know that Bluetooth Mesh cannot do that.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>