using System; using System.IO.Ports; using System.Threading; using System.Threading.Tasks; namespace DeviceCommand.Base { public interface ISerialPort { public SerialPort SerialPort { get; set; } Task ConnectAsync(CancellationToken ct = default); void Close(); Task SendAsync(string data, CancellationToken ct = default); Task myReadAsync(string delimiter = "\n", CancellationToken ct = default); } }