WinCEGeräteSE_Handbuch_Programmierung_v3.00_EN
38 / 65
lResult = RFIDFindCards(g_hRfid, CARDFAMILY_MIFARE, &Tag[0],
&nFoundCards, FALSE);
if (lResult != RFID_SUCCESS)
{
// Error occurred when getting the transponder cards
if (lResult == RFID_NO_TAG)
{
// No transponder card found
_tprintf(_T("No Mifare transponder card found!\n"));
}
else
return(RetDspError());
}
if (nFoundCards > 0)
{
// Show transponder addresses
ShowCards(&Tag[0], nFoundCards);
for(nCards = 0; nCards < nFoundCards; +)
{
// Select transponder cards
lResult = RFIDSelectCard(g_hRfid, Tag[nCards], &bCardSize, TRUE);
if (lResult != RFID_SUCCESS)
return(RetDspError());
// Read out block 0
nSize = sizeof(fromReadBlockData);
lResult = RFIDReadBlock(g_hRfid, Tag[nCards], 0,
fromReadBlockData, &nSize, TRUE);
if (lResult != RFID_SUCCESS)
return(RetDspError());
// Show block data
ShowReadData(Tag[nCards], fromReadBlockData);
}
}
// Uninitialise
RFIDUnInit(g_hRfid);
//*******************************************************************
// ICODE SLI, ICODE EPC, ICODE UID, UHF
//*******************************************************************
// The function steps below also apply to the ICode EPC,
// ICode UID and EPC UHF Gen 2 transponder cards
// (the card family must be changed in the RFIDInit function)
// Initialise
_tprintf(_T("\n\nInitialise...\n\n"));
nFoundCards = MAXCARD;
#ifdef _ICODE_SLI
dwCardFamily = CARDFAMILY_ICODE_SLI;
#endif
#ifdef _UHF
dwCardFamily = CARDFAMILY_UHF;
#endif
#ifdef _ICODE_SLI
lResult = RFIDInit(&dwCardFamily, 5000, 0, TRUE, &g_hRfid);
#endif