Class: SDN::Message::Nack
- Inherits:
-
SDN::Message
- Object
- SDN::Message
- SDN::Message::Nack
- Defined in:
- lib/sdn/message.rb
Constant Summary collapse
- MSG =
0x6f- PARAMS_LENGTH =
1- VALUES =
{ data_error: 0x01, unknown_message: 0x10, node_is_locked: 0x20, wrong_position: 0x21, limits_not_set: 0x22, ip_not_set: 0x23, out_of_range: 0x24, busy: 0xff }.freeze
Instance Attribute Summary collapse
-
#error_code ⇒ Object
presumed.
Attributes inherited from SDN::Message
#ack_requested, #dest, #node_type, #src
Instance Method Summary collapse
-
#initialize(dest = nil, error_code = nil, **kwargs) ⇒ Nack
constructor
A new instance of Nack.
- #parse(params) ⇒ Object
Methods inherited from SDN::Message
#==, #class_inspect, expected_response?, inherited, #inspect, parse, #serialize
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(dest = nil, error_code = nil, **kwargs) ⇒ Nack
Returns a new instance of Nack.
171 172 173 174 175 |
# File 'lib/sdn/message.rb', line 171 def initialize(dest = nil, error_code = nil, **kwargs) kwargs[:dest] ||= dest super(**kwargs) self.error_code = error_code end |
Instance Attribute Details
#error_code ⇒ Object
presumed
169 170 171 |
# File 'lib/sdn/message.rb', line 169 def error_code @error_code end |
Instance Method Details
#parse(params) ⇒ Object
177 178 179 180 181 |
# File 'lib/sdn/message.rb', line 177 def parse(params) super error_code = to_number(params[0]) self.error_code = VALUES.invert[error_code] || error_code end |