X-Git-Url: http://git.rot13.org/?p=librfid;a=blobdiff_plain;f=utils%2Fcommon.c;h=ba39710b3d94ce15f18c1e46643fac1bc7250992;hp=12c3bd492771841681acc295baaac36fbc6024e9;hb=72e21ac4f2e8c9352797d32dd5d19d0d3c2736c7;hpb=714b632cc57bcb867bac02947f1a33dd198519e0 diff --git a/utils/common.c b/utils/common.c index 12c3bd4..ba39710 100644 --- a/utils/common.c +++ b/utils/common.c @@ -43,6 +43,8 @@ static char parse_hexdigit(const char hexdigit) return hexdigit - '0'; if (hexdigit <= 'f' && hexdigit >= 'a') return 10 + (hexdigit - 'a'); + if (hexdigit <= 'F' && hexdigit >= 'A') + return 10 + (hexdigit - 'A'); return 0; } @@ -72,13 +74,13 @@ struct rfid_protocol_handle *ph; int reader_init(void) { - printf("opening reader handle\n"); - rh = rfid_reader_open(NULL, RFID_READER_CM5121); + printf("opening reader handle OpenPCD, CM5x21\n"); + rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); if (!rh) { - fprintf(stderr, "No Omnikey Cardman 5121 found\n"); - rh = rfid_reader_open(NULL, RFID_READER_OPENPCD); + fprintf(stderr, "No OpenPCD found\n"); + rh = rfid_reader_open(NULL, RFID_READER_CM5121); if (!rh) { - fprintf(stderr, "No OpenPCD found either\n"); + fprintf(stderr, "No Omnikey Cardman 5x21 found\n"); return -1; } } @@ -92,11 +94,11 @@ int l2_init(int layer2) printf("opening layer2 handle\n"); l2h = rfid_layer2_init(rh, layer2); if (!l2h) { - fprintf(stderr, "error during iso14443a_init\n"); + fprintf(stderr, "error during layer2(%d)_init (0=14a,1=14b,3=15)\n",layer2); return -1; } - printf("running layer2 anticol\n"); + printf("running layer2 anticol(_open)\n"); rc = rfid_layer2_open(l2h); if (rc < 0) { fprintf(stderr, "error during layer2_open\n");