Reputation: 482
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()
?
Upvotes: 2
Views: 1038
Reputation: 482
Finally,
SerialPort.purgePort(int flags)
is what I've been looking for.
Upvotes: 3