Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send data to COM PORT using JAVA? [duplicate]

Possible Duplicate:
Java Serial Communication on Windows

Friends, I want to connect and transfer data to COM PORT (either virtual or original) in JAVA?

like image 441
Srinivasan__ Avatar asked May 23 '09 05:05

Srinivasan__


2 Answers

This question has been asked and answered many times:

Read file from serial port using Java

Reading serial port in Java

Reading file from serial port in Java

Is there Java library or framework for accessing Serial ports?

Java Serial Communication on Windows

to reference a few.

Personally I recommend SerialPort from http://serialio.com - it's not free, but it's well worth the developer (no royalties) licensing fee for any commercial project. Sadly, it is no longer royalty free to deploy, and SerialIO.com seems to have remade themselves as a hardware seller; I had to search for information on SerialPort.

From personal experience, I strongly recommend against the Sun, IBM and RxTx implementations, all of which were unstable in 24/7 use. Refer to my answers on some of the aforementioned questions for details. To be perfectly fair, RxTx may have come a long way since I tried it, though the Sun and IBM implementations were essentially abandoned, even back then.

A newer free option that looks promising and may be worth trying is jSSC (Java Simple Serial Connector), as suggested by @Jodes comment.

like image 162
Lawrence Dol Avatar answered Sep 17 '22 02:09

Lawrence Dol


The Java Communications API (also known as javax.comm) provides applications access to RS-232 hardware (serial ports): http://www.oracle.com/technetwork/java/index-jsp-141752.html

like image 27
Robert Harvey Avatar answered Sep 19 '22 02:09

Robert Harvey