module
TLV::Helpers
Defined in:
tlv/helpers.crClass Method Summary
-
.get_array(hash : Hash(Tag, Value), tag : Int32) : Array(Value) | Nil
Get array field by tag
-
.get_bool(hash : Hash(Tag, Value), tag : Int32, default : Bool = false) : Bool
Get boolean field by tag
-
.get_by_tag(hash : Hash(Tag, Value), tag : Int32) : Value | Nil
Safely get a value from a TLV hash by tag, trying multiple tag type variations
-
.get_bytes(hash : Hash(Tag, Value), tag : Int32) : Bytes | Nil
Get bytes field by tag
-
.get_hash(hash : Hash(Tag, Value), tag : Int32) : Hash(Tag, Value) | Nil
Get hash/structure field by tag
-
.get_int(hash : Hash(Tag, Value), tag : Int32) : Int32 | Nil
Get integer field by tag, handling different integer types
-
.get_uint16(hash : Hash(Tag, Value), tag : Int32) : UInt16 | Nil
Get UInt16 field by tag
-
.get_uint32(hash : Hash(Tag, Value), tag : Int32) : UInt32 | Nil
Get UInt32 field by tag
-
.parse_attribute_path(value : Value) : Tuple(UInt16 | Nil, UInt32 | Nil, UInt32 | Nil)
Parse attribute path from either list-form or structure-form List-form: [endpoint, cluster, attribute] Structure-form: {2 => endpoint, 3 => cluster, 4 => attribute}
-
.unwrap_anonymous(hash : Hash(Tag, Value)) : Hash(Tag, Value)
Extract from "Any" anonymous structure
Class Method Detail
Get array field by tag
Get boolean field by tag
Safely get a value from a TLV hash by tag, trying multiple tag type variations
Get bytes field by tag
Get hash/structure field by tag
Get integer field by tag, handling different integer types
Get UInt16 field by tag
Get UInt32 field by tag
Parse attribute path from either list-form or structure-form List-form: [endpoint, cluster, attribute] Structure-form: {2 => endpoint, 3 => cluster, 4 => attribute}