mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-03-10 09:33:48 +00:00
New internal API function: pn53x_target_send_dep_bytes().
This commit is contained in:
20
libnfc/nfc.c
20
libnfc/nfc.c
@@ -69,7 +69,7 @@ nfc_device_desc_t * nfc_pick_device (void);
|
||||
//
|
||||
// // Target
|
||||
// extern const byte_t pncmd_target_get_data [ 2];
|
||||
extern const byte_t pncmd_target_set_data [264];
|
||||
// extern const byte_t pncmd_target_set_data [264];
|
||||
extern const byte_t pncmd_target_init [ 39];
|
||||
// extern const byte_t pncmd_target_virtual_card [ 4];
|
||||
extern const byte_t pncmd_target_receive [ 2];
|
||||
@@ -740,23 +740,7 @@ bool nfc_target_send_bytes(nfc_device_t* pnd, const byte_t* pbtTx, const size_t
|
||||
*/
|
||||
bool nfc_target_send_dep_bytes(nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxLen)
|
||||
{
|
||||
byte_t abtCmd[sizeof(pncmd_target_set_data)];
|
||||
|
||||
pnd->iLastError = 0;
|
||||
|
||||
memcpy(abtCmd,pncmd_target_set_data,sizeof(pncmd_target_set_data));
|
||||
|
||||
// We can not just send bytes without parity if while the PN53X expects we handled them
|
||||
if (!pnd->bPar) return false;
|
||||
|
||||
// Copy the data into the command frame
|
||||
memcpy(abtCmd+2,pbtTx,szTxLen);
|
||||
|
||||
// Try to send the bits to the reader
|
||||
if (!pn53x_transceive(pnd,abtCmd,szTxLen+2,NULL,NULL)) return false;
|
||||
|
||||
// Everyting seems ok, return true
|
||||
return true;
|
||||
return pn53x_target_send_dep_bytes(pnd, pbtTx, szTxLen);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user