Class: SDN::Message::GetMotorIP
- Inherits:
-
Message
- Object
- Message
- SDN::Message::GetMotorIP
- Defined in:
- lib/sdn/message/get.rb
Overview
Request for a motor's stored intermediate position at a given slot.
Constant Summary collapse
- MSG =
Protocol message number
0x25- PARAMS_LENGTH =
Number of protocol parameter bytes expected
1
Instance Attribute Summary collapse
-
#ip ⇒ Integer
Intermediate position slot being queried.
Instance Method Summary collapse
-
#initialize(dest = nil, ip = 1, **kwargs) ⇒ GetMotorIP
constructor
Creates a request for a specific intermediate position slot.
-
#params ⇒ <Integer>
Returns the protocol-specific payload bytes for this message.
-
#parse(params) ⇒ void
Parses protocol-specific parameter bytes into this message instance.
Constructor Details
#initialize(dest = nil, ip = 1, **kwargs) ⇒ GetMotorIP
Creates a request for a specific intermediate position slot.
73 74 75 76 77 |
# File 'lib/sdn/message/get.rb', line 73 def initialize(dest = nil, ip = 1, **kwargs) kwargs[:dest] ||= dest super(**kwargs) self.ip = ip end |
Instance Attribute Details
#ip ⇒ Integer
Intermediate position slot being queried.
66 67 68 |
# File 'lib/sdn/message/get.rb', line 66 def ip @ip end |
Instance Method Details
#params ⇒ <Integer>
Returns the protocol-specific payload bytes for this message.
92 93 94 |
# File 'lib/sdn/message/get.rb', line 92 def params transform_param(ip) end |
#parse(params) ⇒ void
This method returns an undefined value.
Parses protocol-specific parameter bytes into this message instance.
80 81 82 83 |
# File 'lib/sdn/message/get.rb', line 80 def parse(params) super self.ip = to_number(params[0]) end |