Skip to content

Instantly share code, notes, and snippets.

@saviour123
Created October 26, 2017 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saviour123/616cae1413ffdce7800f2e0f1c223f1e to your computer and use it in GitHub Desktop.
Save saviour123/616cae1413ffdce7800f2e0f1c223f1e to your computer and use it in GitHub Desktop.
import com.fazecast.jSerialComm.SerialPort;
public class clean {
public static void main(String[] args) {
SerialPort[] ttyPort = SerialPort.getCommPorts();
for (SerialPort i: ttyPort) {
i.openPort();
System.out.println(i.bytesAvailable());
i.closePort();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment