Class: SDN::Message::UnknownMessage

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

Overview

messages after this point were decoded from UAI+ communication and may be named wrong

Instance Attribute Summary collapse

Attributes inherited from SDN::Message

#ack_requested, #dest, #node_type, #src

Instance Method Summary collapse

Methods inherited from SDN::Message

#==, expected_response?, inherited, #inspect, parse

Methods included from Helpers

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

Constructor Details

#initialize(params = [], **kwargs) ⇒ UnknownMessage

Returns a new instance of UnknownMessage.



178
179
180
181
# File 'lib/sdn/message.rb', line 178

def initialize(params = [], **kwargs)
  super(**kwargs)
  self.params = params
end

Instance Attribute Details

#msgObject

Returns the value of attribute msg.



176
177
178
# File 'lib/sdn/message.rb', line 176

def msg
  @msg
end

#paramsObject

Returns the value of attribute params.



176
177
178
# File 'lib/sdn/message.rb', line 176

def params
  @params
end

Instance Method Details

#class_inspectObject



191
192
193
194
195
196
197
198
199
200
# File 'lib/sdn/message.rb', line 191

def class_inspect
  result = if self.class == UnknownMessage
    result = ", @msg=%02xh" % msg 
  else
    super || ""
  end
  return result if params.empty?

  result << ", @params=#{params.map { |b| "%02x" % b }.join(' ')}"
end

#serializeObject

Raises:

  • (NotImplementedError)


185
186
187
188
189
# File 'lib/sdn/message.rb', line 185

def serialize
  # prevent serializing something we don't know
  raise NotImplementedError unless params
  super
end