Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTorbjörn SVENSSON2019-09-03 11:22:04 +0000
committerTorbjörn SVENSSON2019-09-03 15:41:53 +0000
commit1c4271836b484b6926809fe3542448bdd970af3d (patch)
tree58c549af473d7752cad360c8fb08f3a4e25b28be
parent2109a6d28314edf0a7f5bc98ab23ed4062fa3410 (diff)
downloadorg.eclipse.cdt-1c4271836b484b6926809fe3542448bdd970af3d.tar.gz
org.eclipse.cdt-1c4271836b484b6926809fe3542448bdd970af3d.tar.xz
org.eclipse.cdt-1c4271836b484b6926809fe3542448bdd970af3d.zip
Bug 550697: Also set DCB.Parity=NOPARITY on Windows
Some serial port drivers on Windows, notably usbser.sys, does not care about DCB.fParity and only relies on DCB.Parity to contain the correct value. In the case where we need to configure it for no parity, the DCB.Parity field needs to be explicitly set to NOPARITY. The above statment has been checked using Wireshark and look at the SET LINE CODING Request package (it contained ODDPARITY although DCB.fParity=FALSE). The statement was also somewhat confirmed by this post: https://stackoverflow.com/questions/36411498. Change-Id: I2e2ab3da5da547e0420e3e61f91452ef0edeb755 Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
-rw-r--r--native/org.eclipse.cdt.native.serial/jni/serial.c2
-rwxr-xr-xnative/org.eclipse.cdt.native.serial/os/linux/x86_64/libserial.sobin13280 -> 13280 bytes
-rwxr-xr-xnative/org.eclipse.cdt.native.serial/os/macosx/x86_64/libserial.jnilibbin13620 -> 13620 bytes
-rwxr-xr-xnative/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dllbin383701 -> 125772 bytes
4 files changed, 2 insertions, 0 deletions
diff --git a/native/org.eclipse.cdt.native.serial/jni/serial.c b/native/org.eclipse.cdt.native.serial/jni/serial.c
index 9ff8e26448..be6c549b1e 100644
--- a/native/org.eclipse.cdt.native.serial/jni/serial.c
+++ b/native/org.eclipse.cdt.native.serial/jni/serial.c
@@ -10,6 +10,7 @@
*
* Contributors:
* QNX Software Systems - initial API and implementation
+ * STMicroelectronics
*******************************************************************************/
#ifdef __APPLE__
#include <sys/types.h>
@@ -194,6 +195,7 @@ JNIEXPORT jlong JNICALL FUNC(open0)(JNIEnv *env, jobject jobj, jstring portName,
switch (parity) {
case 0: // None
dcb.fParity = FALSE;
+ dcb.Parity = NOPARITY;
break;
case 1: // Even
dcb.fParity = TRUE;
diff --git a/native/org.eclipse.cdt.native.serial/os/linux/x86_64/libserial.so b/native/org.eclipse.cdt.native.serial/os/linux/x86_64/libserial.so
index 71e25cdf0b..8d792d5a42 100755
--- a/native/org.eclipse.cdt.native.serial/os/linux/x86_64/libserial.so
+++ b/native/org.eclipse.cdt.native.serial/os/linux/x86_64/libserial.so
Binary files differ
diff --git a/native/org.eclipse.cdt.native.serial/os/macosx/x86_64/libserial.jnilib b/native/org.eclipse.cdt.native.serial/os/macosx/x86_64/libserial.jnilib
index 1631744a7c..2c88702add 100755
--- a/native/org.eclipse.cdt.native.serial/os/macosx/x86_64/libserial.jnilib
+++ b/native/org.eclipse.cdt.native.serial/os/macosx/x86_64/libserial.jnilib
Binary files differ
diff --git a/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll b/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll
index a63fa4db15..849ad95d56 100755
--- a/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll
+++ b/native/org.eclipse.cdt.native.serial/os/win32/x86_64/serial.dll
Binary files differ

Back to the top