struct Subscribe

Overview

Fixed header for SUBSCRIBE PACKET

7 3 0

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

| SUBSCRIBE (8) NIBBLE | RESERVED | 0

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

| Remaining Len = Len of Variable header(2) + Payload | 1

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

Variable header ( LENGTH = 2 Bytes)

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

| Packet Identifier MSB | 2

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

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

| Packet Identifier LSB | 3

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

Payload: Set these optionals

2 bytes subscribe topic length + subscribe topic + 1 byte qos

... for all the topics

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(topics : Array(Tuple(String, QoS)), pkid : Pkid) #

[View source]

Instance Method Detail

def pkid : Pkid #

[View source]
def pkid=(pkid : Pkid) #

[View source]
def to_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::SystemEndian) #

[View source]