Increase preset RTS/DTR command buffer size

This commit is contained in:
hedgecrw85 2019-10-29 11:37:51 -05:00
parent 11864b4afe
commit 0acc234660
5 changed files with 15 additions and 15 deletions

View File

@ -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);

View File

@ -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

View File

@ -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);
}