#!/usr/bin/perl -w # This Script is written for the ACG Card-Reader to dump RFID Tag # metadata and content # Copyright by L. Grunwald DN-Systems GmbH 2004 use POSIX; if (@ARGV < 1) { print "Dump contents of an RFID\n"; print "Copyright 2004 by L. Grunwald DN-Systems GmbH\n"; print "usage: rfdump.pl tty \n"; print "e.g. rfdump.pl /dev/ttyS2\n"; exit 1; } my $reader = $ARGV[0]; open RFH,"+<".$reader or die "canīt open $reader"; print RFH "x"; $tagtype=""; $tagid=""; while () { print RFH "s"; chomp; if ((length $_)> 10) { $tagid=$_; &identtag; } $tagid=""; } sub identtag{ print "$tagid "; $tagtype=(substr($tagid,0,1 )); if ($tagtype eq 'V') {print "ISO 15693 "; $mfid=(substr($tagid,3,2)); print "MFID: ".$mfid." "; if ($mfid == 0x02) {print "ST Microelectronics ";} elsif ($mfid == 0x04) {print "Phillips Semiconductors ";} elsif ($mfid == 0x05) {print "Infinion Technologies AG ";} elsif ($mfid == 0x07) {print "Texas Instruments ";} elsif ($mfid == 0x16 ) {print "EM Microelectronic-Marin SA ";} else {print "unknown ";} print "Serial: ".(substr($tagid,,5))."\n";} if ($tagtype eq 'T') {print "Tagit "; print "MFID: Texas Instruments "; print "Serial: ".$tagid."\n";} if ($tagtype eq 'I') {print "ICode "; print "MFID: Phillips Semiconductors "; print "Serial: ".$tagid."\n"; print RFH "m".$tagid; } if ($tagtype eq 'M') {print "Mifare Ultralight or ISO 14443 Type A "; print "MFID: ".$mfid." "; print "Serial: ".$tagid."\n";} if ($tagtype eq 'S') {print "SR176 "; print "MFID: STM"; print "Serial: ".$tagid."\n";} if ($tagtype eq 'Z') {print "ISO 14443 Type B "; print "MFID: ".$mfid." "; print "Serial: ".$tagid."\n";} }