class

MQTT::V5::Ack

Inherits MQTT::V5::ReasonCoded / MQTT::Header / BinData / Reference / Object

PUBACK, PUBREC, PUBREL and PUBCOMP.

NOTE:: MQTT-3.4.2.1, the reason code and the property section are both omitted when the reason is success and there are no properties. Nothing in the packet says so — the remaining length is what tells you, which is exactly what onlyif needs

Constants

AFTER_DESERIALIZE = [] of Nil

PUBACK, PUBREC, PUBREL and PUBCOMP.

NOTE:: MQTT-3.4.2.1, the reason code and the property section are both omitted when the reason is success and there are no properties. Nothing in the packet says so — the remaining length is what tells you, which is exactly what onlyif needs

ALLOWED_PROPERTIES = [PropertyId::ReasonString, PropertyId::UserProperty]
BEFORE_SERIALIZE = [] of Nil

PUBACK, PUBREC, PUBREL and PUBCOMP.

NOTE:: MQTT-3.4.2.1, the reason code and the property section are both omitted when the reason is success and there are no properties. Nothing in the packet says so — the remaining length is what tells you, which is exactly what onlyif needs

ENDIAN = ["big"]

PUBACK, PUBREC, PUBREL and PUBCOMP.

NOTE:: MQTT-3.4.2.1, the reason code and the property section are both omitted when the reason is success and there are no properties. Nothing in the packet says so — the remaining length is what tells you, which is exactly what onlyif needs

KLASS_NAME = [MQTT::V5::Ack]

PUBACK, PUBREC, PUBREL and PUBCOMP.

NOTE:: MQTT-3.4.2.1, the reason code and the property section are both omitted when the reason is success and there are no properties. Nothing in the packet says so — the remaining length is what tells you, which is exactly what onlyif needs

PARTS = [{type: "basic", name: message_id, cls: UInt16, onlyif: nil, verify: nil, value: nil, endian: nil}, {type: "basic", name: raw_reason_code, cls: UInt8, onlyif: -> do packet_length > 2 end, verify: nil, value: nil, endian: nil}, {type: "basic", name: properties, cls: MQTT::V5::Properties, onlyif: -> do packet_length > 3 end, verify: nil, value: nil}] of Nil

PUBACK, PUBREC, PUBREL and PUBCOMP.

NOTE:: MQTT-3.4.2.1, the reason code and the property section are both omitted when the reason is success and there are no properties. Nothing in the packet says so — the remaining length is what tells you, which is exactly what onlyif needs

REMAINING = [] of Nil

PUBACK, PUBREC, PUBREL and PUBCOMP.

NOTE:: MQTT-3.4.2.1, the reason code and the property section are both omitted when the reason is success and there are no properties. Nothing in the packet says so — the remaining length is what tells you, which is exactly what onlyif needs

Class methods

bit_fields

PUBACK, PUBREC, PUBREL and PUBCOMP.

NOTE:: MQTT-3.4.2.1, the reason code and the property section are both omitted when the reason is success and there are no properties. Nothing in the packet says so — the remaining length is what tells you, which is exactly what onlyif needs

Source

Instance methods

__format__

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.

Source
add_user_property(key : String, value : String) : Nil
Source
calculate_length
Source
message_id
message_id=(message_id : UInt16)
properties
properties=(properties : Properties)
raw_reason_code
raw_reason_code=(raw_reason_code : UInt8)
reason_string
Source
reason_string=(value : String | Nil)
Source
user_properties
Source
validate!
Source