| 1 | # You may distribute under the terms of either the GNU General Public License |
| 2 | # or the Artistic License (the same terms as Perl itself) |
| 3 | # |
| 4 | # (C) Paul Evans, 2016 -- [email protected] |
| 5 | |
| 6 | package Linux::Termios2scip-perl cpan Linux-Termios2 0.01 Linux/Termios2/; |
| 7 | |
| 8 | use strictscip-perl cpan Linux-Termios2 0.01 strict/; |
| 9 | use warningsscip-perl cpan Linux-Termios2 0.01 warnings/; |
| 10 | |
| 11 | our $VERSIONscip-perl cpan Linux-Termios2 0.01 Linux/Termios2/$VERSION. = '0.01'; |
| 12 | |
| 13 | requirescip-perl cpan Linux-Termios2 0.01 Linux/Termios2/require(). XSLoader; |
| 14 | XSLoader::loadscip-perl cpan Linux-Termios2 0.01 XSLoader/load().( __PACKAGE__scip-perl cpan Linux-Termios2 0.01 Linux/Termios2/__PACKAGE__()., $VERSIONscip-perl cpan Linux-Termios2 0.01 Linux/Termios2/$VERSION. ); |
| 15 | |
| 16 | =head1 NAME |
| 17 | |
| 18 | C<Linux::Termios2> - wrap the F<Linux>-specific C<struct termios2> structure |
| 19 | and related |
| 20 | |
| 21 | =head1 SYNOPSIS |
| 22 | |
| 23 | This module is primarily intended as a helper for L<IO::Termios>, but it could |
| 24 | also be used directly. |
| 25 | |
| 26 | use Linux::Termios2; |
| 27 | use POSIX qw( TCSANOW ); |
| 28 | |
| 29 | my $termios = Linux::Termios2->new; |
| 30 | $termios->getattr( 0 ); |
| 31 | |
| 32 | $termios->setospeed( 123456 ); |
| 33 | |
| 34 | $termios->setattr( 0, TCSANOW ) or |
| 35 | die "Cannot TCSETS2 - $!"; |
| 36 | |
| 37 | =head1 DESCRIPTION |
| 38 | |
| 39 | This class provides an API equivalent to the L<POSIX::Termios> class, except |
| 40 | backed by the F<Linux>-specific C<struct termios2> structure instead. |
| 41 | |
| 42 | It uses the C<TCGETS2> and C<TCSETS2> family of C<ioctl()> calls, meaning it |
| 43 | has access to the arbitrary baud rate ability of the C<c_ispeed> and |
| 44 | C<c_ospeed> fields with the C<BOTHER> baud setting. These are accessed |
| 45 | transparently, by simply calling C<setispeed> and C<setospeed> with baud rates |
| 46 | in bits per second. |
| 47 | |
| 48 | =cut |
| 49 | |
| 50 | =head1 AUTHOR |
| 51 | |
| 52 | Paul Evans <[email protected]> |
| 53 | |
| 54 | =cut |
| 55 | |
| 56 | 0x55AA; |