/[RFID]/3m-810.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /3m-810.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 29 by dpavlin, Mon Apr 6 13:10:40 2009 UTC revision 30 by dpavlin, Mon Apr 6 13:18:55 2009 UTC
# Line 258  sub write_tag { Line 258  sub write_tag {
258    
259          my $data = read_file( $path );          my $data = read_file( $path );
260    
261          print "write_tag $tag = $data\n";          $data = substr($data,0,16);
262    
263            my $hex_data = unpack('H*', $data) . ' 00' x ( 16 - length($data) );
264    
265            print "write_tag $tag = $data ",dump( $hex_data );
266    
267          cmd(          cmd(
268                  "D6 00  26  04  $tag  00 06 00  04 11 00 01  61 61 61 61  62 62 62 62  63 63 63 63  64 64 64 64  00 00 00 00  FD3B", "write $tag",                  "D6 00  26  04  $tag  00 06 00  04 11 00 01  $hex_data 00 00 00 00  FD3B", "write $tag",
269                  "D6 00  0D  04 00  $tag  06  AFB1", sub { assert() },                  "D6 00  0D  04 00  $tag  06  AFB1", sub { assert() },
270          ) foreach ( 1 .. 3 ); # XXX 3M software does this three times!          ) foreach ( 1 .. 3 ); # XXX 3M software does this three times!
271    
# Line 271  sub write_tag { Line 275  sub write_tag {
275          rename $path, $to;          rename $path, $to;
276          print ">> $to\n";          print ">> $to\n";
277    
278            delete $tags_data->{$tag};      # force re-read of tag
279  }  }
280    
281  exit;  exit;

Legend:
Removed from v.29  
changed lines
  Added in v.30

  ViewVC Help
Powered by ViewVC 1.1.26