mirror of
https://github.com/brmlab/lasic.git
synced 2025-06-08 01:03:59 +02:00
Brm::Lasic: Fix serial I/O
This commit is contained in:
parent
8e0d6747cc
commit
53b99be308
1 changed files with 12 additions and 4 deletions
|
@ -91,6 +91,11 @@ sub BUILD {
|
||||||
$self->port->stopbits(1);
|
$self->port->stopbits(1);
|
||||||
$self->port->handshake("none");
|
$self->port->handshake("none");
|
||||||
$self->port->write_settings();
|
$self->port->write_settings();
|
||||||
|
$self->port->read_const_time(500);
|
||||||
|
# Yes, output record separator != input record separator!
|
||||||
|
$self->port->output_record_separator("\n");
|
||||||
|
$self->port->are_match("\r\n");
|
||||||
|
sleep(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
=item B<reset>
|
=item B<reset>
|
||||||
|
@ -168,10 +173,13 @@ sub msg {
|
||||||
$self->seqid($self->seqid + 1);
|
$self->seqid($self->seqid + 1);
|
||||||
|
|
||||||
my $fd = $self->fd();
|
my $fd = $self->fd();
|
||||||
print $fd join(' ', @args)."\r\n";
|
# print join(' ', @args)."\n";
|
||||||
my $msg = <$fd>;
|
print $fd join(' ', @args);
|
||||||
chomp $msg;
|
my $msg;
|
||||||
print "(rep: $msg)\n";
|
do {
|
||||||
|
$msg = <$fd>;
|
||||||
|
} while (not $msg);
|
||||||
|
# print "(rep: $msg)\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue