org.ka2ddo.yaac.io
Class AGWPEConnector

java.lang.Object
  extended by org.ka2ddo.ax25.Connector
      extended by org.ka2ddo.yaac.io.PortConnector
          extended by org.ka2ddo.yaac.io.TransmittingPortConnector
              extended by org.ka2ddo.yaac.io.TNCConnector
                  extended by org.ka2ddo.yaac.io.AGWPEConnector

public class AGWPEConnector
extends TNCConnector

This class defines a driver for using the Windows AGWPE software TNC/multiplexer with YAAC, or emulations thereof such as software TNCs like as Sivan Toledo's soundmodem or the DireWolf software. Note as a stupid coding restriction, this only supports 1 AGWPE server per IP address (but how likely is anyone to run multiple AGWPE servers on the same box when one server can handle multiple sound cards and hardware TNCs?).


Nested Class Summary
 
Nested classes/interfaces inherited from class org.ka2ddo.ax25.Connector
Connector.PortStats
 
Field Summary
static java.lang.String CONFIG_GUI
           
static java.lang.String TYPE_NAME
           
 
Fields inherited from class org.ka2ddo.yaac.io.PortConnector
currentCfg, portConfig
 
Fields inherited from class org.ka2ddo.ax25.Connector
CAP_FULL_DUPLEX, CAP_GPS_DATA, CAP_HF, CAP_IGATE, CAP_OPENTRAC, CAP_RCV_PACKET_DATA, CAP_RF, CAP_WAYPOINT_SENDER, CAP_WEATHER, CAP_XMT_PACKET_DATA, stats
 
Constructor Summary
AGWPEConnector()
           
 
Method Summary
 void close()
          Shut down this port connection.
 void configure(PortConfig config)
          Update the configuration of the connector to match the updated setup.
 int getBitRate()
          Get the bit transmission rate for the radio on this port.
 int getCapabilities()
          Specify what capabilities a port of this type has.
static java.lang.String[] getRadioPortNames(java.lang.String ipAddress, int socketPort, java.lang.String oldAgwpePortName)
          Get the list of ports discovered on this AGWPE server.
static boolean hasLocalAGWPE()
          Test if the host computer is potentially running AGWPE with TCP/IP support.
 boolean isOpen()
          Test if the connection to the associated AGWPE server is open and working.
 void sendFrame(AX25Frame frame)
          Transmit an AX.25 frame through this port.
 java.lang.String toString()
           
 
Methods inherited from class org.ka2ddo.yaac.io.TNCConnector
convertTNC2FormatToAX25Frame, getCallsign, getPortAddress, setPortAddress
 
Methods inherited from class org.ka2ddo.yaac.io.PortConnector
addFrameListener, addPortEventListener, createPort, fireConsumeFrame, fireConsumeFrame, fireFailed, fireReceiving, fireTransmitting, getPortConnectorClass, portConnectorClasses, portTypeNames, registerPortConnectorType, removeFrameListener, removePortEventListener, setPortConfig
 
Methods inherited from class org.ka2ddo.ax25.Connector
finalize, getStats, hasCapability
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_NAME

public static final java.lang.String TYPE_NAME
See Also:
Constant Field Values

CONFIG_GUI

public static final java.lang.String CONFIG_GUI
See Also:
Constant Field Values
Constructor Detail

AGWPEConnector

public AGWPEConnector()
Method Detail

configure

public void configure(PortConfig config)
               throws java.io.IOException,
                      java.lang.IllegalArgumentException
Update the configuration of the connector to match the updated setup.

Specified by:
configure in class PortConnector
Parameters:
config - PortConfig defining new port settings
Throws:
java.io.IOException - if interface changes could not be applied
java.lang.IllegalArgumentException - if type information is invalid for changing the settings of this PortConnector

sendFrame

public void sendFrame(AX25Frame frame)
               throws java.io.IOException
Transmit an AX.25 frame through this port. May fail silently if port is not configured for transmission (receive-only).

Specified by:
sendFrame in class TransmittingPortConnector
Parameters:
frame - AX25Frame object to transmit
Throws:
java.io.IOException - if transmit failed for any reason other than a receive-only port

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getCapabilities

public int getCapabilities()
Specify what capabilities a port of this type has.

Overrides:
getCapabilities in class Connector
Returns:
bitmask of capability flags
See Also:
Connector.CAP_RCV_PACKET_DATA, Connector.CAP_XMT_PACKET_DATA, Connector.CAP_FULL_DUPLEX, Connector.CAP_GPS_DATA, Connector.CAP_IGATE, Connector.CAP_OPENTRAC, Connector.CAP_RF, Connector.CAP_WAYPOINT_SENDER, Connector.CAP_WEATHER

hasLocalAGWPE

public static boolean hasLocalAGWPE()
Test if the host computer is potentially running AGWPE with TCP/IP support.

Returns:
boolean true if the AGWPE service appears to be running

isOpen

public boolean isOpen()
Test if the connection to the associated AGWPE server is open and working.

Specified by:
isOpen in class Connector
Returns:
boolean true if AGWPE connection is open

getRadioPortNames

public static java.lang.String[] getRadioPortNames(java.lang.String ipAddress,
                                                   int socketPort,
                                                   java.lang.String oldAgwpePortName)
                                            throws java.io.IOException
Get the list of ports discovered on this AGWPE server.

Parameters:
ipAddress - String of IP address to AGWPE server
socketPort - TCP port number for AGWPE server
oldAgwpePortName - String of port number currently in use on AGWPEConnector (or null if not initialized yet)
Returns:
array of String port names
Throws:
java.io.IOException - if expected socket error communicating with AGWPE server

close

public void close()
Shut down this port connection.

Overrides:
close in class Connector

getBitRate

public int getBitRate()
Get the bit transmission rate for the radio on this port.

Overrides:
getBitRate in class TNCConnector
Returns:
bit rate in bits per second