diff options
author | laforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede> | 2008-02-08 15:19:37 +0000 |
---|---|---|
committer | laforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede> | 2008-02-08 15:19:37 +0000 |
commit | 74b93b30bc667829341e5d0cfcab36992db13451 (patch) | |
tree | 27c54df382a1bee86c28303a2d8a6847c9fdaa63 /utils | |
parent | 3b0c0650587bb575d73b3622a5631e2e4fc477e1 (diff) |
add support for setting layer2 while doing scanning (Bjoern Riemer)
git-svn-id: https://svn.gnumonks.org/trunk/librfid@2083 e0336214-984f-0b4b-a45f-81c69e1f0ede
Diffstat (limited to 'utils')
-rw-r--r-- | utils/librfid-tool.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/utils/librfid-tool.c b/utils/librfid-tool.c index eae9025..a336ded 100644 --- a/utils/librfid-tool.c +++ b/utils/librfid-tool.c @@ -466,7 +466,7 @@ static void do_enum(int layer2) if (l2h) { uid_len = sizeof(uid_buf); rfid_layer2_getopt(l2h, RFID_OPT_LAYER2_UID, &uid_buf, &uid_len); - printf("Layer 2 success (%s)[%d]: %s\n", rfid_layer2_name(l2h), uid_len, hexdump(uid_buf, uid_len)); + printf("Layer 2 success (%s)[%d]: '%s'\n", rfid_layer2_name(l2h), uid_len, hexdump(uid_buf, uid_len)); } /* @@ -570,10 +570,10 @@ static void help(void) { printf( " -s --scan scan until first RFID tag is found\n" " -S --scan-loop endless scanning loop\n" - " -p --protocol {tcl,mifare-ultralight,mifare-classic,tagit}\n" - " -l --layer2 {iso14443a,iso14443b,iso15693}\n" + " -p --protocol {tcl,mifare-ultralight,mifare-classic,tagit,icode}\n" + " -l --layer2 {iso14443a,iso14443b,iso15693,icode1}\n" " -d --dump dump rc632 registers\n" - " -e --enum enumerate all tag's in field (iso14443a)\n" + " -e --enum enumerate all tag's in field \n" " -h --help\n"); } @@ -606,19 +606,23 @@ int main(int argc, char **argv) case 'e': if (reader_init() < 0) exit(1); - layer2 = RFID_LAYER2_ISO14443A; + if (layer2==0) + layer2 = RFID_LAYER2_ISO14443A; do_enum(layer2); + rfid_reader_close(rh); exit(0); break; case 'd': if (reader_init() < 0) exit(1); do_regdump(); + rfid_reader_close(rh); break; case 's': if (reader_init() < 0) exit(1); do_scan(0); + rfid_reader_close(rh); exit(0); break; case 'S': |