Class: IrPtz::IrRemote

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/ir_ptz/ir_remote.rb

Constant Summary collapse

TIME_NEEDED_BETWEEN_IR_BLAST =

seconds

0.18

Instance Method Summary collapse

Instance Method Details

#read_codeObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/ir_ptz/ir_remote.rb', line 18

def read_code
  data = nil
  end_of_read = nil

  ir.read do |ir_data|
    data = ir_data
    end_of_read = true
  end

  puts "reading.."
  ir.wait { sleep 1; break if end_of_read }
  puts "finished reading!"

  data
end