Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

INVALID_REQUEST for antChannel.setRfFrequency(57) with private NetworkKey

Rank

Total Posts: 2

Joined 2015-12-09

PM

I am creating a Android App for a ANT device with a private NetworkKey.
When i set the channel's RF Frequency to 57,an error appeared:
com.dsi.ant.channel.AntCommandFailedException: ANT Service responded with failure reason: INVALID_REQUEST


...
mAntChannelProvider = ...
antChannel mAntChannelProvider.acquireChannelOnPrivateNetwork(....)
antChannel.setRfFrequency(57
     
Rank

Total Posts: 2

Joined 2015-12-09

PM

The code i am using is Sample_BackgroundScan which download from Github.
Here is the stacktrace of that exception:
12-10 09:12:36.716E/ChannelController(23118): com.dsi.ant.channel.AntCommandFailedExceptionANT Service responded with failure reasonINVALID_REQUEST
12
-10 09:12:36.716E/ChannelController(23118):  at com.dsi.ant.channel.AntChannel.checkResult(AntChannel.java:895)
12-10 09:12:36.716E/ChannelController(23118):  at com.dsi.ant.channel.AntChannel.setRfFrequency(AntChannel.java:349)
12-10 09:12:36.716E/ChannelController(23118):  at com.dsi.ant.sample.backgroundscan.ChannelController.configureBackgroundScanningChannel(ChannelController.java:121)
12-10 09:12:36.716E/ChannelController(23118):  at com.dsi.ant.sample.backgroundscan.ChannelController.<init>(ChannelController.java:86)
12-10 09:12:36.716E/ChannelController(23118):  at com.dsi.ant.sample.backgroundscan.ChannelService.acquireBackgroundScanningChannel(ChannelService.java:244)
12-10 09:12:36.716E/ChannelController(23118):  at com.dsi.ant.sample.backgroundscan.ChannelService$1.onServiceConnected(ChannelService.java:91)
12-10 09:12:36.716E/ChannelController(23118):  at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1103)
12-10 09:12:36.716E/ChannelController(23118):  at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1120)
12-10 09:12:36.716E/ChannelController(23118):  at android.os.Handler.handleCallback(Handler.java:733)
12-10 09:12:36.716E/ChannelController(23118):  at android.os.Handler.dispatchMessage(Handler.java:95)
12-10 09:12:36.716E/ChannelController(23118):  at android.os.Looper.loop(Looper.java:136)
12-10 09:12:36.716E/ChannelController(23118):  at android.app.ActivityThread.main(ActivityThread.java:5113)
12-10 09:12:36.716E/ChannelController(23118):  at java.lang.reflect.Method.invokeNative(Native Method)
12-10 09:12:36.716E/ChannelController(23118):  at java.lang.reflect.Method.invoke(Method.java:515)
12-10 09:12:36.716E/ChannelController(23118):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-10 09:12:36.716E/ChannelController(23118):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
12-10 09:12:36.716E/ChannelController(23118):  at dalvik.system.NativeStart.main(Native Method
     
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

As described in the API documentation https://www.thisisant.com/APIassets/Android_ANT_API/com/dsi/ant/channel/AntChannel.html#setRfFrequency(int):

A frequency offset of 57 MHz (2457 MHz) is not allowed and is reserved for use by the ANT+ Plugin API, which must be used to connect to ANT+ devices.


Any network other than ANT+ should avoid using the frequency of 2057 to minimize interference and contention on that frequency.

If you have a specific use case you believe has no way to avoid this contention, please send a PM describing your situation to @Harrison (https://www.thisisant.com/forum/member/messages/pm/408)      

Signature

Dynastream Developer