mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 21:05:37 +02:00
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>
This commit is contained in:
parent
2109a6d283
commit
1c4271836b
4 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Reference in a new issue