Class: SDN::Message::ILT2::PostMotorSettings

Inherits:
UnknownMessage show all
Defined in:
lib/sdn/message/ilt2/post.rb

Overview

Response carrying ILT2 motor settings in a partially decoded form.

Constant Summary collapse

MSG =

Protocol message number

0x62
PARAMS_LENGTH =

Number of protocol parameter bytes expected

3

Instance Attribute Summary collapse

Attributes inherited from UnknownMessage

#msg

Instance Method Summary collapse

Methods inherited from UnknownMessage

#class_inspect, #serialize

Constructor Details

#initialize(limit = nil) ⇒ PostMotorSettings

Creates an ILT2 motor settings response.

Parameters:

  • limit (Integer, nil) (defaults to: nil)

    configured lower limit



171
172
173
174
# File 'lib/sdn/message/ilt2/post.rb', line 171

def initialize(limit = nil, **)
  super(**)
  self.limit = limit
end

Instance Attribute Details

#limitInteger?

Reported configured lower limit.

Returns:

  • (Integer, nil)


166
167
168
# File 'lib/sdn/message/ilt2/post.rb', line 166

def limit
  @limit
end

Instance Method Details

#params<Integer>

Returns the protocol-specific payload bytes for this message.

Returns:

  • (<Integer>)


183
184
185
# File 'lib/sdn/message/ilt2/post.rb', line 183

def params
  transform_param(0) + from_number(limit, 2)
end

#parse(params) ⇒ void

This method returns an undefined value.

Parses protocol-specific parameter bytes into this message instance.

Parameters:

  • params (<Integer>)

    raw parameter bytes

Raises:



177
178
179
180
# File 'lib/sdn/message/ilt2/post.rb', line 177

def parse(params)
  super
  self.limit = to_number(params[1..2])
end