I'm reading COM port from under java. Like:
new RandomAccessFile("COM1", "rw"); I know, it looks dumb, I would be more happy with ActiveX too...
But I need the ability to adapt to different kind of systems in the future, and COM can be read as file on almost every OP system. To configure baud, I use
Runtime.exec("mode.com [...]") . The problem is that if a program has let COM in a blocking state, my program can't call close() if the device gets disconnected, because if it already called read() blocking, any other access will block too (including write(), but I an handle that). Well, when I do blocking streams, close releases all threads waiting on it possibly with exception, but sby was thinking differently here. Maybe it will be different (well, better :P) on Linux... But now I need help for a win quick fix:
So is there an external command or any downloadable utilitys I can use to setup timeout along with baudrate, like I do with mode.com? I don't wana write dll, that would make cross platforming harder. I want to cover every possible case through RandomAccessFile. (RxTx is... Out of the question.)
Thanks for any help!
Edited by MoZo1: n/a