-
Notifications
You must be signed in to change notification settings - Fork 151
Open
Description
I'm attempting to contact with a chip card device using serial communication, which is linked to a reader via a serial port. The communication works fine when I use the initial baud rate 9600, but when I change the initial baud rate (9600) of my serial port communication to a higher baud rate value (e.g. - 115200), the device closes the connection, despite the fact that the same device works fine with a higher baud rate using the javax.comm library. Please see the code snippet attached.
public void setBaudRate(int rate) throws UnsupportedCommOperationException {
if (null != serialPort) {
if (serialPort.getBaudRate() != rate) {
boolean rts = serialPort.isRTS();
boolean dtr = serialPort.isDTR();
serialPort = nrSerialPort.getSerialPortInstance();// Extracting the serialPort instance
serialPort.setSerialPortParams(rate, serialPort.getDataBits(), serialPort.getStopBits(), serialPort.getParity());
serialPort.setDTR(dtr);
serialPort.setRTS(rts);
}
}
}
Is the baud rate changing supported by the nrjavaserial library?
Metadata
Metadata
Assignees
Labels
No labels