Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
protected String |
atKommando
AT-Kommando zum versenden.
|
protected boolean |
beenden
Flag, ob beendet werden soll.
|
protected byte[] |
bytePuffer
Bytes zum versenden.
|
protected int |
bytePufferDatenGroesse
Groesse des Byte-Strings zu versenden.
|
protected boolean |
datenFlussGeeignet
Bestimmt ob Daten versendet werden können, wenn die
SW-DatenFlusssteuerung eingeschaltet ist.
|
protected int |
extraDLE
Anzahl der zusätzlich eingefügten DLE's.
|
protected InputStream |
is
Eingabestream serielle Schnittstelle (für die
SW-Datenflusssteuerung).
|
protected static de.bsvrz.sys.funclib.debug.Debug |
LOGGER
Der Logger.
|
protected boolean |
mitDebug
Parameter fuer Debug-Zwecke.
|
protected Object |
mutex
Wird nur als Mutex benutzt.
|
protected OutputStream |
os
Ausgabestream serielle Schnittstelle.
|
protected gnu.io.SerialPort |
port
Die serielle Schnittstelle.
|
protected AsyncSerialPortReader |
reader
Der Reader-Thread.
|
protected boolean |
swDatenFlussSteuerung
Flag, ob die SW-DatenFlusssteuerung eingeschaltet ist.
|
protected int |
versendeteBytes
Anzahl der versendeten Bytes im letzten Chunk.
|
protected int |
versendeteBytesTotal
Anzahl der versendeten Bytes - Summe.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
AsyncSerialPortWriter(gnu.io.SerialPort port,
int pufferSize,
AsyncSerialPortReader read,
boolean swFlowControl)
Standardkonstruktor.
|
Modifier and Type | Method and Description |
---|---|
void |
beenden()
Beendet den Versand-Thread.
|
void |
endBinaryModus()
Wird am Ende des binären Modus aufgerufen, wenn OK als Antwort vom
Modem gekommen ist.
|
void |
outputPufferLeer()
Wird beim Event OutputBufferEmpty aufgerufen.
|
boolean |
ready()
Gibt zurück, ob der Thread bereit ist.
|
void |
run()
Der Arbeiter-Thread.
|
boolean |
sendByte(long timeout,
byte b)
Sendet ein Byte.
|
boolean |
sendBytes(long timeout,
byte[] cmd,
int off,
int len)
Sendet eine Byte-Kette ohne etwas zu ersetzen.
|
boolean |
sendCmd(long timeout,
String cmd)
Sendet ein AT Kommando.
|
int |
sendData(long timeout,
byte[] data,
int off,
int len,
boolean reverseBitOrder)
Versendet Daten im binären Modus.
|
void |
setDebug(boolean debug)
Setzt den Debug-Parameter.
|
void |
setSwFlowStatus(boolean flussGeeignet)
Setzt die SwDatenFlusssteuerung.
|
void |
startBinaryModus()
Wird bei Start des binären Modus aufgerufen, wenn CONNECT als
Antwort vom Modem gekommen ist.
|
protected void |
writeByte(byte b)
Schreibt ein Byte auf die serielle Schnittstelle.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
protected static final de.bsvrz.sys.funclib.debug.Debug LOGGER
protected OutputStream os
protected InputStream is
protected boolean mitDebug
protected int extraDLE
protected String atKommando
protected byte[] bytePuffer
protected int bytePufferDatenGroesse
protected boolean beenden
protected int versendeteBytes
protected int versendeteBytesTotal
protected gnu.io.SerialPort port
protected AsyncSerialPortReader reader
protected boolean swDatenFlussSteuerung
protected boolean datenFlussGeeignet
protected Object mutex
public AsyncSerialPortWriter(gnu.io.SerialPort port, int pufferSize, AsyncSerialPortReader read, boolean swFlowControl) throws IOException
port
- Die serielle SchnittstellepufferSize
- PufferGroesseread
- Der Reader ThreadswFlowControl
- benutze Software-Flusssteuerung ja/neinIOException
- bei Ausnahmenpublic void beenden()
public void endBinaryModus()
public void outputPufferLeer()
public boolean ready()
public void run()
public boolean sendByte(long timeout, byte b)
timeout
- timeoutb
- Bytepublic boolean sendBytes(long timeout, byte[] cmd, int off, int len)
timeout
- Timeoutcmd
- Byte-Kommando zu versendenoff
- Offsetlen
- Lengthpublic boolean sendCmd(long timeout, String cmd)
timeout
- Timeoutcmd
- Kommandopublic int sendData(long timeout, byte[] data, int off, int len, boolean reverseBitOrder) throws Exception
DLE
wird
gedoppelt, damit es vom Modem korrekt interpertiert wirdtimeout
- Timeoutdata
- Datenoff
- Offsetlen
- LaengereverseBitOrder
- Flag, ob die Bitorder umgekehrt werden sollException
- bei Ausnahmenpublic void setDebug(boolean debug)
debug
- true, wenn Debug Ein-istpublic void setSwFlowStatus(boolean flussGeeignet)
flussGeeignet
- true
, wenn SwDatenFlusssteuerung benutzt werden
sollpublic void startBinaryModus()
protected void writeByte(byte b)
b
- Byte zum VersendenCopyright © 2017 BitCtrl Systems GmbH. All rights reserved.