3 use Test::More; # tests => 3;
4 use Data::Dump qw(dump);
9 use_ok( 'Biblio::RFID::Reader::3M810' );
12 ok( my $o = Biblio::RFID::Reader::3M810->new( device => '/dev/ttyUSB0' ), 'new' );
14 my @tags = $o->inventory;
15 diag 'inventory ',join(' ',@tags);
19 foreach my $tag ( @tags ) {
21 ok( my $blocks = $o->read_blocks( $tag ), "read_blocks $tag" );
23 ok( my $afi = $o->read_afi( $tag ), "read_afi $tag" );
25 ok( $o->write_blocks( $tag, $blocks->{$tag} ), "write_blocks $tag" );
29 ok( $o->write_afi( $tag, $new_afi ), sprintf( "write_afi %s %x", $tag, $new_afi ) );
31 cmp_ok( $o->read_afi( $tag ), 'eq', $new_afi, 'AFI check' );
33 ok( $o->write_afi( $tag, $afi ), sprintf( "write_afi %s %x", $tag, $afi ) );