public final class ChannelRfFrequencyMessage extends AntMessageFromHost
Modifier and Type | Field and Description |
---|---|
static int |
MAX_RF_FREQUENCY
The maximum frequency value ANT will accept
|
static int |
MIN_RF_FREQUENCY
The minimum frequency value ANT will accept
|
static int |
OFFSET_RF_FREQUENCY
The message content offset to the frequency value
|
static int |
RF_FREQUENCY_BASE_VALUE
The real world channel frequency (MHz) is calculated by taking the set value and adding it
to this starting value.
|
static int |
SIZE_RF_FREQUENCY
The number of bytes used for the frequency value
|
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 and Description |
---|
ChannelRfFrequencyMessage(int rfFrequency)
Constructs the message from the given frequency value.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getMessageContent(int channelNumber,
int networkNumber)
The content of the message with specified channel number and network number set if required.
|
MessageFromHostType |
getMessageType()
The unique type of this message based on its message id, contents, and intended channel
type.
|
int |
getRealRfFrequency() |
static int |
getRealRfFrequency(int rfFrequencyOffset)
Converts an ANT Channel RF Frequency value to the real world frequency.
|
int |
getRfFrequency()
Gets the frequency (offset) value contained in the message.
|
static int |
getRfFrequencyOffset(int realRfFrequency) |
static boolean |
inRange(int frequency)
Determines if the frequency is within the acceptable range for ANT chips.
|
java.lang.String |
toString() |
createAntMessage, getMessageContent, getMessageContent, getMessageId, getRawMessage
equals, getMessageContentString, getMessageIdString, hashCode, maskChannelNumber
public static final int OFFSET_RF_FREQUENCY
public static final int SIZE_RF_FREQUENCY
public static final int MIN_RF_FREQUENCY
public static final int MAX_RF_FREQUENCY
public static final int RF_FREQUENCY_BASE_VALUE
Real Channel Frequency = 2400 MHz + Channel RF Frequency Number
public ChannelRfFrequencyMessage(int rfFrequency)
rfFrequency
- The frequency offset of 2400 MHz (e.g. 50 MHz for 2450
MHz).public static final boolean inRange(int frequency)
frequency
- The frequency offset of 2400 MHz (e.g. 50 MHz for 2450
MHz) to be checked.public static int getRealRfFrequency(int rfFrequencyOffset)
rfFrequencyOffset
- The set ANT Channel RF Frequency as an offset.public int getRealRfFrequency()
public static int getRfFrequencyOffset(int realRfFrequency)
public int getRfFrequency()
public byte[] getMessageContent(int channelNumber, int networkNumber)
AntMessageFromHost
getMessageContent
in class AntMessageFromHost
channelNumber
- Written to the channel number byte if requirednetworkNumber
- Written to the network number byte if requiredpublic MessageFromHostType getMessageType()
AntMessageFromHost
It is recommended to use this rather than the raw message ID.
getMessageType
in class AntMessageFromHost
public java.lang.String toString()
toString
in class AntMessageFromHost
Copyright © 2015 Dynastream Innovations Inc. All Rights Reserved.