From d1b0e93e8e6c57b6b4d7af6146d95ef840b55413 Mon Sep 17 00:00:00 2001 From: Audrey Diacre Date: Wed, 18 Jan 2012 09:53:45 +0000 Subject: [PATCH] add initialization and deinitialization. --- include/nfc/nfc.h | 4 ++++ libnfc/nfc.c | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/include/nfc/nfc.h b/include/nfc/nfc.h index cdbf404..63367ef 100644 --- a/include/nfc/nfc.h +++ b/include/nfc/nfc.h @@ -62,6 +62,10 @@ extern "C" { # endif // __cplusplus +/* Library initialization/deinitialization */ + NFC_EXPORT void nfc_init(); + NFC_EXPORT void nfc_exit(); + /* NFC Device/Hardware manipulation */ NFC_EXPORT bool nfc_get_default_device (nfc_connstring *connstring); NFC_EXPORT nfc_device *nfc_open (const nfc_connstring connstring); diff --git a/libnfc/nfc.c b/libnfc/nfc.c index 6abc614..5baf7dd 100644 --- a/libnfc/nfc.c +++ b/libnfc/nfc.c @@ -61,6 +61,26 @@ const struct nfc_driver *nfc_drivers[] = { NULL }; +/** + * @brief Initialize libnfc. + * + */ +void +nfc_init() +{ + log_init (); +} + +/** + * @brief Deinitialize libnfc. + * + */ +void +nfc_exit() +{ + log_fini (); +} + /** * @brief Get the defaut NFC device * @param connstring \a nfc_connstring pointer where the default connection string will be stored