From 0acc2346608902fe6a3d3f58873fc20fbdceede7 Mon Sep 17 00:00:00 2001 From: hedgecrw85 Date: Tue, 29 Oct 2019 11:37:51 -0500 Subject: [PATCH] Increase preset RTS/DTR command buffer size --- src/main/c/Android/jni/SerialPort_Android.c | 10 +++++----- src/main/c/Posix/SerialPort_Posix.c | 10 +++++----- src/main/c/Windows/SerialPort_Windows.c | 10 +++++----- .../resources/Windows/x86/jSerialComm.dll | Bin 122880 -> 122880 bytes .../resources/Windows/x86_64/jSerialComm.dll | Bin 146432 -> 146432 bytes 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/c/Android/jni/SerialPort_Android.c b/src/main/c/Android/jni/SerialPort_Android.c index eef803e..753d6e3 100644 --- a/src/main/c/Android/jni/SerialPort_Android.c +++ b/src/main/c/Android/jni/SerialPort_Android.c @@ -2,7 +2,7 @@ * SerialPort_Android.c * * Created on: Mar 13, 2015 - * Last Updated on: Oct 15, 2019 + * Last Updated on: Oct 29, 2019 * Author: Will Hedgecock * * Copyright (C) 2012-2019 Fazecast, Inc. @@ -612,7 +612,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_presetRTS(JN const char *portName = (*env)->GetStringUTFChars(env, portNameJString, NULL); // Send a system command to preset the RTS mode of the serial port - char commandString[64]; + char commandString[128]; sprintf(commandString, "stty -F %s hupcl >>/dev/null 2>&1", portName); int result = system(commandString); @@ -626,7 +626,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_preclearRTS( const char *portName = (*env)->GetStringUTFChars(env, portNameJString, NULL); // Send a system command to preset the RTS mode of the serial port - char commandString[64]; + char commandString[128]; sprintf(commandString, "stty -F %s -hupcl >>/dev/null 2>&1", portName); int result = system(commandString); @@ -656,7 +656,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_presetDTR(JN const char *portName = (*env)->GetStringUTFChars(env, portNameJString, NULL); // Send a system command to preset the DTR mode of the serial port - char commandString[64]; + char commandString[128]; sprintf(commandString, "stty -F %s hupcl >>/dev/null 2>&1", portName); int result = system(commandString); @@ -670,7 +670,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_preclearDTR( const char *portName = (*env)->GetStringUTFChars(env, portNameJString, NULL); // Send a system command to preset the DTR mode of the serial port - char commandString[64]; + char commandString[128]; sprintf(commandString, "stty -F %s -hupcl >>/dev/null 2>&1", portName); int result = system(commandString); diff --git a/src/main/c/Posix/SerialPort_Posix.c b/src/main/c/Posix/SerialPort_Posix.c index 18df503..bce9719 100644 --- a/src/main/c/Posix/SerialPort_Posix.c +++ b/src/main/c/Posix/SerialPort_Posix.c @@ -2,7 +2,7 @@ * SerialPort_Posix.c * * Created on: Feb 25, 2012 - * Last Updated on: Oct 15, 2019 + * Last Updated on: Oct 29, 2019 * Author: Will Hedgecock * * Copyright (C) 2012-2019 Fazecast, Inc. @@ -722,7 +722,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_presetRTS(JN const char *portName = (*env)->GetStringUTFChars(env, portNameJString, NULL); // Send a system command to preset the RTS mode of the serial port - char commandString[64]; + char commandString[128]; #if defined(__linux__) sprintf(commandString, "stty -F %s hupcl >>/dev/null 2>&1", portName); #else @@ -740,7 +740,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_preclearRTS( const char *portName = (*env)->GetStringUTFChars(env, portNameJString, NULL); // Send a system command to preset the RTS mode of the serial port - char commandString[64]; + char commandString[128]; #if defined(__linux__) sprintf(commandString, "stty -F %s -hupcl >>/dev/null 2>&1", portName); #else @@ -774,7 +774,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_presetDTR(JN const char *portName = (*env)->GetStringUTFChars(env, portNameJString, NULL); // Send a system command to preset the DTR mode of the serial port - char commandString[64]; + char commandString[128]; #if defined(__linux__) sprintf(commandString, "stty -F %s hupcl >>/dev/null 2>&1", portName); #else @@ -792,7 +792,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_preclearDTR( const char *portName = (*env)->GetStringUTFChars(env, portNameJString, NULL); // Send a system command to preset the DTR mode of the serial port - char commandString[64]; + char commandString[128]; #if defined(__linux__) sprintf(commandString, "stty -F %s -hupcl >>/dev/null 2>&1", portName); #else diff --git a/src/main/c/Windows/SerialPort_Windows.c b/src/main/c/Windows/SerialPort_Windows.c index fbb8862..c5e061a 100644 --- a/src/main/c/Windows/SerialPort_Windows.c +++ b/src/main/c/Windows/SerialPort_Windows.c @@ -2,7 +2,7 @@ * SerialPort_Windows.c * * Created on: Feb 25, 2012 - * Last Updated on: Oct 15, 2019 + * Last Updated on: Oct 29, 2019 * Author: Will Hedgecock * * Copyright (C) 2012-2019 Fazecast, Inc. @@ -803,7 +803,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_presetRTS(JN int result = -1; if (comPort != NULL) { - char commandString[32]; + char commandString[64]; sprintf(commandString, "cmd.exe /C \"MODE %s rts=on > nul 2>&1\"", comPort + 1); result = system(commandString); } @@ -822,7 +822,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_preclearRTS( int result = -1; if (comPort != NULL) { - char commandString[32]; + char commandString[64]; sprintf(commandString, "cmd.exe /C \"MODE %s rts=off > nul 2>&1\"", comPort + 1); result = system(commandString); } @@ -857,7 +857,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_presetDTR(JN int result = -1; if (comPort != NULL) { - char commandString[32]; + char commandString[64]; sprintf(commandString, "cmd.exe /C \"MODE %s dtr=on > nul 2>&1\"", comPort + 1); result = system(commandString); } @@ -876,7 +876,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_preclearDTR( int result = -1; if (comPort != NULL) { - char commandString[32]; + char commandString[64]; sprintf(commandString, "cmd.exe /C \"MODE %s dtr=off > nul 2>&1\"", comPort + 1); result = system(commandString); } diff --git a/src/main/resources/Windows/x86/jSerialComm.dll b/src/main/resources/Windows/x86/jSerialComm.dll index 3c809484d408175c31000b7b75a9f38f9998efd8..7c3af35dd819609e3b090b2fb07f12528ca0d5a4 100644 GIT binary patch delta 261 zcmZoTz}|3xeE}o0Yu1j<%#8n)#9bD$JYWWfW+fv; h6LD5rs-an#$OyKwd5hZeEozLdATMvWfW+fv; h6LD5rs-an#$OyKwd5hZeEozLdATMv4 diff --git a/src/main/resources/Windows/x86_64/jSerialComm.dll b/src/main/resources/Windows/x86_64/jSerialComm.dll index 2f6aa9e2e5b52f1dc099725afd9d66457d54317e..d559b96d7f2790d9edf04a2f236b87c53f603adf 100644 GIT binary patch delta 240 zcmZqp!O`%8V*w+xS=Nrt%#1fw1qwX6SylfsGI$st@#u6>NtpavtwA)w!}!dLH_QwS z9^G?P7BB$m<|74@8`P!2%2WR!DPOG)Rjz}s+(9E6qWm|qat)YrCLE?O{e`4FTNA20 vhY?kIlh!sZ#wCY9{@A|!4dZ!Meh~(qOB@C432Xrdxr_`6+gm>|R(k>frp{9` delta 240 zcmZqp!O`%8V*w-c56)$qnHg`W3Iup`v#S1OWbiOP;?e1%;xPHOT7#&Ahw+&gZ|R(k>fudh(-