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/beacon.rb', line 31
def run
@running = true
last_trigger = Beacon::now
while @running and Beacon::now - last_trigger < 30
sleep(1)
end
last_trigger = Beacon::now
while @running
if Beacon::now - last_trigger >= 600
last_trigger = Beacon::now
@port_configs.each do |port, port_config|
frame = {:source => port.identifier,
:destination => 'APRS',
:path => port_config[:beacon_path],
:text => port_config[:beacon_text]
}
port.write(frame)
end
else
sleep(1)
end
end
end
|