Class SerialPort
Provides mehods for interacting with serial ports
Inheritance
System.Object
SerialPort
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Cosmos.HAL
Assembly: Cosmos.HAL2.dll
Syntax
public static class SerialPort
Fields
| Improve this Doc View SourceCOM1
IO port for COM1 port
Declaration
public const ushort COM1 = 1016
Field Value
Type | Description |
---|---|
System.UInt16 |
COM2
IO port for COM2 port
Declaration
public const ushort COM2 = 760
Field Value
Type | Description |
---|---|
System.UInt16 |
COM3
IO port for COM3 port
Declaration
public const ushort COM3 = 1000
Field Value
Type | Description |
---|---|
System.UInt16 |
COM4
IO port for COM4 port
Declaration
public const ushort COM4 = 744
Field Value
Type | Description |
---|---|
System.UInt16 |
COM5
IO port for COM5 port
Declaration
public const ushort COM5 = 1528
Field Value
Type | Description |
---|---|
System.UInt16 |
COM6
IO port for COM6 port
Declaration
public const ushort COM6 = 1272
Field Value
Type | Description |
---|---|
System.UInt16 |
COM7
IO port for COM7 port
Declaration
public const ushort COM7 = 1512
Field Value
Type | Description |
---|---|
System.UInt16 |
COM8
IO port for COM8 port
Declaration
public const ushort COM8 = 1256
Field Value
Type | Description |
---|---|
System.UInt16 |
Methods
| Improve this Doc View SourceEnable(UInt16)
Enables certain COM port
Declaration
public static void Enable(ushort aPort)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | aPort | COM port |
Receive()
Reads byte (ASCII character) from COM1 port
Declaration
public static byte Receive()
Returns
Type | Description |
---|---|
System.Byte |
Receive(UInt16)
Reads byte (ASCII character) from COM port
Declaration
public static byte Receive(ushort aPort)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | aPort | COM port |
Returns
Type | Description |
---|---|
System.Byte | ASCII character as byte |
Send(Char)
Sends character to COM1 port
Declaration
public static void Send(char aText)
Parameters
Type | Name | Description |
---|---|---|
System.Char | aText | Character to send |
Send(Char, UInt16)
Sends character to COM port
Declaration
public static void Send(char aText, ushort aPort)
Parameters
Type | Name | Description |
---|---|---|
System.Char | aText | Character to send |
System.UInt16 | aPort | COM port |
SendString(String)
Sends string to COM1 port
Declaration
public static void SendString(string aText)
Parameters
Type | Name | Description |
---|---|---|
System.String | aText | String to send |
SendString(String, UInt16)
Sends string to COM port
Declaration
public static void SendString(string aText, ushort aPort)
Parameters
Type | Name | Description |
---|---|---|
System.String | aText | String to send |
System.UInt16 | aPort | COM port |