class
MQTT::V5::Connect
- MQTT::V5::Connect
- MQTT::Header
- BinData
- Reference
- Object
Overview
MQTT-3.1. Same shape as 3.1.1 with a property section after the keep alive, and a second property section in front of the will topic
Defined in:
mqtt/v5/connect.crConstant Summary
-
AFTER_DESERIALIZE =
[] of Nil -
MQTT-3.1. Same shape as 3.1.1 with a property section after the keep alive, and a second property section in front of the will topic
-
ALLOWED_PROPERTIES =
[PropertyId::SessionExpiryInterval, PropertyId::ReceiveMaximum, PropertyId::MaximumPacketSize, PropertyId::TopicAliasMaximum, PropertyId::RequestResponseInformation, PropertyId::RequestProblemInformation, PropertyId::UserProperty, PropertyId::AuthenticationMethod, PropertyId::AuthenticationData] -
ALLOWED_WILL_PROPERTIES =
[PropertyId::WillDelayInterval, PropertyId::PayloadFormatIndicator, PropertyId::MessageExpiryInterval, PropertyId::ContentType, PropertyId::ResponseTopic, PropertyId::CorrelationData, PropertyId::UserProperty] -
BEFORE_SERIALIZE =
[] of Nil -
MQTT-3.1. Same shape as 3.1.1 with a property section after the keep alive, and a second property section in front of the will topic
-
ENDIAN =
["big"] -
MQTT-3.1. Same shape as 3.1.1 with a property section after the keep alive, and a second property section in front of the will topic
-
KLASS_NAME =
[MQTT::V5::Connect] -
MQTT-3.1. Same shape as 3.1.1 with a property section after the keep alive, and a second property section in front of the will topic
-
PARTS =
[{type: "basic", name: name_size, cls: UInt16, onlyif: nil, verify: nil, value: -> do name.bytesize end, endian: nil}, {type: "string", name: name, cls: String, onlyif: nil, verify: nil, length: -> do name_size end, value: nil, encoding: nil}, {type: "enum", name: version, cls: typeof(Version::V5.value), onlyif: nil, verify: nil, value: nil, encoding: nil, enum_type: MQTT::Version}, {type: "bitfield", name: 3, cls: MQTT::V5::Connect, onlyif: nil, verify: nil, endian: IO::ByteFormat::BigEndian}, {type: "basic", name: keep_alive_seconds, cls: UInt16, onlyif: nil, verify: nil, value: nil, endian: nil}, {type: "basic", name: properties, cls: MQTT::V5::Properties, onlyif: nil, verify: nil, value: nil}, {type: "basic", name: client_id_size, cls: UInt16, onlyif: nil, verify: nil, value: -> do client_id.bytesize end, endian: nil}, {type: "string", name: client_id, cls: String, onlyif: nil, verify: nil, length: -> do client_id_size end, value: nil, encoding: nil}, {type: "basic", name: will_properties, cls: MQTT::V5::Properties, onlyif: -> do will_flag end, verify: nil, value: nil}, {type: "basic", name: will_topic_size, cls: UInt16, onlyif: -> do will_flag end, verify: nil, value: -> do will_topic.bytesize end, endian: nil}, {type: "string", name: will_topic, cls: String, onlyif: -> do will_flag end, verify: nil, length: -> do will_topic_size end, value: nil, encoding: nil}, {type: "basic", name: will_payload_size, cls: UInt16, onlyif: -> do will_flag end, verify: nil, value: -> do will_payload.size end, endian: nil}, {type: "bytes", name: will_payload, cls: Slice(UInt8), onlyif: -> do will_flag end, verify: nil, length: -> do will_payload_size end, value: nil}, {type: "basic", name: username_size, cls: UInt16, onlyif: -> do has_username end, verify: nil, value: -> do username.bytesize end, endian: nil}, {type: "string", name: username, cls: String, onlyif: -> do has_username end, verify: nil, length: -> do username_size end, value: nil, encoding: nil}, {type: "basic", name: password_size, cls: UInt16, onlyif: -> do has_password end, verify: nil, value: -> do password.bytesize end, endian: nil}, {type: "string", name: password, cls: String, onlyif: -> do has_password end, verify: nil, length: -> do password_size end, value: nil, encoding: nil}] of Nil -
MQTT-3.1. Same shape as 3.1.1 with a property section after the keep alive, and a second property section in front of the will topic
-
REMAINING =
[] of Nil -
MQTT-3.1. Same shape as 3.1.1 with a property section after the keep alive, and a second property section in front of the will topic
Class Method Summary
-
.bit_fields
MQTT-3.1.
Instance Method Summary
-
#__format__ : IO::ByteFormat
A
grouporbit_fieldcaptures the endianness at its declaration point, so declaringendianafter one would silently leave it system-endian. - #_reserved_ : UInt8
- #_reserved_=(_reserved_ : UInt8)
- #add_user_property(key : String, value : String) : Nil
- #authentication_data : Bytes | Nil
- #authentication_data=(value : Bytes | Nil)
- #authentication_method : String | Nil
- #authentication_method=(value : String | Nil)
-
#calculate_length : UInt32
Packet length, excluding the fixed header
- #clean_start : Bool
- #clean_start=(clean_start : UInt8)
- #clean_start=(value : Bool)
- #client_id : String
- #client_id=(client_id : String)
- #client_id_size : UInt16
- #client_id_size=(client_id_size : UInt16)
- #has_password : Bool
- #has_password=(has_password : UInt8)
- #has_password=(value : Bool)
- #has_username : Bool
- #has_username=(has_username : UInt8)
- #has_username=(value : Bool)
- #keep_alive_seconds : UInt16
- #keep_alive_seconds=(keep_alive_seconds : UInt16)
- #maximum_packet_size : UInt32 | Nil
- #maximum_packet_size=(value : UInt32 | Nil)
- #name : String
- #name=(name : String)
- #name_size : UInt16
- #name_size=(name_size : UInt16)
- #password : String
- #password=(str : String)
- #password_size : UInt16
- #password_size=(password_size : UInt16)
- #properties : Properties
- #properties=(properties : Properties)
-
#receive_maximum : UInt16 | Nil
How many QoS > 0 messages we are willing to have in flight at once
- #receive_maximum=(value : UInt16 | Nil)
-
#session_expiry_interval : UInt32 | Nil
How long the broker keeps the session after we disconnect.
- #session_expiry_interval=(value : UInt32 | Nil)
- #topic_alias_maximum : UInt16 | Nil
- #topic_alias_maximum=(value : UInt16 | Nil)
- #user_properties : Array(Tuple(String, String))
- #username : String
- #username=(str : String)
- #username_size : UInt16
- #username_size=(username_size : UInt16)
- #validate! : self
- #version : Version
- #version=(version : Version)
-
#will_delay_interval : UInt32 | Nil
How long the broker waits before publishing the will
- #will_delay_interval=(value : UInt32 | Nil)
- #will_flag : Bool
- #will_flag=(will_flag : UInt8)
- #will_flag=(value : Bool)
- #will_payload : Bytes
- #will_payload=(will_payload : Bytes)
- #will_payload=(payload : String)
-
#will_payload_size : UInt16
MQTT-3.1.3.3, the will payload is binary data rather than a string
-
#will_payload_size=(will_payload_size : UInt16)
MQTT-3.1.3.3, the will payload is binary data rather than a string
-
#will_properties : Properties
the will has its own property section, and it precedes the will topic
-
#will_properties=(will_properties : Properties)
the will has its own property section, and it precedes the will topic
- #will_qos : MQTT::QoS
- #will_qos=(will_qos : UInt8)
- #will_qos=(value : MQTT::QoS)
- #will_retain : Bool
- #will_retain=(will_retain : UInt8)
- #will_retain=(value : Bool)
- #will_topic : String
- #will_topic=(str : String)
- #will_topic_size : UInt16
- #will_topic_size=(will_topic_size : UInt16)
Instance methods inherited from class MQTT::Header
__format__ : IO::ByteFormat
__format__,
duplicate : Bool
duplicate,
duplicate=(duplicate : UInt8)duplicate=(value : Bool) duplicate=, fixed_header_size : Int32 fixed_header_size, id : MQTT::RequestType id, id=(id : UInt8)
id=(value : MQTT::RequestType) id=, packet_length : UInt32 packet_length, packet_length=(size : UInt32) : UInt32 packet_length=, qos : MQTT::QoS qos, qos=(qos : UInt8)
qos=(value : MQTT::QoS) qos=, qos? qos?, retain : Bool retain, retain=(retain : UInt8)
retain=(value : Bool) retain=, variable_length1 : UInt8 variable_length1, variable_length1=(value : UInt8) : UInt8 variable_length1=, variable_length2 : UInt8 variable_length2, variable_length2=(value : UInt8) : UInt8 variable_length2=, variable_length3 : UInt8 variable_length3, variable_length3=(value : UInt8) : UInt8 variable_length3=, variable_length4 : UInt8 variable_length4, variable_length4=(value : UInt8) : UInt8 variable_length4=
Class methods inherited from class MQTT::Header
bit_fields
bit_fields
Class Method Detail
MQTT-3.1. Same shape as 3.1.1 with a property section after the keep alive, and a second property section in front of the will topic
Instance Method Detail
A group or bit_field captures the endianness at its declaration point, so
declaring endian after one would silently leave it system-endian. Fail loudly.
How many QoS > 0 messages we are willing to have in flight at once
How long the broker keeps the session after we disconnect. 5.0 uses this instead of 3.1.1's clean session flag alone
MQTT-3.1.3.3, the will payload is binary data rather than a string
the will has its own property section, and it precedes the will topic
the will has its own property section, and it precedes the will topic