org.ka2ddo.ax25
Class Connector

java.lang.Object
  extended by org.ka2ddo.ax25.Connector
Direct Known Subclasses:
PortConnector

public abstract class Connector
extends java.lang.Object

This class defines the generic API for an object that connects a bidirectional real-time data stream to this application.


Nested Class Summary
static class Connector.PortStats
          A data structure recording throughput statistics for its containing PortConnector instance.
 
Field Summary
static int CAP_FULL_DUPLEX
          A port that can both send and receive data simultaneously.
static int CAP_GPS_DATA
          A port capable of providing NMEA GPS data.
static int CAP_HF
          A port that has HF radio access (i.e., low bandwidth, excessive geographical coverage).
static int CAP_IGATE
          A port with a connection to the Internet and APRS-IS backbone.
static int CAP_OPENTRAC
          A port that can speak the OpenTRAC protocol.
static int CAP_RCV_PACKET_DATA
          A port that is capable of receiving AX.25 (or equivalent) data frames.
static int CAP_RF
          A port that has local RF access.
static int CAP_WAYPOINT_SENDER
          A port capable of accepting NMEA waypoint data.
static int CAP_WEATHER
          A port that can provide weather data through the WeatherDistributor.
static int CAP_XMT_PACKET_DATA
          A port that is capable of transmitting AX.25 (or equivalent) data frames.
protected  Connector.PortStats stats
          Statistics about this PortConnector.
 
Constructor Summary
Connector()
           
 
Method Summary
 void close()
          Shut down this port connection.
protected  void finalize()
           
 java.lang.String getCallsign()
          For ports that have an AX.25 address (callsign), report the callsign associated with the port (used for transmissions initiated through this port instead of digipeated).
 int getCapabilities()
          Specify what capabilities a port of this type has.
 Connector.PortStats getStats()
          Get the current statistics for this PortConnector instance.
 boolean hasCapability(int capMask)
          Test if this PortConnector has the specified capability or capabilities.
abstract  boolean isOpen()
          Reports whether this Connector has an open connection to its port.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stats

protected Connector.PortStats stats
Statistics about this PortConnector.


CAP_XMT_PACKET_DATA

public static final int CAP_XMT_PACKET_DATA
A port that is capable of transmitting AX.25 (or equivalent) data frames.

See Also:
SerialTNCConnector, AGWPEConnector, AprsIsConnector, Constant Field Values

CAP_RCV_PACKET_DATA

public static final int CAP_RCV_PACKET_DATA
A port that is capable of receiving AX.25 (or equivalent) data frames.

See Also:
SerialTNCConnector, KenwoodConnector, AGWPEConnector, AprsIsConnector, Constant Field Values

CAP_IGATE

public static final int CAP_IGATE
A port with a connection to the Internet and APRS-IS backbone.

See Also:
AprsIsConnector, Constant Field Values

CAP_GPS_DATA

public static final int CAP_GPS_DATA
A port capable of providing NMEA GPS data.

See Also:
SerialGpsConnector, KenwoodConnector, GPSDistributor, Constant Field Values

CAP_WAYPOINT_SENDER

public static final int CAP_WAYPOINT_SENDER
A port capable of accepting NMEA waypoint data.

See Also:
Constant Field Values

CAP_FULL_DUPLEX

public static final int CAP_FULL_DUPLEX
A port that can both send and receive data simultaneously. For example, most TNC ports will not specify this (because the associated radio cannot transmit and receive simultaneously on the same channel), but an Internet connection will specify this capability.

See Also:
AprsIsConnector, Constant Field Values

CAP_WEATHER

public static final int CAP_WEATHER
A port that can provide weather data through the WeatherDistributor.

See Also:
SerialWeatherConnector, WxnowTxtConnector, WeatherDistributor, Constant Field Values

CAP_RF

public static final int CAP_RF
A port that has local RF access.

See Also:
SerialTNCConnector, KenwoodConnector, AGWPEConnector, Constant Field Values

CAP_OPENTRAC

public static final int CAP_OPENTRAC
A port that can speak the OpenTRAC protocol.

See Also:
SerialTNCConnector, AGWPEConnector, Constant Field Values

CAP_HF

public static final int CAP_HF
A port that has HF radio access (i.e., low bandwidth, excessive geographical coverage).

See Also:
PortConfig.FLAGS_HF, Constant Field Values
Constructor Detail

Connector

public Connector()
Method Detail

getStats

public Connector.PortStats getStats()
Get the current statistics for this PortConnector instance.

Returns:
PortStats for this port.

close

public void close()
Shut down this port connection. Expected to be overridden by sub-classes.


finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

isOpen

public abstract boolean isOpen()
Reports whether this Connector has an open connection to its port.

Returns:
boolean true if Connector is open

getCallsign

public java.lang.String getCallsign()
For ports that have an AX.25 address (callsign), report the callsign associated with the port (used for transmissions initiated through this port instead of digipeated). By default, returns empty string. Subclasses are expected to override this.

Returns:
callsign String, or null if no associated callsign

getCapabilities

public int getCapabilities()
Specify what capabilities a port of this type has. By default, returns a zero bitmask (not capable of anything). Expected to be overridden by subclasses.

Returns:
bitmask of capability flags
See Also:
CAP_RCV_PACKET_DATA, CAP_XMT_PACKET_DATA, CAP_FULL_DUPLEX, CAP_GPS_DATA, CAP_IGATE, CAP_OPENTRAC, CAP_RF, CAP_WAYPOINT_SENDER, CAP_WEATHER

hasCapability

public boolean hasCapability(int capMask)
Test if this PortConnector has the specified capability or capabilities.

Parameters:
capMask - bitmask of capabilities to be tested for
Returns:
boolean true if this port has all the specified capabilities in its capability set