Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT+ Network key for Android device. 128bits. 

Rank

Total Posts: 1

Joined 2020-09-14

PM

Hi everyone, i have some problem about Network key using.

In my android project, i would like to usb background scan mode to scan all my ANT+ devices.

My code is below:
byte[] bytes = new byte[]{(byte)0xB9, ....;
NetworkKey antPlusNetworkKey = new NetworkKey(bytes);

Capabilities capableOfBackgroundScan = new Capabilities();
capableOfBackgroundScan.supportBackgroundScanning(true);

Log.d(TAG, antPlusNetworkKey.toString());
try {
mAntChannel = mAntChannelProvider.acquireChannelOnPrivateNetwork(this, antPlusNetworkKey, capableOfBackgroundScan);
} catch (UnsupportedFeatureException|IllegalArgumentException e) {
e.printStackTrace();
}
But i compiler my code, it cause an exception: java.lang.IllegalArgumentException: Received network key that is null or has invalid length

I use the correct network key, but the result shows it length error.

Can you tell my how can i solve this problems?

I find someone says "android need use 128bit network key", and how can i get it?

Many thanks.      
Rank

Total Posts: 1

Joined 2020-09-28

PM

Hi!

I have exactly the same problem, any solution?

Regards.      
RankRankRankRank

Total Posts: 370

Joined 2012-06-27

PM

Please see https://www.thisisant.com/forum/viewthread/7477/ for how you can develop on the ANT+ network outside of plugins.      

Signature

Ian Haigh

RankRankRankRank

Total Posts: 370

Joined 2012-06-27

PM

Removed ANT+ key from original post      

Signature

Ian Haigh