<?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>Send Data to sensor after ble disconnected</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51045/send-data-to-sensor-after-ble-disconnected</link><description>Hi nordic community 
 I am trying to send stop command to my device(which is connected to my NRF 52840) from my ble module(NRF 52480) after my android disconnected from the ble module. so i put the stop command function in the BLE_GAP_EVT_DISCONNECTED</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 Aug 2019 07:13:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51045/send-data-to-sensor-after-ble-disconnected" /><item><title>RE: Send Data to sensor after ble disconnected</title><link>https://devzone.nordicsemi.com/thread/204645?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2019 07:13:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11997919-26fd-4379-9971-ba2a0cfd3842</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi Nahom,&lt;/p&gt;
&lt;p&gt;Just to be sure that I understand you correctly: the module should send a stop signal to device to stop sending messages when the android device disconnects from the module. But the problem is that it keeps sending messages to the module after the android device has disconnected.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The first step is to step through the code using the &lt;a href="https://www.youtube.com/watch?v=uP8RYgYGRvI"&gt;debugger&lt;/a&gt; and verify that&amp;nbsp;&lt;span&gt;stop_command_init() is called once the Android&amp;nbsp;device disconnects (i.e BLE_GAP_EVT_DISCONNECTED event is generated).&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;The next step is to check that the module sends the stop signal over the SPI data line. You can do this by either using a logical analyzer or oscilloscope.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If issue persists, then the problem is probably at your device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send Data to sensor after ble disconnected</title><link>https://devzone.nordicsemi.com/thread/204543?ContentTypeID=1</link><pubDate>Fri, 16 Aug 2019 14:20:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfa1d229-3c36-4aac-901b-30616680507a</guid><dc:creator>Nahom</dc:creator><description>&lt;p&gt;sorry about data_init() it is writing mistake it is suppose to be&amp;nbsp;&lt;span&gt;stop_command_init(). Everything is working fine when the ble connected&amp;nbsp;my ble model&amp;nbsp;start sending command to my device and my device send the response&amp;nbsp;data to the ble model&amp;nbsp;then from ble module to my android. but when i get disconnected my android from the ble model, my device keep sending data to the ble model&amp;nbsp;unless i send stop command from the ble model&amp;nbsp;to it. so i decided to send the stop command after the ble model is disconnected from the android. but nothing is happen even no error. I think the SPI communication with the device is depend on the ble event that&amp;nbsp;why when disconnect&amp;nbsp;event happen all the communication is stop. am I correct?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send Data to sensor after ble disconnected</title><link>https://devzone.nordicsemi.com/thread/204420?ContentTypeID=1</link><pubDate>Fri, 16 Aug 2019 08:42:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4dea5f19-7a81-428b-8512-2f877781bb2f</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi Nahom,&lt;/p&gt;
&lt;p&gt;I would need more information regarding your application, it&amp;#39;s not obvious from the code that you&amp;#39;ve shared where data_init() is called but i presume that it&amp;#39;s called in stop_command_init()?&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Are you getting any log output on the terminal at all? Does the printf line in the ble event handler successfully print? &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/uart_example.html?cp=5_1_4_6_48_0#uart_example_testing"&gt;Have you configured the terminal correctly&lt;/a&gt;&lt;span&gt;? What backend are you using for the logger module?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Have you tried stepping through the code with the debugger and see if the program asserts? If it does, what error code is returned?&lt;/li&gt;
&lt;li&gt;Can you see any activity on the UART lines that are connected to your device?&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>