2009-04-29 14:47:41 +02:00
|
|
|
/*
|
|
|
|
|
|
|
|
Public platform independent Near Field Communication (NFC) library
|
|
|
|
Copyright (C) 2009, Roel Verdult
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
2009-06-26 11:05:25 +02:00
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
2009-04-29 14:47:41 +02:00
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
2009-06-26 11:05:25 +02:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>
|
2009-04-29 14:47:41 +02:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
2009-02-12 13:39:05 +01:00
|
|
|
#ifndef _LIBNFC_H_
|
|
|
|
#define _LIBNFC_H_
|
|
|
|
|
2009-05-27 12:13:19 +02:00
|
|
|
#include <stdint.h>
|
2009-05-27 16:05:07 +02:00
|
|
|
#include <stdbool.h>
|
2009-05-27 12:13:19 +02:00
|
|
|
|
2009-02-12 13:39:05 +01:00
|
|
|
#include "defines.h"
|
|
|
|
#include "types.h"
|
|
|
|
#include "bitutils.h"
|
2009-04-29 14:47:41 +02:00
|
|
|
#include "devices.h"
|
|
|
|
|
2009-06-03 09:32:43 +02:00
|
|
|
dev_info* nfc_connect(void);
|
2009-04-29 14:47:41 +02:00
|
|
|
void nfc_disconnect(dev_info* pdi);
|
|
|
|
bool nfc_configure(dev_info* pdi, const dev_config_option dco, const bool bEnable);
|
|
|
|
|
|
|
|
bool nfc_reader_init(const dev_info* pdi);
|
2009-05-27 12:13:19 +02:00
|
|
|
bool nfc_reader_select(const dev_info* pdi, const init_modulation im, const byte* pbtInitData, const uint32_t uiInitDataLen, tag_info* pti);
|
2009-04-29 14:47:41 +02:00
|
|
|
bool nfc_reader_deselect(const dev_info* pdi);
|
2009-05-27 12:13:19 +02:00
|
|
|
bool nfc_reader_transceive_bits(const dev_info* pdi, const byte* pbtTx, const uint32_t uiTxBits, const byte* pbtTxPar, byte* pbtRx, uint32_t* puiRxBits, byte* pbtRxPar);
|
|
|
|
bool nfc_reader_transceive_bytes(const dev_info* pdi, const byte* pbtTx, const uint32_t uiTxLen, byte* pbtRx, uint32_t* puiRxLen);
|
|
|
|
bool nfc_reader_mifare_cmd(const dev_info* pdi, const mifare_cmd mc, const uint8_t ui8Block, mifare_param* pmp);
|
|
|
|
|
|
|
|
bool nfc_target_init(const dev_info* pdi, byte* pbtRx, uint32_t* puiRxBits);
|
|
|
|
bool nfc_target_receive_bits(const dev_info* pdi, byte* pbtRx, uint32_t* puiRxBits, byte* pbtRxPar);
|
|
|
|
bool nfc_target_receive_bytes(const dev_info* pdi, byte* pbtRx, uint32_t* puiRxLen);
|
|
|
|
bool nfc_target_send_bits(const dev_info* pdi, const byte* pbtTx, const uint32_t uiTxBits, const byte* pbtTxPar);
|
|
|
|
bool nfc_target_send_bytes(const dev_info* pdi, const byte* pbtTx, const uint32_t uiTxLen);
|
2009-02-12 13:39:05 +01:00
|
|
|
|
|
|
|
#endif // _LIBNFC_H_
|
|
|
|
|