[Rxtx] Pulling out USB Devices

Botond Kardos Botond.Kardos at essnet.se
Sat May 14 18:38:46 MDT 2005


    Hi,
    which version do you use? In the latest releases (2-0-7-pre1 and
above I think) the IOLock handling in RXTXPort.java is broken. The
nativeAvailable(...) routine will throw an exception when you pull out
the device and the read routines will exit with IOLock asserted.
Subsequent read attempts will further increase the value of IOLock. And
the close(...) routine will simply fail because IOLock is positive. If
you catch those exceptions in the read routines and reset IOLock to 0
before throwing the same exception again the close(...) routine will
work just fine.
    Your debug messages are unfamiliar to me but maybe I gave a clue.
    Cheers,
    Botond

On Fri, 2005-05-13 at 19:47 +0200, Christopher.Dawes at retail-logic.com
wrote:

> 
> 
> 
> Hello, I'm afraid i'm trying to do something rather horrible to rather
> disastrous effects. I have 1 thread which reads a command and writes a
> response with a USB serial device. When i yank the device out the
> reading
> terminates by throwing an exception in the read method which then tries
> to
> clean up and stop the communication however I then try to close the
> serial
> port as sometimes cleanup is performed tidily by an exit command however
> it
> then throws this horrible stream of errors. Has anybody got any ideas
> how i
> could stop this from happening?
> 
> java.io.IOException: No error in readArray
>       at gnu.io.RXTXPort.readArray(Native Method)
>       at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1368)
>       at
> com.retail_logic.apposite.appositeAgent.PED.DASistemiPEDConnector.listen
> AndProcessSerialData(DASistemiPEDConnector.java:310)
>       at
> com.retail_logic.apposite.appositeAgent.PED.DASistemiPEDConnector.run(DA
> SistemiPEDConnector.java:226)
>       at java.lang.Thread.run(Thread.java:534)
> Closing PED About To Send
> Error 0x1f at /home/bob/rxtx-devel/src/termios.c(1284): A device
> attached
> to the system is not functioning.
> 
> 
> Error 0x5 at /home/bob/rxtx-devel/src/termios.c(488): Access is denied.
> 
> 
> Error 0x5 at /home/bob/rxtx-devel/src/termios.c(1476): Access is denied.
> 
> 
> Error 0x5 at /home/bob/rxtx-devel/src/termios.c(488): Access is denied.
> 
> 
> Error 0x5 at /home/bob/rxtx-devel/src/termios.c(488): Access is denied.
> 
> 
> Error 0x5 at /home/bob/rxtx-devel/src/termios.c(488): Access is denied.
> 
> 
> GetCommMOdemStatus failed!
> Error 0x5 at /home/bob/rxtx-devel/src/termios.c(488): Access is denied.
> 
> 
> Error 0x5 at /home/bob/rxtx-devel/src/termios.c(488): Access is denied.
> 
> 
> Error 0x5 at /home/bob/rxtx-devel/src/termios.c(488): Access is denied.
> 
> 
> 
> Thanks
> 
> Christopher
> 
> _______________________________________________
> Rxtx mailing list
> Rxtx at mail.linuxgrrls.org
> http://mail.linuxgrrls.org/mailman/listinfo/rxtx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qbang.org/pipermail/rxtx/attachments/20050515/9964d5f3/attachment-1085.htm>


More information about the Rxtx mailing list