AirPlay.V2.Plist (AirPlay v0.1.0)

Copy Markdown View Source

Minimal Apple binary property list (bplist00) codec for AirPlay 2 — enough for the /info response and the /setup request body.

Supports the types AP2 uses: dict, array, ASCII/UTF-16 string, integer, real, boolean, and data (binary). Maps encode as dicts; use {:data, bin} to force a data node and {:real, float} for a real. Decoding returns maps/lists/binaries/ integers/floats/booleans.

Summary

Functions

Decode a bplist00 binary into Elixir terms, or {:error, reason}.

Encode an Elixir term to a bplist00 binary.

Functions

decode(bin)

@spec decode(binary()) :: {:ok, term()} | {:error, term()}

Decode a bplist00 binary into Elixir terms, or {:error, reason}.

encode(term)

@spec encode(term()) :: binary()

Encode an Elixir term to a bplist00 binary.