diff --git a/serial-rxtx/src/main/java/com/smartbotkit/serial/rxtx/RxTxSerialPort.java b/serial-rxtx/src/main/java/com/smartbotkit/serial/rxtx/RxTxSerialPort.java index 746e3fd..651ceab 100644 --- a/serial-rxtx/src/main/java/com/smartbotkit/serial/rxtx/RxTxSerialPort.java +++ b/serial-rxtx/src/main/java/com/smartbotkit/serial/rxtx/RxTxSerialPort.java @@ -33,30 +33,30 @@ public class RxTxSerialPort implements ISerialPort { /** * The serial port. */ - private SerialPort port; + protected SerialPort port; /** * The serial configuration. */ - private SerialConfig config; + protected SerialConfig config; /** * The input stream to read from. */ - private InputStream input; + protected InputStream input; /** * The output stream to write to. */ - private OutputStream output; + protected OutputStream output; /** * The flow control listener. */ - private IFlowControlListener flowControlListener; + protected IFlowControlListener flowControlListener; /** * The line error listener. */ - private ILineErrorListener lineErrorListener; + protected ILineErrorListener lineErrorListener; /** * A serial port listener that forwards the events to the listeners. @@ -127,6 +127,9 @@ public class RxTxSerialPort implements ISerialPort { try { port.setSerialPortParams(getBaudRate(), getDataBits(), getStopBits(), getParity()); port.setFlowControlMode(getFlowControl()); + port.setInputBufferSize(4096); + port.setOutputBufferSize(4096); + input = port.getInputStream(); output = port.getOutputStream(); port.addEventListener(serialPortListener);