1fbf05c8e6f7043e3799981eff27a85fcad9a243
[Biblio-RFID.git] / t / 20-CPR-M02.t
1 #!/usr/bin/perl
2
3 use Test::More;
4 use Data::Dump qw(dump);
5
6 use lib 'lib';
7
8 BEGIN {
9         use_ok( 'RFID::Biblio::Reader::CPRM02' );
10 }
11
12 ok( my $o = RFID::Biblio::Reader::CPRM02->new( device => '/dev/ttyUSB0' ), 'new' );
13
14 ok( my @tags = $o->inventory, 'inventory' );
15
16 foreach my $tag ( @tags ) {
17
18         ok( my $blocks = $o->read_blocks( $tag ), "read_blocks $tag" );
19
20         my $pattern = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F";
21         ok( $o->write_blocks( $tag, $pattern ), "write_blocks $tag" );
22         
23         $pattern = "0123456789ABCDEF.....";
24         ok( $o->write_blocks( $tag, $pattern ), "write_blocks $tag" );
25
26 #       ok( $o->write_blocks( $tag, $blocks->{$tag} ), "write_blocks $tag" );
27
28 }
29
30 done_testing;