public class XmitEncoding
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
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 |
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
BADFMT_CTCSS_FREQS
The standard TCS/CTCSS frequencies in 1/10 Hz values.
|
static java.lang.String[] |
CTCSS_FREQS
The standard TCS/CTCSS frequencies used for analog repeaters, in ascending frequency order.
|
static java.lang.String[] |
DCS_CODES
The standard DCS (CDCSS) code numbers, in ascending number order.
|
boolean |
isDigital
Indicates this represents DCS (Digital Code Squelch) rather than tone squelch,
|
boolean |
isFullDuplex
Indicates that the repeater not only expects a tone, but sends one out as well.
|
boolean |
isInvalid
Indicates that values of this object are meaningless garbage and should not be used.
|
boolean |
isNarrowband
Indicates repeater is using narrow-band modulation.
|
short |
toneCodeIndex
Index into CTCSS_FREQS or DCS_CODES array; 0 implies no tone or code, -1 indicates unspecified.
|
Constructor and Description |
---|
XmitEncoding()
Create 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.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates and returns a copy of this object.
|
void |
copyInto(XmitEncoding other)
Copy another XmitEncoding into this XmitEncoding object.
|
static XmitEncoding |
decodeString(java.lang.String s)
Decode the specified string into a tone or DCS encoding.
|
java.lang.String |
encodedString()
Generate a String encoding in ASCII text the value of this XmitEncoding object.
|
boolean |
equals(java.lang.Object obj)
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.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
public boolean isNarrowband
public short toneCodeIndex
public boolean isDigital
public boolean isFullDuplex
public boolean isInvalid
public static final java.lang.String[] CTCSS_FREQS
public static final java.lang.String[] BADFMT_CTCSS_FREQS
public static final java.lang.String[] DCS_CODES
public XmitEncoding()
public XmitEncoding(boolean isDigital, boolean isFullDuplex, short toneCodeIndex, boolean isNarrowBand)
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 into CTCSS_FREQS
or DCS_CODES
array for tone/code in use, 0 for no tone or code. -1 for unspecifiedisNarrowBand
- boolean true if transmission is using narrow modulation bandwidthpublic java.lang.String encodedString()
public static XmitEncoding decodeString(java.lang.String s)
s
- String to decodejava.lang.IllegalArgumentException
- if this looks like a tone encoding but doesn't have one of the
legal tone frequencies or digital code numberspublic void copyInto(XmitEncoding other)
other
- source XmitEncoding objectpublic static boolean isValidLookingSubTone(byte[] body, int offset)
body
- byte array containing APRS message bodyoffset
- index in body array where subtone encoding should be presentpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.hashCode()
,
Hashtable
public int hashCode()
java.util.Hashtable
.hashCode
in class java.lang.Object
Object.equals(Object)
,
Hashtable
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object