class MqttCrystal::Packet
- MqttCrystal::Packet
- Reference
- Object
Direct Known Subclasses
- MqttCrystal::Packet::Connack
- MqttCrystal::Packet::Connect
- MqttCrystal::Packet::Disconnect
- MqttCrystal::Packet::Pingreq
- MqttCrystal::Packet::Pingresp
- MqttCrystal::Packet::Puback
- MqttCrystal::Packet::Pubcomp
- MqttCrystal::Packet::Publish
- MqttCrystal::Packet::Pubrec
- MqttCrystal::Packet::Pubrel
- MqttCrystal::Packet::Suback
- MqttCrystal::Packet::Subscribe
- MqttCrystal::Packet::Unsuback
- MqttCrystal::Packet::Unsubscribe
Defined in:
mqtt_crystal/packet.crConstant Summary
-
PACKET_TYPES =
[nil, Packet::Connect, Packet::Connack, Packet::Publish, Packet::Puback, Packet::Pubrec, Packet::Pubrel, Packet::Pubcomp, Packet::Subscribe, Packet::Suback, Packet::Unsubscribe, Packet::Unsuback, Packet::Pingreq, Packet::Pingresp, Packet::Disconnect, nil]
Constructors
Class Method Summary
- .create_from_header(byte : UInt8)
- .parse(bytes : Array(UInt8)) : Packet | Nil
- .slice_it(a : String) : Bytes
- .slice_it(a : Array(UInt8)) : Bytes
Instance Method Summary
- #_extract_string!(buffer : Array(UInt8), index : Int32 = 0) : String
- #body_length : UInt64
- #body_length=(body_length : UInt64)
- #bytes : Bytes
- #check_remaining_length(bytes : Array(UInt8)) : NamedTuple(pos: UInt8, body_length: UInt64)
- #concatenate(*args) : Bytes
- #decode_short(buffer : Array(UInt8), index : Int32) : UInt16
- #encode_body : Bytes
- #encode_header : UInt8
- #encode_short(n : UInt16) : Bytes
- #encode_string(str : String) : Bytes
- #encode_string(strings : Array(String)) : Bytes
- #flags : Array(Bool)
- #flags=(flags : Array(Bool))
- #parse_body(buffer : Array(UInt8))
- #slice_it(a : Array(UInt8)) : Bytes
- #type_id : Int32
- #validate_flags
Constructor Detail
Class Method Detail
Instance Method Detail
def check_remaining_length(bytes : Array(UInt8)) : NamedTuple(pos: UInt8, body_length: UInt64)
#