Skip to content

Implemention to clear break (IOCTL_SERIAL_SET_BREAK_OFF) #200

Description

@marcpuca

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;
		}
	}
	// ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions