debian/0000755000000000000000000000000011762421331007166 5ustar debian/watch0000644000000000000000000000020211642703155010215 0ustar # format version number, currently 3; this line is compulsory! version=3 http://rxtx.qbang.org/pub/rxtx/rxtx-([0-9].*[0-9])\.zip debian/copyright0000644000000000000000000001473011642703155011132 0ustar Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 Name: rxtx Maintainer: Trent Jarvi Source: http://rxtx.qbang.org/ Copyright: 1997-2007, Trent Jarvi License: LGPL-2.1+ Files: ./src/psmisc/fuser.c, ./src/fuserImp.c, /CNI/fuserImp.c Copyright: 1993-1998, Werner Almesberger License: other Redistribution and use in source and binary forms of parts of or the whole original or derived work are permitted provided that the original work is properly attributed to the author. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. This work is provided "as is" and without any express or implied warranties. Files: ./src/termios.c Copyright: 1998-2002, Wayne Roberts 1997-2009, Trent Jarvi License: LGPL-2.1+ Files: ./src/gnu/io/RXTXCommDriver.java, ./CNI/RXTXCommDriver.java Copyright: 1998, Kevin Hester 2000-2008, Trent Jarvi License: LGPL-2.1+ Files: ./src/gnu/io/Zystem.java, ./src/lfd/lockdaemon.c, ./CNI/Zystem.java Copyright: 2002-2007, Trent Jarvi License: LGPL-2.1+ Files: ./src/gnu/io/RXTXVersion.java, ./src/gnu/io/RXTXPort.java, ./src/SerialImp.h, ./src/SerialImp.c, ./src/win32termios.h Copyright: 1997-2009, Trent Jarvi License: LGPL-2.1+ Files: ./WinCE/StdAfx.h Copyright: 2002-2004, Michal Hobot License: LGPL-2.1+ Files: ./tests/gnu/io/rxtx/tests/* Copyright: 2008, Martin Oberhuber (Wind River) License: LGPL-2.1+ Files: ./ltmain.sh Copyright: 1996-2001, 2003-2005, Free Software Foundation, Inc. License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. . As a special exception to the GNU General Public License, if you distribute this file as part of a program that contains a configuration script generated by Autoconf, you may include it under the same distribution terms that you use for the rest of that program. . On Debian GNU/Linux systems, the complete text of the GNU Library General Public License can be found in '/usr/share/common-licenses/GPL-2'. License: LGPL-2.1+ RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. RXTX is a native interface to serial ports in java. Copyright 1997-2007 by Trent Jarvi tjarvi@qbang.org and others who actually wrote it. See individual source files for more information. A copy of the LGPL v 2.1 may be found at http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is here for your convenience. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. An executable that contains no derivative of any portion of RXTX, but is designed to work with RXTX by being dynamically linked with it, is considered a "work that uses the Library" subject to the terms and conditions of the GNU Lesser General Public License. The following has been added to the RXTX License to remove any confusion about linking to RXTX. We want to allow in part what section 5, paragraph 2 of the LGPL does not permit in the special case of linking over a controlled interface. The intent is to add a Java Specification Request or standards body defined interface in the future as another exception but one is not currently available. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface As a special exception, the copyright holders of RXTX give you permission to link RXTX with independent modules that communicate with RXTX solely through the Sun Microsytems CommAPI interface version 2, regardless of the license terms of these independent modules, and to copy and distribute the resulting combined work under terms of your choice, provided that every copy of the combined work is accompanied by a complete copy of the source code of RXTX (the version of RXTX used to produce the combined work), being distributed under the terms of the GNU Lesser General Public License plus this exception. An independent module is a module which is not derived from or based on RXTX. Note that people who make modified versions of RXTX are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. All trademarks belong to their respective owners. On Debian GNU/Linux systems, the complete text of the GNU Library General Public License can be found in '/usr/share/common-licenses/LGPL-2.1'. Files: debian/* Copyright: 1999, Christian Leutloff 2010, Scott Howard , edited by Scott Howard <2010-06-03> Index: rxtx/src/RS485Imp.c =================================================================== --- rxtx.orig/src/RS485Imp.c 2011-10-31 02:58:18.280985274 -0400 +++ rxtx/src/RS485Imp.c 2011-10-31 02:58:21.300985346 -0400 @@ -127,6 +127,7 @@ #endif /* !__FreeBSD_kernel__ */ #if defined(__linux__) /* Lets let people who upgraded kernels know they may have problems */ + /* if (uname (&name) == -1) { fprintf(stderr,"RXTX WARNING: cannot get system name\n"); @@ -137,6 +138,7 @@ fprintf(stderr, "\n\n\nRXTX WARNING: This library was compiled to run with OS release %s and you are currently running OS release %s. In some cases this can be a problem. Try recompiling RXTX if you notice strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the include files that came with the kernel source and not an older copy.\n\n\npress enter to continue\n",UTS_RELEASE,name.release); getchar(); } + */ #endif /* __linux__ */ #endif /* WIN32 */ } Index: rxtx/src/RawImp.c =================================================================== --- rxtx.orig/src/RawImp.c 2011-10-31 02:58:18.280985274 -0400 +++ rxtx/src/RawImp.c 2011-10-31 02:58:21.300985346 -0400 @@ -272,6 +272,7 @@ #endif /* !__FreeBSD_kernel__ */ #if defined(__linux__) /* Lets let people who upgraded kernels know they may have problems */ + /* if (uname (&name) == -1) { fprintf(stderr,"RXTX WARNING: cannot get system name\n"); @@ -282,6 +283,7 @@ fprintf(stderr, "\n\n\nRXTX WARNING: This library was compiled to run with OS release %s and you are currently running OS release %s. In some cases this can be a problem. Try recompiling RXTX if you notice strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the include files that came with the kernel source and not an older copy.\n\n\npress enter to continue\n",UTS_RELEASE,name.release); getchar(); } + */ #endif /* __linux__ */ #endif /* WIN32 */ } Index: rxtx/src/SerialImp.c =================================================================== --- rxtx.orig/src/SerialImp.c 2011-10-31 02:58:18.284985274 -0400 +++ rxtx/src/SerialImp.c 2011-10-31 02:58:21.304985346 -0400 @@ -320,6 +320,7 @@ #endif /* DEBUG_TIMING */ #if defined(DEBUG) && defined(__linux__) /* Lets let people who upgraded kernels know they may have problems */ + /* if (uname (&name) == -1) { report( "RXTX WARNING: cannot get system name\n" ); @@ -333,6 +334,7 @@ report( message ); getchar(); } + */ LEAVE( "RXTXPort:Initialize" ); #endif /* DEBUG && __linux__ */ } Index: rxtx/src/I2CImp.c =================================================================== --- rxtx.orig/src/I2CImp.c 2011-10-31 02:58:18.284985274 -0400 +++ rxtx/src/I2CImp.c 2011-10-31 02:58:21.304985346 -0400 @@ -127,6 +127,7 @@ #endif /* !__FreeBSD_kernel__ */ #if defined(__linux__) /* Lets let people who upgraded kernels know they may have problems */ + /* if (uname (&name) == -1) { fprintf(stderr,"RXTX WARNING: cannot get system name\n"); @@ -137,6 +138,7 @@ fprintf(stderr, "\n\n\nRXTX WARNING: This library was compiled to run with OS release %s and you are currently running OS release %s. In some cases this can be a problem. Try recompiling RXTX if you notice strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the include files that came with the kernel source and not an older copy.\n\n\npress enter to continue\n",UTS_RELEASE,name.release); getchar(); } + */ #endif /* __linux__ */ #endif /* WIN32 */ } Index: rxtx/src/SerialImp.cpp =================================================================== --- rxtx.orig/src/SerialImp.cpp 2011-10-31 02:58:18.284985274 -0400 +++ rxtx/src/SerialImp.cpp 2011-10-31 02:58:21.304985346 -0400 @@ -142,6 +142,7 @@ #endif /* !__FreeBSD_kernel__ */ #ifdef DEBUG /* Lets let people who upgraded kernels know they may have problems */ + /* if (uname (&name) == -1) { report("RXTX WARNING: cannot get system name\n"); @@ -153,6 +154,7 @@ name.release); getchar(); } + */ #endif /* DEBUG */ #endif /* __BEOS__ */ #endif /* WIN32 */ Index: rxtx/Makefile.am =================================================================== --- rxtx.orig/Makefile.am 2011-10-31 02:55:54.600981860 -0400 +++ rxtx/Makefile.am 2011-10-31 02:58:21.304985346 -0400 @@ -137,7 +137,8 @@ # create the javadoc files. docs: $(CLASSES) - $(JAVADOC) $(javafiles) + mkdir api + cd api && $(JAVADOC) $(javafiles) ################ WIN32 CrossCompiling from here down ####################### debian/patches/zsystem_init_exception.patch0000644000000000000000000000113611642703155016462 0ustar Description: print exception if initialization fails Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053 Author: Jan Niehusmann Index: rxtx/src/gnu/io/RXTXPort.java =================================================================== --- rxtx.orig/src/gnu/io/RXTXPort.java 2011-02-03 20:48:21.824924891 -0500 +++ rxtx/src/gnu/io/RXTXPort.java 2011-02-03 20:50:04.058464228 -0500 @@ -86,7 +86,9 @@ { try { z = new Zystem(); - } catch ( Exception e ) {} + } catch ( Exception e ) { + throw new Error(e.toString()); + } if(debug ) z.reportln( "RXTXPort {}"); debian/patches/kfreebsd_libpthread.patch0000644000000000000000000000110611642703155015623 0ustar Description: libc_r is not available, use libpthread Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=585089 Author: Scott Howard Index: rxtx/configure.in =================================================================== --- rxtx.orig/configure.in 2011-02-06 11:13:16.151426139 -0500 +++ rxtx/configure.in 2011-02-06 11:13:58.820020857 -0500 @@ -575,7 +575,7 @@ ;; *BSD) - LDFLAGS=$LDFLAGS" -lc_r" + LDFLAGS=$LDFLAGS" -lpthread" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ debian/patches/sys_io_h_check.patch0000644000000000000000000000207111642703155014613 0ustar Description: sys/io.h does not exist on all systems Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=609152 Author: Scott Howard Index: rxtx/configure.in =================================================================== --- rxtx.orig/configure.in 2011-02-23 23:01:09.596613286 -0500 +++ rxtx/configure.in 2011-02-23 23:02:41.269525630 -0500 @@ -71,6 +71,7 @@ AC_CHECK_HEADERS(sys/time.h) AC_CHECK_HEADERS(sys/signal.h) AC_CHECK_HEADERS(signal.h) +AC_CHECK_HEADERS(sys/io.h) AC_CHECK_HEADERS(termios.h) AC_CHECK_HEADERS(grp.h) AC_CHECK_HEADERS(pwd.h) Index: rxtx/src/RawImp.c =================================================================== --- rxtx.orig/src/RawImp.c 2011-02-23 23:04:29.641932242 -0500 +++ rxtx/src/RawImp.c 2011-02-23 23:05:40.487353587 -0500 @@ -99,11 +99,9 @@ # include # include #endif -#ifndef __APPLE__ /* dima */ -#ifndef PPC -#include -#endif /* PPC */ -#endif /* dima */ +#ifdef HAVE_SYS_IO_H +# include +#endif extern int errno; #include "I2CImp.h" debian/patches/series0000644000000000000000000000042511762417451012043 0ustar zsystem_init_exception.patch kfreebsd_port.patch ttyACM_port.patch original_debian_changes.patch kfreebsd_libpthread.patch sys_io_h_check.patch port_to_hurd.patch multiple_property_dirs.patch uninstall_target.patch fhs_lock_buffer_overflow_fix.patch MonitorThread-daemon.patch debian/patches/multiple_property_dirs.patch0000644000000000000000000001313111652560361016462 0ustar Description: Handles the case when "java.ext.dirs" system property contains more than one directory. Author: Philip Ashmore Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=646069 Index: rxtx/src/gnu/io/RXTXCommDriver.java =================================================================== --- rxtx.orig/src/gnu/io/RXTXCommDriver.java 2011-10-28 13:02:43.046717064 -0400 +++ rxtx/src/gnu/io/RXTXCommDriver.java 2011-10-28 13:02:43.186717068 -0400 @@ -356,7 +356,7 @@ First try to register ports specified in the properties file. If that doesn't exist, then scan for ports. */ - for (int PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PARALLEL;PortType++) { + for (int PortType=CommPortIdentifier.PORT_SERIAL; PortType<=CommPortIdentifier.PORT_PARALLEL; PortType++) { if (!registerSpecifiedPorts(PortType)) { if (!registerKnownPorts(PortType)) { registerScannedPorts(PortType); @@ -375,10 +375,18 @@ while (tok.hasMoreElements()) { String PortName = tok.nextToken(); - - if (testRead(PortName, PortType)) + if(debug) + System.out.println("Trying " + PortName + "."); + if (testRead(PortName, PortType)) { CommPortIdentifier.addPortName(PortName, PortType, this); + if(debug) + System.out.println("Success: Read from " + PortName + "."); + }else{ + if(debug) + System.out.println("Fail: Cannot read from " + PortName + + "."); + } } } @@ -402,26 +410,39 @@ private boolean registerSpecifiedPorts(int PortType) { String val = null; - Properties origp = System.getProperties();//save system properties - - try - { + Properties origp = System.getProperties(); // save system properties - String ext_dir=System.getProperty("java.ext.dirs")+System.getProperty("file.separator"); - FileInputStream rxtx_prop=new FileInputStream(ext_dir+"gnu.io.rxtx.properties"); - Properties p=new Properties(); - p.load(rxtx_prop); - System.setProperties(p); - for (Iterator it = p.keySet().iterator(); it.hasNext();) { - String key = (String) it.next(); - System.setProperty(key, p.getProperty(key)); - } - }catch(Exception e){ - if (debug){ - System.out.println("The file: gnu.io.rxtx.properties doesn't exists."); - System.out.println(e.toString()); - }//end if + String [] ext_dirs = System.getProperty("java.ext.dirs").split(":"); + String fs = System.getProperty("file.separator"); + for (int n = 0; n < ext_dirs.length; ++n) { + String ext_file = "?"; + try{ + ext_file = ext_dirs[n] + fs + "gnu.io.rxtx.properties"; + FileInputStream rxtx_prop = new FileInputStream(ext_file); + Properties p=new Properties(); + p.load(rxtx_prop); + System.setProperties(p); + for (Iterator it = p.keySet().iterator(); it.hasNext();) { + String key = (String) it.next(); + String value = p.getProperty(key); + if(debug) { + System.out.println(key + " -> " + value); + } + System.setProperty(key, value); + } + }catch(Exception e){ + if (debug){ + System.out.println("The file \"" + ext_file + + "\" doesn't exist."); + System.out.println(e.toString()); + }//end if + continue; }//end catch + if (debug){ + System.out.println("Read properties from \"" + ext_file + + "\"."); + }//end if + }//end for if (debug) System.out.println("checking for system-known ports of type "+PortType); Index: rxtx/src/SerialImp.c =================================================================== --- rxtx.orig/src/SerialImp.c 2011-10-28 13:02:43.078717065 -0400 +++ rxtx/src/SerialImp.c 2011-10-28 13:02:43.190717067 -0400 @@ -4359,7 +4359,11 @@ if( fd < 0 ) { - report_verbose( "testRead() open failed\n" ); + report_verbose( "testRead() open \"" ); + report_verbose( name ); + report_verbose( "\" failed: " ); + report_verbose( strerror(errno) ); + report_verbose( "\n" ); ret = JNI_FALSE; goto END; } @@ -5095,7 +5099,7 @@ exceptions: none comments: ----------------------------------------------------------*/ -void report_warning(char *msg) +void report_warning(const char *msg) { #ifndef DEBUG_MW fprintf(stderr, msg); @@ -5113,7 +5117,7 @@ exceptions: none comments: ----------------------------------------------------------*/ -void report_verbose(char *msg) +void report_verbose(const char *msg) { #ifdef DEBUG_VERBOSE #ifdef DEBUG_MW @@ -5132,7 +5136,7 @@ exceptions: none comments: ----------------------------------------------------------*/ -void report_error(char *msg) +void report_error(const char *msg) { #ifndef DEBUG_MW fprintf(stderr, msg); @@ -5150,7 +5154,7 @@ exceptions: none comments: ----------------------------------------------------------*/ -void report(char *msg) +void report(const char *msg) { #ifdef DEBUG # ifndef DEBUG_MW Index: rxtx/src/SerialImp.h =================================================================== --- rxtx.orig/src/SerialImp.h 2011-10-28 13:02:43.162717067 -0400 +++ rxtx/src/SerialImp.h 2011-10-28 13:02:43.194717067 -0400 @@ -467,10 +467,10 @@ jboolean is_interrupted( struct event_info_struct * ); int send_event(struct event_info_struct *, jint, int ); void dump_termios(char *,struct termios *); -void report_verbose(char *); -void report_error(char *); -void report_warning(char *); -void report(char *); +void report_verbose(const char *); +void report_error(const char *); +void report_warning(const char *); +void report(const char *); void throw_java_exception( JNIEnv *, char *, char *, char * ); int lock_device( const char * ); void unlock_device( const char * ); debian/patches/fhs_lock_buffer_overflow_fix.patch0000644000000000000000000000472311762417243017565 0ustar Description: Java fails with a buffer overflow when there's a locked serial device, see http://mailman.qbang.org/pipermail/rxtx/2009-May/10897125.html. Author: Sergio Talens-Oliag Index: rxtx-2.2pre2/CNI/SerialImp.c =================================================================== --- rxtx-2.2pre2.orig/CNI/SerialImp.c 2012-05-21 13:13:43.000000000 +0200 +++ rxtx-2.2pre2/CNI/SerialImp.c 2012-05-21 13:24:05.876652630 +0200 @@ -4752,7 +4752,7 @@ fd = open( file, O_CREAT | O_WRONLY | O_EXCL, 0444 ); if( fd < 0 ) { - sprintf( message, + snprintf( message, 79, "RXTX fhs_lock() Error: creating lock file: %s: %s\n", file, strerror(errno) ); report_error( message ); Index: rxtx-2.2pre2/src/SerialImp.c =================================================================== --- rxtx-2.2pre2.orig/src/SerialImp.c 2012-05-21 13:13:43.000000000 +0200 +++ rxtx-2.2pre2/src/SerialImp.c 2012-05-21 13:26:50.184644233 +0200 @@ -5307,7 +5307,7 @@ } if ( dev_lock( filename ) ) { - sprintf( message, + snprintf( message, 79, "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", filename, strerror(errno) ); report_error( message ); @@ -5367,7 +5367,7 @@ fd = open( file, O_CREAT | O_WRONLY | O_EXCL, 0444 ); if( fd < 0 ) { - sprintf( message, + snprintf( message, 79, "RXTX fhs_lock() Error: creating lock file: %s: %s\n", file, strerror(errno) ); report_error( message ); Index: rxtx-2.2pre2/src/lfd/lockdaemon.c =================================================================== --- rxtx-2.2pre2.orig/src/lfd/lockdaemon.c 2007-04-26 07:26:07.000000000 +0200 +++ rxtx-2.2pre2/src/lfd/lockdaemon.c 2012-05-21 13:25:35.396648055 +0200 @@ -145,7 +145,7 @@ fd = open( file, O_CREAT | O_WRONLY | O_EXCL, 0444 ); if( fd < 0 ) { - sprintf( message, + snprintf( message, 79, "RXTX fhs_lock() Error: creating lock file: %s: %s\n", file, strerror(errno) ); syslog( LOG_INFO, message ); Index: rxtx-2.2pre2/src/lfd/lockdaemon.c.noinetd =================================================================== --- rxtx-2.2pre2.orig/src/lfd/lockdaemon.c.noinetd 2007-04-26 07:26:07.000000000 +0200 +++ rxtx-2.2pre2/src/lfd/lockdaemon.c.noinetd 2012-05-21 13:25:55.748647017 +0200 @@ -144,7 +144,7 @@ fd = open( file, O_CREAT | O_WRONLY | O_EXCL, 0444 ); if( fd < 0 ) { - sprintf( message, + snprintf( message, 79, "RXTX fhs_lock() Error: creating lock file: %s: %s\n", file, strerror(errno) ); syslog( LOG_INFO, message ); debian/patches/uninstall_target.patch0000644000000000000000000000116711653443573015235 0ustar Description: adds uninstall target to Makefile Author: Scott Howard Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=646069 Index: rxtx/Makefile.am =================================================================== --- rxtx.orig/Makefile.am 2011-10-31 02:43:21.532963961 -0400 +++ rxtx/Makefile.am 2011-10-31 02:46:03.348967808 -0400 @@ -129,6 +129,10 @@ done` $(RXTX_PATH) $(INSTALL_PROGRAM) $(JARTARGET) $(JHOME)/ +uninstall: + cd $(RXTX_PATH) && $(RM) librxtx* + $(RM) $(JHOME)/$(JARTARGET) + clean-generic: rm -rf $(DEST) $(TOP)/$(CLASSTOP) -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) debian/patches/port_to_hurd.patch0000644000000000000000000000117711642703155014360 0ustar Description: Defines __GNU__ to use the FHS Author: Scott Howard Index: rxtx/src/SerialImp.h =================================================================== --- rxtx.orig/src/SerialImp.h 2011-02-23 23:26:14.955993397 -0500 +++ rxtx/src/SerialImp.h 2011-02-23 23:26:52.684023837 -0500 @@ -147,7 +147,7 @@ }; /* Ports known on the OS */ -#if defined(__linux__) || defined(__FreeBSD_kernel__) +#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__) /* This is a small hack to get mark and space parity working on older systems https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 debian/patches/MonitorThread-daemon.patch0000644000000000000000000000274611762417615015701 0ustar Desciption: Threads created in Java by RXTX are not marked as daemon. Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=674975 Author: Christopher Wellons --- a/src/gnu/io/I2C.java +++ b/src/gnu/io/I2C.java @@ -468,7 +468,9 @@ private boolean BI=false; private boolean Data=false; private boolean Output=false; - MonitorThread() { } + MonitorThread() { + setDaemon(true); + } public void run() { eventLoop(); } --- a/src/gnu/io/LPRPort.java +++ b/src/gnu/io/LPRPort.java @@ -366,7 +366,9 @@ { private boolean monError = false; private boolean monBuffer = false; - MonitorThread() { } + MonitorThread() { + setDaemon(true); + } public void run() { eventLoop(); --- a/src/gnu/io/RS485.java +++ b/src/gnu/io/RS485.java @@ -465,7 +465,9 @@ private boolean BI=false; private boolean Data=false; private boolean Output=false; - MonitorThread() { } + MonitorThread() { + setDaemon(true); + } public void run() { eventLoop(); } --- a/src/gnu/io/RXTXPort.java +++ b/src/gnu/io/RXTXPort.java @@ -1629,6 +1629,7 @@ MonitorThread() { + setDaemon(true); if (debug) z.reportln( "RXTXPort:MontitorThread:MonitorThread()"); } --- a/src/gnu/io/Raw.java +++ b/src/gnu/io/Raw.java @@ -466,7 +466,9 @@ private boolean BI=false; private boolean Data=false; private boolean Output=false; - MonitorThread() { } + MonitorThread() { + setDaemon(true); + } public void run() { eventLoop(); } debian/patches/ttyACM_port.patch0000644000000000000000000000215011642703155014045 0ustar Description: Allows for the enumeration of many additional ports, including ttyACM for Arduino Unos Author: Scott Howard Index: rxtx/src/gnu/io/RXTXCommDriver.java =================================================================== --- rxtx.orig/src/gnu/io/RXTXCommDriver.java 2010-10-04 23:14:47.236148507 -0400 +++ rxtx/src/gnu/io/RXTXCommDriver.java 2010-10-04 23:18:56.976108303 -0400 @@ -574,20 +574,7 @@ if(osName.equals("Linux")) { String[] Temp = { - "ttyS", // linux Serial Ports "ttySA", // for the IPAQs - "ttyUSB", // for USB frobs - "rfcomm", // bluetooth serial device - "ttyircomm", // linux IrCommdevices (IrDA serial emu) - }; - CandidatePortPrefixes=Temp; - } - else if(osName.equals("Linux-all-ports")) - { - /* if you want to enumerate all ports ~5000 - possible, then replace the above with this - */ - String[] Temp = { "comx", // linux COMMX synchronous serial card "holter", // custom card for heart monitoring "modem", // linux symbolic link to modem. debian/patches/kfreebsd_port.patch0000644000000000000000000002546711642703155014511 0ustar Description: Defines FreeBSD for kFreeBSD systems, also makes sure kfreeBSD is set to use FHS #grep -r -H "__FreeBSD" . -m 1 --exclude=*.patch --exclude-dir=.git | cut -d: -f1 | xargs sed -i s/__FreeBSD__/__FreeBSD_kernel__/ Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=585089 Author: Scott Howard Index: rxtx/src/RS485Imp.c =================================================================== --- rxtx.orig/src/RS485Imp.c 2011-02-23 22:53:43.393378664 -0500 +++ rxtx/src/RS485Imp.c 2011-02-23 22:53:52.663072550 -0500 @@ -120,11 +120,11 @@ threads, because it slows things down. Go figure. */ /* POSIX signal handling functions */ -#if !defined(__FreeBSD___) +#if !defined(__FreeBSD_kernel___) struct sigaction handler; sigaction( SIGIO, NULL, &handler ); if( !handler.sa_handler ) signal( SIGIO, SIG_IGN ); -#endif /* !__FreeBSD__ */ +#endif /* !__FreeBSD_kernel__ */ #if defined(__linux__) /* Lets let people who upgraded kernels know they may have problems */ if (uname (&name) == -1) @@ -178,7 +178,7 @@ ttyset.c_cc[ VMIN ] = 0; ttyset.c_cc[ VTIME ] = 0; -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ if( cfsetspeed( &ttyset, B9600 ) < 0 ) goto fail; #else if( cfsetispeed( &ttyset, B9600 ) < 0 ) goto fail; @@ -238,7 +238,7 @@ if( !translate_data_bits( env, (int *)&(ttyset.c_cflag), dataBits ) ) return; /* dima c_cflag in darwin is unsigned long */ if( !translate_stop_bits( env, (int *)&(ttyset.c_cflag), stopBits ) ) return; /* dima c_cflag in darwin is unsigned long */ if( !translate_parity( env, (int *)&(ttyset.c_cflag), parity ) ) return;/* dima c_cflag in darwin is unsigned long */ -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ if( cfsetspeed( &ttyset, cspeed ) < 0 ) goto fail; #else if( cfsetispeed( &ttyset, cspeed ) < 0 ) goto fail; @@ -1290,7 +1290,7 @@ return(JNI_FALSE); } #endif -#if defined(__FreeBSD__) +#if defined(__FreeBSD_kernel__) if(!strcmp(name,"tty0")|| !strcmp(name,"ttyd")|| !strcmp(name,"ttyq")|| !strcmp(name,"ttym")|| !strcmp(name,"ttyf")|| !strcmp(name,"ttyS")|| Index: rxtx/src/RawImp.c =================================================================== --- rxtx.orig/src/RawImp.c 2011-02-23 22:53:43.413378002 -0500 +++ rxtx/src/RawImp.c 2011-02-23 22:53:52.663072550 -0500 @@ -265,11 +265,11 @@ threads, because it slows things down. Go figure. */ /* POSIX signal handling functions */ -#if !defined(__FreeBSD___) +#if !defined(__FreeBSD_kernel___) struct sigaction handler; sigaction( SIGIO, NULL, &handler ); if( !handler.sa_handler ) signal( SIGIO, SIG_IGN ); -#endif /* !__FreeBSD__ */ +#endif /* !__FreeBSD_kernel__ */ #if defined(__linux__) /* Lets let people who upgraded kernels know they may have problems */ if (uname (&name) == -1) @@ -307,7 +307,7 @@ if( !translate_data_bits( env, (int *)&(ttyset.c_cflag), dataBits ) ) return; /* dima c_flag darwin unsigned long */ if( !translate_stop_bits( env, (int *)&(ttyset.c_cflag), stopBits ) ) return; /* dima c_flag darwin unsigned long */ if( !translate_parity( env, (int *)&(ttyset.c_cflag), parity ) ) return;/* dima c_flag darwin unsigned long */ -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ if( cfsetspeed( &ttyset, cspeed ) < 0 ) goto fail; #else if( cfsetispeed( &ttyset, cspeed ) < 0 ) goto fail; @@ -1289,7 +1289,7 @@ return(JNI_FALSE); } #endif -#if defined(__FreeBSD__) +#if defined(__FreeBSD_kernel__) if(!strcmp(name,"tty0")|| !strcmp(name,"ttyd")|| !strcmp(name,"ttyq")|| !strcmp(name,"ttym")|| !strcmp(name,"ttyf")|| !strcmp(name,"ttyS")|| Index: rxtx/src/SerialImp.h =================================================================== --- rxtx.orig/src/SerialImp.h 2011-02-23 22:53:43.423377671 -0500 +++ rxtx/src/SerialImp.h 2011-02-23 22:55:45.573475048 -0500 @@ -97,7 +97,7 @@ /* glue for unsupported linux speeds see also win32termios.h */ -#if !defined(__APPLE__) && !defined(__FreeBSD__) /* dima */ +#if !defined(__APPLE__) && !defined(__FreeBSD_kernel__) /* dima */ /* this is now handled in SerialImp.c #define B14400 1010001 #define B28800 1010002 @@ -147,7 +147,7 @@ }; /* Ports known on the OS */ -#if defined(__linux__) +#if defined(__linux__) || defined(__FreeBSD_kernel__) /* This is a small hack to get mark and space parity working on older systems https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Index: rxtx/src/SerialImp.c =================================================================== --- rxtx.orig/src/SerialImp.c 2011-02-23 22:53:43.443377009 -0500 +++ rxtx/src/SerialImp.c 2011-02-23 22:53:52.663072550 -0500 @@ -423,7 +423,7 @@ ttyset.c_cc[ VMIN ] = 0; ttyset.c_cc[ VTIME ] = 0; -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ if( cfsetspeed( &ttyset, B9600 ) < 0 ) goto fail; #else if( cfsetispeed( &ttyset, B9600 ) < 0 ) goto fail; @@ -844,13 +844,13 @@ return(1); } -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ if( cfsetspeed( &ttyset, cspeed ) < 0 ) { report( "set_port_params: Cannot Set Speed\n" ); return( 1 ); } -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ if( !cspeed ) { /* hang up the modem aka drop DTR */ @@ -4705,7 +4705,7 @@ stat(teststring,&mystat); #endif /* __sun__ */ /* XXX the following hoses freebsd when it tries to open the port later on */ -#ifndef __FreeBSD__ +#ifndef __FreeBSD_kernel__ if(S_ISCHR(mystat.st_mode)){ fd=OPEN(teststring,O_RDONLY|O_NONBLOCK); if (fd>0){ Index: rxtx/src/ParallelImp.c =================================================================== --- rxtx.orig/src/ParallelImp.c 2011-02-23 22:53:43.463376347 -0500 +++ rxtx/src/ParallelImp.c 2011-02-23 22:53:52.663072550 -0500 @@ -111,7 +111,7 @@ #if defined(__linux__) # include #endif -#if defined(__FreeBSD__) +#if defined(__FreeBSD_kernel__) /* # include ? is this changed or wrong */ # include #endif @@ -265,7 +265,7 @@ #if defined(__linux__) return( status & LP_BUSY ? JNI_TRUE : JNI_FALSE ); #endif -#if defined(__FreeBSD__) +#if defined(__FreeBSD_kernel__) return( status & EBUSY ? JNI_TRUE : JNI_FALSE ); #endif return(JNI_FALSE); @@ -341,7 +341,7 @@ ioctl(fd, LPGETSTATUS, &status); return( status & LP_BUSY ? JNI_TRUE : JNI_FALSE ); #endif -#if defined(__FreeBSD__) +#if defined(__FreeBSD_kernel__) printf("ParallelImp.c LPGETSTATUS not defined\n"); /* return( status & EBUSY ? JNI_TRUE : JNI_FALSE ); Index: rxtx/src/I2CImp.c =================================================================== --- rxtx.orig/src/I2CImp.c 2011-02-23 22:53:43.483375685 -0500 +++ rxtx/src/I2CImp.c 2011-02-23 22:53:52.663072550 -0500 @@ -120,11 +120,11 @@ threads, because it slows things down. Go figure. */ /* POSIX signal handling functions */ -#if !defined(__FreeBSD___) +#if !defined(__FreeBSD_kernel___) struct sigaction handler; sigaction( SIGIO, NULL, &handler ); if( !handler.sa_handler ) signal( SIGIO, SIG_IGN ); -#endif /* !__FreeBSD__ */ +#endif /* !__FreeBSD_kernel__ */ #if defined(__linux__) /* Lets let people who upgraded kernels know they may have problems */ if (uname (&name) == -1) @@ -178,7 +178,7 @@ ttyset.c_cc[ VMIN ] = 0; ttyset.c_cc[ VTIME ] = 0; -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ if( cfsetspeed( &ttyset, B9600 ) < 0 ) goto fail; #else if( cfsetispeed( &ttyset, B9600 ) < 0 ) goto fail; @@ -238,7 +238,7 @@ if( !translate_data_bits( env, (int *)&(ttyset.c_cflag), dataBits ) ) return; /* dima darwin defime c_cflag as unsigned long */ if( !translate_stop_bits( env, (int *)&(ttyset.c_cflag), stopBits ) ) return; /* dima darwin defime c_cflag as unsigned long */ if( !translate_parity( env, (int *)&(ttyset.c_cflag), parity ) ) return;/* dima darwin defime c_cflag as unsigned long */ -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ if( cfsetspeed( &ttyset, cspeed ) < 0 ) goto fail; #else if( cfsetispeed( &ttyset, cspeed ) < 0 ) goto fail; @@ -1220,7 +1220,7 @@ return(JNI_FALSE); } #endif -#if defined(__FreeBSD__) +#if defined(__FreeBSD_kernel__) if(!strcmp(name,"tty0")|| !strcmp(name,"ttyd")|| !strcmp(name,"ttyq")|| !strcmp(name,"ttym")|| !strcmp(name,"ttyf")|| !strcmp(name,"ttyS")|| Index: rxtx/src/SerialImp.cpp =================================================================== --- rxtx.orig/src/SerialImp.cpp 2011-02-23 22:53:43.503375023 -0500 +++ rxtx/src/SerialImp.cpp 2011-02-23 22:53:52.663072550 -0500 @@ -135,11 +135,11 @@ threads, because it slows things down. Go figure. */ /* POSIX signal handling functions */ -#if !defined(__FreeBSD___) +#if !defined(__FreeBSD_kernel___) struct sigaction handler; sigaction( SIGIO, NULL, &handler ); if( !handler.sa_handler ) signal( SIGIO, SIG_IGN ); -#endif /* !__FreeBSD__ */ +#endif /* !__FreeBSD_kernel__ */ #ifdef DEBUG /* Lets let people who upgraded kernels know they may have problems */ if (uname (&name) == -1) Index: rxtx/CNI/SerialImp.h =================================================================== --- rxtx.orig/CNI/SerialImp.h 2011-02-23 22:53:43.523374359 -0500 +++ rxtx/CNI/SerialImp.h 2011-02-23 22:53:52.663072550 -0500 @@ -97,7 +97,7 @@ /* glue for unsupported linux speeds see also win32termios.h */ -#if !defined(__APPLE__) && !defined(__FreeBSD__) /* dima */ +#if !defined(__APPLE__) && !defined(__FreeBSD_kernel__) /* dima */ /* this is now handled in SerialImp.c #define B14400 1010001 #define B28800 1010002 @@ -165,7 +165,7 @@ # define LOCKFILEPREFIX "LK." # define UUCP #endif /* __sgi__ || sgi */ -#if defined(__FreeBSD__) +#if defined(__FreeBSD_kernel__) # define DEVICEDIR "/dev/" # define LOCKDIR "/var/spool/uucp" # define LOCKFILEPREFIX "LK." @@ -176,7 +176,7 @@ # define LOCKDIR "/var/spool/uucp" # define LOCKFILEPREFIX "LK." # define UUCP -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ #if defined(__NetBSD__) # define DEVICEDIR "/dev/" # define LOCKDIR "/usr/spool/uucp" Index: rxtx/CNI/SerialImp.c =================================================================== --- rxtx.orig/CNI/SerialImp.c 2011-02-23 22:53:43.543373697 -0500 +++ rxtx/CNI/SerialImp.c 2011-02-23 22:53:52.663072550 -0500 @@ -382,7 +382,7 @@ ttyset.c_cc[ VMIN ] = 0; ttyset.c_cc[ VTIME ] = 0; -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ if( cfsetspeed( &ttyset, B9600 ) < 0 ) goto fail; #else if( cfsetispeed( &ttyset, B9600 ) < 0 ) goto fail; @@ -686,13 +686,13 @@ return(1); } -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ if( cfsetspeed( &ttyset, cspeed ) < 0 ) { report( "set_port_params: Cannot Set Speed\n" ); return( 1 ); } -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ if( !cspeed ) { /* hang up the modem aka drop DTR */ @@ -4257,7 +4257,7 @@ stat(teststring,&mystat); #endif /* __sun__ */ /* XXX the following hoses freebsd when it tries to open the port later on */ -#ifndef __FreeBSD__ +#ifndef __FreeBSD_kernel__ if(S_ISCHR(mystat.st_mode)){ fd=::OPEN(teststring,O_RDONLY|O_NONBLOCK); if (fd>0){ debian/control0000644000000000000000000000243611653433702010602 0ustar Source: rxtx Section: java Priority: optional Maintainer: Debian Java maintainers Uploaders: Scott Howard DM-Upload-Allowed: yes Build-Depends: debhelper (>= 8), libtool, javahelper, default-jdk, dh-autoreconf, autotools-dev Standards-Version: 3.9.2 Homepage: http://www.rxtx.org Vcs-Git: git://git.debian.org/pkg-java/rxtx.git Vcs-Browser: http://git.debian.org/?p=pkg-java/rxtx.git Package: librxtx-java Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ${java:Depends} Recommends: ${java:Recommends} Provides: lib-rxtx-java Conflicts: lib-rxtx-java Description: Full Java CommAPI implementation RXTX is a full implementation of the Java CommAPI from Sun. It contains native libraries providing serial and parallel communication for the Java Development Toolkit. Package: librxtx-java-dbg Architecture: any Section: debug Priority: extra Depends: ${shlibs:Depends}, ${misc:Depends}, librxtx-java (= ${binary:Version}) Description: Full Java CommAPI implementation, Debugging Symbols RXTX is a full implementation of the Java CommAPI from Sun. It contains native libraries providing serial and parallel communication for the Java Development Toolkit. . This package contains the debugging symbols for librxtx-java. debian/README.Debian0000644000000000000000000003360111642703155011236 0ustar RXTX - Full Java CommAPI implementation ======================================= This package contains a full implementation of the Java CommAPI from Sun. To use applications, written with the original CommAPI, with rxtx you have to change references to javax.comm.* to gnu.io.*. The rest of this file contains some useful information about problems with the rxtx package found in the upstream INSTALL file. The unimportant sections are left out. ------------------------------------------------------------------------------- 3. COMMON PROBLEMS [...] B. Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path librxtxSerial.so is located in the wrong directory. Here is an example $ mv /usr/local/java/jre/lib/i386/librxtxSerial* /usr/local/lib $ java BlackBox Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(Compiled Code) at java.lang.Runtime.loadLibrary0(Compiled Code) at java.lang.System.loadLibrary(Compiled Code) at gnu.io.NativePort.(NativePort.java:32) at gnu.io.RXTXPort.(Compiled Code) at gnu.io.RXTXCommDriver.getCommPort(Compiled Code) at gnu.io.CommPortIdentifier.open(Compiled Code) at SerialPortDisplay.openBBPort(Compiled Code) at SerialPortDisplay.(Compiled Code) at BlackBox.addPort(Compiled Code) at BlackBox.main(Compiled Code) ... lets fix it. Solution 1: move the file to a place that works $ mv /usr/local/lib/librxtxSerial.* /usr/local/java/jre/lib/i386/ Solution 2: add the location of librxtxSerial to LD_LIBRARY_PATH $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/ Solution 3: pass the location in on the command line $ java -Djava.library.path=/usr/local/lib/ ... C. I Can Not Open the Port. If you're not able to open the port (read the errors carefully) then you may not have permission to use the device. Redhat Linux ships with the following permissions: crw-r--r-- /dev/ttyS? Users need to be able to read and write with serial communication... chmod 666 /dev/ttyS? should fix the problem. Be sure to check the file CommAPI for common mistakes. Make sure that the user can create lock files. D. java.lang.NoClassDefFoundError: gnu/io/CommPort RXTXcomm.jar is probably not in your classpath or not located in the proper directory. for example, lets not include RXTXcomm.jar export CLASSPATH=../java/lib/classes.zip $ java BlackBoxException in thread "main" java.lang.NoClassDefFoundError: gnu/io/CommPort [...] H. BlackBox Can Not Handle all the ports! BlackBox has a hard coded limit in BlackBox.java that prevents it from running if you don't specify a port. We are considering alternative ways of handling the large number of port names in Unix. The line in question is: portDisp = new SerialPortDisplay[50]; just change 50 to say 256. I. Illegal use of nonvirtal function call! Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call at gnu.io.RXTXCommDriver.getCommPort(Compiled Code) at gnu.io.CommPortIdentifier.open(Compiled Code) at SerialPortDisplay.openBBPort(Compiled Code) at SerialPortDisplay.(Compiled Code) at BlackBox.addPort(Compiled Code) at BlackBox.main(Compiled Code) "1.1 compilers sometimes generate code that won't verify under 1.2. If you don't have the sources for the offending class to recompile with a 1.2 javac, the only solution I know of is to launch the VM with the -noverify option. Louis" In other words start with a fresh build directory, rebuild, and reinstall to avoid the problem. [...] L. Problems with RMISecurityManager() Please see the file RMISecurityManager.html M. Which Wires Should be Connected? With the DB25 use 2 (TX), 3 (RX) and 7 (GD) to connect to the device. With the DB9 use 2 (RX), 3 (TX) and 5 (GD) to connect to the device. You will need to hook up more than that for hardware flow control. N. Which Device Should be Used? Linux serial ports should use /dev/ttyS? specialx, cyclades and isdn4 linux have been reported to work. as many as 64 ports have worked at one time. FreeBSD uses cuaa? netbsd uses tty0? Irix uses ttyd? ttym? ttyf? HP-UX uses tty0p? tty1p? BeOS uses /dev/ports/serial? Win32 uses COM? [...] P. Which jdk should be used? Ideally any jdk would be fine. Here is a list of jdk's tried on RedHat 6.0/kernel 2.2.17pre13 with various versions of glibc. Sun IBM Blackdown 2.1.2_006 1.3.0 1.1.8v1 green native green native green native ------------------------------------------ glibc-2.1.1-6 | OK | *1 | *2 | *2 | OK | *3 | ------------------------------------------- glibc-2.1.2-11 | OK | *1 | OK | OK | OK | OK | ------------------------------------------- glibc-2.1.2-17 | OK | *1 | OK | OK | OK | OK | ------------------------------------------- glibc-2.1.3-15 | OK | *1 | OK | OK | OK | OK | ------------------------------------------- 1) BlackBox (a demo application shipped with CommAPI locks after multiple open()/close() 2) java wont start "Unable to load /usr/local/java/jre/bin/libhpi.so: symbol sem_wait, version GLIBC_2.1 not defined in file libpthread.so.0 with link time reference Could not create the Java virtual machine." 3) java wont start "error in loading shared libraries: /usr/local/java/bin/../lib/i686/native_threads/libjava.so: symbol sem_init, version GLIBC_2.1 not defined in file libpthread.so.0 with link time reference" Conclusion? Avoid Sun's native threads unless you can figure out whats going wrong. Q. How does rxtx detect ports? Can I override it? rxtx tries to detect ports on by scanning /dev for files matching any of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on. Any ones that exist, are supposed to be good for the current operating system, and that can be read and written are offered back from CommPortIdentifier.getPortIdentifiers(), and only these can be used as ports. If you wish, you can set the system properties gnu.io.rxtx.SerialPorts and gnu.io.rxtx.ParallelPorts. If either of these is set, then no scanning will be carried out and only the specified ports will be available. You can use this to make one platform look like another, to restrict Java access to ports, or possibly for other reasons. For example java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp will look kind of like Solaris, if you have created the appropriate device nodes. A note on Linux port enumeration. We have set most ports aside. Once the number of possible devices started getting into the thousands, checking them all made little sense. Look in RXTXCommDriver.java and search for Linux. You will see that only /dev/ttyS* is searched but the possible addition ports that can be used are listed under it. Just copy the few you need. [...] S. How can I tell which version of rxtx is installed? Version information is not documented in Sun's CommAPI so this is probably unique to RXTX. As of rxtx-1.5-4 and rxtx-1.4-6 a class has been added to allow developers to check which version of rxtx is installed. The class is RXTXVersion. The static method: System.out.println(RXTXVersion.getVersion()); will print the rxtx version as a String in the following format: "RXTX-MAJOR.MINOR-PATCH". an example would be: "RXTX-1.5-4" A change in the MAJOR version would suggest you're in trouble. Odd MINOR version are reserved for development. Even MINOR versions are reserved for 'stable' releases. PATCH is used to differentiate incremental releases of the MINOR releases. CommPortIdentifier is expected to support getVersion() in the RXTX-1.5 series. T. What Type of Latency can I expect with RXTX frantz put RXTX under a scope and found the following: RXTX currently has a latency of 150-200ms on a PII at 450mhz. The latency can be reduced to 70-80ms by reducing the usleep() value in SerialImp.c:eventLoop() to usleep(5000)). Much lower latencies should be possible but the maintainer does not have equipment to test changes. He is going to look at this further. He needs 20 ms or less latency. U. I got rxtx working on a new OS but I can't read from the port > Now my java program starts up nicely without complaining. However, it does > never read any data from the serial port. It looks like it can write data, > because if I start a terminal program after I tried to run my program, I get > all the return stuff from the modem that my program wrote. > > I hacked around abit and found out that it hangs in the select() call which > simply never returns. > On Sun, 28 Jan 2001, Baldur Norddahl wrote: > HPUX 11: > > As I wrote to the mailinglist I had some weird problems where it apparently > could write data to the modem, but not read anything back. My terminal > programs had no problem using the port. A few days after I reported the > problem to the mailinglist, I had given up for now, but then I noticed that > it suddenly worked! So it remains a mystery what was wrong as I did not > change anything at all, neither in my program nor on the host. > > Baldur > I suspect two java applications had the port open. Its easy to do while developing. Perhaps z instead of c was entered. This is the reason for adding lockfile support to rxtx. If another application has opened the port, a second application will appear to not be able to read or get only part of the data. ..because the first one is reading. Only one of the select()s are waken. Its possible to put lockfile support in for HPUX if it is known where other applications place their lockfiles. The easiest way to find out where is to fire up minicom, kermit, ... and see where its lockfile is placed. Here are the known suspects: const char *lockdirs[]={ "/etc/locks", "/usr/spool/kermit", "/usr/spool/locks", "/usr/spool/uucp", "/usr/spool/uucp/", "/usr/spool/uucp/LCK", "/var/lock", "/var/lock/modem", "/var/spool/lock", "/var/spool/locks", "/var/spool/uucp",NULL }; freebsd uses /var/spool/uucp/, linux uses /var/lock those are the only two I've done so far. Adding the support is trivial once a directory is decided upon. Lockfiles are rather simple. when an application opens a port it first checks if there is a file with the ports name. If there is it grabs the PID from the file. If that PID is still active the application does not open the port. If the PID is not active or there is no lockfile, the application creates one with its own PID in it. The confusion starts when you have to decide where (see above) to put the lockfile, what the name format is for the file and how to store the PID. rxtx follows The File System Hierarchy Standard http://www.pathname.com/fhs/ on linux. I'm not positive what is normal on other OS's. more reading: The File System Hierarchy Standard http://www.pathname.com/fhs/ FSSTND ftp://tsx-11.mit.edu/pub/linux/docs/linux-standards/fsstnd/ Proposed Changes to the File System Hierarchy Standard ftp://scicom.alphacdc.com/pub/linux/devlock-0.X.tgz "UNIX Network Programming", W. Richard Stevens, Prentice-Hall, 1990, pages 96-101. more reading: V. My ThinkPad is Not Working! Scott Burleigh writes: For your files, and in case anybody asks in the future, IBM Thinkpads ship with the external serial port *disabled* by default. The Thinkpad configuration utility supplied with the machine (under Windows) says it's enabled, and the device manager in the System dialog of the Control panel says it's enabled, but they lie. In order to enable the port you have to use the old DOS ps2.exe bios configuration utility which, under Windows 2000, is in c:\Program Files\Thinkpad\utilities: ps2 sera enable Until you do, "setserial -ga /dev/ttyS0" will always tell you the UART is unknown. 4. APPLETS More info is needed on signing applets. This is an exchange from the rxtx mail- list. A. Using Applets prashantg10@yahoo.com asked: Hi All ! I am trying to use applet on thin terminal which has Linux base Kernel.For testing I am using Linux machine.I have install all the required components. e.g. JDK, RXTX. Everthing is fine. BlackBox runs ,even my application runs. When It comes to applet, everything is halts. It does not even show the listing of ports. Is it because applet can't run under root account or what might be the reasons. Can anybody tell me solution. Son To replied: Java applets run withing the sandbox of the security manager. Applets must be signed to access the com port, but for development purposes you can put user_pref("signed.applets.codebase_principal_support", true); in your prefs.js located in ~/.mozilla/default/XYYrandomDirName I didn't use Java applet for my application. I used XUL and CSS for the GUI development and used mozilla Javascript SOAP library to communicate with apache Axis webservice backend which uses RXTX to access the com port. ------------------------------------------------------------------------------- -- Mario Jou/3en debian/clean0000644000000000000000000000000511642703155010172 0ustar *.m4 debian/librxtx-java.docs0000644000000000000000000000010711642703155012455 0ustar AUTHORS RMISecurityManager.html SerialPortInstructions.txt README TODO debian/rules0000755000000000000000000000075711653443165010267 0ustar #!/usr/bin/make -f %: dh $@ --with autotools-dev --with autoreconf --with javahelper override_dh_auto_install: $(MAKE) install RXTX_PATH=$(CURDIR)/debian/librxtx-java/usr/lib/jni \ JHOME=$(CURDIR)/debian/librxtx-java/usr/share/java override_dh_auto_build: $(MAKE) RXTX_PATH=/usr/lib/jni $(MAKE) docs override_dh_install: find . -name *.la -delete dh_install override_dh_installchangelogs: dh_installchangelogs ChangeLog override_dh_strip: dh_strip --dbg-package=librxtx-java-dbg debian/librxtx-java.doc-base0000644000000000000000000000056211642703155013207 0ustar Document: librxtx-rmisecuritymanager Title: RMISecurityManager and CommAPI workaround Author: Alejandro P. Revilla Abstract: Email describing a work around for accessing CommAPI after setting an RMISecurityManager(). Section: Programming Format: HTML Index: /usr/share/doc/librxtx-java/RMISecurityManager.html Files: /usr/share/doc/librxtx-java/RMISecurityManager.html debian/changelog0000644000000000000000000001657711762420167011066 0ustar rxtx (2.2pre2-11) unstable; urgency=low * debian/patches/MonitorThread-daemon.patch - Mark threads created by RXTX as daemon so JVM can shut down gracefully. Thanks to Christopher Wellons (Closes: #674975) * debian/patches/fhs_lock_buffer_overflow_fix.patch - Prevents java from failing with buffer overflow when a locked serial debice is opened. Thanks to Sergio Talens-Oliag (Closes: #673778) -- Scott Howard Sat, 02 Jun 2012 10:13:50 -0400 rxtx (2.2pre2-10) unstable; urgency=low * debian/patches/multiple_property_dirs.patch - handles the case where the "java.ext.dirs" system property contains more than one directory. (Closes: #646069) Thanks Philip Ashmore. * Added librxtx-java-dbg package and added uninstall target (Closes: #646356) -- Scott Howard Mon, 31 Oct 2011 03:04:52 -0400 rxtx (2.2pre2-9) unstable; urgency=low * debian/rules: dh_install -X.la for removal of *.la from libraries -- Scott Howard Tue, 04 Oct 2011 18:24:09 -0400 rxtx (2.2pre2-8) UNRELEASED; urgency=low * Updated kfreebsd_port.patch to follow FHS * replaced debian_porting.patch with sys_io_h_check.patch to use AC_CHECK_HEADERS to determine if sys/io.h is on a system. Thanks to Nobuhiro Iwamatsu. (Closes: #609152) * port_to_hurd.patch defines that HURD uses the FHS. -- Scott Howard Wed, 23 Feb 2011 23:28:09 -0500 rxtx (2.2pre2-7) unstable; urgency=low * Continued poritng effor: added --with autotools-dev --with autoreconf to debian/rules -- Scott Howard Sun, 06 Feb 2011 12:56:21 -0500 rxtx (2.2pre2-6) unstable; urgency=low * debian/patches/kfreebsd_libpthread.patch - libc_r is not available, use libpthread on kfreebsd * Merge to unstable -- Scott Howard Sun, 06 Feb 2011 12:05:45 -0500 rxtx (2.2pre2-5) experimental; urgency=low * debian/patches/kreebsd_porting.patch - Fixed a FTBFS from not defining __FreeBSD_kernel__ * Ported to s390 by adding it to debian_porting.patch. -- Scott Howard Fri, 04 Feb 2011 00:32:37 -0500 rxtx (2.2pre2-4) experimental; urgency=low * Updated debian/copyright. * debian/compat is now 8 * debian/patches/debian_porting.patch - Fixed a FTBFS in src/RawImp.c for systems without sys/io.h (Closes: #609152) * debian/patches/kreebsd_porting.patch - Fixed a FTBFS from not defining __FreeBSD_kernel__ (Closes: #585089) * debian/patches/zsystem_exception.patch - Print error if initialization fails (Closes: #472053) -- Scott Howard Thu, 03 Feb 2011 21:05:47 -0500 rxtx (2.2pre2-3) experimental; urgency=low * Added ${java:Recommends} to debian/control to recommend links to system installed javadocs per Debian Java Policy. * Debian policy 3.9.1 (no changes). * Added ttyACM_ports.patch to allow for enumeration of many additional ports, including ttyACM used in Arduino Uno development boards. -- Scott Howard Tue, 05 Oct 2010 09:42:49 -0400 rxtx (2.2pre2-2) unstable; urgency=low * Added javadoc to package * Changed build depend on default-jdk-builddep to default-jdk -- Scott Howard Thu, 24 Jun 2010 20:39:54 -0400 rxtx (2.2pre2-1) unstable; urgency=low * New upstream release: - Fixes JVM crash and UnsatisfiedLinkError/NoClassDefFoundError (Closes: #523139) (Closes: #489701) - Fixes amd64 support (Closes: #574395) * Added debian/watch file * Switched to source format 3.0 (quilt) - moved debian changes into patch in debian/patches * Changed rules to use dh * Fixed multiple lintian errors and multiple warnings - Policy version 3.8.4 * Section moved to java from libs * Moved to team maintenance: Maintainer: Debian Java maintainers - Mario and I moved to uploaders * DM Uploads Allowed: yes * Build depends on javahelper - Binary depends on ${java:Depends}, use jh_installlibs for versioned install - Versioned naming of RXTXcomm.jar (Debian java policy) * Added VCS tags to debian/control * Libs now install in /usr/lib/jni instead of /usr/lib * Added doc-base file -- Scott Howard Thu, 03 Jun 2010 23:19:16 -0400 rxtx (2.1.7r2-4) unstable; urgency=low * Changed Java build dependency to default-jdk-builddep. (closes: Bug#491169) * Changed Java dependency to java-runtime. (closes: Bug#463115) -- Mario Joussen Mon, 21 Jul 2008 18:20:31 +0200 rxtx (2.1.7r2-3) unstable; urgency=low * Removed check of UTS_RELEASE. (closes: Bug#428998) -- Mario Joussen Sat, 28 Jul 2007 16:13:55 +0200 rxtx (2.1.7r2-2) unstable; urgency=low * Fixed configure script for Java version 1.6. (closes: Bug#417109) -- Mario Joussen Tue, 3 Jul 2007 21:27:42 +0200 rxtx (2.1.7r2-1) unstable; urgency=low * New upstream release. (closes: Bug#428998) -- Mario Joussen Sat, 30 Jun 2007 12:43:58 +0200 rxtx (2.1.7-2) unstable; urgency=low * Fixed stupid bug in clean target. (closes: Bug#354859) -- Mario Joussen Wed, 1 Mar 2006 18:56:52 +0100 rxtx (2.1.7-1) unstable; urgency=low * New upstream release. * Fixed broken build system to make package compilable with Kaffe again. (closes: Bug#290420, Bug#301364) -- Mario Joussen Sun, 26 Feb 2006 12:14:09 +0100 rxtx (2.1.6-2) unstable; urgency=high * Ship jar file instead of individual classfiles. (closes: Bug#275916) * Renamed binary package according to Java sub-policy. * Changes to configure.in, so rxtx can be compiled with recent versions of Kaffe and hence can be moved from contrib to main. * Removed unnecessary postinst. * Fixed Build-Depends and Depends to include a real package (kaffe-dev, kaffe) in order to shut up lintian. * Thanks for all these changes to Hilko Bengen . -- Mario Joussen Sun, 17 Oct 2004 23:49:00 +0200 rxtx (2.1.6-1) unstable; urgency=low * New upstream release. (closes: Bug#160368) -- Mario Joussen Sat, 2 Nov 2002 15:26:07 +0100 rxtx (1.5.9pre5-1) unstable; urgency=low * New maintainer. (closes: Bug#133233) * New upstream release. (closes: Bug#132572) * Changed the dependencies according to the proposed Debian Java policy. (closes: Bug#112353, Bug#74168, Bug#44469) * Removed the included jar file and put the class files under /usr/share/java/repository instead. -- Mario Joussen Wed, 6 Mar 2002 00:50:09 +0100 rxtx (1.3.8-1) unstable; urgency=low * New upstream release -- Christian Leutloff Thu, 18 Nov 1999 21:23:57 +0100 rxtx (1.3.3-4) unstable; urgency=low * control: depends on jdk1.1 (>= 1.1.7v2) -- Christian Leutloff Sun, 4 Jul 1999 12:48:05 +0200 rxtx (1.3.3-3) unstable; urgency=low * fixed package layout -- Christian Leutloff Sun, 4 Jul 1999 12:47:06 +0200 rxtx (1.3.3-2) unstable; urgency=low * improve generation of the needed links (could be improved further) and package layout -- Christian Leutloff Wed, 30 Jun 1999 10:25:58 +0200 rxtx (1.3.3-1) unstable; urgency=low * Initial Release. -- Christian Leutloff Mon, 28 Jun 1999 11:47:41 +0200 debian/librxtx-java.dirs0000644000000000000000000000003311653431004012455 0ustar usr/lib/jni usr/share/java debian/librxtx-java.jlibs0000644000000000000000000000001511653425004012622 0ustar RXTXcomm.jar debian/compat0000644000000000000000000000000211642703155010370 0ustar 8 debian/librxtx-java.lintian-overrides0000644000000000000000000000034211642703155015164 0ustar #The library is installed into /usr/lib/jni, per Debian java policy. postrm and postinst calls are being added by debhelper librxtx-java: postinst-has-useless-call-to-ldconfig librxtx-java: postrm-has-useless-call-to-ldconfig debian/librxtx-java.javadoc0000644000000000000000000000000511642703155013131 0ustar api/