Beispiel #1
0
            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;
            }
Beispiel #2
0
 public void AddTLV(CdpTypes type, String value)
 {
     TLVs.Add(new TLV(type, value));
 }