Amadis
AmadisTLV
Documentation
Please see the main ASL documentation
Description
A helper library allowing creation and modification of mutable TLV trees, as well as conversion from and to byte arrays
Goal and usage
How to?
Create a TLV Tree
// New, empty
TlvTree tree = TlvTree.Empty();
// From a tlv byte array
TlvTree tree = TlvTree.FromRaw(tlvByteArray);
Serialize to a byte array
byte[] rawTlv = tree.AsBytes();
Add a binary element
tree.AddBin(tag, new byte[] { 0x10, 0x00 });
Add an ASCII element
This is a helper over AddBin
- there are no differences on the underlying TLV content
Add a child Data Object (TLV Container)
TlvTree childTree = tree.AddChild(tag);