User manual
NXP Semiconductors
UM10663
NXP Reader Library User Manual
UM10663
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2013. All rights reserved.
User Manual
COMPANY PUBLIC
Rev. 1.2 — 24 July 2013
257412
31 of 47
wKeyVersion: key version to be used in authentication. This is a useless variable, but
must be NULL.
*pUid: pointer to UID of the card to be authenticated. Each card has its own unique
identification number.
bUidLength: length of UID. Only lengths 4, 7 or 10 are legal.
returnValues:
PH_ERR_AUTH_ERROR:
Authentication procedure fails, if the key currently loaded in the Key
buffer of reader does not match with key for given block in card tried to be accessed.
PH_ERR_INVALID_PARAMETER
–
wKeyVersion
other than NULL.
bKeyType
other than
PHAL_MFC_KEYA
or
PHAL_MFC_KEYB
.
wKeyNo
exceeds half of maximum possible number of keys in
the EEPROM
PH_ERR_IO_TIMEOUT
: Authentication command itself did not succeeded while timeout from
timer1 terminated.
PH_ERR_SUCCESS
: operation successful.
Other: depending on implementation and underlaying component.
2.4.3 ReadValue
- phalMfc_ReadValue()
This function performs MIFARE Classic Read command first then in addition verifies all
the read bytes from the 16 byte receive buffer regarding to data format in Fig 4.
Verification is done by
phalMfc_Int_CheckValueBlockFormat()
function.
phStatus_t phalMfc_ReadValue(
void * pDataParams, [In]
uint8_t bBlockNo, [In]
uint8_t * pValue, [Out]
uint8_t * pAddrData ) [Out]
*pDataParams: pointer to the MIFARE Classic AL layer data parameter structure.
bBlockNo: block number to be read from.
*pValue: pointer to 4 byte array containing read value from the MIFARE Classic card
value block.
*pAddrData: pointer to one byte containing address read from the MIFARE Classic card
value block.
returnValues:
PH_ERR_PROTOCOL_ERROR
– error when other than 16 bytes read from MIFARE Classic card
value block.
Fig 4. One value block in EEPROM of the MIFARE Classic