Fix getDSR status call in Posix
This commit is contained in:
parent
4065bdd8fe
commit
69aba390fa
|
@ -2,7 +2,7 @@
|
|||
* SerialPort_Android.c
|
||||
*
|
||||
* Created on: Mar 13, 2015
|
||||
* Last Updated on: Mar 07, 2019
|
||||
* Last Updated on: Apr 15, 2019
|
||||
* Author: Will Hedgecock
|
||||
*
|
||||
* Copyright (C) 2012-2019 Fazecast, Inc.
|
||||
|
@ -668,7 +668,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_getDSR(JNIEn
|
|||
if (serialPortFD <= 0)
|
||||
return JNI_FALSE;
|
||||
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)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* SerialPort_Posix.c
|
||||
*
|
||||
* Created on: Feb 25, 2012
|
||||
* Last Updated on: Mar 07, 2019
|
||||
* Last Updated on: Apr 15, 2019
|
||||
* Author: Will Hedgecock
|
||||
*
|
||||
* Copyright (C) 2012-2019 Fazecast, Inc.
|
||||
|
@ -791,7 +791,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_getDSR(JNIEn
|
|||
if (serialPortFD <= 0)
|
||||
return JNI_FALSE;
|
||||
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)
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue