Lifelesspeople.com

 Forum FAQsForum FAQs  Knowledge BaseKnowledge Base  RulesRules   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   HostingHosting   RegisterRegister 
 DonateDonate   WikiWiki   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Java IO

 
Lifelesspeople.com Forum Index -> Web Architects' Abode
Post new topic   Reply to topic View previous topic :: View next topic  
Author Message
StarBuck
Novice Poster


Joined: 21 Jan 2008
Posts: 35
Location: Skopje

PostPosted: Sat Jan 26, 2008 1:06 am    Post subject: Java IO Reply with quote

Does anyone have good experience in Java Input-Output libraries, more specifically serial communication?

I need some help in reading data from a serial port (com port) into a java application...

So far I've been able to open up a talk-listen connection with the input device, but I've got no luck with the "listen" part Confused
_________________
[img:d0a44f4fbc]http://img210.imageshack.us/img210/8986/buckco0.gif[/img:d0a44f4fbc]
Back to top
 
exsanguination
Forum Regular


Joined: 27 Apr 2005
Posts: 412
Location: Australia

PostPosted: Tue Jan 29, 2008 5:28 pm    Post subject: Reply with quote

Have you found this chapter on serial port programming??
http://java.sun.com/developer/.....ook/11.pdf

Basically you open up the correct COMPort, cast it to SerialPort, set the appropriate properties using setSerialPortParams, and then using the COMPort object you can use the getInputStream and getOutputStream methods to open up the streams and use them in exactly the same way you would for File IO.

If you need to be notified when data is available to read, then you need to implement the SerialPortEventListener interface and on your SerialPort object use the method notifyOnDataAvailable(boolean) and then add you event listener using the addEventListener(SerialPortEventListener) method.
Back to top
 
StarBuck
Novice Poster


Joined: 21 Jan 2008
Posts: 35
Location: Skopje

PostPosted: Wed Jan 30, 2008 3:22 am    Post subject: Reply with quote

thanks a lot for the paper man, I'll try it out as soon as I can and I'll let you know how it works out Very Happy
_________________
[img:d0a44f4fbc]http://img210.imageshack.us/img210/8986/buckco0.gif[/img:d0a44f4fbc]
Back to top
 
Display posts from previous:   
Post new topic   Reply to topic    Lifelesspeople.com Forum Index -> Web Architects' Abode All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Home | Hosting | News | Forum | Links | System Status | About | Archive | Donate ]
Powered by phpBB © 2001, 2002 phpBB Group
All trademarks and copyrights on this page are owned by their respective owners. Posts and comments are owned by the poster. Everything else © 2001 - 2007 Lifelesspeople.com