From 036d2956f493367febf85b25ae55c17e83a772a6 Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Fri, 3 Sep 2010 16:13:46 +0000 Subject: [PATCH] Update nfc_initiator_transceive_bytes() vs. nfc_initiator_transceive_dep_bytes(). nfc_initiator_transceive_dep_bytes() was removed, and nfc_initiator_transceive_bytes() is now configured to behave like the one or the other of the original functions. For details, see: http://code.google.com/p/libnfc/source/detail?r=592 --- libfreefare/mifare_classic.c | 2 +- libfreefare/mifare_desfire.c | 2 ++ libfreefare/mifare_ultralight.c | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libfreefare/mifare_classic.c b/libfreefare/mifare_classic.c index 3bf1a9c..ffb7853 100644 --- a/libfreefare/mifare_classic.c +++ b/libfreefare/mifare_classic.c @@ -83,7 +83,7 @@ do { \ errno = 0; \ DEBUG_XFER (msg, __##msg##_n, "===> "); \ - if (!(nfc_initiator_transceive_dep_bytes (tag->device, msg, __##msg##_n, res, &__##res##_n))) { \ + if (!(nfc_initiator_transceive_bytes (tag->device, msg, __##msg##_n, res, &__##res##_n))) { \ nfc_perror (tag->device, __FUNCTION__); \ if (disconnect) \ tag->active = false; \ diff --git a/libfreefare/mifare_desfire.c b/libfreefare/mifare_desfire.c index 426482c..9c33035 100644 --- a/libfreefare/mifare_desfire.c +++ b/libfreefare/mifare_desfire.c @@ -277,6 +277,7 @@ mifare_desfire_connect (MifareTag tag) errno = EIO; return -1; } + nfc_configure (tag->device, NDO_EASY_FRAMING, false); return 0; } @@ -295,6 +296,7 @@ mifare_desfire_disconnect (MifareTag tag) if (nfc_initiator_deselect_target (tag->device)) { tag->active = 0; } + nfc_configure (tag->device, NDO_EASY_FRAMING, true); return 0; } diff --git a/libfreefare/mifare_ultralight.c b/libfreefare/mifare_ultralight.c index f045716..ec34273 100644 --- a/libfreefare/mifare_ultralight.c +++ b/libfreefare/mifare_ultralight.c @@ -51,7 +51,7 @@ do { \ errno = 0; \ DEBUG_XFER (msg, __##msg##_n, "===> "); \ - if (!(nfc_initiator_transceive_dep_bytes (tag->device, msg, __##msg##_n, res, &__##res##_n))) { \ + if (!(nfc_initiator_transceive_bytes (tag->device, msg, __##msg##_n, res, &__##res##_n))) { \ return errno = EIO, -1; \ } \ DEBUG_XFER (res, __##res##_n, "<=== "); \ @@ -187,7 +187,7 @@ mifare_ultralight_write (MifareTag tag, const MifareUltralightPageNumber page, c memcpy (cmd + 2, data, sizeof (MifareUltralightPage)); size_t n; - if (!(nfc_initiator_transceive_dep_bytes (tag->device, cmd, sizeof (cmd), NULL, &n))) { + if (!(nfc_initiator_transceive_bytes (tag->device, cmd, sizeof (cmd), NULL, &n))) { errno = EIO; return -1; }