Cosimo Streppone > Test-Device-SerialPort-0.01 > Test::Device::SerialPort

Download:
Test-Device-SerialPort-0.01.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.01   Source  

NAME ^

Test::Device::SerialPort - Serial port mock object to be used for testing

SYNOPSIS ^

    use Test::Device::SerialPort;
    my $PortObj = Test::Device::SerialPort->new('/dev/ttyS0');

    $PortObj->baudrate(19200);
    $PortObj->parity('none');
    $PortObj->databits(8);
    $PortObj->stopbits(1);

    # Simulate read from port (can also read nothing)
    my($count, $data) = $PortObj->read(100);

    print "Read random data from serial [$data]\n";

    # Simulate write to serial port
    $count = $PortObj->write("MY_MESSAGE\r");

    print "Written $count chars to test port\n";

    # ...

DESCRIPTION ^

Nothing more. It's a test object that mimics the real Device::SerialPort thing. Used mainly for testing when I don't have an actual device to test.

STATUS ^

Just a sketch version...

SEE ALSO ^

Device::SerialPort
Win32::SerialPort

AUTHOR ^

Cosimo Streppone, <cosimo@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2007 by Cosimo Streppone

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.