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?