Class: SDN::Message::SetFactoryDefault

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

Constant Summary collapse

MSG =
0x1f
PARAMS_LENGTH =
1
RESET =
{ all_settings: 0x00, group_addresses: 0x01, limits: 0x11, rotation: 0x12, rolling_speed: 0x13, ips: 0x15, locks: 0x17 }

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, #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

#initialize(dest = nil, reset = :all_settings, **kwargs) ⇒ SetFactoryDefault

Returns a new instance of SetFactoryDefault.



151
152
153
154
155
# File 'lib/sdn/messages/set.rb', line 151

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

Instance Attribute Details

#resetObject

Returns the value of attribute reset.



149
150
151
# File 'lib/sdn/messages/set.rb', line 149

def reset
  @reset
end

Instance Method Details

#paramsObject



167
168
169
# File 'lib/sdn/messages/set.rb', line 167

def params
  transform_param(RESET[reset])
end

#parse(params) ⇒ Object



157
158
159
160
# File 'lib/sdn/messages/set.rb', line 157

def parse(params)
  super
  self.reset = RESET.invert[to_number(params)]
end