Class: PahoMqtt::Packet::Puback
- Inherits:
-
PahoMqtt::Packet
- Object
- PahoMqtt::Packet
- PahoMqtt::Packet::Puback
- Defined in:
- lib/paho.mqtt/packet_manager.rb
Overview
Class representing an MQTT Publish Acknowledgment packet
Constant Summary
Constants inherited from PahoMqtt::Packet
Instance Attribute Summary
Attributes inherited from PahoMqtt::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 PahoMqtt::Packet
create_from_header, #initialize, parse, parse_header, read, #to_s, #type_id, #type_name, #update_attributes, #validate_flags
Constructor Details
This class inherits a constructor from PahoMqtt::Packet
Instance Method Details
#encode_body ⇒ Object
Get serialisation of packet’s body
642 643 644 |
# File 'lib/paho.mqtt/packet_manager.rb', line 642 def encode_body encode_short(@id) end |
#inspect ⇒ Object
Returns a human readable string, summarising the properties of the packet
656 657 658 |
# File 'lib/paho.mqtt/packet_manager.rb', line 656 def inspect "\#<#{self.class}: 0x%2.2X>" % id end |
#parse_body(buffer) ⇒ Object
Parse the body (variable header and payload) of a packet
647 648 649 650 651 652 653 |
# File 'lib/paho.mqtt/packet_manager.rb', line 647 def parse_body(buffer) super(buffer) @id = shift_short(buffer) unless buffer.empty? raise "Extra bytes at end of Publish Acknowledgment packet" end end |