Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Continous Mode in Android API 4.0

Rank

Total Posts: 3

Joined 2013-05-13

PM

Hello, I've been watching the new Android API and need enable the continuous mode. but can not find the option.

I think it must be in the channel configuration, but can not find the option.

On the other hand, when I try to use channel.setAdapterWideLibConfig(new LibConfig(true, false, false));, throws a exception "class not found".

E/AndroidRuntime(18552): android.os.BadParcelableException
ClassNotFoundException when unmarshallingcom.dsi.ant.message.LibConfig
at android
.os.Parcel.readException(Parcel.java:1329)
at android.os.Parcel.readException(Parcel.java:1281)
at com.dsi.ant.channel.ipc.aidl.IAntChannelAidl$Stub$Proxy.handleMessage(IAntChannelAidl.java:593)
at com.dsi.ant.channel.ipc.aidl.AntChannelCommunicatorAidl.setLibConfig(AntChannelCommunicatorAidl.java:486)
at com.dsi.ant.channel.AntChannel.setAdapterWideLibConfig(AntChannel.java:642

     
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Hi,

The new API is designed to allow multiple apps to concurrently share ANT channels and/or ANT+ sensor data through plugins, so continuous scanning mode is not exposed in the new API as it blocks other apps from accessing the radio. Also, not all radios found in cellphones/tablets support continuous scanning mode.

If your use case requires it, you can emulate the behavior of continuous scan mode using a background scanning channel and a (or several) slave channel(s). You can use a background scanning channel to receive messages from a multitude of ANT masters like in continuous scan mode, and use the slave channel(s) to pair/respond/disconnect/etc to the master channels you wish to communicate with.

Can you provide your Android Version, Phone Model, and any other relevant information around when you see this error?

Cheers      
Rank

Total Posts: 3

Joined 2013-05-13

PM

I can not make the Background Scan Mode recognizes the devices

final ChannelId channelID = new ChannelId(000); 

channel antService.getChannelProvider().acquireChannel(contextPredefinedNetwork.ANT_PLUS
                         new 
Capabilities(falsetruetruefalse)); 

hannel.assign(ChannelType.BIDIRECTIONAL_SLAVE, new ExtendedAssignment(truetrue));
channel.setChannelId(channelID);
//channel.setAdapterWideLibConfig(new LibConfig(true, false, false)); //Crash
channel.setSearchTimeout(LowPrioritySearchTimeout.MAXHighPrioritySearchTimeout.DISABLED);
channel.setChannelEventHandler(callback);
channel.open(); 


My device is Sony Tablet S with Android 4.0      
Avatar
RankRankRankRank

Total Posts: 129

Joined 2010-11-30

PM

This will be fixed in the upcoming update for the SDK. Currently you can not set LibConfig or get LibConfig, BurstState or BackgroundScanState (events still work).

Thanks for reporting the issue.      
Avatar
RankRankRankRank

Total Posts: 129

Joined 2010-11-30

PM

This is not functional in the 4.0 SDK. We are working to make this available ASAP.