Thank you for the answer but it isn't.
Thats my code:
use Fcntl qw/:DEFAULT/;
use IO::Termios ();
use IO::Stty ();
sysopen my $fh, '/dev/ttyUSB0', O_RDWR or die "sysopen: $!";
my $handle = IO::Termios->new($fh) or die "IO::Termios->new: $!";
$handle->set_mode('300,7,e,1');
IO::Stty::stty($handle, qw/ raw -parodd cs7 -cstopb parenb -ixoff -crt
+scts -hupcl -ixon -opost -onlcr -isig -icanon -iexten -echo -echoe -e
+choctl -echoke/);
my $raw = "\x2F\x3F\x21\x0D\x0A";
$handle->syswrite($raw) == length($raw) or die "syswrite";
my $raw = "\x06\x30\x30\x30\x0D\x0A";
$handle->syswrite($raw) == length($raw) or die "syswrite";
for (1..300) {
my $toread = 1;
$handle->sysread(my $in, $toread)
== $toread or die "sysread";
print $in;
}
$handle->close;
And it is always the same output:
/?!
000
/LOG4LK13BD202015
Thats all - thats not, what I need
2019-05-28 Athanasius added code tags
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|