Hulaaki v0.0.4 Hulaaki.Encoder

Provides functions for encoding Message structs to bytes(binary)

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

Types

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

Functions

calculate_remaining_length(arg1)

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)

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

encode_payload(arg1)

Encodes the payload for a given Message struct

encode_variable_header(arg1)

Encodes variable header for a given Message struct