/[RFID]/cpr-m02.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 /cpr-m02.pl

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

revision 87 by dpavlin, Fri Jul 16 13:05:24 2010 UTC revision 89 by dpavlin, Fri Jul 16 13:50:52 2010 UTC
# Line 339  sub cpr_read { Line 339  sub cpr_read {
339          my $hex_uid = as_hex($uid);          my $hex_uid = as_hex($uid);
340    
341          cpr( "FF  B0 23  01  $hex_uid 00 04", "Read Multiple Blocks $hex_uid" );          cpr( "FF  B0 23  01  $hex_uid 00 04", "Read Multiple Blocks $hex_uid" );
342  #       cpr( "FF  B0 2B  01  $hex_uid", "Get System Information $hex_uid" );          cpr( "FF  B0 2B  01  $hex_uid", "Get System Information $hex_uid", sub {
343                    my $data = shift;
344    
345                    warn "# data ",as_hex($data);
346    
347                    my $DSFID    = substr($data,5-2,1);
348                    my $UID      = substr($data,6-2,8);
349                    my $AFI      = substr($data,14-2,1);
350                    my $MEM_SIZE = substr($data,15-2,2);
351                    my $IC_REF   = substr($data,17-2,1);
352    
353                    warn "# split ",as_hex( $DSFID, $UID, $AFI, $MEM_SIZE, $IC_REF );
354    
355            });
356  }  }
357    
358    
# Line 349  while(1) { Line 362  while(1) {
362    
363  cpr( 'FF  B0  01 00', 'ISO - Inventory', sub {  cpr( 'FF  B0  01 00', 'ISO - Inventory', sub {
364          my $data = shift;          my $data = shift;
365            if (length($data) < 5 + 2 ) {
366                    warn "# no tags in range\n";
367                    return;
368            }
369          my $data_sets = ord(substr($data,3,1));          my $data_sets = ord(substr($data,3,1));
370          $data = substr($data,4);          $data = substr($data,4);
371          foreach ( 1 .. $data_sets ) {          foreach ( 1 .. $data_sets ) {

Legend:
Removed from v.87  
changed lines
  Added in v.89

  ViewVC Help
Powered by ViewVC 1.1.26