This project is read-only.
1
Vote

Add CtsHolding property to SerialPort class

description

I would be useful to have CtsHolding property available in SerialPort class.
I think it would not be hard to implement it.

comments

NameOfTheDragon wrote Jul 20, 2015 at 1:15 AM

What pin would it control? Unlike on a desktop PC where the CTS pin is part of the physical serial port UART, on Netduino most of the UART channels don't actually have flow control pins, so you'd need to change the method signature and it would just be messy.

However, since we are using C# and it is object oriented, and the SerialPort class is not sealed, you can easily add that behaviour yourself by inheriting from SerialPort and adding your own CtsHolding property.

JanKucera wrote Jul 20, 2015 at 9:35 AM

.NET Micro Framework does support hardware flow for serial ports since version 3.0 and you can get the CTS/RTS pins using HardwareProvider.GetSerialPins method.

iamin wrote Jul 31, 2015 at 7:34 PM

What pin would it control?
As MSDN states, it reads the status of CTS pin (it does not control it): “Gets the state of the Clear-to-Send line”.
Unlike on a desktop PC where the CTS pin is part of the physical serial port UART, on Netduino most of the UART channels don't actually have flow control pins, so you'd need to change the method signature and it would just be messy.
I don't know about Netduino, but GHI offers a lot of products which have hardware flow control, so CTS and RTS lines are fully working.
However, since we are using C# and it is object oriented, and the SerialPort class is not sealed, you can easily add that behaviour yourself by inheriting from SerialPort and adding your own CtsHolding property.
I don't think you have looked inside the SerialPort class if you are suggesting this. I would like to see how you would do that “easily”.
.NET Micro Framework does support hardware flow for serial ports since version 3.0 and you can get the CTS/RTS pins using HardwareProvider.GetSerialPins method.
You can get CTS pin number, but you cannot read it. That’s because CTS and all other UART related pins are reserved.

JanKucera wrote Jul 31, 2015 at 10:54 PM

You can get CTS pin number, but you cannot read it. That’s because CTS and all other UART related pins are reserved.
Yep, the existence of CTS/RTS pins for serial ports was argument supporting your request. :-)