mirror of
https://github.com/brmlab/brmdoor_libnfc.git
synced 2025-08-03 10:53:37 +02:00
Delesect target after UID scan
This commit is contained in:
parent
c1d400bad6
commit
3717cb2563
1 changed files with 6 additions and 2 deletions
|
@ -64,6 +64,7 @@ std::string NFCDevice::scanUID() throw(NFCError)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
nfc_target nt;
|
nfc_target nt;
|
||||||
|
string uid;
|
||||||
|
|
||||||
if (!opened()) {
|
if (!opened()) {
|
||||||
throw NFCError("NFC device not 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
|
// we are not interested in non-ISO-14443A cards
|
||||||
if (nt.nm.nmt != NMT_ISO14443A) {
|
if (nt.nm.nmt != NMT_ISO14443A) {
|
||||||
return "";
|
return string();
|
||||||
}
|
}
|
||||||
|
|
||||||
const nfc_iso14443a_info& nai = nt.nti.nai;
|
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] = {
|
const nfc_modulation NFCDevice::_modulations[5] = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue