mirror of
https://github.com/brmlab/brmdoor_libnfc.git
synced 2025-06-08 16:36:25 +02:00
Check if device is opened before scanning
This commit is contained in:
parent
7de37d5822
commit
e11b8aaabf
1 changed files with 4 additions and 0 deletions
|
@ -65,6 +65,10 @@ std::string NFCDevice::scanUID() throw(NFCError)
|
||||||
int res;
|
int res;
|
||||||
nfc_target nt;
|
nfc_target nt;
|
||||||
|
|
||||||
|
if (!opened()) {
|
||||||
|
throw NFCError("NFC device not opened");
|
||||||
|
}
|
||||||
|
|
||||||
res = nfc_initiator_poll_target(_nfcDevice, _modulations, _modulationsLen, pollNr, pollPeriod, &nt);
|
res = nfc_initiator_poll_target(_nfcDevice, _modulations, _modulationsLen, pollNr, pollPeriod, &nt);
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
throw NFCError("NFC polling error");
|
throw NFCError("NFC polling error");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue