MqttX.Packet.Properties (MqttX v0.10.0)

Copy Markdown View Source

MQTT 5.0 Properties encoding and decoding.

Supports all 28 MQTT 5.0 property types.

Summary

Functions

Decode properties from binary.

Encode properties map to binary with length prefix.

Functions

decode(arg1, data)

@spec decode(integer(), binary()) :: {:ok, map(), binary()} | {:error, atom()}

Decode properties from binary.

Returns {:ok, properties_map, rest} or {:error, reason}.

encode(arg1, properties)

@spec encode(integer(), map()) :: iodata()

Encode properties map to binary with length prefix.

Only encodes properties for MQTT 5.0. Returns empty varint (0) for other versions.