31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/peak/plugins/id.rb', line 31
def run
@running = true
last_trigger = Id::now
while @running and Id::now - last_trigger < 60
sleep(1)
end
last_trigger = Id::now
while @running
if Id::now - last_trigger >= 600
last_trigger = Id::now
@port_configs.each do |port, port_config|
frame = {:source => port.identifier,
:destination => 'ID',
:path => port_config[:id_path],
:text => port_config[:id_text]
}
port.write(frame)
end
else
sleep(1)
end
end
end
|