SW: Revert list RSI items; fixes #31

This commit is contained in:
Daniel Dugger 2020-08-01 10:22:09 -04:00
parent 9a1955baae
commit 08ee4287d9
1 changed files with 16 additions and 1 deletions

View File

@ -41,7 +41,22 @@ namespace KFDtool.P25.Kmm
public override byte[] ToBytes()
{
throw new NotImplementedException();
List<byte> contents = new List<byte>();
/* inventory type */
contents.Add((byte)InventoryType);
/* number of items */
contents.Add((byte)((RsiItems.Count >> 8) & 0xFF));
contents.Add((byte)(RsiItems.Count & 0xFF));
/* items */
foreach (RsiItem item in RsiItems)
{
contents.AddRange(item.ToBytes());
}
return contents.ToArray();
}
public override void Parse(byte[] contents)