JMU
Serial Communication
Including the History of the RS-232 Protocol


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu


Two Approaches to Data Communication
Serial Communications
Serial Communications (cont.)
History: The RS-232 Protocol
History: Common Connectors
History: One Popular Scheme
History: RS-232C Pins/Signals (DB-25, DB-9)
History: RS-232C Details
Universal Serial Bus (USB)
Accessing USB Ports in Java
An Example: Locating the Serial Port
    SerialPort[] ports = SerialPort.getCommPorts();
    
    for (SerialPort port:ports)
    {
      String description = port.getPortDescription();
      String path = port.getSystemPortPath();
      System.out.println(description + "\t" + path);
    }
  
An Example: Getting an InputStream
    SerialPort port = SerialPort.getCommPort(path); 
    port.openPort();
    port.setComPortTimeouts(SerialPort.TIMEOUT_READ_SEMI_BLOCKING, 0, 0);
    InputStream is = port.getInputStream();