de.bsvrz.kex.tls.osi2osi3.osi2.tc57primary
Class SerialPortControl
java.lang.Object
de.bsvrz.kex.tls.osi2osi3.osi2.tc57primary.SerialPortControl
- All Implemented Interfaces:
- gnu.io.SerialPortEventListener, EventListener
public class SerialPortControl
- extends Object
- implements gnu.io.SerialPortEventListener
Klasse zum Senden und Empfangen von TC57-Telegrammen via serieller Schnittstelle.
- Author:
- Kappich Systemberatung
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_debug
private static final Debug _debug
OPEN_ACCESS_LOCK
private static final Object OPEN_ACCESS_LOCK
_propertyConsultant
private PropertyConsultant _propertyConsultant
_port
private gnu.io.SerialPort _port
_out
private OutputStream _out
_in
private InputStream _in
_rtsOnSend
private boolean _rtsOnSend
_rtsPreSendDelay
private int _rtsPreSendDelay
_rtsPostSendDelay
private int _rtsPostSendDelay
_tap
private int _tap
_interCharacterTimeout
private int _interCharacterTimeout
_waitForCts
private boolean _waitForCts
_pendingOutput
private boolean _pendingOutput
_checkDsr
private boolean _checkDsr
_lastSendTime
private long _lastSendTime
_pendingInput
private int _pendingInput
_receiving
private boolean _receiving
_lastReadTime
private long _lastReadTime
_parityError
private boolean _parityError
_overrunError
private boolean _overrunError
_receivedCount
private int _receivedCount
_receiveBuffer
private byte[] _receiveBuffer
_flushAfterSend
private boolean _flushAfterSend
_byteTransmitDurationMicros
private long _byteTransmitDurationMicros
_portName
private String _portName
_initialized
private boolean _initialized
_waitWhilePendingOutput
private boolean _waitWhilePendingOutput
SerialPortControl
public SerialPortControl()
start
public void start(PropertyQueryInterface propertyQueryInterface,
String applicationName)
throws Exception
- Throws:
Exception
shutdown
public void shutdown()
getEventTypeName
static String getEventTypeName(int eventType)
sendPacket
private void sendPacket(int waitTimeSinceLastReceive,
byte[] packet)
throws InterruptedException,
IOException
- Throws:
InterruptedException
IOException
prepareReceive
private void prepareReceive()
throws IOException
- Throws:
IOException
receivePacket
private byte[] receivePacket(ByteBuffer buffer,
int timeout)
throws InterruptedException
- Throws:
InterruptedException
serialEvent
public void serialEvent(gnu.io.SerialPortEvent serialPortEvent)
- Specified by:
serialEvent
in interface gnu.io.SerialPortEventListener
query
public byte[] query(int waitTimeSinceLastReceive,
byte[] sendBytes,
int receiveTimeout)
throws InterruptedException,
IOException
- Throws:
InterruptedException
IOException
readPacket
private byte[] readPacket(int timeout)
throws InterruptedException,
IOException
- Throws:
InterruptedException
IOException
readBytes
public byte[] readBytes(long timeout)
throws InterruptedException
- Throws:
InterruptedException