Java Communications Extension API (draft)

Version 1.1 (EA3)

This document provides an overview of the components of the Java Communications API, which is a standard extension to the Java platform. It is not a tutorial; readers should know the basics of serial and parallel port programming, and be comfortable reading the Java Communications Extension API reference pages.

Like all Java standard extensions, the Java Communications Extension API is intended to be implementable from specification by third parties.


javax.comm Extension Package

We thank you for the excellent feedback to date. Based on your comments, we are investigating revisions to the API and reference implementations at this time.

There are three levels of classes in the Java Communications Extension API:

The javax.comm package provides the following basic services:

A Simple Reading Example

SimpleRead.java opens a serial port and creates a thread for asynchronously reading data through an event callback technique.

A Simple Writing Example

SimpleWrite.java opens a serial port for writing data.

Solaris Notes

The Solaris implementation of the Java Communications Extension API requires the Solaris Native Threads Pack for JDK 1.1.x.

Here's how to test the SampleRead.java example above on Solaris:

  1. Attach a null-modem cable between two serial ports.
  2. Start tip(1) on one of the serial ports:
  3. % tip -9600 /dev/term/b
  4. Compile ReadSample.java:
  5. % javac ReadSample.java
  6. Run ReadSample:
  7. % java -native ReadSample
  8. Type text into the tip(1) window.

java-commapi-comments@eng.sun.com