From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From storrellas at bdigital.org Wed Feb 23 10:37:48 2011 From: storrellas at bdigital.org (Sergi Torrellas) Date: Wed, 23 Feb 2011 18:37:48 +0100 Subject: [Rxtx] Serial port description Message-ID: Hi all, I am using the library RXTX for connecting to a USB port that is mapped to a serial port. My question is the following is possible to get a longer description of the serial part a part from the COMX? Many thanks, -- *SERGI TORRELLAS SOCASTRO Desenvolupador R+D Salut M. 616.21.72.97** *storrellas at bdigital.org *BARCELONA DIGITAL CENTRE TECNOL?GIC* Roc Boronat 117, 5a planta, 08018 Barcelona Tel. +34 93 553 45 40 - Fax. +34 93 553 45 41 www.bdigital.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Wed Feb 23 21:46:30 2011 From: showard314 at gmail.com (Scott Howard) Date: Wed, 23 Feb 2011 23:46:30 -0500 Subject: [Rxtx] compiling rxtx on archs without sys/io.h Message-ID: Hello all, There is a bug at: http://bugzilla.qbang.org/show_bug.cgi?id=72 for fixing a build failure on PPCs. A similar build failure occurs on mips, ARM, sparc, and a few other architectures. You can work around it be using AC_CHECK_HEADERS and properly shielding #include . I uploaded a new patch to that bug which does that, and have compiled rxtx on those architectures. This will also work for future architectures and won't require manually updating the #ifdefs. If you do use this patch, you should also edit the individual Makefiles (like Makefile.mingw32) to properly #define or #undef HAVE_SYS_IO_H Regards, Scott From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From storrellas at bdigital.org Wed Feb 23 10:37:48 2011 From: storrellas at bdigital.org (Sergi Torrellas) Date: Wed, 23 Feb 2011 18:37:48 +0100 Subject: [Rxtx] Serial port description Message-ID: Hi all, I am using the library RXTX for connecting to a USB port that is mapped to a serial port. My question is the following is possible to get a longer description of the serial part a part from the COMX? Many thanks, -- *SERGI TORRELLAS SOCASTRO Desenvolupador R+D Salut M. 616.21.72.97** *storrellas at bdigital.org *BARCELONA DIGITAL CENTRE TECNOL?GIC* Roc Boronat 117, 5a planta, 08018 Barcelona Tel. +34 93 553 45 40 - Fax. +34 93 553 45 41 www.bdigital.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Wed Feb 23 21:46:30 2011 From: showard314 at gmail.com (Scott Howard) Date: Wed, 23 Feb 2011 23:46:30 -0500 Subject: [Rxtx] compiling rxtx on archs without sys/io.h Message-ID: Hello all, There is a bug at: http://bugzilla.qbang.org/show_bug.cgi?id=72 for fixing a build failure on PPCs. A similar build failure occurs on mips, ARM, sparc, and a few other architectures. You can work around it be using AC_CHECK_HEADERS and properly shielding #include . I uploaded a new patch to that bug which does that, and have compiled rxtx on those architectures. This will also work for future architectures and won't require manually updating the #ifdefs. If you do use this patch, you should also edit the individual Makefiles (like Makefile.mingw32) to properly #define or #undef HAVE_SYS_IO_H Regards, Scott From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From storrellas at bdigital.org Wed Feb 23 10:37:48 2011 From: storrellas at bdigital.org (Sergi Torrellas) Date: Wed, 23 Feb 2011 18:37:48 +0100 Subject: [Rxtx] Serial port description Message-ID: Hi all, I am using the library RXTX for connecting to a USB port that is mapped to a serial port. My question is the following is possible to get a longer description of the serial part a part from the COMX? Many thanks, -- *SERGI TORRELLAS SOCASTRO Desenvolupador R+D Salut M. 616.21.72.97** *storrellas at bdigital.org *BARCELONA DIGITAL CENTRE TECNOL?GIC* Roc Boronat 117, 5a planta, 08018 Barcelona Tel. +34 93 553 45 40 - Fax. +34 93 553 45 41 www.bdigital.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Wed Feb 23 21:46:30 2011 From: showard314 at gmail.com (Scott Howard) Date: Wed, 23 Feb 2011 23:46:30 -0500 Subject: [Rxtx] compiling rxtx on archs without sys/io.h Message-ID: Hello all, There is a bug at: http://bugzilla.qbang.org/show_bug.cgi?id=72 for fixing a build failure on PPCs. A similar build failure occurs on mips, ARM, sparc, and a few other architectures. You can work around it be using AC_CHECK_HEADERS and properly shielding #include . I uploaded a new patch to that bug which does that, and have compiled rxtx on those architectures. This will also work for future architectures and won't require manually updating the #ifdefs. If you do use this patch, you should also edit the individual Makefiles (like Makefile.mingw32) to properly #define or #undef HAVE_SYS_IO_H Regards, Scott From ajmas at sympatico.ca Fri Feb 25 09:03:34 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:03:34 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D613A6C.80304@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. On 20-Feb-2011, at 10:59, Adrian Crum wrote: > The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: >> Are there any show stoppers to using the rewrite instead of the current source branch? >> >> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >> >>> There is no timeline to merge the two versions. >>> >>> -Adrian >>> >>> Quoting Andre-John Mas: >>> >>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>> >>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>> >>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>> Hi, >>>>>> >>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>> - src/ >>>>>> - Rewrite2010/src/ >>>>>> >>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>> >>>>>> Andre >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 25 09:17:23 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:17:23 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > >> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >> >> -Adrian >> >> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>> Are there any show stoppers to using the rewrite instead of the current source branch? >>> >>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>> >>>> There is no timeline to merge the two versions. >>>> >>>> -Adrian >>>> >>>> Quoting Andre-John Mas: >>>> >>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>> >>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>> >>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>> - src/ >>>>>>> - Rewrite2010/src/ >>>>>>> >>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>> >>>>>>> Andre >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From storrellas at bdigital.org Wed Feb 23 10:37:48 2011 From: storrellas at bdigital.org (Sergi Torrellas) Date: Wed, 23 Feb 2011 18:37:48 +0100 Subject: [Rxtx] Serial port description Message-ID: Hi all, I am using the library RXTX for connecting to a USB port that is mapped to a serial port. My question is the following is possible to get a longer description of the serial part a part from the COMX? Many thanks, -- *SERGI TORRELLAS SOCASTRO Desenvolupador R+D Salut M. 616.21.72.97** *storrellas at bdigital.org *BARCELONA DIGITAL CENTRE TECNOL?GIC* Roc Boronat 117, 5a planta, 08018 Barcelona Tel. +34 93 553 45 40 - Fax. +34 93 553 45 41 www.bdigital.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Wed Feb 23 21:46:30 2011 From: showard314 at gmail.com (Scott Howard) Date: Wed, 23 Feb 2011 23:46:30 -0500 Subject: [Rxtx] compiling rxtx on archs without sys/io.h Message-ID: Hello all, There is a bug at: http://bugzilla.qbang.org/show_bug.cgi?id=72 for fixing a build failure on PPCs. A similar build failure occurs on mips, ARM, sparc, and a few other architectures. You can work around it be using AC_CHECK_HEADERS and properly shielding #include . I uploaded a new patch to that bug which does that, and have compiled rxtx on those architectures. This will also work for future architectures and won't require manually updating the #ifdefs. If you do use this patch, you should also edit the individual Makefiles (like Makefile.mingw32) to properly #define or #undef HAVE_SYS_IO_H Regards, Scott From ajmas at sympatico.ca Fri Feb 25 09:03:34 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:03:34 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D613A6C.80304@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. On 20-Feb-2011, at 10:59, Adrian Crum wrote: > The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: >> Are there any show stoppers to using the rewrite instead of the current source branch? >> >> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >> >>> There is no timeline to merge the two versions. >>> >>> -Adrian >>> >>> Quoting Andre-John Mas: >>> >>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>> >>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>> >>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>> Hi, >>>>>> >>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>> - src/ >>>>>> - Rewrite2010/src/ >>>>>> >>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>> >>>>>> Andre >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 25 09:17:23 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:17:23 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > >> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >> >> -Adrian >> >> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>> Are there any show stoppers to using the rewrite instead of the current source branch? >>> >>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>> >>>> There is no timeline to merge the two versions. >>>> >>>> -Adrian >>>> >>>> Quoting Andre-John Mas: >>>> >>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>> >>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>> >>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>> - src/ >>>>>>> - Rewrite2010/src/ >>>>>>> >>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>> >>>>>>> Andre >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 26 18:58:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 26 Feb 2011 17:58:27 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: <4D69AFC3.50008@sandglass-software.com> Thank you for doing that. There hasn't been much community interest in the rewrite, and I've been busy since I started it. I hope to work on it some more in the next month or two. -Adrian On 2/25/2011 8:17 AM, Andre-John Mas wrote: > I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > >> What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. >> >> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >> >>> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>> >>> -Adrian >>> >>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> Are there any show stoppers to using the rewrite instead of the current source branch? >>>> >>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>> >>>>> There is no timeline to merge the two versions. >>>>> >>>>> -Adrian >>>>> >>>>> Quoting Andre-John Mas: >>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>>> >>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>> - src/ >>>>>>>> - Rewrite2010/src/ >>>>>>>> >>>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>>> >>>>>>>> Andre >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From storrellas at bdigital.org Wed Feb 23 10:37:48 2011 From: storrellas at bdigital.org (Sergi Torrellas) Date: Wed, 23 Feb 2011 18:37:48 +0100 Subject: [Rxtx] Serial port description Message-ID: Hi all, I am using the library RXTX for connecting to a USB port that is mapped to a serial port. My question is the following is possible to get a longer description of the serial part a part from the COMX? Many thanks, -- *SERGI TORRELLAS SOCASTRO Desenvolupador R+D Salut M. 616.21.72.97** *storrellas at bdigital.org *BARCELONA DIGITAL CENTRE TECNOL?GIC* Roc Boronat 117, 5a planta, 08018 Barcelona Tel. +34 93 553 45 40 - Fax. +34 93 553 45 41 www.bdigital.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Wed Feb 23 21:46:30 2011 From: showard314 at gmail.com (Scott Howard) Date: Wed, 23 Feb 2011 23:46:30 -0500 Subject: [Rxtx] compiling rxtx on archs without sys/io.h Message-ID: Hello all, There is a bug at: http://bugzilla.qbang.org/show_bug.cgi?id=72 for fixing a build failure on PPCs. A similar build failure occurs on mips, ARM, sparc, and a few other architectures. You can work around it be using AC_CHECK_HEADERS and properly shielding #include . I uploaded a new patch to that bug which does that, and have compiled rxtx on those architectures. This will also work for future architectures and won't require manually updating the #ifdefs. If you do use this patch, you should also edit the individual Makefiles (like Makefile.mingw32) to properly #define or #undef HAVE_SYS_IO_H Regards, Scott From ajmas at sympatico.ca Fri Feb 25 09:03:34 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:03:34 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D613A6C.80304@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. On 20-Feb-2011, at 10:59, Adrian Crum wrote: > The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: >> Are there any show stoppers to using the rewrite instead of the current source branch? >> >> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >> >>> There is no timeline to merge the two versions. >>> >>> -Adrian >>> >>> Quoting Andre-John Mas: >>> >>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>> >>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>> >>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>> Hi, >>>>>> >>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>> - src/ >>>>>> - Rewrite2010/src/ >>>>>> >>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>> >>>>>> Andre >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 25 09:17:23 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:17:23 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > >> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >> >> -Adrian >> >> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>> Are there any show stoppers to using the rewrite instead of the current source branch? >>> >>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>> >>>> There is no timeline to merge the two versions. >>>> >>>> -Adrian >>>> >>>> Quoting Andre-John Mas: >>>> >>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>> >>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>> >>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>> - src/ >>>>>>> - Rewrite2010/src/ >>>>>>> >>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>> >>>>>>> Andre >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 26 18:58:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 26 Feb 2011 17:58:27 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: <4D69AFC3.50008@sandglass-software.com> Thank you for doing that. There hasn't been much community interest in the rewrite, and I've been busy since I started it. I hope to work on it some more in the next month or two. -Adrian On 2/25/2011 8:17 AM, Andre-John Mas wrote: > I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > >> What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. >> >> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >> >>> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>> >>> -Adrian >>> >>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> Are there any show stoppers to using the rewrite instead of the current source branch? >>>> >>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>> >>>>> There is no timeline to merge the two versions. >>>>> >>>>> -Adrian >>>>> >>>>> Quoting Andre-John Mas: >>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>>> >>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>> - src/ >>>>>>>> - Rewrite2010/src/ >>>>>>>> >>>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>>> >>>>>>>> Andre >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From iqzw2r602 at sneakemail.com Sun Feb 27 15:47:16 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 09:47:16 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D69AFC3.50008@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> Message-ID: <23853-1298846836-791608@sneakemail.com> Hi Adrian, I've followed the discussion about the rewrite over the past months, and I'm sorry to hear interest in it hasn't picked up. I've had a look at the source code yesterday, and it seems very well designed and nicely documented. IMHO one reason why it hasn't been fully embraced yet is because it currently only runs on Windows. I know from first hand experience (jpathwatch) that it's quite hard to write robust cross-platform Java libraries containing native code, and that people might be hesitant to pick up development on something like that. I was contemplating of toying around with the code base a couple of times, but I'd rather write as much platform dependent code as I can in Java (this might be a matter of preference, however, I have found that it made my life a hell of a lot easier). So to give people choice in how they implement their port, I suggest that: * the Dispatcher Java class becomes abstract, without native methods. * All Java and native code in the Dispatcher class moves to a new NativeDispatcher java/C++ class, which derives from Dispatcher. * The Dispatcher.getInstance() method chooses, per platform, which Dispatcher instance it's going to create. So on Windows and other platforms that like their dispatcher to be native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). On other platforms (say, on BSD based platforms), a different Dispatcher implementation is instantiated, which can be implemented almost entirely in Java. This way, every OS can implement it's own dispatcher. This gives the implementor the option to choose whether to write their implementation as a fat native library (like the one you have implemented for Windows), or in Java with a slim native library (which only wraps OS function calls). In turn, it might make it more attractive for developers to jump in and contribute implementations for other platforms. What do you think? Cheers, Uwe On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > Thank you for doing that. There hasn't been much community interest in the > rewrite, and I've been busy since I started it. I hope to work on it some > more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > >> I have added a stub page here: >> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >> >> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >> >> What could be useful is an entry in the wiki documenting the mile-stones >>> and what is left to be done. >>> >>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>> >>> The rewrite isn't finished - it still needs Java unit tests and native >>>> code for Apple and *nix. You can find more information on the mailing list: >>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>> >>>> -Adrian >>>> >>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> >>>>> Are there any show stoppers to using the rewrite instead of the current >>>>> source branch? >>>>> >>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>> >>>>> There is no timeline to merge the two versions. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> Quoting Andre-John Mas: >>>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>> for? >>>>>>> >>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>> library is in Rewrite2010/src. >>>>>>>> >>>>>>>> -Adrian >>>>>>>> >>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>> - src/ >>>>>>>>> - Rewrite2010/src/ >>>>>>>>> >>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>> we shouldn't be using around? >>>>>>>>> >>>>>>>>> Andre >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Sun Feb 27 16:26:56 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 27 Feb 2011 15:26:56 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <4D6ADDC0.1020608@sandglass-software.com> As far as I know, any Java library that manipulates hardware devices is going to need native code. If the JRE contains classes that already do that, then I'm unaware of them. In other words, I don't know how one would accomplish "making OS calls" without native code. I agree that developing a Java library that reads/writes serial and parallel hardware is not an easy task - therefore there will be few willing to engage in it. I don't agree that Java code should contain as much platform-specific code as possible. That might make things easier for you, but it defeats the "write once, run anywhere" design of Java. I'm not sure what you mean by "fat native code" versus "slim native code." The native code in the rewrite is the minimum necessary to control the hardware - in fact, that is one of the rewrite's design goals. The rewrite's design reduces native code development down to implementing two virtual classes and two functions. I thought I set the bar pretty low, but I might be wrong. -Adrian On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, > and I'm sorry to hear interest in it hasn't picked up. I've had a look > at the source code yesterday, and it seems very well designed and > nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick up development on something like that. > > I was contemplating of toying around with the code base a couple of > times, but I'd rather write as much platform dependent code as I can > in Java (this might be a matter of preference, however, I have found > that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be implemented > almost entirely in Java. This way, every OS can implement it's own > dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have > implemented for Windows), or in Java with a slim native library (which > only wraps OS function calls). > In turn, it might make it more attractive for developers to jump in > and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > Thank you for doing that. There hasn't been much community > interest in the rewrite, and I've been busy since I started it. I > hope to work on it some more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: > http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > What could be useful is an entry in the wiki documenting > the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > The rewrite isn't finished - it still needs Java unit > tests and native code for Apple and *nix. You can find > more information on the mailing list: > http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, > adrian.crum at sandglass-software.com > wrote: > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas >: > > What is the timeline to merge the two? > Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > The latest working source is in src, > and a recent rewrite of the library is > in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas > wrote: > > Hi, > > I am seeing two Java source folder > in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and > is there any need to keep the one > we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:28:56 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:28:56 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() Message-ID: Hi, I have a receive thread that does nothing but call read() on the serial port input stream. It works fine for a while but after running for a long time it eventually returns -1 which means EOF. This is my first problem, as the device I'm talking to runs forever, I don't know why it would return -1. I am calling disableReceiveThreshold() and disableReceiveTimeout() at initialization which according to the documentation means read will return as soon as any data is available and it will block forever when data is not available, so -1 should never be returned from read, right? I have been unable to figure out why read returns -1 after a long while but I have found that if I kill my application and restart it everything works fine again. Therefore I tried to work around the problem by having my code close the port and reopen it when read returns -1. My second problem is that in this case when I call close() on the port it blocks forever. I did find this old bug http://bugzilla.qbang.org/show_bug.cgi?id=53 which describes close() hanging on OSX, but it says that bug was fixed with a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any idea why read might be returning -1 in the first place? If I can avoid that I don't care about close() hanging because I would never close the port. If not, does anyone know why close() might block forever and how I can prevent this? I'm using RXTX version 2.1-7. Thanks, -- Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:34:04 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:34:04 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() In-Reply-To: References: Message-ID: I mis-spoke, I don't have my own thread calling read, I am calling read in the event handler after receiving a SerialPortEvent.DATA_AVAILABLE event. Everything else I said should be accurate though. Ryan On Mon, Feb 28, 2011 at 12:28 AM, Ryan Boder wrote: > Hi, > > I have a receive thread that does nothing but call read() on the serial > port input stream. It works fine for a while but after running for a long > time it eventually returns -1 which means EOF. This is my first problem, as > the device I'm talking to runs forever, I don't know why it would return -1. > I am calling disableReceiveThreshold() and disableReceiveTimeout() at > initialization which according to the documentation means read will return > as soon as any data is available and it will block forever when data is not > available, so -1 should never be returned from read, right? > > I have been unable to figure out why read returns -1 after a long while but > I have found that if I kill my application and restart it everything works > fine again. Therefore I tried to work around the problem by having my code > close the port and reopen it when read returns -1. My second problem is that > in this case when I call close() on the port it blocks forever. I did find > this old bug > > http://bugzilla.qbang.org/show_bug.cgi?id=53 > > which describes close() hanging on OSX, but it says that bug was fixed with > a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any > idea why read might be returning -1 in the first place? If I can avoid that > I don't care about close() hanging because I would never close the port. If > not, does anyone know why close() might block forever and how I can prevent > this? I'm using RXTX version 2.1-7. > > Thanks, > -- > Ryan > > -- Ryan Boder 1 614 598-6339 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.w.janssen at lxtreme.nl Mon Feb 28 04:09:50 2011 From: j.w.janssen at lxtreme.nl (Jan Willem Janssen) Date: Mon, 28 Feb 2011 12:09:50 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <123a513d85e4569df1ebce58088e6592.squirrel@lxtreme.homelinux.org> FWIW: I'm also interested in the 2010-rewrite, but was waiting until a bit more code was available for other platforms, like Linux and/or OSX. I'd like to offer my help if needed, for example to test stuff. Regards, Jan Willem On Sun, February 27, 2011 23:47, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm > sorry to hear interest in it hasn't picked up. I've had a look at the > source > code yesterday, and it seems very well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java > (this > might be a matter of preference, however, I have found that it made my > life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a > NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely > in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. From iqzw2r602 at sneakemail.com Mon Feb 28 04:52:33 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 22:52:33 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6ADDC0.1020608@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> Message-ID: <15854-1298893954-139343@sneakemail.com> Hi Adrian, On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > As far as I know, any Java library that manipulates hardware devices is > going to need native code. If the JRE contains classes that already do that, > then I'm unaware of them. In other words, I don't know how one would > accomplish "making OS calls" without native code. > Yes, you're right, you need native code to do that. The only question is how much. I'm not saying that you wouldn't write native code. I'm just saying you'll need very little. Take CreateFile() on Windows. Your implementation calls it from C++ code, which implements logic all around it. However, you can also call CreateFile() from Java code, and this is what I'm proposing: Expose the CreateFile() function to Java as a static native Java method, so it becomes directly callable from Java code (only visible to implementation, not publicly). So while the code all around the CreateFile() call is all Java (granted, it's platform specific, it has to be), the 'public static native CreateFile()' method is implemented in C++ - and all it does is to call the native CreateFile() function. > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few willing > to engage in it. I don't agree that Java code should contain as much > platform-specific code as possible. That might make things easier for you, > but it defeats the "write once, run anywhere" design of Java. > "write once, run anywhere" (WORA) does apply for client code calling RXTX. However, it doesn't mean that you can't or shouldn't write platform specific code to /implement/ a library that's doing OS specific things; in fact you have to: CreateFile() only exists on Windows, open() only on Unix, etc., so you have to write code specific to each platform that calls these functions and handles their semantics. And in case you haven't noticed yet, the JDK does the same thing, it has platform specific Java classes for lots of things (try debugging the methods of java.io.File, or the parts of the AWT, and see where they call into). The point of WORA is that client code - code that calls into RXTX - should not have to deal with specifics of a platform. > I'm not sure what you mean by "fat native code" versus "slim native code." > Fat native libraries have methods like this, all written in C++: Lots of pointers here, lots of things that could go wrong (but I'm not saying it does, just showing the potential, think threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: CommPort* CommPortFactory::getInstance(const char *portName, int portType) { #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS if (strcmp("PARALLEL_PASS", portName) == 0) return new ParallelLoopback(portName); if (strcmp("SERIAL_PASS", portName) == 0) return new SerialLoopback(portName); #endif // Do not open overlapped. Let the Java application // handle multi-threaded I/O. HANDLE hComm = CreateFile( portName, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); if (hComm == INVALID_HANDLE_VALUE) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); printf("%s\n", lpMsgBuf); delete lpMsgBuf; throw IOException(); } .... // SNIP! Fact is, you can write all of this in Java. You can even take the same code, reword it a bit, and feed it into javac. So I won't quote this here again and Java-ise it, just assume the above is Java code (BTW: you can even do #ifdefs with statics). This Java code will have this import statement at the top: import static Windows.*; In Windows.java would look like this (in fact it does, I've done this in jpathwatch): static native long CreateFile(String fileName, int desiredAccess, int shareMode, SECURITY_ATTRIBUTES securityAttributes, int creationDisposition, int flagsAndAttributes, long templateFileHandle); And the code in Windows.cpp? That calls the native CreateFile() function. And that's all (There's some special handling so GetLastError() works in different threads and won't interfere with the JVM, but that's another topic) The native code in the rewrite is the minimum necessary to control the > hardware - in fact, that is one of the rewrite's design goals. The rewrite's > design reduces native code development down to implementing two virtual > classes and two functions. I thought I set the bar pretty low, but I might > be wrong. > See above; it can be even less. And since I keep saying I've done it, have a look at these files: Windows.cpp[1], Windows.java[2], WindowsPathWatchService.java [3] Don't understand this as a criticism of your design, I actually quite like it. All I am saying is that it doesn't need to be all native, and that if you make the Dispatcher an abstract class like I proposed in my previous email, implementors can choose which language they use (and yes, I'd choose Java over C++; and I've written C++ code for more than 15 years) Cheers, Uwe [1] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup [2] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup [3] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > -Adrian > > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm sorry to hear interest in it hasn't picked up. I've had a look at the > source code yesterday, and it seems very well designed and nicely > documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java (this > might be a matter of preference, however, I have found that it made my life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example > Allow| wrote: > >> Thank you for doing that. There hasn't been much community interest in the >> rewrite, and I've been busy since I started it. I hope to work on it some >> more in the next month or two. >> >> -Adrian >> >> >> On 2/25/2011 8:17 AM, Andre-John Mas wrote: >> >>> I have added a stub page here: >>> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >>> >>> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >>> >>> What could be useful is an entry in the wiki documenting the mile-stones >>>> and what is left to be done. >>>> >>>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>>> >>>> The rewrite isn't finished - it still needs Java unit tests and native >>>>> code for Apple and *nix. You can find more information on the mailing list: >>>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>>> >>>>>> Are there any show stoppers to using the rewrite instead of the >>>>>> current source branch? >>>>>> >>>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>>> >>>>>> There is no timeline to merge the two versions. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> Quoting Andre-John Mas: >>>>>>> >>>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>>> for? >>>>>>>> >>>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>>> >>>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>>> library is in Rewrite2010/src. >>>>>>>>> >>>>>>>>> -Adrian >>>>>>>>> >>>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>>> - src/ >>>>>>>>>> - Rewrite2010/src/ >>>>>>>>>> >>>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>>> we shouldn't be using around? >>>>>>>>>> >>>>>>>>>> Andre >>>>>>>>>> _______________________________________________ >>>>>>>>>> Rxtx mailing list >>>>>>>>>> Rxtx at qbang.org >>>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 28 05:36:14 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 28 Feb 2011 14:36:14 +0200 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> Message-ID: Sorry for top posting but I felt it was justified here to keep the whole context of the referred text intact. I very much agree with Uwe's point of view, ie doing as much as possible in Java, even the platform specific things, and doing the absolute minimum in C/C++. And this is not criticism Adrian's work/design. I would (again) advocate using JNA instead of JNI to access the native OS services/API from Java. This simplifies the live of the library users and developers a great deal because no C/C++ tool chain is involved. Zero. You don't even need a C compiler. There are some 'issues' in accessing some OS API functions from Java (like the need to use OS specific values in the Java code that are only available with #define in header files) but given the stability and longtime standing of the API functions we are talking about (open/close/select/read/write) I do not see this as big issue. A lot of the argumentation is included in this thread when this was last time rehashed on this list. http://answerpot.com/showthread.php?1022262-JNA%20alternative%20(was:%20rxt x%20moving%20from%20JNI%20to%20JNA%20(was%20%20About%20JRE%20crashes))/Page 1 If anyone is interested I can make the straw man implementation available. It compiles and has a fighting chance to work in a POSIX compatible OS (Mac OS X / Linux) with moderate debugging. Of course it is a long way from production, especially as throwing away the current rxtx also throws away most of the testing and debugging to the obscure/uncommon OSes that rxtx currently supports (I suggest anyone attempting to replace the current implementation has peek at the innards of the current implementation to see the variety it claims to support). (As an aside, and not really relevant to calling OS API from Java with JNA, I feel I need to mention that calling C++ using JNA is not easy because of the name mangling, so libraries with C interface are preferred with JNA). br Kusti On 2/28/11 13:52, "iqzw2r602 at sneakemail.com" wrote: >Hi Adrian, > >On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum >adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| >wrote: > > > > > > > > As far as I know, any Java library that manipulates hardware devices > is going to need native code. If the JRE contains classes that > already do that, then I'm unaware of them. In other words, I don't > know how one would accomplish "making OS calls" without native code. > > > > >Yes, you're right, you need native code to do that. The only question is >how much. I'm not saying that you wouldn't write native code. I'm just >saying you'll need very little. Take CreateFile() on Windows. Your >implementation calls it from C++ code, which implements logic all around >it. > >However, you can also call CreateFile() from Java code, and this is what >I'm proposing: Expose the CreateFile() function to Java as a static >native Java method, so it becomes directly callable from Java code (only >visible to implementation, not publicly). So while the code all around >the CreateFile() call is all Java (granted, it's platform specific, it >has to be), the 'public static native CreateFile()' method is implemented >in C++ - and all it does is to call the native CreateFile() function. > > > > > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few > willing to engage in it. I don't agree that Java code should contain > as much platform-specific code as possible. That might make things > easier for you, but it defeats the "write once, run anywhere" design > of Java. > > > > >"write once, run anywhere" (WORA) does apply for client code calling >RXTX. > >However, it doesn't mean that you can't or shouldn't write platform >specific code to /implement/ a library that's doing OS specific things; >in fact you have to: >CreateFile() only exists on Windows, open() only on Unix, etc., so you >have to write code specific to each platform that calls these functions >and handles their semantics. And in case you haven't noticed yet, the JDK >does the same thing, it has platform specific Java classes for lots of >things (try debugging the methods of java.io.File, or the parts of the >AWT, and see where they call into). > >The point of WORA is that client code - code that calls into RXTX - >should not have to deal with specifics of a platform. > > > > > I'm not sure what you mean by "fat native code" versus "slim native > code." > > > >Fat native libraries have methods like this, all written in C++: Lots of >pointers here, lots of things that could go wrong (but I'm not saying it >does, just showing the potential, think >threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: > >CommPort* CommPortFactory::getInstance(const char *portName, int portType) >{ >#ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); >#endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } >... >// SNIP! > >Fact is, you can write all of this in Java. You can even take the same >code, reword it a bit, and feed it into javac. So I won't quote this here >again and Java-ise it, just assume the above is Java code (BTW: you can >even do #ifdefs with statics). This Java code will have this import >statement at the top: > >import static Windows.*; > >In Windows.java would look like this (in fact it does, I've done this in >jpathwatch): > >static native long CreateFile(String fileName, int desiredAccess, int >shareMode, SECURITY_ATTRIBUTES securityAttributes, int >creationDisposition, int flagsAndAttributes, long templateFileHandle); > >And the code in Windows.cpp? That calls the native CreateFile() function. >And that's all (There's some special handling so GetLastError() works in >different threads and won't interfere with the JVM, but that's another >topic) > > > >The native code in the rewrite is the minimum necessary to > control the hardware - in fact, that is one of the rewrite's design > goals. The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I set > the bar pretty low, but I might be wrong. > > > > >See above; it can be even less. > >And since I keep saying I've done it, have a look at these files: >Windows.cpp >jpathwatch-native/src/Windows.cpp?revision=130&view=markup>[1], >Windows.java >jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&v >iew=markup>[2], WindowsPathWatchService.java >jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.jav >a?revision=130&view=markup>[3] > >Don't understand this as a criticism of your design, I actually quite >like it. All I am saying is that it doesn't need to be all native, and >that if you make the Dispatcher an abstract class like I proposed in my >previous email, implementors can choose which language they use (and yes, >I'd choose Java over C++; and I've written C++ code for more than 15 >years) > >Cheers, > >Uwe > >[1] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-native/src/Windows.cpp?revision=130&view=markup >[2] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&vi >ew=markup >[3] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java >?revision=130&view=markup > > > > > -Adrian > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > >Hi Adrian, > > I've followed the discussion about the rewrite over the past > months, and I'm sorry to hear interest in it hasn't picked up. > I've had a look at the source code yesterday, and it seems very > well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because > it currently only runs on Windows. I know from first hand > experience (jpathwatch) that it's quite hard to write robust > cross-platform Java libraries containing native code, and that > people might be hesitant to pick up development on something like > that. > > I was contemplating of toying around with the code base a couple > of times, but I'd rather write as much platform dependent code as > I can in Java (this might be a matter of preference, however, I > have found that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I > suggest that: > > * the Dispatcher Java class becomes abstract, without native > methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by > Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be > implemented almost entirely in Java. This way, every OS can > implement it's own dispatcher. > > This gives the implementor the option to choose whether to write > their implementation as a fat native library (like the one you > have implemented for Windows), or in Java with a slim native > library (which only wraps OS function calls). > In turn, it might make it more attractive for developers to jump > in and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian > Crum adrian.crum-at-sandglass-software.com > > |rxtx.org > mailing list/Example Allow| > wrote: > >Thank you for doing that. There hasn't > been much community interest in the rewrite, and I've been > busy since I started it. I hope to work on it some more in the > next month or two. > > > -Adrian > > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: >http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > > What could be useful is an entry in the wiki > documenting the mile-stones and what is left to be > done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > > The rewrite isn't finished - it still needs Java > unit tests and native code for Apple and *nix. You > can find more information on the mailing list: >http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, >adrian.crum at sandglass-software.com > wrote: > > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas: > > > What is the timeline to merge the two? Also, > what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > > The latest working source is in src, and a > recent rewrite of the library is in > Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: > > Hi, > > I am seeing two Java source folder in the > CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there > any need to keep the one we shouldn't be > using around? > > Andre >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > >http://mailman.qbang.org/mailman/listinfo/rxtx > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From storrellas at bdigital.org Wed Feb 23 10:37:48 2011 From: storrellas at bdigital.org (Sergi Torrellas) Date: Wed, 23 Feb 2011 18:37:48 +0100 Subject: [Rxtx] Serial port description Message-ID: Hi all, I am using the library RXTX for connecting to a USB port that is mapped to a serial port. My question is the following is possible to get a longer description of the serial part a part from the COMX? Many thanks, -- *SERGI TORRELLAS SOCASTRO Desenvolupador R+D Salut M. 616.21.72.97** *storrellas at bdigital.org *BARCELONA DIGITAL CENTRE TECNOL?GIC* Roc Boronat 117, 5a planta, 08018 Barcelona Tel. +34 93 553 45 40 - Fax. +34 93 553 45 41 www.bdigital.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Wed Feb 23 21:46:30 2011 From: showard314 at gmail.com (Scott Howard) Date: Wed, 23 Feb 2011 23:46:30 -0500 Subject: [Rxtx] compiling rxtx on archs without sys/io.h Message-ID: Hello all, There is a bug at: http://bugzilla.qbang.org/show_bug.cgi?id=72 for fixing a build failure on PPCs. A similar build failure occurs on mips, ARM, sparc, and a few other architectures. You can work around it be using AC_CHECK_HEADERS and properly shielding #include . I uploaded a new patch to that bug which does that, and have compiled rxtx on those architectures. This will also work for future architectures and won't require manually updating the #ifdefs. If you do use this patch, you should also edit the individual Makefiles (like Makefile.mingw32) to properly #define or #undef HAVE_SYS_IO_H Regards, Scott From ajmas at sympatico.ca Fri Feb 25 09:03:34 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:03:34 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D613A6C.80304@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. On 20-Feb-2011, at 10:59, Adrian Crum wrote: > The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: >> Are there any show stoppers to using the rewrite instead of the current source branch? >> >> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >> >>> There is no timeline to merge the two versions. >>> >>> -Adrian >>> >>> Quoting Andre-John Mas: >>> >>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>> >>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>> >>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>> Hi, >>>>>> >>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>> - src/ >>>>>> - Rewrite2010/src/ >>>>>> >>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>> >>>>>> Andre >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 25 09:17:23 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:17:23 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > >> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >> >> -Adrian >> >> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>> Are there any show stoppers to using the rewrite instead of the current source branch? >>> >>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>> >>>> There is no timeline to merge the two versions. >>>> >>>> -Adrian >>>> >>>> Quoting Andre-John Mas: >>>> >>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>> >>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>> >>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>> - src/ >>>>>>> - Rewrite2010/src/ >>>>>>> >>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>> >>>>>>> Andre >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 26 18:58:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 26 Feb 2011 17:58:27 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: <4D69AFC3.50008@sandglass-software.com> Thank you for doing that. There hasn't been much community interest in the rewrite, and I've been busy since I started it. I hope to work on it some more in the next month or two. -Adrian On 2/25/2011 8:17 AM, Andre-John Mas wrote: > I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > >> What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. >> >> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >> >>> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>> >>> -Adrian >>> >>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> Are there any show stoppers to using the rewrite instead of the current source branch? >>>> >>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>> >>>>> There is no timeline to merge the two versions. >>>>> >>>>> -Adrian >>>>> >>>>> Quoting Andre-John Mas: >>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>>> >>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>> - src/ >>>>>>>> - Rewrite2010/src/ >>>>>>>> >>>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>>> >>>>>>>> Andre >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From iqzw2r602 at sneakemail.com Sun Feb 27 15:47:16 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 09:47:16 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D69AFC3.50008@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> Message-ID: <23853-1298846836-791608@sneakemail.com> Hi Adrian, I've followed the discussion about the rewrite over the past months, and I'm sorry to hear interest in it hasn't picked up. I've had a look at the source code yesterday, and it seems very well designed and nicely documented. IMHO one reason why it hasn't been fully embraced yet is because it currently only runs on Windows. I know from first hand experience (jpathwatch) that it's quite hard to write robust cross-platform Java libraries containing native code, and that people might be hesitant to pick up development on something like that. I was contemplating of toying around with the code base a couple of times, but I'd rather write as much platform dependent code as I can in Java (this might be a matter of preference, however, I have found that it made my life a hell of a lot easier). So to give people choice in how they implement their port, I suggest that: * the Dispatcher Java class becomes abstract, without native methods. * All Java and native code in the Dispatcher class moves to a new NativeDispatcher java/C++ class, which derives from Dispatcher. * The Dispatcher.getInstance() method chooses, per platform, which Dispatcher instance it's going to create. So on Windows and other platforms that like their dispatcher to be native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). On other platforms (say, on BSD based platforms), a different Dispatcher implementation is instantiated, which can be implemented almost entirely in Java. This way, every OS can implement it's own dispatcher. This gives the implementor the option to choose whether to write their implementation as a fat native library (like the one you have implemented for Windows), or in Java with a slim native library (which only wraps OS function calls). In turn, it might make it more attractive for developers to jump in and contribute implementations for other platforms. What do you think? Cheers, Uwe On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > Thank you for doing that. There hasn't been much community interest in the > rewrite, and I've been busy since I started it. I hope to work on it some > more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > >> I have added a stub page here: >> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >> >> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >> >> What could be useful is an entry in the wiki documenting the mile-stones >>> and what is left to be done. >>> >>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>> >>> The rewrite isn't finished - it still needs Java unit tests and native >>>> code for Apple and *nix. You can find more information on the mailing list: >>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>> >>>> -Adrian >>>> >>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> >>>>> Are there any show stoppers to using the rewrite instead of the current >>>>> source branch? >>>>> >>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>> >>>>> There is no timeline to merge the two versions. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> Quoting Andre-John Mas: >>>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>> for? >>>>>>> >>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>> library is in Rewrite2010/src. >>>>>>>> >>>>>>>> -Adrian >>>>>>>> >>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>> - src/ >>>>>>>>> - Rewrite2010/src/ >>>>>>>>> >>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>> we shouldn't be using around? >>>>>>>>> >>>>>>>>> Andre >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Sun Feb 27 16:26:56 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 27 Feb 2011 15:26:56 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <4D6ADDC0.1020608@sandglass-software.com> As far as I know, any Java library that manipulates hardware devices is going to need native code. If the JRE contains classes that already do that, then I'm unaware of them. In other words, I don't know how one would accomplish "making OS calls" without native code. I agree that developing a Java library that reads/writes serial and parallel hardware is not an easy task - therefore there will be few willing to engage in it. I don't agree that Java code should contain as much platform-specific code as possible. That might make things easier for you, but it defeats the "write once, run anywhere" design of Java. I'm not sure what you mean by "fat native code" versus "slim native code." The native code in the rewrite is the minimum necessary to control the hardware - in fact, that is one of the rewrite's design goals. The rewrite's design reduces native code development down to implementing two virtual classes and two functions. I thought I set the bar pretty low, but I might be wrong. -Adrian On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, > and I'm sorry to hear interest in it hasn't picked up. I've had a look > at the source code yesterday, and it seems very well designed and > nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick up development on something like that. > > I was contemplating of toying around with the code base a couple of > times, but I'd rather write as much platform dependent code as I can > in Java (this might be a matter of preference, however, I have found > that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be implemented > almost entirely in Java. This way, every OS can implement it's own > dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have > implemented for Windows), or in Java with a slim native library (which > only wraps OS function calls). > In turn, it might make it more attractive for developers to jump in > and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > Thank you for doing that. There hasn't been much community > interest in the rewrite, and I've been busy since I started it. I > hope to work on it some more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: > http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > What could be useful is an entry in the wiki documenting > the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > The rewrite isn't finished - it still needs Java unit > tests and native code for Apple and *nix. You can find > more information on the mailing list: > http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, > adrian.crum at sandglass-software.com > wrote: > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas >: > > What is the timeline to merge the two? > Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > The latest working source is in src, > and a recent rewrite of the library is > in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas > wrote: > > Hi, > > I am seeing two Java source folder > in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and > is there any need to keep the one > we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:28:56 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:28:56 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() Message-ID: Hi, I have a receive thread that does nothing but call read() on the serial port input stream. It works fine for a while but after running for a long time it eventually returns -1 which means EOF. This is my first problem, as the device I'm talking to runs forever, I don't know why it would return -1. I am calling disableReceiveThreshold() and disableReceiveTimeout() at initialization which according to the documentation means read will return as soon as any data is available and it will block forever when data is not available, so -1 should never be returned from read, right? I have been unable to figure out why read returns -1 after a long while but I have found that if I kill my application and restart it everything works fine again. Therefore I tried to work around the problem by having my code close the port and reopen it when read returns -1. My second problem is that in this case when I call close() on the port it blocks forever. I did find this old bug http://bugzilla.qbang.org/show_bug.cgi?id=53 which describes close() hanging on OSX, but it says that bug was fixed with a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any idea why read might be returning -1 in the first place? If I can avoid that I don't care about close() hanging because I would never close the port. If not, does anyone know why close() might block forever and how I can prevent this? I'm using RXTX version 2.1-7. Thanks, -- Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:34:04 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:34:04 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() In-Reply-To: References: Message-ID: I mis-spoke, I don't have my own thread calling read, I am calling read in the event handler after receiving a SerialPortEvent.DATA_AVAILABLE event. Everything else I said should be accurate though. Ryan On Mon, Feb 28, 2011 at 12:28 AM, Ryan Boder wrote: > Hi, > > I have a receive thread that does nothing but call read() on the serial > port input stream. It works fine for a while but after running for a long > time it eventually returns -1 which means EOF. This is my first problem, as > the device I'm talking to runs forever, I don't know why it would return -1. > I am calling disableReceiveThreshold() and disableReceiveTimeout() at > initialization which according to the documentation means read will return > as soon as any data is available and it will block forever when data is not > available, so -1 should never be returned from read, right? > > I have been unable to figure out why read returns -1 after a long while but > I have found that if I kill my application and restart it everything works > fine again. Therefore I tried to work around the problem by having my code > close the port and reopen it when read returns -1. My second problem is that > in this case when I call close() on the port it blocks forever. I did find > this old bug > > http://bugzilla.qbang.org/show_bug.cgi?id=53 > > which describes close() hanging on OSX, but it says that bug was fixed with > a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any > idea why read might be returning -1 in the first place? If I can avoid that > I don't care about close() hanging because I would never close the port. If > not, does anyone know why close() might block forever and how I can prevent > this? I'm using RXTX version 2.1-7. > > Thanks, > -- > Ryan > > -- Ryan Boder 1 614 598-6339 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.w.janssen at lxtreme.nl Mon Feb 28 04:09:50 2011 From: j.w.janssen at lxtreme.nl (Jan Willem Janssen) Date: Mon, 28 Feb 2011 12:09:50 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <123a513d85e4569df1ebce58088e6592.squirrel@lxtreme.homelinux.org> FWIW: I'm also interested in the 2010-rewrite, but was waiting until a bit more code was available for other platforms, like Linux and/or OSX. I'd like to offer my help if needed, for example to test stuff. Regards, Jan Willem On Sun, February 27, 2011 23:47, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm > sorry to hear interest in it hasn't picked up. I've had a look at the > source > code yesterday, and it seems very well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java > (this > might be a matter of preference, however, I have found that it made my > life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a > NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely > in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. From iqzw2r602 at sneakemail.com Mon Feb 28 04:52:33 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 22:52:33 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6ADDC0.1020608@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> Message-ID: <15854-1298893954-139343@sneakemail.com> Hi Adrian, On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > As far as I know, any Java library that manipulates hardware devices is > going to need native code. If the JRE contains classes that already do that, > then I'm unaware of them. In other words, I don't know how one would > accomplish "making OS calls" without native code. > Yes, you're right, you need native code to do that. The only question is how much. I'm not saying that you wouldn't write native code. I'm just saying you'll need very little. Take CreateFile() on Windows. Your implementation calls it from C++ code, which implements logic all around it. However, you can also call CreateFile() from Java code, and this is what I'm proposing: Expose the CreateFile() function to Java as a static native Java method, so it becomes directly callable from Java code (only visible to implementation, not publicly). So while the code all around the CreateFile() call is all Java (granted, it's platform specific, it has to be), the 'public static native CreateFile()' method is implemented in C++ - and all it does is to call the native CreateFile() function. > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few willing > to engage in it. I don't agree that Java code should contain as much > platform-specific code as possible. That might make things easier for you, > but it defeats the "write once, run anywhere" design of Java. > "write once, run anywhere" (WORA) does apply for client code calling RXTX. However, it doesn't mean that you can't or shouldn't write platform specific code to /implement/ a library that's doing OS specific things; in fact you have to: CreateFile() only exists on Windows, open() only on Unix, etc., so you have to write code specific to each platform that calls these functions and handles their semantics. And in case you haven't noticed yet, the JDK does the same thing, it has platform specific Java classes for lots of things (try debugging the methods of java.io.File, or the parts of the AWT, and see where they call into). The point of WORA is that client code - code that calls into RXTX - should not have to deal with specifics of a platform. > I'm not sure what you mean by "fat native code" versus "slim native code." > Fat native libraries have methods like this, all written in C++: Lots of pointers here, lots of things that could go wrong (but I'm not saying it does, just showing the potential, think threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: CommPort* CommPortFactory::getInstance(const char *portName, int portType) { #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS if (strcmp("PARALLEL_PASS", portName) == 0) return new ParallelLoopback(portName); if (strcmp("SERIAL_PASS", portName) == 0) return new SerialLoopback(portName); #endif // Do not open overlapped. Let the Java application // handle multi-threaded I/O. HANDLE hComm = CreateFile( portName, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); if (hComm == INVALID_HANDLE_VALUE) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); printf("%s\n", lpMsgBuf); delete lpMsgBuf; throw IOException(); } .... // SNIP! Fact is, you can write all of this in Java. You can even take the same code, reword it a bit, and feed it into javac. So I won't quote this here again and Java-ise it, just assume the above is Java code (BTW: you can even do #ifdefs with statics). This Java code will have this import statement at the top: import static Windows.*; In Windows.java would look like this (in fact it does, I've done this in jpathwatch): static native long CreateFile(String fileName, int desiredAccess, int shareMode, SECURITY_ATTRIBUTES securityAttributes, int creationDisposition, int flagsAndAttributes, long templateFileHandle); And the code in Windows.cpp? That calls the native CreateFile() function. And that's all (There's some special handling so GetLastError() works in different threads and won't interfere with the JVM, but that's another topic) The native code in the rewrite is the minimum necessary to control the > hardware - in fact, that is one of the rewrite's design goals. The rewrite's > design reduces native code development down to implementing two virtual > classes and two functions. I thought I set the bar pretty low, but I might > be wrong. > See above; it can be even less. And since I keep saying I've done it, have a look at these files: Windows.cpp[1], Windows.java[2], WindowsPathWatchService.java [3] Don't understand this as a criticism of your design, I actually quite like it. All I am saying is that it doesn't need to be all native, and that if you make the Dispatcher an abstract class like I proposed in my previous email, implementors can choose which language they use (and yes, I'd choose Java over C++; and I've written C++ code for more than 15 years) Cheers, Uwe [1] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup [2] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup [3] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > -Adrian > > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm sorry to hear interest in it hasn't picked up. I've had a look at the > source code yesterday, and it seems very well designed and nicely > documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java (this > might be a matter of preference, however, I have found that it made my life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example > Allow| wrote: > >> Thank you for doing that. There hasn't been much community interest in the >> rewrite, and I've been busy since I started it. I hope to work on it some >> more in the next month or two. >> >> -Adrian >> >> >> On 2/25/2011 8:17 AM, Andre-John Mas wrote: >> >>> I have added a stub page here: >>> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >>> >>> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >>> >>> What could be useful is an entry in the wiki documenting the mile-stones >>>> and what is left to be done. >>>> >>>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>>> >>>> The rewrite isn't finished - it still needs Java unit tests and native >>>>> code for Apple and *nix. You can find more information on the mailing list: >>>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>>> >>>>>> Are there any show stoppers to using the rewrite instead of the >>>>>> current source branch? >>>>>> >>>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>>> >>>>>> There is no timeline to merge the two versions. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> Quoting Andre-John Mas: >>>>>>> >>>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>>> for? >>>>>>>> >>>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>>> >>>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>>> library is in Rewrite2010/src. >>>>>>>>> >>>>>>>>> -Adrian >>>>>>>>> >>>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>>> - src/ >>>>>>>>>> - Rewrite2010/src/ >>>>>>>>>> >>>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>>> we shouldn't be using around? >>>>>>>>>> >>>>>>>>>> Andre >>>>>>>>>> _______________________________________________ >>>>>>>>>> Rxtx mailing list >>>>>>>>>> Rxtx at qbang.org >>>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 28 05:36:14 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 28 Feb 2011 14:36:14 +0200 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> Message-ID: Sorry for top posting but I felt it was justified here to keep the whole context of the referred text intact. I very much agree with Uwe's point of view, ie doing as much as possible in Java, even the platform specific things, and doing the absolute minimum in C/C++. And this is not criticism Adrian's work/design. I would (again) advocate using JNA instead of JNI to access the native OS services/API from Java. This simplifies the live of the library users and developers a great deal because no C/C++ tool chain is involved. Zero. You don't even need a C compiler. There are some 'issues' in accessing some OS API functions from Java (like the need to use OS specific values in the Java code that are only available with #define in header files) but given the stability and longtime standing of the API functions we are talking about (open/close/select/read/write) I do not see this as big issue. A lot of the argumentation is included in this thread when this was last time rehashed on this list. http://answerpot.com/showthread.php?1022262-JNA%20alternative%20(was:%20rxt x%20moving%20from%20JNI%20to%20JNA%20(was%20%20About%20JRE%20crashes))/Page 1 If anyone is interested I can make the straw man implementation available. It compiles and has a fighting chance to work in a POSIX compatible OS (Mac OS X / Linux) with moderate debugging. Of course it is a long way from production, especially as throwing away the current rxtx also throws away most of the testing and debugging to the obscure/uncommon OSes that rxtx currently supports (I suggest anyone attempting to replace the current implementation has peek at the innards of the current implementation to see the variety it claims to support). (As an aside, and not really relevant to calling OS API from Java with JNA, I feel I need to mention that calling C++ using JNA is not easy because of the name mangling, so libraries with C interface are preferred with JNA). br Kusti On 2/28/11 13:52, "iqzw2r602 at sneakemail.com" wrote: >Hi Adrian, > >On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum >adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| >wrote: > > > > > > > > As far as I know, any Java library that manipulates hardware devices > is going to need native code. If the JRE contains classes that > already do that, then I'm unaware of them. In other words, I don't > know how one would accomplish "making OS calls" without native code. > > > > >Yes, you're right, you need native code to do that. The only question is >how much. I'm not saying that you wouldn't write native code. I'm just >saying you'll need very little. Take CreateFile() on Windows. Your >implementation calls it from C++ code, which implements logic all around >it. > >However, you can also call CreateFile() from Java code, and this is what >I'm proposing: Expose the CreateFile() function to Java as a static >native Java method, so it becomes directly callable from Java code (only >visible to implementation, not publicly). So while the code all around >the CreateFile() call is all Java (granted, it's platform specific, it >has to be), the 'public static native CreateFile()' method is implemented >in C++ - and all it does is to call the native CreateFile() function. > > > > > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few > willing to engage in it. I don't agree that Java code should contain > as much platform-specific code as possible. That might make things > easier for you, but it defeats the "write once, run anywhere" design > of Java. > > > > >"write once, run anywhere" (WORA) does apply for client code calling >RXTX. > >However, it doesn't mean that you can't or shouldn't write platform >specific code to /implement/ a library that's doing OS specific things; >in fact you have to: >CreateFile() only exists on Windows, open() only on Unix, etc., so you >have to write code specific to each platform that calls these functions >and handles their semantics. And in case you haven't noticed yet, the JDK >does the same thing, it has platform specific Java classes for lots of >things (try debugging the methods of java.io.File, or the parts of the >AWT, and see where they call into). > >The point of WORA is that client code - code that calls into RXTX - >should not have to deal with specifics of a platform. > > > > > I'm not sure what you mean by "fat native code" versus "slim native > code." > > > >Fat native libraries have methods like this, all written in C++: Lots of >pointers here, lots of things that could go wrong (but I'm not saying it >does, just showing the potential, think >threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: > >CommPort* CommPortFactory::getInstance(const char *portName, int portType) >{ >#ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); >#endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } >... >// SNIP! > >Fact is, you can write all of this in Java. You can even take the same >code, reword it a bit, and feed it into javac. So I won't quote this here >again and Java-ise it, just assume the above is Java code (BTW: you can >even do #ifdefs with statics). This Java code will have this import >statement at the top: > >import static Windows.*; > >In Windows.java would look like this (in fact it does, I've done this in >jpathwatch): > >static native long CreateFile(String fileName, int desiredAccess, int >shareMode, SECURITY_ATTRIBUTES securityAttributes, int >creationDisposition, int flagsAndAttributes, long templateFileHandle); > >And the code in Windows.cpp? That calls the native CreateFile() function. >And that's all (There's some special handling so GetLastError() works in >different threads and won't interfere with the JVM, but that's another >topic) > > > >The native code in the rewrite is the minimum necessary to > control the hardware - in fact, that is one of the rewrite's design > goals. The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I set > the bar pretty low, but I might be wrong. > > > > >See above; it can be even less. > >And since I keep saying I've done it, have a look at these files: >Windows.cpp >jpathwatch-native/src/Windows.cpp?revision=130&view=markup>[1], >Windows.java >jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&v >iew=markup>[2], WindowsPathWatchService.java >jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.jav >a?revision=130&view=markup>[3] > >Don't understand this as a criticism of your design, I actually quite >like it. All I am saying is that it doesn't need to be all native, and >that if you make the Dispatcher an abstract class like I proposed in my >previous email, implementors can choose which language they use (and yes, >I'd choose Java over C++; and I've written C++ code for more than 15 >years) > >Cheers, > >Uwe > >[1] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-native/src/Windows.cpp?revision=130&view=markup >[2] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&vi >ew=markup >[3] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java >?revision=130&view=markup > > > > > -Adrian > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > >Hi Adrian, > > I've followed the discussion about the rewrite over the past > months, and I'm sorry to hear interest in it hasn't picked up. > I've had a look at the source code yesterday, and it seems very > well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because > it currently only runs on Windows. I know from first hand > experience (jpathwatch) that it's quite hard to write robust > cross-platform Java libraries containing native code, and that > people might be hesitant to pick up development on something like > that. > > I was contemplating of toying around with the code base a couple > of times, but I'd rather write as much platform dependent code as > I can in Java (this might be a matter of preference, however, I > have found that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I > suggest that: > > * the Dispatcher Java class becomes abstract, without native > methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by > Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be > implemented almost entirely in Java. This way, every OS can > implement it's own dispatcher. > > This gives the implementor the option to choose whether to write > their implementation as a fat native library (like the one you > have implemented for Windows), or in Java with a slim native > library (which only wraps OS function calls). > In turn, it might make it more attractive for developers to jump > in and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian > Crum adrian.crum-at-sandglass-software.com > > |rxtx.org > mailing list/Example Allow| > wrote: > >Thank you for doing that. There hasn't > been much community interest in the rewrite, and I've been > busy since I started it. I hope to work on it some more in the > next month or two. > > > -Adrian > > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: >http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > > What could be useful is an entry in the wiki > documenting the mile-stones and what is left to be > done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > > The rewrite isn't finished - it still needs Java > unit tests and native code for Apple and *nix. You > can find more information on the mailing list: >http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, >adrian.crum at sandglass-software.com > wrote: > > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas: > > > What is the timeline to merge the two? Also, > what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > > The latest working source is in src, and a > recent rewrite of the library is in > Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: > > Hi, > > I am seeing two Java source folder in the > CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there > any need to keep the one we shouldn't be > using around? > > Andre >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > >http://mailman.qbang.org/mailman/listinfo/rxtx > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From adrian.crum at sandglass-software.com Mon Feb 28 08:15:18 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 07:15:18 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> Message-ID: <4D6BBC06.4090402@sandglass-software.com> Thank you for the suggestions - I will keep them in mind the next time I work on it. -Adrian On 2/28/2011 3:52 AM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > As far as I know, any Java library that manipulates hardware > devices is going to need native code. If the JRE contains classes > that already do that, then I'm unaware of them. In other words, I > don't know how one would accomplish "making OS calls" without > native code. > > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as a > static native Java method, so it becomes directly callable from Java > code (only visible to implementation, not publicly). So while the code > all around the CreateFile() call is all Java (granted, it's platform > specific, it has to be), the 'public static native CreateFile()' > method is implemented in C++ - and all it does is to call the native > CreateFile() function. > > > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there will > be few willing to engage in it. I don't agree that Java code > should contain as much platform-specific code as possible. That > might make things easier for you, but it defeats the "write once, > run anywhere" design of Java. > > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. > > > I'm not sure what you mean by "fat native code" versus "slim > native code." > > > Fat native libraries have methods like this, all written in C++: Lots > of pointers here, lots of things that could go wrong (but I'm not > saying it does, just showing the potential, think threading) - and I'm > a cheeky bastard here and quote from W32_Support.cpp: > > CommPort* CommPortFactory::getInstance(const char *portName, int portType) > { > #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); > #endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } > ... > // SNIP! > > Fact is, you can write all of this in Java. You can even take the same > code, reword it a bit, and feed it into javac. So I won't quote this > here again and Java-ise it, just assume the above is Java code (BTW: > you can even do #ifdefs with statics). This Java code will have this > import statement at the top: > > import static Windows.*; > > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > > static native long CreateFile(String fileName, int desiredAccess, int > shareMode, SECURITY_ATTRIBUTES securityAttributes, int > creationDisposition, int flagsAndAttributes, long templateFileHandle); > > And the code in Windows.cpp? That calls the native CreateFile() > function. And that's all (There's some special handling so > GetLastError() works in different threads and won't interfere with the > JVM, but that's another topic) > > The native code in the rewrite is the minimum necessary to control > the hardware - in fact, that is one of the rewrite's design goals. > The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I > set the bar pretty low, but I might be wrong. > > > See above; it can be even less. > > And since I keep saying I've done it, have a look at these files: > Windows.cpp > [1], > Windows.java > [2], > WindowsPathWatchService.java > [3] > > Don't understand this as a criticism of your design, I actually quite > like it. All I am saying is that it doesn't need to be all native, and > that if you make the Dispatcher an abstract class like I proposed in > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) > > Cheers, > > Uwe > > [1] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup > > [2] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup > > [3] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Feb 28 09:51:19 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 17:51:19 +0100 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <20110228165119.GD10695@elberon.bln.de.ingenico.com> * Andre-John Mas wrote on Fri, Feb 18, 2011 at 21:43 -0500: > Is anyone using JDK 1.4 or less? Yes, 1.4.2_11-b06 (j2sdk-1_4_2_11-fcs-linux-i586) in some cases (also similar versions: 1.4.2_15-b02, 1.4.2_16-b05, maybe others). > I am asking because I would be interested in bringing the code > up to Java 1.5 standards, with the use of generics and other > recent developments. Why that? oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Mon Feb 28 10:20:53 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 18:20:53 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6BBC06.4090402@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> Message-ID: <20110228172052.GE10695@elberon.bln.de.ingenico.com> * Adrian Crum wrote on Mon, Feb 28, 2011 at 07:15 -0800: [...] > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. I think in general it can be good to have an system-abstracting interface of the native code. That means, the native code implementation abstracts from the system (instead of implementing that abstractions in Java). Of course it is more complex :) IIRC we already had such a discussion here. > Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as > a static native Java method, so it becomes directly callable > from Java code (only visible to implementation, not publicly). > So while the code all around the CreateFile() call is all Java > (granted, it's platform specific, it has to be), the 'public > static native CreateFile()' method is implemented in C++ - and > all it does is to call the native CreateFile() function. I don't think I'd like this. CreateFile() is very system-specific. Exposing this to Java code makes this Java code system-specific. Although you could "run" it everywhere, it won't work anyware except on appropriate windows boxes. But this goes even further, you might consider calling open and select from Java and use it for serial ports on linux, but on another system that have both functions, they simply won't work (like on windows; there should be open and select, but AFAIK the latter cannot be expected to work on serial interfaces). Of course there is an somewhat strong argument, that is if the developer is much more experienced with Java than with C, it might be easier to implement this in Java, but personally I think it is hard to believe that developers who are able to correctly abstract device-I/O from system calls are not good at C, because I'm sure C is the language system by system programmers. > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there > will be few willing to engage in it. I don't agree that Java > code should contain as much platform-specific code as possible. > That might make things easier for you, but it defeats the > "write once, run anywhere" design of Java. Java runs on compliant JVMs only and nowhere else. It just happens that JVMs exist for most systems of a special set of computers such as PCs and small servers (but not neccesarily for embedded devices or main frames). As soon as a single native function is needed (required) for the application to work properly, the `run anywhere' is already impossible, because now it does not run on any JVM but only on JVMs that supply an implementation for this native code function. > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. Yes, exactly. Also, it is possible to write system-specific applications `with 100% Java' (for example, hardcode "C:\\Program Files" to be windows-specific or use "/dev/null" or so). Expecting a certain behavior not specified by Java (e.g. whether you can read "/dev/null", what CreateFile returns or whether select works on non-socket-filehandles) IMHO already misses the "write once, run anywhere" idea. So in summary I don't think the amount of platform-specific code matters much. It must be avaiable, requiring deployment etc, so little difference how many lines of code that were. [...] > import static Windows.*; > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > static native long CreateFile(String fileName, int desiredAccess, int [...] Someone here also proposed to use a general method to invoke arbitrary functions of shared libraries, JNA. By this, you wouldn't need `static NATIVE long CreateFile'; you could replace JNI by JNA here. Assuming that this native functionality would already be deployed on many target platform systems, implementing all the platform-specific code in Java can make sense, because this specific implementations would not require additional native code deployment. If, for example, the Java installation of Debian would by default already offer native library call execution, platform-specific code implemented in Java would work on Debian without needing any additional binary lib to be installed, I think could be quite an advantage. I think if having some Windows.java layer (which I personally would not like), JNA IMHO seems to be suited well. Personally, I prefere to define nice, simple and comfortable interfaces, also for native code (if possible, for JNI I think it always is a compromise). > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) Do you mean in general or also specifically for system programming? If someone would need a small program to let's say query DCD on linux I think a small C application would be suited best. Of course this topic also is more complex and depends on things. oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From msemtd at googlemail.com Mon Feb 28 13:50:42 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 28 Feb 2011 20:50:42 +0000 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172052.GE10695@elberon.bln.de.ingenico.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: This was discussed to death last year - summary: - * JNI is too hard * JNA is compelling * yay! let's start a rewrite Time passes... Current status: Windows-only and incomplete Back in non-vaporware land (this is meant in good humour BTW), the current RXTX platform-specifics are achieved with ports of POSIX termios.h[1]. It just works (mostly, kinda!) and you have to treat it nice and test it to death for _YOUR_ platform in _YOUR_ application but, y'know, that's what professional software engineers just do anyway. I seriously don't believe anyone will come up with anything better anytime soon. Regards, Michael Erskine. [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition From iqzw2r602 at sneakemail.com Mon Feb 28 15:01:20 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 09:01:20 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <6175-1298930480-518642@sneakemail.com> Good summary. This whole JNI/JNA/C++ thing only came up again because I tried to explain my motivations for my initial request. And I agree, let's not discuss this further, we've been there already. So let's get this discussion back on track: All I suggested is to separate the implementation of the Dispatcher Java class into a NativeDispatcher class and a Dispatcher interface, so people can implement the Dispatcher (Java-) interface with whatever Three-Letter-Abbreviation they want. So can people please comment on that? Cheers, Uwe On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 > Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 15:22:21 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 14:22:21 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <4D6C201D.6060103@sandglass-software.com> One of the issues I tried to address in the rewite is the "JNI is too hard" issue. Anyone with rudimentary C++ skills can implement the two virtual classes and two functions - no knowledge of JNI is necessary because Dispatcher.cpp takes care of all of the JNI data type marshalling/unmarshalling. I don't agree that the 2.x versions "just work" - the recurring bugs mentioned on this list and in other forums are evidence of that. I tried to work with the 2.x version by wrapping it in thread-safe classes, but even that didn't help. I tried to fix the most recent version by supplying patches, but the sum of the patches added up to a rewrite. So I created a rewrite instead. -Adrian On 2/28/2011 12:50 PM, Michael Erskine wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Mon Feb 28 16:24:00 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 15:24:00 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <6175-1298930480-518642@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> Message-ID: <4D6C2E90.9010601@sandglass-software.com> My question would be: Why would you do that? The rewrite does most of the work for you - all you have to do is implement two C++ virtual classes and two C++ functions. In Windows that took me a few hours. I can't imagine other ports taking much longer than that - especially since POSIX-based code can be shared between ports. What you're suggesting would require a great deal more effort than necessary. -Adrian On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to > explain my motivations for my initial request. And I agree, let's not > discuss this further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher > Java class into a NativeDispatcher class and a Dispatcher interface, > so people can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine > msemtd-at-googlemail.com |rxtx.org > mailing list/Example Allow| > <6zkk4zdpgt at sneakemail.com > wrote: > > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Mon Feb 28 17:26:18 2011 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Mon, 28 Feb 2011 17:26:18 -0700 Subject: [Rxtx] =?utf-8?q?Which_Java_folder_in_source=3F?= Message-ID: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 17:40:03 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 16:40:03 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> References: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> Message-ID: <4D6C4063.5060708@sandglass-software.com> Speaking of bugs one knows - was anyone interested in the bug fixing effort you proposed? -Adrian On 2/28/2011 4:26 PM, jfh at greenhousepc.com wrote: > Adrian, > > I have many dozens of clients using the RXTX jar on a wide variety of > Windows, Linux and a few MacOS X releases. Provided one does what the > previous poster suggested, the code really does "just work". > > Most of the problems that get reported are things that Windows > applications, and not a few Linux ones as well, have problems with > already. > > The other issue is that even with a boat load of testing, I have no > expectation to migrate to the re-write until 3Q12 at the absolute > earliest. > > I appreciate the effort you are putting into this re-write, but after > 32 years in this field (that's more years than many on this list are > alive), I've seen a lot of "re-writes". I've even done a few myself, > some better than others. > > That 32 years of software engineering experience has taught me one > vital lesson -- the bugs one knows are far less dangerous than the > bugs one doesn't know. And all re-writes are a minefield of unknown > bugs. For my products, it takes about 9 =months= before a release is > stable enough that I'm truly pleased with it. I'm still struggling > with bugs from new features I added in my 3Q10 release. I don't need > to struggle with the new bugs that are going to come from the > re-write. Not personal, just my 32 years of experience. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com > // greenHousePC on Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Which Java folder in source? > From: Adrian Crum > ; > Date: Mon, February 28, 2011 4:22 pm > To: rxtx at qbang.org > > One of the issues I tried to address in the rewite is the "JNI is too > hard" issue. Anyone with rudimentary C++ skills can implement the two > virtual classes and two functions - no knowledge of JNI is necessary > because Dispatcher.cpp takes care of all of the JNI data type > marshalling/unmarshalling. > > I don't agree that the 2.x versions "just work" - the recurring bugs > mentioned on this list and in other forums are evidence of that. I > tried > to work with the 2.x version by wrapping it in thread-safe > classes, but > even that didn't help. I tried to fix the most recent version by > supplying patches, but the sum of the patches added up to a > rewrite. So > I created a rewrite instead. > > -Adrian > > On 2/28/2011 12:50 PM, Michael Erskine wrote: > > This was discussed to death last year - summary: - > > * JNI is too hard > > * JNA is compelling > > * yay! let's start a rewrite > > > > Time passes... > > > > Current status: Windows-only and incomplete > > > > Back in non-vaporware land (this is meant in good humour BTW), the > > current RXTX platform-specifics are achieved with ports of POSIX > > termios.h[1]. > > > > It just works (mostly, kinda!) and you have to treat it nice and test > > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > > that's what professional software engineers just do anyway. I > > seriously don't believe anyone will come up with anything better > > anytime soon. > > > > Regards, > > Michael Erskine. > > > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From iqzw2r602 at sneakemail.com Mon Feb 28 18:59:48 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 12:59:48 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6C2E90.9010601@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> Message-ID: <13486-1298944789-675699@sneakemail.com> On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > My question would be: Why would you do that? > I'm thinking about the debugging effort, quite frankly. When I started off with jpathwatch, I initially wrote a fat native library. It got me into trouble: It was hard to debug, the JVM would crash every now and then, depending which bug it hit, and debugging a process with a JVM (even on Windows) is not fun. When I finally got it to work on Windows, I started doing Linux, and the same thing happened again - and I didn't find the tools as nice. When it started sucking up too much of my time I scrapped the whole thing, literally, and moved to a slim native library. I wrote the new implementation in a fraction of the time, and it rarely ever crashed (because except for the little C++ code to wrap OS functions there was nothing that could). So that's my reason to write things in Java mainly for a project like this. Others prefer C++. What I'm suggesting gives people a choice to use the tool they're most comfortable with (because this is really about people, not code; the code won't write and fix itself, people have to go in and do it) > The rewrite does most of the work for you - all you have to do is implement > two C++ virtual classes and two C++ functions. In Windows that took me a few > hours. I can't imagine other ports taking much longer than that - especially > since POSIX-based code can be shared between ports. > And that's fine for people who want to write a native code implementation. I'm not talking about scrapping that at all, quite the contrary - Windows and the C++ framework should stay as it is, it's quite a large contribution you've made in time and effort, it'd be stupid to abandon that. Even more so, other platforms could build on the C++ code you've written, as you intended. All this would provide is another option, so people can also implement a platform in Java with any TLA they want (don't want to mention technologies here, that'll start another flame war ;) > What you're suggesting would require a great deal more effort than > necessary. > No, I don't think so; it'd be a quite simple refactoring task: * Copy Dispatcher.java into NativeDispatcher.java and change constructor name. Make it derive from Dispatcher * Make all methods in the original Dispatcher.java abstract except for getInstance(). That method does System.getProperty("os.name") to decide which implementation to instantiate. On Windows (and other platforms that implement the C++ interface), it instantiates NativeDispatcher. On yet others, it would instantiate the MyOSNameHereDispatcher * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename corresponding C++ class I'd think this is about 3 hours of work. I'm even happy to have a shot at it, but I have no commit rights to CVS, and I certainly don't intend to make changes that other people don't like. Remember, this discussion stemmed from people being worried that the rewrite is Windows-only right now. So the goal is to get more supported platforms, and to get there you'll need people to contribute code. I think providing more options will attract more contributors. It would certainly make it more attractive for me. Cheers, Uwe > -Adrian > > > > On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to explain > my motivations for my initial request. And I agree, let's not discuss this > further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher Java > class into a NativeDispatcher class and a Dispatcher interface, so people > can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | > rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > >> This was discussed to death last year - summary: - >> * JNI is too hard >> * JNA is compelling >> * yay! let's start a rewrite >> >> Time passes... >> >> Current status: Windows-only and incomplete >> >> Back in non-vaporware land (this is meant in good humour BTW), the >> current RXTX platform-specifics are achieved with ports of POSIX >> termios.h[1]. >> >> It just works (mostly, kinda!) and you have to treat it nice and test >> it to death for _YOUR_ platform in _YOUR_ application but, y'know, >> that's what professional software engineers just do anyway. I >> seriously don't believe anyone will come up with anything better >> anytime soon. >> >> Regards, >> Michael Erskine. >> >> [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 >> Edition >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 19:32:12 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 18:32:12 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <13486-1298944789-675699@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> <13486-1298944789-675699@sneakemail.com> Message-ID: <4D6C5AAC.3070508@sandglass-software.com> Just to make sure I'm understanding you correctly, anyone porting RxTx to a new platform would have to do the following: 1. Write their own Java implementation of an abstract Dispatcher class. 2. Write a native (JNI or JNA) interface for the abstract class implementation. 3. Write all of the native (or non-native) code to implement the native interface. Is that correct? If yes, how is that easier than the simple implementation the current rewrite design uses? On a side note: there is no requirement to write native code using C++. If C++ is a real obstacle to adoption, then regular C could be used instead. In that case, there would be a Dispatcher.c file that contains function protoypes that need to be implemented. Dispatcher.c would still maintain the same role as Dispatcher.cpp - which is to shield native code developers from the details of JNI. Just build out the missing functions using C data types and you're ready to go. -Adrian On 2/28/2011 5:59 PM, iqzw2r602 at sneakemail.com wrote: > On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > What you're suggesting would require a great deal more effort than > necessary. > > > No, I don't think so; it'd be a quite simple refactoring task: > * Copy Dispatcher.java into NativeDispatcher.java and change > constructor name. Make it derive from Dispatcher > * Make all methods in the original Dispatcher.java abstract except for > getInstance(). That method does System.getProperty("os.name > ") to decide which implementation to instantiate. On > Windows (and other platforms that implement the C++ interface), it > instantiates NativeDispatcher. On yet others, it would instantiate the > MyOSNameHereDispatcher > * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename > corresponding C++ class > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From storrellas at bdigital.org Wed Feb 23 10:37:48 2011 From: storrellas at bdigital.org (Sergi Torrellas) Date: Wed, 23 Feb 2011 18:37:48 +0100 Subject: [Rxtx] Serial port description Message-ID: Hi all, I am using the library RXTX for connecting to a USB port that is mapped to a serial port. My question is the following is possible to get a longer description of the serial part a part from the COMX? Many thanks, -- *SERGI TORRELLAS SOCASTRO Desenvolupador R+D Salut M. 616.21.72.97** *storrellas at bdigital.org *BARCELONA DIGITAL CENTRE TECNOL?GIC* Roc Boronat 117, 5a planta, 08018 Barcelona Tel. +34 93 553 45 40 - Fax. +34 93 553 45 41 www.bdigital.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Wed Feb 23 21:46:30 2011 From: showard314 at gmail.com (Scott Howard) Date: Wed, 23 Feb 2011 23:46:30 -0500 Subject: [Rxtx] compiling rxtx on archs without sys/io.h Message-ID: Hello all, There is a bug at: http://bugzilla.qbang.org/show_bug.cgi?id=72 for fixing a build failure on PPCs. A similar build failure occurs on mips, ARM, sparc, and a few other architectures. You can work around it be using AC_CHECK_HEADERS and properly shielding #include . I uploaded a new patch to that bug which does that, and have compiled rxtx on those architectures. This will also work for future architectures and won't require manually updating the #ifdefs. If you do use this patch, you should also edit the individual Makefiles (like Makefile.mingw32) to properly #define or #undef HAVE_SYS_IO_H Regards, Scott From ajmas at sympatico.ca Fri Feb 25 09:03:34 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:03:34 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D613A6C.80304@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. On 20-Feb-2011, at 10:59, Adrian Crum wrote: > The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: >> Are there any show stoppers to using the rewrite instead of the current source branch? >> >> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >> >>> There is no timeline to merge the two versions. >>> >>> -Adrian >>> >>> Quoting Andre-John Mas: >>> >>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>> >>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>> >>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>> Hi, >>>>>> >>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>> - src/ >>>>>> - Rewrite2010/src/ >>>>>> >>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>> >>>>>> Andre >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 25 09:17:23 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:17:23 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > >> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >> >> -Adrian >> >> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>> Are there any show stoppers to using the rewrite instead of the current source branch? >>> >>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>> >>>> There is no timeline to merge the two versions. >>>> >>>> -Adrian >>>> >>>> Quoting Andre-John Mas: >>>> >>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>> >>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>> >>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>> - src/ >>>>>>> - Rewrite2010/src/ >>>>>>> >>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>> >>>>>>> Andre >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 26 18:58:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 26 Feb 2011 17:58:27 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: <4D69AFC3.50008@sandglass-software.com> Thank you for doing that. There hasn't been much community interest in the rewrite, and I've been busy since I started it. I hope to work on it some more in the next month or two. -Adrian On 2/25/2011 8:17 AM, Andre-John Mas wrote: > I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > >> What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. >> >> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >> >>> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>> >>> -Adrian >>> >>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> Are there any show stoppers to using the rewrite instead of the current source branch? >>>> >>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>> >>>>> There is no timeline to merge the two versions. >>>>> >>>>> -Adrian >>>>> >>>>> Quoting Andre-John Mas: >>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>>> >>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>> - src/ >>>>>>>> - Rewrite2010/src/ >>>>>>>> >>>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>>> >>>>>>>> Andre >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From iqzw2r602 at sneakemail.com Sun Feb 27 15:47:16 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 09:47:16 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D69AFC3.50008@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> Message-ID: <23853-1298846836-791608@sneakemail.com> Hi Adrian, I've followed the discussion about the rewrite over the past months, and I'm sorry to hear interest in it hasn't picked up. I've had a look at the source code yesterday, and it seems very well designed and nicely documented. IMHO one reason why it hasn't been fully embraced yet is because it currently only runs on Windows. I know from first hand experience (jpathwatch) that it's quite hard to write robust cross-platform Java libraries containing native code, and that people might be hesitant to pick up development on something like that. I was contemplating of toying around with the code base a couple of times, but I'd rather write as much platform dependent code as I can in Java (this might be a matter of preference, however, I have found that it made my life a hell of a lot easier). So to give people choice in how they implement their port, I suggest that: * the Dispatcher Java class becomes abstract, without native methods. * All Java and native code in the Dispatcher class moves to a new NativeDispatcher java/C++ class, which derives from Dispatcher. * The Dispatcher.getInstance() method chooses, per platform, which Dispatcher instance it's going to create. So on Windows and other platforms that like their dispatcher to be native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). On other platforms (say, on BSD based platforms), a different Dispatcher implementation is instantiated, which can be implemented almost entirely in Java. This way, every OS can implement it's own dispatcher. This gives the implementor the option to choose whether to write their implementation as a fat native library (like the one you have implemented for Windows), or in Java with a slim native library (which only wraps OS function calls). In turn, it might make it more attractive for developers to jump in and contribute implementations for other platforms. What do you think? Cheers, Uwe On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > Thank you for doing that. There hasn't been much community interest in the > rewrite, and I've been busy since I started it. I hope to work on it some > more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > >> I have added a stub page here: >> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >> >> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >> >> What could be useful is an entry in the wiki documenting the mile-stones >>> and what is left to be done. >>> >>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>> >>> The rewrite isn't finished - it still needs Java unit tests and native >>>> code for Apple and *nix. You can find more information on the mailing list: >>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>> >>>> -Adrian >>>> >>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> >>>>> Are there any show stoppers to using the rewrite instead of the current >>>>> source branch? >>>>> >>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>> >>>>> There is no timeline to merge the two versions. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> Quoting Andre-John Mas: >>>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>> for? >>>>>>> >>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>> library is in Rewrite2010/src. >>>>>>>> >>>>>>>> -Adrian >>>>>>>> >>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>> - src/ >>>>>>>>> - Rewrite2010/src/ >>>>>>>>> >>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>> we shouldn't be using around? >>>>>>>>> >>>>>>>>> Andre >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Sun Feb 27 16:26:56 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 27 Feb 2011 15:26:56 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <4D6ADDC0.1020608@sandglass-software.com> As far as I know, any Java library that manipulates hardware devices is going to need native code. If the JRE contains classes that already do that, then I'm unaware of them. In other words, I don't know how one would accomplish "making OS calls" without native code. I agree that developing a Java library that reads/writes serial and parallel hardware is not an easy task - therefore there will be few willing to engage in it. I don't agree that Java code should contain as much platform-specific code as possible. That might make things easier for you, but it defeats the "write once, run anywhere" design of Java. I'm not sure what you mean by "fat native code" versus "slim native code." The native code in the rewrite is the minimum necessary to control the hardware - in fact, that is one of the rewrite's design goals. The rewrite's design reduces native code development down to implementing two virtual classes and two functions. I thought I set the bar pretty low, but I might be wrong. -Adrian On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, > and I'm sorry to hear interest in it hasn't picked up. I've had a look > at the source code yesterday, and it seems very well designed and > nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick up development on something like that. > > I was contemplating of toying around with the code base a couple of > times, but I'd rather write as much platform dependent code as I can > in Java (this might be a matter of preference, however, I have found > that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be implemented > almost entirely in Java. This way, every OS can implement it's own > dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have > implemented for Windows), or in Java with a slim native library (which > only wraps OS function calls). > In turn, it might make it more attractive for developers to jump in > and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > Thank you for doing that. There hasn't been much community > interest in the rewrite, and I've been busy since I started it. I > hope to work on it some more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: > http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > What could be useful is an entry in the wiki documenting > the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > The rewrite isn't finished - it still needs Java unit > tests and native code for Apple and *nix. You can find > more information on the mailing list: > http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, > adrian.crum at sandglass-software.com > wrote: > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas >: > > What is the timeline to merge the two? > Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > The latest working source is in src, > and a recent rewrite of the library is > in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas > wrote: > > Hi, > > I am seeing two Java source folder > in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and > is there any need to keep the one > we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:28:56 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:28:56 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() Message-ID: Hi, I have a receive thread that does nothing but call read() on the serial port input stream. It works fine for a while but after running for a long time it eventually returns -1 which means EOF. This is my first problem, as the device I'm talking to runs forever, I don't know why it would return -1. I am calling disableReceiveThreshold() and disableReceiveTimeout() at initialization which according to the documentation means read will return as soon as any data is available and it will block forever when data is not available, so -1 should never be returned from read, right? I have been unable to figure out why read returns -1 after a long while but I have found that if I kill my application and restart it everything works fine again. Therefore I tried to work around the problem by having my code close the port and reopen it when read returns -1. My second problem is that in this case when I call close() on the port it blocks forever. I did find this old bug http://bugzilla.qbang.org/show_bug.cgi?id=53 which describes close() hanging on OSX, but it says that bug was fixed with a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any idea why read might be returning -1 in the first place? If I can avoid that I don't care about close() hanging because I would never close the port. If not, does anyone know why close() might block forever and how I can prevent this? I'm using RXTX version 2.1-7. Thanks, -- Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:34:04 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:34:04 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() In-Reply-To: References: Message-ID: I mis-spoke, I don't have my own thread calling read, I am calling read in the event handler after receiving a SerialPortEvent.DATA_AVAILABLE event. Everything else I said should be accurate though. Ryan On Mon, Feb 28, 2011 at 12:28 AM, Ryan Boder wrote: > Hi, > > I have a receive thread that does nothing but call read() on the serial > port input stream. It works fine for a while but after running for a long > time it eventually returns -1 which means EOF. This is my first problem, as > the device I'm talking to runs forever, I don't know why it would return -1. > I am calling disableReceiveThreshold() and disableReceiveTimeout() at > initialization which according to the documentation means read will return > as soon as any data is available and it will block forever when data is not > available, so -1 should never be returned from read, right? > > I have been unable to figure out why read returns -1 after a long while but > I have found that if I kill my application and restart it everything works > fine again. Therefore I tried to work around the problem by having my code > close the port and reopen it when read returns -1. My second problem is that > in this case when I call close() on the port it blocks forever. I did find > this old bug > > http://bugzilla.qbang.org/show_bug.cgi?id=53 > > which describes close() hanging on OSX, but it says that bug was fixed with > a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any > idea why read might be returning -1 in the first place? If I can avoid that > I don't care about close() hanging because I would never close the port. If > not, does anyone know why close() might block forever and how I can prevent > this? I'm using RXTX version 2.1-7. > > Thanks, > -- > Ryan > > -- Ryan Boder 1 614 598-6339 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.w.janssen at lxtreme.nl Mon Feb 28 04:09:50 2011 From: j.w.janssen at lxtreme.nl (Jan Willem Janssen) Date: Mon, 28 Feb 2011 12:09:50 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <123a513d85e4569df1ebce58088e6592.squirrel@lxtreme.homelinux.org> FWIW: I'm also interested in the 2010-rewrite, but was waiting until a bit more code was available for other platforms, like Linux and/or OSX. I'd like to offer my help if needed, for example to test stuff. Regards, Jan Willem On Sun, February 27, 2011 23:47, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm > sorry to hear interest in it hasn't picked up. I've had a look at the > source > code yesterday, and it seems very well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java > (this > might be a matter of preference, however, I have found that it made my > life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a > NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely > in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. From iqzw2r602 at sneakemail.com Mon Feb 28 04:52:33 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 22:52:33 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6ADDC0.1020608@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> Message-ID: <15854-1298893954-139343@sneakemail.com> Hi Adrian, On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > As far as I know, any Java library that manipulates hardware devices is > going to need native code. If the JRE contains classes that already do that, > then I'm unaware of them. In other words, I don't know how one would > accomplish "making OS calls" without native code. > Yes, you're right, you need native code to do that. The only question is how much. I'm not saying that you wouldn't write native code. I'm just saying you'll need very little. Take CreateFile() on Windows. Your implementation calls it from C++ code, which implements logic all around it. However, you can also call CreateFile() from Java code, and this is what I'm proposing: Expose the CreateFile() function to Java as a static native Java method, so it becomes directly callable from Java code (only visible to implementation, not publicly). So while the code all around the CreateFile() call is all Java (granted, it's platform specific, it has to be), the 'public static native CreateFile()' method is implemented in C++ - and all it does is to call the native CreateFile() function. > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few willing > to engage in it. I don't agree that Java code should contain as much > platform-specific code as possible. That might make things easier for you, > but it defeats the "write once, run anywhere" design of Java. > "write once, run anywhere" (WORA) does apply for client code calling RXTX. However, it doesn't mean that you can't or shouldn't write platform specific code to /implement/ a library that's doing OS specific things; in fact you have to: CreateFile() only exists on Windows, open() only on Unix, etc., so you have to write code specific to each platform that calls these functions and handles their semantics. And in case you haven't noticed yet, the JDK does the same thing, it has platform specific Java classes for lots of things (try debugging the methods of java.io.File, or the parts of the AWT, and see where they call into). The point of WORA is that client code - code that calls into RXTX - should not have to deal with specifics of a platform. > I'm not sure what you mean by "fat native code" versus "slim native code." > Fat native libraries have methods like this, all written in C++: Lots of pointers here, lots of things that could go wrong (but I'm not saying it does, just showing the potential, think threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: CommPort* CommPortFactory::getInstance(const char *portName, int portType) { #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS if (strcmp("PARALLEL_PASS", portName) == 0) return new ParallelLoopback(portName); if (strcmp("SERIAL_PASS", portName) == 0) return new SerialLoopback(portName); #endif // Do not open overlapped. Let the Java application // handle multi-threaded I/O. HANDLE hComm = CreateFile( portName, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); if (hComm == INVALID_HANDLE_VALUE) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); printf("%s\n", lpMsgBuf); delete lpMsgBuf; throw IOException(); } .... // SNIP! Fact is, you can write all of this in Java. You can even take the same code, reword it a bit, and feed it into javac. So I won't quote this here again and Java-ise it, just assume the above is Java code (BTW: you can even do #ifdefs with statics). This Java code will have this import statement at the top: import static Windows.*; In Windows.java would look like this (in fact it does, I've done this in jpathwatch): static native long CreateFile(String fileName, int desiredAccess, int shareMode, SECURITY_ATTRIBUTES securityAttributes, int creationDisposition, int flagsAndAttributes, long templateFileHandle); And the code in Windows.cpp? That calls the native CreateFile() function. And that's all (There's some special handling so GetLastError() works in different threads and won't interfere with the JVM, but that's another topic) The native code in the rewrite is the minimum necessary to control the > hardware - in fact, that is one of the rewrite's design goals. The rewrite's > design reduces native code development down to implementing two virtual > classes and two functions. I thought I set the bar pretty low, but I might > be wrong. > See above; it can be even less. And since I keep saying I've done it, have a look at these files: Windows.cpp[1], Windows.java[2], WindowsPathWatchService.java [3] Don't understand this as a criticism of your design, I actually quite like it. All I am saying is that it doesn't need to be all native, and that if you make the Dispatcher an abstract class like I proposed in my previous email, implementors can choose which language they use (and yes, I'd choose Java over C++; and I've written C++ code for more than 15 years) Cheers, Uwe [1] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup [2] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup [3] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > -Adrian > > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm sorry to hear interest in it hasn't picked up. I've had a look at the > source code yesterday, and it seems very well designed and nicely > documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java (this > might be a matter of preference, however, I have found that it made my life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example > Allow| wrote: > >> Thank you for doing that. There hasn't been much community interest in the >> rewrite, and I've been busy since I started it. I hope to work on it some >> more in the next month or two. >> >> -Adrian >> >> >> On 2/25/2011 8:17 AM, Andre-John Mas wrote: >> >>> I have added a stub page here: >>> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >>> >>> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >>> >>> What could be useful is an entry in the wiki documenting the mile-stones >>>> and what is left to be done. >>>> >>>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>>> >>>> The rewrite isn't finished - it still needs Java unit tests and native >>>>> code for Apple and *nix. You can find more information on the mailing list: >>>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>>> >>>>>> Are there any show stoppers to using the rewrite instead of the >>>>>> current source branch? >>>>>> >>>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>>> >>>>>> There is no timeline to merge the two versions. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> Quoting Andre-John Mas: >>>>>>> >>>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>>> for? >>>>>>>> >>>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>>> >>>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>>> library is in Rewrite2010/src. >>>>>>>>> >>>>>>>>> -Adrian >>>>>>>>> >>>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>>> - src/ >>>>>>>>>> - Rewrite2010/src/ >>>>>>>>>> >>>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>>> we shouldn't be using around? >>>>>>>>>> >>>>>>>>>> Andre >>>>>>>>>> _______________________________________________ >>>>>>>>>> Rxtx mailing list >>>>>>>>>> Rxtx at qbang.org >>>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 28 05:36:14 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 28 Feb 2011 14:36:14 +0200 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> Message-ID: Sorry for top posting but I felt it was justified here to keep the whole context of the referred text intact. I very much agree with Uwe's point of view, ie doing as much as possible in Java, even the platform specific things, and doing the absolute minimum in C/C++. And this is not criticism Adrian's work/design. I would (again) advocate using JNA instead of JNI to access the native OS services/API from Java. This simplifies the live of the library users and developers a great deal because no C/C++ tool chain is involved. Zero. You don't even need a C compiler. There are some 'issues' in accessing some OS API functions from Java (like the need to use OS specific values in the Java code that are only available with #define in header files) but given the stability and longtime standing of the API functions we are talking about (open/close/select/read/write) I do not see this as big issue. A lot of the argumentation is included in this thread when this was last time rehashed on this list. http://answerpot.com/showthread.php?1022262-JNA%20alternative%20(was:%20rxt x%20moving%20from%20JNI%20to%20JNA%20(was%20%20About%20JRE%20crashes))/Page 1 If anyone is interested I can make the straw man implementation available. It compiles and has a fighting chance to work in a POSIX compatible OS (Mac OS X / Linux) with moderate debugging. Of course it is a long way from production, especially as throwing away the current rxtx also throws away most of the testing and debugging to the obscure/uncommon OSes that rxtx currently supports (I suggest anyone attempting to replace the current implementation has peek at the innards of the current implementation to see the variety it claims to support). (As an aside, and not really relevant to calling OS API from Java with JNA, I feel I need to mention that calling C++ using JNA is not easy because of the name mangling, so libraries with C interface are preferred with JNA). br Kusti On 2/28/11 13:52, "iqzw2r602 at sneakemail.com" wrote: >Hi Adrian, > >On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum >adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| >wrote: > > > > > > > > As far as I know, any Java library that manipulates hardware devices > is going to need native code. If the JRE contains classes that > already do that, then I'm unaware of them. In other words, I don't > know how one would accomplish "making OS calls" without native code. > > > > >Yes, you're right, you need native code to do that. The only question is >how much. I'm not saying that you wouldn't write native code. I'm just >saying you'll need very little. Take CreateFile() on Windows. Your >implementation calls it from C++ code, which implements logic all around >it. > >However, you can also call CreateFile() from Java code, and this is what >I'm proposing: Expose the CreateFile() function to Java as a static >native Java method, so it becomes directly callable from Java code (only >visible to implementation, not publicly). So while the code all around >the CreateFile() call is all Java (granted, it's platform specific, it >has to be), the 'public static native CreateFile()' method is implemented >in C++ - and all it does is to call the native CreateFile() function. > > > > > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few > willing to engage in it. I don't agree that Java code should contain > as much platform-specific code as possible. That might make things > easier for you, but it defeats the "write once, run anywhere" design > of Java. > > > > >"write once, run anywhere" (WORA) does apply for client code calling >RXTX. > >However, it doesn't mean that you can't or shouldn't write platform >specific code to /implement/ a library that's doing OS specific things; >in fact you have to: >CreateFile() only exists on Windows, open() only on Unix, etc., so you >have to write code specific to each platform that calls these functions >and handles their semantics. And in case you haven't noticed yet, the JDK >does the same thing, it has platform specific Java classes for lots of >things (try debugging the methods of java.io.File, or the parts of the >AWT, and see where they call into). > >The point of WORA is that client code - code that calls into RXTX - >should not have to deal with specifics of a platform. > > > > > I'm not sure what you mean by "fat native code" versus "slim native > code." > > > >Fat native libraries have methods like this, all written in C++: Lots of >pointers here, lots of things that could go wrong (but I'm not saying it >does, just showing the potential, think >threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: > >CommPort* CommPortFactory::getInstance(const char *portName, int portType) >{ >#ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); >#endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } >... >// SNIP! > >Fact is, you can write all of this in Java. You can even take the same >code, reword it a bit, and feed it into javac. So I won't quote this here >again and Java-ise it, just assume the above is Java code (BTW: you can >even do #ifdefs with statics). This Java code will have this import >statement at the top: > >import static Windows.*; > >In Windows.java would look like this (in fact it does, I've done this in >jpathwatch): > >static native long CreateFile(String fileName, int desiredAccess, int >shareMode, SECURITY_ATTRIBUTES securityAttributes, int >creationDisposition, int flagsAndAttributes, long templateFileHandle); > >And the code in Windows.cpp? That calls the native CreateFile() function. >And that's all (There's some special handling so GetLastError() works in >different threads and won't interfere with the JVM, but that's another >topic) > > > >The native code in the rewrite is the minimum necessary to > control the hardware - in fact, that is one of the rewrite's design > goals. The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I set > the bar pretty low, but I might be wrong. > > > > >See above; it can be even less. > >And since I keep saying I've done it, have a look at these files: >Windows.cpp >jpathwatch-native/src/Windows.cpp?revision=130&view=markup>[1], >Windows.java >jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&v >iew=markup>[2], WindowsPathWatchService.java >jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.jav >a?revision=130&view=markup>[3] > >Don't understand this as a criticism of your design, I actually quite >like it. All I am saying is that it doesn't need to be all native, and >that if you make the Dispatcher an abstract class like I proposed in my >previous email, implementors can choose which language they use (and yes, >I'd choose Java over C++; and I've written C++ code for more than 15 >years) > >Cheers, > >Uwe > >[1] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-native/src/Windows.cpp?revision=130&view=markup >[2] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&vi >ew=markup >[3] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java >?revision=130&view=markup > > > > > -Adrian > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > >Hi Adrian, > > I've followed the discussion about the rewrite over the past > months, and I'm sorry to hear interest in it hasn't picked up. > I've had a look at the source code yesterday, and it seems very > well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because > it currently only runs on Windows. I know from first hand > experience (jpathwatch) that it's quite hard to write robust > cross-platform Java libraries containing native code, and that > people might be hesitant to pick up development on something like > that. > > I was contemplating of toying around with the code base a couple > of times, but I'd rather write as much platform dependent code as > I can in Java (this might be a matter of preference, however, I > have found that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I > suggest that: > > * the Dispatcher Java class becomes abstract, without native > methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by > Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be > implemented almost entirely in Java. This way, every OS can > implement it's own dispatcher. > > This gives the implementor the option to choose whether to write > their implementation as a fat native library (like the one you > have implemented for Windows), or in Java with a slim native > library (which only wraps OS function calls). > In turn, it might make it more attractive for developers to jump > in and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian > Crum adrian.crum-at-sandglass-software.com > > |rxtx.org > mailing list/Example Allow| > wrote: > >Thank you for doing that. There hasn't > been much community interest in the rewrite, and I've been > busy since I started it. I hope to work on it some more in the > next month or two. > > > -Adrian > > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: >http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > > What could be useful is an entry in the wiki > documenting the mile-stones and what is left to be > done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > > The rewrite isn't finished - it still needs Java > unit tests and native code for Apple and *nix. You > can find more information on the mailing list: >http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, >adrian.crum at sandglass-software.com > wrote: > > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas: > > > What is the timeline to merge the two? Also, > what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > > The latest working source is in src, and a > recent rewrite of the library is in > Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: > > Hi, > > I am seeing two Java source folder in the > CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there > any need to keep the one we shouldn't be > using around? > > Andre >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > >http://mailman.qbang.org/mailman/listinfo/rxtx > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From adrian.crum at sandglass-software.com Mon Feb 28 08:15:18 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 07:15:18 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> Message-ID: <4D6BBC06.4090402@sandglass-software.com> Thank you for the suggestions - I will keep them in mind the next time I work on it. -Adrian On 2/28/2011 3:52 AM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > As far as I know, any Java library that manipulates hardware > devices is going to need native code. If the JRE contains classes > that already do that, then I'm unaware of them. In other words, I > don't know how one would accomplish "making OS calls" without > native code. > > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as a > static native Java method, so it becomes directly callable from Java > code (only visible to implementation, not publicly). So while the code > all around the CreateFile() call is all Java (granted, it's platform > specific, it has to be), the 'public static native CreateFile()' > method is implemented in C++ - and all it does is to call the native > CreateFile() function. > > > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there will > be few willing to engage in it. I don't agree that Java code > should contain as much platform-specific code as possible. That > might make things easier for you, but it defeats the "write once, > run anywhere" design of Java. > > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. > > > I'm not sure what you mean by "fat native code" versus "slim > native code." > > > Fat native libraries have methods like this, all written in C++: Lots > of pointers here, lots of things that could go wrong (but I'm not > saying it does, just showing the potential, think threading) - and I'm > a cheeky bastard here and quote from W32_Support.cpp: > > CommPort* CommPortFactory::getInstance(const char *portName, int portType) > { > #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); > #endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } > ... > // SNIP! > > Fact is, you can write all of this in Java. You can even take the same > code, reword it a bit, and feed it into javac. So I won't quote this > here again and Java-ise it, just assume the above is Java code (BTW: > you can even do #ifdefs with statics). This Java code will have this > import statement at the top: > > import static Windows.*; > > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > > static native long CreateFile(String fileName, int desiredAccess, int > shareMode, SECURITY_ATTRIBUTES securityAttributes, int > creationDisposition, int flagsAndAttributes, long templateFileHandle); > > And the code in Windows.cpp? That calls the native CreateFile() > function. And that's all (There's some special handling so > GetLastError() works in different threads and won't interfere with the > JVM, but that's another topic) > > The native code in the rewrite is the minimum necessary to control > the hardware - in fact, that is one of the rewrite's design goals. > The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I > set the bar pretty low, but I might be wrong. > > > See above; it can be even less. > > And since I keep saying I've done it, have a look at these files: > Windows.cpp > [1], > Windows.java > [2], > WindowsPathWatchService.java > [3] > > Don't understand this as a criticism of your design, I actually quite > like it. All I am saying is that it doesn't need to be all native, and > that if you make the Dispatcher an abstract class like I proposed in > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) > > Cheers, > > Uwe > > [1] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup > > [2] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup > > [3] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Feb 28 09:51:19 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 17:51:19 +0100 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <20110228165119.GD10695@elberon.bln.de.ingenico.com> * Andre-John Mas wrote on Fri, Feb 18, 2011 at 21:43 -0500: > Is anyone using JDK 1.4 or less? Yes, 1.4.2_11-b06 (j2sdk-1_4_2_11-fcs-linux-i586) in some cases (also similar versions: 1.4.2_15-b02, 1.4.2_16-b05, maybe others). > I am asking because I would be interested in bringing the code > up to Java 1.5 standards, with the use of generics and other > recent developments. Why that? oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Mon Feb 28 10:20:53 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 18:20:53 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6BBC06.4090402@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> Message-ID: <20110228172052.GE10695@elberon.bln.de.ingenico.com> * Adrian Crum wrote on Mon, Feb 28, 2011 at 07:15 -0800: [...] > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. I think in general it can be good to have an system-abstracting interface of the native code. That means, the native code implementation abstracts from the system (instead of implementing that abstractions in Java). Of course it is more complex :) IIRC we already had such a discussion here. > Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as > a static native Java method, so it becomes directly callable > from Java code (only visible to implementation, not publicly). > So while the code all around the CreateFile() call is all Java > (granted, it's platform specific, it has to be), the 'public > static native CreateFile()' method is implemented in C++ - and > all it does is to call the native CreateFile() function. I don't think I'd like this. CreateFile() is very system-specific. Exposing this to Java code makes this Java code system-specific. Although you could "run" it everywhere, it won't work anyware except on appropriate windows boxes. But this goes even further, you might consider calling open and select from Java and use it for serial ports on linux, but on another system that have both functions, they simply won't work (like on windows; there should be open and select, but AFAIK the latter cannot be expected to work on serial interfaces). Of course there is an somewhat strong argument, that is if the developer is much more experienced with Java than with C, it might be easier to implement this in Java, but personally I think it is hard to believe that developers who are able to correctly abstract device-I/O from system calls are not good at C, because I'm sure C is the language system by system programmers. > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there > will be few willing to engage in it. I don't agree that Java > code should contain as much platform-specific code as possible. > That might make things easier for you, but it defeats the > "write once, run anywhere" design of Java. Java runs on compliant JVMs only and nowhere else. It just happens that JVMs exist for most systems of a special set of computers such as PCs and small servers (but not neccesarily for embedded devices or main frames). As soon as a single native function is needed (required) for the application to work properly, the `run anywhere' is already impossible, because now it does not run on any JVM but only on JVMs that supply an implementation for this native code function. > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. Yes, exactly. Also, it is possible to write system-specific applications `with 100% Java' (for example, hardcode "C:\\Program Files" to be windows-specific or use "/dev/null" or so). Expecting a certain behavior not specified by Java (e.g. whether you can read "/dev/null", what CreateFile returns or whether select works on non-socket-filehandles) IMHO already misses the "write once, run anywhere" idea. So in summary I don't think the amount of platform-specific code matters much. It must be avaiable, requiring deployment etc, so little difference how many lines of code that were. [...] > import static Windows.*; > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > static native long CreateFile(String fileName, int desiredAccess, int [...] Someone here also proposed to use a general method to invoke arbitrary functions of shared libraries, JNA. By this, you wouldn't need `static NATIVE long CreateFile'; you could replace JNI by JNA here. Assuming that this native functionality would already be deployed on many target platform systems, implementing all the platform-specific code in Java can make sense, because this specific implementations would not require additional native code deployment. If, for example, the Java installation of Debian would by default already offer native library call execution, platform-specific code implemented in Java would work on Debian without needing any additional binary lib to be installed, I think could be quite an advantage. I think if having some Windows.java layer (which I personally would not like), JNA IMHO seems to be suited well. Personally, I prefere to define nice, simple and comfortable interfaces, also for native code (if possible, for JNI I think it always is a compromise). > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) Do you mean in general or also specifically for system programming? If someone would need a small program to let's say query DCD on linux I think a small C application would be suited best. Of course this topic also is more complex and depends on things. oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From msemtd at googlemail.com Mon Feb 28 13:50:42 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 28 Feb 2011 20:50:42 +0000 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172052.GE10695@elberon.bln.de.ingenico.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: This was discussed to death last year - summary: - * JNI is too hard * JNA is compelling * yay! let's start a rewrite Time passes... Current status: Windows-only and incomplete Back in non-vaporware land (this is meant in good humour BTW), the current RXTX platform-specifics are achieved with ports of POSIX termios.h[1]. It just works (mostly, kinda!) and you have to treat it nice and test it to death for _YOUR_ platform in _YOUR_ application but, y'know, that's what professional software engineers just do anyway. I seriously don't believe anyone will come up with anything better anytime soon. Regards, Michael Erskine. [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition From iqzw2r602 at sneakemail.com Mon Feb 28 15:01:20 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 09:01:20 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <6175-1298930480-518642@sneakemail.com> Good summary. This whole JNI/JNA/C++ thing only came up again because I tried to explain my motivations for my initial request. And I agree, let's not discuss this further, we've been there already. So let's get this discussion back on track: All I suggested is to separate the implementation of the Dispatcher Java class into a NativeDispatcher class and a Dispatcher interface, so people can implement the Dispatcher (Java-) interface with whatever Three-Letter-Abbreviation they want. So can people please comment on that? Cheers, Uwe On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 > Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 15:22:21 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 14:22:21 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <4D6C201D.6060103@sandglass-software.com> One of the issues I tried to address in the rewite is the "JNI is too hard" issue. Anyone with rudimentary C++ skills can implement the two virtual classes and two functions - no knowledge of JNI is necessary because Dispatcher.cpp takes care of all of the JNI data type marshalling/unmarshalling. I don't agree that the 2.x versions "just work" - the recurring bugs mentioned on this list and in other forums are evidence of that. I tried to work with the 2.x version by wrapping it in thread-safe classes, but even that didn't help. I tried to fix the most recent version by supplying patches, but the sum of the patches added up to a rewrite. So I created a rewrite instead. -Adrian On 2/28/2011 12:50 PM, Michael Erskine wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Mon Feb 28 16:24:00 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 15:24:00 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <6175-1298930480-518642@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> Message-ID: <4D6C2E90.9010601@sandglass-software.com> My question would be: Why would you do that? The rewrite does most of the work for you - all you have to do is implement two C++ virtual classes and two C++ functions. In Windows that took me a few hours. I can't imagine other ports taking much longer than that - especially since POSIX-based code can be shared between ports. What you're suggesting would require a great deal more effort than necessary. -Adrian On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to > explain my motivations for my initial request. And I agree, let's not > discuss this further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher > Java class into a NativeDispatcher class and a Dispatcher interface, > so people can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine > msemtd-at-googlemail.com |rxtx.org > mailing list/Example Allow| > <6zkk4zdpgt at sneakemail.com > wrote: > > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Mon Feb 28 17:26:18 2011 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Mon, 28 Feb 2011 17:26:18 -0700 Subject: [Rxtx] =?utf-8?q?Which_Java_folder_in_source=3F?= Message-ID: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 17:40:03 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 16:40:03 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> References: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> Message-ID: <4D6C4063.5060708@sandglass-software.com> Speaking of bugs one knows - was anyone interested in the bug fixing effort you proposed? -Adrian On 2/28/2011 4:26 PM, jfh at greenhousepc.com wrote: > Adrian, > > I have many dozens of clients using the RXTX jar on a wide variety of > Windows, Linux and a few MacOS X releases. Provided one does what the > previous poster suggested, the code really does "just work". > > Most of the problems that get reported are things that Windows > applications, and not a few Linux ones as well, have problems with > already. > > The other issue is that even with a boat load of testing, I have no > expectation to migrate to the re-write until 3Q12 at the absolute > earliest. > > I appreciate the effort you are putting into this re-write, but after > 32 years in this field (that's more years than many on this list are > alive), I've seen a lot of "re-writes". I've even done a few myself, > some better than others. > > That 32 years of software engineering experience has taught me one > vital lesson -- the bugs one knows are far less dangerous than the > bugs one doesn't know. And all re-writes are a minefield of unknown > bugs. For my products, it takes about 9 =months= before a release is > stable enough that I'm truly pleased with it. I'm still struggling > with bugs from new features I added in my 3Q10 release. I don't need > to struggle with the new bugs that are going to come from the > re-write. Not personal, just my 32 years of experience. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com > // greenHousePC on Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Which Java folder in source? > From: Adrian Crum > ; > Date: Mon, February 28, 2011 4:22 pm > To: rxtx at qbang.org > > One of the issues I tried to address in the rewite is the "JNI is too > hard" issue. Anyone with rudimentary C++ skills can implement the two > virtual classes and two functions - no knowledge of JNI is necessary > because Dispatcher.cpp takes care of all of the JNI data type > marshalling/unmarshalling. > > I don't agree that the 2.x versions "just work" - the recurring bugs > mentioned on this list and in other forums are evidence of that. I > tried > to work with the 2.x version by wrapping it in thread-safe > classes, but > even that didn't help. I tried to fix the most recent version by > supplying patches, but the sum of the patches added up to a > rewrite. So > I created a rewrite instead. > > -Adrian > > On 2/28/2011 12:50 PM, Michael Erskine wrote: > > This was discussed to death last year - summary: - > > * JNI is too hard > > * JNA is compelling > > * yay! let's start a rewrite > > > > Time passes... > > > > Current status: Windows-only and incomplete > > > > Back in non-vaporware land (this is meant in good humour BTW), the > > current RXTX platform-specifics are achieved with ports of POSIX > > termios.h[1]. > > > > It just works (mostly, kinda!) and you have to treat it nice and test > > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > > that's what professional software engineers just do anyway. I > > seriously don't believe anyone will come up with anything better > > anytime soon. > > > > Regards, > > Michael Erskine. > > > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From iqzw2r602 at sneakemail.com Mon Feb 28 18:59:48 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 12:59:48 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6C2E90.9010601@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> Message-ID: <13486-1298944789-675699@sneakemail.com> On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > My question would be: Why would you do that? > I'm thinking about the debugging effort, quite frankly. When I started off with jpathwatch, I initially wrote a fat native library. It got me into trouble: It was hard to debug, the JVM would crash every now and then, depending which bug it hit, and debugging a process with a JVM (even on Windows) is not fun. When I finally got it to work on Windows, I started doing Linux, and the same thing happened again - and I didn't find the tools as nice. When it started sucking up too much of my time I scrapped the whole thing, literally, and moved to a slim native library. I wrote the new implementation in a fraction of the time, and it rarely ever crashed (because except for the little C++ code to wrap OS functions there was nothing that could). So that's my reason to write things in Java mainly for a project like this. Others prefer C++. What I'm suggesting gives people a choice to use the tool they're most comfortable with (because this is really about people, not code; the code won't write and fix itself, people have to go in and do it) > The rewrite does most of the work for you - all you have to do is implement > two C++ virtual classes and two C++ functions. In Windows that took me a few > hours. I can't imagine other ports taking much longer than that - especially > since POSIX-based code can be shared between ports. > And that's fine for people who want to write a native code implementation. I'm not talking about scrapping that at all, quite the contrary - Windows and the C++ framework should stay as it is, it's quite a large contribution you've made in time and effort, it'd be stupid to abandon that. Even more so, other platforms could build on the C++ code you've written, as you intended. All this would provide is another option, so people can also implement a platform in Java with any TLA they want (don't want to mention technologies here, that'll start another flame war ;) > What you're suggesting would require a great deal more effort than > necessary. > No, I don't think so; it'd be a quite simple refactoring task: * Copy Dispatcher.java into NativeDispatcher.java and change constructor name. Make it derive from Dispatcher * Make all methods in the original Dispatcher.java abstract except for getInstance(). That method does System.getProperty("os.name") to decide which implementation to instantiate. On Windows (and other platforms that implement the C++ interface), it instantiates NativeDispatcher. On yet others, it would instantiate the MyOSNameHereDispatcher * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename corresponding C++ class I'd think this is about 3 hours of work. I'm even happy to have a shot at it, but I have no commit rights to CVS, and I certainly don't intend to make changes that other people don't like. Remember, this discussion stemmed from people being worried that the rewrite is Windows-only right now. So the goal is to get more supported platforms, and to get there you'll need people to contribute code. I think providing more options will attract more contributors. It would certainly make it more attractive for me. Cheers, Uwe > -Adrian > > > > On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to explain > my motivations for my initial request. And I agree, let's not discuss this > further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher Java > class into a NativeDispatcher class and a Dispatcher interface, so people > can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | > rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > >> This was discussed to death last year - summary: - >> * JNI is too hard >> * JNA is compelling >> * yay! let's start a rewrite >> >> Time passes... >> >> Current status: Windows-only and incomplete >> >> Back in non-vaporware land (this is meant in good humour BTW), the >> current RXTX platform-specifics are achieved with ports of POSIX >> termios.h[1]. >> >> It just works (mostly, kinda!) and you have to treat it nice and test >> it to death for _YOUR_ platform in _YOUR_ application but, y'know, >> that's what professional software engineers just do anyway. I >> seriously don't believe anyone will come up with anything better >> anytime soon. >> >> Regards, >> Michael Erskine. >> >> [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 >> Edition >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 19:32:12 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 18:32:12 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <13486-1298944789-675699@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> <13486-1298944789-675699@sneakemail.com> Message-ID: <4D6C5AAC.3070508@sandglass-software.com> Just to make sure I'm understanding you correctly, anyone porting RxTx to a new platform would have to do the following: 1. Write their own Java implementation of an abstract Dispatcher class. 2. Write a native (JNI or JNA) interface for the abstract class implementation. 3. Write all of the native (or non-native) code to implement the native interface. Is that correct? If yes, how is that easier than the simple implementation the current rewrite design uses? On a side note: there is no requirement to write native code using C++. If C++ is a real obstacle to adoption, then regular C could be used instead. In that case, there would be a Dispatcher.c file that contains function protoypes that need to be implemented. Dispatcher.c would still maintain the same role as Dispatcher.cpp - which is to shield native code developers from the details of JNI. Just build out the missing functions using C data types and you're ready to go. -Adrian On 2/28/2011 5:59 PM, iqzw2r602 at sneakemail.com wrote: > On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > What you're suggesting would require a great deal more effort than > necessary. > > > No, I don't think so; it'd be a quite simple refactoring task: > * Copy Dispatcher.java into NativeDispatcher.java and change > constructor name. Make it derive from Dispatcher > * Make all methods in the original Dispatcher.java abstract except for > getInstance(). That method does System.getProperty("os.name > ") to decide which implementation to instantiate. On > Windows (and other platforms that implement the C++ interface), it > instantiates NativeDispatcher. On yet others, it would instantiate the > MyOSNameHereDispatcher > * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename > corresponding C++ class > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From storrellas at bdigital.org Wed Feb 23 10:37:48 2011 From: storrellas at bdigital.org (Sergi Torrellas) Date: Wed, 23 Feb 2011 18:37:48 +0100 Subject: [Rxtx] Serial port description Message-ID: Hi all, I am using the library RXTX for connecting to a USB port that is mapped to a serial port. My question is the following is possible to get a longer description of the serial part a part from the COMX? Many thanks, -- *SERGI TORRELLAS SOCASTRO Desenvolupador R+D Salut M. 616.21.72.97** *storrellas at bdigital.org *BARCELONA DIGITAL CENTRE TECNOL?GIC* Roc Boronat 117, 5a planta, 08018 Barcelona Tel. +34 93 553 45 40 - Fax. +34 93 553 45 41 www.bdigital.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Wed Feb 23 21:46:30 2011 From: showard314 at gmail.com (Scott Howard) Date: Wed, 23 Feb 2011 23:46:30 -0500 Subject: [Rxtx] compiling rxtx on archs without sys/io.h Message-ID: Hello all, There is a bug at: http://bugzilla.qbang.org/show_bug.cgi?id=72 for fixing a build failure on PPCs. A similar build failure occurs on mips, ARM, sparc, and a few other architectures. You can work around it be using AC_CHECK_HEADERS and properly shielding #include . I uploaded a new patch to that bug which does that, and have compiled rxtx on those architectures. This will also work for future architectures and won't require manually updating the #ifdefs. If you do use this patch, you should also edit the individual Makefiles (like Makefile.mingw32) to properly #define or #undef HAVE_SYS_IO_H Regards, Scott From ajmas at sympatico.ca Fri Feb 25 09:03:34 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:03:34 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D613A6C.80304@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. On 20-Feb-2011, at 10:59, Adrian Crum wrote: > The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: >> Are there any show stoppers to using the rewrite instead of the current source branch? >> >> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >> >>> There is no timeline to merge the two versions. >>> >>> -Adrian >>> >>> Quoting Andre-John Mas: >>> >>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>> >>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>> >>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>> Hi, >>>>>> >>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>> - src/ >>>>>> - Rewrite2010/src/ >>>>>> >>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>> >>>>>> Andre >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 25 09:17:23 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:17:23 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > >> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >> >> -Adrian >> >> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>> Are there any show stoppers to using the rewrite instead of the current source branch? >>> >>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>> >>>> There is no timeline to merge the two versions. >>>> >>>> -Adrian >>>> >>>> Quoting Andre-John Mas: >>>> >>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>> >>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>> >>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>> - src/ >>>>>>> - Rewrite2010/src/ >>>>>>> >>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>> >>>>>>> Andre >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 26 18:58:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 26 Feb 2011 17:58:27 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: <4D69AFC3.50008@sandglass-software.com> Thank you for doing that. There hasn't been much community interest in the rewrite, and I've been busy since I started it. I hope to work on it some more in the next month or two. -Adrian On 2/25/2011 8:17 AM, Andre-John Mas wrote: > I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > >> What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. >> >> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >> >>> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>> >>> -Adrian >>> >>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> Are there any show stoppers to using the rewrite instead of the current source branch? >>>> >>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>> >>>>> There is no timeline to merge the two versions. >>>>> >>>>> -Adrian >>>>> >>>>> Quoting Andre-John Mas: >>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>>> >>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>> - src/ >>>>>>>> - Rewrite2010/src/ >>>>>>>> >>>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>>> >>>>>>>> Andre >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From iqzw2r602 at sneakemail.com Sun Feb 27 15:47:16 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 09:47:16 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D69AFC3.50008@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> Message-ID: <23853-1298846836-791608@sneakemail.com> Hi Adrian, I've followed the discussion about the rewrite over the past months, and I'm sorry to hear interest in it hasn't picked up. I've had a look at the source code yesterday, and it seems very well designed and nicely documented. IMHO one reason why it hasn't been fully embraced yet is because it currently only runs on Windows. I know from first hand experience (jpathwatch) that it's quite hard to write robust cross-platform Java libraries containing native code, and that people might be hesitant to pick up development on something like that. I was contemplating of toying around with the code base a couple of times, but I'd rather write as much platform dependent code as I can in Java (this might be a matter of preference, however, I have found that it made my life a hell of a lot easier). So to give people choice in how they implement their port, I suggest that: * the Dispatcher Java class becomes abstract, without native methods. * All Java and native code in the Dispatcher class moves to a new NativeDispatcher java/C++ class, which derives from Dispatcher. * The Dispatcher.getInstance() method chooses, per platform, which Dispatcher instance it's going to create. So on Windows and other platforms that like their dispatcher to be native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). On other platforms (say, on BSD based platforms), a different Dispatcher implementation is instantiated, which can be implemented almost entirely in Java. This way, every OS can implement it's own dispatcher. This gives the implementor the option to choose whether to write their implementation as a fat native library (like the one you have implemented for Windows), or in Java with a slim native library (which only wraps OS function calls). In turn, it might make it more attractive for developers to jump in and contribute implementations for other platforms. What do you think? Cheers, Uwe On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > Thank you for doing that. There hasn't been much community interest in the > rewrite, and I've been busy since I started it. I hope to work on it some > more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > >> I have added a stub page here: >> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >> >> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >> >> What could be useful is an entry in the wiki documenting the mile-stones >>> and what is left to be done. >>> >>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>> >>> The rewrite isn't finished - it still needs Java unit tests and native >>>> code for Apple and *nix. You can find more information on the mailing list: >>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>> >>>> -Adrian >>>> >>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> >>>>> Are there any show stoppers to using the rewrite instead of the current >>>>> source branch? >>>>> >>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>> >>>>> There is no timeline to merge the two versions. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> Quoting Andre-John Mas: >>>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>> for? >>>>>>> >>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>> library is in Rewrite2010/src. >>>>>>>> >>>>>>>> -Adrian >>>>>>>> >>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>> - src/ >>>>>>>>> - Rewrite2010/src/ >>>>>>>>> >>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>> we shouldn't be using around? >>>>>>>>> >>>>>>>>> Andre >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Sun Feb 27 16:26:56 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 27 Feb 2011 15:26:56 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <4D6ADDC0.1020608@sandglass-software.com> As far as I know, any Java library that manipulates hardware devices is going to need native code. If the JRE contains classes that already do that, then I'm unaware of them. In other words, I don't know how one would accomplish "making OS calls" without native code. I agree that developing a Java library that reads/writes serial and parallel hardware is not an easy task - therefore there will be few willing to engage in it. I don't agree that Java code should contain as much platform-specific code as possible. That might make things easier for you, but it defeats the "write once, run anywhere" design of Java. I'm not sure what you mean by "fat native code" versus "slim native code." The native code in the rewrite is the minimum necessary to control the hardware - in fact, that is one of the rewrite's design goals. The rewrite's design reduces native code development down to implementing two virtual classes and two functions. I thought I set the bar pretty low, but I might be wrong. -Adrian On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, > and I'm sorry to hear interest in it hasn't picked up. I've had a look > at the source code yesterday, and it seems very well designed and > nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick up development on something like that. > > I was contemplating of toying around with the code base a couple of > times, but I'd rather write as much platform dependent code as I can > in Java (this might be a matter of preference, however, I have found > that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be implemented > almost entirely in Java. This way, every OS can implement it's own > dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have > implemented for Windows), or in Java with a slim native library (which > only wraps OS function calls). > In turn, it might make it more attractive for developers to jump in > and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > Thank you for doing that. There hasn't been much community > interest in the rewrite, and I've been busy since I started it. I > hope to work on it some more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: > http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > What could be useful is an entry in the wiki documenting > the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > The rewrite isn't finished - it still needs Java unit > tests and native code for Apple and *nix. You can find > more information on the mailing list: > http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, > adrian.crum at sandglass-software.com > wrote: > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas >: > > What is the timeline to merge the two? > Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > The latest working source is in src, > and a recent rewrite of the library is > in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas > wrote: > > Hi, > > I am seeing two Java source folder > in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and > is there any need to keep the one > we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:28:56 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:28:56 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() Message-ID: Hi, I have a receive thread that does nothing but call read() on the serial port input stream. It works fine for a while but after running for a long time it eventually returns -1 which means EOF. This is my first problem, as the device I'm talking to runs forever, I don't know why it would return -1. I am calling disableReceiveThreshold() and disableReceiveTimeout() at initialization which according to the documentation means read will return as soon as any data is available and it will block forever when data is not available, so -1 should never be returned from read, right? I have been unable to figure out why read returns -1 after a long while but I have found that if I kill my application and restart it everything works fine again. Therefore I tried to work around the problem by having my code close the port and reopen it when read returns -1. My second problem is that in this case when I call close() on the port it blocks forever. I did find this old bug http://bugzilla.qbang.org/show_bug.cgi?id=53 which describes close() hanging on OSX, but it says that bug was fixed with a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any idea why read might be returning -1 in the first place? If I can avoid that I don't care about close() hanging because I would never close the port. If not, does anyone know why close() might block forever and how I can prevent this? I'm using RXTX version 2.1-7. Thanks, -- Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:34:04 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:34:04 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() In-Reply-To: References: Message-ID: I mis-spoke, I don't have my own thread calling read, I am calling read in the event handler after receiving a SerialPortEvent.DATA_AVAILABLE event. Everything else I said should be accurate though. Ryan On Mon, Feb 28, 2011 at 12:28 AM, Ryan Boder wrote: > Hi, > > I have a receive thread that does nothing but call read() on the serial > port input stream. It works fine for a while but after running for a long > time it eventually returns -1 which means EOF. This is my first problem, as > the device I'm talking to runs forever, I don't know why it would return -1. > I am calling disableReceiveThreshold() and disableReceiveTimeout() at > initialization which according to the documentation means read will return > as soon as any data is available and it will block forever when data is not > available, so -1 should never be returned from read, right? > > I have been unable to figure out why read returns -1 after a long while but > I have found that if I kill my application and restart it everything works > fine again. Therefore I tried to work around the problem by having my code > close the port and reopen it when read returns -1. My second problem is that > in this case when I call close() on the port it blocks forever. I did find > this old bug > > http://bugzilla.qbang.org/show_bug.cgi?id=53 > > which describes close() hanging on OSX, but it says that bug was fixed with > a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any > idea why read might be returning -1 in the first place? If I can avoid that > I don't care about close() hanging because I would never close the port. If > not, does anyone know why close() might block forever and how I can prevent > this? I'm using RXTX version 2.1-7. > > Thanks, > -- > Ryan > > -- Ryan Boder 1 614 598-6339 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.w.janssen at lxtreme.nl Mon Feb 28 04:09:50 2011 From: j.w.janssen at lxtreme.nl (Jan Willem Janssen) Date: Mon, 28 Feb 2011 12:09:50 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <123a513d85e4569df1ebce58088e6592.squirrel@lxtreme.homelinux.org> FWIW: I'm also interested in the 2010-rewrite, but was waiting until a bit more code was available for other platforms, like Linux and/or OSX. I'd like to offer my help if needed, for example to test stuff. Regards, Jan Willem On Sun, February 27, 2011 23:47, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm > sorry to hear interest in it hasn't picked up. I've had a look at the > source > code yesterday, and it seems very well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java > (this > might be a matter of preference, however, I have found that it made my > life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a > NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely > in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. From iqzw2r602 at sneakemail.com Mon Feb 28 04:52:33 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 22:52:33 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6ADDC0.1020608@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> Message-ID: <15854-1298893954-139343@sneakemail.com> Hi Adrian, On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > As far as I know, any Java library that manipulates hardware devices is > going to need native code. If the JRE contains classes that already do that, > then I'm unaware of them. In other words, I don't know how one would > accomplish "making OS calls" without native code. > Yes, you're right, you need native code to do that. The only question is how much. I'm not saying that you wouldn't write native code. I'm just saying you'll need very little. Take CreateFile() on Windows. Your implementation calls it from C++ code, which implements logic all around it. However, you can also call CreateFile() from Java code, and this is what I'm proposing: Expose the CreateFile() function to Java as a static native Java method, so it becomes directly callable from Java code (only visible to implementation, not publicly). So while the code all around the CreateFile() call is all Java (granted, it's platform specific, it has to be), the 'public static native CreateFile()' method is implemented in C++ - and all it does is to call the native CreateFile() function. > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few willing > to engage in it. I don't agree that Java code should contain as much > platform-specific code as possible. That might make things easier for you, > but it defeats the "write once, run anywhere" design of Java. > "write once, run anywhere" (WORA) does apply for client code calling RXTX. However, it doesn't mean that you can't or shouldn't write platform specific code to /implement/ a library that's doing OS specific things; in fact you have to: CreateFile() only exists on Windows, open() only on Unix, etc., so you have to write code specific to each platform that calls these functions and handles their semantics. And in case you haven't noticed yet, the JDK does the same thing, it has platform specific Java classes for lots of things (try debugging the methods of java.io.File, or the parts of the AWT, and see where they call into). The point of WORA is that client code - code that calls into RXTX - should not have to deal with specifics of a platform. > I'm not sure what you mean by "fat native code" versus "slim native code." > Fat native libraries have methods like this, all written in C++: Lots of pointers here, lots of things that could go wrong (but I'm not saying it does, just showing the potential, think threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: CommPort* CommPortFactory::getInstance(const char *portName, int portType) { #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS if (strcmp("PARALLEL_PASS", portName) == 0) return new ParallelLoopback(portName); if (strcmp("SERIAL_PASS", portName) == 0) return new SerialLoopback(portName); #endif // Do not open overlapped. Let the Java application // handle multi-threaded I/O. HANDLE hComm = CreateFile( portName, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); if (hComm == INVALID_HANDLE_VALUE) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); printf("%s\n", lpMsgBuf); delete lpMsgBuf; throw IOException(); } .... // SNIP! Fact is, you can write all of this in Java. You can even take the same code, reword it a bit, and feed it into javac. So I won't quote this here again and Java-ise it, just assume the above is Java code (BTW: you can even do #ifdefs with statics). This Java code will have this import statement at the top: import static Windows.*; In Windows.java would look like this (in fact it does, I've done this in jpathwatch): static native long CreateFile(String fileName, int desiredAccess, int shareMode, SECURITY_ATTRIBUTES securityAttributes, int creationDisposition, int flagsAndAttributes, long templateFileHandle); And the code in Windows.cpp? That calls the native CreateFile() function. And that's all (There's some special handling so GetLastError() works in different threads and won't interfere with the JVM, but that's another topic) The native code in the rewrite is the minimum necessary to control the > hardware - in fact, that is one of the rewrite's design goals. The rewrite's > design reduces native code development down to implementing two virtual > classes and two functions. I thought I set the bar pretty low, but I might > be wrong. > See above; it can be even less. And since I keep saying I've done it, have a look at these files: Windows.cpp[1], Windows.java[2], WindowsPathWatchService.java [3] Don't understand this as a criticism of your design, I actually quite like it. All I am saying is that it doesn't need to be all native, and that if you make the Dispatcher an abstract class like I proposed in my previous email, implementors can choose which language they use (and yes, I'd choose Java over C++; and I've written C++ code for more than 15 years) Cheers, Uwe [1] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup [2] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup [3] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > -Adrian > > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm sorry to hear interest in it hasn't picked up. I've had a look at the > source code yesterday, and it seems very well designed and nicely > documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java (this > might be a matter of preference, however, I have found that it made my life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example > Allow| wrote: > >> Thank you for doing that. There hasn't been much community interest in the >> rewrite, and I've been busy since I started it. I hope to work on it some >> more in the next month or two. >> >> -Adrian >> >> >> On 2/25/2011 8:17 AM, Andre-John Mas wrote: >> >>> I have added a stub page here: >>> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >>> >>> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >>> >>> What could be useful is an entry in the wiki documenting the mile-stones >>>> and what is left to be done. >>>> >>>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>>> >>>> The rewrite isn't finished - it still needs Java unit tests and native >>>>> code for Apple and *nix. You can find more information on the mailing list: >>>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>>> >>>>>> Are there any show stoppers to using the rewrite instead of the >>>>>> current source branch? >>>>>> >>>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>>> >>>>>> There is no timeline to merge the two versions. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> Quoting Andre-John Mas: >>>>>>> >>>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>>> for? >>>>>>>> >>>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>>> >>>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>>> library is in Rewrite2010/src. >>>>>>>>> >>>>>>>>> -Adrian >>>>>>>>> >>>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>>> - src/ >>>>>>>>>> - Rewrite2010/src/ >>>>>>>>>> >>>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>>> we shouldn't be using around? >>>>>>>>>> >>>>>>>>>> Andre >>>>>>>>>> _______________________________________________ >>>>>>>>>> Rxtx mailing list >>>>>>>>>> Rxtx at qbang.org >>>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 28 05:36:14 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 28 Feb 2011 14:36:14 +0200 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> Message-ID: Sorry for top posting but I felt it was justified here to keep the whole context of the referred text intact. I very much agree with Uwe's point of view, ie doing as much as possible in Java, even the platform specific things, and doing the absolute minimum in C/C++. And this is not criticism Adrian's work/design. I would (again) advocate using JNA instead of JNI to access the native OS services/API from Java. This simplifies the live of the library users and developers a great deal because no C/C++ tool chain is involved. Zero. You don't even need a C compiler. There are some 'issues' in accessing some OS API functions from Java (like the need to use OS specific values in the Java code that are only available with #define in header files) but given the stability and longtime standing of the API functions we are talking about (open/close/select/read/write) I do not see this as big issue. A lot of the argumentation is included in this thread when this was last time rehashed on this list. http://answerpot.com/showthread.php?1022262-JNA%20alternative%20(was:%20rxt x%20moving%20from%20JNI%20to%20JNA%20(was%20%20About%20JRE%20crashes))/Page 1 If anyone is interested I can make the straw man implementation available. It compiles and has a fighting chance to work in a POSIX compatible OS (Mac OS X / Linux) with moderate debugging. Of course it is a long way from production, especially as throwing away the current rxtx also throws away most of the testing and debugging to the obscure/uncommon OSes that rxtx currently supports (I suggest anyone attempting to replace the current implementation has peek at the innards of the current implementation to see the variety it claims to support). (As an aside, and not really relevant to calling OS API from Java with JNA, I feel I need to mention that calling C++ using JNA is not easy because of the name mangling, so libraries with C interface are preferred with JNA). br Kusti On 2/28/11 13:52, "iqzw2r602 at sneakemail.com" wrote: >Hi Adrian, > >On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum >adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| >wrote: > > > > > > > > As far as I know, any Java library that manipulates hardware devices > is going to need native code. If the JRE contains classes that > already do that, then I'm unaware of them. In other words, I don't > know how one would accomplish "making OS calls" without native code. > > > > >Yes, you're right, you need native code to do that. The only question is >how much. I'm not saying that you wouldn't write native code. I'm just >saying you'll need very little. Take CreateFile() on Windows. Your >implementation calls it from C++ code, which implements logic all around >it. > >However, you can also call CreateFile() from Java code, and this is what >I'm proposing: Expose the CreateFile() function to Java as a static >native Java method, so it becomes directly callable from Java code (only >visible to implementation, not publicly). So while the code all around >the CreateFile() call is all Java (granted, it's platform specific, it >has to be), the 'public static native CreateFile()' method is implemented >in C++ - and all it does is to call the native CreateFile() function. > > > > > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few > willing to engage in it. I don't agree that Java code should contain > as much platform-specific code as possible. That might make things > easier for you, but it defeats the "write once, run anywhere" design > of Java. > > > > >"write once, run anywhere" (WORA) does apply for client code calling >RXTX. > >However, it doesn't mean that you can't or shouldn't write platform >specific code to /implement/ a library that's doing OS specific things; >in fact you have to: >CreateFile() only exists on Windows, open() only on Unix, etc., so you >have to write code specific to each platform that calls these functions >and handles their semantics. And in case you haven't noticed yet, the JDK >does the same thing, it has platform specific Java classes for lots of >things (try debugging the methods of java.io.File, or the parts of the >AWT, and see where they call into). > >The point of WORA is that client code - code that calls into RXTX - >should not have to deal with specifics of a platform. > > > > > I'm not sure what you mean by "fat native code" versus "slim native > code." > > > >Fat native libraries have methods like this, all written in C++: Lots of >pointers here, lots of things that could go wrong (but I'm not saying it >does, just showing the potential, think >threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: > >CommPort* CommPortFactory::getInstance(const char *portName, int portType) >{ >#ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); >#endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } >... >// SNIP! > >Fact is, you can write all of this in Java. You can even take the same >code, reword it a bit, and feed it into javac. So I won't quote this here >again and Java-ise it, just assume the above is Java code (BTW: you can >even do #ifdefs with statics). This Java code will have this import >statement at the top: > >import static Windows.*; > >In Windows.java would look like this (in fact it does, I've done this in >jpathwatch): > >static native long CreateFile(String fileName, int desiredAccess, int >shareMode, SECURITY_ATTRIBUTES securityAttributes, int >creationDisposition, int flagsAndAttributes, long templateFileHandle); > >And the code in Windows.cpp? That calls the native CreateFile() function. >And that's all (There's some special handling so GetLastError() works in >different threads and won't interfere with the JVM, but that's another >topic) > > > >The native code in the rewrite is the minimum necessary to > control the hardware - in fact, that is one of the rewrite's design > goals. The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I set > the bar pretty low, but I might be wrong. > > > > >See above; it can be even less. > >And since I keep saying I've done it, have a look at these files: >Windows.cpp >jpathwatch-native/src/Windows.cpp?revision=130&view=markup>[1], >Windows.java >jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&v >iew=markup>[2], WindowsPathWatchService.java >jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.jav >a?revision=130&view=markup>[3] > >Don't understand this as a criticism of your design, I actually quite >like it. All I am saying is that it doesn't need to be all native, and >that if you make the Dispatcher an abstract class like I proposed in my >previous email, implementors can choose which language they use (and yes, >I'd choose Java over C++; and I've written C++ code for more than 15 >years) > >Cheers, > >Uwe > >[1] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-native/src/Windows.cpp?revision=130&view=markup >[2] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&vi >ew=markup >[3] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java >?revision=130&view=markup > > > > > -Adrian > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > >Hi Adrian, > > I've followed the discussion about the rewrite over the past > months, and I'm sorry to hear interest in it hasn't picked up. > I've had a look at the source code yesterday, and it seems very > well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because > it currently only runs on Windows. I know from first hand > experience (jpathwatch) that it's quite hard to write robust > cross-platform Java libraries containing native code, and that > people might be hesitant to pick up development on something like > that. > > I was contemplating of toying around with the code base a couple > of times, but I'd rather write as much platform dependent code as > I can in Java (this might be a matter of preference, however, I > have found that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I > suggest that: > > * the Dispatcher Java class becomes abstract, without native > methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by > Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be > implemented almost entirely in Java. This way, every OS can > implement it's own dispatcher. > > This gives the implementor the option to choose whether to write > their implementation as a fat native library (like the one you > have implemented for Windows), or in Java with a slim native > library (which only wraps OS function calls). > In turn, it might make it more attractive for developers to jump > in and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian > Crum adrian.crum-at-sandglass-software.com > > |rxtx.org > mailing list/Example Allow| > wrote: > >Thank you for doing that. There hasn't > been much community interest in the rewrite, and I've been > busy since I started it. I hope to work on it some more in the > next month or two. > > > -Adrian > > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: >http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > > What could be useful is an entry in the wiki > documenting the mile-stones and what is left to be > done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > > The rewrite isn't finished - it still needs Java > unit tests and native code for Apple and *nix. You > can find more information on the mailing list: >http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, >adrian.crum at sandglass-software.com > wrote: > > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas: > > > What is the timeline to merge the two? Also, > what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > > The latest working source is in src, and a > recent rewrite of the library is in > Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: > > Hi, > > I am seeing two Java source folder in the > CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there > any need to keep the one we shouldn't be > using around? > > Andre >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > >http://mailman.qbang.org/mailman/listinfo/rxtx > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From adrian.crum at sandglass-software.com Mon Feb 28 08:15:18 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 07:15:18 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> Message-ID: <4D6BBC06.4090402@sandglass-software.com> Thank you for the suggestions - I will keep them in mind the next time I work on it. -Adrian On 2/28/2011 3:52 AM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > As far as I know, any Java library that manipulates hardware > devices is going to need native code. If the JRE contains classes > that already do that, then I'm unaware of them. In other words, I > don't know how one would accomplish "making OS calls" without > native code. > > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as a > static native Java method, so it becomes directly callable from Java > code (only visible to implementation, not publicly). So while the code > all around the CreateFile() call is all Java (granted, it's platform > specific, it has to be), the 'public static native CreateFile()' > method is implemented in C++ - and all it does is to call the native > CreateFile() function. > > > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there will > be few willing to engage in it. I don't agree that Java code > should contain as much platform-specific code as possible. That > might make things easier for you, but it defeats the "write once, > run anywhere" design of Java. > > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. > > > I'm not sure what you mean by "fat native code" versus "slim > native code." > > > Fat native libraries have methods like this, all written in C++: Lots > of pointers here, lots of things that could go wrong (but I'm not > saying it does, just showing the potential, think threading) - and I'm > a cheeky bastard here and quote from W32_Support.cpp: > > CommPort* CommPortFactory::getInstance(const char *portName, int portType) > { > #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); > #endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } > ... > // SNIP! > > Fact is, you can write all of this in Java. You can even take the same > code, reword it a bit, and feed it into javac. So I won't quote this > here again and Java-ise it, just assume the above is Java code (BTW: > you can even do #ifdefs with statics). This Java code will have this > import statement at the top: > > import static Windows.*; > > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > > static native long CreateFile(String fileName, int desiredAccess, int > shareMode, SECURITY_ATTRIBUTES securityAttributes, int > creationDisposition, int flagsAndAttributes, long templateFileHandle); > > And the code in Windows.cpp? That calls the native CreateFile() > function. And that's all (There's some special handling so > GetLastError() works in different threads and won't interfere with the > JVM, but that's another topic) > > The native code in the rewrite is the minimum necessary to control > the hardware - in fact, that is one of the rewrite's design goals. > The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I > set the bar pretty low, but I might be wrong. > > > See above; it can be even less. > > And since I keep saying I've done it, have a look at these files: > Windows.cpp > [1], > Windows.java > [2], > WindowsPathWatchService.java > [3] > > Don't understand this as a criticism of your design, I actually quite > like it. All I am saying is that it doesn't need to be all native, and > that if you make the Dispatcher an abstract class like I proposed in > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) > > Cheers, > > Uwe > > [1] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup > > [2] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup > > [3] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Feb 28 09:51:19 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 17:51:19 +0100 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <20110228165119.GD10695@elberon.bln.de.ingenico.com> * Andre-John Mas wrote on Fri, Feb 18, 2011 at 21:43 -0500: > Is anyone using JDK 1.4 or less? Yes, 1.4.2_11-b06 (j2sdk-1_4_2_11-fcs-linux-i586) in some cases (also similar versions: 1.4.2_15-b02, 1.4.2_16-b05, maybe others). > I am asking because I would be interested in bringing the code > up to Java 1.5 standards, with the use of generics and other > recent developments. Why that? oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Mon Feb 28 10:20:53 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 18:20:53 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6BBC06.4090402@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> Message-ID: <20110228172052.GE10695@elberon.bln.de.ingenico.com> * Adrian Crum wrote on Mon, Feb 28, 2011 at 07:15 -0800: [...] > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. I think in general it can be good to have an system-abstracting interface of the native code. That means, the native code implementation abstracts from the system (instead of implementing that abstractions in Java). Of course it is more complex :) IIRC we already had such a discussion here. > Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as > a static native Java method, so it becomes directly callable > from Java code (only visible to implementation, not publicly). > So while the code all around the CreateFile() call is all Java > (granted, it's platform specific, it has to be), the 'public > static native CreateFile()' method is implemented in C++ - and > all it does is to call the native CreateFile() function. I don't think I'd like this. CreateFile() is very system-specific. Exposing this to Java code makes this Java code system-specific. Although you could "run" it everywhere, it won't work anyware except on appropriate windows boxes. But this goes even further, you might consider calling open and select from Java and use it for serial ports on linux, but on another system that have both functions, they simply won't work (like on windows; there should be open and select, but AFAIK the latter cannot be expected to work on serial interfaces). Of course there is an somewhat strong argument, that is if the developer is much more experienced with Java than with C, it might be easier to implement this in Java, but personally I think it is hard to believe that developers who are able to correctly abstract device-I/O from system calls are not good at C, because I'm sure C is the language system by system programmers. > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there > will be few willing to engage in it. I don't agree that Java > code should contain as much platform-specific code as possible. > That might make things easier for you, but it defeats the > "write once, run anywhere" design of Java. Java runs on compliant JVMs only and nowhere else. It just happens that JVMs exist for most systems of a special set of computers such as PCs and small servers (but not neccesarily for embedded devices or main frames). As soon as a single native function is needed (required) for the application to work properly, the `run anywhere' is already impossible, because now it does not run on any JVM but only on JVMs that supply an implementation for this native code function. > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. Yes, exactly. Also, it is possible to write system-specific applications `with 100% Java' (for example, hardcode "C:\\Program Files" to be windows-specific or use "/dev/null" or so). Expecting a certain behavior not specified by Java (e.g. whether you can read "/dev/null", what CreateFile returns or whether select works on non-socket-filehandles) IMHO already misses the "write once, run anywhere" idea. So in summary I don't think the amount of platform-specific code matters much. It must be avaiable, requiring deployment etc, so little difference how many lines of code that were. [...] > import static Windows.*; > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > static native long CreateFile(String fileName, int desiredAccess, int [...] Someone here also proposed to use a general method to invoke arbitrary functions of shared libraries, JNA. By this, you wouldn't need `static NATIVE long CreateFile'; you could replace JNI by JNA here. Assuming that this native functionality would already be deployed on many target platform systems, implementing all the platform-specific code in Java can make sense, because this specific implementations would not require additional native code deployment. If, for example, the Java installation of Debian would by default already offer native library call execution, platform-specific code implemented in Java would work on Debian without needing any additional binary lib to be installed, I think could be quite an advantage. I think if having some Windows.java layer (which I personally would not like), JNA IMHO seems to be suited well. Personally, I prefere to define nice, simple and comfortable interfaces, also for native code (if possible, for JNI I think it always is a compromise). > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) Do you mean in general or also specifically for system programming? If someone would need a small program to let's say query DCD on linux I think a small C application would be suited best. Of course this topic also is more complex and depends on things. oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From msemtd at googlemail.com Mon Feb 28 13:50:42 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 28 Feb 2011 20:50:42 +0000 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172052.GE10695@elberon.bln.de.ingenico.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: This was discussed to death last year - summary: - * JNI is too hard * JNA is compelling * yay! let's start a rewrite Time passes... Current status: Windows-only and incomplete Back in non-vaporware land (this is meant in good humour BTW), the current RXTX platform-specifics are achieved with ports of POSIX termios.h[1]. It just works (mostly, kinda!) and you have to treat it nice and test it to death for _YOUR_ platform in _YOUR_ application but, y'know, that's what professional software engineers just do anyway. I seriously don't believe anyone will come up with anything better anytime soon. Regards, Michael Erskine. [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition From iqzw2r602 at sneakemail.com Mon Feb 28 15:01:20 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 09:01:20 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <6175-1298930480-518642@sneakemail.com> Good summary. This whole JNI/JNA/C++ thing only came up again because I tried to explain my motivations for my initial request. And I agree, let's not discuss this further, we've been there already. So let's get this discussion back on track: All I suggested is to separate the implementation of the Dispatcher Java class into a NativeDispatcher class and a Dispatcher interface, so people can implement the Dispatcher (Java-) interface with whatever Three-Letter-Abbreviation they want. So can people please comment on that? Cheers, Uwe On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 > Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 15:22:21 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 14:22:21 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <4D6C201D.6060103@sandglass-software.com> One of the issues I tried to address in the rewite is the "JNI is too hard" issue. Anyone with rudimentary C++ skills can implement the two virtual classes and two functions - no knowledge of JNI is necessary because Dispatcher.cpp takes care of all of the JNI data type marshalling/unmarshalling. I don't agree that the 2.x versions "just work" - the recurring bugs mentioned on this list and in other forums are evidence of that. I tried to work with the 2.x version by wrapping it in thread-safe classes, but even that didn't help. I tried to fix the most recent version by supplying patches, but the sum of the patches added up to a rewrite. So I created a rewrite instead. -Adrian On 2/28/2011 12:50 PM, Michael Erskine wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Mon Feb 28 16:24:00 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 15:24:00 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <6175-1298930480-518642@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> Message-ID: <4D6C2E90.9010601@sandglass-software.com> My question would be: Why would you do that? The rewrite does most of the work for you - all you have to do is implement two C++ virtual classes and two C++ functions. In Windows that took me a few hours. I can't imagine other ports taking much longer than that - especially since POSIX-based code can be shared between ports. What you're suggesting would require a great deal more effort than necessary. -Adrian On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to > explain my motivations for my initial request. And I agree, let's not > discuss this further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher > Java class into a NativeDispatcher class and a Dispatcher interface, > so people can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine > msemtd-at-googlemail.com |rxtx.org > mailing list/Example Allow| > <6zkk4zdpgt at sneakemail.com > wrote: > > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Mon Feb 28 17:26:18 2011 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Mon, 28 Feb 2011 17:26:18 -0700 Subject: [Rxtx] =?utf-8?q?Which_Java_folder_in_source=3F?= Message-ID: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 17:40:03 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 16:40:03 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> References: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> Message-ID: <4D6C4063.5060708@sandglass-software.com> Speaking of bugs one knows - was anyone interested in the bug fixing effort you proposed? -Adrian On 2/28/2011 4:26 PM, jfh at greenhousepc.com wrote: > Adrian, > > I have many dozens of clients using the RXTX jar on a wide variety of > Windows, Linux and a few MacOS X releases. Provided one does what the > previous poster suggested, the code really does "just work". > > Most of the problems that get reported are things that Windows > applications, and not a few Linux ones as well, have problems with > already. > > The other issue is that even with a boat load of testing, I have no > expectation to migrate to the re-write until 3Q12 at the absolute > earliest. > > I appreciate the effort you are putting into this re-write, but after > 32 years in this field (that's more years than many on this list are > alive), I've seen a lot of "re-writes". I've even done a few myself, > some better than others. > > That 32 years of software engineering experience has taught me one > vital lesson -- the bugs one knows are far less dangerous than the > bugs one doesn't know. And all re-writes are a minefield of unknown > bugs. For my products, it takes about 9 =months= before a release is > stable enough that I'm truly pleased with it. I'm still struggling > with bugs from new features I added in my 3Q10 release. I don't need > to struggle with the new bugs that are going to come from the > re-write. Not personal, just my 32 years of experience. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com > // greenHousePC on Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Which Java folder in source? > From: Adrian Crum > ; > Date: Mon, February 28, 2011 4:22 pm > To: rxtx at qbang.org > > One of the issues I tried to address in the rewite is the "JNI is too > hard" issue. Anyone with rudimentary C++ skills can implement the two > virtual classes and two functions - no knowledge of JNI is necessary > because Dispatcher.cpp takes care of all of the JNI data type > marshalling/unmarshalling. > > I don't agree that the 2.x versions "just work" - the recurring bugs > mentioned on this list and in other forums are evidence of that. I > tried > to work with the 2.x version by wrapping it in thread-safe > classes, but > even that didn't help. I tried to fix the most recent version by > supplying patches, but the sum of the patches added up to a > rewrite. So > I created a rewrite instead. > > -Adrian > > On 2/28/2011 12:50 PM, Michael Erskine wrote: > > This was discussed to death last year - summary: - > > * JNI is too hard > > * JNA is compelling > > * yay! let's start a rewrite > > > > Time passes... > > > > Current status: Windows-only and incomplete > > > > Back in non-vaporware land (this is meant in good humour BTW), the > > current RXTX platform-specifics are achieved with ports of POSIX > > termios.h[1]. > > > > It just works (mostly, kinda!) and you have to treat it nice and test > > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > > that's what professional software engineers just do anyway. I > > seriously don't believe anyone will come up with anything better > > anytime soon. > > > > Regards, > > Michael Erskine. > > > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From iqzw2r602 at sneakemail.com Mon Feb 28 18:59:48 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 12:59:48 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6C2E90.9010601@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> Message-ID: <13486-1298944789-675699@sneakemail.com> On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > My question would be: Why would you do that? > I'm thinking about the debugging effort, quite frankly. When I started off with jpathwatch, I initially wrote a fat native library. It got me into trouble: It was hard to debug, the JVM would crash every now and then, depending which bug it hit, and debugging a process with a JVM (even on Windows) is not fun. When I finally got it to work on Windows, I started doing Linux, and the same thing happened again - and I didn't find the tools as nice. When it started sucking up too much of my time I scrapped the whole thing, literally, and moved to a slim native library. I wrote the new implementation in a fraction of the time, and it rarely ever crashed (because except for the little C++ code to wrap OS functions there was nothing that could). So that's my reason to write things in Java mainly for a project like this. Others prefer C++. What I'm suggesting gives people a choice to use the tool they're most comfortable with (because this is really about people, not code; the code won't write and fix itself, people have to go in and do it) > The rewrite does most of the work for you - all you have to do is implement > two C++ virtual classes and two C++ functions. In Windows that took me a few > hours. I can't imagine other ports taking much longer than that - especially > since POSIX-based code can be shared between ports. > And that's fine for people who want to write a native code implementation. I'm not talking about scrapping that at all, quite the contrary - Windows and the C++ framework should stay as it is, it's quite a large contribution you've made in time and effort, it'd be stupid to abandon that. Even more so, other platforms could build on the C++ code you've written, as you intended. All this would provide is another option, so people can also implement a platform in Java with any TLA they want (don't want to mention technologies here, that'll start another flame war ;) > What you're suggesting would require a great deal more effort than > necessary. > No, I don't think so; it'd be a quite simple refactoring task: * Copy Dispatcher.java into NativeDispatcher.java and change constructor name. Make it derive from Dispatcher * Make all methods in the original Dispatcher.java abstract except for getInstance(). That method does System.getProperty("os.name") to decide which implementation to instantiate. On Windows (and other platforms that implement the C++ interface), it instantiates NativeDispatcher. On yet others, it would instantiate the MyOSNameHereDispatcher * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename corresponding C++ class I'd think this is about 3 hours of work. I'm even happy to have a shot at it, but I have no commit rights to CVS, and I certainly don't intend to make changes that other people don't like. Remember, this discussion stemmed from people being worried that the rewrite is Windows-only right now. So the goal is to get more supported platforms, and to get there you'll need people to contribute code. I think providing more options will attract more contributors. It would certainly make it more attractive for me. Cheers, Uwe > -Adrian > > > > On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to explain > my motivations for my initial request. And I agree, let's not discuss this > further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher Java > class into a NativeDispatcher class and a Dispatcher interface, so people > can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | > rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > >> This was discussed to death last year - summary: - >> * JNI is too hard >> * JNA is compelling >> * yay! let's start a rewrite >> >> Time passes... >> >> Current status: Windows-only and incomplete >> >> Back in non-vaporware land (this is meant in good humour BTW), the >> current RXTX platform-specifics are achieved with ports of POSIX >> termios.h[1]. >> >> It just works (mostly, kinda!) and you have to treat it nice and test >> it to death for _YOUR_ platform in _YOUR_ application but, y'know, >> that's what professional software engineers just do anyway. I >> seriously don't believe anyone will come up with anything better >> anytime soon. >> >> Regards, >> Michael Erskine. >> >> [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 >> Edition >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 19:32:12 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 18:32:12 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <13486-1298944789-675699@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> <13486-1298944789-675699@sneakemail.com> Message-ID: <4D6C5AAC.3070508@sandglass-software.com> Just to make sure I'm understanding you correctly, anyone porting RxTx to a new platform would have to do the following: 1. Write their own Java implementation of an abstract Dispatcher class. 2. Write a native (JNI or JNA) interface for the abstract class implementation. 3. Write all of the native (or non-native) code to implement the native interface. Is that correct? If yes, how is that easier than the simple implementation the current rewrite design uses? On a side note: there is no requirement to write native code using C++. If C++ is a real obstacle to adoption, then regular C could be used instead. In that case, there would be a Dispatcher.c file that contains function protoypes that need to be implemented. Dispatcher.c would still maintain the same role as Dispatcher.cpp - which is to shield native code developers from the details of JNI. Just build out the missing functions using C data types and you're ready to go. -Adrian On 2/28/2011 5:59 PM, iqzw2r602 at sneakemail.com wrote: > On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > What you're suggesting would require a great deal more effort than > necessary. > > > No, I don't think so; it'd be a quite simple refactoring task: > * Copy Dispatcher.java into NativeDispatcher.java and change > constructor name. Make it derive from Dispatcher > * Make all methods in the original Dispatcher.java abstract except for > getInstance(). That method does System.getProperty("os.name > ") to decide which implementation to instantiate. On > Windows (and other platforms that implement the C++ interface), it > instantiates NativeDispatcher. On yet others, it would instantiate the > MyOSNameHereDispatcher > * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename > corresponding C++ class > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From storrellas at bdigital.org Wed Feb 23 10:37:48 2011 From: storrellas at bdigital.org (Sergi Torrellas) Date: Wed, 23 Feb 2011 18:37:48 +0100 Subject: [Rxtx] Serial port description Message-ID: Hi all, I am using the library RXTX for connecting to a USB port that is mapped to a serial port. My question is the following is possible to get a longer description of the serial part a part from the COMX? Many thanks, -- *SERGI TORRELLAS SOCASTRO Desenvolupador R+D Salut M. 616.21.72.97** *storrellas at bdigital.org *BARCELONA DIGITAL CENTRE TECNOL?GIC* Roc Boronat 117, 5a planta, 08018 Barcelona Tel. +34 93 553 45 40 - Fax. +34 93 553 45 41 www.bdigital.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Wed Feb 23 21:46:30 2011 From: showard314 at gmail.com (Scott Howard) Date: Wed, 23 Feb 2011 23:46:30 -0500 Subject: [Rxtx] compiling rxtx on archs without sys/io.h Message-ID: Hello all, There is a bug at: http://bugzilla.qbang.org/show_bug.cgi?id=72 for fixing a build failure on PPCs. A similar build failure occurs on mips, ARM, sparc, and a few other architectures. You can work around it be using AC_CHECK_HEADERS and properly shielding #include . I uploaded a new patch to that bug which does that, and have compiled rxtx on those architectures. This will also work for future architectures and won't require manually updating the #ifdefs. If you do use this patch, you should also edit the individual Makefiles (like Makefile.mingw32) to properly #define or #undef HAVE_SYS_IO_H Regards, Scott From ajmas at sympatico.ca Fri Feb 25 09:03:34 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:03:34 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D613A6C.80304@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. On 20-Feb-2011, at 10:59, Adrian Crum wrote: > The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: >> Are there any show stoppers to using the rewrite instead of the current source branch? >> >> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >> >>> There is no timeline to merge the two versions. >>> >>> -Adrian >>> >>> Quoting Andre-John Mas: >>> >>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>> >>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>> >>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>> Hi, >>>>>> >>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>> - src/ >>>>>> - Rewrite2010/src/ >>>>>> >>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>> >>>>>> Andre >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 25 09:17:23 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:17:23 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > >> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >> >> -Adrian >> >> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>> Are there any show stoppers to using the rewrite instead of the current source branch? >>> >>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>> >>>> There is no timeline to merge the two versions. >>>> >>>> -Adrian >>>> >>>> Quoting Andre-John Mas: >>>> >>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>> >>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>> >>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>> - src/ >>>>>>> - Rewrite2010/src/ >>>>>>> >>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>> >>>>>>> Andre >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 26 18:58:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 26 Feb 2011 17:58:27 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: <4D69AFC3.50008@sandglass-software.com> Thank you for doing that. There hasn't been much community interest in the rewrite, and I've been busy since I started it. I hope to work on it some more in the next month or two. -Adrian On 2/25/2011 8:17 AM, Andre-John Mas wrote: > I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > >> What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. >> >> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >> >>> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>> >>> -Adrian >>> >>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> Are there any show stoppers to using the rewrite instead of the current source branch? >>>> >>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>> >>>>> There is no timeline to merge the two versions. >>>>> >>>>> -Adrian >>>>> >>>>> Quoting Andre-John Mas: >>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>>> >>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>> - src/ >>>>>>>> - Rewrite2010/src/ >>>>>>>> >>>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>>> >>>>>>>> Andre >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From iqzw2r602 at sneakemail.com Sun Feb 27 15:47:16 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 09:47:16 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D69AFC3.50008@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> Message-ID: <23853-1298846836-791608@sneakemail.com> Hi Adrian, I've followed the discussion about the rewrite over the past months, and I'm sorry to hear interest in it hasn't picked up. I've had a look at the source code yesterday, and it seems very well designed and nicely documented. IMHO one reason why it hasn't been fully embraced yet is because it currently only runs on Windows. I know from first hand experience (jpathwatch) that it's quite hard to write robust cross-platform Java libraries containing native code, and that people might be hesitant to pick up development on something like that. I was contemplating of toying around with the code base a couple of times, but I'd rather write as much platform dependent code as I can in Java (this might be a matter of preference, however, I have found that it made my life a hell of a lot easier). So to give people choice in how they implement their port, I suggest that: * the Dispatcher Java class becomes abstract, without native methods. * All Java and native code in the Dispatcher class moves to a new NativeDispatcher java/C++ class, which derives from Dispatcher. * The Dispatcher.getInstance() method chooses, per platform, which Dispatcher instance it's going to create. So on Windows and other platforms that like their dispatcher to be native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). On other platforms (say, on BSD based platforms), a different Dispatcher implementation is instantiated, which can be implemented almost entirely in Java. This way, every OS can implement it's own dispatcher. This gives the implementor the option to choose whether to write their implementation as a fat native library (like the one you have implemented for Windows), or in Java with a slim native library (which only wraps OS function calls). In turn, it might make it more attractive for developers to jump in and contribute implementations for other platforms. What do you think? Cheers, Uwe On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > Thank you for doing that. There hasn't been much community interest in the > rewrite, and I've been busy since I started it. I hope to work on it some > more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > >> I have added a stub page here: >> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >> >> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >> >> What could be useful is an entry in the wiki documenting the mile-stones >>> and what is left to be done. >>> >>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>> >>> The rewrite isn't finished - it still needs Java unit tests and native >>>> code for Apple and *nix. You can find more information on the mailing list: >>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>> >>>> -Adrian >>>> >>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> >>>>> Are there any show stoppers to using the rewrite instead of the current >>>>> source branch? >>>>> >>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>> >>>>> There is no timeline to merge the two versions. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> Quoting Andre-John Mas: >>>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>> for? >>>>>>> >>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>> library is in Rewrite2010/src. >>>>>>>> >>>>>>>> -Adrian >>>>>>>> >>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>> - src/ >>>>>>>>> - Rewrite2010/src/ >>>>>>>>> >>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>> we shouldn't be using around? >>>>>>>>> >>>>>>>>> Andre >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Sun Feb 27 16:26:56 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 27 Feb 2011 15:26:56 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <4D6ADDC0.1020608@sandglass-software.com> As far as I know, any Java library that manipulates hardware devices is going to need native code. If the JRE contains classes that already do that, then I'm unaware of them. In other words, I don't know how one would accomplish "making OS calls" without native code. I agree that developing a Java library that reads/writes serial and parallel hardware is not an easy task - therefore there will be few willing to engage in it. I don't agree that Java code should contain as much platform-specific code as possible. That might make things easier for you, but it defeats the "write once, run anywhere" design of Java. I'm not sure what you mean by "fat native code" versus "slim native code." The native code in the rewrite is the minimum necessary to control the hardware - in fact, that is one of the rewrite's design goals. The rewrite's design reduces native code development down to implementing two virtual classes and two functions. I thought I set the bar pretty low, but I might be wrong. -Adrian On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, > and I'm sorry to hear interest in it hasn't picked up. I've had a look > at the source code yesterday, and it seems very well designed and > nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick up development on something like that. > > I was contemplating of toying around with the code base a couple of > times, but I'd rather write as much platform dependent code as I can > in Java (this might be a matter of preference, however, I have found > that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be implemented > almost entirely in Java. This way, every OS can implement it's own > dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have > implemented for Windows), or in Java with a slim native library (which > only wraps OS function calls). > In turn, it might make it more attractive for developers to jump in > and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > Thank you for doing that. There hasn't been much community > interest in the rewrite, and I've been busy since I started it. I > hope to work on it some more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: > http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > What could be useful is an entry in the wiki documenting > the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > The rewrite isn't finished - it still needs Java unit > tests and native code for Apple and *nix. You can find > more information on the mailing list: > http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, > adrian.crum at sandglass-software.com > wrote: > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas >: > > What is the timeline to merge the two? > Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > The latest working source is in src, > and a recent rewrite of the library is > in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas > wrote: > > Hi, > > I am seeing two Java source folder > in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and > is there any need to keep the one > we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:28:56 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:28:56 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() Message-ID: Hi, I have a receive thread that does nothing but call read() on the serial port input stream. It works fine for a while but after running for a long time it eventually returns -1 which means EOF. This is my first problem, as the device I'm talking to runs forever, I don't know why it would return -1. I am calling disableReceiveThreshold() and disableReceiveTimeout() at initialization which according to the documentation means read will return as soon as any data is available and it will block forever when data is not available, so -1 should never be returned from read, right? I have been unable to figure out why read returns -1 after a long while but I have found that if I kill my application and restart it everything works fine again. Therefore I tried to work around the problem by having my code close the port and reopen it when read returns -1. My second problem is that in this case when I call close() on the port it blocks forever. I did find this old bug http://bugzilla.qbang.org/show_bug.cgi?id=53 which describes close() hanging on OSX, but it says that bug was fixed with a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any idea why read might be returning -1 in the first place? If I can avoid that I don't care about close() hanging because I would never close the port. If not, does anyone know why close() might block forever and how I can prevent this? I'm using RXTX version 2.1-7. Thanks, -- Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:34:04 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:34:04 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() In-Reply-To: References: Message-ID: I mis-spoke, I don't have my own thread calling read, I am calling read in the event handler after receiving a SerialPortEvent.DATA_AVAILABLE event. Everything else I said should be accurate though. Ryan On Mon, Feb 28, 2011 at 12:28 AM, Ryan Boder wrote: > Hi, > > I have a receive thread that does nothing but call read() on the serial > port input stream. It works fine for a while but after running for a long > time it eventually returns -1 which means EOF. This is my first problem, as > the device I'm talking to runs forever, I don't know why it would return -1. > I am calling disableReceiveThreshold() and disableReceiveTimeout() at > initialization which according to the documentation means read will return > as soon as any data is available and it will block forever when data is not > available, so -1 should never be returned from read, right? > > I have been unable to figure out why read returns -1 after a long while but > I have found that if I kill my application and restart it everything works > fine again. Therefore I tried to work around the problem by having my code > close the port and reopen it when read returns -1. My second problem is that > in this case when I call close() on the port it blocks forever. I did find > this old bug > > http://bugzilla.qbang.org/show_bug.cgi?id=53 > > which describes close() hanging on OSX, but it says that bug was fixed with > a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any > idea why read might be returning -1 in the first place? If I can avoid that > I don't care about close() hanging because I would never close the port. If > not, does anyone know why close() might block forever and how I can prevent > this? I'm using RXTX version 2.1-7. > > Thanks, > -- > Ryan > > -- Ryan Boder 1 614 598-6339 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.w.janssen at lxtreme.nl Mon Feb 28 04:09:50 2011 From: j.w.janssen at lxtreme.nl (Jan Willem Janssen) Date: Mon, 28 Feb 2011 12:09:50 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <123a513d85e4569df1ebce58088e6592.squirrel@lxtreme.homelinux.org> FWIW: I'm also interested in the 2010-rewrite, but was waiting until a bit more code was available for other platforms, like Linux and/or OSX. I'd like to offer my help if needed, for example to test stuff. Regards, Jan Willem On Sun, February 27, 2011 23:47, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm > sorry to hear interest in it hasn't picked up. I've had a look at the > source > code yesterday, and it seems very well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java > (this > might be a matter of preference, however, I have found that it made my > life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a > NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely > in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. From iqzw2r602 at sneakemail.com Mon Feb 28 04:52:33 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 22:52:33 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6ADDC0.1020608@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> Message-ID: <15854-1298893954-139343@sneakemail.com> Hi Adrian, On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > As far as I know, any Java library that manipulates hardware devices is > going to need native code. If the JRE contains classes that already do that, > then I'm unaware of them. In other words, I don't know how one would > accomplish "making OS calls" without native code. > Yes, you're right, you need native code to do that. The only question is how much. I'm not saying that you wouldn't write native code. I'm just saying you'll need very little. Take CreateFile() on Windows. Your implementation calls it from C++ code, which implements logic all around it. However, you can also call CreateFile() from Java code, and this is what I'm proposing: Expose the CreateFile() function to Java as a static native Java method, so it becomes directly callable from Java code (only visible to implementation, not publicly). So while the code all around the CreateFile() call is all Java (granted, it's platform specific, it has to be), the 'public static native CreateFile()' method is implemented in C++ - and all it does is to call the native CreateFile() function. > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few willing > to engage in it. I don't agree that Java code should contain as much > platform-specific code as possible. That might make things easier for you, > but it defeats the "write once, run anywhere" design of Java. > "write once, run anywhere" (WORA) does apply for client code calling RXTX. However, it doesn't mean that you can't or shouldn't write platform specific code to /implement/ a library that's doing OS specific things; in fact you have to: CreateFile() only exists on Windows, open() only on Unix, etc., so you have to write code specific to each platform that calls these functions and handles their semantics. And in case you haven't noticed yet, the JDK does the same thing, it has platform specific Java classes for lots of things (try debugging the methods of java.io.File, or the parts of the AWT, and see where they call into). The point of WORA is that client code - code that calls into RXTX - should not have to deal with specifics of a platform. > I'm not sure what you mean by "fat native code" versus "slim native code." > Fat native libraries have methods like this, all written in C++: Lots of pointers here, lots of things that could go wrong (but I'm not saying it does, just showing the potential, think threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: CommPort* CommPortFactory::getInstance(const char *portName, int portType) { #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS if (strcmp("PARALLEL_PASS", portName) == 0) return new ParallelLoopback(portName); if (strcmp("SERIAL_PASS", portName) == 0) return new SerialLoopback(portName); #endif // Do not open overlapped. Let the Java application // handle multi-threaded I/O. HANDLE hComm = CreateFile( portName, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); if (hComm == INVALID_HANDLE_VALUE) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); printf("%s\n", lpMsgBuf); delete lpMsgBuf; throw IOException(); } .... // SNIP! Fact is, you can write all of this in Java. You can even take the same code, reword it a bit, and feed it into javac. So I won't quote this here again and Java-ise it, just assume the above is Java code (BTW: you can even do #ifdefs with statics). This Java code will have this import statement at the top: import static Windows.*; In Windows.java would look like this (in fact it does, I've done this in jpathwatch): static native long CreateFile(String fileName, int desiredAccess, int shareMode, SECURITY_ATTRIBUTES securityAttributes, int creationDisposition, int flagsAndAttributes, long templateFileHandle); And the code in Windows.cpp? That calls the native CreateFile() function. And that's all (There's some special handling so GetLastError() works in different threads and won't interfere with the JVM, but that's another topic) The native code in the rewrite is the minimum necessary to control the > hardware - in fact, that is one of the rewrite's design goals. The rewrite's > design reduces native code development down to implementing two virtual > classes and two functions. I thought I set the bar pretty low, but I might > be wrong. > See above; it can be even less. And since I keep saying I've done it, have a look at these files: Windows.cpp[1], Windows.java[2], WindowsPathWatchService.java [3] Don't understand this as a criticism of your design, I actually quite like it. All I am saying is that it doesn't need to be all native, and that if you make the Dispatcher an abstract class like I proposed in my previous email, implementors can choose which language they use (and yes, I'd choose Java over C++; and I've written C++ code for more than 15 years) Cheers, Uwe [1] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup [2] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup [3] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > -Adrian > > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm sorry to hear interest in it hasn't picked up. I've had a look at the > source code yesterday, and it seems very well designed and nicely > documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java (this > might be a matter of preference, however, I have found that it made my life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example > Allow| wrote: > >> Thank you for doing that. There hasn't been much community interest in the >> rewrite, and I've been busy since I started it. I hope to work on it some >> more in the next month or two. >> >> -Adrian >> >> >> On 2/25/2011 8:17 AM, Andre-John Mas wrote: >> >>> I have added a stub page here: >>> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >>> >>> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >>> >>> What could be useful is an entry in the wiki documenting the mile-stones >>>> and what is left to be done. >>>> >>>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>>> >>>> The rewrite isn't finished - it still needs Java unit tests and native >>>>> code for Apple and *nix. You can find more information on the mailing list: >>>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>>> >>>>>> Are there any show stoppers to using the rewrite instead of the >>>>>> current source branch? >>>>>> >>>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>>> >>>>>> There is no timeline to merge the two versions. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> Quoting Andre-John Mas: >>>>>>> >>>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>>> for? >>>>>>>> >>>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>>> >>>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>>> library is in Rewrite2010/src. >>>>>>>>> >>>>>>>>> -Adrian >>>>>>>>> >>>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>>> - src/ >>>>>>>>>> - Rewrite2010/src/ >>>>>>>>>> >>>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>>> we shouldn't be using around? >>>>>>>>>> >>>>>>>>>> Andre >>>>>>>>>> _______________________________________________ >>>>>>>>>> Rxtx mailing list >>>>>>>>>> Rxtx at qbang.org >>>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 28 05:36:14 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 28 Feb 2011 14:36:14 +0200 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> Message-ID: Sorry for top posting but I felt it was justified here to keep the whole context of the referred text intact. I very much agree with Uwe's point of view, ie doing as much as possible in Java, even the platform specific things, and doing the absolute minimum in C/C++. And this is not criticism Adrian's work/design. I would (again) advocate using JNA instead of JNI to access the native OS services/API from Java. This simplifies the live of the library users and developers a great deal because no C/C++ tool chain is involved. Zero. You don't even need a C compiler. There are some 'issues' in accessing some OS API functions from Java (like the need to use OS specific values in the Java code that are only available with #define in header files) but given the stability and longtime standing of the API functions we are talking about (open/close/select/read/write) I do not see this as big issue. A lot of the argumentation is included in this thread when this was last time rehashed on this list. http://answerpot.com/showthread.php?1022262-JNA%20alternative%20(was:%20rxt x%20moving%20from%20JNI%20to%20JNA%20(was%20%20About%20JRE%20crashes))/Page 1 If anyone is interested I can make the straw man implementation available. It compiles and has a fighting chance to work in a POSIX compatible OS (Mac OS X / Linux) with moderate debugging. Of course it is a long way from production, especially as throwing away the current rxtx also throws away most of the testing and debugging to the obscure/uncommon OSes that rxtx currently supports (I suggest anyone attempting to replace the current implementation has peek at the innards of the current implementation to see the variety it claims to support). (As an aside, and not really relevant to calling OS API from Java with JNA, I feel I need to mention that calling C++ using JNA is not easy because of the name mangling, so libraries with C interface are preferred with JNA). br Kusti On 2/28/11 13:52, "iqzw2r602 at sneakemail.com" wrote: >Hi Adrian, > >On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum >adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| >wrote: > > > > > > > > As far as I know, any Java library that manipulates hardware devices > is going to need native code. If the JRE contains classes that > already do that, then I'm unaware of them. In other words, I don't > know how one would accomplish "making OS calls" without native code. > > > > >Yes, you're right, you need native code to do that. The only question is >how much. I'm not saying that you wouldn't write native code. I'm just >saying you'll need very little. Take CreateFile() on Windows. Your >implementation calls it from C++ code, which implements logic all around >it. > >However, you can also call CreateFile() from Java code, and this is what >I'm proposing: Expose the CreateFile() function to Java as a static >native Java method, so it becomes directly callable from Java code (only >visible to implementation, not publicly). So while the code all around >the CreateFile() call is all Java (granted, it's platform specific, it >has to be), the 'public static native CreateFile()' method is implemented >in C++ - and all it does is to call the native CreateFile() function. > > > > > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few > willing to engage in it. I don't agree that Java code should contain > as much platform-specific code as possible. That might make things > easier for you, but it defeats the "write once, run anywhere" design > of Java. > > > > >"write once, run anywhere" (WORA) does apply for client code calling >RXTX. > >However, it doesn't mean that you can't or shouldn't write platform >specific code to /implement/ a library that's doing OS specific things; >in fact you have to: >CreateFile() only exists on Windows, open() only on Unix, etc., so you >have to write code specific to each platform that calls these functions >and handles their semantics. And in case you haven't noticed yet, the JDK >does the same thing, it has platform specific Java classes for lots of >things (try debugging the methods of java.io.File, or the parts of the >AWT, and see where they call into). > >The point of WORA is that client code - code that calls into RXTX - >should not have to deal with specifics of a platform. > > > > > I'm not sure what you mean by "fat native code" versus "slim native > code." > > > >Fat native libraries have methods like this, all written in C++: Lots of >pointers here, lots of things that could go wrong (but I'm not saying it >does, just showing the potential, think >threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: > >CommPort* CommPortFactory::getInstance(const char *portName, int portType) >{ >#ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); >#endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } >... >// SNIP! > >Fact is, you can write all of this in Java. You can even take the same >code, reword it a bit, and feed it into javac. So I won't quote this here >again and Java-ise it, just assume the above is Java code (BTW: you can >even do #ifdefs with statics). This Java code will have this import >statement at the top: > >import static Windows.*; > >In Windows.java would look like this (in fact it does, I've done this in >jpathwatch): > >static native long CreateFile(String fileName, int desiredAccess, int >shareMode, SECURITY_ATTRIBUTES securityAttributes, int >creationDisposition, int flagsAndAttributes, long templateFileHandle); > >And the code in Windows.cpp? That calls the native CreateFile() function. >And that's all (There's some special handling so GetLastError() works in >different threads and won't interfere with the JVM, but that's another >topic) > > > >The native code in the rewrite is the minimum necessary to > control the hardware - in fact, that is one of the rewrite's design > goals. The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I set > the bar pretty low, but I might be wrong. > > > > >See above; it can be even less. > >And since I keep saying I've done it, have a look at these files: >Windows.cpp >jpathwatch-native/src/Windows.cpp?revision=130&view=markup>[1], >Windows.java >jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&v >iew=markup>[2], WindowsPathWatchService.java >jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.jav >a?revision=130&view=markup>[3] > >Don't understand this as a criticism of your design, I actually quite >like it. All I am saying is that it doesn't need to be all native, and >that if you make the Dispatcher an abstract class like I proposed in my >previous email, implementors can choose which language they use (and yes, >I'd choose Java over C++; and I've written C++ code for more than 15 >years) > >Cheers, > >Uwe > >[1] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-native/src/Windows.cpp?revision=130&view=markup >[2] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&vi >ew=markup >[3] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java >?revision=130&view=markup > > > > > -Adrian > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > >Hi Adrian, > > I've followed the discussion about the rewrite over the past > months, and I'm sorry to hear interest in it hasn't picked up. > I've had a look at the source code yesterday, and it seems very > well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because > it currently only runs on Windows. I know from first hand > experience (jpathwatch) that it's quite hard to write robust > cross-platform Java libraries containing native code, and that > people might be hesitant to pick up development on something like > that. > > I was contemplating of toying around with the code base a couple > of times, but I'd rather write as much platform dependent code as > I can in Java (this might be a matter of preference, however, I > have found that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I > suggest that: > > * the Dispatcher Java class becomes abstract, without native > methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by > Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be > implemented almost entirely in Java. This way, every OS can > implement it's own dispatcher. > > This gives the implementor the option to choose whether to write > their implementation as a fat native library (like the one you > have implemented for Windows), or in Java with a slim native > library (which only wraps OS function calls). > In turn, it might make it more attractive for developers to jump > in and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian > Crum adrian.crum-at-sandglass-software.com > > |rxtx.org > mailing list/Example Allow| > wrote: > >Thank you for doing that. There hasn't > been much community interest in the rewrite, and I've been > busy since I started it. I hope to work on it some more in the > next month or two. > > > -Adrian > > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: >http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > > What could be useful is an entry in the wiki > documenting the mile-stones and what is left to be > done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > > The rewrite isn't finished - it still needs Java > unit tests and native code for Apple and *nix. You > can find more information on the mailing list: >http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, >adrian.crum at sandglass-software.com > wrote: > > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas: > > > What is the timeline to merge the two? Also, > what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > > The latest working source is in src, and a > recent rewrite of the library is in > Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: > > Hi, > > I am seeing two Java source folder in the > CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there > any need to keep the one we shouldn't be > using around? > > Andre >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > >http://mailman.qbang.org/mailman/listinfo/rxtx > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From adrian.crum at sandglass-software.com Mon Feb 28 08:15:18 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 07:15:18 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> Message-ID: <4D6BBC06.4090402@sandglass-software.com> Thank you for the suggestions - I will keep them in mind the next time I work on it. -Adrian On 2/28/2011 3:52 AM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > As far as I know, any Java library that manipulates hardware > devices is going to need native code. If the JRE contains classes > that already do that, then I'm unaware of them. In other words, I > don't know how one would accomplish "making OS calls" without > native code. > > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as a > static native Java method, so it becomes directly callable from Java > code (only visible to implementation, not publicly). So while the code > all around the CreateFile() call is all Java (granted, it's platform > specific, it has to be), the 'public static native CreateFile()' > method is implemented in C++ - and all it does is to call the native > CreateFile() function. > > > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there will > be few willing to engage in it. I don't agree that Java code > should contain as much platform-specific code as possible. That > might make things easier for you, but it defeats the "write once, > run anywhere" design of Java. > > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. > > > I'm not sure what you mean by "fat native code" versus "slim > native code." > > > Fat native libraries have methods like this, all written in C++: Lots > of pointers here, lots of things that could go wrong (but I'm not > saying it does, just showing the potential, think threading) - and I'm > a cheeky bastard here and quote from W32_Support.cpp: > > CommPort* CommPortFactory::getInstance(const char *portName, int portType) > { > #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); > #endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } > ... > // SNIP! > > Fact is, you can write all of this in Java. You can even take the same > code, reword it a bit, and feed it into javac. So I won't quote this > here again and Java-ise it, just assume the above is Java code (BTW: > you can even do #ifdefs with statics). This Java code will have this > import statement at the top: > > import static Windows.*; > > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > > static native long CreateFile(String fileName, int desiredAccess, int > shareMode, SECURITY_ATTRIBUTES securityAttributes, int > creationDisposition, int flagsAndAttributes, long templateFileHandle); > > And the code in Windows.cpp? That calls the native CreateFile() > function. And that's all (There's some special handling so > GetLastError() works in different threads and won't interfere with the > JVM, but that's another topic) > > The native code in the rewrite is the minimum necessary to control > the hardware - in fact, that is one of the rewrite's design goals. > The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I > set the bar pretty low, but I might be wrong. > > > See above; it can be even less. > > And since I keep saying I've done it, have a look at these files: > Windows.cpp > [1], > Windows.java > [2], > WindowsPathWatchService.java > [3] > > Don't understand this as a criticism of your design, I actually quite > like it. All I am saying is that it doesn't need to be all native, and > that if you make the Dispatcher an abstract class like I proposed in > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) > > Cheers, > > Uwe > > [1] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup > > [2] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup > > [3] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Feb 28 09:51:19 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 17:51:19 +0100 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <20110228165119.GD10695@elberon.bln.de.ingenico.com> * Andre-John Mas wrote on Fri, Feb 18, 2011 at 21:43 -0500: > Is anyone using JDK 1.4 or less? Yes, 1.4.2_11-b06 (j2sdk-1_4_2_11-fcs-linux-i586) in some cases (also similar versions: 1.4.2_15-b02, 1.4.2_16-b05, maybe others). > I am asking because I would be interested in bringing the code > up to Java 1.5 standards, with the use of generics and other > recent developments. Why that? oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Mon Feb 28 10:20:53 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 18:20:53 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6BBC06.4090402@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> Message-ID: <20110228172052.GE10695@elberon.bln.de.ingenico.com> * Adrian Crum wrote on Mon, Feb 28, 2011 at 07:15 -0800: [...] > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. I think in general it can be good to have an system-abstracting interface of the native code. That means, the native code implementation abstracts from the system (instead of implementing that abstractions in Java). Of course it is more complex :) IIRC we already had such a discussion here. > Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as > a static native Java method, so it becomes directly callable > from Java code (only visible to implementation, not publicly). > So while the code all around the CreateFile() call is all Java > (granted, it's platform specific, it has to be), the 'public > static native CreateFile()' method is implemented in C++ - and > all it does is to call the native CreateFile() function. I don't think I'd like this. CreateFile() is very system-specific. Exposing this to Java code makes this Java code system-specific. Although you could "run" it everywhere, it won't work anyware except on appropriate windows boxes. But this goes even further, you might consider calling open and select from Java and use it for serial ports on linux, but on another system that have both functions, they simply won't work (like on windows; there should be open and select, but AFAIK the latter cannot be expected to work on serial interfaces). Of course there is an somewhat strong argument, that is if the developer is much more experienced with Java than with C, it might be easier to implement this in Java, but personally I think it is hard to believe that developers who are able to correctly abstract device-I/O from system calls are not good at C, because I'm sure C is the language system by system programmers. > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there > will be few willing to engage in it. I don't agree that Java > code should contain as much platform-specific code as possible. > That might make things easier for you, but it defeats the > "write once, run anywhere" design of Java. Java runs on compliant JVMs only and nowhere else. It just happens that JVMs exist for most systems of a special set of computers such as PCs and small servers (but not neccesarily for embedded devices or main frames). As soon as a single native function is needed (required) for the application to work properly, the `run anywhere' is already impossible, because now it does not run on any JVM but only on JVMs that supply an implementation for this native code function. > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. Yes, exactly. Also, it is possible to write system-specific applications `with 100% Java' (for example, hardcode "C:\\Program Files" to be windows-specific or use "/dev/null" or so). Expecting a certain behavior not specified by Java (e.g. whether you can read "/dev/null", what CreateFile returns or whether select works on non-socket-filehandles) IMHO already misses the "write once, run anywhere" idea. So in summary I don't think the amount of platform-specific code matters much. It must be avaiable, requiring deployment etc, so little difference how many lines of code that were. [...] > import static Windows.*; > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > static native long CreateFile(String fileName, int desiredAccess, int [...] Someone here also proposed to use a general method to invoke arbitrary functions of shared libraries, JNA. By this, you wouldn't need `static NATIVE long CreateFile'; you could replace JNI by JNA here. Assuming that this native functionality would already be deployed on many target platform systems, implementing all the platform-specific code in Java can make sense, because this specific implementations would not require additional native code deployment. If, for example, the Java installation of Debian would by default already offer native library call execution, platform-specific code implemented in Java would work on Debian without needing any additional binary lib to be installed, I think could be quite an advantage. I think if having some Windows.java layer (which I personally would not like), JNA IMHO seems to be suited well. Personally, I prefere to define nice, simple and comfortable interfaces, also for native code (if possible, for JNI I think it always is a compromise). > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) Do you mean in general or also specifically for system programming? If someone would need a small program to let's say query DCD on linux I think a small C application would be suited best. Of course this topic also is more complex and depends on things. oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From msemtd at googlemail.com Mon Feb 28 13:50:42 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 28 Feb 2011 20:50:42 +0000 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172052.GE10695@elberon.bln.de.ingenico.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: This was discussed to death last year - summary: - * JNI is too hard * JNA is compelling * yay! let's start a rewrite Time passes... Current status: Windows-only and incomplete Back in non-vaporware land (this is meant in good humour BTW), the current RXTX platform-specifics are achieved with ports of POSIX termios.h[1]. It just works (mostly, kinda!) and you have to treat it nice and test it to death for _YOUR_ platform in _YOUR_ application but, y'know, that's what professional software engineers just do anyway. I seriously don't believe anyone will come up with anything better anytime soon. Regards, Michael Erskine. [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition From iqzw2r602 at sneakemail.com Mon Feb 28 15:01:20 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 09:01:20 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <6175-1298930480-518642@sneakemail.com> Good summary. This whole JNI/JNA/C++ thing only came up again because I tried to explain my motivations for my initial request. And I agree, let's not discuss this further, we've been there already. So let's get this discussion back on track: All I suggested is to separate the implementation of the Dispatcher Java class into a NativeDispatcher class and a Dispatcher interface, so people can implement the Dispatcher (Java-) interface with whatever Three-Letter-Abbreviation they want. So can people please comment on that? Cheers, Uwe On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 > Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 15:22:21 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 14:22:21 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <4D6C201D.6060103@sandglass-software.com> One of the issues I tried to address in the rewite is the "JNI is too hard" issue. Anyone with rudimentary C++ skills can implement the two virtual classes and two functions - no knowledge of JNI is necessary because Dispatcher.cpp takes care of all of the JNI data type marshalling/unmarshalling. I don't agree that the 2.x versions "just work" - the recurring bugs mentioned on this list and in other forums are evidence of that. I tried to work with the 2.x version by wrapping it in thread-safe classes, but even that didn't help. I tried to fix the most recent version by supplying patches, but the sum of the patches added up to a rewrite. So I created a rewrite instead. -Adrian On 2/28/2011 12:50 PM, Michael Erskine wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Mon Feb 28 16:24:00 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 15:24:00 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <6175-1298930480-518642@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> Message-ID: <4D6C2E90.9010601@sandglass-software.com> My question would be: Why would you do that? The rewrite does most of the work for you - all you have to do is implement two C++ virtual classes and two C++ functions. In Windows that took me a few hours. I can't imagine other ports taking much longer than that - especially since POSIX-based code can be shared between ports. What you're suggesting would require a great deal more effort than necessary. -Adrian On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to > explain my motivations for my initial request. And I agree, let's not > discuss this further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher > Java class into a NativeDispatcher class and a Dispatcher interface, > so people can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine > msemtd-at-googlemail.com |rxtx.org > mailing list/Example Allow| > <6zkk4zdpgt at sneakemail.com > wrote: > > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Mon Feb 28 17:26:18 2011 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Mon, 28 Feb 2011 17:26:18 -0700 Subject: [Rxtx] =?utf-8?q?Which_Java_folder_in_source=3F?= Message-ID: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 17:40:03 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 16:40:03 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> References: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> Message-ID: <4D6C4063.5060708@sandglass-software.com> Speaking of bugs one knows - was anyone interested in the bug fixing effort you proposed? -Adrian On 2/28/2011 4:26 PM, jfh at greenhousepc.com wrote: > Adrian, > > I have many dozens of clients using the RXTX jar on a wide variety of > Windows, Linux and a few MacOS X releases. Provided one does what the > previous poster suggested, the code really does "just work". > > Most of the problems that get reported are things that Windows > applications, and not a few Linux ones as well, have problems with > already. > > The other issue is that even with a boat load of testing, I have no > expectation to migrate to the re-write until 3Q12 at the absolute > earliest. > > I appreciate the effort you are putting into this re-write, but after > 32 years in this field (that's more years than many on this list are > alive), I've seen a lot of "re-writes". I've even done a few myself, > some better than others. > > That 32 years of software engineering experience has taught me one > vital lesson -- the bugs one knows are far less dangerous than the > bugs one doesn't know. And all re-writes are a minefield of unknown > bugs. For my products, it takes about 9 =months= before a release is > stable enough that I'm truly pleased with it. I'm still struggling > with bugs from new features I added in my 3Q10 release. I don't need > to struggle with the new bugs that are going to come from the > re-write. Not personal, just my 32 years of experience. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com > // greenHousePC on Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Which Java folder in source? > From: Adrian Crum > ; > Date: Mon, February 28, 2011 4:22 pm > To: rxtx at qbang.org > > One of the issues I tried to address in the rewite is the "JNI is too > hard" issue. Anyone with rudimentary C++ skills can implement the two > virtual classes and two functions - no knowledge of JNI is necessary > because Dispatcher.cpp takes care of all of the JNI data type > marshalling/unmarshalling. > > I don't agree that the 2.x versions "just work" - the recurring bugs > mentioned on this list and in other forums are evidence of that. I > tried > to work with the 2.x version by wrapping it in thread-safe > classes, but > even that didn't help. I tried to fix the most recent version by > supplying patches, but the sum of the patches added up to a > rewrite. So > I created a rewrite instead. > > -Adrian > > On 2/28/2011 12:50 PM, Michael Erskine wrote: > > This was discussed to death last year - summary: - > > * JNI is too hard > > * JNA is compelling > > * yay! let's start a rewrite > > > > Time passes... > > > > Current status: Windows-only and incomplete > > > > Back in non-vaporware land (this is meant in good humour BTW), the > > current RXTX platform-specifics are achieved with ports of POSIX > > termios.h[1]. > > > > It just works (mostly, kinda!) and you have to treat it nice and test > > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > > that's what professional software engineers just do anyway. I > > seriously don't believe anyone will come up with anything better > > anytime soon. > > > > Regards, > > Michael Erskine. > > > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From iqzw2r602 at sneakemail.com Mon Feb 28 18:59:48 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 12:59:48 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6C2E90.9010601@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> Message-ID: <13486-1298944789-675699@sneakemail.com> On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > My question would be: Why would you do that? > I'm thinking about the debugging effort, quite frankly. When I started off with jpathwatch, I initially wrote a fat native library. It got me into trouble: It was hard to debug, the JVM would crash every now and then, depending which bug it hit, and debugging a process with a JVM (even on Windows) is not fun. When I finally got it to work on Windows, I started doing Linux, and the same thing happened again - and I didn't find the tools as nice. When it started sucking up too much of my time I scrapped the whole thing, literally, and moved to a slim native library. I wrote the new implementation in a fraction of the time, and it rarely ever crashed (because except for the little C++ code to wrap OS functions there was nothing that could). So that's my reason to write things in Java mainly for a project like this. Others prefer C++. What I'm suggesting gives people a choice to use the tool they're most comfortable with (because this is really about people, not code; the code won't write and fix itself, people have to go in and do it) > The rewrite does most of the work for you - all you have to do is implement > two C++ virtual classes and two C++ functions. In Windows that took me a few > hours. I can't imagine other ports taking much longer than that - especially > since POSIX-based code can be shared between ports. > And that's fine for people who want to write a native code implementation. I'm not talking about scrapping that at all, quite the contrary - Windows and the C++ framework should stay as it is, it's quite a large contribution you've made in time and effort, it'd be stupid to abandon that. Even more so, other platforms could build on the C++ code you've written, as you intended. All this would provide is another option, so people can also implement a platform in Java with any TLA they want (don't want to mention technologies here, that'll start another flame war ;) > What you're suggesting would require a great deal more effort than > necessary. > No, I don't think so; it'd be a quite simple refactoring task: * Copy Dispatcher.java into NativeDispatcher.java and change constructor name. Make it derive from Dispatcher * Make all methods in the original Dispatcher.java abstract except for getInstance(). That method does System.getProperty("os.name") to decide which implementation to instantiate. On Windows (and other platforms that implement the C++ interface), it instantiates NativeDispatcher. On yet others, it would instantiate the MyOSNameHereDispatcher * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename corresponding C++ class I'd think this is about 3 hours of work. I'm even happy to have a shot at it, but I have no commit rights to CVS, and I certainly don't intend to make changes that other people don't like. Remember, this discussion stemmed from people being worried that the rewrite is Windows-only right now. So the goal is to get more supported platforms, and to get there you'll need people to contribute code. I think providing more options will attract more contributors. It would certainly make it more attractive for me. Cheers, Uwe > -Adrian > > > > On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to explain > my motivations for my initial request. And I agree, let's not discuss this > further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher Java > class into a NativeDispatcher class and a Dispatcher interface, so people > can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | > rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > >> This was discussed to death last year - summary: - >> * JNI is too hard >> * JNA is compelling >> * yay! let's start a rewrite >> >> Time passes... >> >> Current status: Windows-only and incomplete >> >> Back in non-vaporware land (this is meant in good humour BTW), the >> current RXTX platform-specifics are achieved with ports of POSIX >> termios.h[1]. >> >> It just works (mostly, kinda!) and you have to treat it nice and test >> it to death for _YOUR_ platform in _YOUR_ application but, y'know, >> that's what professional software engineers just do anyway. I >> seriously don't believe anyone will come up with anything better >> anytime soon. >> >> Regards, >> Michael Erskine. >> >> [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 >> Edition >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 19:32:12 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 18:32:12 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <13486-1298944789-675699@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> <13486-1298944789-675699@sneakemail.com> Message-ID: <4D6C5AAC.3070508@sandglass-software.com> Just to make sure I'm understanding you correctly, anyone porting RxTx to a new platform would have to do the following: 1. Write their own Java implementation of an abstract Dispatcher class. 2. Write a native (JNI or JNA) interface for the abstract class implementation. 3. Write all of the native (or non-native) code to implement the native interface. Is that correct? If yes, how is that easier than the simple implementation the current rewrite design uses? On a side note: there is no requirement to write native code using C++. If C++ is a real obstacle to adoption, then regular C could be used instead. In that case, there would be a Dispatcher.c file that contains function protoypes that need to be implemented. Dispatcher.c would still maintain the same role as Dispatcher.cpp - which is to shield native code developers from the details of JNI. Just build out the missing functions using C data types and you're ready to go. -Adrian On 2/28/2011 5:59 PM, iqzw2r602 at sneakemail.com wrote: > On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > What you're suggesting would require a great deal more effort than > necessary. > > > No, I don't think so; it'd be a quite simple refactoring task: > * Copy Dispatcher.java into NativeDispatcher.java and change > constructor name. Make it derive from Dispatcher > * Make all methods in the original Dispatcher.java abstract except for > getInstance(). That method does System.getProperty("os.name > ") to decide which implementation to instantiate. On > Windows (and other platforms that implement the C++ interface), it > instantiates NativeDispatcher. On yet others, it would instantiate the > MyOSNameHereDispatcher > * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename > corresponding C++ class > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From storrellas at bdigital.org Wed Feb 23 10:37:48 2011 From: storrellas at bdigital.org (Sergi Torrellas) Date: Wed, 23 Feb 2011 18:37:48 +0100 Subject: [Rxtx] Serial port description Message-ID: Hi all, I am using the library RXTX for connecting to a USB port that is mapped to a serial port. My question is the following is possible to get a longer description of the serial part a part from the COMX? Many thanks, -- *SERGI TORRELLAS SOCASTRO Desenvolupador R+D Salut M. 616.21.72.97** *storrellas at bdigital.org *BARCELONA DIGITAL CENTRE TECNOL?GIC* Roc Boronat 117, 5a planta, 08018 Barcelona Tel. +34 93 553 45 40 - Fax. +34 93 553 45 41 www.bdigital.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Wed Feb 23 21:46:30 2011 From: showard314 at gmail.com (Scott Howard) Date: Wed, 23 Feb 2011 23:46:30 -0500 Subject: [Rxtx] compiling rxtx on archs without sys/io.h Message-ID: Hello all, There is a bug at: http://bugzilla.qbang.org/show_bug.cgi?id=72 for fixing a build failure on PPCs. A similar build failure occurs on mips, ARM, sparc, and a few other architectures. You can work around it be using AC_CHECK_HEADERS and properly shielding #include . I uploaded a new patch to that bug which does that, and have compiled rxtx on those architectures. This will also work for future architectures and won't require manually updating the #ifdefs. If you do use this patch, you should also edit the individual Makefiles (like Makefile.mingw32) to properly #define or #undef HAVE_SYS_IO_H Regards, Scott From ajmas at sympatico.ca Fri Feb 25 09:03:34 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:03:34 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D613A6C.80304@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. On 20-Feb-2011, at 10:59, Adrian Crum wrote: > The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: >> Are there any show stoppers to using the rewrite instead of the current source branch? >> >> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >> >>> There is no timeline to merge the two versions. >>> >>> -Adrian >>> >>> Quoting Andre-John Mas: >>> >>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>> >>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>> >>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>> Hi, >>>>>> >>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>> - src/ >>>>>> - Rewrite2010/src/ >>>>>> >>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>> >>>>>> Andre >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 25 09:17:23 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:17:23 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > >> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >> >> -Adrian >> >> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>> Are there any show stoppers to using the rewrite instead of the current source branch? >>> >>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>> >>>> There is no timeline to merge the two versions. >>>> >>>> -Adrian >>>> >>>> Quoting Andre-John Mas: >>>> >>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>> >>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>> >>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>> - src/ >>>>>>> - Rewrite2010/src/ >>>>>>> >>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>> >>>>>>> Andre >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 26 18:58:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 26 Feb 2011 17:58:27 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: <4D69AFC3.50008@sandglass-software.com> Thank you for doing that. There hasn't been much community interest in the rewrite, and I've been busy since I started it. I hope to work on it some more in the next month or two. -Adrian On 2/25/2011 8:17 AM, Andre-John Mas wrote: > I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > >> What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. >> >> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >> >>> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>> >>> -Adrian >>> >>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> Are there any show stoppers to using the rewrite instead of the current source branch? >>>> >>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>> >>>>> There is no timeline to merge the two versions. >>>>> >>>>> -Adrian >>>>> >>>>> Quoting Andre-John Mas: >>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>>> >>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>> - src/ >>>>>>>> - Rewrite2010/src/ >>>>>>>> >>>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>>> >>>>>>>> Andre >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From iqzw2r602 at sneakemail.com Sun Feb 27 15:47:16 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 09:47:16 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D69AFC3.50008@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> Message-ID: <23853-1298846836-791608@sneakemail.com> Hi Adrian, I've followed the discussion about the rewrite over the past months, and I'm sorry to hear interest in it hasn't picked up. I've had a look at the source code yesterday, and it seems very well designed and nicely documented. IMHO one reason why it hasn't been fully embraced yet is because it currently only runs on Windows. I know from first hand experience (jpathwatch) that it's quite hard to write robust cross-platform Java libraries containing native code, and that people might be hesitant to pick up development on something like that. I was contemplating of toying around with the code base a couple of times, but I'd rather write as much platform dependent code as I can in Java (this might be a matter of preference, however, I have found that it made my life a hell of a lot easier). So to give people choice in how they implement their port, I suggest that: * the Dispatcher Java class becomes abstract, without native methods. * All Java and native code in the Dispatcher class moves to a new NativeDispatcher java/C++ class, which derives from Dispatcher. * The Dispatcher.getInstance() method chooses, per platform, which Dispatcher instance it's going to create. So on Windows and other platforms that like their dispatcher to be native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). On other platforms (say, on BSD based platforms), a different Dispatcher implementation is instantiated, which can be implemented almost entirely in Java. This way, every OS can implement it's own dispatcher. This gives the implementor the option to choose whether to write their implementation as a fat native library (like the one you have implemented for Windows), or in Java with a slim native library (which only wraps OS function calls). In turn, it might make it more attractive for developers to jump in and contribute implementations for other platforms. What do you think? Cheers, Uwe On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > Thank you for doing that. There hasn't been much community interest in the > rewrite, and I've been busy since I started it. I hope to work on it some > more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > >> I have added a stub page here: >> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >> >> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >> >> What could be useful is an entry in the wiki documenting the mile-stones >>> and what is left to be done. >>> >>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>> >>> The rewrite isn't finished - it still needs Java unit tests and native >>>> code for Apple and *nix. You can find more information on the mailing list: >>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>> >>>> -Adrian >>>> >>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> >>>>> Are there any show stoppers to using the rewrite instead of the current >>>>> source branch? >>>>> >>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>> >>>>> There is no timeline to merge the two versions. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> Quoting Andre-John Mas: >>>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>> for? >>>>>>> >>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>> library is in Rewrite2010/src. >>>>>>>> >>>>>>>> -Adrian >>>>>>>> >>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>> - src/ >>>>>>>>> - Rewrite2010/src/ >>>>>>>>> >>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>> we shouldn't be using around? >>>>>>>>> >>>>>>>>> Andre >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Sun Feb 27 16:26:56 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 27 Feb 2011 15:26:56 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <4D6ADDC0.1020608@sandglass-software.com> As far as I know, any Java library that manipulates hardware devices is going to need native code. If the JRE contains classes that already do that, then I'm unaware of them. In other words, I don't know how one would accomplish "making OS calls" without native code. I agree that developing a Java library that reads/writes serial and parallel hardware is not an easy task - therefore there will be few willing to engage in it. I don't agree that Java code should contain as much platform-specific code as possible. That might make things easier for you, but it defeats the "write once, run anywhere" design of Java. I'm not sure what you mean by "fat native code" versus "slim native code." The native code in the rewrite is the minimum necessary to control the hardware - in fact, that is one of the rewrite's design goals. The rewrite's design reduces native code development down to implementing two virtual classes and two functions. I thought I set the bar pretty low, but I might be wrong. -Adrian On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, > and I'm sorry to hear interest in it hasn't picked up. I've had a look > at the source code yesterday, and it seems very well designed and > nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick up development on something like that. > > I was contemplating of toying around with the code base a couple of > times, but I'd rather write as much platform dependent code as I can > in Java (this might be a matter of preference, however, I have found > that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be implemented > almost entirely in Java. This way, every OS can implement it's own > dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have > implemented for Windows), or in Java with a slim native library (which > only wraps OS function calls). > In turn, it might make it more attractive for developers to jump in > and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > Thank you for doing that. There hasn't been much community > interest in the rewrite, and I've been busy since I started it. I > hope to work on it some more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: > http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > What could be useful is an entry in the wiki documenting > the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > The rewrite isn't finished - it still needs Java unit > tests and native code for Apple and *nix. You can find > more information on the mailing list: > http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, > adrian.crum at sandglass-software.com > wrote: > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas >: > > What is the timeline to merge the two? > Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > The latest working source is in src, > and a recent rewrite of the library is > in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas > wrote: > > Hi, > > I am seeing two Java source folder > in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and > is there any need to keep the one > we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:28:56 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:28:56 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() Message-ID: Hi, I have a receive thread that does nothing but call read() on the serial port input stream. It works fine for a while but after running for a long time it eventually returns -1 which means EOF. This is my first problem, as the device I'm talking to runs forever, I don't know why it would return -1. I am calling disableReceiveThreshold() and disableReceiveTimeout() at initialization which according to the documentation means read will return as soon as any data is available and it will block forever when data is not available, so -1 should never be returned from read, right? I have been unable to figure out why read returns -1 after a long while but I have found that if I kill my application and restart it everything works fine again. Therefore I tried to work around the problem by having my code close the port and reopen it when read returns -1. My second problem is that in this case when I call close() on the port it blocks forever. I did find this old bug http://bugzilla.qbang.org/show_bug.cgi?id=53 which describes close() hanging on OSX, but it says that bug was fixed with a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any idea why read might be returning -1 in the first place? If I can avoid that I don't care about close() hanging because I would never close the port. If not, does anyone know why close() might block forever and how I can prevent this? I'm using RXTX version 2.1-7. Thanks, -- Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:34:04 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:34:04 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() In-Reply-To: References: Message-ID: I mis-spoke, I don't have my own thread calling read, I am calling read in the event handler after receiving a SerialPortEvent.DATA_AVAILABLE event. Everything else I said should be accurate though. Ryan On Mon, Feb 28, 2011 at 12:28 AM, Ryan Boder wrote: > Hi, > > I have a receive thread that does nothing but call read() on the serial > port input stream. It works fine for a while but after running for a long > time it eventually returns -1 which means EOF. This is my first problem, as > the device I'm talking to runs forever, I don't know why it would return -1. > I am calling disableReceiveThreshold() and disableReceiveTimeout() at > initialization which according to the documentation means read will return > as soon as any data is available and it will block forever when data is not > available, so -1 should never be returned from read, right? > > I have been unable to figure out why read returns -1 after a long while but > I have found that if I kill my application and restart it everything works > fine again. Therefore I tried to work around the problem by having my code > close the port and reopen it when read returns -1. My second problem is that > in this case when I call close() on the port it blocks forever. I did find > this old bug > > http://bugzilla.qbang.org/show_bug.cgi?id=53 > > which describes close() hanging on OSX, but it says that bug was fixed with > a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any > idea why read might be returning -1 in the first place? If I can avoid that > I don't care about close() hanging because I would never close the port. If > not, does anyone know why close() might block forever and how I can prevent > this? I'm using RXTX version 2.1-7. > > Thanks, > -- > Ryan > > -- Ryan Boder 1 614 598-6339 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.w.janssen at lxtreme.nl Mon Feb 28 04:09:50 2011 From: j.w.janssen at lxtreme.nl (Jan Willem Janssen) Date: Mon, 28 Feb 2011 12:09:50 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <123a513d85e4569df1ebce58088e6592.squirrel@lxtreme.homelinux.org> FWIW: I'm also interested in the 2010-rewrite, but was waiting until a bit more code was available for other platforms, like Linux and/or OSX. I'd like to offer my help if needed, for example to test stuff. Regards, Jan Willem On Sun, February 27, 2011 23:47, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm > sorry to hear interest in it hasn't picked up. I've had a look at the > source > code yesterday, and it seems very well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java > (this > might be a matter of preference, however, I have found that it made my > life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a > NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely > in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. From iqzw2r602 at sneakemail.com Mon Feb 28 04:52:33 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 22:52:33 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6ADDC0.1020608@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> Message-ID: <15854-1298893954-139343@sneakemail.com> Hi Adrian, On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > As far as I know, any Java library that manipulates hardware devices is > going to need native code. If the JRE contains classes that already do that, > then I'm unaware of them. In other words, I don't know how one would > accomplish "making OS calls" without native code. > Yes, you're right, you need native code to do that. The only question is how much. I'm not saying that you wouldn't write native code. I'm just saying you'll need very little. Take CreateFile() on Windows. Your implementation calls it from C++ code, which implements logic all around it. However, you can also call CreateFile() from Java code, and this is what I'm proposing: Expose the CreateFile() function to Java as a static native Java method, so it becomes directly callable from Java code (only visible to implementation, not publicly). So while the code all around the CreateFile() call is all Java (granted, it's platform specific, it has to be), the 'public static native CreateFile()' method is implemented in C++ - and all it does is to call the native CreateFile() function. > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few willing > to engage in it. I don't agree that Java code should contain as much > platform-specific code as possible. That might make things easier for you, > but it defeats the "write once, run anywhere" design of Java. > "write once, run anywhere" (WORA) does apply for client code calling RXTX. However, it doesn't mean that you can't or shouldn't write platform specific code to /implement/ a library that's doing OS specific things; in fact you have to: CreateFile() only exists on Windows, open() only on Unix, etc., so you have to write code specific to each platform that calls these functions and handles their semantics. And in case you haven't noticed yet, the JDK does the same thing, it has platform specific Java classes for lots of things (try debugging the methods of java.io.File, or the parts of the AWT, and see where they call into). The point of WORA is that client code - code that calls into RXTX - should not have to deal with specifics of a platform. > I'm not sure what you mean by "fat native code" versus "slim native code." > Fat native libraries have methods like this, all written in C++: Lots of pointers here, lots of things that could go wrong (but I'm not saying it does, just showing the potential, think threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: CommPort* CommPortFactory::getInstance(const char *portName, int portType) { #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS if (strcmp("PARALLEL_PASS", portName) == 0) return new ParallelLoopback(portName); if (strcmp("SERIAL_PASS", portName) == 0) return new SerialLoopback(portName); #endif // Do not open overlapped. Let the Java application // handle multi-threaded I/O. HANDLE hComm = CreateFile( portName, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); if (hComm == INVALID_HANDLE_VALUE) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); printf("%s\n", lpMsgBuf); delete lpMsgBuf; throw IOException(); } .... // SNIP! Fact is, you can write all of this in Java. You can even take the same code, reword it a bit, and feed it into javac. So I won't quote this here again and Java-ise it, just assume the above is Java code (BTW: you can even do #ifdefs with statics). This Java code will have this import statement at the top: import static Windows.*; In Windows.java would look like this (in fact it does, I've done this in jpathwatch): static native long CreateFile(String fileName, int desiredAccess, int shareMode, SECURITY_ATTRIBUTES securityAttributes, int creationDisposition, int flagsAndAttributes, long templateFileHandle); And the code in Windows.cpp? That calls the native CreateFile() function. And that's all (There's some special handling so GetLastError() works in different threads and won't interfere with the JVM, but that's another topic) The native code in the rewrite is the minimum necessary to control the > hardware - in fact, that is one of the rewrite's design goals. The rewrite's > design reduces native code development down to implementing two virtual > classes and two functions. I thought I set the bar pretty low, but I might > be wrong. > See above; it can be even less. And since I keep saying I've done it, have a look at these files: Windows.cpp[1], Windows.java[2], WindowsPathWatchService.java [3] Don't understand this as a criticism of your design, I actually quite like it. All I am saying is that it doesn't need to be all native, and that if you make the Dispatcher an abstract class like I proposed in my previous email, implementors can choose which language they use (and yes, I'd choose Java over C++; and I've written C++ code for more than 15 years) Cheers, Uwe [1] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup [2] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup [3] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > -Adrian > > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm sorry to hear interest in it hasn't picked up. I've had a look at the > source code yesterday, and it seems very well designed and nicely > documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java (this > might be a matter of preference, however, I have found that it made my life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example > Allow| wrote: > >> Thank you for doing that. There hasn't been much community interest in the >> rewrite, and I've been busy since I started it. I hope to work on it some >> more in the next month or two. >> >> -Adrian >> >> >> On 2/25/2011 8:17 AM, Andre-John Mas wrote: >> >>> I have added a stub page here: >>> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >>> >>> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >>> >>> What could be useful is an entry in the wiki documenting the mile-stones >>>> and what is left to be done. >>>> >>>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>>> >>>> The rewrite isn't finished - it still needs Java unit tests and native >>>>> code for Apple and *nix. You can find more information on the mailing list: >>>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>>> >>>>>> Are there any show stoppers to using the rewrite instead of the >>>>>> current source branch? >>>>>> >>>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>>> >>>>>> There is no timeline to merge the two versions. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> Quoting Andre-John Mas: >>>>>>> >>>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>>> for? >>>>>>>> >>>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>>> >>>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>>> library is in Rewrite2010/src. >>>>>>>>> >>>>>>>>> -Adrian >>>>>>>>> >>>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>>> - src/ >>>>>>>>>> - Rewrite2010/src/ >>>>>>>>>> >>>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>>> we shouldn't be using around? >>>>>>>>>> >>>>>>>>>> Andre >>>>>>>>>> _______________________________________________ >>>>>>>>>> Rxtx mailing list >>>>>>>>>> Rxtx at qbang.org >>>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 28 05:36:14 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 28 Feb 2011 14:36:14 +0200 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> Message-ID: Sorry for top posting but I felt it was justified here to keep the whole context of the referred text intact. I very much agree with Uwe's point of view, ie doing as much as possible in Java, even the platform specific things, and doing the absolute minimum in C/C++. And this is not criticism Adrian's work/design. I would (again) advocate using JNA instead of JNI to access the native OS services/API from Java. This simplifies the live of the library users and developers a great deal because no C/C++ tool chain is involved. Zero. You don't even need a C compiler. There are some 'issues' in accessing some OS API functions from Java (like the need to use OS specific values in the Java code that are only available with #define in header files) but given the stability and longtime standing of the API functions we are talking about (open/close/select/read/write) I do not see this as big issue. A lot of the argumentation is included in this thread when this was last time rehashed on this list. http://answerpot.com/showthread.php?1022262-JNA%20alternative%20(was:%20rxt x%20moving%20from%20JNI%20to%20JNA%20(was%20%20About%20JRE%20crashes))/Page 1 If anyone is interested I can make the straw man implementation available. It compiles and has a fighting chance to work in a POSIX compatible OS (Mac OS X / Linux) with moderate debugging. Of course it is a long way from production, especially as throwing away the current rxtx also throws away most of the testing and debugging to the obscure/uncommon OSes that rxtx currently supports (I suggest anyone attempting to replace the current implementation has peek at the innards of the current implementation to see the variety it claims to support). (As an aside, and not really relevant to calling OS API from Java with JNA, I feel I need to mention that calling C++ using JNA is not easy because of the name mangling, so libraries with C interface are preferred with JNA). br Kusti On 2/28/11 13:52, "iqzw2r602 at sneakemail.com" wrote: >Hi Adrian, > >On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum >adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| >wrote: > > > > > > > > As far as I know, any Java library that manipulates hardware devices > is going to need native code. If the JRE contains classes that > already do that, then I'm unaware of them. In other words, I don't > know how one would accomplish "making OS calls" without native code. > > > > >Yes, you're right, you need native code to do that. The only question is >how much. I'm not saying that you wouldn't write native code. I'm just >saying you'll need very little. Take CreateFile() on Windows. Your >implementation calls it from C++ code, which implements logic all around >it. > >However, you can also call CreateFile() from Java code, and this is what >I'm proposing: Expose the CreateFile() function to Java as a static >native Java method, so it becomes directly callable from Java code (only >visible to implementation, not publicly). So while the code all around >the CreateFile() call is all Java (granted, it's platform specific, it >has to be), the 'public static native CreateFile()' method is implemented >in C++ - and all it does is to call the native CreateFile() function. > > > > > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few > willing to engage in it. I don't agree that Java code should contain > as much platform-specific code as possible. That might make things > easier for you, but it defeats the "write once, run anywhere" design > of Java. > > > > >"write once, run anywhere" (WORA) does apply for client code calling >RXTX. > >However, it doesn't mean that you can't or shouldn't write platform >specific code to /implement/ a library that's doing OS specific things; >in fact you have to: >CreateFile() only exists on Windows, open() only on Unix, etc., so you >have to write code specific to each platform that calls these functions >and handles their semantics. And in case you haven't noticed yet, the JDK >does the same thing, it has platform specific Java classes for lots of >things (try debugging the methods of java.io.File, or the parts of the >AWT, and see where they call into). > >The point of WORA is that client code - code that calls into RXTX - >should not have to deal with specifics of a platform. > > > > > I'm not sure what you mean by "fat native code" versus "slim native > code." > > > >Fat native libraries have methods like this, all written in C++: Lots of >pointers here, lots of things that could go wrong (but I'm not saying it >does, just showing the potential, think >threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: > >CommPort* CommPortFactory::getInstance(const char *portName, int portType) >{ >#ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); >#endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } >... >// SNIP! > >Fact is, you can write all of this in Java. You can even take the same >code, reword it a bit, and feed it into javac. So I won't quote this here >again and Java-ise it, just assume the above is Java code (BTW: you can >even do #ifdefs with statics). This Java code will have this import >statement at the top: > >import static Windows.*; > >In Windows.java would look like this (in fact it does, I've done this in >jpathwatch): > >static native long CreateFile(String fileName, int desiredAccess, int >shareMode, SECURITY_ATTRIBUTES securityAttributes, int >creationDisposition, int flagsAndAttributes, long templateFileHandle); > >And the code in Windows.cpp? That calls the native CreateFile() function. >And that's all (There's some special handling so GetLastError() works in >different threads and won't interfere with the JVM, but that's another >topic) > > > >The native code in the rewrite is the minimum necessary to > control the hardware - in fact, that is one of the rewrite's design > goals. The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I set > the bar pretty low, but I might be wrong. > > > > >See above; it can be even less. > >And since I keep saying I've done it, have a look at these files: >Windows.cpp >jpathwatch-native/src/Windows.cpp?revision=130&view=markup>[1], >Windows.java >jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&v >iew=markup>[2], WindowsPathWatchService.java >jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.jav >a?revision=130&view=markup>[3] > >Don't understand this as a criticism of your design, I actually quite >like it. All I am saying is that it doesn't need to be all native, and >that if you make the Dispatcher an abstract class like I proposed in my >previous email, implementors can choose which language they use (and yes, >I'd choose Java over C++; and I've written C++ code for more than 15 >years) > >Cheers, > >Uwe > >[1] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-native/src/Windows.cpp?revision=130&view=markup >[2] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&vi >ew=markup >[3] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java >?revision=130&view=markup > > > > > -Adrian > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > >Hi Adrian, > > I've followed the discussion about the rewrite over the past > months, and I'm sorry to hear interest in it hasn't picked up. > I've had a look at the source code yesterday, and it seems very > well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because > it currently only runs on Windows. I know from first hand > experience (jpathwatch) that it's quite hard to write robust > cross-platform Java libraries containing native code, and that > people might be hesitant to pick up development on something like > that. > > I was contemplating of toying around with the code base a couple > of times, but I'd rather write as much platform dependent code as > I can in Java (this might be a matter of preference, however, I > have found that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I > suggest that: > > * the Dispatcher Java class becomes abstract, without native > methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by > Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be > implemented almost entirely in Java. This way, every OS can > implement it's own dispatcher. > > This gives the implementor the option to choose whether to write > their implementation as a fat native library (like the one you > have implemented for Windows), or in Java with a slim native > library (which only wraps OS function calls). > In turn, it might make it more attractive for developers to jump > in and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian > Crum adrian.crum-at-sandglass-software.com > > |rxtx.org > mailing list/Example Allow| > wrote: > >Thank you for doing that. There hasn't > been much community interest in the rewrite, and I've been > busy since I started it. I hope to work on it some more in the > next month or two. > > > -Adrian > > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: >http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > > What could be useful is an entry in the wiki > documenting the mile-stones and what is left to be > done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > > The rewrite isn't finished - it still needs Java > unit tests and native code for Apple and *nix. You > can find more information on the mailing list: >http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, >adrian.crum at sandglass-software.com > wrote: > > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas: > > > What is the timeline to merge the two? Also, > what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > > The latest working source is in src, and a > recent rewrite of the library is in > Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: > > Hi, > > I am seeing two Java source folder in the > CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there > any need to keep the one we shouldn't be > using around? > > Andre >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > >http://mailman.qbang.org/mailman/listinfo/rxtx > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From adrian.crum at sandglass-software.com Mon Feb 28 08:15:18 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 07:15:18 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> Message-ID: <4D6BBC06.4090402@sandglass-software.com> Thank you for the suggestions - I will keep them in mind the next time I work on it. -Adrian On 2/28/2011 3:52 AM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > As far as I know, any Java library that manipulates hardware > devices is going to need native code. If the JRE contains classes > that already do that, then I'm unaware of them. In other words, I > don't know how one would accomplish "making OS calls" without > native code. > > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as a > static native Java method, so it becomes directly callable from Java > code (only visible to implementation, not publicly). So while the code > all around the CreateFile() call is all Java (granted, it's platform > specific, it has to be), the 'public static native CreateFile()' > method is implemented in C++ - and all it does is to call the native > CreateFile() function. > > > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there will > be few willing to engage in it. I don't agree that Java code > should contain as much platform-specific code as possible. That > might make things easier for you, but it defeats the "write once, > run anywhere" design of Java. > > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. > > > I'm not sure what you mean by "fat native code" versus "slim > native code." > > > Fat native libraries have methods like this, all written in C++: Lots > of pointers here, lots of things that could go wrong (but I'm not > saying it does, just showing the potential, think threading) - and I'm > a cheeky bastard here and quote from W32_Support.cpp: > > CommPort* CommPortFactory::getInstance(const char *portName, int portType) > { > #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); > #endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } > ... > // SNIP! > > Fact is, you can write all of this in Java. You can even take the same > code, reword it a bit, and feed it into javac. So I won't quote this > here again and Java-ise it, just assume the above is Java code (BTW: > you can even do #ifdefs with statics). This Java code will have this > import statement at the top: > > import static Windows.*; > > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > > static native long CreateFile(String fileName, int desiredAccess, int > shareMode, SECURITY_ATTRIBUTES securityAttributes, int > creationDisposition, int flagsAndAttributes, long templateFileHandle); > > And the code in Windows.cpp? That calls the native CreateFile() > function. And that's all (There's some special handling so > GetLastError() works in different threads and won't interfere with the > JVM, but that's another topic) > > The native code in the rewrite is the minimum necessary to control > the hardware - in fact, that is one of the rewrite's design goals. > The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I > set the bar pretty low, but I might be wrong. > > > See above; it can be even less. > > And since I keep saying I've done it, have a look at these files: > Windows.cpp > [1], > Windows.java > [2], > WindowsPathWatchService.java > [3] > > Don't understand this as a criticism of your design, I actually quite > like it. All I am saying is that it doesn't need to be all native, and > that if you make the Dispatcher an abstract class like I proposed in > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) > > Cheers, > > Uwe > > [1] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup > > [2] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup > > [3] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Feb 28 09:51:19 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 17:51:19 +0100 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <20110228165119.GD10695@elberon.bln.de.ingenico.com> * Andre-John Mas wrote on Fri, Feb 18, 2011 at 21:43 -0500: > Is anyone using JDK 1.4 or less? Yes, 1.4.2_11-b06 (j2sdk-1_4_2_11-fcs-linux-i586) in some cases (also similar versions: 1.4.2_15-b02, 1.4.2_16-b05, maybe others). > I am asking because I would be interested in bringing the code > up to Java 1.5 standards, with the use of generics and other > recent developments. Why that? oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Mon Feb 28 10:20:53 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 18:20:53 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6BBC06.4090402@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> Message-ID: <20110228172052.GE10695@elberon.bln.de.ingenico.com> * Adrian Crum wrote on Mon, Feb 28, 2011 at 07:15 -0800: [...] > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. I think in general it can be good to have an system-abstracting interface of the native code. That means, the native code implementation abstracts from the system (instead of implementing that abstractions in Java). Of course it is more complex :) IIRC we already had such a discussion here. > Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as > a static native Java method, so it becomes directly callable > from Java code (only visible to implementation, not publicly). > So while the code all around the CreateFile() call is all Java > (granted, it's platform specific, it has to be), the 'public > static native CreateFile()' method is implemented in C++ - and > all it does is to call the native CreateFile() function. I don't think I'd like this. CreateFile() is very system-specific. Exposing this to Java code makes this Java code system-specific. Although you could "run" it everywhere, it won't work anyware except on appropriate windows boxes. But this goes even further, you might consider calling open and select from Java and use it for serial ports on linux, but on another system that have both functions, they simply won't work (like on windows; there should be open and select, but AFAIK the latter cannot be expected to work on serial interfaces). Of course there is an somewhat strong argument, that is if the developer is much more experienced with Java than with C, it might be easier to implement this in Java, but personally I think it is hard to believe that developers who are able to correctly abstract device-I/O from system calls are not good at C, because I'm sure C is the language system by system programmers. > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there > will be few willing to engage in it. I don't agree that Java > code should contain as much platform-specific code as possible. > That might make things easier for you, but it defeats the > "write once, run anywhere" design of Java. Java runs on compliant JVMs only and nowhere else. It just happens that JVMs exist for most systems of a special set of computers such as PCs and small servers (but not neccesarily for embedded devices or main frames). As soon as a single native function is needed (required) for the application to work properly, the `run anywhere' is already impossible, because now it does not run on any JVM but only on JVMs that supply an implementation for this native code function. > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. Yes, exactly. Also, it is possible to write system-specific applications `with 100% Java' (for example, hardcode "C:\\Program Files" to be windows-specific or use "/dev/null" or so). Expecting a certain behavior not specified by Java (e.g. whether you can read "/dev/null", what CreateFile returns or whether select works on non-socket-filehandles) IMHO already misses the "write once, run anywhere" idea. So in summary I don't think the amount of platform-specific code matters much. It must be avaiable, requiring deployment etc, so little difference how many lines of code that were. [...] > import static Windows.*; > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > static native long CreateFile(String fileName, int desiredAccess, int [...] Someone here also proposed to use a general method to invoke arbitrary functions of shared libraries, JNA. By this, you wouldn't need `static NATIVE long CreateFile'; you could replace JNI by JNA here. Assuming that this native functionality would already be deployed on many target platform systems, implementing all the platform-specific code in Java can make sense, because this specific implementations would not require additional native code deployment. If, for example, the Java installation of Debian would by default already offer native library call execution, platform-specific code implemented in Java would work on Debian without needing any additional binary lib to be installed, I think could be quite an advantage. I think if having some Windows.java layer (which I personally would not like), JNA IMHO seems to be suited well. Personally, I prefere to define nice, simple and comfortable interfaces, also for native code (if possible, for JNI I think it always is a compromise). > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) Do you mean in general or also specifically for system programming? If someone would need a small program to let's say query DCD on linux I think a small C application would be suited best. Of course this topic also is more complex and depends on things. oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From msemtd at googlemail.com Mon Feb 28 13:50:42 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 28 Feb 2011 20:50:42 +0000 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172052.GE10695@elberon.bln.de.ingenico.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: This was discussed to death last year - summary: - * JNI is too hard * JNA is compelling * yay! let's start a rewrite Time passes... Current status: Windows-only and incomplete Back in non-vaporware land (this is meant in good humour BTW), the current RXTX platform-specifics are achieved with ports of POSIX termios.h[1]. It just works (mostly, kinda!) and you have to treat it nice and test it to death for _YOUR_ platform in _YOUR_ application but, y'know, that's what professional software engineers just do anyway. I seriously don't believe anyone will come up with anything better anytime soon. Regards, Michael Erskine. [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition From iqzw2r602 at sneakemail.com Mon Feb 28 15:01:20 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 09:01:20 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <6175-1298930480-518642@sneakemail.com> Good summary. This whole JNI/JNA/C++ thing only came up again because I tried to explain my motivations for my initial request. And I agree, let's not discuss this further, we've been there already. So let's get this discussion back on track: All I suggested is to separate the implementation of the Dispatcher Java class into a NativeDispatcher class and a Dispatcher interface, so people can implement the Dispatcher (Java-) interface with whatever Three-Letter-Abbreviation they want. So can people please comment on that? Cheers, Uwe On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 > Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 15:22:21 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 14:22:21 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <4D6C201D.6060103@sandglass-software.com> One of the issues I tried to address in the rewite is the "JNI is too hard" issue. Anyone with rudimentary C++ skills can implement the two virtual classes and two functions - no knowledge of JNI is necessary because Dispatcher.cpp takes care of all of the JNI data type marshalling/unmarshalling. I don't agree that the 2.x versions "just work" - the recurring bugs mentioned on this list and in other forums are evidence of that. I tried to work with the 2.x version by wrapping it in thread-safe classes, but even that didn't help. I tried to fix the most recent version by supplying patches, but the sum of the patches added up to a rewrite. So I created a rewrite instead. -Adrian On 2/28/2011 12:50 PM, Michael Erskine wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Mon Feb 28 16:24:00 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 15:24:00 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <6175-1298930480-518642@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> Message-ID: <4D6C2E90.9010601@sandglass-software.com> My question would be: Why would you do that? The rewrite does most of the work for you - all you have to do is implement two C++ virtual classes and two C++ functions. In Windows that took me a few hours. I can't imagine other ports taking much longer than that - especially since POSIX-based code can be shared between ports. What you're suggesting would require a great deal more effort than necessary. -Adrian On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to > explain my motivations for my initial request. And I agree, let's not > discuss this further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher > Java class into a NativeDispatcher class and a Dispatcher interface, > so people can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine > msemtd-at-googlemail.com |rxtx.org > mailing list/Example Allow| > <6zkk4zdpgt at sneakemail.com > wrote: > > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Mon Feb 28 17:26:18 2011 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Mon, 28 Feb 2011 17:26:18 -0700 Subject: [Rxtx] =?utf-8?q?Which_Java_folder_in_source=3F?= Message-ID: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 17:40:03 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 16:40:03 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> References: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> Message-ID: <4D6C4063.5060708@sandglass-software.com> Speaking of bugs one knows - was anyone interested in the bug fixing effort you proposed? -Adrian On 2/28/2011 4:26 PM, jfh at greenhousepc.com wrote: > Adrian, > > I have many dozens of clients using the RXTX jar on a wide variety of > Windows, Linux and a few MacOS X releases. Provided one does what the > previous poster suggested, the code really does "just work". > > Most of the problems that get reported are things that Windows > applications, and not a few Linux ones as well, have problems with > already. > > The other issue is that even with a boat load of testing, I have no > expectation to migrate to the re-write until 3Q12 at the absolute > earliest. > > I appreciate the effort you are putting into this re-write, but after > 32 years in this field (that's more years than many on this list are > alive), I've seen a lot of "re-writes". I've even done a few myself, > some better than others. > > That 32 years of software engineering experience has taught me one > vital lesson -- the bugs one knows are far less dangerous than the > bugs one doesn't know. And all re-writes are a minefield of unknown > bugs. For my products, it takes about 9 =months= before a release is > stable enough that I'm truly pleased with it. I'm still struggling > with bugs from new features I added in my 3Q10 release. I don't need > to struggle with the new bugs that are going to come from the > re-write. Not personal, just my 32 years of experience. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com > // greenHousePC on Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Which Java folder in source? > From: Adrian Crum > ; > Date: Mon, February 28, 2011 4:22 pm > To: rxtx at qbang.org > > One of the issues I tried to address in the rewite is the "JNI is too > hard" issue. Anyone with rudimentary C++ skills can implement the two > virtual classes and two functions - no knowledge of JNI is necessary > because Dispatcher.cpp takes care of all of the JNI data type > marshalling/unmarshalling. > > I don't agree that the 2.x versions "just work" - the recurring bugs > mentioned on this list and in other forums are evidence of that. I > tried > to work with the 2.x version by wrapping it in thread-safe > classes, but > even that didn't help. I tried to fix the most recent version by > supplying patches, but the sum of the patches added up to a > rewrite. So > I created a rewrite instead. > > -Adrian > > On 2/28/2011 12:50 PM, Michael Erskine wrote: > > This was discussed to death last year - summary: - > > * JNI is too hard > > * JNA is compelling > > * yay! let's start a rewrite > > > > Time passes... > > > > Current status: Windows-only and incomplete > > > > Back in non-vaporware land (this is meant in good humour BTW), the > > current RXTX platform-specifics are achieved with ports of POSIX > > termios.h[1]. > > > > It just works (mostly, kinda!) and you have to treat it nice and test > > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > > that's what professional software engineers just do anyway. I > > seriously don't believe anyone will come up with anything better > > anytime soon. > > > > Regards, > > Michael Erskine. > > > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From iqzw2r602 at sneakemail.com Mon Feb 28 18:59:48 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 12:59:48 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6C2E90.9010601@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> Message-ID: <13486-1298944789-675699@sneakemail.com> On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > My question would be: Why would you do that? > I'm thinking about the debugging effort, quite frankly. When I started off with jpathwatch, I initially wrote a fat native library. It got me into trouble: It was hard to debug, the JVM would crash every now and then, depending which bug it hit, and debugging a process with a JVM (even on Windows) is not fun. When I finally got it to work on Windows, I started doing Linux, and the same thing happened again - and I didn't find the tools as nice. When it started sucking up too much of my time I scrapped the whole thing, literally, and moved to a slim native library. I wrote the new implementation in a fraction of the time, and it rarely ever crashed (because except for the little C++ code to wrap OS functions there was nothing that could). So that's my reason to write things in Java mainly for a project like this. Others prefer C++. What I'm suggesting gives people a choice to use the tool they're most comfortable with (because this is really about people, not code; the code won't write and fix itself, people have to go in and do it) > The rewrite does most of the work for you - all you have to do is implement > two C++ virtual classes and two C++ functions. In Windows that took me a few > hours. I can't imagine other ports taking much longer than that - especially > since POSIX-based code can be shared between ports. > And that's fine for people who want to write a native code implementation. I'm not talking about scrapping that at all, quite the contrary - Windows and the C++ framework should stay as it is, it's quite a large contribution you've made in time and effort, it'd be stupid to abandon that. Even more so, other platforms could build on the C++ code you've written, as you intended. All this would provide is another option, so people can also implement a platform in Java with any TLA they want (don't want to mention technologies here, that'll start another flame war ;) > What you're suggesting would require a great deal more effort than > necessary. > No, I don't think so; it'd be a quite simple refactoring task: * Copy Dispatcher.java into NativeDispatcher.java and change constructor name. Make it derive from Dispatcher * Make all methods in the original Dispatcher.java abstract except for getInstance(). That method does System.getProperty("os.name") to decide which implementation to instantiate. On Windows (and other platforms that implement the C++ interface), it instantiates NativeDispatcher. On yet others, it would instantiate the MyOSNameHereDispatcher * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename corresponding C++ class I'd think this is about 3 hours of work. I'm even happy to have a shot at it, but I have no commit rights to CVS, and I certainly don't intend to make changes that other people don't like. Remember, this discussion stemmed from people being worried that the rewrite is Windows-only right now. So the goal is to get more supported platforms, and to get there you'll need people to contribute code. I think providing more options will attract more contributors. It would certainly make it more attractive for me. Cheers, Uwe > -Adrian > > > > On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to explain > my motivations for my initial request. And I agree, let's not discuss this > further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher Java > class into a NativeDispatcher class and a Dispatcher interface, so people > can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | > rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > >> This was discussed to death last year - summary: - >> * JNI is too hard >> * JNA is compelling >> * yay! let's start a rewrite >> >> Time passes... >> >> Current status: Windows-only and incomplete >> >> Back in non-vaporware land (this is meant in good humour BTW), the >> current RXTX platform-specifics are achieved with ports of POSIX >> termios.h[1]. >> >> It just works (mostly, kinda!) and you have to treat it nice and test >> it to death for _YOUR_ platform in _YOUR_ application but, y'know, >> that's what professional software engineers just do anyway. I >> seriously don't believe anyone will come up with anything better >> anytime soon. >> >> Regards, >> Michael Erskine. >> >> [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 >> Edition >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 19:32:12 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 18:32:12 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <13486-1298944789-675699@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> <13486-1298944789-675699@sneakemail.com> Message-ID: <4D6C5AAC.3070508@sandglass-software.com> Just to make sure I'm understanding you correctly, anyone porting RxTx to a new platform would have to do the following: 1. Write their own Java implementation of an abstract Dispatcher class. 2. Write a native (JNI or JNA) interface for the abstract class implementation. 3. Write all of the native (or non-native) code to implement the native interface. Is that correct? If yes, how is that easier than the simple implementation the current rewrite design uses? On a side note: there is no requirement to write native code using C++. If C++ is a real obstacle to adoption, then regular C could be used instead. In that case, there would be a Dispatcher.c file that contains function protoypes that need to be implemented. Dispatcher.c would still maintain the same role as Dispatcher.cpp - which is to shield native code developers from the details of JNI. Just build out the missing functions using C data types and you're ready to go. -Adrian On 2/28/2011 5:59 PM, iqzw2r602 at sneakemail.com wrote: > On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > What you're suggesting would require a great deal more effort than > necessary. > > > No, I don't think so; it'd be a quite simple refactoring task: > * Copy Dispatcher.java into NativeDispatcher.java and change > constructor name. Make it derive from Dispatcher > * Make all methods in the original Dispatcher.java abstract except for > getInstance(). That method does System.getProperty("os.name > ") to decide which implementation to instantiate. On > Windows (and other platforms that implement the C++ interface), it > instantiates NativeDispatcher. On yet others, it would instantiate the > MyOSNameHereDispatcher > * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename > corresponding C++ class > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From storrellas at bdigital.org Wed Feb 23 10:37:48 2011 From: storrellas at bdigital.org (Sergi Torrellas) Date: Wed, 23 Feb 2011 18:37:48 +0100 Subject: [Rxtx] Serial port description Message-ID: Hi all, I am using the library RXTX for connecting to a USB port that is mapped to a serial port. My question is the following is possible to get a longer description of the serial part a part from the COMX? Many thanks, -- *SERGI TORRELLAS SOCASTRO Desenvolupador R+D Salut M. 616.21.72.97** *storrellas at bdigital.org *BARCELONA DIGITAL CENTRE TECNOL?GIC* Roc Boronat 117, 5a planta, 08018 Barcelona Tel. +34 93 553 45 40 - Fax. +34 93 553 45 41 www.bdigital.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Wed Feb 23 21:46:30 2011 From: showard314 at gmail.com (Scott Howard) Date: Wed, 23 Feb 2011 23:46:30 -0500 Subject: [Rxtx] compiling rxtx on archs without sys/io.h Message-ID: Hello all, There is a bug at: http://bugzilla.qbang.org/show_bug.cgi?id=72 for fixing a build failure on PPCs. A similar build failure occurs on mips, ARM, sparc, and a few other architectures. You can work around it be using AC_CHECK_HEADERS and properly shielding #include . I uploaded a new patch to that bug which does that, and have compiled rxtx on those architectures. This will also work for future architectures and won't require manually updating the #ifdefs. If you do use this patch, you should also edit the individual Makefiles (like Makefile.mingw32) to properly #define or #undef HAVE_SYS_IO_H Regards, Scott From ajmas at sympatico.ca Fri Feb 25 09:03:34 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:03:34 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D613A6C.80304@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. On 20-Feb-2011, at 10:59, Adrian Crum wrote: > The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: >> Are there any show stoppers to using the rewrite instead of the current source branch? >> >> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >> >>> There is no timeline to merge the two versions. >>> >>> -Adrian >>> >>> Quoting Andre-John Mas: >>> >>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>> >>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>> >>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>> Hi, >>>>>> >>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>> - src/ >>>>>> - Rewrite2010/src/ >>>>>> >>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>> >>>>>> Andre >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 25 09:17:23 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:17:23 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > >> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >> >> -Adrian >> >> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>> Are there any show stoppers to using the rewrite instead of the current source branch? >>> >>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>> >>>> There is no timeline to merge the two versions. >>>> >>>> -Adrian >>>> >>>> Quoting Andre-John Mas: >>>> >>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>> >>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>> >>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>> - src/ >>>>>>> - Rewrite2010/src/ >>>>>>> >>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>> >>>>>>> Andre >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 26 18:58:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 26 Feb 2011 17:58:27 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: <4D69AFC3.50008@sandglass-software.com> Thank you for doing that. There hasn't been much community interest in the rewrite, and I've been busy since I started it. I hope to work on it some more in the next month or two. -Adrian On 2/25/2011 8:17 AM, Andre-John Mas wrote: > I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > >> What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. >> >> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >> >>> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>> >>> -Adrian >>> >>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> Are there any show stoppers to using the rewrite instead of the current source branch? >>>> >>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>> >>>>> There is no timeline to merge the two versions. >>>>> >>>>> -Adrian >>>>> >>>>> Quoting Andre-John Mas: >>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>>> >>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>> - src/ >>>>>>>> - Rewrite2010/src/ >>>>>>>> >>>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>>> >>>>>>>> Andre >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From iqzw2r602 at sneakemail.com Sun Feb 27 15:47:16 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 09:47:16 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D69AFC3.50008@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> Message-ID: <23853-1298846836-791608@sneakemail.com> Hi Adrian, I've followed the discussion about the rewrite over the past months, and I'm sorry to hear interest in it hasn't picked up. I've had a look at the source code yesterday, and it seems very well designed and nicely documented. IMHO one reason why it hasn't been fully embraced yet is because it currently only runs on Windows. I know from first hand experience (jpathwatch) that it's quite hard to write robust cross-platform Java libraries containing native code, and that people might be hesitant to pick up development on something like that. I was contemplating of toying around with the code base a couple of times, but I'd rather write as much platform dependent code as I can in Java (this might be a matter of preference, however, I have found that it made my life a hell of a lot easier). So to give people choice in how they implement their port, I suggest that: * the Dispatcher Java class becomes abstract, without native methods. * All Java and native code in the Dispatcher class moves to a new NativeDispatcher java/C++ class, which derives from Dispatcher. * The Dispatcher.getInstance() method chooses, per platform, which Dispatcher instance it's going to create. So on Windows and other platforms that like their dispatcher to be native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). On other platforms (say, on BSD based platforms), a different Dispatcher implementation is instantiated, which can be implemented almost entirely in Java. This way, every OS can implement it's own dispatcher. This gives the implementor the option to choose whether to write their implementation as a fat native library (like the one you have implemented for Windows), or in Java with a slim native library (which only wraps OS function calls). In turn, it might make it more attractive for developers to jump in and contribute implementations for other platforms. What do you think? Cheers, Uwe On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > Thank you for doing that. There hasn't been much community interest in the > rewrite, and I've been busy since I started it. I hope to work on it some > more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > >> I have added a stub page here: >> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >> >> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >> >> What could be useful is an entry in the wiki documenting the mile-stones >>> and what is left to be done. >>> >>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>> >>> The rewrite isn't finished - it still needs Java unit tests and native >>>> code for Apple and *nix. You can find more information on the mailing list: >>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>> >>>> -Adrian >>>> >>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> >>>>> Are there any show stoppers to using the rewrite instead of the current >>>>> source branch? >>>>> >>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>> >>>>> There is no timeline to merge the two versions. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> Quoting Andre-John Mas: >>>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>> for? >>>>>>> >>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>> library is in Rewrite2010/src. >>>>>>>> >>>>>>>> -Adrian >>>>>>>> >>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>> - src/ >>>>>>>>> - Rewrite2010/src/ >>>>>>>>> >>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>> we shouldn't be using around? >>>>>>>>> >>>>>>>>> Andre >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Sun Feb 27 16:26:56 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 27 Feb 2011 15:26:56 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <4D6ADDC0.1020608@sandglass-software.com> As far as I know, any Java library that manipulates hardware devices is going to need native code. If the JRE contains classes that already do that, then I'm unaware of them. In other words, I don't know how one would accomplish "making OS calls" without native code. I agree that developing a Java library that reads/writes serial and parallel hardware is not an easy task - therefore there will be few willing to engage in it. I don't agree that Java code should contain as much platform-specific code as possible. That might make things easier for you, but it defeats the "write once, run anywhere" design of Java. I'm not sure what you mean by "fat native code" versus "slim native code." The native code in the rewrite is the minimum necessary to control the hardware - in fact, that is one of the rewrite's design goals. The rewrite's design reduces native code development down to implementing two virtual classes and two functions. I thought I set the bar pretty low, but I might be wrong. -Adrian On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, > and I'm sorry to hear interest in it hasn't picked up. I've had a look > at the source code yesterday, and it seems very well designed and > nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick up development on something like that. > > I was contemplating of toying around with the code base a couple of > times, but I'd rather write as much platform dependent code as I can > in Java (this might be a matter of preference, however, I have found > that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be implemented > almost entirely in Java. This way, every OS can implement it's own > dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have > implemented for Windows), or in Java with a slim native library (which > only wraps OS function calls). > In turn, it might make it more attractive for developers to jump in > and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > Thank you for doing that. There hasn't been much community > interest in the rewrite, and I've been busy since I started it. I > hope to work on it some more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: > http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > What could be useful is an entry in the wiki documenting > the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > The rewrite isn't finished - it still needs Java unit > tests and native code for Apple and *nix. You can find > more information on the mailing list: > http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, > adrian.crum at sandglass-software.com > wrote: > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas >: > > What is the timeline to merge the two? > Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > The latest working source is in src, > and a recent rewrite of the library is > in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas > wrote: > > Hi, > > I am seeing two Java source folder > in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and > is there any need to keep the one > we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:28:56 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:28:56 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() Message-ID: Hi, I have a receive thread that does nothing but call read() on the serial port input stream. It works fine for a while but after running for a long time it eventually returns -1 which means EOF. This is my first problem, as the device I'm talking to runs forever, I don't know why it would return -1. I am calling disableReceiveThreshold() and disableReceiveTimeout() at initialization which according to the documentation means read will return as soon as any data is available and it will block forever when data is not available, so -1 should never be returned from read, right? I have been unable to figure out why read returns -1 after a long while but I have found that if I kill my application and restart it everything works fine again. Therefore I tried to work around the problem by having my code close the port and reopen it when read returns -1. My second problem is that in this case when I call close() on the port it blocks forever. I did find this old bug http://bugzilla.qbang.org/show_bug.cgi?id=53 which describes close() hanging on OSX, but it says that bug was fixed with a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any idea why read might be returning -1 in the first place? If I can avoid that I don't care about close() hanging because I would never close the port. If not, does anyone know why close() might block forever and how I can prevent this? I'm using RXTX version 2.1-7. Thanks, -- Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:34:04 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:34:04 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() In-Reply-To: References: Message-ID: I mis-spoke, I don't have my own thread calling read, I am calling read in the event handler after receiving a SerialPortEvent.DATA_AVAILABLE event. Everything else I said should be accurate though. Ryan On Mon, Feb 28, 2011 at 12:28 AM, Ryan Boder wrote: > Hi, > > I have a receive thread that does nothing but call read() on the serial > port input stream. It works fine for a while but after running for a long > time it eventually returns -1 which means EOF. This is my first problem, as > the device I'm talking to runs forever, I don't know why it would return -1. > I am calling disableReceiveThreshold() and disableReceiveTimeout() at > initialization which according to the documentation means read will return > as soon as any data is available and it will block forever when data is not > available, so -1 should never be returned from read, right? > > I have been unable to figure out why read returns -1 after a long while but > I have found that if I kill my application and restart it everything works > fine again. Therefore I tried to work around the problem by having my code > close the port and reopen it when read returns -1. My second problem is that > in this case when I call close() on the port it blocks forever. I did find > this old bug > > http://bugzilla.qbang.org/show_bug.cgi?id=53 > > which describes close() hanging on OSX, but it says that bug was fixed with > a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any > idea why read might be returning -1 in the first place? If I can avoid that > I don't care about close() hanging because I would never close the port. If > not, does anyone know why close() might block forever and how I can prevent > this? I'm using RXTX version 2.1-7. > > Thanks, > -- > Ryan > > -- Ryan Boder 1 614 598-6339 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.w.janssen at lxtreme.nl Mon Feb 28 04:09:50 2011 From: j.w.janssen at lxtreme.nl (Jan Willem Janssen) Date: Mon, 28 Feb 2011 12:09:50 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <123a513d85e4569df1ebce58088e6592.squirrel@lxtreme.homelinux.org> FWIW: I'm also interested in the 2010-rewrite, but was waiting until a bit more code was available for other platforms, like Linux and/or OSX. I'd like to offer my help if needed, for example to test stuff. Regards, Jan Willem On Sun, February 27, 2011 23:47, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm > sorry to hear interest in it hasn't picked up. I've had a look at the > source > code yesterday, and it seems very well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java > (this > might be a matter of preference, however, I have found that it made my > life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a > NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely > in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. From iqzw2r602 at sneakemail.com Mon Feb 28 04:52:33 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 22:52:33 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6ADDC0.1020608@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> Message-ID: <15854-1298893954-139343@sneakemail.com> Hi Adrian, On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > As far as I know, any Java library that manipulates hardware devices is > going to need native code. If the JRE contains classes that already do that, > then I'm unaware of them. In other words, I don't know how one would > accomplish "making OS calls" without native code. > Yes, you're right, you need native code to do that. The only question is how much. I'm not saying that you wouldn't write native code. I'm just saying you'll need very little. Take CreateFile() on Windows. Your implementation calls it from C++ code, which implements logic all around it. However, you can also call CreateFile() from Java code, and this is what I'm proposing: Expose the CreateFile() function to Java as a static native Java method, so it becomes directly callable from Java code (only visible to implementation, not publicly). So while the code all around the CreateFile() call is all Java (granted, it's platform specific, it has to be), the 'public static native CreateFile()' method is implemented in C++ - and all it does is to call the native CreateFile() function. > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few willing > to engage in it. I don't agree that Java code should contain as much > platform-specific code as possible. That might make things easier for you, > but it defeats the "write once, run anywhere" design of Java. > "write once, run anywhere" (WORA) does apply for client code calling RXTX. However, it doesn't mean that you can't or shouldn't write platform specific code to /implement/ a library that's doing OS specific things; in fact you have to: CreateFile() only exists on Windows, open() only on Unix, etc., so you have to write code specific to each platform that calls these functions and handles their semantics. And in case you haven't noticed yet, the JDK does the same thing, it has platform specific Java classes for lots of things (try debugging the methods of java.io.File, or the parts of the AWT, and see where they call into). The point of WORA is that client code - code that calls into RXTX - should not have to deal with specifics of a platform. > I'm not sure what you mean by "fat native code" versus "slim native code." > Fat native libraries have methods like this, all written in C++: Lots of pointers here, lots of things that could go wrong (but I'm not saying it does, just showing the potential, think threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: CommPort* CommPortFactory::getInstance(const char *portName, int portType) { #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS if (strcmp("PARALLEL_PASS", portName) == 0) return new ParallelLoopback(portName); if (strcmp("SERIAL_PASS", portName) == 0) return new SerialLoopback(portName); #endif // Do not open overlapped. Let the Java application // handle multi-threaded I/O. HANDLE hComm = CreateFile( portName, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); if (hComm == INVALID_HANDLE_VALUE) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); printf("%s\n", lpMsgBuf); delete lpMsgBuf; throw IOException(); } .... // SNIP! Fact is, you can write all of this in Java. You can even take the same code, reword it a bit, and feed it into javac. So I won't quote this here again and Java-ise it, just assume the above is Java code (BTW: you can even do #ifdefs with statics). This Java code will have this import statement at the top: import static Windows.*; In Windows.java would look like this (in fact it does, I've done this in jpathwatch): static native long CreateFile(String fileName, int desiredAccess, int shareMode, SECURITY_ATTRIBUTES securityAttributes, int creationDisposition, int flagsAndAttributes, long templateFileHandle); And the code in Windows.cpp? That calls the native CreateFile() function. And that's all (There's some special handling so GetLastError() works in different threads and won't interfere with the JVM, but that's another topic) The native code in the rewrite is the minimum necessary to control the > hardware - in fact, that is one of the rewrite's design goals. The rewrite's > design reduces native code development down to implementing two virtual > classes and two functions. I thought I set the bar pretty low, but I might > be wrong. > See above; it can be even less. And since I keep saying I've done it, have a look at these files: Windows.cpp[1], Windows.java[2], WindowsPathWatchService.java [3] Don't understand this as a criticism of your design, I actually quite like it. All I am saying is that it doesn't need to be all native, and that if you make the Dispatcher an abstract class like I proposed in my previous email, implementors can choose which language they use (and yes, I'd choose Java over C++; and I've written C++ code for more than 15 years) Cheers, Uwe [1] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup [2] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup [3] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > -Adrian > > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm sorry to hear interest in it hasn't picked up. I've had a look at the > source code yesterday, and it seems very well designed and nicely > documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java (this > might be a matter of preference, however, I have found that it made my life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example > Allow| wrote: > >> Thank you for doing that. There hasn't been much community interest in the >> rewrite, and I've been busy since I started it. I hope to work on it some >> more in the next month or two. >> >> -Adrian >> >> >> On 2/25/2011 8:17 AM, Andre-John Mas wrote: >> >>> I have added a stub page here: >>> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >>> >>> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >>> >>> What could be useful is an entry in the wiki documenting the mile-stones >>>> and what is left to be done. >>>> >>>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>>> >>>> The rewrite isn't finished - it still needs Java unit tests and native >>>>> code for Apple and *nix. You can find more information on the mailing list: >>>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>>> >>>>>> Are there any show stoppers to using the rewrite instead of the >>>>>> current source branch? >>>>>> >>>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>>> >>>>>> There is no timeline to merge the two versions. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> Quoting Andre-John Mas: >>>>>>> >>>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>>> for? >>>>>>>> >>>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>>> >>>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>>> library is in Rewrite2010/src. >>>>>>>>> >>>>>>>>> -Adrian >>>>>>>>> >>>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>>> - src/ >>>>>>>>>> - Rewrite2010/src/ >>>>>>>>>> >>>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>>> we shouldn't be using around? >>>>>>>>>> >>>>>>>>>> Andre >>>>>>>>>> _______________________________________________ >>>>>>>>>> Rxtx mailing list >>>>>>>>>> Rxtx at qbang.org >>>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 28 05:36:14 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 28 Feb 2011 14:36:14 +0200 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> Message-ID: Sorry for top posting but I felt it was justified here to keep the whole context of the referred text intact. I very much agree with Uwe's point of view, ie doing as much as possible in Java, even the platform specific things, and doing the absolute minimum in C/C++. And this is not criticism Adrian's work/design. I would (again) advocate using JNA instead of JNI to access the native OS services/API from Java. This simplifies the live of the library users and developers a great deal because no C/C++ tool chain is involved. Zero. You don't even need a C compiler. There are some 'issues' in accessing some OS API functions from Java (like the need to use OS specific values in the Java code that are only available with #define in header files) but given the stability and longtime standing of the API functions we are talking about (open/close/select/read/write) I do not see this as big issue. A lot of the argumentation is included in this thread when this was last time rehashed on this list. http://answerpot.com/showthread.php?1022262-JNA%20alternative%20(was:%20rxt x%20moving%20from%20JNI%20to%20JNA%20(was%20%20About%20JRE%20crashes))/Page 1 If anyone is interested I can make the straw man implementation available. It compiles and has a fighting chance to work in a POSIX compatible OS (Mac OS X / Linux) with moderate debugging. Of course it is a long way from production, especially as throwing away the current rxtx also throws away most of the testing and debugging to the obscure/uncommon OSes that rxtx currently supports (I suggest anyone attempting to replace the current implementation has peek at the innards of the current implementation to see the variety it claims to support). (As an aside, and not really relevant to calling OS API from Java with JNA, I feel I need to mention that calling C++ using JNA is not easy because of the name mangling, so libraries with C interface are preferred with JNA). br Kusti On 2/28/11 13:52, "iqzw2r602 at sneakemail.com" wrote: >Hi Adrian, > >On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum >adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| >wrote: > > > > > > > > As far as I know, any Java library that manipulates hardware devices > is going to need native code. If the JRE contains classes that > already do that, then I'm unaware of them. In other words, I don't > know how one would accomplish "making OS calls" without native code. > > > > >Yes, you're right, you need native code to do that. The only question is >how much. I'm not saying that you wouldn't write native code. I'm just >saying you'll need very little. Take CreateFile() on Windows. Your >implementation calls it from C++ code, which implements logic all around >it. > >However, you can also call CreateFile() from Java code, and this is what >I'm proposing: Expose the CreateFile() function to Java as a static >native Java method, so it becomes directly callable from Java code (only >visible to implementation, not publicly). So while the code all around >the CreateFile() call is all Java (granted, it's platform specific, it >has to be), the 'public static native CreateFile()' method is implemented >in C++ - and all it does is to call the native CreateFile() function. > > > > > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few > willing to engage in it. I don't agree that Java code should contain > as much platform-specific code as possible. That might make things > easier for you, but it defeats the "write once, run anywhere" design > of Java. > > > > >"write once, run anywhere" (WORA) does apply for client code calling >RXTX. > >However, it doesn't mean that you can't or shouldn't write platform >specific code to /implement/ a library that's doing OS specific things; >in fact you have to: >CreateFile() only exists on Windows, open() only on Unix, etc., so you >have to write code specific to each platform that calls these functions >and handles their semantics. And in case you haven't noticed yet, the JDK >does the same thing, it has platform specific Java classes for lots of >things (try debugging the methods of java.io.File, or the parts of the >AWT, and see where they call into). > >The point of WORA is that client code - code that calls into RXTX - >should not have to deal with specifics of a platform. > > > > > I'm not sure what you mean by "fat native code" versus "slim native > code." > > > >Fat native libraries have methods like this, all written in C++: Lots of >pointers here, lots of things that could go wrong (but I'm not saying it >does, just showing the potential, think >threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: > >CommPort* CommPortFactory::getInstance(const char *portName, int portType) >{ >#ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); >#endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } >... >// SNIP! > >Fact is, you can write all of this in Java. You can even take the same >code, reword it a bit, and feed it into javac. So I won't quote this here >again and Java-ise it, just assume the above is Java code (BTW: you can >even do #ifdefs with statics). This Java code will have this import >statement at the top: > >import static Windows.*; > >In Windows.java would look like this (in fact it does, I've done this in >jpathwatch): > >static native long CreateFile(String fileName, int desiredAccess, int >shareMode, SECURITY_ATTRIBUTES securityAttributes, int >creationDisposition, int flagsAndAttributes, long templateFileHandle); > >And the code in Windows.cpp? That calls the native CreateFile() function. >And that's all (There's some special handling so GetLastError() works in >different threads and won't interfere with the JVM, but that's another >topic) > > > >The native code in the rewrite is the minimum necessary to > control the hardware - in fact, that is one of the rewrite's design > goals. The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I set > the bar pretty low, but I might be wrong. > > > > >See above; it can be even less. > >And since I keep saying I've done it, have a look at these files: >Windows.cpp >jpathwatch-native/src/Windows.cpp?revision=130&view=markup>[1], >Windows.java >jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&v >iew=markup>[2], WindowsPathWatchService.java >jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.jav >a?revision=130&view=markup>[3] > >Don't understand this as a criticism of your design, I actually quite >like it. All I am saying is that it doesn't need to be all native, and >that if you make the Dispatcher an abstract class like I proposed in my >previous email, implementors can choose which language they use (and yes, >I'd choose Java over C++; and I've written C++ code for more than 15 >years) > >Cheers, > >Uwe > >[1] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-native/src/Windows.cpp?revision=130&view=markup >[2] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&vi >ew=markup >[3] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java >?revision=130&view=markup > > > > > -Adrian > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > >Hi Adrian, > > I've followed the discussion about the rewrite over the past > months, and I'm sorry to hear interest in it hasn't picked up. > I've had a look at the source code yesterday, and it seems very > well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because > it currently only runs on Windows. I know from first hand > experience (jpathwatch) that it's quite hard to write robust > cross-platform Java libraries containing native code, and that > people might be hesitant to pick up development on something like > that. > > I was contemplating of toying around with the code base a couple > of times, but I'd rather write as much platform dependent code as > I can in Java (this might be a matter of preference, however, I > have found that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I > suggest that: > > * the Dispatcher Java class becomes abstract, without native > methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by > Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be > implemented almost entirely in Java. This way, every OS can > implement it's own dispatcher. > > This gives the implementor the option to choose whether to write > their implementation as a fat native library (like the one you > have implemented for Windows), or in Java with a slim native > library (which only wraps OS function calls). > In turn, it might make it more attractive for developers to jump > in and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian > Crum adrian.crum-at-sandglass-software.com > > |rxtx.org > mailing list/Example Allow| > wrote: > >Thank you for doing that. There hasn't > been much community interest in the rewrite, and I've been > busy since I started it. I hope to work on it some more in the > next month or two. > > > -Adrian > > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: >http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > > What could be useful is an entry in the wiki > documenting the mile-stones and what is left to be > done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > > The rewrite isn't finished - it still needs Java > unit tests and native code for Apple and *nix. You > can find more information on the mailing list: >http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, >adrian.crum at sandglass-software.com > wrote: > > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas: > > > What is the timeline to merge the two? Also, > what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > > The latest working source is in src, and a > recent rewrite of the library is in > Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: > > Hi, > > I am seeing two Java source folder in the > CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there > any need to keep the one we shouldn't be > using around? > > Andre >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > >http://mailman.qbang.org/mailman/listinfo/rxtx > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From adrian.crum at sandglass-software.com Mon Feb 28 08:15:18 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 07:15:18 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> Message-ID: <4D6BBC06.4090402@sandglass-software.com> Thank you for the suggestions - I will keep them in mind the next time I work on it. -Adrian On 2/28/2011 3:52 AM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > As far as I know, any Java library that manipulates hardware > devices is going to need native code. If the JRE contains classes > that already do that, then I'm unaware of them. In other words, I > don't know how one would accomplish "making OS calls" without > native code. > > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as a > static native Java method, so it becomes directly callable from Java > code (only visible to implementation, not publicly). So while the code > all around the CreateFile() call is all Java (granted, it's platform > specific, it has to be), the 'public static native CreateFile()' > method is implemented in C++ - and all it does is to call the native > CreateFile() function. > > > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there will > be few willing to engage in it. I don't agree that Java code > should contain as much platform-specific code as possible. That > might make things easier for you, but it defeats the "write once, > run anywhere" design of Java. > > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. > > > I'm not sure what you mean by "fat native code" versus "slim > native code." > > > Fat native libraries have methods like this, all written in C++: Lots > of pointers here, lots of things that could go wrong (but I'm not > saying it does, just showing the potential, think threading) - and I'm > a cheeky bastard here and quote from W32_Support.cpp: > > CommPort* CommPortFactory::getInstance(const char *portName, int portType) > { > #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); > #endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } > ... > // SNIP! > > Fact is, you can write all of this in Java. You can even take the same > code, reword it a bit, and feed it into javac. So I won't quote this > here again and Java-ise it, just assume the above is Java code (BTW: > you can even do #ifdefs with statics). This Java code will have this > import statement at the top: > > import static Windows.*; > > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > > static native long CreateFile(String fileName, int desiredAccess, int > shareMode, SECURITY_ATTRIBUTES securityAttributes, int > creationDisposition, int flagsAndAttributes, long templateFileHandle); > > And the code in Windows.cpp? That calls the native CreateFile() > function. And that's all (There's some special handling so > GetLastError() works in different threads and won't interfere with the > JVM, but that's another topic) > > The native code in the rewrite is the minimum necessary to control > the hardware - in fact, that is one of the rewrite's design goals. > The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I > set the bar pretty low, but I might be wrong. > > > See above; it can be even less. > > And since I keep saying I've done it, have a look at these files: > Windows.cpp > [1], > Windows.java > [2], > WindowsPathWatchService.java > [3] > > Don't understand this as a criticism of your design, I actually quite > like it. All I am saying is that it doesn't need to be all native, and > that if you make the Dispatcher an abstract class like I proposed in > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) > > Cheers, > > Uwe > > [1] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup > > [2] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup > > [3] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Feb 28 09:51:19 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 17:51:19 +0100 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <20110228165119.GD10695@elberon.bln.de.ingenico.com> * Andre-John Mas wrote on Fri, Feb 18, 2011 at 21:43 -0500: > Is anyone using JDK 1.4 or less? Yes, 1.4.2_11-b06 (j2sdk-1_4_2_11-fcs-linux-i586) in some cases (also similar versions: 1.4.2_15-b02, 1.4.2_16-b05, maybe others). > I am asking because I would be interested in bringing the code > up to Java 1.5 standards, with the use of generics and other > recent developments. Why that? oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Mon Feb 28 10:20:53 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 18:20:53 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6BBC06.4090402@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> Message-ID: <20110228172052.GE10695@elberon.bln.de.ingenico.com> * Adrian Crum wrote on Mon, Feb 28, 2011 at 07:15 -0800: [...] > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. I think in general it can be good to have an system-abstracting interface of the native code. That means, the native code implementation abstracts from the system (instead of implementing that abstractions in Java). Of course it is more complex :) IIRC we already had such a discussion here. > Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as > a static native Java method, so it becomes directly callable > from Java code (only visible to implementation, not publicly). > So while the code all around the CreateFile() call is all Java > (granted, it's platform specific, it has to be), the 'public > static native CreateFile()' method is implemented in C++ - and > all it does is to call the native CreateFile() function. I don't think I'd like this. CreateFile() is very system-specific. Exposing this to Java code makes this Java code system-specific. Although you could "run" it everywhere, it won't work anyware except on appropriate windows boxes. But this goes even further, you might consider calling open and select from Java and use it for serial ports on linux, but on another system that have both functions, they simply won't work (like on windows; there should be open and select, but AFAIK the latter cannot be expected to work on serial interfaces). Of course there is an somewhat strong argument, that is if the developer is much more experienced with Java than with C, it might be easier to implement this in Java, but personally I think it is hard to believe that developers who are able to correctly abstract device-I/O from system calls are not good at C, because I'm sure C is the language system by system programmers. > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there > will be few willing to engage in it. I don't agree that Java > code should contain as much platform-specific code as possible. > That might make things easier for you, but it defeats the > "write once, run anywhere" design of Java. Java runs on compliant JVMs only and nowhere else. It just happens that JVMs exist for most systems of a special set of computers such as PCs and small servers (but not neccesarily for embedded devices or main frames). As soon as a single native function is needed (required) for the application to work properly, the `run anywhere' is already impossible, because now it does not run on any JVM but only on JVMs that supply an implementation for this native code function. > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. Yes, exactly. Also, it is possible to write system-specific applications `with 100% Java' (for example, hardcode "C:\\Program Files" to be windows-specific or use "/dev/null" or so). Expecting a certain behavior not specified by Java (e.g. whether you can read "/dev/null", what CreateFile returns or whether select works on non-socket-filehandles) IMHO already misses the "write once, run anywhere" idea. So in summary I don't think the amount of platform-specific code matters much. It must be avaiable, requiring deployment etc, so little difference how many lines of code that were. [...] > import static Windows.*; > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > static native long CreateFile(String fileName, int desiredAccess, int [...] Someone here also proposed to use a general method to invoke arbitrary functions of shared libraries, JNA. By this, you wouldn't need `static NATIVE long CreateFile'; you could replace JNI by JNA here. Assuming that this native functionality would already be deployed on many target platform systems, implementing all the platform-specific code in Java can make sense, because this specific implementations would not require additional native code deployment. If, for example, the Java installation of Debian would by default already offer native library call execution, platform-specific code implemented in Java would work on Debian without needing any additional binary lib to be installed, I think could be quite an advantage. I think if having some Windows.java layer (which I personally would not like), JNA IMHO seems to be suited well. Personally, I prefere to define nice, simple and comfortable interfaces, also for native code (if possible, for JNI I think it always is a compromise). > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) Do you mean in general or also specifically for system programming? If someone would need a small program to let's say query DCD on linux I think a small C application would be suited best. Of course this topic also is more complex and depends on things. oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From msemtd at googlemail.com Mon Feb 28 13:50:42 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 28 Feb 2011 20:50:42 +0000 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172052.GE10695@elberon.bln.de.ingenico.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: This was discussed to death last year - summary: - * JNI is too hard * JNA is compelling * yay! let's start a rewrite Time passes... Current status: Windows-only and incomplete Back in non-vaporware land (this is meant in good humour BTW), the current RXTX platform-specifics are achieved with ports of POSIX termios.h[1]. It just works (mostly, kinda!) and you have to treat it nice and test it to death for _YOUR_ platform in _YOUR_ application but, y'know, that's what professional software engineers just do anyway. I seriously don't believe anyone will come up with anything better anytime soon. Regards, Michael Erskine. [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition From iqzw2r602 at sneakemail.com Mon Feb 28 15:01:20 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 09:01:20 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <6175-1298930480-518642@sneakemail.com> Good summary. This whole JNI/JNA/C++ thing only came up again because I tried to explain my motivations for my initial request. And I agree, let's not discuss this further, we've been there already. So let's get this discussion back on track: All I suggested is to separate the implementation of the Dispatcher Java class into a NativeDispatcher class and a Dispatcher interface, so people can implement the Dispatcher (Java-) interface with whatever Three-Letter-Abbreviation they want. So can people please comment on that? Cheers, Uwe On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 > Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 15:22:21 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 14:22:21 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <4D6C201D.6060103@sandglass-software.com> One of the issues I tried to address in the rewite is the "JNI is too hard" issue. Anyone with rudimentary C++ skills can implement the two virtual classes and two functions - no knowledge of JNI is necessary because Dispatcher.cpp takes care of all of the JNI data type marshalling/unmarshalling. I don't agree that the 2.x versions "just work" - the recurring bugs mentioned on this list and in other forums are evidence of that. I tried to work with the 2.x version by wrapping it in thread-safe classes, but even that didn't help. I tried to fix the most recent version by supplying patches, but the sum of the patches added up to a rewrite. So I created a rewrite instead. -Adrian On 2/28/2011 12:50 PM, Michael Erskine wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Mon Feb 28 16:24:00 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 15:24:00 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <6175-1298930480-518642@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> Message-ID: <4D6C2E90.9010601@sandglass-software.com> My question would be: Why would you do that? The rewrite does most of the work for you - all you have to do is implement two C++ virtual classes and two C++ functions. In Windows that took me a few hours. I can't imagine other ports taking much longer than that - especially since POSIX-based code can be shared between ports. What you're suggesting would require a great deal more effort than necessary. -Adrian On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to > explain my motivations for my initial request. And I agree, let's not > discuss this further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher > Java class into a NativeDispatcher class and a Dispatcher interface, > so people can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine > msemtd-at-googlemail.com |rxtx.org > mailing list/Example Allow| > <6zkk4zdpgt at sneakemail.com > wrote: > > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Mon Feb 28 17:26:18 2011 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Mon, 28 Feb 2011 17:26:18 -0700 Subject: [Rxtx] =?utf-8?q?Which_Java_folder_in_source=3F?= Message-ID: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 17:40:03 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 16:40:03 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> References: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> Message-ID: <4D6C4063.5060708@sandglass-software.com> Speaking of bugs one knows - was anyone interested in the bug fixing effort you proposed? -Adrian On 2/28/2011 4:26 PM, jfh at greenhousepc.com wrote: > Adrian, > > I have many dozens of clients using the RXTX jar on a wide variety of > Windows, Linux and a few MacOS X releases. Provided one does what the > previous poster suggested, the code really does "just work". > > Most of the problems that get reported are things that Windows > applications, and not a few Linux ones as well, have problems with > already. > > The other issue is that even with a boat load of testing, I have no > expectation to migrate to the re-write until 3Q12 at the absolute > earliest. > > I appreciate the effort you are putting into this re-write, but after > 32 years in this field (that's more years than many on this list are > alive), I've seen a lot of "re-writes". I've even done a few myself, > some better than others. > > That 32 years of software engineering experience has taught me one > vital lesson -- the bugs one knows are far less dangerous than the > bugs one doesn't know. And all re-writes are a minefield of unknown > bugs. For my products, it takes about 9 =months= before a release is > stable enough that I'm truly pleased with it. I'm still struggling > with bugs from new features I added in my 3Q10 release. I don't need > to struggle with the new bugs that are going to come from the > re-write. Not personal, just my 32 years of experience. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com > // greenHousePC on Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Which Java folder in source? > From: Adrian Crum > ; > Date: Mon, February 28, 2011 4:22 pm > To: rxtx at qbang.org > > One of the issues I tried to address in the rewite is the "JNI is too > hard" issue. Anyone with rudimentary C++ skills can implement the two > virtual classes and two functions - no knowledge of JNI is necessary > because Dispatcher.cpp takes care of all of the JNI data type > marshalling/unmarshalling. > > I don't agree that the 2.x versions "just work" - the recurring bugs > mentioned on this list and in other forums are evidence of that. I > tried > to work with the 2.x version by wrapping it in thread-safe > classes, but > even that didn't help. I tried to fix the most recent version by > supplying patches, but the sum of the patches added up to a > rewrite. So > I created a rewrite instead. > > -Adrian > > On 2/28/2011 12:50 PM, Michael Erskine wrote: > > This was discussed to death last year - summary: - > > * JNI is too hard > > * JNA is compelling > > * yay! let's start a rewrite > > > > Time passes... > > > > Current status: Windows-only and incomplete > > > > Back in non-vaporware land (this is meant in good humour BTW), the > > current RXTX platform-specifics are achieved with ports of POSIX > > termios.h[1]. > > > > It just works (mostly, kinda!) and you have to treat it nice and test > > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > > that's what professional software engineers just do anyway. I > > seriously don't believe anyone will come up with anything better > > anytime soon. > > > > Regards, > > Michael Erskine. > > > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From iqzw2r602 at sneakemail.com Mon Feb 28 18:59:48 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 12:59:48 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6C2E90.9010601@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> Message-ID: <13486-1298944789-675699@sneakemail.com> On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > My question would be: Why would you do that? > I'm thinking about the debugging effort, quite frankly. When I started off with jpathwatch, I initially wrote a fat native library. It got me into trouble: It was hard to debug, the JVM would crash every now and then, depending which bug it hit, and debugging a process with a JVM (even on Windows) is not fun. When I finally got it to work on Windows, I started doing Linux, and the same thing happened again - and I didn't find the tools as nice. When it started sucking up too much of my time I scrapped the whole thing, literally, and moved to a slim native library. I wrote the new implementation in a fraction of the time, and it rarely ever crashed (because except for the little C++ code to wrap OS functions there was nothing that could). So that's my reason to write things in Java mainly for a project like this. Others prefer C++. What I'm suggesting gives people a choice to use the tool they're most comfortable with (because this is really about people, not code; the code won't write and fix itself, people have to go in and do it) > The rewrite does most of the work for you - all you have to do is implement > two C++ virtual classes and two C++ functions. In Windows that took me a few > hours. I can't imagine other ports taking much longer than that - especially > since POSIX-based code can be shared between ports. > And that's fine for people who want to write a native code implementation. I'm not talking about scrapping that at all, quite the contrary - Windows and the C++ framework should stay as it is, it's quite a large contribution you've made in time and effort, it'd be stupid to abandon that. Even more so, other platforms could build on the C++ code you've written, as you intended. All this would provide is another option, so people can also implement a platform in Java with any TLA they want (don't want to mention technologies here, that'll start another flame war ;) > What you're suggesting would require a great deal more effort than > necessary. > No, I don't think so; it'd be a quite simple refactoring task: * Copy Dispatcher.java into NativeDispatcher.java and change constructor name. Make it derive from Dispatcher * Make all methods in the original Dispatcher.java abstract except for getInstance(). That method does System.getProperty("os.name") to decide which implementation to instantiate. On Windows (and other platforms that implement the C++ interface), it instantiates NativeDispatcher. On yet others, it would instantiate the MyOSNameHereDispatcher * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename corresponding C++ class I'd think this is about 3 hours of work. I'm even happy to have a shot at it, but I have no commit rights to CVS, and I certainly don't intend to make changes that other people don't like. Remember, this discussion stemmed from people being worried that the rewrite is Windows-only right now. So the goal is to get more supported platforms, and to get there you'll need people to contribute code. I think providing more options will attract more contributors. It would certainly make it more attractive for me. Cheers, Uwe > -Adrian > > > > On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to explain > my motivations for my initial request. And I agree, let's not discuss this > further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher Java > class into a NativeDispatcher class and a Dispatcher interface, so people > can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | > rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > >> This was discussed to death last year - summary: - >> * JNI is too hard >> * JNA is compelling >> * yay! let's start a rewrite >> >> Time passes... >> >> Current status: Windows-only and incomplete >> >> Back in non-vaporware land (this is meant in good humour BTW), the >> current RXTX platform-specifics are achieved with ports of POSIX >> termios.h[1]. >> >> It just works (mostly, kinda!) and you have to treat it nice and test >> it to death for _YOUR_ platform in _YOUR_ application but, y'know, >> that's what professional software engineers just do anyway. I >> seriously don't believe anyone will come up with anything better >> anytime soon. >> >> Regards, >> Michael Erskine. >> >> [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 >> Edition >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 19:32:12 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 18:32:12 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <13486-1298944789-675699@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> <13486-1298944789-675699@sneakemail.com> Message-ID: <4D6C5AAC.3070508@sandglass-software.com> Just to make sure I'm understanding you correctly, anyone porting RxTx to a new platform would have to do the following: 1. Write their own Java implementation of an abstract Dispatcher class. 2. Write a native (JNI or JNA) interface for the abstract class implementation. 3. Write all of the native (or non-native) code to implement the native interface. Is that correct? If yes, how is that easier than the simple implementation the current rewrite design uses? On a side note: there is no requirement to write native code using C++. If C++ is a real obstacle to adoption, then regular C could be used instead. In that case, there would be a Dispatcher.c file that contains function protoypes that need to be implemented. Dispatcher.c would still maintain the same role as Dispatcher.cpp - which is to shield native code developers from the details of JNI. Just build out the missing functions using C data types and you're ready to go. -Adrian On 2/28/2011 5:59 PM, iqzw2r602 at sneakemail.com wrote: > On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > What you're suggesting would require a great deal more effort than > necessary. > > > No, I don't think so; it'd be a quite simple refactoring task: > * Copy Dispatcher.java into NativeDispatcher.java and change > constructor name. Make it derive from Dispatcher > * Make all methods in the original Dispatcher.java abstract except for > getInstance(). That method does System.getProperty("os.name > ") to decide which implementation to instantiate. On > Windows (and other platforms that implement the C++ interface), it > instantiates NativeDispatcher. On yet others, it would instantiate the > MyOSNameHereDispatcher > * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename > corresponding C++ class > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From storrellas at bdigital.org Wed Feb 23 10:37:48 2011 From: storrellas at bdigital.org (Sergi Torrellas) Date: Wed, 23 Feb 2011 18:37:48 +0100 Subject: [Rxtx] Serial port description Message-ID: Hi all, I am using the library RXTX for connecting to a USB port that is mapped to a serial port. My question is the following is possible to get a longer description of the serial part a part from the COMX? Many thanks, -- *SERGI TORRELLAS SOCASTRO Desenvolupador R+D Salut M. 616.21.72.97** *storrellas at bdigital.org *BARCELONA DIGITAL CENTRE TECNOL?GIC* Roc Boronat 117, 5a planta, 08018 Barcelona Tel. +34 93 553 45 40 - Fax. +34 93 553 45 41 www.bdigital.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Wed Feb 23 21:46:30 2011 From: showard314 at gmail.com (Scott Howard) Date: Wed, 23 Feb 2011 23:46:30 -0500 Subject: [Rxtx] compiling rxtx on archs without sys/io.h Message-ID: Hello all, There is a bug at: http://bugzilla.qbang.org/show_bug.cgi?id=72 for fixing a build failure on PPCs. A similar build failure occurs on mips, ARM, sparc, and a few other architectures. You can work around it be using AC_CHECK_HEADERS and properly shielding #include . I uploaded a new patch to that bug which does that, and have compiled rxtx on those architectures. This will also work for future architectures and won't require manually updating the #ifdefs. If you do use this patch, you should also edit the individual Makefiles (like Makefile.mingw32) to properly #define or #undef HAVE_SYS_IO_H Regards, Scott From ajmas at sympatico.ca Fri Feb 25 09:03:34 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:03:34 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D613A6C.80304@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. On 20-Feb-2011, at 10:59, Adrian Crum wrote: > The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: >> Are there any show stoppers to using the rewrite instead of the current source branch? >> >> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >> >>> There is no timeline to merge the two versions. >>> >>> -Adrian >>> >>> Quoting Andre-John Mas: >>> >>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>> >>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>> >>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>> Hi, >>>>>> >>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>> - src/ >>>>>> - Rewrite2010/src/ >>>>>> >>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>> >>>>>> Andre >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 25 09:17:23 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:17:23 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > >> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >> >> -Adrian >> >> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>> Are there any show stoppers to using the rewrite instead of the current source branch? >>> >>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>> >>>> There is no timeline to merge the two versions. >>>> >>>> -Adrian >>>> >>>> Quoting Andre-John Mas: >>>> >>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>> >>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>> >>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>> - src/ >>>>>>> - Rewrite2010/src/ >>>>>>> >>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>> >>>>>>> Andre >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 26 18:58:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 26 Feb 2011 17:58:27 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: <4D69AFC3.50008@sandglass-software.com> Thank you for doing that. There hasn't been much community interest in the rewrite, and I've been busy since I started it. I hope to work on it some more in the next month or two. -Adrian On 2/25/2011 8:17 AM, Andre-John Mas wrote: > I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > >> What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. >> >> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >> >>> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>> >>> -Adrian >>> >>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> Are there any show stoppers to using the rewrite instead of the current source branch? >>>> >>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>> >>>>> There is no timeline to merge the two versions. >>>>> >>>>> -Adrian >>>>> >>>>> Quoting Andre-John Mas: >>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>>> >>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>> - src/ >>>>>>>> - Rewrite2010/src/ >>>>>>>> >>>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>>> >>>>>>>> Andre >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From iqzw2r602 at sneakemail.com Sun Feb 27 15:47:16 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 09:47:16 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D69AFC3.50008@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> Message-ID: <23853-1298846836-791608@sneakemail.com> Hi Adrian, I've followed the discussion about the rewrite over the past months, and I'm sorry to hear interest in it hasn't picked up. I've had a look at the source code yesterday, and it seems very well designed and nicely documented. IMHO one reason why it hasn't been fully embraced yet is because it currently only runs on Windows. I know from first hand experience (jpathwatch) that it's quite hard to write robust cross-platform Java libraries containing native code, and that people might be hesitant to pick up development on something like that. I was contemplating of toying around with the code base a couple of times, but I'd rather write as much platform dependent code as I can in Java (this might be a matter of preference, however, I have found that it made my life a hell of a lot easier). So to give people choice in how they implement their port, I suggest that: * the Dispatcher Java class becomes abstract, without native methods. * All Java and native code in the Dispatcher class moves to a new NativeDispatcher java/C++ class, which derives from Dispatcher. * The Dispatcher.getInstance() method chooses, per platform, which Dispatcher instance it's going to create. So on Windows and other platforms that like their dispatcher to be native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). On other platforms (say, on BSD based platforms), a different Dispatcher implementation is instantiated, which can be implemented almost entirely in Java. This way, every OS can implement it's own dispatcher. This gives the implementor the option to choose whether to write their implementation as a fat native library (like the one you have implemented for Windows), or in Java with a slim native library (which only wraps OS function calls). In turn, it might make it more attractive for developers to jump in and contribute implementations for other platforms. What do you think? Cheers, Uwe On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > Thank you for doing that. There hasn't been much community interest in the > rewrite, and I've been busy since I started it. I hope to work on it some > more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > >> I have added a stub page here: >> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >> >> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >> >> What could be useful is an entry in the wiki documenting the mile-stones >>> and what is left to be done. >>> >>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>> >>> The rewrite isn't finished - it still needs Java unit tests and native >>>> code for Apple and *nix. You can find more information on the mailing list: >>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>> >>>> -Adrian >>>> >>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> >>>>> Are there any show stoppers to using the rewrite instead of the current >>>>> source branch? >>>>> >>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>> >>>>> There is no timeline to merge the two versions. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> Quoting Andre-John Mas: >>>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>> for? >>>>>>> >>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>> library is in Rewrite2010/src. >>>>>>>> >>>>>>>> -Adrian >>>>>>>> >>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>> - src/ >>>>>>>>> - Rewrite2010/src/ >>>>>>>>> >>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>> we shouldn't be using around? >>>>>>>>> >>>>>>>>> Andre >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Sun Feb 27 16:26:56 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 27 Feb 2011 15:26:56 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <4D6ADDC0.1020608@sandglass-software.com> As far as I know, any Java library that manipulates hardware devices is going to need native code. If the JRE contains classes that already do that, then I'm unaware of them. In other words, I don't know how one would accomplish "making OS calls" without native code. I agree that developing a Java library that reads/writes serial and parallel hardware is not an easy task - therefore there will be few willing to engage in it. I don't agree that Java code should contain as much platform-specific code as possible. That might make things easier for you, but it defeats the "write once, run anywhere" design of Java. I'm not sure what you mean by "fat native code" versus "slim native code." The native code in the rewrite is the minimum necessary to control the hardware - in fact, that is one of the rewrite's design goals. The rewrite's design reduces native code development down to implementing two virtual classes and two functions. I thought I set the bar pretty low, but I might be wrong. -Adrian On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, > and I'm sorry to hear interest in it hasn't picked up. I've had a look > at the source code yesterday, and it seems very well designed and > nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick up development on something like that. > > I was contemplating of toying around with the code base a couple of > times, but I'd rather write as much platform dependent code as I can > in Java (this might be a matter of preference, however, I have found > that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be implemented > almost entirely in Java. This way, every OS can implement it's own > dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have > implemented for Windows), or in Java with a slim native library (which > only wraps OS function calls). > In turn, it might make it more attractive for developers to jump in > and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > Thank you for doing that. There hasn't been much community > interest in the rewrite, and I've been busy since I started it. I > hope to work on it some more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: > http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > What could be useful is an entry in the wiki documenting > the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > The rewrite isn't finished - it still needs Java unit > tests and native code for Apple and *nix. You can find > more information on the mailing list: > http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, > adrian.crum at sandglass-software.com > wrote: > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas >: > > What is the timeline to merge the two? > Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > The latest working source is in src, > and a recent rewrite of the library is > in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas > wrote: > > Hi, > > I am seeing two Java source folder > in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and > is there any need to keep the one > we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:28:56 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:28:56 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() Message-ID: Hi, I have a receive thread that does nothing but call read() on the serial port input stream. It works fine for a while but after running for a long time it eventually returns -1 which means EOF. This is my first problem, as the device I'm talking to runs forever, I don't know why it would return -1. I am calling disableReceiveThreshold() and disableReceiveTimeout() at initialization which according to the documentation means read will return as soon as any data is available and it will block forever when data is not available, so -1 should never be returned from read, right? I have been unable to figure out why read returns -1 after a long while but I have found that if I kill my application and restart it everything works fine again. Therefore I tried to work around the problem by having my code close the port and reopen it when read returns -1. My second problem is that in this case when I call close() on the port it blocks forever. I did find this old bug http://bugzilla.qbang.org/show_bug.cgi?id=53 which describes close() hanging on OSX, but it says that bug was fixed with a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any idea why read might be returning -1 in the first place? If I can avoid that I don't care about close() hanging because I would never close the port. If not, does anyone know why close() might block forever and how I can prevent this? I'm using RXTX version 2.1-7. Thanks, -- Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:34:04 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:34:04 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() In-Reply-To: References: Message-ID: I mis-spoke, I don't have my own thread calling read, I am calling read in the event handler after receiving a SerialPortEvent.DATA_AVAILABLE event. Everything else I said should be accurate though. Ryan On Mon, Feb 28, 2011 at 12:28 AM, Ryan Boder wrote: > Hi, > > I have a receive thread that does nothing but call read() on the serial > port input stream. It works fine for a while but after running for a long > time it eventually returns -1 which means EOF. This is my first problem, as > the device I'm talking to runs forever, I don't know why it would return -1. > I am calling disableReceiveThreshold() and disableReceiveTimeout() at > initialization which according to the documentation means read will return > as soon as any data is available and it will block forever when data is not > available, so -1 should never be returned from read, right? > > I have been unable to figure out why read returns -1 after a long while but > I have found that if I kill my application and restart it everything works > fine again. Therefore I tried to work around the problem by having my code > close the port and reopen it when read returns -1. My second problem is that > in this case when I call close() on the port it blocks forever. I did find > this old bug > > http://bugzilla.qbang.org/show_bug.cgi?id=53 > > which describes close() hanging on OSX, but it says that bug was fixed with > a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any > idea why read might be returning -1 in the first place? If I can avoid that > I don't care about close() hanging because I would never close the port. If > not, does anyone know why close() might block forever and how I can prevent > this? I'm using RXTX version 2.1-7. > > Thanks, > -- > Ryan > > -- Ryan Boder 1 614 598-6339 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.w.janssen at lxtreme.nl Mon Feb 28 04:09:50 2011 From: j.w.janssen at lxtreme.nl (Jan Willem Janssen) Date: Mon, 28 Feb 2011 12:09:50 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <123a513d85e4569df1ebce58088e6592.squirrel@lxtreme.homelinux.org> FWIW: I'm also interested in the 2010-rewrite, but was waiting until a bit more code was available for other platforms, like Linux and/or OSX. I'd like to offer my help if needed, for example to test stuff. Regards, Jan Willem On Sun, February 27, 2011 23:47, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm > sorry to hear interest in it hasn't picked up. I've had a look at the > source > code yesterday, and it seems very well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java > (this > might be a matter of preference, however, I have found that it made my > life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a > NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely > in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. From iqzw2r602 at sneakemail.com Mon Feb 28 04:52:33 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 22:52:33 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6ADDC0.1020608@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> Message-ID: <15854-1298893954-139343@sneakemail.com> Hi Adrian, On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > As far as I know, any Java library that manipulates hardware devices is > going to need native code. If the JRE contains classes that already do that, > then I'm unaware of them. In other words, I don't know how one would > accomplish "making OS calls" without native code. > Yes, you're right, you need native code to do that. The only question is how much. I'm not saying that you wouldn't write native code. I'm just saying you'll need very little. Take CreateFile() on Windows. Your implementation calls it from C++ code, which implements logic all around it. However, you can also call CreateFile() from Java code, and this is what I'm proposing: Expose the CreateFile() function to Java as a static native Java method, so it becomes directly callable from Java code (only visible to implementation, not publicly). So while the code all around the CreateFile() call is all Java (granted, it's platform specific, it has to be), the 'public static native CreateFile()' method is implemented in C++ - and all it does is to call the native CreateFile() function. > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few willing > to engage in it. I don't agree that Java code should contain as much > platform-specific code as possible. That might make things easier for you, > but it defeats the "write once, run anywhere" design of Java. > "write once, run anywhere" (WORA) does apply for client code calling RXTX. However, it doesn't mean that you can't or shouldn't write platform specific code to /implement/ a library that's doing OS specific things; in fact you have to: CreateFile() only exists on Windows, open() only on Unix, etc., so you have to write code specific to each platform that calls these functions and handles their semantics. And in case you haven't noticed yet, the JDK does the same thing, it has platform specific Java classes for lots of things (try debugging the methods of java.io.File, or the parts of the AWT, and see where they call into). The point of WORA is that client code - code that calls into RXTX - should not have to deal with specifics of a platform. > I'm not sure what you mean by "fat native code" versus "slim native code." > Fat native libraries have methods like this, all written in C++: Lots of pointers here, lots of things that could go wrong (but I'm not saying it does, just showing the potential, think threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: CommPort* CommPortFactory::getInstance(const char *portName, int portType) { #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS if (strcmp("PARALLEL_PASS", portName) == 0) return new ParallelLoopback(portName); if (strcmp("SERIAL_PASS", portName) == 0) return new SerialLoopback(portName); #endif // Do not open overlapped. Let the Java application // handle multi-threaded I/O. HANDLE hComm = CreateFile( portName, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); if (hComm == INVALID_HANDLE_VALUE) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); printf("%s\n", lpMsgBuf); delete lpMsgBuf; throw IOException(); } .... // SNIP! Fact is, you can write all of this in Java. You can even take the same code, reword it a bit, and feed it into javac. So I won't quote this here again and Java-ise it, just assume the above is Java code (BTW: you can even do #ifdefs with statics). This Java code will have this import statement at the top: import static Windows.*; In Windows.java would look like this (in fact it does, I've done this in jpathwatch): static native long CreateFile(String fileName, int desiredAccess, int shareMode, SECURITY_ATTRIBUTES securityAttributes, int creationDisposition, int flagsAndAttributes, long templateFileHandle); And the code in Windows.cpp? That calls the native CreateFile() function. And that's all (There's some special handling so GetLastError() works in different threads and won't interfere with the JVM, but that's another topic) The native code in the rewrite is the minimum necessary to control the > hardware - in fact, that is one of the rewrite's design goals. The rewrite's > design reduces native code development down to implementing two virtual > classes and two functions. I thought I set the bar pretty low, but I might > be wrong. > See above; it can be even less. And since I keep saying I've done it, have a look at these files: Windows.cpp[1], Windows.java[2], WindowsPathWatchService.java [3] Don't understand this as a criticism of your design, I actually quite like it. All I am saying is that it doesn't need to be all native, and that if you make the Dispatcher an abstract class like I proposed in my previous email, implementors can choose which language they use (and yes, I'd choose Java over C++; and I've written C++ code for more than 15 years) Cheers, Uwe [1] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup [2] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup [3] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > -Adrian > > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm sorry to hear interest in it hasn't picked up. I've had a look at the > source code yesterday, and it seems very well designed and nicely > documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java (this > might be a matter of preference, however, I have found that it made my life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example > Allow| wrote: > >> Thank you for doing that. There hasn't been much community interest in the >> rewrite, and I've been busy since I started it. I hope to work on it some >> more in the next month or two. >> >> -Adrian >> >> >> On 2/25/2011 8:17 AM, Andre-John Mas wrote: >> >>> I have added a stub page here: >>> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >>> >>> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >>> >>> What could be useful is an entry in the wiki documenting the mile-stones >>>> and what is left to be done. >>>> >>>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>>> >>>> The rewrite isn't finished - it still needs Java unit tests and native >>>>> code for Apple and *nix. You can find more information on the mailing list: >>>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>>> >>>>>> Are there any show stoppers to using the rewrite instead of the >>>>>> current source branch? >>>>>> >>>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>>> >>>>>> There is no timeline to merge the two versions. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> Quoting Andre-John Mas: >>>>>>> >>>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>>> for? >>>>>>>> >>>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>>> >>>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>>> library is in Rewrite2010/src. >>>>>>>>> >>>>>>>>> -Adrian >>>>>>>>> >>>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>>> - src/ >>>>>>>>>> - Rewrite2010/src/ >>>>>>>>>> >>>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>>> we shouldn't be using around? >>>>>>>>>> >>>>>>>>>> Andre >>>>>>>>>> _______________________________________________ >>>>>>>>>> Rxtx mailing list >>>>>>>>>> Rxtx at qbang.org >>>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 28 05:36:14 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 28 Feb 2011 14:36:14 +0200 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> Message-ID: Sorry for top posting but I felt it was justified here to keep the whole context of the referred text intact. I very much agree with Uwe's point of view, ie doing as much as possible in Java, even the platform specific things, and doing the absolute minimum in C/C++. And this is not criticism Adrian's work/design. I would (again) advocate using JNA instead of JNI to access the native OS services/API from Java. This simplifies the live of the library users and developers a great deal because no C/C++ tool chain is involved. Zero. You don't even need a C compiler. There are some 'issues' in accessing some OS API functions from Java (like the need to use OS specific values in the Java code that are only available with #define in header files) but given the stability and longtime standing of the API functions we are talking about (open/close/select/read/write) I do not see this as big issue. A lot of the argumentation is included in this thread when this was last time rehashed on this list. http://answerpot.com/showthread.php?1022262-JNA%20alternative%20(was:%20rxt x%20moving%20from%20JNI%20to%20JNA%20(was%20%20About%20JRE%20crashes))/Page 1 If anyone is interested I can make the straw man implementation available. It compiles and has a fighting chance to work in a POSIX compatible OS (Mac OS X / Linux) with moderate debugging. Of course it is a long way from production, especially as throwing away the current rxtx also throws away most of the testing and debugging to the obscure/uncommon OSes that rxtx currently supports (I suggest anyone attempting to replace the current implementation has peek at the innards of the current implementation to see the variety it claims to support). (As an aside, and not really relevant to calling OS API from Java with JNA, I feel I need to mention that calling C++ using JNA is not easy because of the name mangling, so libraries with C interface are preferred with JNA). br Kusti On 2/28/11 13:52, "iqzw2r602 at sneakemail.com" wrote: >Hi Adrian, > >On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum >adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| >wrote: > > > > > > > > As far as I know, any Java library that manipulates hardware devices > is going to need native code. If the JRE contains classes that > already do that, then I'm unaware of them. In other words, I don't > know how one would accomplish "making OS calls" without native code. > > > > >Yes, you're right, you need native code to do that. The only question is >how much. I'm not saying that you wouldn't write native code. I'm just >saying you'll need very little. Take CreateFile() on Windows. Your >implementation calls it from C++ code, which implements logic all around >it. > >However, you can also call CreateFile() from Java code, and this is what >I'm proposing: Expose the CreateFile() function to Java as a static >native Java method, so it becomes directly callable from Java code (only >visible to implementation, not publicly). So while the code all around >the CreateFile() call is all Java (granted, it's platform specific, it >has to be), the 'public static native CreateFile()' method is implemented >in C++ - and all it does is to call the native CreateFile() function. > > > > > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few > willing to engage in it. I don't agree that Java code should contain > as much platform-specific code as possible. That might make things > easier for you, but it defeats the "write once, run anywhere" design > of Java. > > > > >"write once, run anywhere" (WORA) does apply for client code calling >RXTX. > >However, it doesn't mean that you can't or shouldn't write platform >specific code to /implement/ a library that's doing OS specific things; >in fact you have to: >CreateFile() only exists on Windows, open() only on Unix, etc., so you >have to write code specific to each platform that calls these functions >and handles their semantics. And in case you haven't noticed yet, the JDK >does the same thing, it has platform specific Java classes for lots of >things (try debugging the methods of java.io.File, or the parts of the >AWT, and see where they call into). > >The point of WORA is that client code - code that calls into RXTX - >should not have to deal with specifics of a platform. > > > > > I'm not sure what you mean by "fat native code" versus "slim native > code." > > > >Fat native libraries have methods like this, all written in C++: Lots of >pointers here, lots of things that could go wrong (but I'm not saying it >does, just showing the potential, think >threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: > >CommPort* CommPortFactory::getInstance(const char *portName, int portType) >{ >#ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); >#endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } >... >// SNIP! > >Fact is, you can write all of this in Java. You can even take the same >code, reword it a bit, and feed it into javac. So I won't quote this here >again and Java-ise it, just assume the above is Java code (BTW: you can >even do #ifdefs with statics). This Java code will have this import >statement at the top: > >import static Windows.*; > >In Windows.java would look like this (in fact it does, I've done this in >jpathwatch): > >static native long CreateFile(String fileName, int desiredAccess, int >shareMode, SECURITY_ATTRIBUTES securityAttributes, int >creationDisposition, int flagsAndAttributes, long templateFileHandle); > >And the code in Windows.cpp? That calls the native CreateFile() function. >And that's all (There's some special handling so GetLastError() works in >different threads and won't interfere with the JVM, but that's another >topic) > > > >The native code in the rewrite is the minimum necessary to > control the hardware - in fact, that is one of the rewrite's design > goals. The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I set > the bar pretty low, but I might be wrong. > > > > >See above; it can be even less. > >And since I keep saying I've done it, have a look at these files: >Windows.cpp >jpathwatch-native/src/Windows.cpp?revision=130&view=markup>[1], >Windows.java >jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&v >iew=markup>[2], WindowsPathWatchService.java >jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.jav >a?revision=130&view=markup>[3] > >Don't understand this as a criticism of your design, I actually quite >like it. All I am saying is that it doesn't need to be all native, and >that if you make the Dispatcher an abstract class like I proposed in my >previous email, implementors can choose which language they use (and yes, >I'd choose Java over C++; and I've written C++ code for more than 15 >years) > >Cheers, > >Uwe > >[1] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-native/src/Windows.cpp?revision=130&view=markup >[2] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&vi >ew=markup >[3] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java >?revision=130&view=markup > > > > > -Adrian > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > >Hi Adrian, > > I've followed the discussion about the rewrite over the past > months, and I'm sorry to hear interest in it hasn't picked up. > I've had a look at the source code yesterday, and it seems very > well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because > it currently only runs on Windows. I know from first hand > experience (jpathwatch) that it's quite hard to write robust > cross-platform Java libraries containing native code, and that > people might be hesitant to pick up development on something like > that. > > I was contemplating of toying around with the code base a couple > of times, but I'd rather write as much platform dependent code as > I can in Java (this might be a matter of preference, however, I > have found that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I > suggest that: > > * the Dispatcher Java class becomes abstract, without native > methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by > Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be > implemented almost entirely in Java. This way, every OS can > implement it's own dispatcher. > > This gives the implementor the option to choose whether to write > their implementation as a fat native library (like the one you > have implemented for Windows), or in Java with a slim native > library (which only wraps OS function calls). > In turn, it might make it more attractive for developers to jump > in and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian > Crum adrian.crum-at-sandglass-software.com > > |rxtx.org > mailing list/Example Allow| > wrote: > >Thank you for doing that. There hasn't > been much community interest in the rewrite, and I've been > busy since I started it. I hope to work on it some more in the > next month or two. > > > -Adrian > > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: >http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > > What could be useful is an entry in the wiki > documenting the mile-stones and what is left to be > done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > > The rewrite isn't finished - it still needs Java > unit tests and native code for Apple and *nix. You > can find more information on the mailing list: >http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, >adrian.crum at sandglass-software.com > wrote: > > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas: > > > What is the timeline to merge the two? Also, > what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > > The latest working source is in src, and a > recent rewrite of the library is in > Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: > > Hi, > > I am seeing two Java source folder in the > CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there > any need to keep the one we shouldn't be > using around? > > Andre >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > >http://mailman.qbang.org/mailman/listinfo/rxtx > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From adrian.crum at sandglass-software.com Mon Feb 28 08:15:18 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 07:15:18 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> Message-ID: <4D6BBC06.4090402@sandglass-software.com> Thank you for the suggestions - I will keep them in mind the next time I work on it. -Adrian On 2/28/2011 3:52 AM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > As far as I know, any Java library that manipulates hardware > devices is going to need native code. If the JRE contains classes > that already do that, then I'm unaware of them. In other words, I > don't know how one would accomplish "making OS calls" without > native code. > > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as a > static native Java method, so it becomes directly callable from Java > code (only visible to implementation, not publicly). So while the code > all around the CreateFile() call is all Java (granted, it's platform > specific, it has to be), the 'public static native CreateFile()' > method is implemented in C++ - and all it does is to call the native > CreateFile() function. > > > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there will > be few willing to engage in it. I don't agree that Java code > should contain as much platform-specific code as possible. That > might make things easier for you, but it defeats the "write once, > run anywhere" design of Java. > > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. > > > I'm not sure what you mean by "fat native code" versus "slim > native code." > > > Fat native libraries have methods like this, all written in C++: Lots > of pointers here, lots of things that could go wrong (but I'm not > saying it does, just showing the potential, think threading) - and I'm > a cheeky bastard here and quote from W32_Support.cpp: > > CommPort* CommPortFactory::getInstance(const char *portName, int portType) > { > #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); > #endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } > ... > // SNIP! > > Fact is, you can write all of this in Java. You can even take the same > code, reword it a bit, and feed it into javac. So I won't quote this > here again and Java-ise it, just assume the above is Java code (BTW: > you can even do #ifdefs with statics). This Java code will have this > import statement at the top: > > import static Windows.*; > > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > > static native long CreateFile(String fileName, int desiredAccess, int > shareMode, SECURITY_ATTRIBUTES securityAttributes, int > creationDisposition, int flagsAndAttributes, long templateFileHandle); > > And the code in Windows.cpp? That calls the native CreateFile() > function. And that's all (There's some special handling so > GetLastError() works in different threads and won't interfere with the > JVM, but that's another topic) > > The native code in the rewrite is the minimum necessary to control > the hardware - in fact, that is one of the rewrite's design goals. > The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I > set the bar pretty low, but I might be wrong. > > > See above; it can be even less. > > And since I keep saying I've done it, have a look at these files: > Windows.cpp > [1], > Windows.java > [2], > WindowsPathWatchService.java > [3] > > Don't understand this as a criticism of your design, I actually quite > like it. All I am saying is that it doesn't need to be all native, and > that if you make the Dispatcher an abstract class like I proposed in > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) > > Cheers, > > Uwe > > [1] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup > > [2] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup > > [3] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Feb 28 09:51:19 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 17:51:19 +0100 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <20110228165119.GD10695@elberon.bln.de.ingenico.com> * Andre-John Mas wrote on Fri, Feb 18, 2011 at 21:43 -0500: > Is anyone using JDK 1.4 or less? Yes, 1.4.2_11-b06 (j2sdk-1_4_2_11-fcs-linux-i586) in some cases (also similar versions: 1.4.2_15-b02, 1.4.2_16-b05, maybe others). > I am asking because I would be interested in bringing the code > up to Java 1.5 standards, with the use of generics and other > recent developments. Why that? oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Mon Feb 28 10:20:53 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 18:20:53 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6BBC06.4090402@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> Message-ID: <20110228172052.GE10695@elberon.bln.de.ingenico.com> * Adrian Crum wrote on Mon, Feb 28, 2011 at 07:15 -0800: [...] > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. I think in general it can be good to have an system-abstracting interface of the native code. That means, the native code implementation abstracts from the system (instead of implementing that abstractions in Java). Of course it is more complex :) IIRC we already had such a discussion here. > Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as > a static native Java method, so it becomes directly callable > from Java code (only visible to implementation, not publicly). > So while the code all around the CreateFile() call is all Java > (granted, it's platform specific, it has to be), the 'public > static native CreateFile()' method is implemented in C++ - and > all it does is to call the native CreateFile() function. I don't think I'd like this. CreateFile() is very system-specific. Exposing this to Java code makes this Java code system-specific. Although you could "run" it everywhere, it won't work anyware except on appropriate windows boxes. But this goes even further, you might consider calling open and select from Java and use it for serial ports on linux, but on another system that have both functions, they simply won't work (like on windows; there should be open and select, but AFAIK the latter cannot be expected to work on serial interfaces). Of course there is an somewhat strong argument, that is if the developer is much more experienced with Java than with C, it might be easier to implement this in Java, but personally I think it is hard to believe that developers who are able to correctly abstract device-I/O from system calls are not good at C, because I'm sure C is the language system by system programmers. > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there > will be few willing to engage in it. I don't agree that Java > code should contain as much platform-specific code as possible. > That might make things easier for you, but it defeats the > "write once, run anywhere" design of Java. Java runs on compliant JVMs only and nowhere else. It just happens that JVMs exist for most systems of a special set of computers such as PCs and small servers (but not neccesarily for embedded devices or main frames). As soon as a single native function is needed (required) for the application to work properly, the `run anywhere' is already impossible, because now it does not run on any JVM but only on JVMs that supply an implementation for this native code function. > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. Yes, exactly. Also, it is possible to write system-specific applications `with 100% Java' (for example, hardcode "C:\\Program Files" to be windows-specific or use "/dev/null" or so). Expecting a certain behavior not specified by Java (e.g. whether you can read "/dev/null", what CreateFile returns or whether select works on non-socket-filehandles) IMHO already misses the "write once, run anywhere" idea. So in summary I don't think the amount of platform-specific code matters much. It must be avaiable, requiring deployment etc, so little difference how many lines of code that were. [...] > import static Windows.*; > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > static native long CreateFile(String fileName, int desiredAccess, int [...] Someone here also proposed to use a general method to invoke arbitrary functions of shared libraries, JNA. By this, you wouldn't need `static NATIVE long CreateFile'; you could replace JNI by JNA here. Assuming that this native functionality would already be deployed on many target platform systems, implementing all the platform-specific code in Java can make sense, because this specific implementations would not require additional native code deployment. If, for example, the Java installation of Debian would by default already offer native library call execution, platform-specific code implemented in Java would work on Debian without needing any additional binary lib to be installed, I think could be quite an advantage. I think if having some Windows.java layer (which I personally would not like), JNA IMHO seems to be suited well. Personally, I prefere to define nice, simple and comfortable interfaces, also for native code (if possible, for JNI I think it always is a compromise). > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) Do you mean in general or also specifically for system programming? If someone would need a small program to let's say query DCD on linux I think a small C application would be suited best. Of course this topic also is more complex and depends on things. oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From msemtd at googlemail.com Mon Feb 28 13:50:42 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 28 Feb 2011 20:50:42 +0000 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172052.GE10695@elberon.bln.de.ingenico.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: This was discussed to death last year - summary: - * JNI is too hard * JNA is compelling * yay! let's start a rewrite Time passes... Current status: Windows-only and incomplete Back in non-vaporware land (this is meant in good humour BTW), the current RXTX platform-specifics are achieved with ports of POSIX termios.h[1]. It just works (mostly, kinda!) and you have to treat it nice and test it to death for _YOUR_ platform in _YOUR_ application but, y'know, that's what professional software engineers just do anyway. I seriously don't believe anyone will come up with anything better anytime soon. Regards, Michael Erskine. [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition From iqzw2r602 at sneakemail.com Mon Feb 28 15:01:20 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 09:01:20 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <6175-1298930480-518642@sneakemail.com> Good summary. This whole JNI/JNA/C++ thing only came up again because I tried to explain my motivations for my initial request. And I agree, let's not discuss this further, we've been there already. So let's get this discussion back on track: All I suggested is to separate the implementation of the Dispatcher Java class into a NativeDispatcher class and a Dispatcher interface, so people can implement the Dispatcher (Java-) interface with whatever Three-Letter-Abbreviation they want. So can people please comment on that? Cheers, Uwe On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 > Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 15:22:21 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 14:22:21 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <4D6C201D.6060103@sandglass-software.com> One of the issues I tried to address in the rewite is the "JNI is too hard" issue. Anyone with rudimentary C++ skills can implement the two virtual classes and two functions - no knowledge of JNI is necessary because Dispatcher.cpp takes care of all of the JNI data type marshalling/unmarshalling. I don't agree that the 2.x versions "just work" - the recurring bugs mentioned on this list and in other forums are evidence of that. I tried to work with the 2.x version by wrapping it in thread-safe classes, but even that didn't help. I tried to fix the most recent version by supplying patches, but the sum of the patches added up to a rewrite. So I created a rewrite instead. -Adrian On 2/28/2011 12:50 PM, Michael Erskine wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Mon Feb 28 16:24:00 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 15:24:00 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <6175-1298930480-518642@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> Message-ID: <4D6C2E90.9010601@sandglass-software.com> My question would be: Why would you do that? The rewrite does most of the work for you - all you have to do is implement two C++ virtual classes and two C++ functions. In Windows that took me a few hours. I can't imagine other ports taking much longer than that - especially since POSIX-based code can be shared between ports. What you're suggesting would require a great deal more effort than necessary. -Adrian On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to > explain my motivations for my initial request. And I agree, let's not > discuss this further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher > Java class into a NativeDispatcher class and a Dispatcher interface, > so people can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine > msemtd-at-googlemail.com |rxtx.org > mailing list/Example Allow| > <6zkk4zdpgt at sneakemail.com > wrote: > > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Mon Feb 28 17:26:18 2011 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Mon, 28 Feb 2011 17:26:18 -0700 Subject: [Rxtx] =?utf-8?q?Which_Java_folder_in_source=3F?= Message-ID: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 17:40:03 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 16:40:03 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> References: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> Message-ID: <4D6C4063.5060708@sandglass-software.com> Speaking of bugs one knows - was anyone interested in the bug fixing effort you proposed? -Adrian On 2/28/2011 4:26 PM, jfh at greenhousepc.com wrote: > Adrian, > > I have many dozens of clients using the RXTX jar on a wide variety of > Windows, Linux and a few MacOS X releases. Provided one does what the > previous poster suggested, the code really does "just work". > > Most of the problems that get reported are things that Windows > applications, and not a few Linux ones as well, have problems with > already. > > The other issue is that even with a boat load of testing, I have no > expectation to migrate to the re-write until 3Q12 at the absolute > earliest. > > I appreciate the effort you are putting into this re-write, but after > 32 years in this field (that's more years than many on this list are > alive), I've seen a lot of "re-writes". I've even done a few myself, > some better than others. > > That 32 years of software engineering experience has taught me one > vital lesson -- the bugs one knows are far less dangerous than the > bugs one doesn't know. And all re-writes are a minefield of unknown > bugs. For my products, it takes about 9 =months= before a release is > stable enough that I'm truly pleased with it. I'm still struggling > with bugs from new features I added in my 3Q10 release. I don't need > to struggle with the new bugs that are going to come from the > re-write. Not personal, just my 32 years of experience. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com > // greenHousePC on Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Which Java folder in source? > From: Adrian Crum > ; > Date: Mon, February 28, 2011 4:22 pm > To: rxtx at qbang.org > > One of the issues I tried to address in the rewite is the "JNI is too > hard" issue. Anyone with rudimentary C++ skills can implement the two > virtual classes and two functions - no knowledge of JNI is necessary > because Dispatcher.cpp takes care of all of the JNI data type > marshalling/unmarshalling. > > I don't agree that the 2.x versions "just work" - the recurring bugs > mentioned on this list and in other forums are evidence of that. I > tried > to work with the 2.x version by wrapping it in thread-safe > classes, but > even that didn't help. I tried to fix the most recent version by > supplying patches, but the sum of the patches added up to a > rewrite. So > I created a rewrite instead. > > -Adrian > > On 2/28/2011 12:50 PM, Michael Erskine wrote: > > This was discussed to death last year - summary: - > > * JNI is too hard > > * JNA is compelling > > * yay! let's start a rewrite > > > > Time passes... > > > > Current status: Windows-only and incomplete > > > > Back in non-vaporware land (this is meant in good humour BTW), the > > current RXTX platform-specifics are achieved with ports of POSIX > > termios.h[1]. > > > > It just works (mostly, kinda!) and you have to treat it nice and test > > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > > that's what professional software engineers just do anyway. I > > seriously don't believe anyone will come up with anything better > > anytime soon. > > > > Regards, > > Michael Erskine. > > > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From iqzw2r602 at sneakemail.com Mon Feb 28 18:59:48 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 12:59:48 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6C2E90.9010601@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> Message-ID: <13486-1298944789-675699@sneakemail.com> On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > My question would be: Why would you do that? > I'm thinking about the debugging effort, quite frankly. When I started off with jpathwatch, I initially wrote a fat native library. It got me into trouble: It was hard to debug, the JVM would crash every now and then, depending which bug it hit, and debugging a process with a JVM (even on Windows) is not fun. When I finally got it to work on Windows, I started doing Linux, and the same thing happened again - and I didn't find the tools as nice. When it started sucking up too much of my time I scrapped the whole thing, literally, and moved to a slim native library. I wrote the new implementation in a fraction of the time, and it rarely ever crashed (because except for the little C++ code to wrap OS functions there was nothing that could). So that's my reason to write things in Java mainly for a project like this. Others prefer C++. What I'm suggesting gives people a choice to use the tool they're most comfortable with (because this is really about people, not code; the code won't write and fix itself, people have to go in and do it) > The rewrite does most of the work for you - all you have to do is implement > two C++ virtual classes and two C++ functions. In Windows that took me a few > hours. I can't imagine other ports taking much longer than that - especially > since POSIX-based code can be shared between ports. > And that's fine for people who want to write a native code implementation. I'm not talking about scrapping that at all, quite the contrary - Windows and the C++ framework should stay as it is, it's quite a large contribution you've made in time and effort, it'd be stupid to abandon that. Even more so, other platforms could build on the C++ code you've written, as you intended. All this would provide is another option, so people can also implement a platform in Java with any TLA they want (don't want to mention technologies here, that'll start another flame war ;) > What you're suggesting would require a great deal more effort than > necessary. > No, I don't think so; it'd be a quite simple refactoring task: * Copy Dispatcher.java into NativeDispatcher.java and change constructor name. Make it derive from Dispatcher * Make all methods in the original Dispatcher.java abstract except for getInstance(). That method does System.getProperty("os.name") to decide which implementation to instantiate. On Windows (and other platforms that implement the C++ interface), it instantiates NativeDispatcher. On yet others, it would instantiate the MyOSNameHereDispatcher * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename corresponding C++ class I'd think this is about 3 hours of work. I'm even happy to have a shot at it, but I have no commit rights to CVS, and I certainly don't intend to make changes that other people don't like. Remember, this discussion stemmed from people being worried that the rewrite is Windows-only right now. So the goal is to get more supported platforms, and to get there you'll need people to contribute code. I think providing more options will attract more contributors. It would certainly make it more attractive for me. Cheers, Uwe > -Adrian > > > > On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to explain > my motivations for my initial request. And I agree, let's not discuss this > further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher Java > class into a NativeDispatcher class and a Dispatcher interface, so people > can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | > rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > >> This was discussed to death last year - summary: - >> * JNI is too hard >> * JNA is compelling >> * yay! let's start a rewrite >> >> Time passes... >> >> Current status: Windows-only and incomplete >> >> Back in non-vaporware land (this is meant in good humour BTW), the >> current RXTX platform-specifics are achieved with ports of POSIX >> termios.h[1]. >> >> It just works (mostly, kinda!) and you have to treat it nice and test >> it to death for _YOUR_ platform in _YOUR_ application but, y'know, >> that's what professional software engineers just do anyway. I >> seriously don't believe anyone will come up with anything better >> anytime soon. >> >> Regards, >> Michael Erskine. >> >> [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 >> Edition >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 19:32:12 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 18:32:12 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <13486-1298944789-675699@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> <13486-1298944789-675699@sneakemail.com> Message-ID: <4D6C5AAC.3070508@sandglass-software.com> Just to make sure I'm understanding you correctly, anyone porting RxTx to a new platform would have to do the following: 1. Write their own Java implementation of an abstract Dispatcher class. 2. Write a native (JNI or JNA) interface for the abstract class implementation. 3. Write all of the native (or non-native) code to implement the native interface. Is that correct? If yes, how is that easier than the simple implementation the current rewrite design uses? On a side note: there is no requirement to write native code using C++. If C++ is a real obstacle to adoption, then regular C could be used instead. In that case, there would be a Dispatcher.c file that contains function protoypes that need to be implemented. Dispatcher.c would still maintain the same role as Dispatcher.cpp - which is to shield native code developers from the details of JNI. Just build out the missing functions using C data types and you're ready to go. -Adrian On 2/28/2011 5:59 PM, iqzw2r602 at sneakemail.com wrote: > On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > What you're suggesting would require a great deal more effort than > necessary. > > > No, I don't think so; it'd be a quite simple refactoring task: > * Copy Dispatcher.java into NativeDispatcher.java and change > constructor name. Make it derive from Dispatcher > * Make all methods in the original Dispatcher.java abstract except for > getInstance(). That method does System.getProperty("os.name > ") to decide which implementation to instantiate. On > Windows (and other platforms that implement the C++ interface), it > instantiates NativeDispatcher. On yet others, it would instantiate the > MyOSNameHereDispatcher > * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename > corresponding C++ class > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From storrellas at bdigital.org Wed Feb 23 10:37:48 2011 From: storrellas at bdigital.org (Sergi Torrellas) Date: Wed, 23 Feb 2011 18:37:48 +0100 Subject: [Rxtx] Serial port description Message-ID: Hi all, I am using the library RXTX for connecting to a USB port that is mapped to a serial port. My question is the following is possible to get a longer description of the serial part a part from the COMX? Many thanks, -- *SERGI TORRELLAS SOCASTRO Desenvolupador R+D Salut M. 616.21.72.97** *storrellas at bdigital.org *BARCELONA DIGITAL CENTRE TECNOL?GIC* Roc Boronat 117, 5a planta, 08018 Barcelona Tel. +34 93 553 45 40 - Fax. +34 93 553 45 41 www.bdigital.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Wed Feb 23 21:46:30 2011 From: showard314 at gmail.com (Scott Howard) Date: Wed, 23 Feb 2011 23:46:30 -0500 Subject: [Rxtx] compiling rxtx on archs without sys/io.h Message-ID: Hello all, There is a bug at: http://bugzilla.qbang.org/show_bug.cgi?id=72 for fixing a build failure on PPCs. A similar build failure occurs on mips, ARM, sparc, and a few other architectures. You can work around it be using AC_CHECK_HEADERS and properly shielding #include . I uploaded a new patch to that bug which does that, and have compiled rxtx on those architectures. This will also work for future architectures and won't require manually updating the #ifdefs. If you do use this patch, you should also edit the individual Makefiles (like Makefile.mingw32) to properly #define or #undef HAVE_SYS_IO_H Regards, Scott From ajmas at sympatico.ca Fri Feb 25 09:03:34 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:03:34 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D613A6C.80304@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. On 20-Feb-2011, at 10:59, Adrian Crum wrote: > The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: >> Are there any show stoppers to using the rewrite instead of the current source branch? >> >> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >> >>> There is no timeline to merge the two versions. >>> >>> -Adrian >>> >>> Quoting Andre-John Mas: >>> >>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>> >>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>> >>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>> Hi, >>>>>> >>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>> - src/ >>>>>> - Rewrite2010/src/ >>>>>> >>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>> >>>>>> Andre >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 25 09:17:23 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:17:23 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > >> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >> >> -Adrian >> >> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>> Are there any show stoppers to using the rewrite instead of the current source branch? >>> >>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>> >>>> There is no timeline to merge the two versions. >>>> >>>> -Adrian >>>> >>>> Quoting Andre-John Mas: >>>> >>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>> >>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>> >>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>> - src/ >>>>>>> - Rewrite2010/src/ >>>>>>> >>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>> >>>>>>> Andre >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 26 18:58:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 26 Feb 2011 17:58:27 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: <4D69AFC3.50008@sandglass-software.com> Thank you for doing that. There hasn't been much community interest in the rewrite, and I've been busy since I started it. I hope to work on it some more in the next month or two. -Adrian On 2/25/2011 8:17 AM, Andre-John Mas wrote: > I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > >> What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. >> >> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >> >>> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>> >>> -Adrian >>> >>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> Are there any show stoppers to using the rewrite instead of the current source branch? >>>> >>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>> >>>>> There is no timeline to merge the two versions. >>>>> >>>>> -Adrian >>>>> >>>>> Quoting Andre-John Mas: >>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>>> >>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>> - src/ >>>>>>>> - Rewrite2010/src/ >>>>>>>> >>>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>>> >>>>>>>> Andre >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From iqzw2r602 at sneakemail.com Sun Feb 27 15:47:16 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 09:47:16 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D69AFC3.50008@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> Message-ID: <23853-1298846836-791608@sneakemail.com> Hi Adrian, I've followed the discussion about the rewrite over the past months, and I'm sorry to hear interest in it hasn't picked up. I've had a look at the source code yesterday, and it seems very well designed and nicely documented. IMHO one reason why it hasn't been fully embraced yet is because it currently only runs on Windows. I know from first hand experience (jpathwatch) that it's quite hard to write robust cross-platform Java libraries containing native code, and that people might be hesitant to pick up development on something like that. I was contemplating of toying around with the code base a couple of times, but I'd rather write as much platform dependent code as I can in Java (this might be a matter of preference, however, I have found that it made my life a hell of a lot easier). So to give people choice in how they implement their port, I suggest that: * the Dispatcher Java class becomes abstract, without native methods. * All Java and native code in the Dispatcher class moves to a new NativeDispatcher java/C++ class, which derives from Dispatcher. * The Dispatcher.getInstance() method chooses, per platform, which Dispatcher instance it's going to create. So on Windows and other platforms that like their dispatcher to be native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). On other platforms (say, on BSD based platforms), a different Dispatcher implementation is instantiated, which can be implemented almost entirely in Java. This way, every OS can implement it's own dispatcher. This gives the implementor the option to choose whether to write their implementation as a fat native library (like the one you have implemented for Windows), or in Java with a slim native library (which only wraps OS function calls). In turn, it might make it more attractive for developers to jump in and contribute implementations for other platforms. What do you think? Cheers, Uwe On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > Thank you for doing that. There hasn't been much community interest in the > rewrite, and I've been busy since I started it. I hope to work on it some > more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > >> I have added a stub page here: >> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >> >> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >> >> What could be useful is an entry in the wiki documenting the mile-stones >>> and what is left to be done. >>> >>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>> >>> The rewrite isn't finished - it still needs Java unit tests and native >>>> code for Apple and *nix. You can find more information on the mailing list: >>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>> >>>> -Adrian >>>> >>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> >>>>> Are there any show stoppers to using the rewrite instead of the current >>>>> source branch? >>>>> >>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>> >>>>> There is no timeline to merge the two versions. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> Quoting Andre-John Mas: >>>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>> for? >>>>>>> >>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>> library is in Rewrite2010/src. >>>>>>>> >>>>>>>> -Adrian >>>>>>>> >>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>> - src/ >>>>>>>>> - Rewrite2010/src/ >>>>>>>>> >>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>> we shouldn't be using around? >>>>>>>>> >>>>>>>>> Andre >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Sun Feb 27 16:26:56 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 27 Feb 2011 15:26:56 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <4D6ADDC0.1020608@sandglass-software.com> As far as I know, any Java library that manipulates hardware devices is going to need native code. If the JRE contains classes that already do that, then I'm unaware of them. In other words, I don't know how one would accomplish "making OS calls" without native code. I agree that developing a Java library that reads/writes serial and parallel hardware is not an easy task - therefore there will be few willing to engage in it. I don't agree that Java code should contain as much platform-specific code as possible. That might make things easier for you, but it defeats the "write once, run anywhere" design of Java. I'm not sure what you mean by "fat native code" versus "slim native code." The native code in the rewrite is the minimum necessary to control the hardware - in fact, that is one of the rewrite's design goals. The rewrite's design reduces native code development down to implementing two virtual classes and two functions. I thought I set the bar pretty low, but I might be wrong. -Adrian On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, > and I'm sorry to hear interest in it hasn't picked up. I've had a look > at the source code yesterday, and it seems very well designed and > nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick up development on something like that. > > I was contemplating of toying around with the code base a couple of > times, but I'd rather write as much platform dependent code as I can > in Java (this might be a matter of preference, however, I have found > that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be implemented > almost entirely in Java. This way, every OS can implement it's own > dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have > implemented for Windows), or in Java with a slim native library (which > only wraps OS function calls). > In turn, it might make it more attractive for developers to jump in > and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > Thank you for doing that. There hasn't been much community > interest in the rewrite, and I've been busy since I started it. I > hope to work on it some more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: > http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > What could be useful is an entry in the wiki documenting > the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > The rewrite isn't finished - it still needs Java unit > tests and native code for Apple and *nix. You can find > more information on the mailing list: > http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, > adrian.crum at sandglass-software.com > wrote: > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas >: > > What is the timeline to merge the two? > Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > The latest working source is in src, > and a recent rewrite of the library is > in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas > wrote: > > Hi, > > I am seeing two Java source folder > in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and > is there any need to keep the one > we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:28:56 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:28:56 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() Message-ID: Hi, I have a receive thread that does nothing but call read() on the serial port input stream. It works fine for a while but after running for a long time it eventually returns -1 which means EOF. This is my first problem, as the device I'm talking to runs forever, I don't know why it would return -1. I am calling disableReceiveThreshold() and disableReceiveTimeout() at initialization which according to the documentation means read will return as soon as any data is available and it will block forever when data is not available, so -1 should never be returned from read, right? I have been unable to figure out why read returns -1 after a long while but I have found that if I kill my application and restart it everything works fine again. Therefore I tried to work around the problem by having my code close the port and reopen it when read returns -1. My second problem is that in this case when I call close() on the port it blocks forever. I did find this old bug http://bugzilla.qbang.org/show_bug.cgi?id=53 which describes close() hanging on OSX, but it says that bug was fixed with a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any idea why read might be returning -1 in the first place? If I can avoid that I don't care about close() hanging because I would never close the port. If not, does anyone know why close() might block forever and how I can prevent this? I'm using RXTX version 2.1-7. Thanks, -- Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:34:04 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:34:04 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() In-Reply-To: References: Message-ID: I mis-spoke, I don't have my own thread calling read, I am calling read in the event handler after receiving a SerialPortEvent.DATA_AVAILABLE event. Everything else I said should be accurate though. Ryan On Mon, Feb 28, 2011 at 12:28 AM, Ryan Boder wrote: > Hi, > > I have a receive thread that does nothing but call read() on the serial > port input stream. It works fine for a while but after running for a long > time it eventually returns -1 which means EOF. This is my first problem, as > the device I'm talking to runs forever, I don't know why it would return -1. > I am calling disableReceiveThreshold() and disableReceiveTimeout() at > initialization which according to the documentation means read will return > as soon as any data is available and it will block forever when data is not > available, so -1 should never be returned from read, right? > > I have been unable to figure out why read returns -1 after a long while but > I have found that if I kill my application and restart it everything works > fine again. Therefore I tried to work around the problem by having my code > close the port and reopen it when read returns -1. My second problem is that > in this case when I call close() on the port it blocks forever. I did find > this old bug > > http://bugzilla.qbang.org/show_bug.cgi?id=53 > > which describes close() hanging on OSX, but it says that bug was fixed with > a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any > idea why read might be returning -1 in the first place? If I can avoid that > I don't care about close() hanging because I would never close the port. If > not, does anyone know why close() might block forever and how I can prevent > this? I'm using RXTX version 2.1-7. > > Thanks, > -- > Ryan > > -- Ryan Boder 1 614 598-6339 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.w.janssen at lxtreme.nl Mon Feb 28 04:09:50 2011 From: j.w.janssen at lxtreme.nl (Jan Willem Janssen) Date: Mon, 28 Feb 2011 12:09:50 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <123a513d85e4569df1ebce58088e6592.squirrel@lxtreme.homelinux.org> FWIW: I'm also interested in the 2010-rewrite, but was waiting until a bit more code was available for other platforms, like Linux and/or OSX. I'd like to offer my help if needed, for example to test stuff. Regards, Jan Willem On Sun, February 27, 2011 23:47, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm > sorry to hear interest in it hasn't picked up. I've had a look at the > source > code yesterday, and it seems very well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java > (this > might be a matter of preference, however, I have found that it made my > life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a > NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely > in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. From iqzw2r602 at sneakemail.com Mon Feb 28 04:52:33 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 22:52:33 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6ADDC0.1020608@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> Message-ID: <15854-1298893954-139343@sneakemail.com> Hi Adrian, On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > As far as I know, any Java library that manipulates hardware devices is > going to need native code. If the JRE contains classes that already do that, > then I'm unaware of them. In other words, I don't know how one would > accomplish "making OS calls" without native code. > Yes, you're right, you need native code to do that. The only question is how much. I'm not saying that you wouldn't write native code. I'm just saying you'll need very little. Take CreateFile() on Windows. Your implementation calls it from C++ code, which implements logic all around it. However, you can also call CreateFile() from Java code, and this is what I'm proposing: Expose the CreateFile() function to Java as a static native Java method, so it becomes directly callable from Java code (only visible to implementation, not publicly). So while the code all around the CreateFile() call is all Java (granted, it's platform specific, it has to be), the 'public static native CreateFile()' method is implemented in C++ - and all it does is to call the native CreateFile() function. > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few willing > to engage in it. I don't agree that Java code should contain as much > platform-specific code as possible. That might make things easier for you, > but it defeats the "write once, run anywhere" design of Java. > "write once, run anywhere" (WORA) does apply for client code calling RXTX. However, it doesn't mean that you can't or shouldn't write platform specific code to /implement/ a library that's doing OS specific things; in fact you have to: CreateFile() only exists on Windows, open() only on Unix, etc., so you have to write code specific to each platform that calls these functions and handles their semantics. And in case you haven't noticed yet, the JDK does the same thing, it has platform specific Java classes for lots of things (try debugging the methods of java.io.File, or the parts of the AWT, and see where they call into). The point of WORA is that client code - code that calls into RXTX - should not have to deal with specifics of a platform. > I'm not sure what you mean by "fat native code" versus "slim native code." > Fat native libraries have methods like this, all written in C++: Lots of pointers here, lots of things that could go wrong (but I'm not saying it does, just showing the potential, think threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: CommPort* CommPortFactory::getInstance(const char *portName, int portType) { #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS if (strcmp("PARALLEL_PASS", portName) == 0) return new ParallelLoopback(portName); if (strcmp("SERIAL_PASS", portName) == 0) return new SerialLoopback(portName); #endif // Do not open overlapped. Let the Java application // handle multi-threaded I/O. HANDLE hComm = CreateFile( portName, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); if (hComm == INVALID_HANDLE_VALUE) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); printf("%s\n", lpMsgBuf); delete lpMsgBuf; throw IOException(); } .... // SNIP! Fact is, you can write all of this in Java. You can even take the same code, reword it a bit, and feed it into javac. So I won't quote this here again and Java-ise it, just assume the above is Java code (BTW: you can even do #ifdefs with statics). This Java code will have this import statement at the top: import static Windows.*; In Windows.java would look like this (in fact it does, I've done this in jpathwatch): static native long CreateFile(String fileName, int desiredAccess, int shareMode, SECURITY_ATTRIBUTES securityAttributes, int creationDisposition, int flagsAndAttributes, long templateFileHandle); And the code in Windows.cpp? That calls the native CreateFile() function. And that's all (There's some special handling so GetLastError() works in different threads and won't interfere with the JVM, but that's another topic) The native code in the rewrite is the minimum necessary to control the > hardware - in fact, that is one of the rewrite's design goals. The rewrite's > design reduces native code development down to implementing two virtual > classes and two functions. I thought I set the bar pretty low, but I might > be wrong. > See above; it can be even less. And since I keep saying I've done it, have a look at these files: Windows.cpp[1], Windows.java[2], WindowsPathWatchService.java [3] Don't understand this as a criticism of your design, I actually quite like it. All I am saying is that it doesn't need to be all native, and that if you make the Dispatcher an abstract class like I proposed in my previous email, implementors can choose which language they use (and yes, I'd choose Java over C++; and I've written C++ code for more than 15 years) Cheers, Uwe [1] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup [2] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup [3] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > -Adrian > > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm sorry to hear interest in it hasn't picked up. I've had a look at the > source code yesterday, and it seems very well designed and nicely > documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java (this > might be a matter of preference, however, I have found that it made my life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example > Allow| wrote: > >> Thank you for doing that. There hasn't been much community interest in the >> rewrite, and I've been busy since I started it. I hope to work on it some >> more in the next month or two. >> >> -Adrian >> >> >> On 2/25/2011 8:17 AM, Andre-John Mas wrote: >> >>> I have added a stub page here: >>> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >>> >>> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >>> >>> What could be useful is an entry in the wiki documenting the mile-stones >>>> and what is left to be done. >>>> >>>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>>> >>>> The rewrite isn't finished - it still needs Java unit tests and native >>>>> code for Apple and *nix. You can find more information on the mailing list: >>>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>>> >>>>>> Are there any show stoppers to using the rewrite instead of the >>>>>> current source branch? >>>>>> >>>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>>> >>>>>> There is no timeline to merge the two versions. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> Quoting Andre-John Mas: >>>>>>> >>>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>>> for? >>>>>>>> >>>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>>> >>>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>>> library is in Rewrite2010/src. >>>>>>>>> >>>>>>>>> -Adrian >>>>>>>>> >>>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>>> - src/ >>>>>>>>>> - Rewrite2010/src/ >>>>>>>>>> >>>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>>> we shouldn't be using around? >>>>>>>>>> >>>>>>>>>> Andre >>>>>>>>>> _______________________________________________ >>>>>>>>>> Rxtx mailing list >>>>>>>>>> Rxtx at qbang.org >>>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 28 05:36:14 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 28 Feb 2011 14:36:14 +0200 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> Message-ID: Sorry for top posting but I felt it was justified here to keep the whole context of the referred text intact. I very much agree with Uwe's point of view, ie doing as much as possible in Java, even the platform specific things, and doing the absolute minimum in C/C++. And this is not criticism Adrian's work/design. I would (again) advocate using JNA instead of JNI to access the native OS services/API from Java. This simplifies the live of the library users and developers a great deal because no C/C++ tool chain is involved. Zero. You don't even need a C compiler. There are some 'issues' in accessing some OS API functions from Java (like the need to use OS specific values in the Java code that are only available with #define in header files) but given the stability and longtime standing of the API functions we are talking about (open/close/select/read/write) I do not see this as big issue. A lot of the argumentation is included in this thread when this was last time rehashed on this list. http://answerpot.com/showthread.php?1022262-JNA%20alternative%20(was:%20rxt x%20moving%20from%20JNI%20to%20JNA%20(was%20%20About%20JRE%20crashes))/Page 1 If anyone is interested I can make the straw man implementation available. It compiles and has a fighting chance to work in a POSIX compatible OS (Mac OS X / Linux) with moderate debugging. Of course it is a long way from production, especially as throwing away the current rxtx also throws away most of the testing and debugging to the obscure/uncommon OSes that rxtx currently supports (I suggest anyone attempting to replace the current implementation has peek at the innards of the current implementation to see the variety it claims to support). (As an aside, and not really relevant to calling OS API from Java with JNA, I feel I need to mention that calling C++ using JNA is not easy because of the name mangling, so libraries with C interface are preferred with JNA). br Kusti On 2/28/11 13:52, "iqzw2r602 at sneakemail.com" wrote: >Hi Adrian, > >On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum >adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| >wrote: > > > > > > > > As far as I know, any Java library that manipulates hardware devices > is going to need native code. If the JRE contains classes that > already do that, then I'm unaware of them. In other words, I don't > know how one would accomplish "making OS calls" without native code. > > > > >Yes, you're right, you need native code to do that. The only question is >how much. I'm not saying that you wouldn't write native code. I'm just >saying you'll need very little. Take CreateFile() on Windows. Your >implementation calls it from C++ code, which implements logic all around >it. > >However, you can also call CreateFile() from Java code, and this is what >I'm proposing: Expose the CreateFile() function to Java as a static >native Java method, so it becomes directly callable from Java code (only >visible to implementation, not publicly). So while the code all around >the CreateFile() call is all Java (granted, it's platform specific, it >has to be), the 'public static native CreateFile()' method is implemented >in C++ - and all it does is to call the native CreateFile() function. > > > > > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few > willing to engage in it. I don't agree that Java code should contain > as much platform-specific code as possible. That might make things > easier for you, but it defeats the "write once, run anywhere" design > of Java. > > > > >"write once, run anywhere" (WORA) does apply for client code calling >RXTX. > >However, it doesn't mean that you can't or shouldn't write platform >specific code to /implement/ a library that's doing OS specific things; >in fact you have to: >CreateFile() only exists on Windows, open() only on Unix, etc., so you >have to write code specific to each platform that calls these functions >and handles their semantics. And in case you haven't noticed yet, the JDK >does the same thing, it has platform specific Java classes for lots of >things (try debugging the methods of java.io.File, or the parts of the >AWT, and see where they call into). > >The point of WORA is that client code - code that calls into RXTX - >should not have to deal with specifics of a platform. > > > > > I'm not sure what you mean by "fat native code" versus "slim native > code." > > > >Fat native libraries have methods like this, all written in C++: Lots of >pointers here, lots of things that could go wrong (but I'm not saying it >does, just showing the potential, think >threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: > >CommPort* CommPortFactory::getInstance(const char *portName, int portType) >{ >#ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); >#endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } >... >// SNIP! > >Fact is, you can write all of this in Java. You can even take the same >code, reword it a bit, and feed it into javac. So I won't quote this here >again and Java-ise it, just assume the above is Java code (BTW: you can >even do #ifdefs with statics). This Java code will have this import >statement at the top: > >import static Windows.*; > >In Windows.java would look like this (in fact it does, I've done this in >jpathwatch): > >static native long CreateFile(String fileName, int desiredAccess, int >shareMode, SECURITY_ATTRIBUTES securityAttributes, int >creationDisposition, int flagsAndAttributes, long templateFileHandle); > >And the code in Windows.cpp? That calls the native CreateFile() function. >And that's all (There's some special handling so GetLastError() works in >different threads and won't interfere with the JVM, but that's another >topic) > > > >The native code in the rewrite is the minimum necessary to > control the hardware - in fact, that is one of the rewrite's design > goals. The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I set > the bar pretty low, but I might be wrong. > > > > >See above; it can be even less. > >And since I keep saying I've done it, have a look at these files: >Windows.cpp >jpathwatch-native/src/Windows.cpp?revision=130&view=markup>[1], >Windows.java >jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&v >iew=markup>[2], WindowsPathWatchService.java >jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.jav >a?revision=130&view=markup>[3] > >Don't understand this as a criticism of your design, I actually quite >like it. All I am saying is that it doesn't need to be all native, and >that if you make the Dispatcher an abstract class like I proposed in my >previous email, implementors can choose which language they use (and yes, >I'd choose Java over C++; and I've written C++ code for more than 15 >years) > >Cheers, > >Uwe > >[1] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-native/src/Windows.cpp?revision=130&view=markup >[2] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&vi >ew=markup >[3] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java >?revision=130&view=markup > > > > > -Adrian > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > >Hi Adrian, > > I've followed the discussion about the rewrite over the past > months, and I'm sorry to hear interest in it hasn't picked up. > I've had a look at the source code yesterday, and it seems very > well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because > it currently only runs on Windows. I know from first hand > experience (jpathwatch) that it's quite hard to write robust > cross-platform Java libraries containing native code, and that > people might be hesitant to pick up development on something like > that. > > I was contemplating of toying around with the code base a couple > of times, but I'd rather write as much platform dependent code as > I can in Java (this might be a matter of preference, however, I > have found that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I > suggest that: > > * the Dispatcher Java class becomes abstract, without native > methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by > Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be > implemented almost entirely in Java. This way, every OS can > implement it's own dispatcher. > > This gives the implementor the option to choose whether to write > their implementation as a fat native library (like the one you > have implemented for Windows), or in Java with a slim native > library (which only wraps OS function calls). > In turn, it might make it more attractive for developers to jump > in and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian > Crum adrian.crum-at-sandglass-software.com > > |rxtx.org > mailing list/Example Allow| > wrote: > >Thank you for doing that. There hasn't > been much community interest in the rewrite, and I've been > busy since I started it. I hope to work on it some more in the > next month or two. > > > -Adrian > > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: >http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > > What could be useful is an entry in the wiki > documenting the mile-stones and what is left to be > done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > > The rewrite isn't finished - it still needs Java > unit tests and native code for Apple and *nix. You > can find more information on the mailing list: >http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, >adrian.crum at sandglass-software.com > wrote: > > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas: > > > What is the timeline to merge the two? Also, > what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > > The latest working source is in src, and a > recent rewrite of the library is in > Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: > > Hi, > > I am seeing two Java source folder in the > CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there > any need to keep the one we shouldn't be > using around? > > Andre >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > >http://mailman.qbang.org/mailman/listinfo/rxtx > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From adrian.crum at sandglass-software.com Mon Feb 28 08:15:18 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 07:15:18 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> Message-ID: <4D6BBC06.4090402@sandglass-software.com> Thank you for the suggestions - I will keep them in mind the next time I work on it. -Adrian On 2/28/2011 3:52 AM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > As far as I know, any Java library that manipulates hardware > devices is going to need native code. If the JRE contains classes > that already do that, then I'm unaware of them. In other words, I > don't know how one would accomplish "making OS calls" without > native code. > > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as a > static native Java method, so it becomes directly callable from Java > code (only visible to implementation, not publicly). So while the code > all around the CreateFile() call is all Java (granted, it's platform > specific, it has to be), the 'public static native CreateFile()' > method is implemented in C++ - and all it does is to call the native > CreateFile() function. > > > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there will > be few willing to engage in it. I don't agree that Java code > should contain as much platform-specific code as possible. That > might make things easier for you, but it defeats the "write once, > run anywhere" design of Java. > > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. > > > I'm not sure what you mean by "fat native code" versus "slim > native code." > > > Fat native libraries have methods like this, all written in C++: Lots > of pointers here, lots of things that could go wrong (but I'm not > saying it does, just showing the potential, think threading) - and I'm > a cheeky bastard here and quote from W32_Support.cpp: > > CommPort* CommPortFactory::getInstance(const char *portName, int portType) > { > #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); > #endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } > ... > // SNIP! > > Fact is, you can write all of this in Java. You can even take the same > code, reword it a bit, and feed it into javac. So I won't quote this > here again and Java-ise it, just assume the above is Java code (BTW: > you can even do #ifdefs with statics). This Java code will have this > import statement at the top: > > import static Windows.*; > > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > > static native long CreateFile(String fileName, int desiredAccess, int > shareMode, SECURITY_ATTRIBUTES securityAttributes, int > creationDisposition, int flagsAndAttributes, long templateFileHandle); > > And the code in Windows.cpp? That calls the native CreateFile() > function. And that's all (There's some special handling so > GetLastError() works in different threads and won't interfere with the > JVM, but that's another topic) > > The native code in the rewrite is the minimum necessary to control > the hardware - in fact, that is one of the rewrite's design goals. > The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I > set the bar pretty low, but I might be wrong. > > > See above; it can be even less. > > And since I keep saying I've done it, have a look at these files: > Windows.cpp > [1], > Windows.java > [2], > WindowsPathWatchService.java > [3] > > Don't understand this as a criticism of your design, I actually quite > like it. All I am saying is that it doesn't need to be all native, and > that if you make the Dispatcher an abstract class like I proposed in > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) > > Cheers, > > Uwe > > [1] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup > > [2] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup > > [3] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Feb 28 09:51:19 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 17:51:19 +0100 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <20110228165119.GD10695@elberon.bln.de.ingenico.com> * Andre-John Mas wrote on Fri, Feb 18, 2011 at 21:43 -0500: > Is anyone using JDK 1.4 or less? Yes, 1.4.2_11-b06 (j2sdk-1_4_2_11-fcs-linux-i586) in some cases (also similar versions: 1.4.2_15-b02, 1.4.2_16-b05, maybe others). > I am asking because I would be interested in bringing the code > up to Java 1.5 standards, with the use of generics and other > recent developments. Why that? oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Mon Feb 28 10:20:53 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 18:20:53 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6BBC06.4090402@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> Message-ID: <20110228172052.GE10695@elberon.bln.de.ingenico.com> * Adrian Crum wrote on Mon, Feb 28, 2011 at 07:15 -0800: [...] > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. I think in general it can be good to have an system-abstracting interface of the native code. That means, the native code implementation abstracts from the system (instead of implementing that abstractions in Java). Of course it is more complex :) IIRC we already had such a discussion here. > Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as > a static native Java method, so it becomes directly callable > from Java code (only visible to implementation, not publicly). > So while the code all around the CreateFile() call is all Java > (granted, it's platform specific, it has to be), the 'public > static native CreateFile()' method is implemented in C++ - and > all it does is to call the native CreateFile() function. I don't think I'd like this. CreateFile() is very system-specific. Exposing this to Java code makes this Java code system-specific. Although you could "run" it everywhere, it won't work anyware except on appropriate windows boxes. But this goes even further, you might consider calling open and select from Java and use it for serial ports on linux, but on another system that have both functions, they simply won't work (like on windows; there should be open and select, but AFAIK the latter cannot be expected to work on serial interfaces). Of course there is an somewhat strong argument, that is if the developer is much more experienced with Java than with C, it might be easier to implement this in Java, but personally I think it is hard to believe that developers who are able to correctly abstract device-I/O from system calls are not good at C, because I'm sure C is the language system by system programmers. > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there > will be few willing to engage in it. I don't agree that Java > code should contain as much platform-specific code as possible. > That might make things easier for you, but it defeats the > "write once, run anywhere" design of Java. Java runs on compliant JVMs only and nowhere else. It just happens that JVMs exist for most systems of a special set of computers such as PCs and small servers (but not neccesarily for embedded devices or main frames). As soon as a single native function is needed (required) for the application to work properly, the `run anywhere' is already impossible, because now it does not run on any JVM but only on JVMs that supply an implementation for this native code function. > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. Yes, exactly. Also, it is possible to write system-specific applications `with 100% Java' (for example, hardcode "C:\\Program Files" to be windows-specific or use "/dev/null" or so). Expecting a certain behavior not specified by Java (e.g. whether you can read "/dev/null", what CreateFile returns or whether select works on non-socket-filehandles) IMHO already misses the "write once, run anywhere" idea. So in summary I don't think the amount of platform-specific code matters much. It must be avaiable, requiring deployment etc, so little difference how many lines of code that were. [...] > import static Windows.*; > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > static native long CreateFile(String fileName, int desiredAccess, int [...] Someone here also proposed to use a general method to invoke arbitrary functions of shared libraries, JNA. By this, you wouldn't need `static NATIVE long CreateFile'; you could replace JNI by JNA here. Assuming that this native functionality would already be deployed on many target platform systems, implementing all the platform-specific code in Java can make sense, because this specific implementations would not require additional native code deployment. If, for example, the Java installation of Debian would by default already offer native library call execution, platform-specific code implemented in Java would work on Debian without needing any additional binary lib to be installed, I think could be quite an advantage. I think if having some Windows.java layer (which I personally would not like), JNA IMHO seems to be suited well. Personally, I prefere to define nice, simple and comfortable interfaces, also for native code (if possible, for JNI I think it always is a compromise). > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) Do you mean in general or also specifically for system programming? If someone would need a small program to let's say query DCD on linux I think a small C application would be suited best. Of course this topic also is more complex and depends on things. oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From msemtd at googlemail.com Mon Feb 28 13:50:42 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 28 Feb 2011 20:50:42 +0000 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172052.GE10695@elberon.bln.de.ingenico.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: This was discussed to death last year - summary: - * JNI is too hard * JNA is compelling * yay! let's start a rewrite Time passes... Current status: Windows-only and incomplete Back in non-vaporware land (this is meant in good humour BTW), the current RXTX platform-specifics are achieved with ports of POSIX termios.h[1]. It just works (mostly, kinda!) and you have to treat it nice and test it to death for _YOUR_ platform in _YOUR_ application but, y'know, that's what professional software engineers just do anyway. I seriously don't believe anyone will come up with anything better anytime soon. Regards, Michael Erskine. [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition From iqzw2r602 at sneakemail.com Mon Feb 28 15:01:20 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 09:01:20 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <6175-1298930480-518642@sneakemail.com> Good summary. This whole JNI/JNA/C++ thing only came up again because I tried to explain my motivations for my initial request. And I agree, let's not discuss this further, we've been there already. So let's get this discussion back on track: All I suggested is to separate the implementation of the Dispatcher Java class into a NativeDispatcher class and a Dispatcher interface, so people can implement the Dispatcher (Java-) interface with whatever Three-Letter-Abbreviation they want. So can people please comment on that? Cheers, Uwe On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 > Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 15:22:21 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 14:22:21 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <4D6C201D.6060103@sandglass-software.com> One of the issues I tried to address in the rewite is the "JNI is too hard" issue. Anyone with rudimentary C++ skills can implement the two virtual classes and two functions - no knowledge of JNI is necessary because Dispatcher.cpp takes care of all of the JNI data type marshalling/unmarshalling. I don't agree that the 2.x versions "just work" - the recurring bugs mentioned on this list and in other forums are evidence of that. I tried to work with the 2.x version by wrapping it in thread-safe classes, but even that didn't help. I tried to fix the most recent version by supplying patches, but the sum of the patches added up to a rewrite. So I created a rewrite instead. -Adrian On 2/28/2011 12:50 PM, Michael Erskine wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Mon Feb 28 16:24:00 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 15:24:00 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <6175-1298930480-518642@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> Message-ID: <4D6C2E90.9010601@sandglass-software.com> My question would be: Why would you do that? The rewrite does most of the work for you - all you have to do is implement two C++ virtual classes and two C++ functions. In Windows that took me a few hours. I can't imagine other ports taking much longer than that - especially since POSIX-based code can be shared between ports. What you're suggesting would require a great deal more effort than necessary. -Adrian On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to > explain my motivations for my initial request. And I agree, let's not > discuss this further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher > Java class into a NativeDispatcher class and a Dispatcher interface, > so people can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine > msemtd-at-googlemail.com |rxtx.org > mailing list/Example Allow| > <6zkk4zdpgt at sneakemail.com > wrote: > > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Mon Feb 28 17:26:18 2011 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Mon, 28 Feb 2011 17:26:18 -0700 Subject: [Rxtx] =?utf-8?q?Which_Java_folder_in_source=3F?= Message-ID: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 17:40:03 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 16:40:03 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> References: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> Message-ID: <4D6C4063.5060708@sandglass-software.com> Speaking of bugs one knows - was anyone interested in the bug fixing effort you proposed? -Adrian On 2/28/2011 4:26 PM, jfh at greenhousepc.com wrote: > Adrian, > > I have many dozens of clients using the RXTX jar on a wide variety of > Windows, Linux and a few MacOS X releases. Provided one does what the > previous poster suggested, the code really does "just work". > > Most of the problems that get reported are things that Windows > applications, and not a few Linux ones as well, have problems with > already. > > The other issue is that even with a boat load of testing, I have no > expectation to migrate to the re-write until 3Q12 at the absolute > earliest. > > I appreciate the effort you are putting into this re-write, but after > 32 years in this field (that's more years than many on this list are > alive), I've seen a lot of "re-writes". I've even done a few myself, > some better than others. > > That 32 years of software engineering experience has taught me one > vital lesson -- the bugs one knows are far less dangerous than the > bugs one doesn't know. And all re-writes are a minefield of unknown > bugs. For my products, it takes about 9 =months= before a release is > stable enough that I'm truly pleased with it. I'm still struggling > with bugs from new features I added in my 3Q10 release. I don't need > to struggle with the new bugs that are going to come from the > re-write. Not personal, just my 32 years of experience. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com > // greenHousePC on Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Which Java folder in source? > From: Adrian Crum > ; > Date: Mon, February 28, 2011 4:22 pm > To: rxtx at qbang.org > > One of the issues I tried to address in the rewite is the "JNI is too > hard" issue. Anyone with rudimentary C++ skills can implement the two > virtual classes and two functions - no knowledge of JNI is necessary > because Dispatcher.cpp takes care of all of the JNI data type > marshalling/unmarshalling. > > I don't agree that the 2.x versions "just work" - the recurring bugs > mentioned on this list and in other forums are evidence of that. I > tried > to work with the 2.x version by wrapping it in thread-safe > classes, but > even that didn't help. I tried to fix the most recent version by > supplying patches, but the sum of the patches added up to a > rewrite. So > I created a rewrite instead. > > -Adrian > > On 2/28/2011 12:50 PM, Michael Erskine wrote: > > This was discussed to death last year - summary: - > > * JNI is too hard > > * JNA is compelling > > * yay! let's start a rewrite > > > > Time passes... > > > > Current status: Windows-only and incomplete > > > > Back in non-vaporware land (this is meant in good humour BTW), the > > current RXTX platform-specifics are achieved with ports of POSIX > > termios.h[1]. > > > > It just works (mostly, kinda!) and you have to treat it nice and test > > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > > that's what professional software engineers just do anyway. I > > seriously don't believe anyone will come up with anything better > > anytime soon. > > > > Regards, > > Michael Erskine. > > > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From iqzw2r602 at sneakemail.com Mon Feb 28 18:59:48 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 12:59:48 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6C2E90.9010601@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> Message-ID: <13486-1298944789-675699@sneakemail.com> On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > My question would be: Why would you do that? > I'm thinking about the debugging effort, quite frankly. When I started off with jpathwatch, I initially wrote a fat native library. It got me into trouble: It was hard to debug, the JVM would crash every now and then, depending which bug it hit, and debugging a process with a JVM (even on Windows) is not fun. When I finally got it to work on Windows, I started doing Linux, and the same thing happened again - and I didn't find the tools as nice. When it started sucking up too much of my time I scrapped the whole thing, literally, and moved to a slim native library. I wrote the new implementation in a fraction of the time, and it rarely ever crashed (because except for the little C++ code to wrap OS functions there was nothing that could). So that's my reason to write things in Java mainly for a project like this. Others prefer C++. What I'm suggesting gives people a choice to use the tool they're most comfortable with (because this is really about people, not code; the code won't write and fix itself, people have to go in and do it) > The rewrite does most of the work for you - all you have to do is implement > two C++ virtual classes and two C++ functions. In Windows that took me a few > hours. I can't imagine other ports taking much longer than that - especially > since POSIX-based code can be shared between ports. > And that's fine for people who want to write a native code implementation. I'm not talking about scrapping that at all, quite the contrary - Windows and the C++ framework should stay as it is, it's quite a large contribution you've made in time and effort, it'd be stupid to abandon that. Even more so, other platforms could build on the C++ code you've written, as you intended. All this would provide is another option, so people can also implement a platform in Java with any TLA they want (don't want to mention technologies here, that'll start another flame war ;) > What you're suggesting would require a great deal more effort than > necessary. > No, I don't think so; it'd be a quite simple refactoring task: * Copy Dispatcher.java into NativeDispatcher.java and change constructor name. Make it derive from Dispatcher * Make all methods in the original Dispatcher.java abstract except for getInstance(). That method does System.getProperty("os.name") to decide which implementation to instantiate. On Windows (and other platforms that implement the C++ interface), it instantiates NativeDispatcher. On yet others, it would instantiate the MyOSNameHereDispatcher * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename corresponding C++ class I'd think this is about 3 hours of work. I'm even happy to have a shot at it, but I have no commit rights to CVS, and I certainly don't intend to make changes that other people don't like. Remember, this discussion stemmed from people being worried that the rewrite is Windows-only right now. So the goal is to get more supported platforms, and to get there you'll need people to contribute code. I think providing more options will attract more contributors. It would certainly make it more attractive for me. Cheers, Uwe > -Adrian > > > > On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to explain > my motivations for my initial request. And I agree, let's not discuss this > further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher Java > class into a NativeDispatcher class and a Dispatcher interface, so people > can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | > rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > >> This was discussed to death last year - summary: - >> * JNI is too hard >> * JNA is compelling >> * yay! let's start a rewrite >> >> Time passes... >> >> Current status: Windows-only and incomplete >> >> Back in non-vaporware land (this is meant in good humour BTW), the >> current RXTX platform-specifics are achieved with ports of POSIX >> termios.h[1]. >> >> It just works (mostly, kinda!) and you have to treat it nice and test >> it to death for _YOUR_ platform in _YOUR_ application but, y'know, >> that's what professional software engineers just do anyway. I >> seriously don't believe anyone will come up with anything better >> anytime soon. >> >> Regards, >> Michael Erskine. >> >> [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 >> Edition >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 19:32:12 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 18:32:12 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <13486-1298944789-675699@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> <13486-1298944789-675699@sneakemail.com> Message-ID: <4D6C5AAC.3070508@sandglass-software.com> Just to make sure I'm understanding you correctly, anyone porting RxTx to a new platform would have to do the following: 1. Write their own Java implementation of an abstract Dispatcher class. 2. Write a native (JNI or JNA) interface for the abstract class implementation. 3. Write all of the native (or non-native) code to implement the native interface. Is that correct? If yes, how is that easier than the simple implementation the current rewrite design uses? On a side note: there is no requirement to write native code using C++. If C++ is a real obstacle to adoption, then regular C could be used instead. In that case, there would be a Dispatcher.c file that contains function protoypes that need to be implemented. Dispatcher.c would still maintain the same role as Dispatcher.cpp - which is to shield native code developers from the details of JNI. Just build out the missing functions using C data types and you're ready to go. -Adrian On 2/28/2011 5:59 PM, iqzw2r602 at sneakemail.com wrote: > On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > What you're suggesting would require a great deal more effort than > necessary. > > > No, I don't think so; it'd be a quite simple refactoring task: > * Copy Dispatcher.java into NativeDispatcher.java and change > constructor name. Make it derive from Dispatcher > * Make all methods in the original Dispatcher.java abstract except for > getInstance(). That method does System.getProperty("os.name > ") to decide which implementation to instantiate. On > Windows (and other platforms that implement the C++ interface), it > instantiates NativeDispatcher. On yet others, it would instantiate the > MyOSNameHereDispatcher > * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename > corresponding C++ class > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:17:27 -0800 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5FED17.4080105@sandglass-software.com> RxTx is based on the javax.comm API - which was created before Java 1.5. If you use generics, you will break the API. -Adrian On 2/18/2011 6:43 PM, Andre-John Mas wrote: > Hi, > > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Sat Feb 19 09:19:02 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 19 Feb 2011 08:19:02 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: Message-ID: <4D5FED76.1060407@sandglass-software.com> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. -Adrian On 2/18/2011 6:29 PM, Andre-John Mas wrote: > Hi, > > I am seeing two Java source folder in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there any need to keep the one we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sat Feb 19 16:17:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 19 Feb 2011 18:17:07 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D5FED76.1060407@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> Message-ID: What is the timeline to merge the two? Also, what is the CNI folder for? On 19-Feb-2011, at 11:19, Adrian Crum wrote: > The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: >> Hi, >> >> I am seeing two Java source folder in the CVS repository checkout: >> - src/ >> - Rewrite2010/src/ >> >> Which one should we be using and is there any need to keep the one we shouldn't be using around? >> >> Andre >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 19 17:22:50 2011 From: adrian.crum at sandglass-software.com (adrian.crum at sandglass-software.com) Date: Sat, 19 Feb 2011 18:22:50 -0600 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> Message-ID: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> There is no timeline to merge the two versions. -Adrian Quoting Andre-John Mas : > What is the timeline to merge the two? Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > >> The latest working source is in src, and a recent rewrite of the >> library is in Rewrite2010/src. >> >> -Adrian >> >> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>> Hi, >>> >>> I am seeing two Java source folder in the CVS repository checkout: >>> - src/ >>> - Rewrite2010/src/ >>> >>> Which one should we be using and is there any need to keep the one >>> we shouldn't be using around? >>> >>> Andre >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Sun Feb 20 02:28:54 2011 From: lfarkas at lfarkas.org (Farkas Levente) Date: Sun, 20 Feb 2011 10:28:54 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D60DED6.2090301@lfarkas.org> is there any plan to and updated version? 2.2pre is a few years old with many problems without update... On 02/20/2011 01:22 AM, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the >>> library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one >>>> we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From ajmas at sympatico.ca Sun Feb 20 08:23:22 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Feb 2011 10:23:22 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: Are there any show stoppers to using the rewrite instead of the current source branch? On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas : > >> What is the timeline to merge the two? Also, what is the CNI folder for? >> >> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >> >>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>> >>> -Adrian >>> >>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>> Hi, >>>> >>>> I am seeing two Java source folder in the CVS repository checkout: >>>> - src/ >>>> - Rewrite2010/src/ >>>> >>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>> >>>> Andre >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sun Feb 20 08:59:40 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 20 Feb 2011 07:59:40 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> Message-ID: <4D613A6C.80304@sandglass-software.com> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. -Adrian On 2/20/2011 7:23 AM, Andre-John Mas wrote: > Are there any show stoppers to using the rewrite instead of the current source branch? > > On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: > >> There is no timeline to merge the two versions. >> >> -Adrian >> >> Quoting Andre-John Mas: >> >>> What is the timeline to merge the two? Also, what is the CNI folder for? >>> >>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>> >>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>> >>>> -Adrian >>>> >>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>> Hi, >>>>> >>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>> - src/ >>>>> - Rewrite2010/src/ >>>>> >>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>> >>>>> Andre >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From storrellas at bdigital.org Wed Feb 23 10:37:48 2011 From: storrellas at bdigital.org (Sergi Torrellas) Date: Wed, 23 Feb 2011 18:37:48 +0100 Subject: [Rxtx] Serial port description Message-ID: Hi all, I am using the library RXTX for connecting to a USB port that is mapped to a serial port. My question is the following is possible to get a longer description of the serial part a part from the COMX? Many thanks, -- *SERGI TORRELLAS SOCASTRO Desenvolupador R+D Salut M. 616.21.72.97** *storrellas at bdigital.org *BARCELONA DIGITAL CENTRE TECNOL?GIC* Roc Boronat 117, 5a planta, 08018 Barcelona Tel. +34 93 553 45 40 - Fax. +34 93 553 45 41 www.bdigital.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From showard314 at gmail.com Wed Feb 23 21:46:30 2011 From: showard314 at gmail.com (Scott Howard) Date: Wed, 23 Feb 2011 23:46:30 -0500 Subject: [Rxtx] compiling rxtx on archs without sys/io.h Message-ID: Hello all, There is a bug at: http://bugzilla.qbang.org/show_bug.cgi?id=72 for fixing a build failure on PPCs. A similar build failure occurs on mips, ARM, sparc, and a few other architectures. You can work around it be using AC_CHECK_HEADERS and properly shielding #include . I uploaded a new patch to that bug which does that, and have compiled rxtx on those architectures. This will also work for future architectures and won't require manually updating the #ifdefs. If you do use this patch, you should also edit the individual Makefiles (like Makefile.mingw32) to properly #define or #undef HAVE_SYS_IO_H Regards, Scott From ajmas at sympatico.ca Fri Feb 25 09:03:34 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:03:34 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D613A6C.80304@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. On 20-Feb-2011, at 10:59, Adrian Crum wrote: > The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: >> Are there any show stoppers to using the rewrite instead of the current source branch? >> >> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >> >>> There is no timeline to merge the two versions. >>> >>> -Adrian >>> >>> Quoting Andre-John Mas: >>> >>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>> >>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>> >>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>> Hi, >>>>>> >>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>> - src/ >>>>>> - Rewrite2010/src/ >>>>>> >>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>> >>>>>> Andre >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 25 09:17:23 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 25 Feb 2011 11:17:23 -0500 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > >> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >> >> -Adrian >> >> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>> Are there any show stoppers to using the rewrite instead of the current source branch? >>> >>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>> >>>> There is no timeline to merge the two versions. >>>> >>>> -Adrian >>>> >>>> Quoting Andre-John Mas: >>>> >>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>> >>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>> >>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>> - src/ >>>>>>> - Rewrite2010/src/ >>>>>>> >>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>> >>>>>>> Andre >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From adrian.crum at sandglass-software.com Sat Feb 26 18:58:27 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sat, 26 Feb 2011 17:58:27 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> Message-ID: <4D69AFC3.50008@sandglass-software.com> Thank you for doing that. There hasn't been much community interest in the rewrite, and I've been busy since I started it. I hope to work on it some more in the next month or two. -Adrian On 2/25/2011 8:17 AM, Andre-John Mas wrote: > I have added a stub page here: http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > >> What could be useful is an entry in the wiki documenting the mile-stones and what is left to be done. >> >> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >> >>> The rewrite isn't finished - it still needs Java unit tests and native code for Apple and *nix. You can find more information on the mailing list: http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>> >>> -Adrian >>> >>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> Are there any show stoppers to using the rewrite instead of the current source branch? >>>> >>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>> >>>>> There is no timeline to merge the two versions. >>>>> >>>>> -Adrian >>>>> >>>>> Quoting Andre-John Mas: >>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder for? >>>>>> >>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the library is in Rewrite2010/src. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>> - src/ >>>>>>>> - Rewrite2010/src/ >>>>>>>> >>>>>>>> Which one should we be using and is there any need to keep the one we shouldn't be using around? >>>>>>>> >>>>>>>> Andre >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From iqzw2r602 at sneakemail.com Sun Feb 27 15:47:16 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 09:47:16 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D69AFC3.50008@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> Message-ID: <23853-1298846836-791608@sneakemail.com> Hi Adrian, I've followed the discussion about the rewrite over the past months, and I'm sorry to hear interest in it hasn't picked up. I've had a look at the source code yesterday, and it seems very well designed and nicely documented. IMHO one reason why it hasn't been fully embraced yet is because it currently only runs on Windows. I know from first hand experience (jpathwatch) that it's quite hard to write robust cross-platform Java libraries containing native code, and that people might be hesitant to pick up development on something like that. I was contemplating of toying around with the code base a couple of times, but I'd rather write as much platform dependent code as I can in Java (this might be a matter of preference, however, I have found that it made my life a hell of a lot easier). So to give people choice in how they implement their port, I suggest that: * the Dispatcher Java class becomes abstract, without native methods. * All Java and native code in the Dispatcher class moves to a new NativeDispatcher java/C++ class, which derives from Dispatcher. * The Dispatcher.getInstance() method chooses, per platform, which Dispatcher instance it's going to create. So on Windows and other platforms that like their dispatcher to be native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). On other platforms (say, on BSD based platforms), a different Dispatcher implementation is instantiated, which can be implemented almost entirely in Java. This way, every OS can implement it's own dispatcher. This gives the implementor the option to choose whether to write their implementation as a fat native library (like the one you have implemented for Windows), or in Java with a slim native library (which only wraps OS function calls). In turn, it might make it more attractive for developers to jump in and contribute implementations for other platforms. What do you think? Cheers, Uwe On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > Thank you for doing that. There hasn't been much community interest in the > rewrite, and I've been busy since I started it. I hope to work on it some > more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > >> I have added a stub page here: >> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >> >> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >> >> What could be useful is an entry in the wiki documenting the mile-stones >>> and what is left to be done. >>> >>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>> >>> The rewrite isn't finished - it still needs Java unit tests and native >>>> code for Apple and *nix. You can find more information on the mailing list: >>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>> >>>> -Adrian >>>> >>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>> >>>>> Are there any show stoppers to using the rewrite instead of the current >>>>> source branch? >>>>> >>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>> >>>>> There is no timeline to merge the two versions. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> Quoting Andre-John Mas: >>>>>> >>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>> for? >>>>>>> >>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>> >>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>> library is in Rewrite2010/src. >>>>>>>> >>>>>>>> -Adrian >>>>>>>> >>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>> - src/ >>>>>>>>> - Rewrite2010/src/ >>>>>>>>> >>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>> we shouldn't be using around? >>>>>>>>> >>>>>>>>> Andre >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> >>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Sun Feb 27 16:26:56 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Sun, 27 Feb 2011 15:26:56 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <4D6ADDC0.1020608@sandglass-software.com> As far as I know, any Java library that manipulates hardware devices is going to need native code. If the JRE contains classes that already do that, then I'm unaware of them. In other words, I don't know how one would accomplish "making OS calls" without native code. I agree that developing a Java library that reads/writes serial and parallel hardware is not an easy task - therefore there will be few willing to engage in it. I don't agree that Java code should contain as much platform-specific code as possible. That might make things easier for you, but it defeats the "write once, run anywhere" design of Java. I'm not sure what you mean by "fat native code" versus "slim native code." The native code in the rewrite is the minimum necessary to control the hardware - in fact, that is one of the rewrite's design goals. The rewrite's design reduces native code development down to implementing two virtual classes and two functions. I thought I set the bar pretty low, but I might be wrong. -Adrian On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, > and I'm sorry to hear interest in it hasn't picked up. I've had a look > at the source code yesterday, and it seems very well designed and > nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick up development on something like that. > > I was contemplating of toying around with the code base a couple of > times, but I'd rather write as much platform dependent code as I can > in Java (this might be a matter of preference, however, I have found > that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be implemented > almost entirely in Java. This way, every OS can implement it's own > dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have > implemented for Windows), or in Java with a slim native library (which > only wraps OS function calls). > In turn, it might make it more attractive for developers to jump in > and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > Thank you for doing that. There hasn't been much community > interest in the rewrite, and I've been busy since I started it. I > hope to work on it some more in the next month or two. > > -Adrian > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: > http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > What could be useful is an entry in the wiki documenting > the mile-stones and what is left to be done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > The rewrite isn't finished - it still needs Java unit > tests and native code for Apple and *nix. You can find > more information on the mailing list: > http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, > adrian.crum at sandglass-software.com > wrote: > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas >: > > What is the timeline to merge the two? > Also, what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > The latest working source is in src, > and a recent rewrite of the library is > in Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas > wrote: > > Hi, > > I am seeing two Java source folder > in the CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and > is there any need to keep the one > we shouldn't be using around? > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:28:56 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:28:56 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() Message-ID: Hi, I have a receive thread that does nothing but call read() on the serial port input stream. It works fine for a while but after running for a long time it eventually returns -1 which means EOF. This is my first problem, as the device I'm talking to runs forever, I don't know why it would return -1. I am calling disableReceiveThreshold() and disableReceiveTimeout() at initialization which according to the documentation means read will return as soon as any data is available and it will block forever when data is not available, so -1 should never be returned from read, right? I have been unable to figure out why read returns -1 after a long while but I have found that if I kill my application and restart it everything works fine again. Therefore I tried to work around the problem by having my code close the port and reopen it when read returns -1. My second problem is that in this case when I call close() on the port it blocks forever. I did find this old bug http://bugzilla.qbang.org/show_bug.cgi?id=53 which describes close() hanging on OSX, but it says that bug was fixed with a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any idea why read might be returning -1 in the first place? If I can avoid that I don't care about close() hanging because I would never close the port. If not, does anyone know why close() might block forever and how I can prevent this? I'm using RXTX version 2.1-7. Thanks, -- Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.boder at gmail.com Sun Feb 27 22:34:04 2011 From: ryan.boder at gmail.com (Ryan Boder) Date: Mon, 28 Feb 2011 00:34:04 -0500 Subject: [Rxtx] RXTX serial port read() returns -1 unexpectedly and then blocks forever on close() In-Reply-To: References: Message-ID: I mis-spoke, I don't have my own thread calling read, I am calling read in the event handler after receiving a SerialPortEvent.DATA_AVAILABLE event. Everything else I said should be accurate though. Ryan On Mon, Feb 28, 2011 at 12:28 AM, Ryan Boder wrote: > Hi, > > I have a receive thread that does nothing but call read() on the serial > port input stream. It works fine for a while but after running for a long > time it eventually returns -1 which means EOF. This is my first problem, as > the device I'm talking to runs forever, I don't know why it would return -1. > I am calling disableReceiveThreshold() and disableReceiveTimeout() at > initialization which according to the documentation means read will return > as soon as any data is available and it will block forever when data is not > available, so -1 should never be returned from read, right? > > I have been unable to figure out why read returns -1 after a long while but > I have found that if I kill my application and restart it everything works > fine again. Therefore I tried to work around the problem by having my code > close the port and reopen it when read returns -1. My second problem is that > in this case when I call close() on the port it blocks forever. I did find > this old bug > > http://bugzilla.qbang.org/show_bug.cgi?id=53 > > which describes close() hanging on OSX, but it says that bug was fixed with > a patch in May 2006. Anyway I am on Window 7, not OSX. Does anyone have any > idea why read might be returning -1 in the first place? If I can avoid that > I don't care about close() hanging because I would never close the port. If > not, does anyone know why close() might block forever and how I can prevent > this? I'm using RXTX version 2.1-7. > > Thanks, > -- > Ryan > > -- Ryan Boder 1 614 598-6339 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.w.janssen at lxtreme.nl Mon Feb 28 04:09:50 2011 From: j.w.janssen at lxtreme.nl (Jan Willem Janssen) Date: Mon, 28 Feb 2011 12:09:50 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <23853-1298846836-791608@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> Message-ID: <123a513d85e4569df1ebce58088e6592.squirrel@lxtreme.homelinux.org> FWIW: I'm also interested in the 2010-rewrite, but was waiting until a bit more code was available for other platforms, like Linux and/or OSX. I'd like to offer my help if needed, for example to test stuff. Regards, Jan Willem On Sun, February 27, 2011 23:47, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm > sorry to hear interest in it hasn't picked up. I've had a look at the > source > code yesterday, and it seems very well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to > pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java > (this > might be a matter of preference, however, I have found that it made my > life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a > NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely > in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. From iqzw2r602 at sneakemail.com Mon Feb 28 04:52:33 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Mon, 28 Feb 2011 22:52:33 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6ADDC0.1020608@sandglass-software.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> Message-ID: <15854-1298893954-139343@sneakemail.com> Hi Adrian, On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > As far as I know, any Java library that manipulates hardware devices is > going to need native code. If the JRE contains classes that already do that, > then I'm unaware of them. In other words, I don't know how one would > accomplish "making OS calls" without native code. > Yes, you're right, you need native code to do that. The only question is how much. I'm not saying that you wouldn't write native code. I'm just saying you'll need very little. Take CreateFile() on Windows. Your implementation calls it from C++ code, which implements logic all around it. However, you can also call CreateFile() from Java code, and this is what I'm proposing: Expose the CreateFile() function to Java as a static native Java method, so it becomes directly callable from Java code (only visible to implementation, not publicly). So while the code all around the CreateFile() call is all Java (granted, it's platform specific, it has to be), the 'public static native CreateFile()' method is implemented in C++ - and all it does is to call the native CreateFile() function. > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few willing > to engage in it. I don't agree that Java code should contain as much > platform-specific code as possible. That might make things easier for you, > but it defeats the "write once, run anywhere" design of Java. > "write once, run anywhere" (WORA) does apply for client code calling RXTX. However, it doesn't mean that you can't or shouldn't write platform specific code to /implement/ a library that's doing OS specific things; in fact you have to: CreateFile() only exists on Windows, open() only on Unix, etc., so you have to write code specific to each platform that calls these functions and handles their semantics. And in case you haven't noticed yet, the JDK does the same thing, it has platform specific Java classes for lots of things (try debugging the methods of java.io.File, or the parts of the AWT, and see where they call into). The point of WORA is that client code - code that calls into RXTX - should not have to deal with specifics of a platform. > I'm not sure what you mean by "fat native code" versus "slim native code." > Fat native libraries have methods like this, all written in C++: Lots of pointers here, lots of things that could go wrong (but I'm not saying it does, just showing the potential, think threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: CommPort* CommPortFactory::getInstance(const char *portName, int portType) { #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS if (strcmp("PARALLEL_PASS", portName) == 0) return new ParallelLoopback(portName); if (strcmp("SERIAL_PASS", portName) == 0) return new SerialLoopback(portName); #endif // Do not open overlapped. Let the Java application // handle multi-threaded I/O. HANDLE hComm = CreateFile( portName, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); if (hComm == INVALID_HANDLE_VALUE) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); printf("%s\n", lpMsgBuf); delete lpMsgBuf; throw IOException(); } .... // SNIP! Fact is, you can write all of this in Java. You can even take the same code, reword it a bit, and feed it into javac. So I won't quote this here again and Java-ise it, just assume the above is Java code (BTW: you can even do #ifdefs with statics). This Java code will have this import statement at the top: import static Windows.*; In Windows.java would look like this (in fact it does, I've done this in jpathwatch): static native long CreateFile(String fileName, int desiredAccess, int shareMode, SECURITY_ATTRIBUTES securityAttributes, int creationDisposition, int flagsAndAttributes, long templateFileHandle); And the code in Windows.cpp? That calls the native CreateFile() function. And that's all (There's some special handling so GetLastError() works in different threads and won't interfere with the JVM, but that's another topic) The native code in the rewrite is the minimum necessary to control the > hardware - in fact, that is one of the rewrite's design goals. The rewrite's > design reduces native code development down to implementing two virtual > classes and two functions. I thought I set the bar pretty low, but I might > be wrong. > See above; it can be even less. And since I keep saying I've done it, have a look at these files: Windows.cpp[1], Windows.java[2], WindowsPathWatchService.java [3] Don't understand this as a criticism of your design, I actually quite like it. All I am saying is that it doesn't need to be all native, and that if you make the Dispatcher an abstract class like I proposed in my previous email, implementors can choose which language they use (and yes, I'd choose Java over C++; and I've written C++ code for more than 15 years) Cheers, Uwe [1] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup [2] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup [3] http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > -Adrian > > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > > Hi Adrian, > > I've followed the discussion about the rewrite over the past months, and > I'm sorry to hear interest in it hasn't picked up. I've had a look at the > source code yesterday, and it seems very well designed and nicely > documented. > > IMHO one reason why it hasn't been fully embraced yet is because it > currently only runs on Windows. I know from first hand experience > (jpathwatch) that it's quite hard to write robust cross-platform Java > libraries containing native code, and that people might be hesitant to pick > up development on something like that. > > I was contemplating of toying around with the code base a couple of times, > but I'd rather write as much platform dependent code as I can in Java (this > might be a matter of preference, however, I have found that it made my life > a hell of a lot easier). > > So to give people choice in how they implement their port, I suggest that: > > * the Dispatcher Java class becomes abstract, without native methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be native, > a NativeDispatcher is instantiated by Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different Dispatcher > implementation is instantiated, which can be implemented almost entirely in > Java. This way, every OS can implement it's own dispatcher. > > This gives the implementor the option to choose whether to write their > implementation as a fat native library (like the one you have implemented > for Windows), or in Java with a slim native library (which only wraps OS > function calls). > In turn, it might make it more attractive for developers to jump in and > contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian Crum > adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example > Allow| wrote: > >> Thank you for doing that. There hasn't been much community interest in the >> rewrite, and I've been busy since I started it. I hope to work on it some >> more in the next month or two. >> >> -Adrian >> >> >> On 2/25/2011 8:17 AM, Andre-John Mas wrote: >> >>> I have added a stub page here: >>> http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 >>> >>> On 25-Feb-2011, at 11:03, Andre-John Mas wrote: >>> >>> What could be useful is an entry in the wiki documenting the mile-stones >>>> and what is left to be done. >>>> >>>> On 20-Feb-2011, at 10:59, Adrian Crum wrote: >>>> >>>> The rewrite isn't finished - it still needs Java unit tests and native >>>>> code for Apple and *nix. You can find more information on the mailing list: >>>>> http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. >>>>> >>>>> -Adrian >>>>> >>>>> On 2/20/2011 7:23 AM, Andre-John Mas wrote: >>>>> >>>>>> Are there any show stoppers to using the rewrite instead of the >>>>>> current source branch? >>>>>> >>>>>> On 19-Feb-2011, at 19:22, adrian.crum at sandglass-software.com wrote: >>>>>> >>>>>> There is no timeline to merge the two versions. >>>>>>> >>>>>>> -Adrian >>>>>>> >>>>>>> Quoting Andre-John Mas: >>>>>>> >>>>>>> What is the timeline to merge the two? Also, what is the CNI folder >>>>>>>> for? >>>>>>>> >>>>>>>> On 19-Feb-2011, at 11:19, Adrian Crum wrote: >>>>>>>> >>>>>>>> The latest working source is in src, and a recent rewrite of the >>>>>>>>> library is in Rewrite2010/src. >>>>>>>>> >>>>>>>>> -Adrian >>>>>>>>> >>>>>>>>> On 2/18/2011 6:29 PM, Andre-John Mas wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I am seeing two Java source folder in the CVS repository checkout: >>>>>>>>>> - src/ >>>>>>>>>> - Rewrite2010/src/ >>>>>>>>>> >>>>>>>>>> Which one should we be using and is there any need to keep the one >>>>>>>>>> we shouldn't be using around? >>>>>>>>>> >>>>>>>>>> Andre >>>>>>>>>> _______________________________________________ >>>>>>>>>> Rxtx mailing list >>>>>>>>>> Rxtx at qbang.org >>>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Rxtx mailing list >>>>>>>>> Rxtx at qbang.org >>>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>> Rxtx mailing list >>>>>>>> Rxtx at qbang.org >>>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>>> >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> Rxtx mailing list >>>>>>> Rxtx at qbang.org >>>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>>> >>>>>>> _______________________________________________ >>>>>> Rxtx mailing list >>>>>> Rxtx at qbang.org >>>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>>> >>>>> _______________________________________________ >>>>> Rxtx mailing list >>>>> Rxtx at qbang.org >>>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>>> >>>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 28 05:36:14 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 28 Feb 2011 14:36:14 +0200 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> Message-ID: Sorry for top posting but I felt it was justified here to keep the whole context of the referred text intact. I very much agree with Uwe's point of view, ie doing as much as possible in Java, even the platform specific things, and doing the absolute minimum in C/C++. And this is not criticism Adrian's work/design. I would (again) advocate using JNA instead of JNI to access the native OS services/API from Java. This simplifies the live of the library users and developers a great deal because no C/C++ tool chain is involved. Zero. You don't even need a C compiler. There are some 'issues' in accessing some OS API functions from Java (like the need to use OS specific values in the Java code that are only available with #define in header files) but given the stability and longtime standing of the API functions we are talking about (open/close/select/read/write) I do not see this as big issue. A lot of the argumentation is included in this thread when this was last time rehashed on this list. http://answerpot.com/showthread.php?1022262-JNA%20alternative%20(was:%20rxt x%20moving%20from%20JNI%20to%20JNA%20(was%20%20About%20JRE%20crashes))/Page 1 If anyone is interested I can make the straw man implementation available. It compiles and has a fighting chance to work in a POSIX compatible OS (Mac OS X / Linux) with moderate debugging. Of course it is a long way from production, especially as throwing away the current rxtx also throws away most of the testing and debugging to the obscure/uncommon OSes that rxtx currently supports (I suggest anyone attempting to replace the current implementation has peek at the innards of the current implementation to see the variety it claims to support). (As an aside, and not really relevant to calling OS API from Java with JNA, I feel I need to mention that calling C++ using JNA is not easy because of the name mangling, so libraries with C interface are preferred with JNA). br Kusti On 2/28/11 13:52, "iqzw2r602 at sneakemail.com" wrote: >Hi Adrian, > >On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum >adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| >wrote: > > > > > > > > As far as I know, any Java library that manipulates hardware devices > is going to need native code. If the JRE contains classes that > already do that, then I'm unaware of them. In other words, I don't > know how one would accomplish "making OS calls" without native code. > > > > >Yes, you're right, you need native code to do that. The only question is >how much. I'm not saying that you wouldn't write native code. I'm just >saying you'll need very little. Take CreateFile() on Windows. Your >implementation calls it from C++ code, which implements logic all around >it. > >However, you can also call CreateFile() from Java code, and this is what >I'm proposing: Expose the CreateFile() function to Java as a static >native Java method, so it becomes directly callable from Java code (only >visible to implementation, not publicly). So while the code all around >the CreateFile() call is all Java (granted, it's platform specific, it >has to be), the 'public static native CreateFile()' method is implemented >in C++ - and all it does is to call the native CreateFile() function. > > > > > I agree that developing a Java library that reads/writes serial and > parallel hardware is not an easy task - therefore there will be few > willing to engage in it. I don't agree that Java code should contain > as much platform-specific code as possible. That might make things > easier for you, but it defeats the "write once, run anywhere" design > of Java. > > > > >"write once, run anywhere" (WORA) does apply for client code calling >RXTX. > >However, it doesn't mean that you can't or shouldn't write platform >specific code to /implement/ a library that's doing OS specific things; >in fact you have to: >CreateFile() only exists on Windows, open() only on Unix, etc., so you >have to write code specific to each platform that calls these functions >and handles their semantics. And in case you haven't noticed yet, the JDK >does the same thing, it has platform specific Java classes for lots of >things (try debugging the methods of java.io.File, or the parts of the >AWT, and see where they call into). > >The point of WORA is that client code - code that calls into RXTX - >should not have to deal with specifics of a platform. > > > > > I'm not sure what you mean by "fat native code" versus "slim native > code." > > > >Fat native libraries have methods like this, all written in C++: Lots of >pointers here, lots of things that could go wrong (but I'm not saying it >does, just showing the potential, think >threading) - and I'm a cheeky bastard here and quote from W32_Support.cpp: > >CommPort* CommPortFactory::getInstance(const char *portName, int portType) >{ >#ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); >#endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } >... >// SNIP! > >Fact is, you can write all of this in Java. You can even take the same >code, reword it a bit, and feed it into javac. So I won't quote this here >again and Java-ise it, just assume the above is Java code (BTW: you can >even do #ifdefs with statics). This Java code will have this import >statement at the top: > >import static Windows.*; > >In Windows.java would look like this (in fact it does, I've done this in >jpathwatch): > >static native long CreateFile(String fileName, int desiredAccess, int >shareMode, SECURITY_ATTRIBUTES securityAttributes, int >creationDisposition, int flagsAndAttributes, long templateFileHandle); > >And the code in Windows.cpp? That calls the native CreateFile() function. >And that's all (There's some special handling so GetLastError() works in >different threads and won't interfere with the JVM, but that's another >topic) > > > >The native code in the rewrite is the minimum necessary to > control the hardware - in fact, that is one of the rewrite's design > goals. The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I set > the bar pretty low, but I might be wrong. > > > > >See above; it can be even less. > >And since I keep saying I've done it, have a look at these files: >Windows.cpp >jpathwatch-native/src/Windows.cpp?revision=130&view=markup>[1], >Windows.java >jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&v >iew=markup>[2], WindowsPathWatchService.java >jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.jav >a?revision=130&view=markup>[3] > >Don't understand this as a criticism of your design, I actually quite >like it. All I am saying is that it doesn't need to be all native, and >that if you make the Dispatcher an abstract class like I proposed in my >previous email, implementors can choose which language they use (and yes, >I'd choose Java over C++; and I've written C++ code for more than 15 >years) > >Cheers, > >Uwe > >[1] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-native/src/Windows.cpp?revision=130&view=markup >[2] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&vi >ew=markup >[3] >http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/j >pathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java >?revision=130&view=markup > > > > > -Adrian > > > On 2/27/2011 2:47 PM, iqzw2r602 at sneakemail.com wrote: > >Hi Adrian, > > I've followed the discussion about the rewrite over the past > months, and I'm sorry to hear interest in it hasn't picked up. > I've had a look at the source code yesterday, and it seems very > well designed and nicely documented. > > IMHO one reason why it hasn't been fully embraced yet is because > it currently only runs on Windows. I know from first hand > experience (jpathwatch) that it's quite hard to write robust > cross-platform Java libraries containing native code, and that > people might be hesitant to pick up development on something like > that. > > I was contemplating of toying around with the code base a couple > of times, but I'd rather write as much platform dependent code as > I can in Java (this might be a matter of preference, however, I > have found that it made my life a hell of a lot easier). > > So to give people choice in how they implement their port, I > suggest that: > > * the Dispatcher Java class becomes abstract, without native > methods. > * All Java and native code in the Dispatcher class moves to a new > NativeDispatcher java/C++ class, which derives from Dispatcher. > * The Dispatcher.getInstance() method chooses, per platform, which > Dispatcher instance it's going to create. > > So on Windows and other platforms that like their dispatcher to be > native, a NativeDispatcher is instantiated by > Dispatcher.getInstance(). > On other platforms (say, on BSD based platforms), a different > Dispatcher implementation is instantiated, which can be > implemented almost entirely in Java. This way, every OS can > implement it's own dispatcher. > > This gives the implementor the option to choose whether to write > their implementation as a fat native library (like the one you > have implemented for Windows), or in Java with a slim native > library (which only wraps OS function calls). > In turn, it might make it more attractive for developers to jump > in and contribute implementations for other platforms. > > What do you think? > > Cheers, > > Uwe > > > > On Sun, Feb 27, 2011 at 12:58 PM, Adrian > Crum adrian.crum-at-sandglass-software.com > > |rxtx.org > mailing list/Example Allow| > wrote: > >Thank you for doing that. There hasn't > been much community interest in the rewrite, and I've been > busy since I started it. I hope to work on it some more in the > next month or two. > > > -Adrian > > > > On 2/25/2011 8:17 AM, Andre-John Mas wrote: > > I have added a stub page here: >http://rxtx.qbang.org/wiki/index.php/Development/ReWrite2010 > > On 25-Feb-2011, at 11:03, Andre-John Mas wrote: > > > What could be useful is an entry in the wiki > documenting the mile-stones and what is left to be > done. > > On 20-Feb-2011, at 10:59, Adrian Crum wrote: > > > The rewrite isn't finished - it still needs Java > unit tests and native code for Apple and *nix. You > can find more information on the mailing list: >http://mailman.qbang.org/pipermail/rxtx/2010-September/8084235.html. > > > > -Adrian > > On 2/20/2011 7:23 AM, Andre-John Mas wrote: > > Are there any show stoppers to using the rewrite > instead of the current source branch? > > On 19-Feb-2011, at 19:22, >adrian.crum at sandglass-software.com > wrote: > > > There is no timeline to merge the two versions. > > -Adrian > > Quoting Andre-John Mas: > > > What is the timeline to merge the two? Also, > what is the CNI folder for? > > On 19-Feb-2011, at 11:19, Adrian Crum wrote: > > > The latest working source is in src, and a > recent rewrite of the library is in > Rewrite2010/src. > > -Adrian > > On 2/18/2011 6:29 PM, Andre-John Mas wrote: > > Hi, > > I am seeing two Java source folder in the > CVS repository checkout: > - src/ > - Rewrite2010/src/ > > Which one should we be using and is there > any need to keep the one we shouldn't be > using around? > > Andre >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > >http://mailman.qbang.org/mailman/listinfo/rxtx > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > >_______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From adrian.crum at sandglass-software.com Mon Feb 28 08:15:18 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 07:15:18 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <15854-1298893954-139343@sneakemail.com> References: <4D5FED76.1060407@sandglass-software.com> <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> Message-ID: <4D6BBC06.4090402@sandglass-software.com> Thank you for the suggestions - I will keep them in mind the next time I work on it. -Adrian On 2/28/2011 3:52 AM, iqzw2r602 at sneakemail.com wrote: > Hi Adrian, > > On Mon, Feb 28, 2011 at 10:26 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > As far as I know, any Java library that manipulates hardware > devices is going to need native code. If the JRE contains classes > that already do that, then I'm unaware of them. In other words, I > don't know how one would accomplish "making OS calls" without > native code. > > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as a > static native Java method, so it becomes directly callable from Java > code (only visible to implementation, not publicly). So while the code > all around the CreateFile() call is all Java (granted, it's platform > specific, it has to be), the 'public static native CreateFile()' > method is implemented in C++ - and all it does is to call the native > CreateFile() function. > > > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there will > be few willing to engage in it. I don't agree that Java code > should contain as much platform-specific code as possible. That > might make things easier for you, but it defeats the "write once, > run anywhere" design of Java. > > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. > > > I'm not sure what you mean by "fat native code" versus "slim > native code." > > > Fat native libraries have methods like this, all written in C++: Lots > of pointers here, lots of things that could go wrong (but I'm not > saying it does, just showing the potential, think threading) - and I'm > a cheeky bastard here and quote from W32_Support.cpp: > > CommPort* CommPortFactory::getInstance(const char *portName, int portType) > { > #ifdef RXTX_INCLUDE_SOFTWARE_LOOPBACKS > if (strcmp("PARALLEL_PASS", portName) == 0) > return new ParallelLoopback(portName); > if (strcmp("SERIAL_PASS", portName) == 0) > return new SerialLoopback(portName); > #endif > // Do not open overlapped. Let the Java application > // handle multi-threaded I/O. > HANDLE hComm = CreateFile( portName, > GENERIC_READ | GENERIC_WRITE, > 0, > 0, > OPEN_EXISTING, > 0, > 0 > ); > if (hComm == INVALID_HANDLE_VALUE) > { > LPVOID lpMsgBuf; > FormatMessage( > FORMAT_MESSAGE_ALLOCATE_BUFFER | > FORMAT_MESSAGE_FROM_SYSTEM | > FORMAT_MESSAGE_IGNORE_INSERTS, > NULL, > GetLastError(), > MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), > (LPTSTR) &lpMsgBuf, > 0, > NULL > ); > printf("%s\n", lpMsgBuf); > delete lpMsgBuf; > throw IOException(); > } > ... > // SNIP! > > Fact is, you can write all of this in Java. You can even take the same > code, reword it a bit, and feed it into javac. So I won't quote this > here again and Java-ise it, just assume the above is Java code (BTW: > you can even do #ifdefs with statics). This Java code will have this > import statement at the top: > > import static Windows.*; > > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > > static native long CreateFile(String fileName, int desiredAccess, int > shareMode, SECURITY_ATTRIBUTES securityAttributes, int > creationDisposition, int flagsAndAttributes, long templateFileHandle); > > And the code in Windows.cpp? That calls the native CreateFile() > function. And that's all (There's some special handling so > GetLastError() works in different threads and won't interfere with the > JVM, but that's another topic) > > The native code in the rewrite is the minimum necessary to control > the hardware - in fact, that is one of the rewrite's design goals. > The rewrite's design reduces native code development down to > implementing two virtual classes and two functions. I thought I > set the bar pretty low, but I might be wrong. > > > See above; it can be even less. > > And since I keep saying I've done it, have a look at these files: > Windows.cpp > [1], > Windows.java > [2], > WindowsPathWatchService.java > [3] > > Don't understand this as a criticism of your design, I actually quite > like it. All I am saying is that it doesn't need to be all native, and > that if you make the Dispatcher an abstract class like I proposed in > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) > > Cheers, > > Uwe > > [1] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-native/src/Windows.cpp?revision=130&view=markup > > [2] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/Windows.java?revision=121&view=markup > > [3] > http://jpathwatch.svn.sourceforge.net/viewvc/jpathwatch/trunk/jpathwatch/jpathwatch-java/src/name/pachler/nio/file/impl/WindowsPathWatchService.java?revision=130&view=markup > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.DETTMER at ingenico.com Mon Feb 28 09:51:19 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 17:51:19 +0100 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <20110228165119.GD10695@elberon.bln.de.ingenico.com> * Andre-John Mas wrote on Fri, Feb 18, 2011 at 21:43 -0500: > Is anyone using JDK 1.4 or less? Yes, 1.4.2_11-b06 (j2sdk-1_4_2_11-fcs-linux-i586) in some cases (also similar versions: 1.4.2_15-b02, 1.4.2_16-b05, maybe others). > I am asking because I would be interested in bringing the code > up to Java 1.5 standards, with the use of generics and other > recent developments. Why that? oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Mon Feb 28 10:20:53 2011 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Mon, 28 Feb 2011 18:20:53 +0100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6BBC06.4090402@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> Message-ID: <20110228172052.GE10695@elberon.bln.de.ingenico.com> * Adrian Crum wrote on Mon, Feb 28, 2011 at 07:15 -0800: [...] > Yes, you're right, you need native code to do that. The only question > is how much. I'm not saying that you wouldn't write native code. I'm > just saying you'll need very little. I think in general it can be good to have an system-abstracting interface of the native code. That means, the native code implementation abstracts from the system (instead of implementing that abstractions in Java). Of course it is more complex :) IIRC we already had such a discussion here. > Take CreateFile() on Windows. > Your implementation calls it from C++ code, which implements logic all > around it. > However, you can also call CreateFile() from Java code, and this is > what I'm proposing: Expose the CreateFile() function to Java as > a static native Java method, so it becomes directly callable > from Java code (only visible to implementation, not publicly). > So while the code all around the CreateFile() call is all Java > (granted, it's platform specific, it has to be), the 'public > static native CreateFile()' method is implemented in C++ - and > all it does is to call the native CreateFile() function. I don't think I'd like this. CreateFile() is very system-specific. Exposing this to Java code makes this Java code system-specific. Although you could "run" it everywhere, it won't work anyware except on appropriate windows boxes. But this goes even further, you might consider calling open and select from Java and use it for serial ports on linux, but on another system that have both functions, they simply won't work (like on windows; there should be open and select, but AFAIK the latter cannot be expected to work on serial interfaces). Of course there is an somewhat strong argument, that is if the developer is much more experienced with Java than with C, it might be easier to implement this in Java, but personally I think it is hard to believe that developers who are able to correctly abstract device-I/O from system calls are not good at C, because I'm sure C is the language system by system programmers. > I agree that developing a Java library that reads/writes serial > and parallel hardware is not an easy task - therefore there > will be few willing to engage in it. I don't agree that Java > code should contain as much platform-specific code as possible. > That might make things easier for you, but it defeats the > "write once, run anywhere" design of Java. Java runs on compliant JVMs only and nowhere else. It just happens that JVMs exist for most systems of a special set of computers such as PCs and small servers (but not neccesarily for embedded devices or main frames). As soon as a single native function is needed (required) for the application to work properly, the `run anywhere' is already impossible, because now it does not run on any JVM but only on JVMs that supply an implementation for this native code function. > "write once, run anywhere" (WORA) does apply for client code calling > RXTX. > However, it doesn't mean that you can't or shouldn't write platform > specific code to /implement/ a library that's doing OS specific > things; in fact you have to: CreateFile() only exists on Windows, > open() only on Unix, etc., so you have to write code specific to each > platform that calls these functions and handles their semantics. And > in case you haven't noticed yet, the JDK does the same thing, it has > platform specific Java classes for lots of things (try debugging the > methods of java.io.File, or the parts of the AWT, and see where they > call into). > The point of WORA is that client code - code that calls into RXTX - > should not have to deal with specifics of a platform. Yes, exactly. Also, it is possible to write system-specific applications `with 100% Java' (for example, hardcode "C:\\Program Files" to be windows-specific or use "/dev/null" or so). Expecting a certain behavior not specified by Java (e.g. whether you can read "/dev/null", what CreateFile returns or whether select works on non-socket-filehandles) IMHO already misses the "write once, run anywhere" idea. So in summary I don't think the amount of platform-specific code matters much. It must be avaiable, requiring deployment etc, so little difference how many lines of code that were. [...] > import static Windows.*; > In Windows.java would look like this (in fact it does, I've done this > in jpathwatch): > static native long CreateFile(String fileName, int desiredAccess, int [...] Someone here also proposed to use a general method to invoke arbitrary functions of shared libraries, JNA. By this, you wouldn't need `static NATIVE long CreateFile'; you could replace JNI by JNA here. Assuming that this native functionality would already be deployed on many target platform systems, implementing all the platform-specific code in Java can make sense, because this specific implementations would not require additional native code deployment. If, for example, the Java installation of Debian would by default already offer native library call execution, platform-specific code implemented in Java would work on Debian without needing any additional binary lib to be installed, I think could be quite an advantage. I think if having some Windows.java layer (which I personally would not like), JNA IMHO seems to be suited well. Personally, I prefere to define nice, simple and comfortable interfaces, also for native code (if possible, for JNI I think it always is a compromise). > my previous email, implementors can choose which language they use > (and yes, I'd choose Java over C++; and I've written C++ code for more > than 15 years) Do you mean in general or also specifically for system programming? If someone would need a small program to let's say query DCD on linux I think a small C application would be suited best. Of course this topic also is more complex and depends on things. oki, Steffen About Ingenico: Ingenico is a leading provider of payment, transaction and business solutions, with over 15 million terminals deployed in more than 125 countries. Over 3,000 employees worldwide support merchants, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. http://www.ingenico.com/. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From msemtd at googlemail.com Mon Feb 28 13:50:42 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 28 Feb 2011 20:50:42 +0000 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172052.GE10695@elberon.bln.de.ingenico.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: This was discussed to death last year - summary: - * JNI is too hard * JNA is compelling * yay! let's start a rewrite Time passes... Current status: Windows-only and incomplete Back in non-vaporware land (this is meant in good humour BTW), the current RXTX platform-specifics are achieved with ports of POSIX termios.h[1]. It just works (mostly, kinda!) and you have to treat it nice and test it to death for _YOUR_ platform in _YOUR_ application but, y'know, that's what professional software engineers just do anyway. I seriously don't believe anyone will come up with anything better anytime soon. Regards, Michael Erskine. [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition From iqzw2r602 at sneakemail.com Mon Feb 28 15:01:20 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 09:01:20 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <6175-1298930480-518642@sneakemail.com> Good summary. This whole JNI/JNA/C++ thing only came up again because I tried to explain my motivations for my initial request. And I agree, let's not discuss this further, we've been there already. So let's get this discussion back on track: All I suggested is to separate the implementation of the Dispatcher Java class into a NativeDispatcher class and a Dispatcher interface, so people can implement the Dispatcher (Java-) interface with whatever Three-Letter-Abbreviation they want. So can people please comment on that? Cheers, Uwe On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 > Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 15:22:21 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 14:22:21 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> Message-ID: <4D6C201D.6060103@sandglass-software.com> One of the issues I tried to address in the rewite is the "JNI is too hard" issue. Anyone with rudimentary C++ skills can implement the two virtual classes and two functions - no knowledge of JNI is necessary because Dispatcher.cpp takes care of all of the JNI data type marshalling/unmarshalling. I don't agree that the 2.x versions "just work" - the recurring bugs mentioned on this list and in other forums are evidence of that. I tried to work with the 2.x version by wrapping it in thread-safe classes, but even that didn't help. I tried to fix the most recent version by supplying patches, but the sum of the patches added up to a rewrite. So I created a rewrite instead. -Adrian On 2/28/2011 12:50 PM, Michael Erskine wrote: > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From adrian.crum at sandglass-software.com Mon Feb 28 16:24:00 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 15:24:00 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <6175-1298930480-518642@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> Message-ID: <4D6C2E90.9010601@sandglass-software.com> My question would be: Why would you do that? The rewrite does most of the work for you - all you have to do is implement two C++ virtual classes and two C++ functions. In Windows that took me a few hours. I can't imagine other ports taking much longer than that - especially since POSIX-based code can be shared between ports. What you're suggesting would require a great deal more effort than necessary. -Adrian On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to > explain my motivations for my initial request. And I agree, let's not > discuss this further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher > Java class into a NativeDispatcher class and a Dispatcher interface, > so people can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine > msemtd-at-googlemail.com |rxtx.org > mailing list/Example Allow| > <6zkk4zdpgt at sneakemail.com > wrote: > > This was discussed to death last year - summary: - > * JNI is too hard > * JNA is compelling > * yay! let's start a rewrite > > Time passes... > > Current status: Windows-only and incomplete > > Back in non-vaporware land (this is meant in good humour BTW), the > current RXTX platform-specifics are achieved with ports of POSIX > termios.h[1]. > > It just works (mostly, kinda!) and you have to treat it nice and test > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > that's what professional software engineers just do anyway. I > seriously don't believe anyone will come up with anything better > anytime soon. > > Regards, > Michael Erskine. > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfh at greenhousepc.com Mon Feb 28 17:26:18 2011 From: jfh at greenhousepc.com (jfh at greenhousepc.com) Date: Mon, 28 Feb 2011 17:26:18 -0700 Subject: [Rxtx] =?utf-8?q?Which_Java_folder_in_source=3F?= Message-ID: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 17:40:03 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 16:40:03 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> References: <20110228172617.8ef0e5b4a80cef441275a6330ffad77d.cfe2f8ae8d.wbe@email13.secureserver.net> Message-ID: <4D6C4063.5060708@sandglass-software.com> Speaking of bugs one knows - was anyone interested in the bug fixing effort you proposed? -Adrian On 2/28/2011 4:26 PM, jfh at greenhousepc.com wrote: > Adrian, > > I have many dozens of clients using the RXTX jar on a wide variety of > Windows, Linux and a few MacOS X releases. Provided one does what the > previous poster suggested, the code really does "just work". > > Most of the problems that get reported are things that Windows > applications, and not a few Linux ones as well, have problems with > already. > > The other issue is that even with a boat load of testing, I have no > expectation to migrate to the re-write until 3Q12 at the absolute > earliest. > > I appreciate the effort you are putting into this re-write, but after > 32 years in this field (that's more years than many on this list are > alive), I've seen a lot of "re-writes". I've even done a few myself, > some better than others. > > That 32 years of software engineering experience has taught me one > vital lesson -- the bugs one knows are far less dangerous than the > bugs one doesn't know. And all re-writes are a minefield of unknown > bugs. For my products, it takes about 9 =months= before a release is > stable enough that I'm truly pleased with it. I'm still struggling > with bugs from new features I added in my 3Q10 release. I don't need > to struggle with the new bugs that are going to come from the > re-write. Not personal, just my 32 years of experience. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com > // greenHousePC on Skype > > > -------- Original Message -------- > Subject: Re: [Rxtx] Which Java folder in source? > From: Adrian Crum > ; > Date: Mon, February 28, 2011 4:22 pm > To: rxtx at qbang.org > > One of the issues I tried to address in the rewite is the "JNI is too > hard" issue. Anyone with rudimentary C++ skills can implement the two > virtual classes and two functions - no knowledge of JNI is necessary > because Dispatcher.cpp takes care of all of the JNI data type > marshalling/unmarshalling. > > I don't agree that the 2.x versions "just work" - the recurring bugs > mentioned on this list and in other forums are evidence of that. I > tried > to work with the 2.x version by wrapping it in thread-safe > classes, but > even that didn't help. I tried to fix the most recent version by > supplying patches, but the sum of the patches added up to a > rewrite. So > I created a rewrite instead. > > -Adrian > > On 2/28/2011 12:50 PM, Michael Erskine wrote: > > This was discussed to death last year - summary: - > > * JNI is too hard > > * JNA is compelling > > * yay! let's start a rewrite > > > > Time passes... > > > > Current status: Windows-only and incomplete > > > > Back in non-vaporware land (this is meant in good humour BTW), the > > current RXTX platform-specifics are achieved with ports of POSIX > > termios.h[1]. > > > > It just works (mostly, kinda!) and you have to treat it nice and test > > it to death for _YOUR_ platform in _YOUR_ application but, y'know, > > that's what professional software engineers just do anyway. I > > seriously don't believe anyone will come up with anything better > > anytime soon. > > > > Regards, > > Michael Erskine. > > > > [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, > 2004 Edition > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From iqzw2r602 at sneakemail.com Mon Feb 28 18:59:48 2011 From: iqzw2r602 at sneakemail.com (iqzw2r602 at sneakemail.com) Date: Tue, 1 Mar 2011 12:59:48 +1100 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <4D6C2E90.9010601@sandglass-software.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> Message-ID: <13486-1298944789-675699@sneakemail.com> On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow| wrote: > My question would be: Why would you do that? > I'm thinking about the debugging effort, quite frankly. When I started off with jpathwatch, I initially wrote a fat native library. It got me into trouble: It was hard to debug, the JVM would crash every now and then, depending which bug it hit, and debugging a process with a JVM (even on Windows) is not fun. When I finally got it to work on Windows, I started doing Linux, and the same thing happened again - and I didn't find the tools as nice. When it started sucking up too much of my time I scrapped the whole thing, literally, and moved to a slim native library. I wrote the new implementation in a fraction of the time, and it rarely ever crashed (because except for the little C++ code to wrap OS functions there was nothing that could). So that's my reason to write things in Java mainly for a project like this. Others prefer C++. What I'm suggesting gives people a choice to use the tool they're most comfortable with (because this is really about people, not code; the code won't write and fix itself, people have to go in and do it) > The rewrite does most of the work for you - all you have to do is implement > two C++ virtual classes and two C++ functions. In Windows that took me a few > hours. I can't imagine other ports taking much longer than that - especially > since POSIX-based code can be shared between ports. > And that's fine for people who want to write a native code implementation. I'm not talking about scrapping that at all, quite the contrary - Windows and the C++ framework should stay as it is, it's quite a large contribution you've made in time and effort, it'd be stupid to abandon that. Even more so, other platforms could build on the C++ code you've written, as you intended. All this would provide is another option, so people can also implement a platform in Java with any TLA they want (don't want to mention technologies here, that'll start another flame war ;) > What you're suggesting would require a great deal more effort than > necessary. > No, I don't think so; it'd be a quite simple refactoring task: * Copy Dispatcher.java into NativeDispatcher.java and change constructor name. Make it derive from Dispatcher * Make all methods in the original Dispatcher.java abstract except for getInstance(). That method does System.getProperty("os.name") to decide which implementation to instantiate. On Windows (and other platforms that implement the C++ interface), it instantiates NativeDispatcher. On yet others, it would instantiate the MyOSNameHereDispatcher * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename corresponding C++ class I'd think this is about 3 hours of work. I'm even happy to have a shot at it, but I have no commit rights to CVS, and I certainly don't intend to make changes that other people don't like. Remember, this discussion stemmed from people being worried that the rewrite is Windows-only right now. So the goal is to get more supported platforms, and to get there you'll need people to contribute code. I think providing more options will attract more contributors. It would certainly make it more attractive for me. Cheers, Uwe > -Adrian > > > > On 2/28/2011 2:01 PM, iqzw2r602 at sneakemail.com wrote: > > Good summary. > > This whole JNI/JNA/C++ thing only came up again because I tried to explain > my motivations for my initial request. And I agree, let's not discuss this > further, we've been there already. > > So let's get this discussion back on track: > > All I suggested is to separate the implementation of the Dispatcher Java > class into a NativeDispatcher class and a Dispatcher interface, so people > can implement the Dispatcher (Java-) interface with whatever > Three-Letter-Abbreviation they want. > > So can people please comment on that? > > Cheers, > > Uwe > > > On Tue, Mar 1, 2011 at 7:50 AM, Michael Erskine msemtd-at-googlemail.com | > rxtx.org mailing list/Example Allow| <6zkk4zdpgt at sneakemail.com> wrote: > >> This was discussed to death last year - summary: - >> * JNI is too hard >> * JNA is compelling >> * yay! let's start a rewrite >> >> Time passes... >> >> Current status: Windows-only and incomplete >> >> Back in non-vaporware land (this is meant in good humour BTW), the >> current RXTX platform-specifics are achieved with ports of POSIX >> termios.h[1]. >> >> It just works (mostly, kinda!) and you have to treat it nice and test >> it to death for _YOUR_ platform in _YOUR_ application but, y'know, >> that's what professional software engineers just do anyway. I >> seriously don't believe anyone will come up with anything better >> anytime soon. >> >> Regards, >> Michael Erskine. >> >> [1] The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 >> Edition >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing listRxtx at qbang.orghttp://mailman.qbang.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.crum at sandglass-software.com Mon Feb 28 19:32:12 2011 From: adrian.crum at sandglass-software.com (Adrian Crum) Date: Mon, 28 Feb 2011 18:32:12 -0800 Subject: [Rxtx] Which Java folder in source? In-Reply-To: <13486-1298944789-675699@sneakemail.com> References: <20110219182250.50135rhuq6ig6pkw@sandglass-software.com> <4D613A6C.80304@sandglass-software.com> <4D69AFC3.50008@sandglass-software.com> <23853-1298846836-791608@sneakemail.com> <4D6ADDC0.1020608@sandglass-software.com> <15854-1298893954-139343@sneakemail.com> <4D6BBC06.4090402@sandglass-software.com> <20110228172052.GE10695@elberon.bln.de.ingenico.com> <6175-1298930480-518642@sneakemail.com> <4D6C2E90.9010601@sandglass-software.com> <13486-1298944789-675699@sneakemail.com> Message-ID: <4D6C5AAC.3070508@sandglass-software.com> Just to make sure I'm understanding you correctly, anyone porting RxTx to a new platform would have to do the following: 1. Write their own Java implementation of an abstract Dispatcher class. 2. Write a native (JNI or JNA) interface for the abstract class implementation. 3. Write all of the native (or non-native) code to implement the native interface. Is that correct? If yes, how is that easier than the simple implementation the current rewrite design uses? On a side note: there is no requirement to write native code using C++. If C++ is a real obstacle to adoption, then regular C could be used instead. In that case, there would be a Dispatcher.c file that contains function protoypes that need to be implemented. Dispatcher.c would still maintain the same role as Dispatcher.cpp - which is to shield native code developers from the details of JNI. Just build out the missing functions using C data types and you're ready to go. -Adrian On 2/28/2011 5:59 PM, iqzw2r602 at sneakemail.com wrote: > On Tue, Mar 1, 2011 at 10:24 AM, Adrian Crum > adrian.crum-at-sandglass-software.com > |rxtx.org > mailing list/Example Allow| > > wrote: > > What you're suggesting would require a great deal more effort than > necessary. > > > No, I don't think so; it'd be a quite simple refactoring task: > * Copy Dispatcher.java into NativeDispatcher.java and change > constructor name. Make it derive from Dispatcher > * Make all methods in the original Dispatcher.java abstract except for > getInstance(). That method does System.getProperty("os.name > ") to decide which implementation to instantiate. On > Windows (and other platforms that implement the C++ interface), it > instantiates NativeDispatcher. On yet others, it would instantiate the > MyOSNameHereDispatcher > * Rename Dispatcher.cpp to NativeDispatcher.cpp and rename > corresponding C++ class > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marc.Schafer at mathworks.com Tue Feb 1 08:41:25 2011 From: Marc.Schafer at mathworks.com (Marc Schafer) Date: Tue, 1 Feb 2011 15:41:25 +0000 Subject: [Rxtx] possible enableReceiveTimeout(0) bug Message-ID: A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever being read in from a SerialInputStream. I believe the problem is in the read_byte_array function inside SerialImp.c A timeout value >= 0 leads to check at the top of the loop to see if the timeout has elapsed. For a value of 0, this will cause the function to return immediately without ever attempting to read any bytes from the serial port. -Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Tue Feb 1 09:00:17 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 11:00:17 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) Message-ID: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Hi, I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. thanks! Chris Bartley -------------------------- [1] For example: http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html [2] http://www.cloudhopper.com/opensource/rxtx [3] http://jlog.org/rxtx-win.html [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html ...and apparently there's a fix: http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html [5] https://sourceforge.net/projects/mingw-w64/ From helmut.bergmann at streamunlimited.com Tue Feb 1 11:52:53 2011 From: helmut.bergmann at streamunlimited.com (helmut.bergmann at streamunlimited.com) Date: Tue, 1 Feb 2011 19:52:53 +0100 (CET) Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <62.178.197.91.1296586373.wm@webmail.inode.at> Hi Chris, I built it with mingw-w64 the last time and had no problems at all building the source. If I would have the *.dll right now, I'd send it to you, but I'm on vacancy currently. Greetings, Helmut > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether > anyone has made progress on this or can offer some tips on how best to > proceed. I've found several previous posts[1], but they more or less > end up with something along the lines of "if there are problems, then > it's in termios.c, but no one has really tried much with it yet". Has > any more work been done on termios.c for 64-bit support? I found the > Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit > build[3], but there's no indication that I've found of how old it is. > We see semi-frequent errors[4] when running under 64-bit Windows using > the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS > X, which I built from recent sources), so I'd really like to build from > recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or > mingw-w64[5], or something else? Any tips, hits, warnings, etc are very > much appreciated, thanks. Once I get it working, I'll of course be sure > to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", > as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bartley at cmu.edu Tue Feb 1 12:58:51 2011 From: bartley at cmu.edu (Chris Bartley) Date: Tue, 1 Feb 2011 14:58:51 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <62.178.197.91.1296586373.wm@webmail.inode.at> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> <62.178.197.91.1296586373.wm@webmail.inode.at> Message-ID: Hi Helmut, Thanks for the quick reply! Excellent, thanks, I'll give mingw-w64 a try. I'm not near a 64-bit machine at the moment, but will send a follow up later on how it goes. thanks, Chris On Feb 1, 2011, at 1:52 PM, wrote: > Hi Chris, > > I built it with mingw-w64 the last time and had no problems at all > building the source. If I would have the *.dll right now, I'd send it to > you, but I'm on vacancy currently. > > Greetings, > Helmut > > >> Hi, >> >> I'd like to build RxTx for 64-bit Windows and am wondering whether >> anyone has made progress on this or can offer some tips on how best to >> proceed. I've found several previous posts[1], but they more or less >> end up with something along the lines of "if there are problems, then >> it's in termios.c, but no one has really tried much with it yet". Has >> any more work been done on termios.c for 64-bit support? I found the >> Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit >> build[3], but there's no indication that I've found of how old it is. >> We see semi-frequent errors[4] when running under 64-bit Windows using >> the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS >> X, which I built from recent sources), so I'd really like to build from >> recent source to see whether the errors go away. >> >> Should I build with Microsoft Visual C++ (as Cloudhopper did), or >> mingw-w64[5], or something else? Any tips, hits, warnings, etc are very >> much appreciated, thanks. Once I get it working, I'll of course be sure >> to document and share with the group. >> >> thanks! >> >> Chris Bartley >> -------------------------- >> [1] For example: >> http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html >> http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html >> [2] http://www.cloudhopper.com/opensource/rxtx >> [3] http://jlog.org/rxtx-win.html >> [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", >> as described here: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html >> >> ...and apparently there's a fix: >> >> http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html >> [5] https://sourceforge.net/projects/mingw-w64/ >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mariusz.dec at gmail.com Tue Feb 1 13:55:38 2011 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 1 Feb 2011 21:55:38 +0100 Subject: [Rxtx] possible enableReceiveTimeout(0) bug In-Reply-To: References: Message-ID: 2011/2/1, Marc Schafer : > A call to RXTPort.enableReceiveTimeout(0) will prevent any bytes from ever > being read in from a SerialInputStream. > > I believe the problem is in the read_byte_array function inside SerialImp.c > A timeout value >= 0 leads to check at the top of the loop to see if the > timeout has elapsed. For a value of 0, this will cause the function to > return immediately without ever attempting to read any bytes from the serial > port. Hi, I am extremally busy now, so without details now - but I would like to point that ReceiveTimeout seen from Java has some traps which are OS specific, so it isn't error, this is OS specific "feature" and should be served in Java. I have explained this problem in threads about "Close() problem solved" (Nov 2009) and many months later in the examples about preventing USB disconnect . Regards Mariusz > > -Marc > > From Bruce.Griffith at se-eng.com Tue Feb 1 20:21:30 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Tue, 1 Feb 2011 20:21:30 -0700 Subject: [Rxtx] Error 0x7a on rxtx for Windows Message-ID: <00a201cbc288$49140260$db3c0720$@Griffith@se-eng.com> Can you look at your copy of the termios.c source in the src directory of your distribution and post the 'C' function that contains lines 2263 and 2269 (and a line number reference)? If you are using rxtx-2.1-7r2, then you may have the YACK macro problem reported in Bug #152. A 0x7A may be ERROR_INSUFFICIENT_BUFFER, and possibly caused by overflowing the message buffer in the sprint() call in YACK(). You will probably need to rework the patch for 2.1-7. If your problem is caused by Bug 152, then you should get a better error message after the fix. From fifo85 at gmx.at Fri Feb 4 04:18:23 2011 From: fifo85 at gmx.at (fifo85 at gmx.at) Date: Fri, 04 Feb 2011 12:18:23 +0100 Subject: [Rxtx] Bluetooth serial port not discovered by getPortIdentifiers (Win7) Message-ID: <4D4BE07F.4070708@gmx.at> Hi! I just started using rxtx and tried to establish a connection with a bluetooth device. The BT-device is listed in my device manager with the corresponding COM port. I can also access the COM port through a terminal, but when I run getPortIdentifiers, it returns all ports, except the BT port. Additional Info: If I already have a connection to the BT COM port (say through a terminal), getPortIdentifiers *does* find the BT COM port. However that doesn't help, because I cannot connect to it, as long as the terminal is connected. System Information: Windows 7 (x86) Java Version: Java SE 6 If you need additional information, please ask. regards, Wolfgang From tim.schaeffer at listentech.com Sun Feb 6 10:24:19 2011 From: tim.schaeffer at listentech.com (Tim Schaeffer) Date: Sun, 6 Feb 2011 10:24:19 -0700 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java Message-ID: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Sun Feb 6 12:04:00 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Sun, 6 Feb 2011 20:04:00 +0100 Subject: [Rxtx] Monitoring COMM Ports with RXTX Java References: <4A0C5019A806A64C86C46B205829608C9B1B86@snowbasin.listentech.com> Message-ID: Hi, Before asking read threads in mailing list. Tons of duiscussions about this problem. Mariusz ----- Original Message ----- From: Tim Schaeffer To: rxtx at qbang.org Sent: Sunday, February 06, 2011 6:24 PM Subject: [Rxtx] Monitoring COMM Ports with RXTX Java We are using Java to control an external USB device via a virtual comm port. This all works well except when someone physically unplugs the device from the computer - this causes port lock up. Does anyone have examples or ideas on how to reliably monitor a comm port so that we can detect when the unit has been unplug and then disconnect our software cleanly, and possibly reconnect once the device has been plugged back in? Thanks, Tim ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From afoss at employees.org Mon Feb 7 08:35:24 2011 From: afoss at employees.org (Andrew Foss) Date: Mon, 07 Feb 2011 07:35:24 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException Message-ID: <4D50113C.1070802@employees.org> Hello, I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 Whenever I try to access and serial devices, I get this; java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) :gnu.io.PortInUseException: Unknown Application I can use "screen" and access the devices ok from a /bin/sh. Any ideas or pointers? thanks, andrew From msemtd at googlemail.com Mon Feb 7 08:53:27 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 7 Feb 2011 15:53:27 +0000 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D50113C.1070802@employees.org> References: <4D50113C.1070802@employees.org> Message-ID: On 7 February 2011 15:35, Andrew Foss wrote: > Hello, > > I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 > > Whenever I try to access and serial devices, I get this; > > java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) > :gnu.io.PortInUseException: Unknown Application > > I can use "screen" and access the devices ok from a /bin/sh. > > Any ideas or pointers? Hi Andrew, Can you be absolutely sure that the port is definitely not in use? (If so, how are you checking, just out of interest?) Regards, Michael Erskine. From afoss at employees.org Mon Feb 7 09:41:43 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 08:41:43 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D5020C7.1070608@employees.org> Michael, I am not absolutely sure. I've gone through and killed all the processes on the mac that can access the usb. The device uses the ftdi drivers and chip set. I asked them and their response was if any application could access it then the drivers were ok. On the mac there's a serial terminal application called "screen", I ran that and it connects to the device ok and spits out the device id, so from that I'm expecting that at the unix level the device is not in use or locked, so am suspecting that it's the java interface? thanks, andrew Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Mon Feb 7 12:00:07 2011 From: afoss at employees.org (afoss) Date: Mon, 07 Feb 2011 11:00:07 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> Message-ID: <4D504137.4050402@employees.org> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... Michael Erskine wrote: > On 7 February 2011 15:35, Andrew Foss wrote: > >> Hello, >> >> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >> >> Whenever I try to access and serial devices, I get this; >> >> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >> :gnu.io.PortInUseException: Unknown Application >> >> I can use "screen" and access the devices ok from a /bin/sh. >> >> Any ideas or pointers? >> > > Hi Andrew, > Can you be absolutely sure that the port is definitely not in use? (If > so, how are you checking, just out of interest?) > > Regards, > Michael Erskine. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From wdtj at yahoo.com Mon Feb 7 13:32:52 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 12:32:52 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows Message-ID: <693613.95988.qm@web162002.mail.bf1.yahoo.com> I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 14:10:29 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:10:29 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003101cbc70b$731980d0$594c8270$@Griffith@se-eng.com> Don't remember where each of the limitations lie, but there is a limitation at COM10 (in RXTX, I believe) and another at COM16 (I think in CYGWIN). I'll follow up shortly with specific code. BG From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Wayne Johnson Sent: Monday, 07 February 2011 1:33 PM To: rxtx at qbang.org Subject: [Rxtx] gnu.io.PortInUseException on Windows I'm using rxtx-2.1-7r2. I'm writing a Datascope application to monitor serial data that's running through a circuit. To monitor both rx and tx I have 2 FTDI UR232 modules emulating COM ports to windows. My Java applications attempts to open these 2 com ports (COM7 & COM10). Rxtx is able to open COM7 fine but gives me a PortInUseException on COM10. Other applications (i.e. putty) open COM10 just fine. Works fine if I just open COM7 alone, but throws the exception when I just open COM10, so it isn't a problem with opening 2 ports. I can also open COM1 (a native serial port) and COM7 togeather fine. Something magic about the name COM10? I've tracked the exception down to the C open() code but haven't gotten any farther than that. Anyone have any ideas before I pull out the C compiler and start hacking? --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bartley at cmu.edu Mon Feb 7 14:53:49 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 7 Feb 2011 16:53:49 -0500 Subject: [Rxtx] RxTx for 64-bit Windows (yes, again...sorry) In-Reply-To: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> References: <4A2AA790-E46D-418D-B321-985270B2D140@cmu.edu> Message-ID: <57B6E4B9-43D8-4AE1-A422-616F745BC968@cmu.edu> Well, I think I finally have working binaries for 32-bit and 64-bit Windows, as well as Mac OS X. Full details on how I built them (including changes I made to the RxTx source) are here: http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/README.txt Binaries and source (both the unmodified and modified snapshots) are here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx Standard disclaimers apply, but feel free to give them a try. We need to do more testing, but so far they seem to be working fine. Hope this helps someone. Please let me know if something doesn't work and/or you have questions. thanks and best, Chris On Feb 1, 2011, at 11:00 AM, Chris Bartley wrote: > Hi, > > I'd like to build RxTx for 64-bit Windows and am wondering whether anyone has made progress on this or can offer some tips on how best to proceed. I've found several previous posts[1], but they more or less end up with something along the lines of "if there are problems, then it's in termios.c, but no one has really tried much with it yet". Has any more work been done on termios.c for 64-bit support? I found the Cloudhopper build[2], but it's over 2 years old. jLog has a 64-bit build[3], but there's no indication that I've found of how old it is. We see semi-frequent errors[4] when running under 64-bit Windows using the above-mentioned prebuilt binaries (but none under 64-bit for Mac OS X, which I built from recent sources), so I'd really like to build from recent source to see whether the errors go away. > > Should I build with Microsoft Visual C++ (as Cloudhopper did), or mingw-w64[5], or something else? Any tips, hits, warnings, etc are very much appreciated, thanks. Once I get it working, I'll of course be sure to document and share with the group. > > thanks! > > Chris Bartley > -------------------------- > [1] For example: > http://mailman.qbang.org/pipermail/rxtx/2008-January/7652061.html > http://mailman.qbang.org/pipermail/rxtx/2008-May/7846738.html > [2] http://www.cloudhopper.com/opensource/rxtx > [3] http://jlog.org/rxtx-win.html > [4] The error is "Error 0x5 at ..\src\termios.c(892): Access is denied", as described here: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954826.html > > ...and apparently there's a fix: > > http://mailman.qbang.org/pipermail/rxtx/2009-April/7954839.html > [5] https://sourceforge.net/projects/mingw-w64/ > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Bruce.Griffith at se-eng.com Mon Feb 7 14:53:51 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 14:53:51 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\ " for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Mon Feb 7 15:22:47 2011 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Mon, 7 Feb 2011 23:22:47 +0100 Subject: [Rxtx] gnu.io.PortInUseException on Windows References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: Hi all, what from this "LIMITATION" to COM10. This is bullshit. Do not write such things!!!! COM16 was acepted from DOS 3.3 or earlier. I have tested connections with COM numbers up to COM252 in Vista without any problems! Regards Mariusz ----- Original Message ----- From: Bruce Griffith To: rxtx at qbang.org Sent: Monday, February 07, 2011 10:53 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. "\\.\COM10"). If that doesn't work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. "/dev/com10"). I believe we modified RXTX to add/remove "\\.\" for Windows port names. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bruce.Griffith at se-eng.com Mon Feb 7 16:29:23 2011 From: Bruce.Griffith at se-eng.com (Bruce Griffith) Date: Mon, 7 Feb 2011 16:29:23 -0700 Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <005301cbc71e$da710f60$8f532e20$@Griffith@se-eng.com> I didn't say they didn't work, I said that there is a Windows-ism that an RXTX user/developer should be aware of when using ports numbered COM10 or higher (the device path prefix) and possibly only with CYGWIN. I, too, have successfully tested using COM ports numbered beyond COM250 (using an RXTX compiled with MinGW). Mariusz, based on your response, I suspect you're using MinGW or a custom-built CYGWIN. In either case, the Windows path thing might not manifest, I wouldn't know. If you are using RXTX native code built with CYGWIN, then you have to change "devices.in" in CYGWIN to get COM ports numbered higher than COM16 to work. See: http://cygwin.com/ml/cygwin/1999-12/msg00323.html http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2004-03/2767. html http://sourceware.org/bugzilla/show_bug.cgi?id=586 http://cygwin.com/ml/cygwin/2008-06/msg00338.html Also devices.in from the current CYGWIN tree (at approximately line 80): http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/devices.in ?rev=1.23 &content-type=text/plain&cvsroot=src&only_with_tag=HEAD BG -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdtj at yahoo.com Mon Feb 7 18:17:29 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 17:17:29 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> <003c01cbc711$81f687a0$85e396e0$@Griffith@se-eng.com> Message-ID: <941888.90892.qm@web162014.mail.bf1.yahoo.com> Bingo! That did the trick. Thank you! --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis ________________________________ From: Bruce Griffith To: rxtx at qbang.org Sent: Mon, February 7, 2011 3:53:51 PM Subject: Re: [Rxtx] gnu.io.PortInUseException on Windows COM10 is a Windows limitation. Windows does not require a fully qualified path for COM1 through COM9. Try appending the serial port name to \\.\ (windows device path prefix) (e.g. ?\\.\COM10?). If that doesn?t work, try appending the serial port name to /dev/ (cygwin device path prefix)(e.g. ?/dev/com10?). I believe we modified RXTX to add/remove ?\\.\? for Windows port names. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Feb 7 18:20:11 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Feb 2011 18:20:11 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException on Windows In-Reply-To: <693613.95988.qm@web162002.mail.bf1.yahoo.com> References: <693613.95988.qm@web162002.mail.bf1.yahoo.com> Message-ID: On Mon, 7 Feb 2011, Wayne Johnson wrote: > I'm using rxtx-2.1-7r2.? > > I'm writing a Datascope application to monitor serial data that's running > through a circuit.? To monitor both rx and tx I have 2 FTDI UR232 modules > emulating COM ports to windows.? My Java applications attempts to open these > 2 com ports (COM7 & COM10).? Rxtx is able to open COM7 fine but gives me a > PortInUseException on COM10.? Other applications (i.e. putty) open COM10 > just fine.? Works fine if I just open COM7 alone, but throws the exception > when I just open COM10, so it isn't a problem with opening 2 ports.? I can > also open COM1 (a native serial port) and COM7 togeather fine.? Something > magic about the name COM10?? > > I've tracked the exception down to the C open() code but haven't gotten any > farther than that.? Anyone have any ideas before I pull out the C compiler > and start hacking? > > ? Hi Wayne, rxtx enumerates ports COM1-COM256 in rxtx 2.1-7pre2. I assume you are seeing the port is available but just can't open it. The interesting thing is that rxtx opens the port and does a timed out read while enumerating. If you see the port in the enumerated list, its already been opened (and closed) once. The code is in RXTXCommDriver.java that does the enumeration: for( int i = 1; i <= 256; i++ ) { temp[i - 1] = new String( "COM" + i ); } for( int i = 1; i <= 3; i++ ) { temp[i + 255] = new String( "LPT" + i ); } ... There are comments in the code about WinCE being limited to COM1-COM8. I'd make sure that you don't have an application that has the port open. Even another copy of your java app. -- Trent Jarvi tjarvi at qbang.org From wdtj at yahoo.com Mon Feb 7 20:32:50 2011 From: wdtj at yahoo.com (Wayne Johnson) Date: Mon, 7 Feb 2011 19:32:50 -0800 (PST) Subject: [Rxtx] Delays in receiving data Message-ID: <611336.74427.qm@web162017.mail.bf1.yahoo.com> OK, I'm on a roll now. Thanks for answering my problem with the COM10 problem. Prefixing the name with \\.\ solved it. I also found that in the Device Manager, I can configure the serial port for a device other than COM10. Both solutions work great. Now I have a slightly more difficult problem. I am using my new fangled datascope to watch the serial communications between a xbee zigbee module and a ATMEL ATMega16 processor. I can see the processor send a command to the xbee, and I can see the xbee respond with the response packet. Problem is that for some reason my datascope application is buffering up the data to the point where the timing between the two get mixed. Sometimes I can see the response go through even before the request packet. I looked at the ReceiveTimeout and ReceiveThreshold settings, and both are defaulting to 0. From what I've read, that should "block until any data is available". Is this right? I suppose it could also be the FTDI drivers that are causing the delay. --- Wayne Johnson, | There are two kinds of people: Those 3943 Penn Ave. N. | who say to God, "Thy will be done," Minneapolis, MN 55412-1908 | and those to whom God says, "All right, (612) 522-7003 | then, have it your way." --C.S. Lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Mon Feb 7 22:01:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 07:01:40 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 2/8/11 05:32, "Wayne Johnson" wrote: > >I looked at the ReceiveTimeout and ReceiveThreshold settings, and both >are defaulting to 0. From what I've read, that should "block until any >data is available". Is this right? I suppose it could also be the FTDI >drivers that are causing the delay. > >--- FWIW the FTDI chip has a feature (IIRC) where it buffers the out going data until it has a full buffer (64 bytes?) or 10 ms has passed which ever comes first. I've confirmed this with an oscilloscope and with nice people at FTDI. It is not a nice feature IMO. Someone on this list claimed that it can be adjusted but I've never done this so I would not know. Maybe search the archives for FTDI... br Kusti From msemtd at googlemail.com Tue Feb 8 01:59:32 2011 From: msemtd at googlemail.com (Michael Erskine) Date: Tue, 8 Feb 2011 08:59:32 +0000 Subject: [Rxtx] Delays in receiving data In-Reply-To: References: <611336.74427.qm@web162017.mail.bf1.yahoo.com> Message-ID: On 8 February 2011 05:01, Kustaa Nyholm wrote: > FWIW the FTDI chip has a feature (IIRC) where it buffers the out going > data until it has a full buffer (64 bytes?) or 10 ms has passed which ever > comes first. I've confirmed this with an oscilloscope and with nice people > at FTDI. It is not a nice feature IMO. Someone on this list claimed that > it can be adjusted but I've never done this so I would not know. Maybe > search the archives for FTDI... You can tune the stock FTDI driver to your application data flow... http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf Regards, Michael Erskine. From Kustaa.Nyholm at planmeca.com Tue Feb 8 02:14:04 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Tue, 8 Feb 2011 11:14:04 +0200 Subject: [Rxtx] Delays in receiving data In-Reply-To: Message-ID: >You can tune the stock FTDI driver to your application data flow... > >http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOp >tions_AN_000073.pdf > Thanks, had not seen this. Good to know although at first glance looks Windows specific, so I do not know if this would help me on Mac OS X. br Kusti From rafaelri at gmail.com Thu Feb 10 17:20:00 2011 From: rafaelri at gmail.com (Rafael Ribeiro) Date: Thu, 10 Feb 2011 21:20:00 -0300 Subject: [Rxtx] symbols not exported after building on linux Message-ID: Hi all, I am trying to build rxtx myself but I am having a rather strange result. configure and make runs just fine but resulting SO file does not have the methods exported (this was identified after running readelf -s) as they are on SO file provided on binary distro. I've read http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux to check if I were missing something but I couldn't find anything significant. Has anyone already faced this? What am I missing? kind regards, Rafael Ribeiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From frans_nieuwerth at nl.ibm.com Thu Feb 10 20:03:17 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 11 Feb 2011 04:03:17 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday. Feb. 14, 2011 (returning 12-02-2011) Message-ID: I am out of the office until 12-02-2011. I will be out of the office for a business trip until Febr. 14, 2011. In this period I will have some access to email and voicemail, but due to timezone differences, maybe not able to respond swiftly. Frans Note: This is an automated response to your message "[Rxtx] symbols not exported after building on linux" sent on 11/2/11 1:20:00. This is the only notification you will receive while this person is away. From lam.bhan at gmail.com Fri Feb 11 20:53:45 2011 From: lam.bhan at gmail.com (Bhan Lam) Date: Sat, 12 Feb 2011 11:53:45 +0800 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: Hi! I'm currently working on a project to output to a 8051 microcontroller using JAVA via RS232. I have successfully installed the RXTX on Windows 7. I am very new to RXTX and still can't understand the sample codes. I need to do the following: 1. Output a 2D Array of Integers to bytes via the RS232 I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? Hope someone can give me some advice. Thanks! -- Cheers, Lam Bhan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zamek at vili.pmmf.hu Sat Feb 12 06:19:55 2011 From: zamek at vili.pmmf.hu (zamek) Date: Sat, 12 Feb 2011 14:19:55 +0100 Subject: [Rxtx] Output to 8051 Microcontroller via rs232 using RXTX on windows In-Reply-To: References: Message-ID: <4D5688FB.9070804@vili.pmmf.hu> hi! 02/12/2011 04:53 AM keltez?ssel, Bhan Lam ?rta: > Hi! I'm currently working on a project to output to a 8051 > microcontroller using JAVA via RS232. I have successfully installed > the RXTX on Windows 7. I am very new to RXTX and still can't > understand the sample codes. > > I need to do the following: > 1. Output a 2D Array of Integers to bytes via the RS232 > RxTx has a getOutputStream() method, all you have to do to send your bytes into this stream; I am using a USB to Serial converter so the port changes when i plug into another USB port or when i switch to another computer. Is there a code to search for the port? ComportIdentifier identifier=null; Enumeration list=ComportIdentifier.getPortIdentifiers(); while(list.hasMoreElements()) { identifier =(ComportIdentifier) list.nextElement(); } -- thx, ---------------------------------- Zoltan Zidarics programmer PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary E-Mail: zamek at vili.pmmf.hu ---------------------------------- From ajmas at sympatico.ca Fri Feb 18 06:24:02 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 08:24:02 -0500 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: <4D504137.4050402@employees.org> References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . On 7-Feb-2011, at 14:00, afoss wrote: > There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... > > Michael Erskine wrote: >> On 7 February 2011 15:35, Andrew Foss wrote: >> >>> Hello, >>> >>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>> >>> Whenever I try to access and serial devices, I get this; >>> >>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>> :gnu.io.PortInUseException: Unknown Application >>> >>> I can use "screen" and access the devices ok from a /bin/sh. >>> >>> Any ideas or pointers? >>> >> >> Hi Andrew, >> Can you be absolutely sure that the port is definitely not in use? (If >> so, how are you checking, just out of interest?) >> >> Regards, >> Michael Erskine. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From afoss at employees.org Fri Feb 18 16:28:00 2011 From: afoss at employees.org (afoss) Date: Fri, 18 Feb 2011 15:28:00 -0800 Subject: [Rxtx] MacOSX gnu.io.PortInUseException In-Reply-To: References: <4D50113C.1070802@employees.org> <4D504137.4050402@employees.org> Message-ID: <4D5F0080.2060601@employees.org> will do, thanks... Andre-John Mas wrote: > The other way of checking is doing and 'lsof' on /dev/tty.usbserial-A600eIPU . > > On 7-Feb-2011, at 14:00, afoss wrote: > > >> There was no /var/lock directory on my mac running 10.5.8, I've created it and chmoded it, but my guess is locking is done differently in this OS... >> >> Michael Erskine wrote: >> >>> On 7 February 2011 15:35, Andrew Foss wrote: >>> >>> >>>> Hello, >>>> >>>> I've put RXTX-2.1-7 on my Mac 32bit OS X 10.5.8 >>>> >>>> Whenever I try to access and serial devices, I get this; >>>> >>>> java.io.IOException: Could not open port (/dev/tty.usbserial-A600eIPU) >>>> :gnu.io.PortInUseException: Unknown Application >>>> >>>> I can use "screen" and access the devices ok from a /bin/sh. >>>> >>>> Any ideas or pointers? >>>> >>>> >>> Hi Andrew, >>> Can you be absolutely sure that the port is definitely not in use? (If >>> so, how are you checking, just out of interest?) >>> >>> Regards, >>> Michael Erskine. >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ajmas at sympatico.ca Fri Feb 18 19:29:51 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:29:51 -0500 Subject: [Rxtx] Which Java folder in source? Message-ID: Hi, I am seeing two Java source folder in the CVS repository checkout: - src/ - Rewrite2010/src/ Which one should we be using and is there any need to keep the one we shouldn't be using around? Andre From ajmas at sympatico.ca Fri Feb 18 19:43:58 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 18 Feb 2011 21:43:58 -0500 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? Message-ID: Hi, Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. Andre From jredman at ergotech.com Fri Feb 18 20:35:08 2011 From: jredman at ergotech.com (Jim Redman) Date: Fri, 18 Feb 2011 20:35:08 -0700 Subject: [Rxtx] Anyone using JDK 1.4 or inferior? In-Reply-To: References: Message-ID: <4D5F3A6C.1070308@ergotech.com> On 02/18/2011 07:43 PM, Andre-John Mas wrote: > Is anyone using JDK 1.4 or less? I am asking because I would be interested in bringing the code up to Java 1.5 standards, with the use of generics and other recent developments. I think that generics will cause problems on a number of embedded platforms. Does J2ME CLDC support generics (maybe depends on who implemented it)? The latest JamVM seems to support generics, but I suspect that that there are a number of JamVM systems around that are not the latest. We have some 1.4 embedded systems, but probably won't update RXTX unless the JVM is also updated. J9 provides its own implementation. Any others (Creme on WinCE)? Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From adrian.crum at sandglass-software.com Sat Feb 19 09:17:27 2011 From: adrian.crum at sandglass-software.com (Adrian C