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<bool> ConnectAsync(CancellationToken ct = default);

        void Close();

        Task SendAsync(string data, CancellationToken ct = default);

        Task<string> myReadAsync(string delimiter = "\n", CancellationToken ct = default);
    }
}
