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:
e11f5b0
)
on error try to reset usb
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 4 Feb 2014 15:55:51 +0000
(16:55 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 4 Feb 2014 15:55:51 +0000
(16:55 +0100)
lib/Biblio/RFID/Reader/librfid.pm
patch
|
blob
|
history
diff --git
a/lib/Biblio/RFID/Reader/librfid.pm
b/lib/Biblio/RFID/Reader/librfid.pm
index
9fa3387
..
72ea674
100644
(file)
--- a/
lib/Biblio/RFID/Reader/librfid.pm
+++ b/
lib/Biblio/RFID/Reader/librfid.pm
@@
-65,6
+65,17
@@
sub _grep_tool {
$coderef->( $sid, $iso );
}
+ close($s);
+ if ( $? >> 8 ) {
+ my $lsusb = `lsusb -d 076b:`;
+ if ( $lsusb =~ m/\S+\s+(\d+)\s+\S+\s+(\d+)/ ) {
+ my $cmd = "usbreset /dev/bus/usb/$1/$2";
+ warn "# $cmd\n";
+ system $cmd;
+ } else {
+ warn "can't reset device $lsusb";
+ }
+ }
}