Hi Alexey,
Your example code shows you are trying to send as a slave, so the burst will only start when a packet is received from the master. If there is any reason a packet is not received (interference, out of range, channel collision etc.), the burst start will be delayed until a packet is received.
You should only wait for TRANSFER_TX_COMPLETED/TRANSFER_TX_FAILED after receiving a TRANSFER_TX_START, as there could be a reason the burst never began (ie. TRANSFER_IN_PROGRESS). To simplify things in Android, you can use the onBurstStateChanged() event and check the status of the BurstState object you are provided. This will also include bursts in progress on channels in use by other apps (only one channel can burst at a time). You should also be checking the max burst size value in BurstState. Currently this is much higher than your case requires, but it may change with future versions of the ANT Radio Service and how other channels on the ANT adapter are configured. The Creating ANT Android Applications document in the ANT Android SDK explains this.
When you ask about the channel “sleeping”, are you not seeing RF events for the data that is being received from the master (eg. Rx data messages, Rx fail events, etc) at the expected message period?
It is tricky to say what throughput your implementation should expect. A standard (non-advanced) burst can perform at 20kbps (interference could impact this), but your implementation has a built-in “dead time” between bursts. Your maximum throughput is dependent on the channel period of your master, and the size of each burst, but is greatly impacted by any interference to the packets from the master and the burst buffer being “primed” with data before that packet is received. A 17Hz connection, with 60 byte bursts is a maximum of 1020 byes/second you will only see in an ideal RF environment. A burst transfer does include built-in retries, so once it has started external factors will have less of an impact (while your total throughput will stay about the same).
Advanced burst should not be needed for your case (with low throughput requirements), allowing you to support all current phones/USB sticks. This feature is not currently supported by the ANT Android API.
Frequency agility will help with external interference, but not with internal sharing of the radio. On the phone with built-in ANT there is only one radio being used for all wireless, so you may see some contention when trying to burst large amounts of data and do high-priority voice streaming over Bluetooth at the same time.
The master will transmit something on every message period, which will be broadcast data if no Ack or Burst data has been requested. The slave will use this to synchronise it’s channel to. So, you should be checking if (old) data is arriving as broadcast. The slave unit will get a RX_FAILED (not TRANSFER_RX_FAILED) if nothing is received. I would suggest logging all received ANT packets to see what is going on. The toString() method of each message class will output the data in a more human readable format than the raw message.
Cheers,
-Rohan