wonderly.jeaprs.net.aprs
Class IGATEStream

java.lang.Object
  |
  +--wonderly.jeaprs.aprs.APRSStreamHandler
        |
        +--wonderly.jeaprs.net.aprs.IGATEStream
All Implemented Interfaces:
APRSEventGenerator, APRSInput, APRSIOModule, APRSOutput, IOModule, TNC

public class IGATEStream
extends APRSStreamHandler
implements TNC

This class provides access to a Internet connected TNC stream. This is still under development and is not known to work correctly.

Version:
1.0
Author:
Gregg Wonderly - The information contained in this document is Copyright 2001-2003, Gregg Wonderly, all rights reserved.

Field Summary
 
Fields inherited from interface wonderly.jeaprs.TNC
TNC_TYPE_EHF, TNC_TYPE_HF, TNC_TYPE_NET, TNC_TYPE_UHF, TNC_TYPE_VHF
 
Constructor Summary
IGATEStream()
           
 
Method Summary
 void close()
          Close the stream when done
 void flush()
           
 java.lang.String getHostName()
           
 java.io.InputStream getInputStream()
          Returns the input stream for the TNC.
 java.io.OutputStream getOutputStream()
          Returns the output stream for the TNC
 int getPort()
           
 int getTNCType()
          Returns what type this TNC was configured for (TNC_TYPE_*).
 void initialize(wonderly.jeaprs.ui.JeAPRSUI ui)
          Set everything up, open ports etc
 void initTNC()
          Send initialization commands to TNC
 boolean isInitialized()
          Tracks whether initTNC has been called
 boolean isKiss()
           
 void lockTNC(boolean how)
          Causes this object to block/release access to the TNC stream
 byte[] readPacket()
          Reads a packet from the TNC.
 void setHostName(java.lang.String name)
           
 void setInitialized(boolean how)
           
 void setKiss(boolean how)
          sets the use of KISS mode based on the passed parameter
 void setPort(int port)
           
 void setTNCType(int type)
          Sets what type this TNC should be recognized as providing (TNC_TYPE_*).
 java.lang.String toString()
           
 void waitReady()
          Waits until the TNC stream is ready to be used
 void write(wonderly.jeaprs.ByteString from, wonderly.jeaprs.ByteString toCall, wonderly.jeaprs.ByteString path, byte[] arr)
          Write the data in arr to the TNC 'device'.
 void write(wonderly.jeaprs.ByteString from, wonderly.jeaprs.ByteString toCall, wonderly.jeaprs.ByteString path, wonderly.jeaprs.ByteString str)
          Write the data in strstr to the TNC 'device' followed by a <CR>.
 
Methods inherited from class wonderly.jeaprs.aprs.APRSStreamHandler
addAPRSEventListener, addAPRSStatusListener, addStreamListener, getAPRSEventListeners, getAPRSStatusListeners, getDebugging, getModuleId, processAPRSPacket, processTNCStream, removeAPRSEventListener, removeAPRSStatusListener, removeStreamListener, sendBadPacket, sendEOFStatus, setDebugging, setModuleId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wonderly.jeaprs.io.IOModule
getModuleId, setModuleId
 

Constructor Detail

IGATEStream

public IGATEStream()
Method Detail

toString

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

close

public void close()
Description copied from interface: APRSInput
Close the stream when done

Specified by:
close in interface APRSInput

setTNCType

public void setTNCType(int type)
Description copied from interface: TNC
Sets what type this TNC should be recognized as providing (TNC_TYPE_*).

Specified by:
setTNCType in interface TNC

getTNCType

public int getTNCType()
Description copied from interface: TNC
Returns what type this TNC was configured for (TNC_TYPE_*).

Specified by:
getTNCType in interface TNC

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in interface TNC
java.io.IOException

isKiss

public boolean isKiss()
Specified by:
isKiss in interface TNC
Returns:
true if this TNC is in KISS mode

setKiss

public void setKiss(boolean how)
Description copied from interface: TNC
sets the use of KISS mode based on the passed parameter

Specified by:
setKiss in interface TNC

getInputStream

public java.io.InputStream getInputStream()
Description copied from interface: TNC
Returns the input stream for the TNC.

Specified by:
getInputStream in interface TNC

lockTNC

public void lockTNC(boolean how)
Description copied from interface: TNC
Causes this object to block/release access to the TNC stream

Specified by:
lockTNC in interface TNC

isInitialized

public boolean isInitialized()
Description copied from interface: TNC
Tracks whether initTNC has been called

Specified by:
isInitialized in interface TNC

setInitialized

public void setInitialized(boolean how)

waitReady

public void waitReady()
Description copied from interface: TNC
Waits until the TNC stream is ready to be used

Specified by:
waitReady in interface TNC

getHostName

public java.lang.String getHostName()

setHostName

public void setHostName(java.lang.String name)

setPort

public void setPort(int port)

getPort

public int getPort()

getOutputStream

public java.io.OutputStream getOutputStream()
Description copied from interface: TNC
Returns the output stream for the TNC

Specified by:
getOutputStream in interface TNC

initialize

public void initialize(wonderly.jeaprs.ui.JeAPRSUI ui)
                throws java.io.IOException
Description copied from interface: TNC
Set everything up, open ports etc

Specified by:
initialize in interface TNC
java.io.IOException

write

public void write(wonderly.jeaprs.ByteString from,
                  wonderly.jeaprs.ByteString toCall,
                  wonderly.jeaprs.ByteString path,
                  wonderly.jeaprs.ByteString str)
           throws java.io.IOException
Description copied from interface: APRSOutput
Write the data in strstr to the TNC 'device' followed by a <CR>. If kissMode is 'true', then callstr, toCall and pathstr are all used to formulate a KISS mode packet, otherwise they are ignored.

Specified by:
write in interface APRSOutput
Parameters:
toCall - the to call/unproto field.
java.io.IOException

write

public void write(wonderly.jeaprs.ByteString from,
                  wonderly.jeaprs.ByteString toCall,
                  wonderly.jeaprs.ByteString path,
                  byte[] arr)
           throws java.io.IOException
Description copied from interface: APRSOutput
Write the data in arr to the TNC 'device'. If kissMode is 'true', then callstr, toCall and pathstr are all used to formulate a KISS mode packet, otherwise they are ignored.

Specified by:
write in interface APRSOutput
Parameters:
toCall - the to call/unproto field.
arr - the contents of the packet.
java.io.IOException

readPacket

public byte[] readPacket()
                  throws java.io.IOException
Description copied from interface: APRSInput
Reads a packet from the TNC. Normally, an APRSStreamHandler is using this stream and will be calling this method and then dispatching the packet to the listeners of that APRSStreamHandler.

Specified by:
readPacket in interface APRSInput
java.io.IOException
See Also:
APRSStreamHandler, wonderly.jeaprs.aprs.APRSEventListener, APRSStatusListener

initTNC

public void initTNC()
Description copied from interface: TNC
Send initialization commands to TNC

Specified by:
initTNC in interface TNC