/// <summary> /// Send data to the serial port. /// </summary> /// <param name="data">Data to send.</param> public void SendDataToSerial(string data) { // Verify connection is open then send data if (IsSerialConnected()) { _serialPort.SendData(data); } }
/// <summary> /// Send data to the serial port. /// </summary> /// <param name="data">Data to send.</param> /// <param name="useCR">Add [CR] to end.</param> public void SendDataToSerial(string data, bool useCR = true) { // Verify connection is open then send data if (IsSerialConnected()) { // Add carrage return, line feed to the end _serialPort.SendData(data, useCR); } }
/// <summary> /// Send data to the serial port. /// </summary> /// <param name="data">Data to send.</param> public void SendDataToSerial(string data) { // Verify connection is open then send data if (IsSerialConnected()) { // Add carrage return, line feed to the end _serialPort.SendData(data + "\r\n", false); } }