Class: MQTT::Packet::Puback
- Inherits:
-
MQTT::Packet
- Object
- MQTT::Packet
- MQTT::Packet::Puback
- Defined in:
- lib/mqtt/packet.rb
Overview
Class representing an MQTT Publish Acknowledgment packet
Constant Summary
Constants inherited from MQTT::Packet
Instance Attribute Summary
Attributes inherited from MQTT::Packet
#body_length, #flags, #id, #version
Instance Method Summary collapse
-
#encode_body ⇒ Object
Get serialisation of packet’s body.
-
#inspect ⇒ Object
Returns a human readable string, summarising the properties of the packet.
-
#parse_body(buffer) ⇒ Object
Parse the body (variable header and payload) of a packet.
Methods inherited from MQTT::Packet
create_from_header, #initialize, #message_id, #message_id=, parse, parse_header, read, read_byte, #to_s, #type_id, #type_name, #update_attributes, #validate_flags
Constructor Details
This class inherits a constructor from MQTT::Packet
Instance Method Details
#encode_body ⇒ Object
Get serialisation of packet’s body
632 633 634 |
# File 'lib/mqtt/packet.rb', line 632 def encode_body encode_short(@id) end |
#inspect ⇒ Object
Returns a human readable string, summarising the properties of the packet
646 647 648 |
# File 'lib/mqtt/packet.rb', line 646 def inspect "\#<#{self.class}: 0x%2.2X>" % id end |
#parse_body(buffer) ⇒ Object
Parse the body (variable header and payload) of a packet
637 638 639 640 641 642 643 |
# File 'lib/mqtt/packet.rb', line 637 def parse_body(buffer) super(buffer) @id = shift_short(buffer) return if buffer.empty? raise ProtocolException, 'Extra bytes at end of Publish Acknowledgment packet' end |