It means that you’r Send method does not have a return type. Meaning that you don’t return anything in that method. If that method shouldn’t return anything, then just add void as a return type:
public void Send(SerialPort serialPort1)
{
if (serialPort1.IsOpen)
{
var content = new List<byte>();
content.Add(2);
content.AddRange(Encoding.ASCII.GetBytes(CommandText));
content.Add(3);
byte[] buffer = content.ToArray();
serialPort1.Write(buffer, 0, buffer.Length);
}
}
1
solved “Method must have a return type” [closed]