Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Possible bug in ANT Android SDK v.C.B3: IAntChannelEventHandler not always called properly

Rank

Total Posts: 5

Joined 0

PM

There seems to be a bug in the current Android SDK (version C.B3).

I'm using the Android application project sample "AcquireChannels" (provided with the SDK). I have made the following changes to the ChannelController class:

- disabling the ANT channel's event buffer
- logging message types and event codes in the IAntChannelEventHandler implementation (this means I can monitor incoming data messages and ANT events in a console window; I'm using LogCat)
- if the channel is opened as slave, it counts the broadcast messages arriving from the master and sends a broadcast message of its own at certain intervals (e.g. after receiving five messages)

With this setup, I can connect two Android devices, one as master and one as slave. The master will then continuously send broadcasts to the slave at the given message period. The slave will send single broadcasts back at a given interval (e.g. after receiving five message). For both devices, I can monitor all of these messages and events in the console window.

Basically, this works fine, but here's the thing: Once I set the message frequency to values around 2 Hz and lower, the outgoing broadcast events (EVENT_TX) are not logged any more. This means that the onReceiveMessage() method of the IAntChannelEventHandler is not called with an EVENT_TX any more. Yet, the actual broadcast message is still transmitted successfully, as I can monitor its arrival on the opposite device.

In other words, the ANT event callbacks from the ANT library (android_antlib_4-7-0.jar) to my Android applications do not work properly at low message frequencies...

I have attached a version of the ChannelController class to this post. My changes are tagged #bsl2.

Any suggestions?
     

File Attachments

Avatar
RankRankRankRank

Total Posts: 129

Joined 2010-11-30

PM

Which phone are you using for this?

Can you do a requestAntVersion() and provide the ANT firmware version.

Cheers      
Rank

Total Posts: 5

Joined 0

PM

Referring to the two Android devices used for the tests mentioned in the original post:

the version string for both devices is: AOV1.08B00;
the ANT Radio Service is up to date on both devices: version 4.7.0;
the devices are:
- Sony Ericsson Xperia arc (LT15i), with Android 4.0.4
- Sony Ericsson Xperia active (ST17i), with Android 4.0.4

In the meantime, I have also tested my code on a Samsung Galaxy S II (GT-I9100, Android 4.1.2) with externally connected ANT dongle (ANT USB-m). The version string here is: AJK2.05RAF.

With this last setup, it works fine! This suggests that it is a problem of older ANT hardware modules or the stacks running on them, right?