Class: SDN::Message::ILT2::SetMotorSettings
- Inherits:
-
UnknownMessage
- Object
- Message
- UnknownMessage
- SDN::Message::ILT2::SetMotorSettings
- Defined in:
- lib/sdn/message/ilt2/set.rb
Overview
the motor does not move, and just stores the new values flags of 1 is reverse direction, but you have to set it every time
Constant Summary collapse
- MSG =
Protocol message number
0x52- PARAMS_LENGTH =
Number of protocol parameter bytes expected
5
Instance Attribute Summary collapse
Attributes inherited from UnknownMessage
Instance Method Summary collapse
-
#initialize(dest = nil, flags = 0, down_limit = 0, position_pulses = 0, **kwargs) ⇒ SetMotorSettings
constructor
Creates an ILT2 motor settings write command.
-
#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 UnknownMessage
Constructor Details
#initialize(dest = nil, flags = 0, down_limit = 0, position_pulses = 0, **kwargs) ⇒ SetMotorSettings
Creates an ILT2 motor settings write command.
277 278 279 280 281 282 283 |
# File 'lib/sdn/message/ilt2/set.rb', line 277 def initialize(dest = nil, flags = 0, down_limit = 0, position_pulses = 0, **kwargs) kwargs[:dest] ||= dest super(**kwargs) self.flags = flags self.down_limit = down_limit self.position_pulses = position_pulses end |
Instance Attribute Details
#down_limit ⇒ Integer
265 266 267 |
# File 'lib/sdn/message/ilt2/set.rb', line 265 def down_limit @down_limit end |
#flags ⇒ Integer
262 263 264 |
# File 'lib/sdn/message/ilt2/set.rb', line 262 def flags @flags end |
#position_pulses ⇒ Integer
268 269 270 |
# File 'lib/sdn/message/ilt2/set.rb', line 268 def position_pulses @position_pulses end |
Instance Method Details
#params ⇒ <Integer>
Returns the protocol-specific payload bytes for this message.
294 295 296 |
# File 'lib/sdn/message/ilt2/set.rb', line 294 def params transform_param(flags) + from_number(down_limit, 2) + from_number(position_pulses, 2) end |
#parse(params) ⇒ void
This method returns an undefined value.
Parses protocol-specific parameter bytes into this message instance.
286 287 288 289 290 291 |
# File 'lib/sdn/message/ilt2/set.rb', line 286 def parse(params) super self.flags = to_number(params[0]) self.down_limit = to_number(params[1..2]) self.position_pulses = to_number(params[3..4]) end |