| ClassPath: | MEng.System.Runtime.CommCfg |
| Parent ClassPath: | MEng.Object |
| Copyable: | Yes |
| Final: | Yes |
MEng.System.Runtime.CommCfg just conglomerates configuration information about a serial port into one place so that it can be moved around and set on the port easily. It includes things like data bits, stop bits, parity, baud, so so forth. Note that it does not include the actual port (COM1, COM2, etc...) because that's not port configuration, it's port selection.
Nested Classes:
Enum=CommPortFlags
Parity : "Control parity checking";
CTSOut : "Control CTS line assertion";
DSROut : "Control DSR line assertion";
XOut : "Control XOut usage";
XIn : "Control XIn usage";
EndEnum;This enumerated type provides control of some miscellaneous aspects of com port control. It is used via the SetPortFlag() method to turn off or on each flag.
Enum=DataBits
Four : "Four Data Bits";
Five : "Five Data Bits";
Six : "Six Data Bits";
Seven : "Seven Data Bits";
Eight : "Eight Data Bits";
EndEnum;This enumerated type is used to indicate the number of data bits that the port should used. They might not all be supported on a particular platform's port hardware. But few devices use anything other than eight bits these days anyway.
Enum=DTRFlags
Disable : "Disable DTR";
Enable : "Enable DTR";
Handshake : "Handshake DTR";
EndEnum;This enumerated type is used to manage the DTR line of the com port. You can disable it, enable it, or have the driver use it in a hardware handshake mode.
Enum=Parities
None : "No Parity";
Odd : "Odd Parity";
Even : "Even Parity";
Mark : "Mark Parity";
Space : "Space Parity";
EndEnum;This enumerated type is used to indicate the style of parity bits that the com port should use. Note that this just insures that the port sends parity bits out correctly. If you want it to check incoming parity to insure it is correct, that is done via the port flags.
Enum=RTSFlags
Disable : "Disable RTS";
Enable : "Enable RTS";
Handshake : "Handshake RTS";
Toggle : "Toggle RTS";
EndEnum;This enumerated type is used to manage the RTS line of the com port. You can disable it, enable it, have the driver use it in a hardware handshake mode or toggle mode.
Enum=StopBits
One : "1 StopBits";
OnePtFive : "1.5 StopBits";
Two : "2 StopBits";
EndEnum;This enumerated type is used to indicate the number of stop bits you wish the port to use and expect from the other end point.
Constructors:
Constructor();
Constructor
(
[In] MEng.Card4 BaudRate
, [In] Parities ParityToUse
, [In] DataBits DataBitsToUse
, [In] StopBits StopBitsToUse
, [In] DTRFlags DTRToUse
, [In] RTSFlags RTSToUse
);There is a default constructor that sets default values so you will need to set it up before using it. And there is another constructor that takes all of the values.
Final, Const Methods:
GetBaud() Returns MEng.Card4;
Returns the currently set baud rate in this object.
GetDataBits() Returns DataBits;
Returns the currently set data bit value in this object.
GetDTRFlag() Returns DTRFlags;
Returns the currently set DTR flag value in this object.
GetParity() Returns Parities;
Returns the currently set parity value in this object.
GetPortFlag([In] CommPortFlags ToGet) Returns MEng.Boolean;
Returns the state of the indicate com port flag. If the flag is on, the return is True, else it is False.
GetRTSFlag() Returns RTSFlags;
Returns the currently set RTS flag value in this object.
GetStopBits() Returns StopBits;
Returns the currently set stop bits value in this object.
Final, Non-Const Methods:
ClearPortFlag([In] CommPortFlags ToClear);
Clears the com port flag indicated by the enumerated parameter ToClear. Use SetPortFlag to set a flag.
SetBaud([In] MEng.Card4 ToSet);
Sets the baud rate member to the passed value.
SetDataBits([In] DataBits ToSet)
Sets the data bits member to the passed value.
SetDTRFlag([In] DTRFlags ToSet);
Set the DTR flags member to the passed value.
SetParity([In] Parities ToSet);
Sets the parity member to the passed value.
SetPortFlag([In] CommPortFlags ToSet);
Sets the com port flag indicated by the passed enumerated value. Use ClearPortFlag to clear a flag.
SetRTSFlag([In] RTSFlags ToSet);
Sets the RTS flag member to the passed value
SetStopBits([In] StopBits ToSet);
Sets the stop bits member to the passed value