namespace MultiTerm.Protocols;
///
/// Interface to interact with a Communication protocol.
///
public interface ICommunicationProtocol
{
///
/// Newline sequence to add on the end when sending a message using .
///
string NewlineSequenceOnSend { get; }
///
/// When this sequence is detected while reading, a new line is introduced.
///
string NewlineOnReceivedSequence { get; }
///
/// New data received from connected device.
///
event EventHandler? ReceivedDataEvent;
///
/// New data sent to the connected device.
///
event EventHandler? SentDataEvent;
///
/// Connect to the device.
///
void Connect();
///
/// 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);
}