class MQTT::SN::Packet::Publish

Constants

DEFAULTS

Attributes

data[RW]
id[RW]
topic_id[RW]

Public Instance Methods

encode_body() click to toggle source
# File lib/mqtt/sn/packet.rb, line 399
def encode_body
  raise 'id must be an Integer' unless id.is_a?(Integer)

  [encode_flags, encode_topic_id, id, data].pack('Cnna*')
end
parse_body(buffer) click to toggle source
# File lib/mqtt/sn/packet.rb, line 405
def parse_body(buffer)
  flags, topic_id, self.id, self.data = buffer.unpack('Cnna*')
  parse_flags(flags)
  parse_topic_id(topic_id)
end