Interface ISerialCommand
Interface for UART communication
Namespace: Elatec.FCT.Client.Hardware
Assembly: ElatecFCT.dll
Syntax
public interface ISerialCommand
Properties
View SourceBaudRate
Serial baudrate
Declaration
int BaudRate { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
DataBits
No of databits
Declaration
int DataBits { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Parity
Paritybit
Declaration
Parity Parity { get; set; }
Property Value
Type | Description |
---|---|
System.IO.Ports.Parity |
PortName
The port name
Declaration
string PortName { get; }
Property Value
Type | Description |
---|---|
System.String |
ReadTimeout
Read timeout in ms
Declaration
int ReadTimeout { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
StopBits
Stopbits
Declaration
StopBits StopBits { get; set; }
Property Value
Type | Description |
---|---|
System.IO.Ports.StopBits |
StopChar
Define wich char shows end of Rx or Tx
Declaration
char StopChar { get; set; }
Property Value
Type | Description |
---|---|
System.Char |
Methods
View SourceClose()
Close a port
Declaration
void Close()
Open()
Open a port
Declaration
void Open()
ReadTo(String)
Read string until string value
Declaration
string ReadTo(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value |
Returns
Type | Description |
---|---|
System.String |
Rx()
read response
Declaration
byte[] Rx()
Returns
Type | Description |
---|---|
System.Byte[] |
Tx(Byte[])
Transmit command
Declaration
void Tx(byte[] tx)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | tx |
TxRx(Byte[])
Transmit command and receive answer
Declaration
byte[] TxRx(byte[] tx)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | tx |
Returns
Type | Description |
---|---|
System.Byte[] |
Write(String)
Write string to serial port
Declaration
void Write(string data)
Parameters
Type | Name | Description |
---|---|---|
System.String | data |
WriteReadTo(String, String)
Write command and read till string value
Declaration
string WriteReadTo(string wrData, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | wrData | |
System.String | value |
Returns
Type | Description |
---|---|
System.String |