Cross Platform Comms

D

Dave Brown

Hi All,

Can anyone recommened a cross platform comms API ? I need to
communicate via an rs232 port in my app, which is meant to run on
windows/mac & linux. I know they'll be some complications with the port
names but I'm having trouble finding a FREE comms api.

I'm surprised as I thought it would be something that was done in the
very early days of java.

Thanks,

Dave.
 
T

Thomas Weidenfeller

Dave said:
Can anyone recommened a cross platform comms API ? I need to
communicate via an rs232 port in my app, which is meant to run on
windows/mac & linux. I know they'll be some complications with the port
names but I'm having trouble finding a FREE comms api.

Sun's JavaComm. On platforms not supported by Sun either with RxTx as a
provider. Alternatively RxTx stand-alone.
I'm surprised as I thought it would be something that was done in the
very early days of java.

It was, why do you think otherwise? Particularly JavaComm shows its age
painfully.

/Thomas
 
D

Dave Brown

Thomas said:
Sun's JavaComm. On platforms not supported by Sun either with RxTx as a
provider. Alternatively RxTx stand-alone.



It was, why do you think otherwise? Particularly JavaComm shows its age
painfully.

/Thomas

Thanks Thomas.

Any advantage in using rxtx with sun's api ? I've downloaded the
standalone version. I guess when I make the installers for my
application its the installers job to determine the OS and which version
of rxtx to install.
 
T

Thomas Weidenfeller

Dave said:
Any advantage in using rxtx with sun's api ? I've downloaded the
standalone version. I guess when I make the installers for my
application its the installers job to determine the OS and which version
of rxtx to install.

It depends. I personally still prefer JavaComm (if necessary with RxTx
as a driver). JavaComm is the standard API. It is not great, but it is
also not as bad as many claim.

Both JavaComm and RxTx are difficult to install, particularly via
WebStart. JavaComm comes with a properties file which requires to go to
a particular directory, an RxTx installation requires to change
ownership and access rights of the serial device. WebStart is not happy
with any of that.

Both have IMHO bad documentation. Unless you find a pre-build package
you have to compile RxTx on your own.

/Thomas
 
A

Andrew Thompson

Both JavaComm and RxTx are difficult to install, particularly via
WebStart. JavaComm comes with a properties file which requires to go to
a particular directory, an RxTx installation requires to change
ownership and access rights of the serial device. WebStart is not happy
with any of that.

'difficult to install' and 'Webstart is not happy'..

Does that add up to ..
'Webstart, as it exists, cannot be used to install JavaComm or RxTx'?

( I have a variety of projects which require files to go
in specific directories - I have never found a way to get
Webstart to work with that, even if I can name the directory.

Of course, the Webstarted program itself could copy the
files to the target directory on first run, edit the
properties files (etcetera), but that seems rather second-hand.
...As well as adding to the application development time. )
 
D

Dave Brown

Thomas said:
It depends. I personally still prefer JavaComm (if necessary with RxTx
as a driver). JavaComm is the standard API. It is not great, but it is
also not as bad as many claim.

Both JavaComm and RxTx are difficult to install, particularly via
WebStart. JavaComm comes with a properties file which requires to go to
a particular directory, an RxTx installation requires to change
ownership and access rights of the serial device. WebStart is not happy
with any of that.

Both have IMHO bad documentation. Unless you find a pre-build package
you have to compile RxTx on your own.

/Thomas

I agree with the documentation for RXTX, Its practically non-existant !
I'm going through the sample that come with JavaComm and changed the
import to gnu.io to see how it all works.

thankfully it seems I wont be using webstart, i'm trying to make a
standard application with its own installer, i usually use installshield
so hopefully I'll be able to install the stuff with no problems. But I'm
sure when I get to that stage they'll be a whole new set of obstacles
i'll encounter. Ahhhh the fun of development ;-)
 
T

Thomas Weidenfeller

Andrew said:
'difficult to install' and 'Webstart is not happy'..

Does that add up to ..
'Webstart, as it exists, cannot be used to install JavaComm or RxTx'?

It adds up to "I never managed to get WebStart to do it", and "I never
heard of anyone who managed to get WebStart to do it" :)
( I have a variety of projects which require files to go
in specific directories - I have never found a way to get
Webstart to work with that, even if I can name the directory.

Which fits the picture, doesn't it :)

/Thomas
 
A

Andrew Thompson

It adds up to "I never managed to get WebStart to do it", and "I never
heard of anyone who managed to get WebStart to do it" :)

That clarifies the statements for me. [ :-( ]

Thanks.
 
D

Dale King

Thomas said:
It adds up to "I never managed to get WebStart to do it", and "I never
heard of anyone who managed to get WebStart to do it" :)

It won't install it, but it can use it. RxTx is easier, because it
doesn't need that incredibly stupid, stupid properties file.

I have personally done it myself. See this from the unofficial WebStart FAQ:

http://lopica.sourceforge.net/faq.html#comm
 
D

Dale King

RXTX is easier to install. It doesn't need that stupid properties file.
RXTX is also still in actual continuing development. JavaComm has not
been touched since 1998.
It depends. I personally still prefer JavaComm (if necessary with RxTx
as a driver). JavaComm is the standard API. It is not great, but it is
also not as bad as many claim.

I think calling it a standard is being too generous. It is an API put
out by Sun, but I see little justifying calling it a standard.

I see absolutely no reason to prefer JavaComm over RXTX.

I had issues with JavaComm where I would setRecieveTimeou and I would
get timeouts even though there was a steady stream of data and it should
never timeout as long as the device was connected. I could only solve it
by setting notifyOnDataAvailable even though I was not using the event
notification.
Both JavaComm and RxTx are difficult to install, particularly via
WebStart. JavaComm comes with a properties file which requires to go to
a particular directory,

I cannot say enough about the stupidity of that properties file. Whoever
implemented JavaComm had no clue what they were doing.

All the file tells you is the name of the class file to create an
instance of for the platform. That information should have been in the
jar file using the Service Provider specification of the Jar specification.

But just using the stupid properties file wasn't bad enough. I've
decompiled the code for the windows one before and they have checks
throughout the code to make sure that the file is actually there by
repeatedly asking the security manager if it is deletable.
an RxTx installation requires to change
ownership and access rights of the serial device.

For Linux that is.
 
T

Thomas Weidenfeller

Dale said:
It won't install it, but it can use it. RxTx is easier, because it
doesn't need that incredibly stupid, stupid properties file.

RxTx on some platforms (AFAIR Linux) requires superuser rights to change
the ownership and access rights of the serial devices. This is something
I have never seen anyone manging to do from web start.
I have personally done it myself. See this from the unofficial WebStart
FAQ:

http://lopica.sourceforge.net/faq.html#comm

Ouch, what a hack. But ok, I correct my statement:

"I never managed to get WebStart to do it, but I have heard of someone
who managed to get WebStart to do an installation". :)

/Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top