mirror of
https://github.com/brmlab/brmdoor_libnfc.git
synced 2025-06-10 09:24:43 +02:00
Explicit unload() 'destructor'
This commit is contained in:
parent
3717cb2563
commit
bbec77f248
3 changed files with 31 additions and 4 deletions
|
@ -71,12 +71,18 @@ public:
|
|||
/** Open device explicitly. May be useful after explicit close */
|
||||
void open() throw(NFCError);
|
||||
|
||||
/** Returns true iff device was opened */
|
||||
bool opened() const {return _opened;}
|
||||
/** Returns true iff device was opened and not unloaded. */
|
||||
bool opened() const {return _opened && !_unloaded;}
|
||||
|
||||
/** Close reader. You need to reopen before reading again */
|
||||
void close();
|
||||
|
||||
/**
|
||||
* Unload all structures, close device. It's kind of explicit destructor
|
||||
* since we can't be sure the destructor will be called in Python.
|
||||
*/
|
||||
void unload();
|
||||
|
||||
/**
|
||||
* Specifies the number of polling (0x01 – 0xFE: 1 up to 254 polling, 0xFF:
|
||||
* Endless polling)
|
||||
|
@ -106,6 +112,9 @@ protected:
|
|||
/** Whether device has been successfully opened */
|
||||
bool _opened;
|
||||
|
||||
/** Whether device and its internal libnfc structures have been unloaded */
|
||||
bool _unloaded;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue