X-Git-Url: http://git.rot13.org/?p=Biblio-RFID.git;a=blobdiff_plain;f=lib%2FRFID%2FSerial.pm;h=9c32a6d46a6020ee5081cdb9eb430082e20497b7;hp=e30f3639e9edb95d3fb3bca54a92b4535564f218;hb=7832e5544c3d3e1535e3f019c939947265a0a7ae;hpb=b008963cecfd48e87939e7bff97ef1265988bf4d diff --git a/lib/RFID/Serial.pm b/lib/RFID/Serial.pm index e30f363..9c32a6d 100644 --- a/lib/RFID/Serial.pm +++ b/lib/RFID/Serial.pm @@ -3,6 +3,9 @@ package RFID::Serial; use warnings; use strict; +use base 'Exporter'; +our @EXPORT = qw( hex2bytes as_hex hex_tag ); + use Device::SerialPort qw(:STAT); use Data::Dump qw(dump); @@ -16,9 +19,6 @@ our $VERSION = '0.01'; my $debug = 0; -use base 'Exporter'; -our @EXPORT = qw( hex2bytes as_hex ); - =head1 SYNOPSIS @@ -111,6 +111,14 @@ sub as_hex { return join(' | ', @out); } +=head2 hex_tag + + print hex_tag $bytes; + +=cut + +sub hex_tag { uc(unpack('H16', shift)) } + =head1 AUTHOR