class MQTT::SN::Packet::Pubrec

Constants

DEFAULTS

Attributes

id[RW]

Public Instance Methods

encode_body() click to toggle source
# File lib/mqttbridge/sn/packet.rb, line 487
def encode_body
  unless id.is_a?(Integer)
    raise "id must be an Integer"
  end

  [id].pack('n')
end
parse_body(buffer) click to toggle source
# File lib/mqttbridge/sn/packet.rb, line 495
def parse_body(buffer)
  self.id, _ignore = buffer.unpack('n')
end