ex_mqtt v0.2.0 ExMqtt.Encoder View Source

Provides functions for encoding Message structs to bytes(binary)

Link to this section Summary

Functions

Calculates the remaining length (as specified in MQTT spec) for a given Message struct

Encodes the fixed header (as specified in MQTT spec) for a given Message struct

Encodes remaining length using a variable length encoding scheme specified in MQTT 3.1.1 spec section 2.2.3

Encodes the payload for a given Message struct

Encodes variable header for a given Message struct

Link to this section Types

Link to this type packet_value() View Source
packet_value() :: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14
Link to this type qos() View Source
qos() :: 0 | 1 | 2
Link to this type retain() View Source
retain() :: 0 | 1

Link to this section Functions

Link to this function calculate_remaining_length(arg1) View Source

Calculates the remaining length (as specified in MQTT spec) for a given Message struct

Link to this function encode_fixed_header(message) View Source

Encodes the fixed header (as specified in MQTT spec) for a given Message struct

Link to this function encode_fixed_header_remaining_length(number) View Source
encode_fixed_header_remaining_length(number()) :: binary()

Encodes remaining length using a variable length encoding scheme specified in MQTT 3.1.1 spec section 2.2.3

Encodes the payload for a given Message struct

Link to this function encode_variable_header(arg1) View Source

Encodes variable header for a given Message struct