You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.2 KiB
45 lines
1.2 KiB
using MultiTerm.Protocols.Types;
|
|
|
|
namespace MultiTerm.Protocols;
|
|
|
|
/// <summary>
|
|
/// Interface to interact with a Communication protocol.
|
|
/// </summary>
|
|
public interface ICommunicationProtocol
|
|
{
|
|
/// <summary>
|
|
/// Indicates the protocol type of the implementing class.
|
|
/// </summary>
|
|
ProtocolType ProtocolType { get; }
|
|
|
|
/// <summary>
|
|
/// Contains settings that are required to connect and use this communication protocol.
|
|
/// </summary>
|
|
IProtocolSettings? Settings { get; }
|
|
|
|
/// <summary>
|
|
/// New data received from connected device.
|
|
/// </summary>
|
|
event EventHandler<ReceivedDataEventArgs>? ReceivedDataEvent;
|
|
|
|
/// <summary>
|
|
/// New data sent to the connected device.
|
|
/// </summary>
|
|
event EventHandler<SentDataEventArgs>? SentDataEvent;
|
|
|
|
/// <summary>
|
|
/// Connect to the device.
|
|
/// </summary>
|
|
void Connect();
|
|
|
|
/// <summary>
|
|
/// Disconnect from the device. Ends all internal activities.
|
|
/// </summary>
|
|
void Disconnect();
|
|
|
|
/// <summary>
|
|
/// Send data to the connected device.
|
|
/// </summary>
|
|
/// <param name="bytes">data to send, as an array of bytes</param>
|
|
void SendBytes(byte[] bytes);
|
|
}
|
|
|