[Rxtx] InputStream.read() not returning -1 under Linux

Fraaz Kamal fraazk at gmail.com
Wed Jun 29 14:31:05 MDT 2011


Hello Mariusz,

Thank you so much for your help. I set the receive timeout and now it works perfectly. 

Thanks again,
Fraaz

On Wednesday, June 29, 2011 at 12:53 PM, M.Dec-GM wrote:

> 1. Read mailing list
> 2. probably receivetimeout have to be set
> regards
> Mariusz
> 
> > ----- Original Message ----- 
> > From: Fraaz Kamal (mailto:fraazk at gmail.com) 
> > To: rxtx at qbang.org (mailto:rxtx at qbang.org) 
> > Sent: Wednesday, June 29, 2011 7:17 PM
> > Subject: [Rxtx] InputStream.read() not returning -1 under Linux
> > 
> > Hello everyone, 
> > 
> > I am attempting to use RXTX in order to communicate with a CC2540 USB dongle (made by Texas Instruments). The dongle enumerates with the USB CDC in order to act as a virtual serial port (shows up as port /dev/ttyACM0 under Linux and COM3 under Windows XP). I created a simple program that connects to the dongle, transmits a series of bytes over the virtual serial port, displays the received bytes from the dongle, and prints the output to the console. Here's the strange part though: the code works perfectly under Windows, but not Linux (Debian Squeeze). 
> > 
> > Inside of Linux, the code can connect to the dongle successfully, it can transmit the bytes over the virtual serial port, and I even receive the bytes that I am expecting. The problem is that the inputStream.read() function is not returning -1, despite the fact that I have received all of the bytes that I am expecting. I can see all of the bytes that I am expecting inside of the console, but the program seems to hang somewhere inside the inputStream.read() function. 
> > 
> > However, the exact same code under Windows XP does not have this problem. I receive all of the bytes including the -1 at the end, the code breaks out of the loop successfully, and the program terminates correctly. 
> > 
> > Does anybody have any ideas about what could be going wrong? Is there some sort of trick with using inputStream.read() under Linux that I don't know about? Or could it be some sort of compatibility problem with the USB dongle that I am using? 
> > 
> > Thanks in advance, 
> > 
> > Fraaz 
> > 
> > 
> > _______________________________________________
> > Rxtx mailing list
> > Rxtx at qbang.org (mailto:Rxtx at qbang.org)
> > http://mailman.qbang.org/mailman/listinfo/rxtx
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org (mailto:Rxtx at qbang.org)
> http://mailman.qbang.org/mailman/listinfo/rxtx

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qbang.org/pipermail/rxtx/attachments/20110629/1ddc87ab/attachment-0239.htm>


More information about the Rxtx mailing list