libnfc
1.7.1
|
This page details how to act as tag (i.e. MIFARE Classic) or NFC target device. More...
Functions | |
int | nfc_target_init (nfc_device *pnd, nfc_target *pnt, uint8_t *pbtRx, const size_t szRx, int timeout) |
Initialize NFC device as an emulated tag. More... | |
int | nfc_target_send_bytes (nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx, int timeout) |
Send bytes and APDU frames. More... | |
int | nfc_target_receive_bytes (nfc_device *pnd, uint8_t *pbtRx, const size_t szRx, int timeout) |
Receive bytes and APDU frames. More... | |
int | nfc_target_send_bits (nfc_device *pnd, const uint8_t *pbtTx, const size_t szTxBits, const uint8_t *pbtTxPar) |
Send raw bit-frames. More... | |
int | nfc_target_receive_bits (nfc_device *pnd, uint8_t *pbtRx, const size_t szRx, uint8_t *pbtRxPar) |
Receive bit-frames. More... | |
This page details how to act as tag (i.e. MIFARE Classic) or NFC target device.
int nfc_target_init | ( | nfc_device * | pnd, |
nfc_target * | pnt, | ||
uint8_t * | pbtRx, | ||
const size_t | szRx, | ||
int | timeout | ||
) |
Initialize NFC device as an emulated tag.
pnd | nfc_device struct pointer that represent currently used device |
pnt | pointer to nfc_target struct that represents the wanted emulated target |
[out] | pbtRx | Rx buffer pointer |
[out] | szRx | received bytes count |
timeout | in milliseconds |
This function initializes NFC device in target mode in order to emulate a tag using the specified nfc_target_mode_t.
If timeout equals to 0, the function blocks indefinitely (until an error is raised or function is completed) If timeout equals to -1, the default timeout will be used
int nfc_target_receive_bits | ( | nfc_device * | pnd, |
uint8_t * | pbtRx, | ||
const size_t | szRx, | ||
uint8_t * | pbtRxPar | ||
) |
Receive bit-frames.
pnd | nfc_device struct pointer that represent currently used device | |
pbtRx | pointer to Rx buffer | |
szRx | size of Rx buffer | |
[out] | pbtRxPar | parameter contains a byte array of the corresponding parity bits |
This function makes it possible to receive (raw) bit-frames. It returns all the messages that are stored in the FIFO buffer of the PN53x chip. It does not require to send any frame and thereby could be used to snoop frames that are transmitted by a nearby initiator.
int nfc_target_receive_bytes | ( | nfc_device * | pnd, |
uint8_t * | pbtRx, | ||
const size_t | szRx, | ||
int | timeout | ||
) |
Receive bytes and APDU frames.
pnd | nfc_device struct pointer that represent currently used device |
pbtRx | pointer to Rx buffer |
szRx | size of Rx buffer |
timeout | in milliseconds |
This function retrieves bytes frames (e.g. ADPU) sent by the initiator to the NFC device (configured as target).
If timeout equals to 0, the function blocks indefinitely (until an error is raised or function is completed) If timeout equals to -1, the default timeout will be used
int nfc_target_send_bits | ( | nfc_device * | pnd, |
const uint8_t * | pbtTx, | ||
const size_t | szTxBits, | ||
const uint8_t * | pbtTxPar | ||
) |
Send raw bit-frames.
pnd | nfc_device struct pointer that represent currently used device |
pbtTx | pointer to Tx buffer |
szTxBits | size of Tx buffer |
pbtTxPar | parameter contains a byte array of the corresponding parity bits needed to send per byte. This function can be used to transmit (raw) bit-frames to the initiator using the specified NFC device (configured as target). |
int nfc_target_send_bytes | ( | nfc_device * | pnd, |
const uint8_t * | pbtTx, | ||
const size_t | szTx, | ||
int | timeout | ||
) |
Send bytes and APDU frames.
pnd | nfc_device struct pointer that represent currently used device |
pbtTx | pointer to Tx buffer |
szTx | size of Tx buffer |
timeout | in milliseconds |
This function make the NFC device (configured as target) send byte frames (e.g. APDU responses) to the initiator.
If timeout equals to 0, the function blocks indefinitely (until an error is raised or function is completed) If timeout equals to -1, the default timeout will be used