Class: BWA::Messages::ControlConfiguration

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

Constant Summary collapse

MESSAGE_TYPE =
"\x0a\xbf\x24".force_encoding(Encoding::ASCII_8BIT)
MESSAGE_LENGTH =
21

Instance Attribute Summary collapse

Attributes inherited from BWA::Message

#raw_data

Instance Method Summary collapse

Methods inherited from BWA::Message

format_duration, format_time, inherited, parse, #serialize

Constructor Details

#initializeControlConfiguration

Returns a new instance of ControlConfiguration.



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

def initialize
  @model = ''
  @version = 0
end

Instance Attribute Details

#modelObject

Returns the value of attribute model.



7
8
9
# File 'lib/bwa/messages/control_configuration.rb', line 7

def model
  @model
end

#versionObject

Returns the value of attribute version.



7
8
9
# File 'lib/bwa/messages/control_configuration.rb', line 7

def version
  @version
end

Instance Method Details

#inspectObject



19
20
21
# File 'lib/bwa/messages/control_configuration.rb', line 19

def inspect
  "#<BWA::Messages::ControlConfiguration #{model} #{version}>"
end

#parse(data) ⇒ Object



14
15
16
17
# File 'lib/bwa/messages/control_configuration.rb', line 14

def parse(data)
  self.version = "V#{data[2].ord}.#{data[3].ord}"
  self.model = data[4..11].strip
end