Class: SDN::Message::SetNetworkLock
- Inherits:
-
Message
- Object
- Message
- SDN::Message::SetNetworkLock
- Defined in:
- lib/sdn/message/set.rb
Overview
Command that applies or clears the network lock state.
Constant Summary collapse
- MSG =
Protocol message number
0x16
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#params ⇒ <Integer>
Returns the protocol-specific payload bytes for this message.
-
#parse(params) ⇒ void
Parses protocol-specific parameter bytes into this message instance.
Instance Attribute Details
#locked ⇒ true, ...
376 377 378 |
# File 'lib/sdn/message/set.rb', line 376 def locked @locked end |
#priority ⇒ Integer?
381 382 383 |
# File 'lib/sdn/message/set.rb', line 381 def priority @priority end |
Instance Method Details
#params ⇒ <Integer>
Returns the protocol-specific payload bytes for this message.
390 391 392 |
# File 'lib/sdn/message/set.rb', line 390 def params transform_param(locked ? 1 : 0) + transform_param(priority) end |
#parse(params) ⇒ void
This method returns an undefined value.
Parses protocol-specific parameter bytes into this message instance.
384 385 386 387 |
# File 'lib/sdn/message/set.rb', line 384 def parse(params) self.locked = to_number(params[0]) == 1 self.priority = to_number(params[1]) end |