From e5c732e18125a4f16ef98a50143fc7ffad7d66e7 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Tue, 28 Jan 2014 10:45:05 +0100 Subject: [PATCH] Fix internal current target when using nfc_initiator_poll_target() (Thanks to Bjoern Kinscher) Fixes Issue 265. --- libnfc/chips/pn53x.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 0631322..8331662 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -1209,10 +1209,16 @@ pn53x_initiator_poll_target(struct nfc_device *pnd, switch (res) { case 1: *pnt = ntTargets[0]; + if (pn53x_current_target_new(pnd, pnt) == NULL) { + return pnd->last_error = NFC_ESOFT; + } return res; break; case 2: *pnt = ntTargets[1]; // We keep the selected one + if (pn53x_current_target_new(pnd, pnt) == NULL) { + return pnd->last_error = NFC_ESOFT; + } return res; break; default: