<?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>What is the proper way to stop Ant-FS?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11167/what-is-the-proper-way-to-stop-ant-fs</link><description>I have an application using N5150 SOC with S210 softdevice and using softdevice_handler, SDK 10.0.0.0, and I&amp;#39;m using Ant-FS to gather data from this device. I only want to do this at specific times so I need to shut down Ant-FS &amp;gt;99% of the time. 
 It</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Jan 2016 14:58:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11167/what-is-the-proper-way-to-stop-ant-fs" /><item><title>RE: What is the proper way to stop Ant-FS?</title><link>https://devzone.nordicsemi.com/thread/41835?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2016 14:58:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88a0fbf6-427c-40d8-aa29-359d822bcb36</guid><dc:creator>TomWS</dc:creator><description>&lt;p&gt;One additional piece of information, I had to add a function to antfs.c:&lt;/p&gt;
&lt;p&gt;void antfs_stop(void)       // TWS, added to provide clean up on stop
{
state_machine_reset();
}&lt;/p&gt;
&lt;p&gt;because the timer used by antfs was still running if I called antfs soon after shutting it down and antfs would fail in antfs_init() on the app_timer_create() call.&lt;/p&gt;
&lt;p&gt;Tom&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the proper way to stop Ant-FS?</title><link>https://devzone.nordicsemi.com/thread/41834?ContentTypeID=1</link><pubDate>Fri, 08 Jan 2016 14:12:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a1e414b-8d3c-4f1a-8ff7-93858baf7937</guid><dc:creator>TomWS</dc:creator><description>&lt;p&gt;Thank you, Petter.  I do call antfs_init() and antfs_channel_setup() as well as setting m_pairing_state=PAIRING_OFF every time I start up ant-fs.   These were part of the original antFS_client() startup.  I can&amp;#39;t say I&amp;#39;ve run it enough times (or enough months ;-) to say that there isn&amp;#39;t a &amp;#39;surprise&amp;#39; somewhere, but, so far it&amp;#39;s been working reliably.&lt;/p&gt;
&lt;p&gt;In the dispatch function, it detects that I want to stop the ant-fs, no longer dispatches to antfs_message_process(), and locally handles sd_ant_channel_unassign() after it receives the EVENT_CHANNEL_CLOSED.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll add the sd_ant burst...disable(), thanks for the advice.  Do I put this BEFORE I close the channel or when I catch the channel close?
Tom&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the proper way to stop Ant-FS?</title><link>https://devzone.nordicsemi.com/thread/41833?ContentTypeID=1</link><pubDate>Fri, 08 Jan 2016 12:49:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:935b0489-2d5a-47f2-a830-20a9995177ca</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;We have started a refactoring the ANT examples to ease operations like this, unfortuneately we haven&amp;#39;t got to the ANT FS example yet.&lt;/p&gt;
&lt;p&gt;In addition to closing and unassigning, you can call sd_ant_burst_handler_wait_flag_disable().&lt;/p&gt;
&lt;p&gt;When you start you should call antfs_init() and antfs_channel_setup().&lt;/p&gt;
&lt;p&gt;Have you experienced that state of the variables antfs affects operation after reinit?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>