#!/usr/bin/perl
#
#
# Author: Bruce S. Garlock
# Date:   2002-09-11
# Requirements: Device::SerialPort 0.12 (from cpan)
#
# Version: 0.1
#
#
# Description:  This perl script is for logging of data from a serial
# port, to a specified logfile.  The logfile can then be parsed with
# other programs for reporting purposes.
# 
# This program was written for specifically logging Multitech's
# MTASR2-203 T1 Router.  The router outputs text to the command
# port with 57.6k, 8-1-N, and No flow control.
#
#

use Device::SerialPort 0.12;

$PORT      = "/dev/usb/tts/1";          # port to watch

#
#
# Serial Settings
#
#

$ob = Device::SerialPort->new ($PORT) || die "Can't Open $PORT: $!";
$ob->baudrate(4800)   || die "failed setting baudrate";
$ob->parity("none")    || die "failed setting parity";
$ob->databits(8)       || die "failed setting databits";
$ob->stopbits(1)       || die "failed setting stopbits";
$ob->handshake("none") || die "failed setting handshake";
$ob->write_settings    || die "no settings";

undef $ob;
