class MQTT::SN::Packet::Suback

Constants

DEFAULTS

Attributes

id[RW]
return_code[RW]
topic_id[RW]

Public Instance Methods

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

  [encode_flags, encode_topic_id, id, return_code].pack('CnnC')
end
parse_body(buffer) click to toggle source
# File lib/mqttbridge/sn/packet.rb, line 565
def parse_body(buffer)
  flags, topic_id, self.id, self.return_code = buffer.unpack('CnnC')
  parse_flags(flags)
  parse_topic_id(topic_id)
end