Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT+ HR Plugin: IDeviceStateChangeReceiver.onDeviceStateChange() not called

Rank

Total Posts: 8

Joined 2013-10-06

PM

For my android app, I use the new ANT+ Plugin API and stumpled upon an odd problem.

When using the non-UI method
public static void requestAccess(Context bindToContext,
int antDeviceNumber,
int searchProximityThreshold,
AntPluginPcc.IPluginAccessResultReceiver<AntPlusEnvironmentPcc> resultReceiver,
AntPluginPcc.IDeviceStateChangeReceiver stateReceiver)

I get the correct heart rate values from the resultReceiver but the onDeviceStateChanged method of the stateReceiver is never called.

Any help?      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Sorry, just noticed this has not been responded to. I retested this to be sure and I am unable to reproduce this. The heart rate state changes seem to be propagating correctly and my stateReceiver is called as expected.

When a device first connects it is usually in the tracking state, as reported in your accessResultReceiver 'initialState', the initial state is never sent on the state receiver. If the device never drops out of tracking during the time you use it, you will never get any callbacks on the deviceStateChanged callback. Could that be the behaviour you are seeing?      

Signature

Dynastream Developer

Rank

Total Posts: 8

Joined 2013-10-06

PM

Ok, that sounds reasonable and seems to be the cause of the problem.
Thank you very much.