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
27 of 47
this function the first UID byte can equal
PHPAL_I14443P3A_CASCADE_TAG
, which indicates,
that UID not complete yet, therefore next anti-collision loop required.
*pNvbUidOut: is length of array of UID. It specifies how many bytes of UID are currently
relevant.
returnValues:
PH_ERR_INVALID_PARAMETER
– invalid cascade level or invalid
bNvbUidIn
.
PH_ERR_PROTOCOL_ERROR
- invalid response received.
PH_ERR_SUCCESS
- operation successful.
Other: depending on implementation and underlaying component.
2.3.6 Selection
- phpalI14443p3a_Select()
This function provides Selection - a partial operation of Activation procedure. This
function and
phpalI14443p3a_Anticollision()
are both together implemented within the
phpalI14443p3a_ActivateCard()
function. Cooperation of this couple of functions results in
obtaining of compete UID in a way satisfying ISO/IEC14443p3.
After this Selection executes successfully, card specified by UID responds by SAK byte
code which refers to the card type (MIFARE Classis 1k, 4K, MIFARE DESFire etc.). If the
PCD reader requested to be able to handle more card types, particular MIFARE card
type can be recognized by SAK one byte code. Further task for developer is to design
branching of software to run correct routines compliant to type (SAK byte) of the card
currently selected.
Note: Use this function just for purpose of finding out SAK byte, which determines type of
card.
phStatus_t phpalI14443p3a_Select(
void * pDataParams, [In]
uint8_t bCascadeLevel, [In]
uint8_t * pUidIn, [In]
uint8_t * pSak ); [Out]
*pDataParams: pointer to PAL data parameter structure. Selection function sets
pDataParam->UidComplete
flag to 1, if acquiring UID was completed successfully.
bCascadeLevel: refers to degree which anti-collision procedure is currently in. For this
parameter there are three legal values in total:
#define PHPAL_I14443P3A_CASCADE_LEVEL_1 0x93
#define PHPAL_I14443P3A_CASCADE_LEVEL_2 0x95
#define PHPAL_I14443P3A_CASCADE_LEVEL_3 0x97
Cards owning 4 byte long UID, run only one cascade level. After the third cascade level
is completed, UID must be obtained for any card - all UID lengths’ cases. For further
information see ISO/IEC14443p3.
*pUidIn: UID of card to be selected. This value should not be NULL, due to this function
process only relevant even if incomplete input UID.
*pSak: byte code specifying type of card. MIFARE card type is determined by bits
according to table of SAK values in [26]. There is one special case SAK==0x04 which
means UID of currently selected card is not complete yet and next cascade of activation
loop is necessary to perform. Therefore Selection function is used inside Activation