class MqttCrystal::Packet::Subscribe

Defined in:

mqtt_crystal/packet.cr

Constructors

Instance Method Summary

Instance methods inherited from class MqttCrystal::Packet

_extract_string!(buffer : Array(UInt8), index : Int32 = 0) : String _extract_string!, body_length : UInt64 body_length, body_length=(body_length : UInt64) body_length=, bytes : Bytes bytes, check_remaining_length(bytes : Array(UInt8)) : NamedTuple(pos: UInt8, body_length: UInt64) check_remaining_length, concatenate(*args) : Bytes concatenate, decode_short(buffer : Array(UInt8), index : Int32) : UInt16 decode_short, encode_body : Bytes encode_body, encode_header : UInt8 encode_header, encode_short(n : UInt16) : Bytes encode_short, encode_string(str : String) : Bytes
encode_string(strings : Array(String)) : Bytes
encode_string
, flags : Array(Bool) flags, flags=(flags : Array(Bool)) flags=, parse_body(buffer : Array(UInt8)) parse_body, slice_it(a : Array(UInt8)) : Bytes slice_it, type_id : Int32 type_id, validate_flags validate_flags

Constructor methods inherited from class MqttCrystal::Packet

new(flags : Array(Bool) = [false, false, false, false], body_length : UInt64 = 0_u64) new

Class methods inherited from class MqttCrystal::Packet

create_from_header(byte : UInt8) create_from_header, parse(bytes : Array(UInt8)) : Packet | Nil parse, slice_it(a : String) : Bytes
slice_it(a : Array(UInt8)) : Bytes
slice_it

Constructor Detail

def self.new(id : UInt16 = 0_u16, topic : String = "pub/test", qos : UInt8 = 1_u8, flags : Array(Bool) = [false, true, false, false], body_length : UInt64 = 0_u64) #

[View source]

Instance Method Detail

def encode_body : Bytes #

[View source]
def parse_body(buffer : Array(UInt8)) #

[View source]
def qos : UInt8 #

[View source]
def qos=(qos : UInt8) #

[View source]
def topic : String #

[View source]
def topic=(topic : String) #

[View source]
def validate_flags #

[View source]