Class: MQTT::SN::Packet::Willmsgresp
- Inherits:
-
MQTT::SN::Packet
- Object
- MQTT::SN::Packet
- MQTT::SN::Packet::Willmsgresp
- Defined in:
- lib/mqtt/sn/packet.rb
Constant Summary collapse
- DEFAULTS =
{ :return_code => 0x00 }
Instance Attribute Summary collapse
-
#return_code ⇒ Object
Returns the value of attribute return_code.
Attributes inherited from MQTT::SN::Packet
#clean_session, #duplicate, #qos, #request_will, #retain, #topic_id_type
Instance Method Summary collapse
Methods inherited from MQTT::SN::Packet
#initialize, parse, #to_s, #type_id, #update_attributes
Constructor Details
This class inherits a constructor from MQTT::SN::Packet
Instance Attribute Details
#return_code ⇒ Object
Returns the value of attribute return_code.
710 711 712 |
# File 'lib/mqtt/sn/packet.rb', line 710 def return_code @return_code end |
Instance Method Details
#encode_body ⇒ Object
716 717 718 719 720 721 722 |
# File 'lib/mqtt/sn/packet.rb', line 716 def encode_body unless return_code.is_a?(Integer) raise "return_code must be an Integer" end [return_code].pack('C') end |
#parse_body(buffer) ⇒ Object
724 725 726 |
# File 'lib/mqtt/sn/packet.rb', line 724 def parse_body(buffer) self.return_code, _ignore = buffer.unpack('C') end |