1 00 00 00 00
2 00 00 00 00
+=head1 Security
+
+AFI byte on RFID tag is used for security.
+
+In my case, we have RFID door which can only read AFI bytes from tag and issue
+alarm sound or ignore it depending on value of byte.
+
+=over 8
+
+=item 0xD7 214
+
+secured item (door will beep)
+
+=item 0xDA 218
+
+unsecured (door will ignore it)
+
+=back
+
+
=head1 METHODS
-=head2 decode_tag
+=head2 to_hash
my $hash = RFID::Biblio::Decode::RFID501->to_hash( $bytes );
my $hash = RFID::Biblio::Decode::RFID501->to_hash( [ 'blk1', 'blk2', ... , 'blk7' ] );
+=head2 from_hash
+
+ my $blocks = RFID::Biblio::Decode::RFID->from_hash({ content => "1301234567" });
+
+=head2 blank_3m
+
+=head2 blank
+
+ my $blocks = RFID::Biblio::Decode::RFID->blank;
+
=cut
my $item_type = {
sub from_hash {
my ( $self, $hash ) = @_;
+ warn "## from_hash ",dump($hash);
+
return pack('C4Z16Nl>l',
0x04,
( $hash->{set} << 4 ) | ( $hash->{total} & 0x0f ),
);
}
+sub blank_3m {
+ return ( "\x55" x ( 6 * 4 ) ) . ( "\x00" x 4 );
+}
+
+sub blank {
+ return "\x00" x ( 4 * 3 );
+}
+
1;