|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--wonderly.jeaprs.aprs.APRSStreamHandler
|
+--wonderly.jeaprs.io.aprs.TNCStream
This class provides access to a Serial Port connected TNC stream. The device is initialized by a 'tnc.init' file (or kiss.init/kissoff.init) in the current directory of the process (System.getProperty("user.dir"), or by default commands which may work for many generic TNCs.
| Field Summary | |
static int |
C_FLAG
|
static int |
END_FLAG
|
static int |
FEND
|
static int |
FESC
|
protected wonderly.jeaprs.io.TNCInitialization |
fileAccess
|
static int |
FLAG_MASK
|
protected boolean |
hardwareFlow
|
static int |
R1_FLAG
|
static int |
R2_FLAG
|
static int |
SSID_MASK
|
static int |
TFEND
|
static int |
TFESC
|
| Fields inherited from interface wonderly.jeaprs.TNC |
TNC_TYPE_EHF, TNC_TYPE_HF, TNC_TYPE_NET, TNC_TYPE_UHF, TNC_TYPE_VHF |
| Constructor Summary | |
TNCStream()
|
|
| Method Summary | |
void |
close()
Close the stream when done |
void |
flush()
|
int |
getBaudRate()
|
java.lang.String |
getCommPort()
|
int |
getDataBits()
|
java.io.InputStream |
getInputStream()
Returns the input stream for the TNC. |
protected java.io.BufferedReader |
getKissModeOff()
Convert InputStream from TNCInitialization (via fileAccess) to BufferedReader() |
protected java.io.BufferedReader |
getKissModeOn()
Convert InputStream from TNCInitialization (via fileAccess) to BufferedReader() |
java.io.OutputStream |
getOutputStream()
Returns the output stream for the TNC |
int |
getParity()
|
int |
getStopBits()
|
protected java.io.BufferedReader |
getTNCInit()
Convert InputStream from TNCInitialization (via fileAccess) to BufferedReader() |
protected java.io.BufferedReader |
getTNCReset()
Convert InputStream from TNCInitialization (via fileAccess) to BufferedReader() |
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()
Call this method to send the default initialization data to the TNC |
void |
initTNC(wonderly.jeaprs.io.TNCInitialization init)
Call this method to initialize the TNC using the passed TNCInitialization instance instead of the default file based initialization. |
boolean |
isHardwareFlow()
|
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 |
void |
openStream(java.lang.String port)
|
byte[] |
readPacket()
Reads a packet from the TNC. |
void |
setBaudRate(int v)
|
void |
setDataBits(int v)
|
void |
setHardwareFlow(boolean how)
|
void |
setKiss(boolean how)
sets the use of KISS mode based on the passed parameter |
void |
setParity(int v)
|
void |
setStopBits(int v)
|
void |
setTNCType(int type)
Sets what type this TNC should be recognized as providing (TNC_TYPE_*). |
void |
waitReady()
Waits until the TNC stream is ready to be used |
void |
write(wonderly.jeaprs.ByteString callstr,
wonderly.jeaprs.ByteString toCall,
wonderly.jeaprs.ByteString pathstr,
byte[] arr)
Write the data in arr to the TNC 'device'. |
void |
write(wonderly.jeaprs.ByteString callstr,
wonderly.jeaprs.ByteString toCall,
wonderly.jeaprs.ByteString pathstr,
wonderly.jeaprs.ByteString strstr)
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, toString |
| 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 |
| Field Detail |
public static final int FEND
public static final int FESC
public static final int TFEND
public static final int TFESC
public static final int C_FLAG
public static final int R2_FLAG
public static final int R1_FLAG
public static final int END_FLAG
public static final int FLAG_MASK
public static final int SSID_MASK
protected boolean hardwareFlow
protected wonderly.jeaprs.io.TNCInitialization fileAccess
| Constructor Detail |
public TNCStream()
| Method Detail |
public java.lang.String getCommPort()
public void setHardwareFlow(boolean how)
public boolean isHardwareFlow()
public void close()
APRSInput
close in interface APRSInputpublic void setTNCType(int type)
TNC
setTNCType in interface TNCpublic int getTNCType()
TNC
getTNCType in interface TNC
public void flush()
throws java.io.IOException
flush in interface TNCjava.io.IOExceptionpublic boolean isKiss()
isKiss in interface TNCpublic void setKiss(boolean how)
TNC
setKiss in interface TNCpublic java.io.InputStream getInputStream()
TNC
getInputStream in interface TNCpublic void lockTNC(boolean how)
TNC
lockTNC in interface TNCpublic boolean isInitialized()
TNC
isInitialized in interface TNCpublic void waitReady()
TNC
waitReady in interface TNCpublic java.io.OutputStream getOutputStream()
TNC
getOutputStream in interface TNCpublic void setStopBits(int v)
public void setBaudRate(int v)
public void setDataBits(int v)
public void setParity(int v)
public int getStopBits()
public int getBaudRate()
public int getDataBits()
public int getParity()
public void initialize(wonderly.jeaprs.ui.JeAPRSUI ui)
throws java.io.IOException
TNC
initialize in interface TNCjava.io.IOException
public void openStream(java.lang.String port)
throws java.io.IOException,
javax.comm.NoSuchPortException,
javax.comm.PortInUseException,
javax.comm.UnsupportedCommOperationException
java.io.IOException
javax.comm.NoSuchPortException
javax.comm.PortInUseException
javax.comm.UnsupportedCommOperationException
public void write(wonderly.jeaprs.ByteString callstr,
wonderly.jeaprs.ByteString toCall,
wonderly.jeaprs.ByteString pathstr,
wonderly.jeaprs.ByteString strstr)
throws java.io.IOException
APRSOutputstrstr 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.
write in interface APRSOutputtoCall - the to call/unproto field.
java.io.IOException
public void write(wonderly.jeaprs.ByteString callstr,
wonderly.jeaprs.ByteString toCall,
wonderly.jeaprs.ByteString pathstr,
byte[] arr)
throws java.io.IOException
APRSOutputcallstr, toCall and pathstr are all used
to formulate a KISS mode packet, otherwise they are ignored.
write in interface APRSOutputtoCall - the to call/unproto field.arr - the contents of the packet.
java.io.IOException
protected java.io.BufferedReader getKissModeOn()
throws java.io.IOException
java.io.IOException
protected java.io.BufferedReader getTNCInit()
throws java.io.IOException
java.io.IOException
protected java.io.BufferedReader getKissModeOff()
throws java.io.IOException
java.io.IOException
protected java.io.BufferedReader getTNCReset()
throws java.io.IOException
java.io.IOException
public byte[] readPacket()
throws java.io.IOException
APRSInput
readPacket in interface APRSInputjava.io.IOExceptionAPRSStreamHandler,
wonderly.jeaprs.aprs.APRSEventListener,
APRSStatusListenerpublic void initTNC(wonderly.jeaprs.io.TNCInitialization init)
public void initTNC()
initTNC in interface TNC
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||