Add nfc_register_driver. Issue 137.

The nfc_register_driver allows users of the library to write their
own device drivers without needing to resort to hacking libnfc itself.
This commit is contained in:
lego 2013-02-01 14:40:40 +02:00
parent 8127a2ca63
commit 225094e2c8
4 changed files with 98 additions and 56 deletions

View file

@ -42,6 +42,11 @@ typedef struct nfc_context nfc_context;
*/
typedef struct nfc_device nfc_device;
/**
* NFC device driver
*/
typedef struct nfc_driver nfc_driver;
/**
* Connection string
*/

View file

@ -79,6 +79,7 @@ extern "C" {
/* Library initialization/deinitialization */
NFC_EXPORT void nfc_init(nfc_context **context) ATTRIBUTE_NONNULL(1);
NFC_EXPORT void nfc_exit(nfc_context *context) ATTRIBUTE_NONNULL(1);
NFC_EXPORT int nfc_register_driver(const nfc_driver *driver);
/* NFC Device/Hardware manipulation */
NFC_EXPORT nfc_device *nfc_open(nfc_context *context, const nfc_connstring connstring) ATTRIBUTE_NONNULL(1);