class MqttCrystal::Packet::Connack
- MqttCrystal::Packet::Connack
- MqttCrystal::Packet
- Reference
- Object
Defined in:
mqtt_crystal/packet.crConstructors
-
.new(session_present : Bool = false, response : MqttCrystal::Packet::ConnackResponse = ConnackResponse::Accepted, flags : Array(Bool) = [false, false, false, false], body_length : UInt64 = 0_u64)
If this is a clean session, @session_present must be false otherwise up to the implementation to decide if the session exists
Instance Method Summary
- #encode_body : Bytes
- #parse_body(buffer : Array(UInt8))
- #response : MqttCrystal::Packet::ConnackResponse
- #response=(response : MqttCrystal::Packet::ConnackResponse)
- #session_present : Bool
- #session_present=(session_present : Bool)
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) : Bytesencode_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) : Bytesslice_it(a : Array(UInt8)) : Bytes slice_it
Constructor Detail
def self.new(session_present : Bool = false, response : MqttCrystal::Packet::ConnackResponse = ConnackResponse::Accepted, flags : Array(Bool) = [false, false, false, false], body_length : UInt64 = 0_u64)
#
If this is a clean session, @session_present must be false otherwise up to the implementation to decide if the session exists