<?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>Stopping DM Service While Keeping BLE Active on nRF5340</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/124739/stopping-dm-service-while-keeping-ble-active-on-nrf5340</link><description>Hello Nordic Support Team, 
 I’m working with an nRF5340 on nRF Connect SDK 3.0.2 , using both the Distance Measurement (DM) service and BLE DFU. 
 My application topology consists of Anchors and Tags . On the Tag side, I only use advertising. 
 After</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Oct 2025 12:46:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/124739/stopping-dm-service-while-keeping-ble-active-on-nrf5340" /><item><title>RE: Stopping DM Service While Keeping BLE Active on nRF5340</title><link>https://devzone.nordicsemi.com/thread/550486?ContentTypeID=1</link><pubDate>Thu, 02 Oct 2025 12:46:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b99ec753-05fd-4aad-b264-14bfd4a6eec2</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The DM sample is a bit finicky. It doesn&amp;#39;t do regular BLE connections, but instead a mix of advertising and scanning. When it detects another device advertising with the manufacturer data that is present in the scan response packet (sd), then it will adjust it&amp;#39;s advertising data accordingly, and resume scanning. When two devices detects that they are advertising with matching scan response data, they will initiate the distance measurement procedure.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So for this to work the devices needs to be advertising with the scan response data packet containing the sample&amp;#39;s&amp;nbsp;mfg_data, and it needs to be scanning.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Attached is a sample that by default doesn&amp;#39;t scan, and doesn&amp;#39;t advertise with the mfg_data in the scan response packet. Pressing button 1 will add the scan response packet, and it will trigger the device to start scanning.&lt;/p&gt;
&lt;p&gt;So if you flash this sample to 2x DKs, they will by default not do anything. If you press button 1 on both the devices, they will start doing distance measurements. If you press button 2 on one of the devices, that device will take away the scan response packet, and stop scanning. This results in the distance measurements stopping, and it will only advertise with it&amp;#39;s device name.&lt;/p&gt;
&lt;p&gt;Pressing button 1 again will resume the distance measurements.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nrf_5F00_dm.zip"&gt;devzone.nordicsemi.com/.../nrf_5F00_dm.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Give it a go, and see if this is what you need.&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>