• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java listening to Serial Port

 
Chris Emerson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please Use Code Tags to preserve your formatting.
 
Chris Emerson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This was resolved by putting a Thread.sleep(1000); as the first line of the try block inside the serialEvent method above.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!