summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorploetz <ploetz@e0336214-984f-0b4b-a45f-81c69e1f0ede>2008-02-02 17:13:59 +0000
committerploetz <ploetz@e0336214-984f-0b4b-a45f-81c69e1f0ede>2008-02-02 17:13:59 +0000
commitdb516767b83404ba51985eee39a8d24ab6e7ecb0 (patch)
tree8e212d16138fd53ff5352b372fe385a8981831ad
parentda4aa962e17978a70bf1cf4fc3d1b46b620bc3bf (diff)
Make librfid-tool print out the ATS in case of success with a T=CL card
git-svn-id: https://svn.gnumonks.org/trunk/librfid@2065 e0336214-984f-0b4b-a45f-81c69e1f0ede
-rw-r--r--utils/librfid-tool.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/utils/librfid-tool.c b/utils/librfid-tool.c
index 449cb4c..eae9025 100644
--- a/utils/librfid-tool.c
+++ b/utils/librfid-tool.c
@@ -42,6 +42,7 @@
#include <librfid/rfid_protocol_mifare_ul.h>
#include <librfid/rfid_protocol_tagit.h>
#include <librfid/rfid_protocol_icode.h>
+#include <librfid/rfid_protocol_tcl.h>
#include "librfid-tool.h"
@@ -332,6 +333,8 @@ static int do_scan(int first)
int rc;
unsigned int size;
unsigned int size_len = sizeof(size);
+ char *data;
+ unsigned int data_len;
if (first) {
unsigned int opt;
@@ -363,6 +366,20 @@ static int do_scan(int first)
if (rfid_protocol_getopt(ph, RFID_OPT_PROTO_SIZE,
&size, &size_len) == 0)
printf("Size: %u bytes\n", size);
+ size_len = sizeof(size);
+ size = 0;
+ if (rfid_protocol_getopt(ph, RFID_OPT_P_TCL_ATS_LEN,
+ &size, &size_len) == 0) {
+ data_len = size + 1;
+ data = malloc(data_len);
+ if (data) {
+ if (rfid_protocol_getopt(ph, RFID_OPT_P_TCL_ATS,
+ data, &data_len) == 0) {
+ printf("Got ATS of %u bytes: %s\n", size,
+ hexdump(data, data_len));
+ }
+ }
+ }
}
return rc;
personal git repositories of Harald Welte. Your mileage may vary