ExMqtt.Protocol.Properties (ex_mqtt_uv v0.1.0)

Copy Markdown View Source

MQTT 5.0 Properties serialization, deserialization, value-range validation, and per-packet allowlist validation.

Summary

Functions

Decodes an MQTT 5.0 Properties section from the front of binary.

Encodes a map of properties for the given context (e.g. :connect, :publish, :will) prefixed by its Variable Byte Integer property length.

Functions

decode(binary, context)

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

Decodes an MQTT 5.0 Properties section from the front of binary.

encode(props, context)

@spec encode(map(), atom()) :: {:ok, iodata()} | {:error, term()}

Encodes a map of properties for the given context (e.g. :connect, :publish, :will) prefixed by its Variable Byte Integer property length.