Hello everyone,


I want to use javax.comm to do serial cable communication on Linux platform. Currently, I can not find enough learning materials (tutorials and samples) from searching the net. Could anyone help to recommend some good ones?


thanks in advance,
George

Hello everyone,


I want to use javax.comm to do serial cable communication on Linux platform. Currently, I can not find enough learning materials (tutorials and samples) from searching the net. Could anyone help to recommend some good ones?


thanks in advance,
George

Your quite lucky the newest version of the javax.comm libarys come with linux support now, so you don't need rxtx. If you look at the javax.comm package it provides some examples of code using the API.

I used it to make a simple application for sending SMS's through a GSM modem. It works quite well.

But anyway check out the API Specs

http://java.sun.com/products/javacomm/reference/api/index.html

and then check out the two examples
simpleread

http://java.sun.com/developer/releases/javacomm/SimpleRead.java

and
simplewrite
http://java.sun.com/developer/releases/javacomm/SimpleWrite.java

Thanks Paul,

Your quite lucky the newest version of the javax.comm libarys come with linux support now, so you don't need rxtx. If you look at the javax.comm package it provides some examples of code using the API.

I used it to make a simple application for sending SMS's through a GSM modem. It works quite well.

But anyway check out the API Specs

http://java.sun.com/products/javacomm/reference/api/index.html

and then check out the two examples
simpleread

http://java.sun.com/developer/releases/javacomm/SimpleRead.java

and
simplewrite
http://java.sun.com/developer/releases/javacomm/SimpleWrite.java

The information you provided is very helpful. My current issue is that, I do not know how to install and configure the library on Linux platform. Where can I find related documents?


regards,
George

I've some problems trying to compile these examples:

I get this problems:

Caught java.lang.ClassNotFoundException: com.sun.comm.Win32Driver while loading driver com.sun.comm.Win32Driver
Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path
Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver
port COM1 not found.

says it all really... It can't find "COM1" using the Solaris classes (which is hardly surprising). It also can't the Windows classes, which is also hardly surprising if you didn't install them.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.