Class: MQTT::SN::Packet::Willmsgresp
- Defined in:
- lib/mqtt/sn/packet.rb
Constant Summary collapse
- DEFAULTS =
{ return_code: 0x00 }.freeze
Constants inherited from Packet
Instance Attribute Summary collapse
-
#return_code ⇒ Object
Returns the value of attribute return_code.
Attributes inherited from Packet
#body_length, #flags, #id, #version
Instance Method Summary collapse
Methods inherited from Packet
create_from_header, #dup, #initialize, #inspect, #message_id, #message_id=, parse, parse_header, read, read_byte, #to_s, #type_id, #type_name, #update_attributes, #validate_flags
Constructor Details
This class inherits a constructor from MQTT::Packet
Instance Attribute Details
#return_code ⇒ Object
Returns the value of attribute return_code.
665 666 667 |
# File 'lib/mqtt/sn/packet.rb', line 665 def return_code @return_code end |
Instance Method Details
#encode_body ⇒ Object
671 672 673 674 675 |
# File 'lib/mqtt/sn/packet.rb', line 671 def encode_body raise "return_code must be an Integer" unless return_code.is_a?(Integer) [return_code].pack("C") end |
#parse_body(buffer) ⇒ Object
677 678 679 |
# File 'lib/mqtt/sn/packet.rb', line 677 def parse_body(buffer) self.return_code, _ignore = buffer.unpack("C") end |