Class: SDN::Message::UnknownMessage
- Inherits:
-
SDN::Message
- Object
- SDN::Message
- SDN::Message::UnknownMessage
- Defined in:
- lib/sdn/message.rb
Overview
messages after this point were decoded from UAI+ communication and may be named wrong
Direct Known Subclasses
ILT2::PostMotorSettings, ILT2::SetMotorLimits, ILT2::SetMotorSettings, PostNetworkLock
Instance Attribute Summary collapse
-
#msg ⇒ Object
Returns the value of attribute msg.
-
#params ⇒ Object
Returns the value of attribute params.
Attributes inherited from SDN::Message
#ack_requested, #dest, #node_type, #src
Instance Method Summary collapse
- #class_inspect ⇒ Object
-
#initialize(params = [], **kwargs) ⇒ UnknownMessage
constructor
A new instance of UnknownMessage.
- #serialize ⇒ Object
Methods inherited from SDN::Message
#==, expected_response?, inherited, #inspect, parse
Methods included from Helpers
#checksum, #from_number, #from_string, #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.
193 194 195 196 |
# File 'lib/sdn/message.rb', line 193 def initialize(params = [], **kwargs) super(**kwargs) self.params = params end |
Instance Attribute Details
#msg ⇒ Object
Returns the value of attribute msg.
191 192 193 |
# File 'lib/sdn/message.rb', line 191 def msg @msg end |
#params ⇒ Object
Returns the value of attribute params.
191 192 193 |
# File 'lib/sdn/message.rb', line 191 def params @params end |
Instance Method Details
#class_inspect ⇒ Object
207 208 209 210 211 212 213 214 215 216 |
# File 'lib/sdn/message.rb', line 207 def class_inspect result = if instance_of?(UnknownMessage) format(", @msg=%02xh", msg) else super || "" end return result if params.empty? result << ", @params=#{params.map { |b| format("%02x", b) }.join(" ")}" end |
#serialize ⇒ Object
200 201 202 203 204 205 |
# File 'lib/sdn/message.rb', line 200 def serialize # prevent serializing something we don't know raise NotImplementedError unless params super end |