public class SerialPortControl extends Object implements gnu.io.SerialPortEventListener
Modifier and Type | Field and Description |
---|---|
private long |
_byteTransmitDurationMicros |
private boolean |
_checkDsr |
private static Debug |
_debug |
private boolean |
_flushAfterSend |
private InputStream |
_in |
private boolean |
_initialized |
private int |
_interCharacterTimeout |
private long |
_lastReadTime |
private long |
_lastSendTime |
private OutputStream |
_out |
private boolean |
_overrunError |
private boolean |
_parityError |
private int |
_pendingInput |
private boolean |
_pendingOutput |
private gnu.io.SerialPort |
_port |
private String |
_portName |
private PropertyConsultant |
_propertyConsultant |
private byte[] |
_receiveBuffer |
private int |
_receivedCount |
private boolean |
_receiving |
private boolean |
_rtsOnSend |
private int |
_rtsPostSendDelay |
private int |
_rtsPreSendDelay |
private int |
_tap |
private boolean |
_waitForCts |
private boolean |
_waitForDcdDown |
private boolean |
_waitWhilePendingOutput |
private static Object |
OPEN_ACCESS_LOCK |
Constructor and Description |
---|
SerialPortControl() |
Modifier and Type | Method and Description |
---|---|
(package private) static String |
getEventTypeName(int eventType) |
private void |
prepareReceive() |
byte[] |
query(int waitTimeSinceLastReceive,
byte[] sendBytes,
int receiveTimeout) |
byte[] |
readBytes(long timeout) |
private byte[] |
readPacket(int timeout) |
private byte[] |
receivePacket(ByteBuffer buffer,
int timeout) |
private void |
sendPacket(int waitTimeSinceLastReceive,
byte[] packet) |
void |
serialEvent(gnu.io.SerialPortEvent serialPortEvent) |
void |
shutdown() |
void |
start(PropertyQueryInterface propertyQueryInterface,
String applicationName) |
private static final Debug _debug
private static final Object OPEN_ACCESS_LOCK
private PropertyConsultant _propertyConsultant
private gnu.io.SerialPort _port
private OutputStream _out
private InputStream _in
private boolean _rtsOnSend
private int _rtsPreSendDelay
private int _rtsPostSendDelay
private int _tap
private int _interCharacterTimeout
private boolean _waitForCts
private boolean _waitForDcdDown
private boolean _pendingOutput
private boolean _checkDsr
private long _lastSendTime
private int _pendingInput
private boolean _receiving
private long _lastReadTime
private boolean _parityError
private boolean _overrunError
private int _receivedCount
private byte[] _receiveBuffer
private boolean _flushAfterSend
private long _byteTransmitDurationMicros
private String _portName
private boolean _initialized
private boolean _waitWhilePendingOutput
public void start(PropertyQueryInterface propertyQueryInterface, String applicationName) throws Exception
Exception
public void shutdown()
static String getEventTypeName(int eventType)
private void sendPacket(int waitTimeSinceLastReceive, byte[] packet) throws InterruptedException, IOException
InterruptedException
IOException
private void prepareReceive() throws IOException
IOException
private byte[] receivePacket(ByteBuffer buffer, int timeout) throws InterruptedException
InterruptedException
public void serialEvent(gnu.io.SerialPortEvent serialPortEvent)
serialEvent
in interface gnu.io.SerialPortEventListener
public byte[] query(int waitTimeSinceLastReceive, byte[] sendBytes, int receiveTimeout) throws InterruptedException, IOException
InterruptedException
IOException
private byte[] readPacket(int timeout) throws InterruptedException, IOException
InterruptedException
IOException
public byte[] readBytes(long timeout) throws InterruptedException
InterruptedException