projects
/
Biblio-RFID.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
90500f7
)
check if response is Dx and try to recover
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 27 Jul 2010 13:07:29 +0000
(15:07 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 27 Jul 2010 13:07:29 +0000
(15:07 +0200)
lib/RFID/Serial/3M810.pm
patch
|
blob
|
history
diff --git
a/lib/RFID/Serial/3M810.pm
b/lib/RFID/Serial/3M810.pm
index
2c27e4d
..
9a01e1b
100644
(file)
--- a/
lib/RFID/Serial/3M810.pm
+++ b/
lib/RFID/Serial/3M810.pm
@@
-67,6
+67,18
@@
sub cmd {
$r_len = $port->read(3);
}
+ # FIXME sometimes, reader returns left-over junk
+ if ( ! ord(substr($r_len,0,1)) && 0xD0 ) {
+ warn "INVALID reponse ",as_hex($r_len);
+ my $c;
+ while ( $c ne "\xD6" ) {
+ $c = $port->read(1) || return;
+ warn "# c ",as_hex($c);
+ }
+ $r_len = $c . $port->read(2);
+ warn "FIXED ",as_hex($r_len);
+ }
+
wait_device;
my $len = ord( substr($r_len,2,1) );