From owner-svn-ports-head@freebsd.org Thu Feb 9 17:50:08 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2011CCD7FE5; Thu, 9 Feb 2017 17:50:08 +0000 (UTC) (envelope-from krion@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB5361E81; Thu, 9 Feb 2017 17:50:07 +0000 (UTC) (envelope-from krion@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v19Ho6iE080350; Thu, 9 Feb 2017 17:50:06 GMT (envelope-from krion@FreeBSD.org) Received: (from krion@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v19Ho6Jx080346; Thu, 9 Feb 2017 17:50:06 GMT (envelope-from krion@FreeBSD.org) Message-Id: <201702091750.v19Ho6Jx080346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: krion set sender to krion@FreeBSD.org using -f From: Kirill Ponomarew Date: Thu, 9 Feb 2017 17:50:06 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r433756 - in head/comms/rxtx: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2017 17:50:08 -0000 Author: krion Date: Thu Feb 9 17:50:06 2017 New Revision: 433756 URL: https://svnweb.freebsd.org/changeset/ports/433756 Log: - Added LICENSE - Fixed patches for portlint - Supressed debug message on RXTXPort:removeEventListener:Exit when not in debug mode - Added java bootstrap class - Updated java source/target directives which will be depreciated in future release, see http://openjdk.java.net/ +jeps/182, and regression tested functionality. PR: 216248 Submitted by: james@elstone.net Approved by: mat (mentor) Differential Revision: https://reviews.freebsd.org/D9508 Modified: head/comms/rxtx/Makefile head/comms/rxtx/files/patch-Makefile.in head/comms/rxtx/files/patch-src-ParallelImp.c head/comms/rxtx/files/patch-src-SerialImp.c head/comms/rxtx/files/patch-src-gnu-io-CommPort.java head/comms/rxtx/files/patch-src-gnu-io-CommPortEnumerator.java head/comms/rxtx/files/patch-src-gnu-io-CommPortIdentifier.java head/comms/rxtx/files/patch-src-gnu-io-Configure.java head/comms/rxtx/files/patch-src-gnu-io-LPRPort.java head/comms/rxtx/files/patch-src-gnu-io-NoSuchPortException.java head/comms/rxtx/files/patch-src-gnu-io-RXTXCommDriver.java head/comms/rxtx/files/patch-src-gnu-io-RXTXPort.java head/comms/rxtx/files/patch-src-gnu-io-SerialPortEvent.java Modified: head/comms/rxtx/Makefile ============================================================================== --- head/comms/rxtx/Makefile Thu Feb 9 17:48:06 2017 (r433755) +++ head/comms/rxtx/Makefile Thu Feb 9 17:50:06 2017 (r433756) @@ -3,7 +3,7 @@ PORTNAME= rxtx PORTVERSION= 2.2p2 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= comms java MASTER_SITES= http://rxtx.qbang.org/pub/rxtx/ \ ftp://jarvi.dsl.frii.com/pub/rxtx/ @@ -13,6 +13,9 @@ DISTNAME= ${PORTNAME}-${PORTVERSION:S/p/ MAINTAINER= james@elstone.net COMMENT= Native interface to serial ports in Java +LICENSE= LGPL21 +LICENSE_FILE= ${WRKSRC}/COPYING + USES= gmake libtool zip USE_JAVA= yes Modified: head/comms/rxtx/files/patch-Makefile.in ============================================================================== --- head/comms/rxtx/files/patch-Makefile.in Thu Feb 9 17:48:06 2017 (r433755) +++ head/comms/rxtx/files/patch-Makefile.in Thu Feb 9 17:50:06 2017 (r433756) @@ -1,5 +1,5 @@ ---- Makefile.in.orig 2008-12-31 10:29:12.000000000 +0800 -+++ Makefile.in 2014-05-23 10:05:55.350336425 +0800 +--- Makefile.in.orig 2008-12-31 02:29:12 UTC ++++ Makefile.in @@ -619,13 +619,15 @@ $(CLASSES): $(javafiles) $(TOP)/Makefile # install librxtxSerial.so into the proper directory and copy $(JARTARGET) to its # proper location Modified: head/comms/rxtx/files/patch-src-ParallelImp.c ============================================================================== --- head/comms/rxtx/files/patch-src-ParallelImp.c Thu Feb 9 17:48:06 2017 (r433755) +++ head/comms/rxtx/files/patch-src-ParallelImp.c Thu Feb 9 17:50:06 2017 (r433756) @@ -1,6 +1,6 @@ ---- src/ParallelImp.c.orig 2008-11-27 20:01:48.000000000 +0000 -+++ src/ParallelImp.c 2015-05-11 16:52:36.000000000 +0100 -@@ -265,9 +265,6 @@ +--- src/ParallelImp.c.orig 2008-11-27 20:01:48 UTC ++++ src/ParallelImp.c +@@ -265,9 +265,6 @@ JNIEXPORT jboolean JNICALL LPRPort(isPri #if defined(__linux__) return( status & LP_BUSY ? JNI_TRUE : JNI_FALSE ); #endif Modified: head/comms/rxtx/files/patch-src-SerialImp.c ============================================================================== --- head/comms/rxtx/files/patch-src-SerialImp.c Thu Feb 9 17:48:06 2017 (r433755) +++ head/comms/rxtx/files/patch-src-SerialImp.c Thu Feb 9 17:50:06 2017 (r433756) @@ -1,5 +1,5 @@ ---- src/SerialImp.c.orig 2009-02-04 22:06:16.000000000 +0000 -+++ src/SerialImp.c 2015-05-11 16:52:36.000000000 +0100 +--- src/SerialImp.c.orig 2009-02-04 22:06:16 UTC ++++ src/SerialImp.c @@ -1,60 +1,79 @@ /*------------------------------------------------------------------------- -| RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. @@ -166,7 +166,7 @@ #endif /* HAVE_SYS_FILE_H */ #ifdef LFS /* File Lock Server */ # include -@@ -167,59 +186,59 @@ +@@ -167,59 +186,59 @@ struct preopened *preopened_port = NULL; /*---------------------------------------------------------- cfmakeraw @@ -263,7 +263,7 @@ #endif /* DEBUG_TIMING */ -@@ -229,16 +248,16 @@ +@@ -229,16 +248,16 @@ struct event_info_struct *master_index = /*---------------------------------------------------------- RXTXPort.Initialize @@ -290,7 +290,7 @@ ----------------------------------------------------------*/ struct event_info_struct build_threadsafe_eis( JNIEnv *env, -@@ -264,13 +283,13 @@ +@@ -264,13 +283,13 @@ struct event_info_struct build_threadsaf /*---------------------------------------------------------- RXTXPort.Initialize @@ -311,7 +311,7 @@ It also allows for some sanity checks on linux boxes if DEBUG is enabled. ----------------------------------------------------------*/ -@@ -284,9 +303,9 @@ +@@ -284,9 +303,9 @@ JNIEXPORT void JNICALL RXTXPort(Initiali char message[80]; #endif /* DEBUG && __linux__ */ /* This bit of code checks to see if there is a signal handler installed @@ -324,7 +324,7 @@ /* POSIX signal handling functions */ #if !defined(WIN32) -@@ -306,7 +325,7 @@ +@@ -306,7 +325,7 @@ JNIEXPORT void JNICALL RXTXPort(Initiali sigaction(SIGIO, &new_action, NULL); } #endif /* !WIN32 */ @@ -333,7 +333,7 @@ #ifdef PRERELEASE /* this is just for avoiding confusion while testing new libraries */ #ifdef DEBUG_MW -@@ -322,32 +341,33 @@ +@@ -322,32 +341,33 @@ JNIEXPORT void JNICALL RXTXPort(Initiali /* Lets let people who upgraded kernels know they may have problems */ if (uname (&name) == -1) { @@ -380,7 +380,7 @@ This is used so people can setDTR low before calling the Java open(). ----------------------------------------------------------*/ -@@ -401,13 +421,13 @@ +@@ -401,13 +421,13 @@ int find_preopened_ports( const char *fi /*---------------------------------------------------------- configure_port @@ -401,7 +401,7 @@ ----------------------------------------------------------*/ int configure_port( int fd ) { -@@ -446,31 +466,31 @@ +@@ -446,31 +466,31 @@ fail: /*---------------------------------------------------------- get_java_baudrate @@ -453,7 +453,7 @@ #ifdef B14400 case B14400: return 14400; #endif /* B14400 */ -@@ -536,13 +556,13 @@ +@@ -536,13 +556,13 @@ int get_java_baudrate( int native_speed /*---------------------------------------------------------- set_java_vars @@ -474,7 +474,7 @@ ----------------------------------------------------------*/ void set_java_vars( JNIEnv *env, jobject jobj, int fd ) -@@ -570,10 +590,10 @@ +@@ -570,10 +590,10 @@ void set_java_vars( JNIEnv *env, jobject switch( ttyset.c_cflag&CSIZE ) { @@ -489,7 +489,7 @@ } #ifdef CMSPAR switch( ttyset.c_cflag&(PARENB|PARODD|CMSPAR ) ) { -@@ -588,9 +608,9 @@ +@@ -588,9 +608,9 @@ void set_java_vars( JNIEnv *env, jobject case PARENB | CMSPAR: jparity = JPARITY_SPACE; break; #endif /* CMSPAR */ } @@ -502,7 +502,7 @@ if ( (ttyset.c_cflag & CSIZE) == CS5 ) { stop_bits = STOPBITS_1_5; } -@@ -598,7 +618,7 @@ +@@ -598,7 +618,7 @@ void set_java_vars( JNIEnv *env, jobject stop_bits = STOPBITS_2; } break; @@ -511,7 +511,7 @@ /* dima writes: -@@ -616,9 +636,9 @@ +@@ -616,9 +636,9 @@ cf{get,set}{i,o}speed and shouldn't be p */ #if defined(CBAUD)/* dima */ @@ -523,7 +523,7 @@ #endif (*env)->SetIntField(env, jobj, jfspeed, ( jint ) get_java_baudrate(baudrate) ); -@@ -629,14 +649,14 @@ +@@ -629,14 +649,14 @@ cf{get,set}{i,o}speed and shouldn't be p /*---------------------------------------------------------- RXTXPort.open @@ -546,7 +546,7 @@ ----------------------------------------------------------*/ JNIEXPORT jint JNICALL RXTXPort(open)( JNIEnv *env, -@@ -676,9 +696,10 @@ +@@ -676,9 +696,10 @@ JNIEXPORT jint JNICALL RXTXPort(open)( system_does_not_lock Win32 */ @@ -558,7 +558,7 @@ sprintf( message, "open: locking has failed for %s\n", filename ); report( message ); -@@ -686,6 +707,7 @@ +@@ -686,6 +707,7 @@ JNIEXPORT jint JNICALL RXTXPort(open)( } else { @@ -566,7 +566,7 @@ sprintf( message, "open: locking worked for %s\n", filename ); report( message ); } -@@ -703,36 +725,36 @@ +@@ -703,36 +725,36 @@ JNIEXPORT jint JNICALL RXTXPort(open)( } while (fd < 0 && errno==EINTR); #ifdef OPEN_EXCL @@ -583,17 +583,16 @@ - filename ); - report( message ); - report_error( message ); -- -- close(fd); -- goto fail; -- } + /* + Note that open() follows POSIX semantics: multiple open() calls to + the same file will succeed unless the TIOCEXCL ioctl is issued. + This will prevent additional opens except by root-owned processes. + See tty(4) ("man 4 tty") and ioctl(2) ("man 2 ioctl") for details. + */ -+ + +- close(fd); +- goto fail; +- } + if (fd >= 0 && (ioctl(fd, TIOCEXCL) == -1)) + { + memset(&message[0], 0, sizeof(message)); @@ -622,7 +621,7 @@ throw_java_exception( env, PORT_IN_USE_EXCEPTION, "open", strerror( errno ) ); return -1; -@@ -741,10 +763,10 @@ +@@ -741,10 +763,10 @@ fail: /*---------------------------------------------------------- RXTXPort.nativeClose @@ -637,7 +636,7 @@ ----------------------------------------------------------*/ JNIEXPORT void JNICALL RXTXPort(nativeClose)( JNIEnv *env, jobject jobj,jstring jstr ) -@@ -764,7 +786,7 @@ +@@ -764,7 +786,7 @@ JNIEXPORT void JNICALL RXTXPort(nativeCl (*env)->ExceptionDescribe( env ); (*env)->ExceptionClear( env ); (*env)->DeleteLocalRef( env, jclazz ); @@ -646,7 +645,7 @@ return; } report("DeleteLocalRef( env, jclazz ); report("nativeClose: release filename\n"); (*env)->ReleaseStringUTFChars( env, jstr, filename ); @@ -672,7 +671,7 @@ report_time_end( ); return; } -@@ -801,15 +823,15 @@ +@@ -801,15 +823,15 @@ JNIEXPORT void JNICALL RXTXPort(nativeCl /*---------------------------------------------------------- RXTXPort.set_port_params @@ -696,7 +695,7 @@ ----------------------------------------------------------*/ int set_port_params( JNIEnv *env, int fd, int cspeed, int dataBits, int stopBits, int parity ) -@@ -864,36 +886,36 @@ +@@ -864,36 +886,36 @@ int set_port_params( JNIEnv *env, int fd ioctl( fd, TIOCMSET, &result ); } /* @@ -749,7 +748,7 @@ */ #if defined(TIOCGSERIAL) -@@ -905,7 +927,7 @@ +@@ -905,7 +927,7 @@ int set_port_params( JNIEnv *env, int fd sstruct.custom_divisor = ( sstruct.baud_base/cspeed ); cspeed = B38400; #endif /* TIOCGSERIAL */ @@ -758,7 +757,7 @@ cfsetospeed( &ttyset, cspeed ) < 0 ) { /* OK, we tried everything */ -@@ -933,10 +955,10 @@ +@@ -933,10 +955,10 @@ int set_port_params( JNIEnv *env, int fd /*---------------------------------------------------------- RXTXPort.nativeSetSerialPortParams @@ -773,7 +772,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(nativeSetSerialPortParams)( JNIEnv *env, jobject jobj, jint speed, jint dataBits, jint stopBits, -@@ -945,15 +967,15 @@ +@@ -945,15 +967,15 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati int fd = get_java_var( env, jobj,"fd","I" ); int cspeed = translate_speed( env, speed ); @@ -792,7 +791,7 @@ throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "", "BaudRate could not be set to the specified value" ); */ -@@ -964,17 +986,17 @@ +@@ -964,17 +986,17 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati if( set_port_params( env, fd, cspeed, dataBits, stopBits, parity ) ) { report("set_port_params failed\n"); @@ -814,7 +813,7 @@ report_time_end( ); return(0); } -@@ -982,17 +1004,17 @@ +@@ -982,17 +1004,17 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati /*---------------------------------------------------------- translate_speed @@ -840,7 +839,7 @@ switch( speed ) { case 0: return B0; case 50: return B50; -@@ -1072,7 +1094,7 @@ +@@ -1072,7 +1094,7 @@ int translate_speed( JNIEnv *env, jint s if( speed >= 0 ) return speed; else { @@ -849,7 +848,7 @@ return -1; } } -@@ -1080,16 +1102,16 @@ +@@ -1080,16 +1102,16 @@ int translate_speed( JNIEnv *env, jint s /*---------------------------------------------------------- translate_data_bits @@ -871,7 +870,7 @@ switch( dataBits ) { case JDATABITS_5: (*cflag) = temp | CS5; -@@ -1105,10 +1127,10 @@ +@@ -1105,10 +1127,10 @@ int translate_data_bits( JNIEnv *env, tc return 0; } @@ -885,7 +884,7 @@ throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "", "databit value not supported" ); */ -@@ -1118,20 +1140,20 @@ +@@ -1118,20 +1140,20 @@ int translate_data_bits( JNIEnv *env, tc /*---------------------------------------------------------- translate_stop_bits @@ -914,7 +913,7 @@ return 0; /* ok.. lets try putting it in and see if anyone notices */ case STOPBITS_1_5: -@@ -1141,14 +1163,14 @@ +@@ -1141,14 +1163,14 @@ int translate_stop_bits( JNIEnv *env, tc return 0; case STOPBITS_2: (*cflag) |= CSTOPB; @@ -933,7 +932,7 @@ throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "", "stopbit value not supported" ); */ -@@ -1181,7 +1203,7 @@ +@@ -1181,7 +1203,7 @@ JNIEXPORT jint JNICALL RXTXPort(nativeGe if( tcgetattr( fd, &ttyset ) < 0 ) { @@ -942,7 +941,7 @@ return( -1 ); } #ifdef CMSPAR -@@ -1215,49 +1237,49 @@ +@@ -1215,49 +1237,49 @@ JNIEXPORT jint JNICALL RXTXPort(nativeGe /*---------------------------------------------------------- translate_parity @@ -1007,7 +1006,7 @@ throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "", "parity value not supported" ); */ -@@ -1267,48 +1289,63 @@ +@@ -1267,48 +1289,63 @@ int translate_parity( JNIEnv *env, tcfla /*---------------------------------------------------------- drain_loop() @@ -1088,7 +1087,7 @@ sprintf(msg, "drain_loop: setting OUTPUT_BUFFER_EMPTY\n" ); report( msg ); */ -@@ -1321,17 +1358,17 @@ +@@ -1321,17 +1358,17 @@ void *drain_loop( void *arg ) { goto end; } @@ -1109,7 +1108,7 @@ } } end: -@@ -1344,12 +1381,12 @@ +@@ -1344,12 +1381,12 @@ end: /*---------------------------------------------------------- finalize_threads( ) @@ -1128,7 +1127,7 @@ The is the pthread spawned on systems that can't access the LSR (Line Status Register). Without access to the LSR rxtx cannot detect when the output buffer is empty in the Monitor -@@ -1361,14 +1398,14 @@ +@@ -1361,14 +1398,14 @@ finalize_threads( ) ----------------------------------------------------------*/ void finalize_threads( struct event_info_struct *eis ) { @@ -1146,7 +1145,7 @@ #endif /* TIOCSERGETLSR & !WIN32 */ } -@@ -1377,6 +1414,8 @@ +@@ -1377,6 +1414,8 @@ static void warn_sig_abort( int signo ) { /* char msg[80]; @@ -1155,7 +1154,7 @@ sprintf( msg, "RXTX Recieved Signal %i\n", signo ); report_error( msg ); */ -@@ -1386,17 +1425,19 @@ +@@ -1386,17 +1425,19 @@ static void warn_sig_abort( int signo ) /*---------------------------------------------------------- init_threads( ) @@ -1183,7 +1182,7 @@ jfieldID jeis; #if !defined(TIOCSERGETLSR) & !defined(WIN32) sigset_t newmask, oldmask; -@@ -1404,7 +1445,7 @@ +@@ -1404,7 +1445,7 @@ int init_threads( struct event_info_stru pthread_t tid; report_time_start( ); @@ -1192,7 +1191,7 @@ /* ignore child thread status changes */ sigemptyset(&newmask); sigaddset(&newmask, SIGCHLD); -@@ -1412,14 +1453,17 @@ +@@ -1412,14 +1453,17 @@ int init_threads( struct event_info_stru /* install our own signal hander */ newaction.sa_handler = warn_sig_abort; sigemptyset( &newaction.sa_mask ); @@ -1203,7 +1202,6 @@ - /* JOE: do not demand restart! we are handling EINTR */ -/* newaction.sa_flags = SA_RESTART;*/ -#endif /* SA_RESTART */ -- + #ifdef SA_INTERRUPT + newaction.sa_flags = SA_INTERRUPT; + #endif /* SA_INTERRUPT */ @@ -1211,14 +1209,14 @@ + /* JOE: do not demand restart! we are handling EINTR */ + /* newaction.sa_flags = SA_RESTART;*/ + #endif /* SA_RESTART */ -+ + + /** + * POSIX SIGABRT behaviour not changed in original code!! + **/ sigaction(SIGABRT, &newaction, &oldaction); sigaction(SIGCHLD, &newaction, &oldaction); sigaction(SIGALRM, &newaction, &oldaction); -@@ -1443,23 +1487,25 @@ +@@ -1443,23 +1487,25 @@ int init_threads( struct event_info_stru pthread_detach( tid ); eis->drain_tid = tid; #endif /* TIOCSERGETLSR */ @@ -1250,7 +1248,7 @@ ----------------------------------------------------------*/ JNIEXPORT void JNICALL RXTXPort(writeByte)( JNIEnv *env, jobject jobj, jint ji, jboolean interrupted ) -@@ -1476,8 +1522,9 @@ +@@ -1476,8 +1522,9 @@ JNIEXPORT void JNICALL RXTXPort(writeByt #endif /* __sun__ */ report_time_start(); @@ -1261,7 +1259,7 @@ sprintf( msg, "writeByte %c>>\n", byte ); report( msg ); result=WRITE (fd, (void * ) &byte, sizeof(unsigned char)); -@@ -1506,12 +1553,14 @@ +@@ -1506,12 +1553,14 @@ JNIEXPORT void JNICALL RXTXPort(writeByt index->next ) index = index->next; } index->writing = 1; @@ -1278,7 +1276,7 @@ if(result >= 0) { report_time_end(); -@@ -1525,13 +1574,13 @@ +@@ -1525,13 +1574,13 @@ fail: /*---------------------------------------------------------- RXTXPort.writeArray @@ -1299,7 +1297,7 @@ ----------------------------------------------------------*/ JNIEXPORT void JNICALL RXTXPort(writeArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint count, -@@ -1562,9 +1611,10 @@ +@@ -1562,9 +1611,10 @@ JNIEXPORT void JNICALL RXTXPort(writeArr /* return; OH CRAP */ report_time_start(); @@ -1311,7 +1309,7 @@ sprintf( message, "::::RXTXPort:writeArray(%s);\n", (char *) body ); report_verbose( message ); */ -@@ -1600,7 +1650,7 @@ +@@ -1600,7 +1650,7 @@ JNIEXPORT void JNICALL RXTXPort(writeArr index->next ) index = index->next; } index->writing = 1; @@ -1320,7 +1318,7 @@ } #endif /* TIOCSERGETLSR */ /* -@@ -1615,7 +1665,7 @@ +@@ -1615,7 +1665,7 @@ JNIEXPORT void JNICALL RXTXPort(writeArr Things just start spinning out of control after that. */ @@ -1329,7 +1327,7 @@ report_time_end(); fail: if( result < 0 ) throw_java_exception( env, IO_EXCEPTION, -@@ -1625,15 +1675,14 @@ +@@ -1625,15 +1675,14 @@ fail: /*---------------------------------------------------------- RXTXPort.nativeDrain @@ -1353,7 +1351,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(nativeDrain)( JNIEnv *env, jobject jobj, jboolean interrupted ) -@@ -1644,7 +1693,7 @@ +@@ -1644,7 +1693,7 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati char message[80]; @@ -1362,7 +1360,7 @@ report_time_start( ); do { report_verbose( "nativeDrain: trying tcdrain\n" ); -@@ -1652,13 +1701,15 @@ +@@ -1652,13 +1701,15 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati count++; } while (result && errno==EINTR && count <3); @@ -1379,7 +1377,7 @@ if( result ) throw_java_exception( env, IO_EXCEPTION, "nativeDrain", strerror( errno ) ); if( interrupted ) return( JNI_FALSE ); -@@ -1669,10 +1720,12 @@ +@@ -1669,10 +1720,12 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati eis->output_buffer_empty_flag = 0; } #endif /* !TIOCSERGETLSR !WIN32 */ @@ -1393,7 +1391,7 @@ send_event( &myeis, SPE_OUTPUT_BUFFER_EMPTY, 1 ); } report_time_end( ); -@@ -1682,29 +1735,29 @@ +@@ -1682,29 +1735,29 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati /*---------------------------------------------------------- RXTXPort.sendBreak @@ -1433,7 +1431,7 @@ ----------------------------------------------------------*/ JNIEXPORT jint JNICALL RXTXPort(NativegetReceiveTimeout)( JNIEnv *env, -@@ -1714,12 +1767,12 @@ +@@ -1714,12 +1767,12 @@ JNIEXPORT jint JNICALL RXTXPort(Nativege int fd = get_java_var( env, jobj,"fd","I" ); struct termios ttyset; @@ -1449,7 +1447,7 @@ throw_java_exception( env, IO_EXCEPTION, "getReceiveTimeout", strerror( errno ) ); return -1; -@@ -1728,10 +1781,10 @@ +@@ -1728,10 +1781,10 @@ fail: /*---------------------------------------------------------- RXTXPort.NativeisReceiveTimeoutEnabled @@ -1464,7 +1462,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(NativeisReceiveTimeoutEnabled)( JNIEnv *env, -@@ -1740,12 +1793,12 @@ +@@ -1740,12 +1793,12 @@ JNIEXPORT jboolean JNICALL RXTXPort(Nati { int fd = get_java_var( env, jobj,"fd","I" ); struct termios ttyset; @@ -1480,7 +1478,7 @@ throw_java_exception( env, IO_EXCEPTION, "isReceiveTimeoutEnabled", strerror( errno ) ); return JNI_FALSE; -@@ -1754,12 +1807,12 @@ +@@ -1754,12 +1807,12 @@ fail: /*---------------------------------------------------------- RXTXPort.isDSR @@ -1499,7 +1497,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(isDSR)( JNIEnv *env, jobject jobj ) -@@ -1768,11 +1821,13 @@ +@@ -1768,11 +1821,13 @@ JNIEXPORT jboolean JNICALL RXTXPort(isDS int fd = get_java_var( env, jobj,"fd","I" ); char message[80]; @@ -1515,7 +1513,7 @@ if( result & TIOCM_DSR ) return JNI_TRUE; else return JNI_FALSE; } -@@ -1780,15 +1835,15 @@ +@@ -1780,15 +1835,15 @@ JNIEXPORT jboolean JNICALL RXTXPort(isDS /*---------------------------------------------------------- RXTXPort.isCD @@ -1540,7 +1538,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(isCD)( JNIEnv *env, -@@ -1798,10 +1853,12 @@ +@@ -1798,10 +1853,12 @@ JNIEXPORT jboolean JNICALL RXTXPort(isCD int fd = get_java_var( env, jobj,"fd","I" ); char message[80]; @@ -1555,7 +1553,7 @@ if( result & TIOCM_CD ) return JNI_TRUE; else return JNI_FALSE; } -@@ -1809,12 +1866,12 @@ +@@ -1809,12 +1866,12 @@ JNIEXPORT jboolean JNICALL RXTXPort(isCD /*---------------------------------------------------------- RXTXPort.isCTS @@ -1574,7 +1572,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(isCTS)( JNIEnv *env, jobject jobj ) -@@ -1823,11 +1880,13 @@ +@@ -1823,11 +1880,13 @@ JNIEXPORT jboolean JNICALL RXTXPort(isCT int fd = get_java_var( env, jobj,"fd","I" ); char message[80]; @@ -1590,7 +1588,7 @@ if( result & TIOCM_CTS ) return JNI_TRUE; else return JNI_FALSE; } -@@ -1835,12 +1894,12 @@ +@@ -1835,12 +1894,12 @@ JNIEXPORT jboolean JNICALL RXTXPort(isCT /*---------------------------------------------------------- RXTXPort.isRI @@ -1609,7 +1607,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(isRI)( JNIEnv *env, jobject jobj ) -@@ -1849,11 +1908,13 @@ +@@ -1849,11 +1908,13 @@ JNIEXPORT jboolean JNICALL RXTXPort(isRI int fd = get_java_var( env, jobj,"fd","I" ); char message[80]; @@ -1625,7 +1623,7 @@ if( result & TIOCM_RI ) return JNI_TRUE; else return JNI_FALSE; } -@@ -1861,12 +1922,12 @@ +@@ -1861,12 +1922,12 @@ JNIEXPORT jboolean JNICALL RXTXPort(isRI /*---------------------------------------------------------- RXTXPort.isRTS @@ -1644,7 +1642,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(isRTS)( JNIEnv *env, jobject jobj ) -@@ -1875,11 +1936,13 @@ +@@ -1875,11 +1936,13 @@ JNIEXPORT jboolean JNICALL RXTXPort(isRT int fd = get_java_var( env, jobj,"fd","I" ); char message[80]; @@ -1660,7 +1658,7 @@ if( result & TIOCM_RTS ) return JNI_TRUE; else return JNI_FALSE; } -@@ -1887,13 +1950,13 @@ +@@ -1887,13 +1950,13 @@ JNIEXPORT jboolean JNICALL RXTXPort(isRT /*---------------------------------------------------------- RXTXPort.setRTS @@ -1681,7 +1679,7 @@ ----------------------------------------------------------*/ JNIEXPORT void JNICALL RXTXPort(setRTS)( JNIEnv *env, jobject jobj, jboolean state ) -@@ -1902,27 +1965,29 @@ +@@ -1902,27 +1965,29 @@ JNIEXPORT void JNICALL RXTXPort(setRTS)( int fd = get_java_var( env, jobj,"fd","I" ); char message[80]; @@ -1720,7 +1718,7 @@ ----------------------------------------------------------*/ JNIEXPORT void JNICALL RXTXPort(setDSR)( JNIEnv *env, jobject jobj, jboolean state ) -@@ -1931,28 +1996,31 @@ +@@ -1931,28 +1996,31 @@ JNIEXPORT void JNICALL RXTXPort(setDSR)( int fd = get_java_var( env, jobj,"fd","I" ); char message[80]; @@ -1760,7 +1758,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(isDTR)( JNIEnv *env, jobject jobj ) -@@ -1961,11 +2029,13 @@ +@@ -1961,11 +2029,13 @@ JNIEXPORT jboolean JNICALL RXTXPort(isDT int fd = get_java_var( env, jobj,"fd","I" ); char message[80]; @@ -1776,7 +1774,7 @@ if( result & TIOCM_DTR ) return JNI_TRUE; else return JNI_FALSE; } -@@ -1973,12 +2043,12 @@ +@@ -1973,12 +2043,12 @@ JNIEXPORT jboolean JNICALL RXTXPort(isDT /*---------------------------------------------------------- RXTXPort.setDTR @@ -1795,7 +1793,7 @@ ----------------------------------------------------------*/ JNIEXPORT void JNICALL RXTXPort(setDTR)( JNIEnv *env, jobject jobj, jboolean state ) -@@ -1987,32 +2057,35 @@ +@@ -1987,32 +2057,35 @@ JNIEXPORT void JNICALL RXTXPort(setDTR)( int fd = get_java_var( env, jobj,"fd","I" ); char message[80]; @@ -1822,20 +1820,19 @@ - exceptions: none - comments: the info is checked on open() if its in the list no - changes are performed on the file on open() -- -- comments: see -- RXTXPort.nativeStaticSetDSR -- RXTXPort.nativeStaticSetDTR -- RXTXPort.nativeStaticSetRTS -- RXTXPort.nativeStaticSetSerialPortParams -- This is used so people can setDTR low before calling the + accept: filename and fd to save + perform: add a struct holding the info to a linked list + return: none + exceptions: none + comments: the info is checked on open() if its in the list no + changes are performed on the file on open() -+ + +- comments: see +- RXTXPort.nativeStaticSetDSR +- RXTXPort.nativeStaticSetDTR +- RXTXPort.nativeStaticSetRTS +- RXTXPort.nativeStaticSetSerialPortParams +- This is used so people can setDTR low before calling the + comments: see + RXTXPort.nativeStaticSetDSR + RXTXPort.nativeStaticSetDTR @@ -1846,7 +1843,7 @@ -----------------------------------------------------------*/ void static_add_filename( const char *filename, int fd) -@@ -2055,14 +2128,14 @@ +@@ -2055,14 +2128,14 @@ void static_add_filename( const char *fi /*---------------------------------------------------------- RXTXPort.nativeSetBaudBase @@ -1869,7 +1866,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(nativeSetBaudBase)( JNIEnv *env, -@@ -2103,13 +2176,13 @@ +@@ -2103,13 +2176,13 @@ fail: /*---------------------------------------------------------- RXTXPort.nativeGetBaudBase @@ -1890,7 +1887,7 @@ ----------------------------------------------------------*/ JNIEXPORT jint JNICALL RXTXPort(nativeGetBaudBase)( JNIEnv *env, -@@ -2141,14 +2214,14 @@ +@@ -2141,14 +2214,14 @@ fail: /*---------------------------------------------------------- RXTXPort.nativeSetDivisor @@ -1913,7 +1910,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(nativeSetDivisor)( JNIEnv *env, -@@ -2187,13 +2260,13 @@ +@@ -2187,13 +2260,13 @@ fail: /*---------------------------------------------------------- RXTXPort.nativeGetDivisor @@ -1934,7 +1931,7 @@ ----------------------------------------------------------*/ JNIEXPORT jint JNICALL RXTXPort(nativeGetDivisor)( JNIEnv *env, -@@ -2226,18 +2299,18 @@ +@@ -2226,18 +2299,18 @@ fail: /*---------------------------------------------------------- RXTXPort.nativeStaticSetDSR @@ -1963,7 +1960,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(nativeStaticSetDSR) (JNIEnv *env, jclass jclazz, jstring jstr, jboolean flag) -@@ -2247,7 +2320,7 @@ +@@ -2247,7 +2320,7 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati int result; const char *filename = (*env)->GetStringUTFChars( env, jstr, 0 ); @@ -1972,7 +1969,7 @@ #ifndef WIN32 pid = getpid(); #endif /* WIN32 */ -@@ -2281,29 +2354,29 @@ +@@ -2281,29 +2354,29 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati /* dont close the port. Its not clear if the DSR would remain high */ (*env)->ReleaseStringUTFChars( env, jstr, filename ); @@ -1999,8 +1996,6 @@ - - This is static so we can not call the open() setDTR() - we dont have the jobject. -- -- First introduced in rxtx-1.5-9 + accept: new RTS state + perform: if flag is true, TIOCM_RTS is set + if flag is false, TIOCM_RTS is unset @@ -2008,7 +2003,8 @@ + exceptions: none + comments: Set the RTS so it does not raise on the next open + needed for some funky test boards? -+ + +- First introduced in rxtx-1.5-9 + This is static so we can not call the open() setDTR() + we dont have the jobject. + @@ -2016,7 +2012,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(nativeStaticSetRTS) (JNIEnv *env, jclass jclazz, jstring jstr, jboolean flag) -@@ -2313,7 +2386,7 @@ +@@ -2313,7 +2386,7 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati int result; const char *filename = (*env)->GetStringUTFChars( env, jstr, 0 ); @@ -2025,7 +2021,7 @@ #ifndef WIN32 pid = getpid(); #endif /* WIN32 */ -@@ -2347,29 +2420,29 @@ +@@ -2347,29 +2420,29 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati /* dont close the port. Its not clear if the RTS would remain high */ (*env)->ReleaseStringUTFChars( env, jstr, filename ); @@ -2066,7 +2062,7 @@ ----------------------------------------------------------*/ JNIEXPORT void JNICALL RXTXPort(nativeStaticSetSerialPortParams) (JNIEnv *env, jclass jclazz, jstring jstr, jint baudrate, jint dataBits, jint stopBits, jint parity ) -@@ -2380,7 +2453,7 @@ +@@ -2380,7 +2453,7 @@ JNIEXPORT void JNICALL RXTXPort(nativeSt int cspeed = translate_speed( env, baudrate ); @@ -2075,7 +2071,7 @@ #ifndef WIN32 pid = getpid(); #endif /* WIN32 */ -@@ -2400,7 +2473,7 @@ +@@ -2400,7 +2473,7 @@ JNIEXPORT void JNICALL RXTXPort(nativeSt if ( fd < 0 ) { (*env)->ReleaseStringUTFChars( env, jstr, filename ); @@ -2084,7 +2080,7 @@ throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeStaticSetSerialPortParams", strerror( errno ) ); return; -@@ -2410,14 +2483,14 @@ +@@ -2410,14 +2483,14 @@ JNIEXPORT void JNICALL RXTXPort(nativeSt { (*env)->ReleaseStringUTFChars( env, jstr, filename ); throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, @@ -2101,7 +2097,7 @@ throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeStaticSetSerialPortParams", strerror( errno ) ); return; -@@ -2431,29 +2504,29 @@ +@@ -2431,29 +2504,29 @@ JNIEXPORT void JNICALL RXTXPort(nativeSt /* dont close the port. */ (*env)->ReleaseStringUTFChars( env, jstr, filename ); @@ -2145,7 +2141,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(nativeStaticSetDTR) (JNIEnv *env, jclass jclazz, jstring jstr, jboolean flag) -@@ -2463,7 +2536,7 @@ +@@ -2463,7 +2536,7 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati const char *filename = (*env)->GetStringUTFChars( env, jstr, 0 ); int result; @@ -2154,7 +2150,7 @@ #ifndef WIN32 pid = getpid(); #endif /* WIN32 */ -@@ -2497,24 +2570,24 @@ +@@ -2497,24 +2570,24 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati /* dont close the port. Its not clear if the DTR would remain high */ (*env)->ReleaseStringUTFChars( env, jstr, filename ); @@ -2188,7 +2184,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(nativeStaticIsRTS)( JNIEnv *env, jobject jobj, jstring jstr ) -@@ -2524,29 +2597,31 @@ +@@ -2524,29 +2597,31 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati int fd = find_preopened_ports( filename ); char message[80]; @@ -2229,7 +2225,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(nativeStaticIsDSR)( JNIEnv *env, jobject jobj, jstring jstr ) -@@ -2556,29 +2631,31 @@ +@@ -2556,29 +2631,31 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati int fd = find_preopened_ports( filename ); char message[80]; @@ -2270,7 +2266,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(nativeStaticIsDTR)( JNIEnv *env, jobject jobj, jstring jstr ) -@@ -2588,29 +2665,31 @@ +@@ -2588,29 +2665,31 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati int fd = find_preopened_ports( filename ); char message[80]; @@ -2311,7 +2307,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(nativeStaticIsCD)( JNIEnv *env, jobject jobj, jstring jstr ) -@@ -2620,29 +2699,31 @@ +@@ -2620,29 +2699,31 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati int fd = find_preopened_ports( filename ); char message[80]; @@ -2352,7 +2348,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(nativeStaticIsCTS)( JNIEnv *env, jobject jobj, jstring jstr ) -@@ -2652,29 +2733,31 @@ +@@ -2652,29 +2733,31 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati int fd = find_preopened_ports( filename ); char message[80]; @@ -2393,7 +2389,7 @@ ----------------------------------------------------------*/ JNIEXPORT jboolean JNICALL RXTXPort(nativeStaticIsRI)( JNIEnv *env, jobject jobj, jstring jstr ) -@@ -2684,16 +2767,18 @@ +@@ -2684,16 +2767,18 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati int fd = find_preopened_ports( filename ); char message[80]; @@ -2414,7 +2410,7 @@ if( result & TIOCM_RI ) return JNI_TRUE; else return JNI_FALSE; } -@@ -2701,11 +2786,11 @@ +@@ -2701,11 +2786,11 @@ JNIEXPORT jboolean JNICALL RXTXPort(nati /*---------------------------------------------------------- *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***