Class: BWA::Messages::ControlConfiguration
- Inherits:
-
BWA::Message
- Object
- BWA::Message
- BWA::Messages::ControlConfiguration
- Defined in:
- lib/bwa/messages/control_configuration.rb
Constant Summary collapse
- MESSAGE_TYPE =
"\xbf\x24".b
- MESSAGE_LENGTH =
21
Instance Attribute Summary collapse
-
#model ⇒ Object
Returns the value of attribute model.
-
#version ⇒ Object
Returns the value of attribute version.
Attributes inherited from BWA::Message
Instance Method Summary collapse
-
#initialize ⇒ ControlConfiguration
constructor
A new instance of ControlConfiguration.
- #inspect ⇒ Object
- #parse(data) ⇒ Object
Methods inherited from BWA::Message
format_duration, format_time, inherited, #log?, parse, #serialize
Constructor Details
#initialize ⇒ ControlConfiguration
Returns a new instance of ControlConfiguration.
11 12 13 14 15 |
# File 'lib/bwa/messages/control_configuration.rb', line 11 def initialize super @model = "" @version = 0 end |
Instance Attribute Details
#model ⇒ Object
Returns the value of attribute model.
9 10 11 |
# File 'lib/bwa/messages/control_configuration.rb', line 9 def model @model end |
#version ⇒ Object
Returns the value of attribute version.
9 10 11 |
# File 'lib/bwa/messages/control_configuration.rb', line 9 def version @version end |
Instance Method Details
#inspect ⇒ Object
22 23 24 |
# File 'lib/bwa/messages/control_configuration.rb', line 22 def inspect "#<BWA::Messages::ControlConfiguration #{model} #{version}>" end |
#parse(data) ⇒ Object
17 18 19 20 |
# File 'lib/bwa/messages/control_configuration.rb', line 17 def parse(data) self.version = "V#{data[2].ord}.#{data[3].ord}" self.model = data[4..11].strip end |