[nottingham] Serial port data acquisition in Perl

From: Graeme Fowler (graeme@graemef.net)
Date: Mon 14 Jan 2002 - 13:01:19 GMT


Has anyone got much experience of the above?

I'm trying to write something to dump the data off of my dive computer,
but I'm buggered if I can make something read the serial interface :(

Simple answers on a postcard, please!

Someothing like:

use <module>;

$port = <module>->new();

$port->setattr(attribute1);.
# set other port attributes
# then attach a filehandle to the device with a sysread() call

while (<FH>) {
  # print out raw data, don't unpack it. Just so we can see the stuff!
  print;
}

close (FH);

...see? I've tried using POSIX::Termios, with which I can manipulate the
port settings and muck about with DTR/CTS etc but I just can't get the
damn thing to do the relevant ioctl() and sysread() calls to read the
data!

It's driving me up the bloody wall. Hints, examples, ideas appreciated.

Graeme

--------------------------------------------------------------------
http://www.lug.org.uk http://www.linuxportal.co.uk
http://www.linuxjob.co.uk http://www.linuxshop.co.uk
--------------------------------------------------------------------



This archive was generated by hypermail 2.1.3 : Mon 14 Jan 2002 - 13:05:04 GMT