Check return value of SetupComm in Windows
This commit is contained in:
parent
5ef0299abd
commit
ca1c709d00
|
@ -2,7 +2,7 @@
|
||||||
* SerialPort_Windows.c
|
* SerialPort_Windows.c
|
||||||
*
|
*
|
||||||
* Created on: Feb 25, 2012
|
* Created on: Feb 25, 2012
|
||||||
* Last Updated on: Feb 19, 2020
|
* Last Updated on: Apr 01, 2020
|
||||||
* Author: Will Hedgecock
|
* Author: Will Hedgecock
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-2020 Fazecast, Inc.
|
* Copyright (C) 2012-2020 Fazecast, Inc.
|
||||||
|
@ -437,8 +437,7 @@ JNIEXPORT jboolean JNICALL Java_com_fazecast_jSerialComm_SerialPort_configPort(J
|
||||||
BOOL XonXoffOutEnabled = ((flowControl & com_fazecast_jSerialComm_SerialPort_FLOW_CONTROL_XONXOFF_OUT_ENABLED) > 0);
|
BOOL XonXoffOutEnabled = ((flowControl & com_fazecast_jSerialComm_SerialPort_FLOW_CONTROL_XONXOFF_OUT_ENABLED) > 0);
|
||||||
|
|
||||||
// Retrieve existing port configuration
|
// Retrieve existing port configuration
|
||||||
SetupComm(serialPortHandle, receiveDeviceQueueSize, sendDeviceQueueSize);
|
if (!configDisabled && (!SetupComm(serialPortHandle, receiveDeviceQueueSize, sendDeviceQueueSize) || !GetCommState(serialPortHandle, &dcbSerialParams)))
|
||||||
if (!configDisabled && !GetCommState(serialPortHandle, &dcbSerialParams))
|
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
|
||||||
// Set updated port parameters
|
// Set updated port parameters
|
||||||
|
|
Loading…
Reference in New Issue