LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-18-2006, 12:39 AM   #1
MRMadhav
Member
 
Registered: Nov 2005
Location: Mauritius
Distribution: PCQLinux, SUSE Linux,Fedora Core 5, Fedora Core 6, Knoppix Live, Kubuntu Edgy, PCLinuxOS
Posts: 167

Rep: Reputation: 30
Question Listening to Com ports in java


Hi i would like to be able to retrieve data from the port com1 of my computer. A machine is connected to that port and it sends signals to the com1 port. When i use Hyper terminal in windows i am able to read the lines, is there a way to do this in java?
 
Old 05-18-2006, 12:47 AM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

If you're running Linux, you should be able to just open the appropriate device file ("/dev/ttyS0", for example), and use standard Java I/O.

Java also has a "Communications API":
http://java.sun.com/products/javacom...api/index.html

I've never used it myself, but I've heard people say favorable things about it.

'Hope that helps .. PSM
 
Old 05-18-2006, 02:30 AM   #3
MRMadhav
Member
 
Registered: Nov 2005
Location: Mauritius
Distribution: PCQLinux, SUSE Linux,Fedora Core 5, Fedora Core 6, Knoppix Live, Kubuntu Edgy, PCLinuxOS
Posts: 167

Original Poster
Rep: Reputation: 30
Thanks, yes i've searched a bit and i came upon the JavaComm api but it would work only in linux and solaris, Then i found the rxtx api, this one is for windows, mac os x and linux... but the problem is that i don't know how to use it in my app, there are no samples!
 
Old 05-18-2006, 03:21 AM   #4
MRMadhav
Member
 
Registered: Nov 2005
Location: Mauritius
Distribution: PCQLinux, SUSE Linux,Fedora Core 5, Fedora Core 6, Knoppix Live, Kubuntu Edgy, PCLinuxOS
Posts: 167

Original Poster
Rep: Reputation: 30
ok, i found out some samples from the JavaComm api. I replaced the javax.comm.*; with gnu.io.*; and it worked! The prob is that the sample is very confusing, thought it is working just like the hyper terminal of windows!
 
  


Reply

Tags
com, java, port


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick Question about listening ports nevarlen Linux - Newbie 9 06-24-2005 03:40 PM
how to minimize listening ports johnnydangerous Fedora 19 02-13-2005 03:15 PM
Ports listening? dareino Linux - Networking 2 03-31-2004 08:40 AM
Listening SuSE 9 ports uniQ Linux - Security 9 01-24-2004 12:48 AM
XDM listening to ports tarballedtux Linux - Security 7 04-28-2002 05:25 AM


All times are GMT -5. The time now is 04:10 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration