my $hash = RFID::Serial::Decode::RFID501->to_hash( $bytes );
+ my $hash = RFID::Serial::Decode::RFID501->to_hash( [ 'blk1', 'blk2', ... , 'blk7' ] );
+
=cut
my $item_type = {
return unless $data;
+ $data = join('', @$data) if ref $data eq 'ARRAY';
+
+ warn "## to_hash $data\n";
+
my ( $u1, $set_item, $u2, $type, $content, $br_lib, $custom ) = unpack('C4Z16Nl>',$data);
my $hash = {
u1 => $u1, # FIXME
ok( my $hash = RFID::Serial::Decode::RFID501->to_hash( "\x04\x11\x00\x00200912310123\x00\x00\x00\x00" ), 'decode_tag' );
diag dump $hash;
-ok( my $hash = RFID::Serial::Decode::RFID501->to_hash( "\x04\x11\x00\x011301234567\x00\x00\x00\x00\x00\x00" ), 'decode_tag' );
+ok( $hash = RFID::Serial::Decode::RFID501->to_hash( "\x04\x11\x00\x011301234567\x00\x00\x00\x00\x00\x00" ), 'decode_tag' );
+diag dump $hash;
+
+my $tag = [
+ "\4\21\0\0",
+ 2009,
+ "0101",
+ "0123",
+ "\0\0\0\0",
+ "\xFF\xFF\xFF\xFF",
+ "\x7F\xFF\xFF\xFF",
+ "\0\0\0\0",
+];
+
+ok( $hash = RFID::Serial::Decode::RFID501->to_hash( $tag ), 'decode_tag' );
diag dump $hash;