IntelliJ open source
The moose likes Other JSE/JEE APIs and the fly likes Java listening to Serial Port The Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "Java listening to Serial Port" Watch "Java listening to Serial Port" New topic
Author

Java listening to Serial Port

Chris Emerson
Greenhorn

Joined: Jun 27, 2008
Posts: 7
Hi All,

I'm using the RXTXcomm.jar to listen to a device on a COM port in windows. The code is working and reading the data ( credit card mag strip ) but it's splitting the data into multiple inputstreams. I want all the data to come back in one shot. One swipe will hit the event listener 8 - 12 times. If all that data is concatenated together, it's all there. Here's the java code based off the example on the rxtx.org site:


[ October 15, 2008: Message edited by: Chris Emerson ]
Rob Prime
Bartender

Joined: Oct 27, 2005
Posts: 11146
Please Use Code Tags to preserve your formatting.

SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Chris Emerson
Greenhorn

Joined: Jun 27, 2008
Posts: 7
This was resolved by putting a Thread.sleep(1000); as the first line of the try block inside the serialEvent method above.
 
YouTrack 2.0
 
subject: Java listening to Serial Port
 
aspose file troubles