AirPlay 2 TLV8 encoder/decoder.
Values longer than 255 bytes are split into repeated type entries. Decoding rejoins repeated chunks for the same type, matching HomeKit/AirPlay TLV8 use.
Summary
Functions
Decode TLV8 into a map keyed by known atoms or raw integer types.
Decode TLV8 into an explicit {:ok, map} / {:error, reason} tuple.
Encode a TLV map or key/value list.
Return the numeric TLV type id for an atom or integer type.
Return the canonical atom name for a known type id, else the raw id.
Types
@type pair() :: {type(), binary() | iodata() | non_neg_integer()}
@type type() :: atom() | 0..255
Functions
Decode TLV8 into a map keyed by known atoms or raw integer types.
Decode TLV8 into an explicit {:ok, map} / {:error, reason} tuple.
Encode a TLV map or key/value list.
@spec type_id(type()) :: 0..255
Return the numeric TLV type id for an atom or integer type.
@spec type_name(0..255) :: atom() | 0..255
Return the canonical atom name for a known type id, else the raw id.