mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-07-22 11:41:50 +00:00
send/receive callbacks from internal chip io return now libnfc error code on failure.
This commit is contained in:
@@ -135,7 +135,7 @@ pn53x_transceive (struct nfc_device *pnd, const uint8_t *pbtTx, const size_t szT
|
||||
|
||||
// Call the send/receice callback functions of the current driver
|
||||
if ((res = CHIP_DATA (pnd)->io->send (pnd, pbtTx, szTx, timeout)) < 0) {
|
||||
return pnd->last_error;
|
||||
return res;
|
||||
}
|
||||
|
||||
// Command is sent, we store the command
|
||||
@@ -147,7 +147,7 @@ pn53x_transceive (struct nfc_device *pnd, const uint8_t *pbtTx, const size_t szT
|
||||
}
|
||||
|
||||
if ((res = CHIP_DATA(pnd)->io->receive (pnd, pbtRx, *pszRx, timeout)) < 0) {
|
||||
return pnd->last_error;
|
||||
return res;
|
||||
}
|
||||
|
||||
if ((CHIP_DATA(pnd)->type == PN532) && (TgInitAsTarget == pbtTx[0])) { // PN532 automatically wakeup on external RF field
|
||||
|
||||
@@ -127,7 +127,7 @@ typedef enum {
|
||||
} pn53x_operating_mode;
|
||||
|
||||
struct pn53x_io {
|
||||
bool (*send)(struct nfc_device *pnd, const uint8_t *pbtData, const size_t szData, int timeout);
|
||||
int (*send)(struct nfc_device *pnd, const uint8_t *pbtData, const size_t szData, int timeout);
|
||||
int (*receive)(struct nfc_device *pnd, uint8_t *pbtData, const size_t szDataLen, int timeout);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user