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);
my $debug = 0;
-use base 'Exporter';
-our @EXPORT = qw( hex2bytes as_hex );
-
=head1 SYNOPSIS
=head2 hex2bytes
+ my $bytes = hex2bytes($hex);
+
=cut
sub hex2bytes {
return $bytes;
}
+=head2 as_hex
+
+ print as_hex( $bytes );
+
+=cut
+
sub as_hex {
my @out;
foreach my $str ( @_ ) {
return join(' | ', @out);
}
+=head2 hex_tag
+
+ print hex_tag $bytes;
+
+=cut
+
+sub hex_tag { uc(unpack('H16', shift)) }
+
=head1 AUTHOR