public static IReadOnlyList <ICommand> ParseToCommands(ProtocolVersion version, IEnumerable <byte[]> payloads) { var result = new List <ICommand>(); foreach (byte[] payload in payloads) { foreach (ParsedCommandSpec rawCmd in ReceivedPacket.ParseCommands(payload)) { result.AddIfNotNull(CommandParser.Parse(version, rawCmd)); } } return(result); }
private static List <List <ParsedCommandSpec> > ParseCommands(string filename) { var res = new List <List <ParsedCommandSpec> >(); using (var reader = new StreamReader(filename)) { string line; while ((line = reader.ReadLine()) != null) { var commands = ReceivedPacket.ParseCommands(line.HexToByteArray()); res.Add(commands.ToList()); } } return(res); }