<?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>ant+ connection/disconnection event?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/4223/ant-connection-disconnection-event</link><description>Hi, 
 Is there any connection/disconnection API in ant+ (sd210) similar to BLE?
I want to use this to control the device activity cycle, if I get disconnection event, would like to make the ANT+ device into sleep unless get a motion trigger. 
 For</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Oct 2014 16:02:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/4223/ant-connection-disconnection-event" /><item><title>RE: ant+ connection/disconnection event?</title><link>https://devzone.nordicsemi.com/thread/15087?ContentTypeID=1</link><pubDate>Wed, 29 Oct 2014 16:02:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b499b6e5-f4cf-4c5f-aa41-110f4c71a143</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;This information shouldn&amp;#39;t be in a comment to my answer. Please edit your question and make it clear what you are asking, so this can be useful to others. Then I can modify my answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ant+ connection/disconnection event?</title><link>https://devzone.nordicsemi.com/thread/15086?ContentTypeID=1</link><pubDate>Wed, 29 Oct 2014 13:31:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87de4da5-c15b-47a2-b566-a30f1e06102d</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;&lt;strong&gt;Edit: master device&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In ANT, the master just sends out packets at regular intervals, and it does so independently of the slave.&lt;/p&gt;
&lt;p&gt;If the master is asleep it can&amp;#39;t get any packets from the slave, so how would the slave initiate a connection?&lt;/p&gt;
&lt;p&gt;The master must be active at some point. To me it seems you have two options, have it active all the time, sending packets with a larger interval, or duty cycling between active and sleep. This depends on your real time requirements.&lt;/p&gt;
&lt;p&gt;If you want the slave to initiate and terminate the connection, I think you would have to implement this on top of the ANT stack, maybe by sending an &amp;quot;initiation&amp;quot; or &amp;quot;termination&amp;quot; message to the master. The &amp;quot;initiation&amp;quot; message could tell the master to increase its interval or skip duty cycling. The &amp;quot;termination&amp;quot; message could tell the master to decrease its interval or start duty cycling. Another option is that the master disconnects if it doesn&amp;#39;t get any messages from the slave in a certain time interval.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Old answer, slave device:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m assuming you are talking about a slave device.&lt;/p&gt;
&lt;p&gt;Maybe you can go to sleep if you get x number of &lt;code&gt;EVENT_RX_FAIL&lt;/code&gt;events, or when you get the &lt;code&gt;EVENT_RX_FAIL_GO_TO_SEARCH&lt;/code&gt; event?&lt;/p&gt;
&lt;p&gt;You will get &lt;code&gt;EVENT_RX_FAIL_GO_TO_SEARCH&lt;/code&gt;when a synchronous rx channel has missed &lt;strong&gt;5&lt;/strong&gt; receiving an ANT packets. &lt;strong&gt;5&lt;/strong&gt; is hardcoded.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//////////////////////////////////////////////
/** @name Channel Events and Command Response Codes
@{ */
//////////////////////////////////////////////
#define RESPONSE_NO_ERROR                          ((uint8_t)0x00) ///&amp;lt; Command response with no error
#define NO_EVENT                                   ((uint8_t)0x00) ///&amp;lt; No Event
#define EVENT_RX_SEARCH_TIMEOUT                    ((uint8_t)0x01) ///&amp;lt; ANT stack generated event when rx searching state for the channel has timed out
#define EVENT_RX_FAIL                              ((uint8_t)0x02) ///&amp;lt; ANT stack generated event when synchronous rx channel has missed receiving an ANT packet
#define EVENT_TX                                   ((uint8_t)0x03) ///&amp;lt; ANT stack generated event when synchronous tx channel has occurred
#define EVENT_TRANSFER_RX_FAILED                   ((uint8_t)0x04) ///&amp;lt; ANT stack generated event when the completion of rx transfer has failed
#define EVENT_TRANSFER_TX_COMPLETED                ((uint8_t)0x05) ///&amp;lt; ANT stack generated event when the completion of tx transfer has succeeded
#define EVENT_TRANSFER_TX_FAILED                   ((uint8_t)0x06) ///&amp;lt; ANT stack generated event when the completion of tx transfer has failed
#define EVENT_CHANNEL_CLOSED                       ((uint8_t)0x07) ///&amp;lt; ANT stack generated event when channel has closed
#define EVENT_RX_FAIL_GO_TO_SEARCH                 ((uint8_t)0x08) ///&amp;lt; ANT stack generated event when synchronous rx channel has lost tracking and is entering rx searching state
#define EVENT_CHANNEL_COLLISION                    ((uint8_t)0x09) ///&amp;lt; ANT stack generated event during a multi-channel setup where an instance of the current synchronous channel is blocked by another synchronous channel
#define EVENT_TRANSFER_TX_START                    ((uint8_t)0x0A) ///&amp;lt; ANT stack generated event when the start of tx transfer is occuring
//...
#define EVENT_TRANSFER_NEXT_DATA_BLOCK             ((uint8_t)0x11) ///&amp;lt; ANT stack generated event when the stack requires the next transfer data block for tx transfer continuation or completion
//...
#define CHANNEL_IN_WRONG_STATE                     ((uint8_t)0x15) ///&amp;lt; Command response on attempt to perform an action from the wrong channel state
#define CHANNEL_NOT_OPENED                         ((uint8_t)0x16) ///&amp;lt; Command response on attempt to communicate on a channel that is not open
//...
#define CHANNEL_ID_NOT_SET                         ((uint8_t)0x18) ///&amp;lt; Command response on attempt to open a channel without setting the channel ID
#define CLOSE_ALL_CHANNELS                         ((uint8_t)0x19) ///&amp;lt; Command response when attempting to start scanning mode, when channels are still open
//...
#define TRANSFER_IN_PROGRESS                       ((uint8_t)0x1F) ///&amp;lt; Command response on attempt to communicate on a channel with a TX transfer in progress
#define TRANSFER_SEQUENCE_NUMBER_ERROR             ((uint8_t)0x20) ///&amp;lt; Command response when sequence number of burst message or burst data segment is out of order
#define TRANSFER_IN_ERROR                          ((uint8_t)0x21) ///&amp;lt; Command response when transfer error has occured on supplied burst message or burst data segment
#define TRANSFER_BUSY                              ((uint8_t)0x22) ///&amp;lt; Command response when transfer is busy and cannot process supplied burst message or burst data segment
//...
#define MESSAGE_SIZE_EXCEEDS_LIMIT                 ((uint8_t)0x27) ///&amp;lt; Command response if a data message is provided that is too large
#define INVALID_MESSAGE                            ((uint8_t)0x28) ///&amp;lt; Command response when the message has an invalid parameter
#define INVALID_NETWORK_NUMBER                     ((uint8_t)0x29) ///&amp;lt; Command response when an invalid network number is provided
#define INVALID_LIST_ID                            ((uint8_t)0x30) ///&amp;lt; Command response when the provided list ID or size exceeds the limit
#define INVALID_SCAN_TX_CHANNEL                    ((uint8_t)0x31) ///&amp;lt; Command response when attempting to transmit on channel 0 when in scan mode
#define INVALID_PARAMETER_PROVIDED                 ((uint8_t)0x33) ///&amp;lt; Command response when an invalid parameter is specified in a configuration message
#define EVENT_QUE_OVERFLOW                         ((uint8_t)0x35) ///&amp;lt; ANT stack generated event when the event queue in the stack has overflowed and drop 1 or 2 events
#define EVENT_ENCRYPT_NEGOTIATION_SUCCESS          ((uint8_t)0x38) ///&amp;lt; ANT stack generated event when connecting to an encrypted channel has succeeded
#define EVENT_ENCRYPT_NEGOTIATION_FAIL             ((uint8_t)0x39) ///&amp;lt; ANT stack generated event when connecting to an encrypted channel has failed
#define EVENT_RFACTIVE_NOTIFICATION                ((uint8_t)0x3A) ///&amp;lt; ANT stack generated event when the time to next synchronous channel RF activity exceeds configured time threshold
#define EVENT_CONNECTION_START                     ((uint8_t)0x3B) ///&amp;lt; Application generated event used to indicate when starting a connection to a channel
#define EVENT_CONNECTION_SUCCESS                   ((uint8_t)0x3C) ///&amp;lt; Application generated event used to indicate when successfuly connected to a channel
#define EVENT_CONNECTION_FAIL                      ((uint8_t)0x3D) ///&amp;lt; Application generated event used to indicate when failed to connect to a channel
#define EVENT_CONNECTION_TIMEOUT                   ((uint8_t)0x3E) ///&amp;lt; Application generated event used to indicate when connecting to a channel has timed out
#define EVENT_CONNECTION_UPDATE                    ((uint8_t)0x3F) ///&amp;lt; Application generated event used to indicate when connection parameters have been updated
//...
#define NO_RESPONSE_MESSAGE                        ((uint8_t)0x50) ///&amp;lt; Command response type intended to indicate that no serial reply message should be generated
#define EVENT_RX                                   ((uint8_t)0x80) ///&amp;lt; ANT stack generated event indicating received data (eg. broadcast, acknowledge, burst) from the channel
#define EVENT_BLOCKED                              ((uint8_t)0xFF) ///&amp;lt; ANT stack generated event that should be ignored (eg. filtered events will generate this)
/** @} */
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>