send/receive callbacks from internal chip io return now libnfc error code on failure.
This commit is contained in:
parent
81d76c8c70
commit
c30e9eed36
11 changed files with 80 additions and 79 deletions
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue