private int CountBytesInCommand(CommandMessenger.Command command, bool printLfCr) { var bytes = command.CommandString().Length; // Command + command separator //var bytes = _cmdMessenger.CommandToString(command).Length + 1; // Command + command separator if (printLfCr) { bytes += Environment.NewLine.Length; // Add bytes for carriage return ('\r') and /or a newline ('\n') } return(bytes); }
// Tools private static int CountBytesInCommand(Command command, bool printLfCr) { var bytes = command.CommandString().Length; // Command + command separator if (printLfCr) bytes += Environment.NewLine.Length; // Add bytes for carriage return ('\r') and /or a newline ('\n') return bytes; }