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:
17ba880
)
fix warnings
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 18 Aug 2010 11:44:26 +0000
(13:44 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 18 Aug 2010 11:44:26 +0000
(13:44 +0200)
when draining output from rfid reader
lib/RFID/Biblio/Reader/3M810.pm
patch
|
blob
|
history
diff --git
a/lib/RFID/Biblio/Reader/3M810.pm
b/lib/RFID/Biblio/Reader/3M810.pm
index
b3848c4
..
a0d127c
100644
(file)
--- a/
lib/RFID/Biblio/Reader/3M810.pm
+++ b/
lib/RFID/Biblio/Reader/3M810.pm
@@
-56,8
+56,10
@@
sub init {
# drain on startup
my ( $count, $str ) = $port->read(3);
- my $data = $port->read( ord(substr($str,2,1)) );
- warn "drain ",as_hex( $str, $data ),"\n";
+ if ( $count ) {
+ my $data = $port->read( ord(substr($str,2,1)) );
+ warn "drain ",as_hex( $str, $data ),"\n";
+ }
$port->read_char_time(100); # 0.1 s char timeout
$port->read_const_time(500); # 0.5 s read timeout