Реферат: Інтерфейси автоматизованих систем управління
}
/// <summary> Close the serial port. </summary>
public void Close()
{
StopReading();
_serialPort.Close();
StatusChanged("connection closed");
}
/// <summary> Get the status of the serial port. </summary>
public bool IsOpen
{
get
{
return _serialPort.IsOpen;
}
}
/// <summary> Get a list of the available ports. Already opened ports
/// are not returend. </summary>
public string[] GetAvailablePorts()
{
return SerialPort.GetPortNames();
}
/// <summary>Send data to the serial port after appending line ending. </summary>
/// <param name="data">An string containing the data to send. </param>
public void Send(string data)
{
if (IsOpen)
{
string lineEnding = "";