X-Git-Url: http://git.rot13.org/?p=Biblio-RFID.git;a=blobdiff_plain;f=lib%2FRFID%2FBiblio%2FReader%2F3M810.pm;h=b3848c450126c708b20f0e3e5a4072f9cbf3c074;hp=66a21b1a1e8a82e5fa243749a24e2494404adaa1;hb=ebc4760751b42a6287557d6e0b3946f49e2f6faa;hpb=45d30dcd99f6708c14d399b4ae2b2b207ff156bd diff --git a/lib/RFID/Biblio/Reader/3M810.pm b/lib/RFID/Biblio/Reader/3M810.pm index 66a21b1..b3848c4 100644 --- a/lib/RFID/Biblio/Reader/3M810.pm +++ b/lib/RFID/Biblio/Reader/3M810.pm @@ -103,7 +103,7 @@ sub cmd { $bytes = "\xD6" . $bytes . $checksum; } - warn ">> ", as_hex( $bytes ), "\t\t[$description]\n"; + warn ">> ", as_hex( $bytes ), "\t\t[$description]\n" if $debug; $port->write( $bytes ); my $r_len = $port->read(3); @@ -118,7 +118,7 @@ sub cmd { warn "<< ", as_hex($r_len,$data), ' | ', substr($data,-2,2) eq checksum(substr($r_len,1).substr($data,0,-2)) ? 'OK' : 'ERROR', - " $len bytes\n"; + " $len bytes\n" if $debug; $coderef->( $data ) if $coderef; @@ -177,7 +177,7 @@ sub _matched { my $b = hex2bytes $hex; my $l = length($b); if ( substr($data,0,$l) eq $b ) { - warn "_matched $hex [$l] in ",as_hex($data); + warn "_matched $hex [$l] in ",as_hex($data) if $debug; return substr($data,$l); } }