Class: SDN::Message::GetGroupAddr
- Inherits:
-
Message
- Object
- Message
- SDN::Message::GetGroupAddr
- Defined in:
- lib/sdn/message/get.rb
Overview
Request for a motor's configured group address at a given slot.
Constant Summary collapse
- MSG =
Protocol message number
0x41- PARAMS_LENGTH =
Number of protocol parameter bytes expected
1
Instance Attribute Summary collapse
-
#group_index ⇒ Integer
Group index in the range 1..16.
Instance Method Summary collapse
-
#initialize(dest = nil, group_index = 1, **kwargs) ⇒ GetGroupAddr
constructor
Creates a request for a specific group 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, group_index = 1, **kwargs) ⇒ GetGroupAddr
Creates a request for a specific group slot.
24 25 26 27 28 |
# File 'lib/sdn/message/get.rb', line 24 def initialize(dest = nil, group_index = 1, **kwargs) kwargs[:dest] ||= dest super(**kwargs) self.group_index = group_index end |
Instance Attribute Details
#group_index ⇒ Integer
Group index in the range 1..16
17 18 19 |
# File 'lib/sdn/message/get.rb', line 17 def group_index @group_index end |
Instance Method Details
#params ⇒ <Integer>
Returns the protocol-specific payload bytes for this message.
43 44 45 |
# File 'lib/sdn/message/get.rb', line 43 def params transform_param(group_index - 1) end |
#parse(params) ⇒ void
This method returns an undefined value.
Parses protocol-specific parameter bytes into this message instance.
31 32 33 34 |
# File 'lib/sdn/message/get.rb', line 31 def parse(params) super self.group_index = to_number(params[0]) + 1 end |