projects
/
vrDialog
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added retry
[vrDialog]
/
dialog.pl
diff --git
a/dialog.pl
b/dialog.pl
index
dbab70b
..
47bfe21
100755
(executable)
--- a/
dialog.pl
+++ b/
dialog.pl
@@
-12,8
+12,8
@@
$port->parity('none');
$port->stopbits(1);
$port->handshake('none');
$port->stopbits(1);
$port->handshake('none');
-$port->read_char_time(
10
00);
-$port->read_const_time(
3
000);
+$port->read_char_time(
5
00);
+$port->read_const_time(
1
000);
sub as_hex {
my @out;
sub as_hex {
my @out;
@@
-36,20
+36,24
@@
sub v {
my ($hex,$expect,$desc) = @_;
my $bytes = hex2bytes( $hex );
warn "# $desc\n";
my ($hex,$expect,$desc) = @_;
my $bytes = hex2bytes( $hex );
warn "# $desc\n";
+retry:
warn ">> ",as_hex( $bytes );
$port->write( $bytes );
my $data = $port->read(1);
warn "<< len: ",ord($data);
warn ">> ",as_hex( $bytes );
$port->write( $bytes );
my $data = $port->read(1);
warn "<< len: ",ord($data);
+
+ goto retry if ord($data) == 0;
+
$data .= $port->read(ord($data) - 1);
warn "<< ",as_hex($data);
warn "?? $expect\n" if $expect;
}
$data .= $port->read(ord($data) - 1);
warn "<< ",as_hex($data);
warn "?? $expect\n" if $expect;
}
-
#
v '07 02 00 00 00 04 C4', "hardware version";
+v '07 02 00 00 00 04 C4', "hardware version";
-
#
v '07 0A 00 00 00 04 44', 'software version';
+v '07 0A 00 00 00 04 44', 'software version';
v '07 00 01 00 06 0E EA', 'temperatures';
v '07 00 01 00 06 0E EA', 'temperatures';