mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-03-03 14:21:47 +00:00
New internal API function: pn53x_target_receive_dep_bytes().
This commit is contained in:
@@ -870,3 +870,24 @@ bool pn53x_transceive_bytes(nfc_device_t* pnd, const byte_t* pbtTx, const size_t
|
||||
// Everything went successful
|
||||
return true;
|
||||
}
|
||||
|
||||
bool pn53x_target_receive_dep_bytes(nfc_device_t* pnd, byte_t* pbtRx, size_t* pszRxLen)
|
||||
{
|
||||
byte_t abtRx[MAX_FRAME_LEN];
|
||||
size_t szRxLen;
|
||||
|
||||
pnd->iLastError = 0;
|
||||
|
||||
|
||||
// Try to gather a received frame from the reader
|
||||
if (!pn53x_transceive(pnd,pncmd_target_get_data,2,abtRx,&szRxLen)) return false;
|
||||
|
||||
// Save the received byte count
|
||||
*pszRxLen = szRxLen-1;
|
||||
|
||||
// Copy the received bytes
|
||||
memcpy(pbtRx,abtRx+1,*pszRxLen);
|
||||
|
||||
// Everyting seems ok, return true
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -101,6 +101,8 @@ bool pn53x_transceive_dep_bytes(nfc_device_t* pnd, const byte_t* pbtTx, const si
|
||||
bool pn53x_transceive_bits(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);
|
||||
bool pn53x_transceive_bytes(nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxLen, byte_t* pbtRx, size_t* pszRxLen);
|
||||
|
||||
bool pn53x_target_receive_dep_bytes(nfc_device_t* pnd, byte_t* pbtRx, size_t* pszRxLen);
|
||||
|
||||
const char *pn53x_strerror (const nfc_device_t *pnd);
|
||||
|
||||
static const struct chip_callbacks pn53x_callbacks_list = {
|
||||
|
||||
Reference in New Issue
Block a user