Class: SDN::Message::PostMotorPosition

Inherits:
SDN::Message show all
Defined in:
lib/sdn/messages/post.rb

Constant Summary collapse

MSG =
0x0d
PARAMS_LENGTH =
5

Instance Attribute Summary collapse

Attributes inherited from SDN::Message

#ack_requested, #dest, #reserved, #src

Instance Method Summary collapse

Methods inherited from SDN::Message

#class_inspect, #initialize, #inspect, parse, readpartial, #serialize

Methods included from Helpers

#checksum, #from_number, #from_string, #is_group_address?, #parse_address, #print_address, #to_number, #to_string, #transform_param

Constructor Details

This class inherits a constructor from SDN::Message

Instance Attribute Details

#ipObject

Returns the value of attribute ip.



7
8
9
# File 'lib/sdn/messages/post.rb', line 7

def ip
  @ip
end

#position_percentObject

Returns the value of attribute position_percent.



7
8
9
# File 'lib/sdn/messages/post.rb', line 7

def position_percent
  @position_percent
end

#position_pulsesObject

Returns the value of attribute position_pulses.



7
8
9
# File 'lib/sdn/messages/post.rb', line 7

def position_pulses
  @position_pulses
end

Instance Method Details

#parse(params) ⇒ Object



9
10
11
12
13
14
# File 'lib/sdn/messages/post.rb', line 9

def parse(params)
  super
  self.position_pulses = to_number(params[0..1], nillable: true)
  self.position_percent = to_number(params[2], nillable: true)
  self.ip = to_number(params[4], nillable: true)
end