Fix getDSR status call in Posix

This commit is contained in:
hedgecrw85 2019-04-15 10:34:54 -05:00
parent 4065bdd8fe
commit 69aba390fa
23 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@
* SerialPort_Android.c * SerialPort_Android.c
* *
* Created on: Mar 13, 2015 * Created on: Mar 13, 2015
* Last Updated on: Mar 07, 2019 * Last Updated on: Apr 15, 2019
* Author: Will Hedgecock * Author: Will Hedgecock
* *
* Copyright (C) 2012-2019 Fazecast, Inc. * Copyright (C) 2012-2019 Fazecast, Inc.
@ -668,7 +668,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_getDSR(JNIEn
if (serialPortFD <= 0) if (serialPortFD <= 0)
return JNI_FALSE; return JNI_FALSE;
int modemBits = 0; int modemBits = 0;
return (ioctl(serialPortFD, TIOCMGET, &modemBits) == 0) && (modemBits & TIOCM_LE); return (ioctl(serialPortFD, TIOCMGET, &modemBits) == 0) && (modemBits & TIOCM_DSR);
} }
JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_getDCD(JNIEnv *env, jobject obj, jlong serialPortFD) JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_getDCD(JNIEnv *env, jobject obj, jlong serialPortFD)

View File

@ -2,7 +2,7 @@
* SerialPort_Posix.c * SerialPort_Posix.c
* *
* Created on: Feb 25, 2012 * Created on: Feb 25, 2012
* Last Updated on: Mar 07, 2019 * Last Updated on: Apr 15, 2019
* Author: Will Hedgecock * Author: Will Hedgecock
* *
* Copyright (C) 2012-2019 Fazecast, Inc. * Copyright (C) 2012-2019 Fazecast, Inc.
@ -791,7 +791,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_getDSR(JNIEn
if (serialPortFD <= 0) if (serialPortFD <= 0)
return JNI_FALSE; return JNI_FALSE;
int modemBits = 0; int modemBits = 0;
return (ioctl(serialPortFD, TIOCMGET, &modemBits) == 0) && (modemBits & TIOCM_LE); return (ioctl(serialPortFD, TIOCMGET, &modemBits) == 0) && (modemBits & TIOCM_DSR);
} }
JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_getDCD(JNIEnv *env, jobject obj, jlong serialPortFD) JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_getDCD(JNIEnv *env, jobject obj, jlong serialPortFD)