Class: SDN::Message::Stop

Inherits:
Message
  • Object
show all
Defined in:
lib/sdn/message/control.rb

Overview

Command that stops motor movement.

Constant Summary collapse

MSG =

Protocol message number

0x02
PARAMS_LENGTH =

Number of protocol parameter bytes expected

1

Instance Method Summary collapse

Constructor Details

#initialize(dest = nil, **kwargs) ⇒ Stop

Creates a stop command for the specified destination.

Parameters:

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

    destination address

  • kwargs (Hash)

    additional message options



332
333
334
335
# File 'lib/sdn/message/control.rb', line 332

def initialize(dest = nil, **kwargs)
  kwargs[:dest] ||= dest
  super(**kwargs)
end

Instance Method Details

#params<Integer>

Returns the protocol-specific payload bytes for this message.

Returns:

  • (<Integer>)


338
339
340
# File 'lib/sdn/message/control.rb', line 338

def params
  transform_param(0)
end