Class: EventMachine::MQTTSN::Packet::Subscribe
- Inherits:
-
EventMachine::MQTTSN::Packet
- Object
- EventMachine::MQTTSN::Packet
- EventMachine::MQTTSN::Packet::Subscribe
- Defined in:
- lib/em/mqtt-sn/packet.rb
Constant Summary collapse
- DEFAULTS =
{ :id => 0x00, :topic_id_type => :normal }
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#topic_id ⇒ Object
Returns the value of attribute topic_id.
-
#topic_name ⇒ Object
Returns the value of attribute topic_name.
Attributes inherited from EventMachine::MQTTSN::Packet
#clean_session, #duplicate, #qos, #request_will, #retain, #topic_id_type
Instance Method Summary collapse
Methods inherited from EventMachine::MQTTSN::Packet
#initialize, parse, #to_s, #type_id, #update_attributes
Constructor Details
This class inherits a constructor from EventMachine::MQTTSN::Packet
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
261 262 263 |
# File 'lib/em/mqtt-sn/packet.rb', line 261 def id @id end |
#topic_id ⇒ Object
Returns the value of attribute topic_id.
262 263 264 |
# File 'lib/em/mqtt-sn/packet.rb', line 262 def topic_id @topic_id end |
#topic_name ⇒ Object
Returns the value of attribute topic_name.
263 264 265 |
# File 'lib/em/mqtt-sn/packet.rb', line 263 def topic_name @topic_name end |
Instance Method Details
#encode_body ⇒ Object
270 271 272 |
# File 'lib/em/mqtt-sn/packet.rb', line 270 def encode_body [encode_flags, id, topic_name].pack('Cna*') end |
#parse_body(buffer) ⇒ Object
274 275 276 277 |
# File 'lib/em/mqtt-sn/packet.rb', line 274 def parse_body(buffer) flags, self.id, self.topic_name = buffer.unpack('Cna*') parse_flags(flags) end |