public class PortConfig
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable
| Modifier and Type | Class and Description |
|---|---|
static class |
PortConfig.Cfg
Port-type-specific configuration parameters for a PortConnector.
|
| Modifier and Type | Field and Description |
|---|---|
boolean |
enabled
Whether port should be opened automatically upon startup.
|
static int |
FLAGS_HF
Indicates this is a TNC port over HF (low bandwidth, wide geographic coverage).
|
static int |
FLAGS_LOCAL
Indicates that this data should be consumed locally as well as transmitted.
|
static int |
FLAGS_UDP
Indicates this is a UDP socket (not TCP).
|
static int |
MAX_PROTOCOL_BIT
Highest bit number supported in protocol bit mask.
|
static java.lang.String[] |
NO_ALIASES
Empty array for ports that have no supported aliases.
|
java.lang.String |
portType
Type of PortConnector used to implement this port, generally defined as a String constant
named PORT_TYPE on the PortConnector subclass.
|
static int |
PROTOCOL_APRS
Flag bit indicating this port allows transmitting APRS packets.
|
static int |
PROTOCOL_AX25
Flag bit indicating this port allows transmitting AX.25 frames containing traffic of types
other than APRS or OpenTRAC UI frames.
|
static int |
PROTOCOL_OPENTRAC
Flag bit indicating this port allows transmitting OpenTRAC packets.
|
static int |
SENTENCE_GPWPL
Send NMEA standard waypoint message back to GPS.
|
static int |
SENTENCE_NONE
No waypoint sentences sent to GPS on this port.
|
static int |
SENTENCE_PKWDWPL
Send Kenwood-specific waypoint message back to GPS.
|
| Constructor and Description |
|---|
PortConfig()
Create a new PortConfig record with a new port instance identifier.
|
| Modifier and Type | Method and Description |
|---|---|
void |
assignPortNumber()
Allocate a new port number for this PortConfig object.
|
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order.
|
void |
copyInto(PortConfig dest)
Do a deep copy of this PortConfig object into another object..
|
PortConfig.Cfg |
current()
Get the port-type-specific configuration parameters for the currently specified port type.
|
PortConfig |
dup()
Make a deep copy of this PortConfig object.
|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
|
java.lang.String |
getDisplayName()
Get the name by which this port will be identified.
|
int |
getPortNumber()
Get the arbitrary sequence port number assigned to this configuration record.
|
int |
hashCode()
Returns a hash code value for the object.
|
static PortConfig |
readFromPreferences(java.util.prefs.Preferences root,
java.lang.String displayName)
Read a PortConfig object from Java Preferences.
|
void |
removeFromPreferences(java.util.prefs.Preferences root)
Delete this PortConfig from the Java Preferences backing store.
|
PortConfig.Cfg |
specific(java.lang.String portType)
Get the port-type-specific configuration parameters for a specific port type.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
void |
writeToPreferences(java.util.prefs.Preferences root)
Write this PortConfig object to Java Preferences on the Ports sub-node of the
specified Preferences node.
|
public static final java.lang.String[] NO_ALIASES
public static final int PROTOCOL_APRS
public static final int PROTOCOL_OPENTRAC
public static final int PROTOCOL_AX25
PROTOCOL_APRS,
PROTOCOL_OPENTRAC,
Constant Field Valuespublic static final int MAX_PROTOCOL_BIT
public static final int SENTENCE_NONE
public static final int SENTENCE_GPWPL
public static final int SENTENCE_PKWDWPL
public static final int FLAGS_HF
public static final int FLAGS_UDP
public static final int FLAGS_LOCAL
public java.lang.String portType
public boolean enabled
public PortConfig()
public final PortConfig.Cfg current()
public final PortConfig.Cfg specific(java.lang.String portType)
portType - the name of the port type whose configuration parameters should be obtainedpublic void assignPortNumber()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the reference object with which to compare.true if this object is the same as the obj
argument; false otherwise.hashCode()public int hashCode()
java.util.Hashtable.hashCode in class java.lang.Objectequals(Object)public java.lang.String getDisplayName()
public int getPortNumber()
public java.lang.String toString()
toString in class java.lang.Objectpublic PortConfig dup()
public void copyInto(PortConfig dest)
dest - destination PortConfigpublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparableo - the object to be compared.java.lang.ClassCastException - if the specified object's type prevents it
from being compared to this object.public void writeToPreferences(java.util.prefs.Preferences root)
root - Preferences node to use to store the Ports sub-nodepublic void removeFromPreferences(java.util.prefs.Preferences root)
root - Preferences node used to store the Ports sub-nodepublic static PortConfig readFromPreferences(java.util.prefs.Preferences root, java.lang.String displayName)
root - Preferences node used to store the Ports sub-nodedisplayName - the String port identifier name to read