public abstract class Connector
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Connector.ConnectorType
Type of Connector, used in filtering and deciding whether to digipeat or I-gate
traffic sourced from this connector.
|
static class |
Connector.PortStats
A data structure recording throughput statistics for its containing PortConnector instance.
|
Modifier and Type | Field and Description |
---|---|
static int |
CAP_ADSB
A port processing ADS-B data (not APRS or OpenTRAC).
|
static int |
CAP_FAST_RF_9600
A port doing 9600 baud RF data rate instead of the usual 1200.
|
static int |
CAP_FULL_DUPLEX
A port that can both send and receive data simultaneously.
|
static int |
CAP_GPS_DATA
A port capable of consuming NMEA-0183 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_KENWOOD_CMD
A port that can use Kenwood radio control protocol to alter the settings of the attached radio.
|
static int |
CAP_OPENTRAC
A port that can speak the OpenTRAC protocol.
|
static int |
CAP_OTHER_TRANSPORT
A port using a transport that isn't APRS-IS or RF that is still capable
of receiving and transmitting the equivalent of APRS packets.
|
static int |
CAP_RAW_AX25
A port that can transmit or receive arbitrary raw AX.25 packets (not just APRS or OpenTRAC).
|
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_SUBCLIENT
A port from a sub-client using YAAC as a proxy.
|
static int |
CAP_WAYPOINT_SENDER
A port capable of sending NMEA-0183 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 and Description |
---|
Connector() |
Modifier and Type | Method and Description |
---|---|
static void |
addFrameListener(FrameListener l)
Add an object that wants to be informed of incoming raw AX.25 frames.
|
void |
close()
Shut down this port connection.
|
protected void |
finalize()
Clean up a Connector when the object is garbage-collected.
|
static void |
fireConsumeFrame(AX25Frame frame,
long rcptTimeMsSinceEpoch)
Send an AX.25 frame to all the listeners expecting to process raw frames,
|
protected AX25Frame |
fireConsumeFrame(byte[] buf,
int offset,
int length,
long rcptTimeMsSinceEpoch)
Extract an AX.25 frame from a byte array and send it to all the listeners expecting to process raw frames,
|
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.
|
Connector.ConnectorType |
getType()
Report what type of traffic comes from this connector.
|
boolean |
hasCapability(int capMask)
Test if this Connector has the specified capability or capabilities.
|
abstract boolean |
isOpen()
Reports whether this Connector has an open connection to its port.
|
static void |
removeFrameListener(FrameListener l)
Remove an object that used to be informed about incoming raw AX.25 frames.
|
protected Connector.PortStats stats
public static final int CAP_XMT_PACKET_DATA
public static final int CAP_RCV_PACKET_DATA
public static final int CAP_IGATE
public static final int CAP_GPS_DATA
public static final int CAP_WAYPOINT_SENDER
public static final int CAP_FULL_DUPLEX
public static final int CAP_WEATHER
public static final int CAP_RF
public static final int CAP_OPENTRAC
public static final int CAP_HF
public static final int CAP_KENWOOD_CMD
public static final int CAP_RAW_AX25
public static final int CAP_FAST_RF_9600
public static final int CAP_ADSB
public static final int CAP_SUBCLIENT
public static final int CAP_OTHER_TRANSPORT
public static void addFrameListener(FrameListener l)
l
- FrameListener to addpublic static void removeFrameListener(FrameListener l)
l
- FrameListener to unregisterpublic static void fireConsumeFrame(AX25Frame frame, long rcptTimeMsSinceEpoch)
frame
- AX25Frame to processrcptTimeMsSinceEpoch
- time since Unix epoch when frame started arrivingprotected AX25Frame fireConsumeFrame(byte[] buf, int offset, int length, long rcptTimeMsSinceEpoch)
buf
- byte array supposedly containing an AX.25 frameoffset
- zero-based index into byte array where frame startslength
- number of consecutive bytes in buffer that make up the framercptTimeMsSinceEpoch
- time since Unix epoch when frame started arrivingpublic Connector.PortStats getStats()
public void close()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- if any unhandled problem occurs during cleanuppublic abstract boolean isOpen()
public java.lang.String getCallsign()
public int getCapabilities()
CAP_RCV_PACKET_DATA
,
CAP_XMT_PACKET_DATA
,
CAP_FAST_RF_9600
,
CAP_FULL_DUPLEX
,
CAP_GPS_DATA
,
CAP_HF
,
CAP_IGATE
,
CAP_KENWOOD_CMD
,
CAP_OPENTRAC
,
CAP_ADSB
,
CAP_RAW_AX25
,
CAP_RF
,
CAP_WAYPOINT_SENDER
,
CAP_WEATHER
,
CAP_SUBCLIENT
,
CAP_OTHER_TRANSPORT
public boolean hasCapability(int capMask)
capMask
- bitmask of capabilities to be tested forCAP_ADSB
,
CAP_RCV_PACKET_DATA
,
CAP_XMT_PACKET_DATA
,
CAP_FAST_RF_9600
,
CAP_FULL_DUPLEX
,
CAP_GPS_DATA
,
CAP_HF
,
CAP_IGATE
,
CAP_KENWOOD_CMD
,
CAP_OPENTRAC
,
CAP_RAW_AX25
,
CAP_RF
,
CAP_WAYPOINT_SENDER
,
CAP_WEATHER
,
CAP_SUBCLIENT
,
CAP_OTHER_TRANSPORT
public Connector.ConnectorType getType()