/// <summary> /// Comstructor to set the properties of our /// serial port communicator to nothing /// </summary> public CommunicationManager() { _baudRate = string.Empty; _parity = string.Empty; _stopBits = string.Empty; _dataBits = string.Empty; _portName = "COM1"; _displayWindow = null; _serialPortConnectInformation = null; }
public void OpenTest() { SerialPort target = new SerialPort(); SerialPortConnectInformation serialPortConnectInformation = null; target.Open(serialPortConnectInformation); bool actual = target.IsOpen; Assert.AreEqual(false, actual); }
/// <summary> /// Constructor to set the properties of our Manager Class /// </summary> /// <param name="baud">Desired BaudRate</param> /// <param name="par">Desired Parity</param> /// <param name="sBits">Desired StopBits</param> /// <param name="dBits">Desired DataBits</param> /// <param name="name">Desired PortName</param> /// <param name="rtb">Rich Textbox, to display messages.</param> public CommunicationManager(string baud, string par, string sBits, string dBits, string name, RichTextBox rtb) { _baudRate = baud; _parity = par; _stopBits = sBits; _dataBits = dBits; _portName = name; _displayWindow = rtb; _serialPortConnectInformation = new SerialPortConnectInformation( name, int.Parse(_baudRate), (Parity)Enum.Parse(typeof(Parity), _parity), int.Parse(_dataBits), (StopBits)Enum.Parse(typeof(StopBits), _stopBits)); //now add an event handler comNativePort.DataReceived += new SerialDataReceivedEventHandler(comNativePort_DataReceived); comSerialPort.onDataReceived += new SerialPortEventHandler(comSerialPort_DataReceived); }
/// <summary> /// Open method, to open a connection to the serial port. /// </summary> /// <param name="serialPortConnectInformation">Connection information, to open the serial port.</param> public void Open(SerialPortConnectInformation serialPortConnectInformation) { _serialPort.Open(serialPortConnectInformation); }
public void Open(SerialPortConnectInformation serialPortConnectInformation) { _isOpen = true; }
/// <summary> /// Open a connection. /// </summary> /// <param name="serialPortConnectInformation">Contains the serial connection information.</param> public void Open(SerialPortConnectInformation serialPortConnectInformation) { _nuvoTelegram.Open(serialPortConnectInformation); }
public void Open(SerialPortConnectInformation serialPortConnectInformation) { _serialPortConnectInformation = serialPortConnectInformation; CreateSerialPort(); }
public void Open(SerialPortConnectInformation serialPortConnectInformation) { OpenQueues(); }
public void Open(SerialPortConnectInformation serialPortConnectInformation) { _log.Debug(m => m("Open called.")); }
public void Open(SerialPortConnectInformation serialPortConnectInformation) { _log.Debug(m => m("Open called. {0}", serialPortConnectInformation.ToString())); _openMethodCalled = true; _serialPortConnectInformation = serialPortConnectInformation; }