Class: Protocol::MQTT::Packet::Pingreq

Inherits:
Protocol::MQTT::Packet show all
Defined in:
lib/protocol/mqtt/packet/pingreq.rb

Overview

PINGREQ (§3.12) — keepalive from client. No body.

Constant Summary collapse

TYPE_ID =
PINGREQ

Constants inherited from Protocol::MQTT::Packet

AUTH, CONNACK, CONNECT, DISCONNECT, PINGREQ, PINGRESP, PUBACK, PUBCOMP, PUBLISH, PUBREC, PUBREL, SUBACK, SUBSCRIBE, UNSUBACK, UNSUBSCRIBE

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Protocol::MQTT::Packet

decode, decode_from_body, #encode, encode_packet, #flags_nibble, register

Class Method Details

.decode_body(_reader, flags:, version:) ⇒ Object



18
19
20
# File 'lib/protocol/mqtt/packet/pingreq.rb', line 18

def self.decode_body(_reader, flags:, version:)
  new
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



23
24
25
# File 'lib/protocol/mqtt/packet/pingreq.rb', line 23

def ==(other)
  other.is_a?(Pingreq)
end

#encode_body(_version) ⇒ Object



13
14
15
# File 'lib/protocol/mqtt/packet/pingreq.rb', line 13

def encode_body(_version)
  "".b.freeze
end

#hashObject



29
30
31
# File 'lib/protocol/mqtt/packet/pingreq.rb', line 29

def hash
  self.class.hash
end