|
Serial Communication
Including the History of the RS-232 Protocol |
|
Prof. David Bernstein |
| Computer Science Department |
| bernstdh@jmu.edu |
SerialPort[] ports = SerialPort.getCommPorts();
for (SerialPort port:ports)
{
String description = port.getPortDescription();
String path = port.getSystemPortPath();
System.out.println(description + "\t" + path);
}
InputStream
SerialPort port = SerialPort.getCommPort(path);
port.openPort();
port.setComPortTimeouts(SerialPort.TIMEOUT_READ_SEMI_BLOCKING, 0, 0);
InputStream is = port.getInputStream();