mirror of
https://github.com/brmlab/brmdoor_libnfc.git
synced 2025-08-02 18:33:37 +02:00
Fix GIL when waiting for tag
This commit is contained in:
parent
8a35b8b884
commit
1c8281f428
2 changed files with 6 additions and 1 deletions
|
@ -2,6 +2,8 @@
|
|||
#include <cassert>
|
||||
#include <memory>
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
#include <nfc/nfc.h>
|
||||
#include <nfc/nfc-types.h>
|
||||
#include <freefare.h>
|
||||
|
@ -102,7 +104,10 @@ std::string NFCDevice::scanUID() throw(NFCError)
|
|||
throw NFCError("NFC device not opened");
|
||||
}
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
res = nfc_initiator_poll_target(_nfcDevice, _modulations, _modulationsLen, pollNr, pollPeriod, &nt);
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
if (res < 0) {
|
||||
throw NFCError("NFC polling error");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue