From 3717cb2563242eb88e098272ac0a262c8d4e63ff Mon Sep 17 00:00:00 2001 From: Ondrej Mikle Date: Sat, 19 Jul 2014 19:55:08 +0200 Subject: [PATCH] Delesect target after UID scan --- brmdoor_nfc.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/brmdoor_nfc.cpp b/brmdoor_nfc.cpp index 04ca79b..2b38486 100644 --- a/brmdoor_nfc.cpp +++ b/brmdoor_nfc.cpp @@ -64,6 +64,7 @@ std::string NFCDevice::scanUID() throw(NFCError) { int res; nfc_target nt; + string uid; if (!opened()) { throw NFCError("NFC device not opened"); @@ -76,12 +77,15 @@ std::string NFCDevice::scanUID() throw(NFCError) // we are not interested in non-ISO-14443A cards if (nt.nm.nmt != NMT_ISO14443A) { - return ""; + return string(); } const nfc_iso14443a_info& nai = nt.nti.nai; + uid = string((const char*)nai.abtUid, nai.szUidLen); - return string((const char*)nai.abtUid, nai.szUidLen); + nfc_initiator_deselect_target(_nfcDevice); + + return uid; } const nfc_modulation NFCDevice::_modulations[5] = {