Class: BWA::Messages::ControlConfiguration

Inherits:
BWA::Message show all
Defined in:
lib/bwa/messages/control_configuration.rb

Constant Summary collapse

MESSAGE_TYPE =
"\xbf\x24".b
MESSAGE_LENGTH =
21

Instance Attribute Summary collapse

Attributes inherited from BWA::Message

#raw_data, #src

Instance Method Summary collapse

Methods inherited from BWA::Message

format_duration, format_time, inherited, #log?, parse, #serialize

Constructor Details

#initializeControlConfiguration

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

#modelObject

Returns the value of attribute model.



9
10
11
# File 'lib/bwa/messages/control_configuration.rb', line 9

def model
  @model
end

#versionObject

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

#inspectObject



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