TLV::Header
Inherits BinData < Reference < Object
Constants
AFTER_DESERIALIZE = [] of Nil
BEFORE_SERIALIZE = [] of Nil
ENDIAN = ["little"]
KLASS_NAME = [TLV::Header]
PARTS = [{type: "bitfield", name: 0, cls: TLV::Header,
onlyif: nil, verify: nil, endian: IO::ByteFormat::LittleEndian}, {type: "group", name: context, cls: Context, onlyif: -> do
tag_format == TagType::Context.value
end,
verify: nil, value: nil}, {type: "group", name: common, cls: Common, onlyif: -> do
tag_format == TagType::CommonProfile.value
end,
verify: nil, value: nil}, {type: "group", name: vendor, cls: Vendor, onlyif: -> do
tag_format >= TagType::VendorProfile.value
end,
verify: nil, value: nil}] of Nil
REMAINING = [] of Nil
Constructors
Class methods
bit_fields
SourceInstance methods
__format__
A group or bit_field captures the endianness at its declaration point, so
declaring endian after one would silently leave it system-endian. Fail loudly.
anonymous?
Sourcecommon
Common Profile - 2 bytes profile + 2 bytes tag
common=(common : TLV::Header::Common)
Common Profile - 2 bytes profile + 2 bytes tag
container?
Sourcecontext
context=(context : TLV::Header::Context)
element_type
Sourceelement_type=(type : ElementType)
Sourceelement_type_raw
control byte
element_type_raw=(element_type_raw : UInt8)
control byte
end_of_container?
Sourceids
Returns the tag identifier(s) based on tag type
- Anonymous: nil
- Context: UInt8 tag id
- Common Profile: {profile_id, tag_id}
- Vendor Profile: {vendor_id, profile_id, tag_id}
tag_format
control byte
tag_format=(tag_format : UInt8)
control byte
tag_type
Sourcetag_type=(type : TagType)
Sourcevendor
Vendor Profile - 2 bytes vendor + 2 bytes profile + 2 bytes tag
vendor=(vendor : TLV::Header::Vendor)
Vendor Profile - 2 bytes vendor + 2 bytes profile + 2 bytes tag