class SDN::Message::ILT2::SetLockStatus

Constants

MSG
PARAMS_LENGTH
TARGET_TYPE

Attributes

priority[R]

when target_type is down_limit, target is number of 10ms intervals it's still allowed to roll up

target[R]

when target_type is down_limit, target is number of 10ms intervals it's still allowed to roll up

target_type[R]

when target_type is down_limit, target is number of 10ms intervals it's still allowed to roll up

Public Class Methods

new(dest = nil, target_type = :unlock, target = nil, priority = 1, **kwargs) click to toggle source
Calls superclass method SDN::Message::new
# File lib/sdn/message/ilt2/set.rb, line 27
def initialize(dest = nil, target_type = :unlock, target = nil, priority = 1, **kwargs)
  kwargs[:dest] ||= dest
  super(**kwargs)
  self.target_type = target_type
  self.target = target
  self.priority = priority
end

Public Instance Methods

params() click to toggle source
# File lib/sdn/message/ilt2/set.rb, line 56
def params
  transform_param(TARGET_TYPE[target_type]) + transform_param(target) + transform_param(priority)
end
parse(params) click to toggle source
Calls superclass method SDN::Message::parse
# File lib/sdn/message/ilt2/set.rb, line 35
def parse(params)
  super
  self.target_type = TARGET_TYPE.invert[to_number(params[0])]
  self.target = to_number(params[1])
  self.priority = to_number(params[2])
end
priority=(value) click to toggle source
# File lib/sdn/message/ilt2/set.rb, line 51
def priority=(value)
  raise ArgumentError, "priority must be between 1 and 100" unless (1..100).include?(value)
  @priority = value
end
target=(value) click to toggle source
# File lib/sdn/message/ilt2/set.rb, line 47
def target=(value)
  @target = value&. & 0xff
end
target_type=(value) click to toggle source
# File lib/sdn/message/ilt2/set.rb, line 42
def target_type=(value)
  raise ArgumentError, "target_type must be one of :current, :up_limit, :down_limit, :ip, or :unlock" unless TARGET_TYPE.keys.include?(value)
  @target_type = value
end