org.ka2ddo.aprs
Class XmitEncoding

java.lang.Object
  extended by org.ka2ddo.aprs.XmitEncoding
All Implemented Interfaces:
java.io.Serializable

public class XmitEncoding
extends java.lang.Object
implements java.io.Serializable

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:

Tanalog tone transmission from mobile to repeater only
Canalog tone transmission in both directions (does not support split tones)
DDCS code number
APRS-Standard Tone Code Prefixes

See Also:
Serialized Form

Field Summary
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
           
 boolean isFullDuplex
           
 boolean isInvalid
           
 boolean isNarrowband
           
 short toneCodeIndex
           
 
Constructor Summary
XmitEncoding()
           
XmitEncoding(boolean isDigital, boolean isFullDuplex, short toneCodeIndex, boolean isNarrowBand)
           
 
Method Summary
 void copyInto(XmitEncoding other)
           
static XmitEncoding decodeString(java.lang.String s)
           
 java.lang.String encodedString()
           
 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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

isNarrowband

public boolean isNarrowband

toneCodeIndex

public short toneCodeIndex

isDigital

public boolean isDigital

isFullDuplex

public boolean isFullDuplex

isInvalid

public boolean isInvalid

CTCSS_FREQS

public static final java.lang.String[] CTCSS_FREQS
The standard TCS/CTCSS frequencies used for analog repeaters, in ascending frequency order.


DCS_CODES

public static final java.lang.String[] DCS_CODES
The standard DCS (CDCSS) code numbers, in ascending number order.

Constructor Detail

XmitEncoding

public XmitEncoding()

XmitEncoding

public XmitEncoding(boolean isDigital,
                    boolean isFullDuplex,
                    short toneCodeIndex,
                    boolean isNarrowBand)
Method Detail

encodedString

public java.lang.String encodedString()

decodeString

public static XmitEncoding decodeString(java.lang.String s)

copyInto

public void copyInto(XmitEncoding other)

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 body
offset - 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

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
hashCode(), Hashtable

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 by java.util.Hashtable.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.
See Also:
Object.equals(Object), Hashtable

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.