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
00034 #include <nfc/nfc-types.h>
00035
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif // __cplusplus
00039
00040
00041 void nfc_list_devices(nfc_device_desc_t pnddDevices[], size_t szDevices, size_t *pszDeviceFound);
00042 nfc_device_t* nfc_connect(nfc_device_desc_t* pndd);
00043 void nfc_disconnect(nfc_device_t* pnd);
00044 bool nfc_configure(nfc_device_t* pnd, const nfc_device_option_t ndo, const bool bEnable);
00045
00046
00047 bool nfc_initiator_init(const nfc_device_t* pnd);
00048 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);
00049 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);
00050 bool nfc_initiator_deselect_tag(const nfc_device_t* pnd);
00051 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);
00052 bool nfc_initiator_transceive_bytes(const nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxLen, byte_t* pbtRx, size_t* pszRxLen);
00053 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);
00054 bool nfc_initiator_mifare_cmd(const nfc_device_t* pnd, const mifare_cmd mc, const uint8_t ui8Block, mifare_param* pmp);
00055
00056
00057 bool nfc_target_init(const nfc_device_t* pnd, byte_t* pbtRx, size_t* pszRxBits);
00058 bool nfc_target_receive_bits(const nfc_device_t* pnd, byte_t* pbtRx, size_t* pszRxBits, byte_t* pbtRxPar);
00059 bool nfc_target_receive_bytes(const nfc_device_t* pnd, byte_t* pbtRx, size_t* pszRxLen);
00060 bool nfc_target_receive_dep_bytes(const nfc_device_t* pnd, byte_t* pbtRx, size_t* pszRxLen);
00061 bool nfc_target_send_bits(const nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxBits, const byte_t* pbtTxPar);
00062 bool nfc_target_send_bytes(const nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxLen);
00063 bool nfc_target_send_dep_bytes(const nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxLen);
00064
00065
00066 const char* nfc_device_name(nfc_device_t* pnd);
00067
00068
00069 const char* nfc_version(void);
00070
00071 #ifdef __cplusplus
00072 }
00073 #endif // __cplusplus
00074
00075
00076 #endif // _LIBNFC_H_
00077