import com.fasterxml.jackson.databind.SerialPort;
public class SerialExample {
public static void main(String[] args) {
SerialPort serialPort = new SerialPort("/dev/ttyUSB0");
serialPort.openPort();
serialPort.setParams(9600, 8, 1, 0);
byte[] writeBuffer = "Hello, Serial!".getBytes();
serialPort.writeBytes(writeBuffer);
serialPort.closePort();
}
}