Class: SDN::Message::ILT2::GetMotorIP
- Inherits:
-
SDN::Message
- Object
- SDN::Message
- SDN::Message::ILT2::GetMotorIP
- Defined in:
- lib/sdn/message/ilt2/get.rb
Overview
Request for an ILT2 intermediate position at a given slot.
Constant Summary collapse
- MSG =
Protocol message number
0x43- PARAMS_LENGTH =
Number of protocol parameter bytes expected
1
Instance Attribute Summary collapse
-
#ip ⇒ Integer
Intermediate position slot being queried in the range 1..16.
Attributes inherited from SDN::Message
#ack_requested, #dest, #node_type, #src
Instance Method Summary collapse
-
#initialize(dest = nil, ip = 1, **kwargs) ⇒ GetMotorIP
constructor
Creates an ILT2 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.
Methods inherited from SDN::Message
#==, expected_response?, #inspect, parse, #serialize
Methods included from Helpers
#checksum, #from_number, #from_string, #group_address?, #node_type_from_number, #node_type_to_number, #node_type_to_string, #parse_address, #print_address, #to_number, #to_string, #transform_param
Constructor Details
#initialize(dest = nil, ip = 1, **kwargs) ⇒ GetMotorIP
Creates an ILT2 request for a specific intermediate position slot.
38 39 40 41 42 |
# File 'lib/sdn/message/ilt2/get.rb', line 38 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 in the range 1..16.
31 32 33 |
# File 'lib/sdn/message/ilt2/get.rb', line 31 def ip @ip end |
Instance Method Details
#params ⇒ <Integer>
Returns the protocol-specific payload bytes for this message.
57 58 59 |
# File 'lib/sdn/message/ilt2/get.rb', line 57 def params transform_param(@ip - 1) end |
#parse(params) ⇒ void
This method returns an undefined value.
Parses protocol-specific parameter bytes into this message instance.
51 52 53 54 |
# File 'lib/sdn/message/ilt2/get.rb', line 51 def parse(params) super self.ip = to_number(params[0]) + 1 end |