Skip Headers
Oracle® Java Micro Edition Connected Device Configuration Runtime Guide
Release 1.1.2 for Oracle Java Micro Edition Embedded Client
  Go To Table Of Contents


B Serial Port Configuration Notes

The interface allows a CDC Java runtime environment to expose an OS-level serial port as a logical serial port connection. This appendix shows how to configure an OS-level serial port on a Linux system so that a Java application can access the corresponding logical serial port connection.


While this example is based on the RS-232 serial interface implementation of CommConnection in, an alternate implementation could use the CommConnection interface to support other forms of serial communication such as IrDA.

Table B-1 Serial Communications References

Interface Document

RS-232 serial communications

minicom serial communications program


Serial port configuration


Serial port driver interface


B.1 Serial Port Setup

  1. Setup a serial cable connection between two Linux computers.

    Become super-user.

    % su

    This step is necessary to allow non-root users to access the serial port.

  2. Configure the serial port to use IRQ 4.

    # setserial /dev/ttyS0 irq 4
  3. Change the file access permissions for the serial port and the lock file.

    # chmod 777 /dev/ttyS0 /var/lock

    This allows other users to access the serial port.

  4. Launch the minicom serial communications program in setup mode.

    # minicom -s
    1. Select Serial port setup from the [configuration] menu.

    2. In the setup menu, type A to change the Serial Device setting.

      If the Serial Device setting is /dev/modem, then change it to /dev/ttyS0.

    3. Press <ENTER> to confirm the change.

    4. Press <ENTER> again to exit the setup menu.

    5. Select the Save setup as dfl menu option.

    6. Select the Exit menu option.

      This initializes the serial port.

    7. Type <CONTROL>-a q to finally exit minicom.

  5. Follow a similar configuration procedure with the other computer connected to the serial cable.

B.2 OS-Level Testing

The serial connection between the two computers can be tested with the minicom serial communications program.

  1. Remotely login to each computer.

  2. Launch the minicom(1) serial communications program on each computer.

  3. Type some text into one of the minicom windows.

  4. Type <CONTROL>-a q to finally exit minicom.

This should determine that the serial connection is correct.