Class: MicroAethAE51::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/micro_aeth-ae51.rb

Overview

Creates and parses messages to and from the MicroAeth. See MicroAeth::Com for specifications on the transmiting of messages.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Message

Returns a new instance of Message.

Parameters:

  • data (String)

    conents between the STX “\x02” and the ETX “0x03”



60
61
62
63
64
# File 'lib/micro_aeth-ae51.rb', line 60

def initialize data
  raise "invalid data" unless data_valid? data
  @original_char_string = data
  parse_data( data[7..-1])
end

Instance Attribute Details

#batteryObject (readonly)

Returns the value of attribute battery.



47
48
49
# File 'lib/micro_aeth-ae51.rb', line 47

def battery
  @battery
end

#flowObject (readonly)

Returns the value of attribute flow.



47
48
49
# File 'lib/micro_aeth-ae51.rb', line 47

def flow
  @flow
end

#original_char_stringObject (readonly)

Returns the value of attribute original_char_string.



47
48
49
# File 'lib/micro_aeth-ae51.rb', line 47

def original_char_string
  @original_char_string
end

#pcb_tempObject (readonly)

Returns the value of attribute pcb_temp.



47
48
49
# File 'lib/micro_aeth-ae51.rb', line 47

def pcb_temp
  @pcb_temp
end

#refObject (readonly)

Returns the value of attribute ref.



47
48
49
# File 'lib/micro_aeth-ae51.rb', line 47

def ref
  @ref
end

#sen1Object (readonly)

Returns the value of attribute sen1.



47
48
49
# File 'lib/micro_aeth-ae51.rb', line 47

def sen1
  @sen1
end

#sen2Object (readonly)

Returns the value of attribute sen2.



47
48
49
# File 'lib/micro_aeth-ae51.rb', line 47

def sen2
  @sen2
end

#statusObject (readonly)

Returns the value of attribute status.



47
48
49
# File 'lib/micro_aeth-ae51.rb', line 47

def status
  @status
end

#timeObject (readonly)

Returns the value of attribute time.



47
48
49
# File 'lib/micro_aeth-ae51.rb', line 47

def time
  @time
end