diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index e8bfd59..c65022b 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -327,7 +327,7 @@ pn53x_unwrap_frame (const uint8_t *pbtFrame, const size_t szFrameBits, uint8_t * } } -bool +int pn53x_decode_target_data (const uint8_t *pbtRawData, size_t szRawData, pn53x_type type, nfc_modulation_type nmt, nfc_target_info *pnti) { @@ -402,7 +402,7 @@ pn53x_decode_target_data (const uint8_t *pbtRawData, size_t szRawData, pn53x_typ // Skip V & T Addresses pbtRawData++; if (*pbtRawData != 0x07) { // 0x07 = REPGEN - return false; + return NFC_ECHIP; } pbtRawData++; // Store the UID @@ -465,10 +465,10 @@ pn53x_decode_target_data (const uint8_t *pbtRawData, size_t szRawData, pn53x_typ memcpy (pnti->nji.btId, pbtRawData, 4); break; default: - return false; + return NFC_ECHIP; break; } - return true; + return NFC_SUCCESS; } int diff --git a/libnfc/chips/pn53x.h b/libnfc/chips/pn53x.h index b5c5e08..d53e732 100644 --- a/libnfc/chips/pn53x.h +++ b/libnfc/chips/pn53x.h @@ -270,7 +270,7 @@ int pn53x_set_parameters (struct nfc_device *pnd, const uint8_t ui8Value, con int pn53x_set_tx_bits (struct nfc_device *pnd, const uint8_t ui8Bits); int pn53x_wrap_frame (const uint8_t *pbtTx, const size_t szTxBits, const uint8_t *pbtTxPar, uint8_t *pbtFrame); int pn53x_unwrap_frame (const uint8_t *pbtFrame, const size_t szFrameBits, uint8_t *pbtRx, uint8_t *pbtRxPar); -bool pn53x_decode_target_data (const uint8_t *pbtRawData, size_t szRawData, +int pn53x_decode_target_data (const uint8_t *pbtRawData, size_t szRawData, pn53x_type chip_type, nfc_modulation_type nmt, nfc_target_info *pnti); int pn53x_read_register (struct nfc_device *pnd, uint16_t ui16Reg, uint8_t *ui8Value);