Hello @sirjuicebox-9237 ,
Thank you for reaching out.
The behavior you see happens when you open a serial port with CreateFile(). This is normal. When the port opens, the driver often turns on some modem lines (like DTR or RTS) by default. Your application can see a HIGH signal right away. This can cause false positives.
You can try these ways to fix it:
- Set modem lines after opening the port Use GetCommState to get the current settings. Change DTR and RTS as you want. Then apply the settings with SetCommState.
- Clear modem lines manually Use EscapeCommFunction with
CLRDTRorCLRRTSafter opening the port.
Hope this helps. If you found my response helpful or informative in any way, I would greatly appreciate it if you could follow this guidance to provide feedback.
Thank you.