Default attribute values
Create a new Pubrel packet
# File lib/mqtt/packet.rb, line 710 def initialize(args={}) super(ATTR_DEFAULTS.merge(args)) end
Get serialisation of packet's body
# File lib/mqtt/packet.rb, line 715 def encode_body encode_short(@id) end
Returns a human readable string, summarising the properties of the packet
# File lib/mqtt/packet.rb, line 737 def inspect "\#<#{self.class}: 0x%2.2X>" % id end
Parse the body (variable header and payload) of a packet
# File lib/mqtt/packet.rb, line 720 def parse_body(buffer) super(buffer) @id = shift_short(buffer) unless buffer.empty? raise ProtocolException.new("Extra bytes at end of Publish Release packet") end end
Check that fixed header flags are valid for this packet type @private
# File lib/mqtt/packet.rb, line 730 def validate_flags if @flags != [false, true, false, false] raise ProtocolException.new("Invalid flags in PUBREL packet header") end end