Currently there is no way to invoke clear break if not previously calling sndBreak, please add the feature
required adding ClearCommBreak(hComm) or possibly amending the code to treat duration -1 as an explicit clear
JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_sendBreak
(JNIEnv *, jobject, jlong portHandle, jint duration){
HANDLE hComm = (HANDLE)portHandle;
// ...
if(SetCommBreak(hComm) > 0){ // Sets Break ON
Sleep(duration);
if(ClearCommBreak(hComm) > 0){ // Sets Break OFF
returnValue = JNI_TRUE;
}
}
// ...
}
Currently there is no way to invoke clear break if not previously calling sndBreak, please add the feature
required adding ClearCommBreak(hComm) or possibly amending the code to treat duration -1 as an explicit clear
JNIEXPORT jboolean JNICALL Java_jssc_SerialNativeInterface_sendBreak (JNIEnv *, jobject, jlong portHandle, jint duration){ HANDLE hComm = (HANDLE)portHandle; // ... if(SetCommBreak(hComm) > 0){ // Sets Break ON Sleep(duration); if(ClearCommBreak(hComm) > 0){ // Sets Break OFF returnValue = JNI_TRUE; } } // ... }