From 51854f508ce0b352560f4fea93db0d98d93fc891 Mon Sep 17 00:00:00 2001 From: Adam Laurie Date: Mon, 14 Dec 2009 19:18:29 +0000 Subject: [PATCH] add nfc_device_name() routine to allow external languages to extract device name --- src/include/nfc/nfc.h | 8 ++++++++ src/lib/nfc.c | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/include/nfc/nfc.h b/src/include/nfc/nfc.h index 6159d33..6563f47 100644 --- a/src/include/nfc/nfc.h +++ b/src/include/nfc/nfc.h @@ -251,6 +251,14 @@ bool nfc_target_send_dep_bytes(const nfc_device_t* pnd, const byte_t* pbtTx, con */ const char* nfc_version(void); +/** + * @fn const char*nfc_device_name(nfc_device_t* pnd) + * @brief Returns the device name + * @return Returns a string with the device name + */ + +const char* nfc_device_name(nfc_device_t* pnd); + #ifdef __cplusplus } #endif // __cplusplus diff --git a/src/lib/nfc.c b/src/lib/nfc.c index 93a22a5..4c9c74c 100644 --- a/src/lib/nfc.c +++ b/src/lib/nfc.c @@ -852,4 +852,11 @@ const char* nfc_version(void) #endif // SVN_REVISION } +// functions to provide external hooks to python (or other languages) - that cannot +// handle structures in return values when used as a DLL +// function to return device name of device that has already been configured/claimed +const char* nfc_device_name(nfc_device_t* pnd) +{ + return pnd->acName; +}