pn53x_decode_target_data() returns now 0 on success and libnfc error code on failure.

This commit is contained in:
Audrey Diacre 2012-01-04 16:11:30 +00:00
parent d4c5476652
commit 240cdcddab
2 changed files with 5 additions and 5 deletions

View file

@ -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, pn53x_decode_target_data (const uint8_t *pbtRawData, size_t szRawData, pn53x_type type, nfc_modulation_type nmt,
nfc_target_info *pnti) 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 // Skip V & T Addresses
pbtRawData++; pbtRawData++;
if (*pbtRawData != 0x07) { // 0x07 = REPGEN if (*pbtRawData != 0x07) { // 0x07 = REPGEN
return false; return NFC_ECHIP;
} }
pbtRawData++; pbtRawData++;
// Store the UID // 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); memcpy (pnti->nji.btId, pbtRawData, 4);
break; break;
default: default:
return false; return NFC_ECHIP;
break; break;
} }
return true; return NFC_SUCCESS;
} }
int int

View file

@ -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_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_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); 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, pn53x_type chip_type, nfc_modulation_type nmt,
nfc_target_info *pnti); nfc_target_info *pnti);
int pn53x_read_register (struct nfc_device *pnd, uint16_t ui16Reg, uint8_t *ui8Value); int pn53x_read_register (struct nfc_device *pnd, uint16_t ui16Reg, uint8_t *ui8Value);