Hulaaki.Encoder

Provides functions for encoding Message structs to bytes(binary)

Source

Summary

calculate_remaining_length(connect)

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

encode_fixed_header(message)

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

encode_fixed_header_remaining_length(number)

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

encode_payload(connect)

Encodes the payload for a given Message struct

encode_variable_header(connect)

Encodes variable header for a given Message struct

Types

dup :: 0 | 1

qos :: 0 | 1 | 2

retain :: 0 | 1

packet_value :: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14

Functions

calculate_remaining_length(connect)

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

Source
encode_fixed_header(message)

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

Source
encode_fixed_header_remaining_length(number)

Specs:

  • 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

Source
encode_payload(connect)

Encodes the payload for a given Message struct

Source
encode_variable_header(connect)

Encodes variable header for a given Message struct

Source