/usr/share/doc/libdevice-serialport-perl/examples/options.plx is in libdevice-serialport-perl 1.04-3+b3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | #!/usr/bin/perl -w
## use lib './blib/lib','../blib/lib'; # can run from here or distribution base
use strict;
use Device::SerialPort 0.02;
my $file = "/dev/ttyS0";
if (@ARGV) {
$file = shift @ARGV;
}
my $ob = Device::SerialPort->new ($file) ||
die "Usage: perl options.plx port_name (/dev/ttySx) > results";
my @baud_opt = $ob->baudrate;
my @parity_opt = $ob->parity;
my @data_opt = $ob->databits;
my @stop_opt = $ob->stopbits;
my @hshake_opt = $ob->handshake;
print "\nAvailable Options for port $file\n";
print "\nData Bit Options: ";
foreach $a (@data_opt) { print " $a"; }
print "\n\nStop Bit Options: ";
foreach $a (@stop_opt) { print " $a"; }
print "\n\nHandshake Options: ";
foreach $a (@hshake_opt) { print " $a"; }
print "\n\nParity Options: ";
foreach $a (@parity_opt) { print " $a"; }
my $c = 8;
print "\n\nBaudrate Options: ";
foreach $a (@baud_opt) {
print " $a";
unless (--$c > 0) {
$c = 8;
print "\n ";
}
}
print "\nBinary Capabilities:\n";
print " can_baud\n" if (scalar $ob->can_baud);
print " can_databits\n" if (scalar $ob->can_databits);
print " can_stopbits\n" if (scalar $ob->can_stopbits);
print " can_dtrdsr\n" if (scalar $ob->can_dtrdsr);
print " can_handshake\n" if (scalar $ob->can_handshake);
print " can_parity_check\n" if (scalar $ob->can_parity_check);
print " can_parity_config\n" if (scalar $ob->can_parity_config);
print " can_parity_enable\n" if (scalar $ob->can_parity_enable);
print " can_rlsd\n" if (scalar $ob->can_rlsd);
print " can_rtscts\n" if (scalar $ob->can_rtscts);
print " can_xonxoff\n" if (scalar $ob->can_xonxoff);
print " can_interval_timeout\n" if (scalar $ob->can_interval_timeout);
print " can_total_timeout\n" if (scalar $ob->can_total_timeout);
print " can_xon_char\n" if (scalar $ob->can_xon_char);
print " can_spec_char\n" if (scalar $ob->can_spec_char);
print " can_16bitmode\n" if (scalar $ob->can_16bitmode);
print " is_rs232\n" if (scalar $ob->is_rs232);
print " is_modem\n" if (scalar $ob->is_modem);
print " binary\n" if (scalar $ob->binary);
print " parity_enable\n" if (scalar $ob->parity_enable);
print "\nCurrent Settings:\n";
printf " baud = %d\n", scalar $ob->baudrate;
printf " parity = %s\n", scalar $ob->parity;
printf " data = %d\n", scalar $ob->databits;
printf " stop = %d\n", scalar $ob->stopbits;
printf " hshake = %s\n", scalar $ob->handshake;
print "\nOther Capabilities:\n";
my ($in, $out) = $ob->buffer_max;
printf " input buffer max = 0x%x\n", $in;
printf " output buffer max = 0x%x\n", $out;
($in, $out)= $ob->buffers;
print " input buffer = $in\n";
print " output buffer = $out\n";
printf " alias = %s\n", $ob->alias;
undef $ob;
|