#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"
int rc;
unsigned int size;
unsigned int size_len = sizeof(size);
+ char *data;
+ unsigned int data_len;
if (first) {
unsigned int opt;
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;
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));
}
/*
{
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");
}
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':