public TLV(CdpTypes type, String value) { TYPE = type; VALUE = value; char[] chars = value.ToCharArray(); foreach (char item in chars) { string hexOutput = Convert.ToInt32(item).ToString("X"); ValueBytes.Add(ushort.Parse(hexOutput, System.Globalization.NumberStyles.HexNumber)); } // TypeBytes.Add(0x00); TypeBytes.Add((ushort)type); LENGTH = chars.Count(); TotalLength = LENGTH + 2 + 2; }
public void AddTLV(CdpTypes type, String value) { TLVs.Add(new TLV(type, value)); }