summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2006-12-01 13:29:00 +0000
committerlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2006-12-01 13:29:00 +0000
commitf0a3a3f8c4f39dfacf2d370bd23b27cd5b3358bf (patch)
tree9980bd638b3df4f71088adc3f191dd4cbc392de5 /utils
parent8b39e78b9d52a6c87ef0a4ab8402d7188f94e788 (diff)
- add size detection for mifare classic / ultralight
- add possibility to obtain ATQA via getopt - fix default -EINVAL return of tcl getopt git-svn-id: https://svn.gnumonks.org/trunk/librfid@1930 e0336214-984f-0b4b-a45f-81c69e1f0ede
Diffstat (limited to 'utils')
-rw-r--r--utils/librfid-tool.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/librfid-tool.c b/utils/librfid-tool.c
index 37efadc..be6e843 100644
--- a/utils/librfid-tool.c
+++ b/utils/librfid-tool.c
@@ -260,6 +260,9 @@ static int l2_by_name(const char *name)
static void do_scan(void)
{
int rc;
+ unsigned int size;
+ unsigned int size_len = sizeof(size);
+
printf("scanning for RFID token...\n");
rc = rfid_scan(rh, &l2h, &ph);
if (rc >= 2) {
@@ -272,6 +275,10 @@ static void do_scan(void)
}
if (rc >= 3) {
printf("Protocol success (%s)\n", rfid_protocol_name(ph));
+
+ if (rfid_protocol_getopt(ph, RFID_OPT_PROTO_SIZE,
+ &size, &size_len) == 0)
+ printf("Size: %u bytes\n", size);
}
}
personal git repositories of Harald Welte. Your mileage may vary