00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00027 #ifndef _LIBNFC_H_
00028 #define _LIBNFC_H_
00029
00030 #include <stdint.h>
00031 #include <stdbool.h>
00032
00033 #ifdef _WIN32
00034
00035 #ifndef _WINDLL
00036
00037 #ifdef nfc_EXPORTS
00038 #define NFC_EXPORT __declspec(dllexport)
00039 #else
00040 #define NFC_EXPORT __declspec(dllimport)
00041 #endif
00042 #else
00043
00044 #define NFC_EXPORT
00045 #endif
00046 #else
00047 #define NFC_EXPORT
00048 #endif
00049
00050 #include <nfc/nfc-types.h>
00051
00052 #ifdef __cplusplus
00053 extern "C" {
00054 #endif // __cplusplus
00055
00056
00057 NFC_EXPORT void nfc_list_devices(nfc_device_desc_t pnddDevices[], size_t szDevices, size_t *pszDeviceFound);
00058 NFC_EXPORT nfc_device_t* nfc_connect(nfc_device_desc_t* pndd);
00059 NFC_EXPORT void nfc_disconnect(nfc_device_t* pnd);
00060 NFC_EXPORT bool nfc_configure(nfc_device_t* pnd, const nfc_device_option_t ndo, const bool bEnable);
00061
00062
00063 NFC_EXPORT bool nfc_initiator_init(const nfc_device_t* pnd);
00064 NFC_EXPORT bool nfc_initiator_select_tag(const nfc_device_t* pnd, const nfc_modulation_t nmInitModulation, const byte_t* pbtInitData, const size_t szInitDataLen, nfc_target_info_t* pti);
00065 NFC_EXPORT bool nfc_initiator_select_dep_target(const nfc_device_t* pnd, const nfc_modulation_t nmInitModulation, const byte_t* pbtPidData, const size_t szPidDataLen, const byte_t* pbtNFCID3i, const size_t szNFCID3iDataLen, const byte_t *pbtGbData, const size_t szGbDataLen, nfc_target_info_t* pti);
00066 NFC_EXPORT bool nfc_initiator_deselect_tag(const nfc_device_t* pnd);
00067 NFC_EXPORT bool nfc_initiator_transceive_bits(const nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxBits, const byte_t* pbtTxPar, byte_t* pbtRx, size_t* pszRxBits, byte_t* pbtRxPar);
00068 NFC_EXPORT bool nfc_initiator_transceive_bytes(const nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxLen, byte_t* pbtRx, size_t* pszRxLen);
00069 NFC_EXPORT bool nfc_initiator_transceive_dep_bytes(const nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxLen, byte_t* pbtRx, size_t* pszRxLen);
00070 NFC_EXPORT bool nfc_initiator_mifare_cmd(const nfc_device_t* pnd, const mifare_cmd mc, const uint8_t ui8Block, mifare_param* pmp);
00071
00072
00073 NFC_EXPORT bool nfc_target_init(const nfc_device_t* pnd, byte_t* pbtRx, size_t* pszRxBits);
00074 NFC_EXPORT bool nfc_target_receive_bits(const nfc_device_t* pnd, byte_t* pbtRx, size_t* pszRxBits, byte_t* pbtRxPar);
00075 NFC_EXPORT bool nfc_target_receive_bytes(const nfc_device_t* pnd, byte_t* pbtRx, size_t* pszRxLen);
00076 NFC_EXPORT bool nfc_target_receive_dep_bytes(const nfc_device_t* pnd, byte_t* pbtRx, size_t* pszRxLen);
00077 NFC_EXPORT bool nfc_target_send_bits(const nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxBits, const byte_t* pbtTxPar);
00078 NFC_EXPORT bool nfc_target_send_bytes(const nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxLen);
00079 NFC_EXPORT bool nfc_target_send_dep_bytes(const nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxLen);
00080
00081
00082 NFC_EXPORT const char* nfc_device_name(nfc_device_t* pnd);
00083
00084
00085 NFC_EXPORT void iso14443a_crc(byte_t* pbtData, size_t szLen, byte_t* pbtCrc);
00086 NFC_EXPORT const char* nfc_version(void);
00087
00088 #ifdef __cplusplus
00089 }
00090 #endif // __cplusplus
00091
00092
00093 #endif // _LIBNFC_H_
00094