Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Android ANT Burst: channel lifecycle

Rank

Total Posts: 6

Joined 2013-09-11

PM

Hello,

I am bursting data between two Android devices with 600 bytes a second rate. Please advise on what is channel life cycle and at what stage is it safe to start transfers - especially if recovering after CHANNEL_CLOSED

As I am seeing Channel life cycle:

STATE 1. CLOSED

then AntChannel.open()

STATE 2. SEARCH

then 20 TX events in a row on master:
or 20 broadcasts in a row on slave:

STATE 3. INSYNC

if 20 RX_FAIL, TRANSFER_TX_FAILED or TRANSFER_RX_FAILED in a row:

STATE 4. DESYNC

then RX_FAIL_GO_TO_SEARCH:

STATE 5. SEARCH

then RX_SEARCH_TIMEOUT:
then CHANNEL_CLOSED:

STATE 6. CLOSED

Questions:
Q1: can you please confirm my understanding of channel lifecycle?
Q2: from STATE2 to 3: is 20 (based on my personal observations) TX events reliable criteria to consider channel INSYNC?
Q3: STATE3: what is broadcasts data format on slave side? sorry could not find definitive answer in documentation.
Q4: how master supposed to realise there is at least one slave to transmit to? TX events are generated either case right?. Is it slave should send broadcast data request to master?


     
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

1) Your understanding of the channel lifecycle is esentially correct.
Between steps 5 & 6, while the slave is searching, if the slave finds the master again, it will go back to the tracking state.

2) The acquisition time is not deterministic, although generally, the faster the channel period of the master, the faster the acquisition time.A channel drops to search after 2 seconds worth of missed messages - the exact number will thus depend on the channel period. You can find more details on all of this on the "ANT Channel Search and Background Scanning Channel" app note.
http://www.thisisant.com/developer/resources/downloads/#documents_tab

3) The format of the data the slave broadcasts is up to the application on the slave - i.e., it is up to the application to define how the payload looks like. Note that unlinke masters, broadcast messages on slaves are sent only on demand (only when instructed to do so at the application level. Section 9.5.51 of the "ANT Message Protocol and Usage" document (also available in the Downloads page) explains in more detail how broadcast messages work on both masters and slaves.

4) Correct, as soon as you open a channel, the master will start broadcasting data every channel period, regardless of whether there is a slave (or more) present, or not. You could potentially use acknowledged messages for the master to know whether there is a slave present, but note that this is not recommended if you expect multiple slaves to synchronize to the same master.