Increase rxtx buffer size.
SmartBotKit/serial/master This commit looks good

This commit is contained in:
Marcus Handte
2019-05-06 14:41:17 +02:00
parent 3c913f404e
commit 5ae66da6cf
@@ -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);