summaryrefslogtreecommitdiff
path: root/ats-watch/ats-watch.pl
diff options
context:
space:
mode:
Diffstat (limited to 'ats-watch/ats-watch.pl')
-rwxr-xr-xats-watch/ats-watch.pl37
1 files changed, 29 insertions, 8 deletions
diff --git a/ats-watch/ats-watch.pl b/ats-watch/ats-watch.pl
index f374295..227f28c 100755
--- a/ats-watch/ats-watch.pl
+++ b/ats-watch/ats-watch.pl
@@ -1,15 +1,36 @@
#!/usr/bin/perl -w
+##
+## Radio Helsinki avr projects
+##
+##
+## Copyright (C) 2013-2015 Christian Pointner <equinox@helsini.at>
+##
+## This file is part of Radio Helsinki avr projects.
+##
+## Radio Helsinki avr projects is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## any later version.
+##
+## Radio Helsinki avr projects is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Radio Helsinki avr projects. If not, see <http://www.gnu.org/licenses/>.
+##
use strict;
use Device::SerialPort;
use Mail::Sendmail;
-my $port = new Device::SerialPort("/dev/ats-watch");
-$port->baudrate(38400);
-$port->parity("none");
-$port->databits(8);
-$port->stopbits(1);
-$port->handshake("none");
+my $port = new Device::SerialPort("/dev/ats-watch");
+$port->baudrate(38400);
+$port->parity("none");
+$port->databits(8);
+$port->stopbits(1);
+$port->handshake("none");
$port->read_const_time(500);
$port->read_char_time(5);
$port->write_settings;
@@ -36,7 +57,7 @@ while(1) {
} else {
$mail{Subject} = '[ATS-Watch] PDU0 state unknown';
$mail{Message} = $line;
- }
+ }
sendmail( %mail ) or print $Mail::Sendmail::error . "\n";
- }
+ }
}