Package org.ka2ddo.aprs
Class XmitEncoding
java.lang.Object
org.ka2ddo.aprs.XmitEncoding
- All Implemented Interfaces:
Serializable
,Cloneable
This class specifies all the parameter variations associated with all possible
encodings for subaudible codes, such as CTCSS, DCS, etc., including specifying
whether narrowband or (comparatively) wideband FM deviation is used.
APRS encoding is as a letter code for the type followed by a three-digit zero-prefixed number for the frequency (dropping fractions) or digital code number. The letter code is uppercase for wideband FM deviation or lowercase for narrowband. The codes are:
T | analog tone transmission from mobile to repeater only |
C | analog tone transmission in both directions (does not support split tones) |
D | DCS code number |
- Author:
- Andrew Pavlin, KA2DDO
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String[]
The standard TCS/CTCSS frequencies in 1/10 Hz values.static final String[]
The standard TCS/CTCSS frequencies used for analog repeaters, in ascending frequency order.static final String[]
The standard DCS (CDCSS) code numbers, in ascending number order.boolean
Indicates this represents DCS (Digital Code Squelch) rather than tone squelch,boolean
Indicates that the repeater not only expects a tone, but sends one out as well.boolean
Indicates that values of this object are meaningless garbage and should not be used.boolean
short
Index into CTCSS_FREQS or DCS_CODES array; 0 implies no tone or code. -
Constructor Summary
ConstructorDescriptionCreate an XmitEncoding object for wideband analog with unspecified tone.XmitEncoding
(boolean isDigital, boolean isFullDuplex, short toneCodeIndex, boolean isNarrowBand) Create an XmitEncoding object with the specified valus. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates and returns a copy of this object.void
copyInto
(XmitEncoding other) Copy another XmitEncoding into this XmitEncoding object.static XmitEncoding
Decode the specified string into a tone or DCS encoding.Generate a String encoding in ASCII text the value of this XmitEncoding object.boolean
Indicates whether some other object is "equal to" this one.int
hashCode()
Returns a hash code value for the object.static boolean
isValidLookingSubTone
(byte[] body, int offset) Test if a message body has a valid-looking subtone encoding for an APRS message.toString()
Returns a string representation of the object.
-
Field Details
-
isNarrowband
public boolean isNarrowband -
toneCodeIndex
public short toneCodeIndexIndex into CTCSS_FREQS or DCS_CODES array; 0 implies no tone or code. -
isDigital
public boolean isDigitalIndicates this represents DCS (Digital Code Squelch) rather than tone squelch, -
isFullDuplex
public boolean isFullDuplexIndicates that the repeater not only expects a tone, but sends one out as well. -
isInvalid
public boolean isInvalidIndicates that values of this object are meaningless garbage and should not be used. -
CTCSS_FREQS
The standard TCS/CTCSS frequencies used for analog repeaters, in ascending frequency order. -
BADFMT_CTCSS_FREQS
The standard TCS/CTCSS frequencies in 1/10 Hz values. -
DCS_CODES
The standard DCS (CDCSS) code numbers, in ascending number order.
-
-
Constructor Details
-
XmitEncoding
public XmitEncoding()Create an XmitEncoding object for wideband analog with unspecified tone. -
XmitEncoding
public XmitEncoding(boolean isDigital, boolean isFullDuplex, short toneCodeIndex, boolean isNarrowBand) Create an XmitEncoding object with the specified valus.- Parameters:
isDigital
- boolean true if transmission uses Digital Code Squelch, false for analog CTCSS toneisFullDuplex
- boolean true if repeater transmits a tone or code on its outputtoneCodeIndex
- zero-based index intoCTCSS_FREQS
orDCS_CODES
array for tone/code in use, 0 for no tone or code. -1 for unspecifiedisNarrowBand
- boolean true if transmission is using narrow modulation bandwidth
-
-
Method Details
-
encodedString
Generate a String encoding in ASCII text the value of this XmitEncoding object.- Returns:
- String representation of encoding
-
decodeString
Decode the specified string into a tone or DCS encoding.- Parameters:
s
- String to decode- Returns:
- XmitEncoding of the specified value, or null if this string does not contain an APRS tone encoding
- Throws:
IllegalArgumentException
- if this looks like a tone encoding but doesn't have one of the legal tone frequencies or digital code numbers
-
copyInto
Copy another XmitEncoding into this XmitEncoding object.- Parameters:
other
- source XmitEncoding object
-
isValidLookingSubTone
public static boolean isValidLookingSubTone(byte[] body, int offset) Test if a message body has a valid-looking subtone encoding for an APRS message.- Parameters:
body
- byte array containing APRS message bodyoffset
- index in body array where subtone encoding should be present- Returns:
- boolean true if a valid-looking subtone encoding is at the specified position in the array
-
equals
Indicates whether some other object is "equal to" this one. -
hashCode
public int hashCode()Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided byjava.util.Hashtable
. -
toString
Returns a string representation of the object. -
clone
Creates and returns a copy of this object.
-