using MultiTerm.Protocols.Types;
namespace MultiTerm.Protocols;
///
/// Interface to interact with a Communication protocol.
///
public interface ICommunicationProtocol
{
///
/// Indicates the protocol type of the implementing class.
///
ProtocolType ProtocolType { get; }
///
/// New data received from connected device.
///
event EventHandler? ReceivedDataEvent;
///
/// New data sent to the connected device.
///
event EventHandler? SentDataEvent;
///
/// Connect to the device.
///
/// settings required to connect and use the protocol
bool Connect(IProtocolSettings settings);
///
/// Disconnect from the device. Ends all internal activities.
///
void Disconnect();
///
/// Send data to the connected device.
///
/// data to send, as an array of bytes
void SendBytes(byte[] bytes);
}