• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to get terminate character in InputStream  RSS feed

 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody, I am Chaitanya, I am reading a data from Serial port. A radio frequency identification kit kis connected to the serial port, it actually sends the data to the serial port. My job is to read the data from it.

I am using InputStream class to read data from serial port.

But the RFID is not sending any termination character such as carriage return and line feed. My problem is to how to come out of the while loop.

Can anybody give me any suggestion. I tried many termination characters such as 0 for null, 3 for end of text, 25 end of medium.

When I opened the hyper terminal and read the data, the data was following one line only. The cursor is not returning to next line. I recognized it is the problem of RFID. But I cannot blame those persons.

Please can anybody give me any idea about how to get out of the for loop.

Thank you all in advance. Have a nice day.
 
Rob Spoor
Sheriff
Posts: 20895
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any input stream returns -1 if there is no more data at all.
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rob, thanks for the reply, I will try this and let you know.

Have a nice day.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!