Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

thread for incomming data

Rank

Total Posts: 2

Joined 2013-11-25

PM

Hi,

I am working on an android app (non ant+) in which works with service (Connect to the ANT Radio Service) . Is there necessary to implement thread for incoming/outgoing data?

Thanks.      
Avatar
RankRankRankRank

Total Posts: 129

Joined 2010-11-30

PM

Hi Tomsa,

The ANTLib/ANT Radio Service makes no assumptions about how an app will implement the API, so it calls all channel/adapter event callbacks on a background "receive thread". It is not necessary to implement your own thread for processing incoming data if you don't want to.

The methods for writing ANT commands block until their response has been received from the chip, which may also block outgoing data. Depending on your implementation you may need to add your own background thread for write requests. This is essential for outgoing burst transfers, as per the AntChannel.burstTransfer(byte[]) API documentation:
Blocks until burst is finished, either successfully or a failure.