20 lines
472 B
C#
20 lines
472 B
C#
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> ReadAsync(string delimiter = "\n", CancellationToken ct = default);
|
|
}
|
|
}
|