RTS_CONTROL_TOGGLE or Win32 handle to the serial port
C#
1
Posts
1
Posters
0
Views
1
Watching
-
Does anyone know if it's possible to get the Win32 handle to the serial port used under the hood in System.IO.SerialPort? The reason I want it is so I'd be able to make changes the DCB struct. I want to set the fRtsControl to RTS_CONTROL_TOGGLE so the RTS signal will be reset automatically when the TX buffer is empty. The other option would be to wait for a "tx buffer empty" event to be signalled after a call to Write. Something like this: port.RtsEnable = true; port.Write(buffer, 0, byteCount); WaitForTxBufferToBeEmpty(port); this.port.RtsEnable = false; ...but how do I implement WaitForTxBufferToBeEmpty?