Device::SerialPort VERSION=0.04, 21 July 1999 Hello Serial Port users: If you are running Windows 95 or later, you want the Win32::SerialPort module instead of this one. It has a compatible user interface. Available from your favorite CPAN site. Since someone asked, there is not currently an equivalent for MS-DOS (and none is anticipated). This is a POSIX-based version of the Win32::Serialport module ported by Joe Doss for the MisterHouse Home Automation Package from Version 0.08 of the Win32 module. He replaced calls to the Win32 API with similar functions implemented using POSIX calls. While most of the testing has occurred on linux, the package should work on other POSIX-compliant Operating Systems. There are a small number of ioctl calls to handle the RTS and DTR outputs. Those require (from more or less traditional locations) the outputs from "h2ph" for ioctl.h and related files. .../_h2ph_pre.ph .../asm/termios.ph .../asm/termbits.ph .../asm/posix_types.ph .../asm/ioctls.ph .../asm/ioctl.ph .../linux/posix_types.ph This module does not require a compiler or use XS. Since everything is (convoluted but still pure) perl, you can fix flaws and change limits if required. But please file a bug report if you do. I have tested with Perl 5.005_02 on Redhat 5.2. This is the first alpha release. Most features are still experimental in implementation. But the intent is to "clone" the corresponding features of the Win32::SerialPort module whenever practical - see the documentation for that module as well as this one for details. COMPATIBILITY NOTES: 1. Earlier versions of this module were named SerialPort_Linux.pm or just SerialPort.pm. The examples in alpha version 0.02 (limited release only) work fine when the Namespace is updated. 2. The Tied FileHandle support will works fully on 5.005, mostly on 5.004, and essentially NOT on 5.003. This is due to the level of support in the underlying Perl - not to the module implementation. The module supports all tie methods except READLINE and READ currently. 3. Like Win32::SerialPort, this distribution uses "hand-crafted" Makefile.PL and Install.PL routines. See the NOTES and KNOWN LIMITATIONS in the SerialPort documentation. The ".pod" is embedded in the ".pm". The comments on "-w" and "use strict" are especially relevant when you start calling this module from your own code. Special thanks to Joe Doss for the initial porting. And to Bruce Winter for the "required *.ph" list. Also thanks to the others who have contributed comments and suggestions. FILES: Changes - for history lovers Makefile.PL - the "starting point" for traditional reasons MANIFEST - file list README - this file eq/demo1.plx - talks to a "really dumb" terminal eg/demo2.plx - "poor man's" readline and chatV eg/demo4.plx - simplest setup: "new", "required param" eg/demo8.plx - command line terminal emulator with Term::Readkey Install.PL - install using MakeMaker tools eq/options.plx - post-install test that prints available options SerialPort.html - documentation eg/example1.txt - example from The Perl Journal #13 (minimal mods) eg/example2.txt - example from The Perl Journal #13 (minimal mods) eg/example3.txt - example from The Perl Journal #13 (minimal mods) lib - install directory lib/Device - install directory lib/Device/SerialPort.pm - the reason you're reading this Altport.pm - stub for inheritance test t - test directory t/test1.t - RUN ME FIRST, tests and creates configuration t/test3.t - Inheritance and export version of test1.t PRE-INSTALL and TEST: You will need suitable permissions to open the port. If the port is also used for logins, you will need to create a lockfile (/var/lock/LCK..ttyS0 on my Redhat 5.2 system. Just touch it, the contents are not important. The may be someday. But not yet. You might need to be "root" for that. Run 'perl Makefile.PL' first with nothing connected to "/dev/ttyS0". This will run the tests automatically. You can specify a diferent port to test with 'perl Makefile.PL PORT'. The Benchmark routines are used to generate reports. The test suite covers many of the module methods and sets the port for 9600 baud, 1 stop, 8 data, no parity, no handshaking, and other defaults. At various points in the testing, it expects unconnected CTS and DTR lines. The module should restore any port settings on exit. But this has not been exhaustively tested yet Tests may also be run individually by typing: 'perl test?.t Page_Delay [/dev/ttySx]' With no delay, the tests execute too rapidly to follow from a command line. Delay may be set from 0 to 5 seconds. All tests are expected to pass - I would be very interested in hearing about failures ("not ok"). These tests should be run from a command prompt. INSTALLATION: 1. For perl versions 5.004 and above, run 'perl Install.PL". That's it! I don't have an earlier one to test. 3. Run 'perl eg/options.plx'. It should run without errors. DEMO PROGRAMS: Connect a dumb terminal (or a PC that acts like one) to /dev/ttyS0 and setup the equivalent configuration. Starting demo1.plx should print a three line message on both the terminal and the command line. The terminal keyboard (only) now accepts characters which it prints to both screens until a CONTROL-Z is typed. Also included is demo2.plx - a truly minimal chat program. Bi-directional communication without an event loop, sockets, pipes (or much utility ;-) This one uses CAPITAL-Q from the active keyboard to quit since doesn't like CONTROL-Z. AltPort.pm and test3.t implement the "basic Inheritance test" discussed in perltoot and other documentation. It also imports the :PARAM constants. It's otherwise only slightly modified from test1.t (you'll get a different "alias" in test3.t). Run options.plx to see the available choices for various parameters along with the current values. If you have trouble, I will probably ask you to save the output of options.plx in a file and send it to me. You can specify a port name for options.plx on the command line (e.g. 'perl options.plx COM2'). Demo4.plx is a "minimum" script showing just the basics needed to get started. Demo8.plx is a simple command-line terminal emulator contributed by Andrej Mikus. The Perl Journal #13 included an article on Controlling a Modem with Win32::SerialPort. Slightly revised versions of the first 3 Examples from the article are included in the "eg" subdirectory. Please tell me what does and what doesn't work. The module has proven to be pretty robust. But I can't test all possible configurations. Don't trust it for anything important without complete testing. And watch for updates at: %%%% http://members.aol.com/Bbirthisel/alpha.html or CPAN under authors/id/B/BB/BBIRTH or Device::SerialPort Thanks, -bill Copyright (C) 1999, Bill Birthisel. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.