Oracle® Java Micro Edition Embedded Client Architecture Guide Release 1.1.1 E23813-02 |
|
Previous |
This appendix describes how to configure an OS-level serial port on a Linux device so that a Java application can use the javax.microedition.io.CommConnection
interface to access the corresponding logical serial port connection.
This appendix includes these topics:
Note: While this example is based on the RS-232 serial interface implementation of |
Table C-1 Serial Communications References
Interface | Document |
---|---|
RS-232 serial communications |
|
|
|
Serial port configuration |
|
Serial port driver interface |
|
Setup a serial cable connection between two Linux computers.
Become super user, then configure the serial port to use IRQ 4.
# setserial /dev/ttyS0 irq 4
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.
Launch the minicom
serial communications program in setup mode.
# minicom -s
Select Serial port setup
from the [configuration]
menu.
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
.
Press <ENTER> to confirm the change.
Press <ENTER> again to exit the setup menu.
Select the Save setup as dfl menu option.
Select the Exit menu option.
This initializes the serial port.
Type <CONTROL>-a q to finally exit minicom
.
Follow a similar configuration procedure with the other computer connected to the serial cable.
The serial connection between the two computers can be tested with the minicom
serial communications program.
Remotely login to each computer.
Launch the minicom
(1) serial communications program on each computer.
Type some text into a minicom
window.
Type <CONTROL>-a q to finally exit minicom
.
This should determine that the serial connection is correct.