// test with: returns: "Hello world" for "48656C6C6F20776F726C64"
// see https://www.fileformat.info/info/charset/UTF-16/list.htm
privatestaticstringFromHexString(stringhexString)
// TODO Implement Unit Tests!
/// <summary>
/// Converts the <see cref="MultiFormatString"/> to a string that only contains ASCII characters.
/// Therefore this method converts all parts of other formats (e.g. <see cref="FormatType.Hexadecimal"/> or <see cref="FormatType.Binary"/>) to ASCII characters.
/// </summary>
/// <returns>converted string</returns>
publicstringToAsciiEncodedString()
{
// Added PadLeft so strings with one character do not get ignored
/// Converts an input string to a bytes array with the given base (<paramref name="fromBase"/>) and bundle size (<paramref name="byteWidth"/>).
/// Input string gets padded with zeroes left.
/// Idea from: https://stackoverflow.com/questions/724862/converting-from-hex-to-string
/// </summary>
/// <param name="str">input string, without separators between individual bytes! </param>
/// <param name="fromBase">number base of the input string (e.g. 2 for binary)</param>
/// <param name="byteWidth">amount of characters required for a complete byte in the <paramref name="fromBase"/> format (e.g. 8 for a binary byte)</param>
/// <returns>byte array of the given input string</returns>
/// Returns ASCII encoded string from a hex string of <see cref="charsPerHexBundle"/> amount of hexadecimal characters.
/// </summary>
/// <param name="hexString">hex string with maximum amount of hex characters according to <see cref="charsPerHexBundle"/>. hex characters must be without any separator (no : or - inbetween bytes)!</param>
/// <returns>ASCII Encoded string of the <paramref name="hexString"/></returns>
/// Returns ASCII encoded string from a binary string of <see cref="charsPerBinBundle"/> amount of binary characters.
/// </summary>
/// <param name="binaryString">hex string with maximum amount of binaryString characters according to <see cref="charsPerBinBundle"/>. binary characters must be without any separator (no space or - inbetween bytes)!</param>
/// <returns>ASCII Encoded string of the <paramref name="binaryString"/></returns>
if(this.CommunicationProtocol==null){thrownewNullReferenceException($"'{nameof(SendToCommunicationProtocol)}()' was called but {nameof(CommunicationProtocol)} is null.");}
@ -168,22 +168,21 @@ public abstract partial class TerminalViewModel : ObservableObject, ITerminalVie