class MQTT::SN::Packet::Disconnect
Constants
- DEFAULTS
Attributes
duration[RW]
Public Instance Methods
encode_body()
click to toggle source
# File lib/mqttbridge/sn/packet.rb, line 632 def encode_body if duration.nil? or duration == 0 '' else [duration].pack('n') end end
parse_body(buffer)
click to toggle source
# File lib/mqttbridge/sn/packet.rb, line 640 def parse_body(buffer) if buffer.length == 2 self.duration = buffer.unpack('n').first else self.duration = nil end end