Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Setting 1.0 Hz using Android API com.dsi.ant.AntInterface.ANTSetChannelPeriod(byte channelNumber, short channelPeriod)

Rank

Total Posts: 1

Joined 0

PM

Hello,

For a custom ANT communication I have to use the channel period of 1Hz.

According to the chapter 5.2.4 "Channel Period" of the ANT Message Protocol and Usage document I have to set the channel period value to 32768 (32768/1 = 32768)

The Android API provides the following method to set this channel period value:
com.dsi.ant.AntInterface.ANTSetChannelPeriod(byte channelNumbershort channelPeriod


However the Java data type range of "short" does only support –2^15 - 2^15 – 1 (–32768...32767)

What value do I have to set to achieve 1Hz?

Thank you in advance.      
Avatar
RankRank

Total Posts: 39

Joined 2011-06-29

PM

Setting the channel period to be 1Hz (or more) is slightly unconventional for Android because Java does not support unsigned primitives. If you set the period as (short)32768 this will truncate it to –32768 but our back-end will treat it as 32768