1

I'm reading data from a hardware through the serial port and I'm using readString() method of jssc.

I have used a Timer to get data continuously. Because of this, whenever I changed the command, the received data is a combination relevant to previous and current commands.

While using C# I have solved this with the help of SerialPort.DiscardInBuffer() method.

Are there any methods in jssc equal to SerialPort.DiscardInBuffer() and SerialPort.DiscardOutBuffer()?

Sherantha
  • 462
  • 3
  • 19

1 Answers1

2

Finally,

SerialPort.purgePort(int flags) 

is what I've been looking for.

Sherantha
  • 462
  • 3
  • 19