struct Connack

Overview

Fixed header for CONNACK PACKET

7 3 0

+--------------------------+--------------------------+

| CONNACK (2) NIBBLE | RESERVED | 0

+--------------------------+--------------------------+

| Remaining Len = Len of Varable header(2) | 1

+-----------------------------------------------------+

Variable header ( LENGTH = 2 Bytes)

+--------------------------+--------------------------+

| Reserved bits 1-7 must be set to 0 (0b0000 0000x) | 2

| Bit 0 is 'session present' flag |

+-----------------------------------------------------+

+--------------------------+--------------------------+

| Connect Return Code | 3

+-----------------------------------------------------

Defined in:

crymq/mqtt.cr

Constructors

Instance Method Summary

Instance methods inherited from struct Control

write_mqtt_string(io : IO, s : String) write_mqtt_string, write_remaining_length(io : IO, remaining_len) write_remaining_length

Constructor methods inherited from struct Control

new new

Constructor Detail

def self.new(session_present : Bool, return_code : UInt8) #

[View source]

Instance Method Detail

def to_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::SystemEndian) #

[View source]