Package com.dsi.ant.message.fromhost
Class ChannelRfFrequencyMessage
java.lang.Object
com.dsi.ant.message.AntMessage
com.dsi.ant.message.fromhost.AntMessageFromHost
com.dsi.ant.message.fromhost.ChannelRfFrequencyMessage
Configures the frequency this channel will operate on.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe maximum frequency value ANT will acceptstatic final intThe minimum frequency value ANT will acceptstatic final intThe message content offset to the frequency valuestatic final intThe real world channel frequency (MHz) is calculated by taking the set value and adding it to this starting value.static final intThe number of bytes used for the frequency valueFields inherited from class com.dsi.ant.message.AntMessage
BITMASK_CHANNEL_NUMBER, FILLER_BYTE, OFFSET_CHANNEL_NUMBER, RAW_OFFSET_MESSAGE_CONTENT_START, RAW_OFFSET_MESSAGE_ID, RAW_OFFSET_MESSAGE_SIZE, SIZE_CHANNEL_NUMBER, SIZE_FILLER_BYTE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedChannelRfFrequencyMessage(byte[] messageContent) ChannelRfFrequencyMessage(int rfFrequency) Constructs the message from the given frequency value. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getMessageContent(int channelNumber, int networkNumber) The content of the message with specified channel number and network number set if required.The unique type of this message based on its message id, contents, and intended channel type.intstatic intgetRealRfFrequency(int rfFrequencyOffset) Converts an ANT Channel RF Frequency value to the real world frequency.intGets the frequency (offset) value contained in the message.static intgetRfFrequencyOffset(int realRfFrequency) static final booleaninRange(int frequency) Determines if the frequency is within the acceptable range for ANT chips.toString()Methods inherited from class com.dsi.ant.message.fromhost.AntMessageFromHost
createAntMessage, createAntMessage, getMessageContent, getMessageContent, getMessageId, getRawMessage, toStringHeaderMethods inherited from class com.dsi.ant.message.AntMessage
equals, getMessageContentString, getMessageIdString, hashCode, maskChannelNumber
-
Field Details
-
OFFSET_RF_FREQUENCY
public static final int OFFSET_RF_FREQUENCYThe message content offset to the frequency value- Since:
- 4.0
- See Also:
-
SIZE_RF_FREQUENCY
public static final int SIZE_RF_FREQUENCYThe number of bytes used for the frequency value- Since:
- 4.0
- See Also:
-
MIN_RF_FREQUENCY
public static final int MIN_RF_FREQUENCYThe minimum frequency value ANT will accept- Since:
- 4.0
- See Also:
-
MAX_RF_FREQUENCY
public static final int MAX_RF_FREQUENCYThe maximum frequency value ANT will accept- Since:
- 4.0
- See Also:
-
RF_FREQUENCY_BASE_VALUE
public static final int RF_FREQUENCY_BASE_VALUEThe real world channel frequency (MHz) is calculated by taking the set value and adding it to this starting value.Real Channel Frequency = 2400 MHz + Channel RF Frequency Number
- Since:
- 4.5
- See Also:
-
-
Constructor Details
-
ChannelRfFrequencyMessage
public ChannelRfFrequencyMessage(int rfFrequency) Constructs the message from the given frequency value.- Parameters:
rfFrequency- The frequency offset of 2400 MHz (e.g. 50 MHz for 2450 MHz).- Since:
- 4.0
-
ChannelRfFrequencyMessage
protected ChannelRfFrequencyMessage(byte[] messageContent)
-
-
Method Details
-
inRange
public static final boolean inRange(int frequency) Determines if the frequency is within the acceptable range for ANT chips.- Parameters:
frequency- The frequency offset of 2400 MHz (e.g. 50 MHz for 2450 MHz) to be checked.- Returns:
- True, if in range. False, otherwise.
- Since:
- 4.0
-
getRealRfFrequency
public static int getRealRfFrequency(int rfFrequencyOffset) Converts an ANT Channel RF Frequency value to the real world frequency.- Parameters:
rfFrequencyOffset- The set ANT Channel RF Frequency as an offset.- Returns:
- The channel period in 1/32768ths of a second units.
- Since:
- 4.5
-
getRealRfFrequency
public int getRealRfFrequency() -
getRfFrequencyOffset
public static int getRfFrequencyOffset(int realRfFrequency) -
getRfFrequency
public int getRfFrequency()Gets the frequency (offset) value contained in the message.- Returns:
- The frequency offset of 2400 MHz (e.g. 50 MHz for 2450 MHz)
- Since:
- 4.0
-
getMessageContent
public byte[] getMessageContent(int channelNumber, int networkNumber) Description copied from class:AntMessageFromHostThe content of the message with specified channel number and network number set if required.- Specified by:
getMessageContentin classAntMessageFromHost- Parameters:
channelNumber- Written to the channel number byte if requirednetworkNumber- Written to the network number byte if required- Returns:
- Message content raw byte array.
- Since:
- 4.0
-
getMessageType
Description copied from class:AntMessageFromHostThe unique type of this message based on its message id, contents, and intended channel type.It is recommended to use this rather than the raw message ID.
- Specified by:
getMessageTypein classAntMessageFromHost- Returns:
- The type of message returned by the host.
- Since:
- 4.0
-
toString
- Overrides:
toStringin classAntMessageFromHost
-