class MQTT::SN::Packet::Regack
Constants
- DEFAULTS
Attributes
id[RW]
return_code[RW]
topic_id[RW]
Public Instance Methods
encode_body()
click to toggle source
# File lib/qubitro-mqtt/sn/packet.rb, line 379 def encode_body raise 'id must be an Integer' unless id.is_a?(Integer) raise 'topic_id must be an Integer' unless topic_id.is_a?(Integer) [topic_id, id, return_code].pack('nnC') end
parse_body(buffer)
click to toggle source
# File lib/qubitro-mqtt/sn/packet.rb, line 387 def parse_body(buffer) self.topic_id, self.id, self.return_code = buffer.unpack('nnC') end