On Monday 14 January 2002 13:01, you wrote:
> Has anyone got much experience of the above?
Yes, I've used perl to process call records, from a PBX.
> ...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.
The way I did it was to run 'stty' and put the tty into raw mode, that's much
easier than mucking about with the terminal I/O library (hint: stty <
/dev/ttyS1). Basically have one process to set the options and read/write
the tty, I think I set a variable to turn on perl's line buffer, probably
$|=1 or something like that.
Unfortunately I don't have a tar file of the code, it's a shame as it was
fairly nifty, as you've found the debugging is the tricky part, and I had it
handled so I could test from disk file, or debug 'rubbish lister' as well as
a tty, which saves a lot of development time.
Rob
--------------------------------------------------------------------
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:22:28 GMT