I want to set DTS and RTS pins to true/false in .NET using SerialPort-Class.
When setting pins to true/false and sniffing COM-Port there are alot of other things send to the COM-Port that I don't want.
Sniff-Log: https://i.stack.imgur.com/1KU7P.png
Code:
SerialPort serialPort = portSelector.SelectedPort;
serialPort.Parity = Parity.None;
serialPort.StopBits = StopBits.One;
serialPort.DataBits = 8;
serialPort.ReadTimeout = 10;
serialPort.WriteTimeout = 10;
serialPort.BaudRate = 5;
serialPort.Handshake = Handshake.None;
serialPort.Open();
serialPort.DiscardInBuffer();
serialPort.DiscardOutBuffer();
serialPort.DtrEnable = false;
If I do the same thing in C it works and is not sending any garbage I don't want. Can you tell me what I'm doing wrong?
Thank you