Class: AutomateEm::Device

Inherits:
Object
  • Object
show all
Includes:
ModuleCore
Defined in:
lib/automate-em/device/device.rb,
lib/automate-em/device/tcp_control.rb

Defined Under Namespace

Classes: Base

Constant Summary

Constants included from Constants

Constants::Off, Constants::On

Instance Attribute Summary collapse

Attributes included from ModuleCore

#base, #systems

Attributes included from Status

#status

Instance Method Summary collapse

Methods included from ModuleCore

#clear_active_timers, #join_system, #leave_system, #logger, #setbase

Methods included from Utilities

array_to_str, byte_to_hex, hex_to_byte, schedule, str_to_array, task

Methods included from Status

#[], #[]=, #mark_emit_end, #mark_emit_start, #update_status

Constructor Details

#initialize(tls, makebreak) ⇒ Device

Returns a new instance of Device.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/automate-em/device/device.rb', line 5

def initialize(tls, makebreak)
  @systems = []

  #

  # Status variables

  #  NOTE:: if changed then change in logic.rb 

  #

  @secure_connection = tls
  @makebreak_connection = makebreak
  @status = {}
  @status_lock = Object.new.extend(MonitorMixin)
  @system_lock = Mutex.new
  @status_waiting = false
end

Instance Attribute Details

#makebreak_connectionObject (readonly)

Returns the value of attribute makebreak_connection.



27
28
29
# File 'lib/automate-em/device/device.rb', line 27

def makebreak_connection
  @makebreak_connection
end

#secure_connectionObject (readonly)

required by base for send logic



26
27
28
# File 'lib/automate-em/device/device.rb', line 26

def secure_connection
  @secure_connection
end