00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 #include "../FEDM.h"
00091 #include "../FEDM_Functions.h"
00092 #include "FEDM_ISOTabItem.h"
00093 #include "FEDM_ISCReader.h"
00094 #include "FEDM_ISCReaderID.h"
00095 #ifdef _FEDM_TAG_HANDLER
00096 #include "tag_handler/FedmIscTagHandler.h"
00097 #if !defined(_FEDM_NO_TAG_HANDLER_EPC_C1_G2)
00098 #include "tag_handler/FedmIscTagHandler_EPC_Class1_Gen2.h"
00099 #include "tag_handler/FedmIscTagHandler_EPC_Class1_Gen2_IDS_SL900A.h"
00100 #endif
00101 #if !defined(_FEDM_NO_TAG_HANDLER_ISO18000_3M3)
00102 #include "tag_handler/FedmIscTagHandler_ISO18000_3M3.h"
00103 #endif
00104 #if !defined(_FEDM_NO_TAG_HANDLER_ISO14443)
00105 #include "tag_handler/FedmIscTagHandler_ISO14443.h"
00106 #include "tag_handler/FedmIscTagHandler_ISO14443_Innovatron.h"
00107 #include "tag_handler/FedmIscTagHandler_ISO14443_2.h"
00108 #include "tag_handler/FedmIscTagHandler_ISO14443_2_Innovision_Jewel.h"
00109 #include "tag_handler/FedmIscTagHandler_ISO14443_2_STM_SR176.h"
00110 #include "tag_handler/FedmIscTagHandler_ISO14443_2_STM_SRIxxx.h"
00111 #include "tag_handler/FedmIscTagHandler_ISO14443_3.h"
00112 #include "tag_handler/FedmIscTagHandler_ISO14443_3_ASK_CTx.h"
00113 #include "tag_handler/FedmIscTagHandler_ISO14443_3_Infineon_my_d.h"
00114 #include "tag_handler/FedmIscTagHandler_ISO14443_3_Infineon_my_d_move.h"
00115 #include "tag_handler/FedmIscTagHandler_ISO14443_3_MIFARE_Classic.h"
00116 #include "tag_handler/FedmIscTagHandler_ISO14443_3_MIFARE_Ultralight.h"
00117 #include "tag_handler/FedmIscTagHandler_ISO14443_3_MIFARE_Plus.h"
00118 #include "tag_handler/FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1.h"
00119 #include "tag_handler/FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL2.h"
00120 #include "tag_handler/FedmIscTagHandler_ISO14443_4.h"
00121 #include "tag_handler/FedmIscTagHandler_ISO14443_4_Maxim.h"
00122 #include "tag_handler/FedmIscTagHandler_ISO14443_4_Maxim_MAX66000.h"
00123 #include "tag_handler/FedmIscTagHandler_ISO14443_4_Maxim_MAX66020.h"
00124 #include "tag_handler/FedmIscTagHandler_ISO14443_4_Maxim_MAX66040.h"
00125 #include "tag_handler/FedmIscTagHandler_ISO14443_4_MIFARE_Plus.h"
00126 #include "tag_handler/FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL1.h"
00127 #include "tag_handler/FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL2.h"
00128 #include "tag_handler/FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL3.h"
00129 #include "tag_handler/FedmIscTagHandler_ISO14443_4_MIFARE_DESFire.h"
00130 #endif
00131 #if !defined(_FEDM_NO_TAG_HANDLER_ISO15693)
00132 #include "tag_handler/FedmIscTagHandler_ISO15693.h"
00133 #include "tag_handler/FedmIscTagHandler_ISO15693_STM.h"
00134 #include "tag_handler/FedmIscTagHandler_ISO15693_STM_LRI2K.h"
00135 #include "tag_handler/FedmIscTagHandler_ISO15693_STM_LRIS2K.h"
00136 #include "tag_handler/FedmIscTagHandler_ISO15693_STM_LRIS64K.h"
00137 #include "tag_handler/FedmIscTagHandler_ISO15693_STM_M24LR64R.h"
00138 #include "tag_handler/FedmIscTagHandler_ISO15693_STM_M24LRxxER.h"
00139 #include "tag_handler/FedmIscTagHandler_ISO15693_NXP.h"
00140 #include "tag_handler/FedmIscTagHandler_ISO15693_NXP_ICODE_SLI.h"
00141 #include "tag_handler/FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX.h"
00142 #include "tag_handler/FedmIscTagHandler_ISO15693_NXP_ICODE_SLI_L.h"
00143 #include "tag_handler/FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX_L.h"
00144 #include "tag_handler/FedmIscTagHandler_ISO15693_NXP_ICODE_SLI_S.h"
00145 #include "tag_handler/FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX_S.h"
00146 #include "tag_handler/FedmIscTagHandler_ISO15693_Infineon.h"
00147 #include "tag_handler/FedmIscTagHandler_ISO15693_Infineon_my_d.h"
00148 #include "tag_handler/FedmIscTagHandler_ISO15693_TI.h"
00149 #include "tag_handler/FedmIscTagHandler_ISO15693_TI_Tag_it_HFI_Pro.h"
00150 #include "tag_handler/FedmIscTagHandler_ISO15693_TI_Tag_it_HFI_Plus.h"
00151 #include "tag_handler/FedmIscTagHandler_ISO15693_Fujitsu.h"
00152 #include "tag_handler/FedmIscTagHandler_ISO15693_Fujitsu_MB89R1xx.h"
00153 #include "tag_handler/FedmIscTagHandler_ISO15693_EM.h"
00154 #include "tag_handler/FedmIscTagHandler_ISO15693_EM_4034.h"
00155 #include "tag_handler/FedmIscTagHandler_ISO15693_KSW.h"
00156 #include "tag_handler/FedmIscTagHandler_ISO15693_Maxim.h"
00157 #include "tag_handler/FedmIscTagHandler_ISO15693_Maxim_MAX66100.h"
00158 #include "tag_handler/FedmIscTagHandler_ISO15693_Maxim_MAX66120.h"
00159 #include "tag_handler/FedmIscTagHandler_ISO15693_Maxim_MAX66140.h"
00160 #include "tag_handler/FedmIscTagHandler_ISO15693_IDS_SL13A.h"
00161 #endif
00162 #endif
00163
00164 #if _MSC_VER >= 1400
00165 #pragma warning(disable : 4996)
00166 #endif
00167
00168
00169
00170
00171
00172
00173
00174 FEDM_ISOTabItem::FEDM_ISOTabItem()
00175 {
00176 m_iRxDB_BlockCount = 256;
00177 m_iRxDB_BlockSize = 32;
00178 m_iTxDB_BlockCount = 256;
00179 m_iTxDB_BlockSize = 32;
00180
00181 m_ucMemSizeLen = 0;
00182 m_uiTabIndex = 0;
00183
00184 m_pReader = NULL;
00185 #ifdef _FEDM_TAG_HANDLER
00186 m_pTagHandler = NULL;
00187 #endif
00188 }
00189
00190 FEDM_ISOTabItem::FEDM_ISOTabItem(unsigned int uiTabIndex, FEDM_ISCReader* pReader)
00191 {
00192 m_iRxDB_BlockCount = 256;
00193 m_iRxDB_BlockSize = 32;
00194 m_iTxDB_BlockCount = 256;
00195 m_iTxDB_BlockSize = 32;
00196
00197 m_ucMemSizeLen = 0;
00198 m_uiTabIndex = uiTabIndex;
00199
00200 m_pReader = pReader;
00201 #ifdef _FEDM_TAG_HANDLER
00202 m_pTagHandler = NULL;
00203 #endif
00204 }
00205
00206 FEDM_ISOTabItem::~FEDM_ISOTabItem()
00207 {
00208 m_ucSecStatus.clear();
00209 m_ucTxDB.clear();
00210 m_ucRxDB.clear();
00211 m_ucTxDB_EpcBank.clear();
00212 m_ucRxDB_EpcBank.clear();
00213 m_ucTxDB_TidBank.clear();
00214 m_ucRxDB_TidBank.clear();
00215 m_ucTxDB_ResBank.clear();
00216 m_ucRxDB_ResBank.clear();
00217
00218 #ifdef _FEDM_TAG_HANDLER
00219 if(m_pTagHandler != NULL)
00220 delete m_pTagHandler;
00221 #endif
00222 }
00223
00224 #ifdef _FEDM_TAG_HANDLER
00225 void FEDM_ISOTabItem::RemoveTagHandler()
00226 {
00227 if(m_pTagHandler != NULL)
00228 {
00229 delete m_pTagHandler;
00230 m_pTagHandler = NULL;
00231 }
00232 }
00233 #endif
00234
00235 bool FEDM_ISOTabItem::HasTagHandler()
00236 {
00237 #ifdef _FEDM_TAG_HANDLER
00238 if(m_pTagHandler != NULL)
00239 return true;
00240 #endif
00241
00242 return false;
00243 }
00244
00245
00246 void FEDM_ISOTabItem::Init()
00247 {
00248 m_iRxDB_BlockCount = 256;
00249 m_iRxDB_BlockSize = 32;
00250 m_iTxDB_BlockCount = 256;
00251 m_iTxDB_BlockSize = 32;
00252
00253 m_ucSecStatus.reserve(FEDM_ISC_ISO_TABLE_SEC_STATUS_SIZE);
00254 m_ucSecStatus.resize(FEDM_ISC_ISO_TABLE_SEC_STATUS_SIZE);
00255 m_ucTxDB.reserve(FEDM_ISC_ISO_TABLE_TxDB_SIZE);
00256 m_ucTxDB.resize(FEDM_ISC_ISO_TABLE_TxDB_SIZE);
00257 m_ucRxDB.reserve(FEDM_ISC_ISO_TABLE_RxDB_SIZE);
00258 m_ucRxDB.resize(FEDM_ISC_ISO_TABLE_RxDB_SIZE);
00259
00260
00261 m_ucTxDB_EpcBank.reserve(FEDM_ISC_ISO_TABLE_EPC_BANK_SIZE);
00262 m_ucTxDB_EpcBank.resize(FEDM_ISC_ISO_TABLE_EPC_BANK_SIZE);
00263 m_ucRxDB_EpcBank.reserve(FEDM_ISC_ISO_TABLE_EPC_BANK_SIZE);
00264 m_ucRxDB_EpcBank.resize(FEDM_ISC_ISO_TABLE_EPC_BANK_SIZE);
00265 m_ucTxDB_TidBank.reserve(FEDM_ISC_ISO_TABLE_TID_BANK_SIZE);
00266 m_ucTxDB_TidBank.resize(FEDM_ISC_ISO_TABLE_TID_BANK_SIZE);
00267 m_ucRxDB_TidBank.reserve(FEDM_ISC_ISO_TABLE_TID_BANK_SIZE);
00268 m_ucRxDB_TidBank.resize(FEDM_ISC_ISO_TABLE_TID_BANK_SIZE);
00269 m_ucTxDB_ResBank.reserve(FEDM_ISC_ISO_TABLE_RES_BANK_SIZE);
00270 m_ucTxDB_ResBank.resize(FEDM_ISC_ISO_TABLE_RES_BANK_SIZE);
00271 m_ucRxDB_ResBank.reserve(FEDM_ISC_ISO_TABLE_RES_BANK_SIZE);
00272 m_ucRxDB_ResBank.resize(FEDM_ISC_ISO_TABLE_RES_BANK_SIZE);
00273
00274 memset(m_ucMemSize, 0, 3);
00275 memset(m_ucSnr, 0, FEDM_ISC_MAX_UID_LENGTH);
00276 memset(m_ucClass1Gen2_PC, 0, 2);
00277 memset(m_ucClass1Gen2_XPC_W1, 0, 2);
00278 memset(&m_ucTxDB[0], 0, FEDM_ISC_ISO_TABLE_TxDB_SIZE);
00279 memset(&m_ucRxDB[0], 0, FEDM_ISC_ISO_TABLE_RxDB_SIZE);
00280 memset(&m_ucSecStatus[0], 0, FEDM_ISC_ISO_TABLE_SEC_STATUS_SIZE);
00281 memset(m_ucTxCB, 0, 16);
00282 memset(m_ucRxCB, 0, 16);
00283
00284
00285 memset(&m_ucTxDB_EpcBank[0], 0, FEDM_ISC_ISO_TABLE_EPC_BANK_SIZE);
00286 memset(&m_ucRxDB_EpcBank[0], 0, FEDM_ISC_ISO_TABLE_EPC_BANK_SIZE);
00287 memset(&m_ucTxDB_TidBank[0], 0, FEDM_ISC_ISO_TABLE_TID_BANK_SIZE);
00288 memset(&m_ucRxDB_TidBank[0], 0, FEDM_ISC_ISO_TABLE_TID_BANK_SIZE);
00289 memset(&m_ucTxDB_ResBank[0], 0, FEDM_ISC_ISO_TABLE_RES_BANK_SIZE);
00290 memset(&m_ucRxDB_ResBank[0], 0, FEDM_ISC_ISO_TABLE_RES_BANK_SIZE);
00291
00292 m_ucAFI = 0;
00293 m_ucDsfID = 0;
00294 m_ucOptInfo = 0;
00295 m_ucProductCode = 0;
00296 m_ucFabCode = 0;
00297 m_ucAppCode = 0;
00298 m_ucEmbedderCode = 0;
00299 m_ucVerlog = 0;
00300 m_ucConfig = 0;
00301 m_ucAtrLen = 0;
00302 memset(m_ucAtr, 0, 33);
00303 m_ucTrType = 0xFF;
00304 m_ucEpcType = 0x00;
00305 m_ucSnrLen = 8;
00306 m_ucICRef = 0;
00307 m_ucBlockSize = 4;
00308 m_uiValue = 0;
00309 m_bIsBlockSizeSet = false;
00310 m_bIsSelected = false;
00311 m_bIsSnr = false;
00312 m_bIsEpc = false;
00313 m_bIsAFI = false;
00314 m_bIsSysInfo = false;
00315 m_bIsISO14443_4Info = false;
00316 m_bIsRSSI = false;
00317
00318
00319 m_ucFSCI = 0;
00320 m_ucFWI = 0;
00321 m_ucDSI = 0;
00322 m_ucDRI = 0;
00323 m_ucNad = 0;
00324 m_ucCid = 0;
00325
00326 ClearAntennaValues();
00327 }
00328
00329
00330 void FEDM_ISOTabItem::Init( int iRxDB_BlockCount,
00331 int iRxDB_BlockSize,
00332 int iTxDB_BlockCount,
00333 int iTxDB_BlockSize)
00334 {
00335 m_iRxDB_BlockCount = iRxDB_BlockCount;
00336 m_iRxDB_BlockSize = iRxDB_BlockSize;
00337 m_iTxDB_BlockCount = iTxDB_BlockCount;
00338 m_iTxDB_BlockSize = iTxDB_BlockSize;
00339
00340 m_ucSecStatus.reserve(iRxDB_BlockCount);
00341 m_ucSecStatus.resize(iRxDB_BlockCount);
00342 m_ucTxDB.reserve(iTxDB_BlockCount * iTxDB_BlockSize);
00343 m_ucTxDB.resize(iTxDB_BlockCount * iTxDB_BlockSize);
00344 m_ucRxDB.reserve(iRxDB_BlockCount * iRxDB_BlockSize);
00345 m_ucRxDB.resize(iRxDB_BlockCount * iRxDB_BlockSize);
00346
00347
00348 m_ucTxDB_EpcBank.reserve(FEDM_ISC_ISO_TABLE_EPC_BANK_SIZE);
00349 m_ucTxDB_EpcBank.resize(FEDM_ISC_ISO_TABLE_EPC_BANK_SIZE);
00350 m_ucRxDB_EpcBank.reserve(FEDM_ISC_ISO_TABLE_EPC_BANK_SIZE);
00351 m_ucRxDB_EpcBank.resize(FEDM_ISC_ISO_TABLE_EPC_BANK_SIZE);
00352 m_ucTxDB_TidBank.reserve(FEDM_ISC_ISO_TABLE_TID_BANK_SIZE);
00353 m_ucTxDB_TidBank.resize(FEDM_ISC_ISO_TABLE_TID_BANK_SIZE);
00354 m_ucRxDB_TidBank.reserve(FEDM_ISC_ISO_TABLE_TID_BANK_SIZE);
00355 m_ucRxDB_TidBank.resize(FEDM_ISC_ISO_TABLE_TID_BANK_SIZE);
00356 m_ucTxDB_ResBank.reserve(FEDM_ISC_ISO_TABLE_RES_BANK_SIZE);
00357 m_ucTxDB_ResBank.resize(FEDM_ISC_ISO_TABLE_RES_BANK_SIZE);
00358 m_ucRxDB_ResBank.reserve(FEDM_ISC_ISO_TABLE_RES_BANK_SIZE);
00359 m_ucRxDB_ResBank.resize(FEDM_ISC_ISO_TABLE_RES_BANK_SIZE);
00360
00361 memset(m_ucMemSize, 0, 3);
00362 memset(m_ucSnr, 0, FEDM_ISC_MAX_UID_LENGTH);
00363 memset(m_ucClass1Gen2_PC, 0, 2);
00364 memset(m_ucClass1Gen2_XPC_W1, 0, 2);
00365 memset(&m_ucTxDB[0], 0, iTxDB_BlockCount * iTxDB_BlockSize);
00366 memset(&m_ucRxDB[0], 0, iRxDB_BlockCount * iRxDB_BlockSize);
00367 memset(&m_ucSecStatus[0], 0, iRxDB_BlockCount);
00368 memset(m_ucTxCB, 0, 16);
00369 memset(m_ucRxCB, 0, 16);
00370
00371
00372 memset(&m_ucTxDB_EpcBank[0], 0, FEDM_ISC_ISO_TABLE_EPC_BANK_SIZE);
00373 memset(&m_ucRxDB_EpcBank[0], 0, FEDM_ISC_ISO_TABLE_EPC_BANK_SIZE);
00374 memset(&m_ucTxDB_TidBank[0], 0, FEDM_ISC_ISO_TABLE_TID_BANK_SIZE);
00375 memset(&m_ucRxDB_TidBank[0], 0, FEDM_ISC_ISO_TABLE_TID_BANK_SIZE);
00376 memset(&m_ucTxDB_ResBank[0], 0, FEDM_ISC_ISO_TABLE_RES_BANK_SIZE);
00377 memset(&m_ucRxDB_ResBank[0], 0, FEDM_ISC_ISO_TABLE_RES_BANK_SIZE);
00378
00379 m_ucAFI = 0;
00380 m_ucDsfID = 0;
00381 m_ucOptInfo = 0;
00382 m_ucProductCode = 0;
00383 m_ucFabCode = 0;
00384 m_ucAppCode = 0;
00385 m_ucEmbedderCode = 0;
00386 m_ucVerlog = 0;
00387 m_ucConfig = 0;
00388 m_ucAtrLen = 0;
00389 memset(m_ucAtr, 0, 33);
00390 m_ucTrType = 0xFF;
00391 m_ucEpcType = 0x00;
00392 m_ucSnrLen = 8;
00393 m_ucICRef = 0;
00394
00395 m_ucBlockSize = 4;
00396 if(iRxDB_BlockSize < m_ucBlockSize)
00397 m_ucBlockSize = (unsigned char)iRxDB_BlockSize;
00398
00399 m_uiValue = 0;
00400 m_bIsBlockSizeSet = false;
00401 m_bIsSelected = false;
00402 m_bIsSnr = false;
00403 m_bIsEpc = false;
00404 m_bIsAFI = false;
00405 m_bIsSysInfo = false;
00406 m_bIsISO14443_4Info = false;
00407 m_bIsRSSI = false;
00408
00409
00410 m_ucFSCI = 0;
00411 m_ucFWI = 0;
00412 m_ucDSI = 0;
00413 m_ucDRI = 0;
00414 m_ucNad = 0;
00415 m_ucCid = 0;
00416
00417 ClearAntennaValues();
00418 }
00419
00420 void FEDM_ISOTabItem::GetTableSizes(int& iRxDB_BlockCount, int& iRxDB_BlockSize, int& iTxDB_BlockCount, int& iTxDB_BlockSize)
00421 {
00422 iRxDB_BlockCount = m_iRxDB_BlockCount;
00423 iRxDB_BlockSize = m_iRxDB_BlockSize;
00424 iTxDB_BlockCount = m_iTxDB_BlockCount;
00425 iTxDB_BlockSize = m_iTxDB_BlockSize;
00426 }
00427
00428 void FEDM_ISOTabItem::ClearAntennaValues()
00429 {
00430 m_ucFlags = 0;
00431 m_ucAntCount = 0;
00432 memset(&m_ucAntNumber[0], 0, FEDM_ISC_ISO_TABLE_MAX_ANTENNA);
00433 memset(&m_ucAntStatus[0], 0, FEDM_ISC_ISO_TABLE_MAX_ANTENNA);
00434 memset(&m_ucAntRSSI[0], 0, FEDM_ISC_ISO_TABLE_MAX_ANTENNA);
00435 }
00436
00437 bool FEDM_ISOTabItem::IsExtendedPC_W1()
00438 {
00439 if(m_ucClass1Gen2_PC[0] & 0x02)
00440 return true;
00441 else
00442 return false;
00443 }
00444
00445
00446 int FEDM_ISOTabItem::GetSnr(std::string& sSnr)
00447 {
00448 return FEDM_ConvHexUCharToHexStr(m_ucSnr, m_ucSnrLen, sSnr);
00449 }
00450
00451
00452 __int64 FEDM_ISOTabItem::GetSnr()
00453 {
00454 __int64 i64Snr = 0;
00455
00456
00457 for ( int i=0; i<8; i++ )
00458 i64Snr += ( (__int64)m_ucSnr[7-i] << (8*i) );
00459
00460 return i64Snr;
00461 }
00462
00463
00464
00465 __int64 FEDM_ISOTabItem::GetSnr(int i64BitPart)
00466 {
00467 __int64 i64Snr = 0;
00468
00469 if(i64BitPart < 1 || i64BitPart > 4)
00470 return 0;
00471
00472 i64BitPart--;
00473
00474
00475 for ( int i=i64BitPart*8; i<(i64BitPart+1)*8; i++ )
00476 i64Snr += ( (__int64)m_ucSnr[(i64BitPart+1)*8-i] << (8*(i-(i64BitPart*8))) );
00477
00478 return i64Snr;
00479 }
00480
00481 int FEDM_ISOTabItem::GetEpc(char* cEpc, int iBufLen)
00482 {
00483 if(! m_bIsEpc)
00484 return FEDM_ERROR_NOT_AN_EPC;
00485
00486 switch(m_ucEpcType)
00487 {
00488 case FEDM_ISC_EPC_TYPE_1:
00489 if(iBufLen < 28)
00490 return FEDM_ERROR_BUFFER_LENGTH;
00491
00492 sprintf(cEpc, "%02X.%07lX.%06lX.%09llX", GetEpcHeader(), (unsigned long)GetEpcDomainManager(), (unsigned long)GetEpcObjectClass(), GetEpcSnr());
00493 break;
00494
00495 case FEDM_ISC_EPC_TYPE_2:
00496 if(iBufLen < 23)
00497 return FEDM_ERROR_BUFFER_LENGTH;
00498
00499 sprintf(cEpc, "%02X.%06lX.%05lX.%06lX", GetEpcHeader(), (unsigned long)GetEpcDomainManager(), (unsigned long)GetEpcObjectClass(), (unsigned long)GetEpcSnr());
00500 break;
00501
00502 case FEDM_ISC_EPC_TYPE_3:
00503 if(iBufLen < 23)
00504 return FEDM_ERROR_BUFFER_LENGTH;
00505
00506 sprintf(cEpc, "%02X.%04lX.%04lX.%09llX", GetEpcHeader(), (unsigned long)GetEpcDomainManager(), (unsigned long)GetEpcObjectClass(), GetEpcSnr());
00507 break;
00508
00509 case FEDM_ISC_EPC_TYPE_4:
00510 if(iBufLen < 23)
00511 return FEDM_ERROR_BUFFER_LENGTH;
00512
00513 sprintf(cEpc, "%02X.%07lX.%04lX.%08lX", GetEpcHeader(), (unsigned long)GetEpcDomainManager(), (unsigned long)GetEpcObjectClass(), (unsigned long)GetEpcSnr());
00514 break;
00515
00516 default:
00517 return FEDM_ERROR_UNKNOWN_EPC_TYPE;
00518 }
00519
00520 return FEDM_OK;
00521 }
00522
00523 int FEDM_ISOTabItem::GetEpcRaw(unsigned char* cEpc, int iBufLen)
00524 {
00525 if(! m_bIsEpc)
00526 return FEDM_ERROR_NOT_AN_EPC;
00527
00528 switch(m_ucEpcType)
00529 {
00530 case FEDM_ISC_EPC_TYPE_1:
00531 if(iBufLen < 12)
00532 return FEDM_ERROR_BUFFER_LENGTH;
00533
00534 memcpy(cEpc, (const char*)m_ucSnr, 12);
00535 break;
00536
00537 case FEDM_ISC_EPC_TYPE_2:
00538 case FEDM_ISC_EPC_TYPE_3:
00539 case FEDM_ISC_EPC_TYPE_4:
00540 if(iBufLen < 8)
00541 return FEDM_ERROR_BUFFER_LENGTH;
00542
00543 memcpy(cEpc, (const char*)m_ucSnr, 8);
00544 break;
00545
00546 default:
00547 return FEDM_ERROR_UNKNOWN_EPC_TYPE;
00548 }
00549
00550 return FEDM_OK;
00551 }
00552
00553 int FEDM_ISOTabItem::GetEpcHeader()
00554 {
00555 if(! m_bIsEpc)
00556 return FEDM_ERROR_NOT_AN_EPC;
00557
00558 switch(m_ucEpcType)
00559 {
00560 case FEDM_ISC_EPC_TYPE_1:
00561 return m_ucSnr[0];
00562 case FEDM_ISC_EPC_TYPE_2:
00563 return ((m_ucSnr[0]&0xC0)>>6);
00564 case FEDM_ISC_EPC_TYPE_3:
00565 return ((m_ucSnr[0]&0xC0)>>6);
00566 case FEDM_ISC_EPC_TYPE_4:
00567 return ((m_ucSnr[0]&0xC0)>>6);
00568 }
00569
00570 return FEDM_ERROR_UNKNOWN_EPC_TYPE;
00571 }
00572
00573 __int64 FEDM_ISOTabItem::GetEpcDomainManager()
00574 {
00575 if(! m_bIsEpc)
00576 return FEDM_ERROR_NOT_AN_EPC;
00577
00578 switch(m_ucEpcType)
00579 {
00580 case FEDM_ISC_EPC_TYPE_1:
00581 return (((__int64)m_ucSnr[1]<<20) + ((__int64)m_ucSnr[2]<<12) + ((__int64)m_ucSnr[3]<<4) + ((__int64)(m_ucSnr[4]&0xF0)>>4));
00582 case FEDM_ISC_EPC_TYPE_2:
00583 return (((__int64)(m_ucSnr[0]&0x3F)<<15) + ((__int64)m_ucSnr[1]<<7) + ((__int64)(m_ucSnr[2]&0xFE)>>1));
00584 case FEDM_ISC_EPC_TYPE_3:
00585 return (((__int64)(m_ucSnr[0]&0x3F)<<9) + ((__int64)m_ucSnr[1]<<1) + ((__int64)(m_ucSnr[2]&0x80)>>7));
00586 case FEDM_ISC_EPC_TYPE_4:
00587 return (((__int64)(m_ucSnr[0]&0x3F)<<20) + ((__int64)m_ucSnr[1]<<12) + ((__int64)m_ucSnr[2]<<4) + ((__int64)(m_ucSnr[3]&0xF0)>>4));
00588 }
00589
00590 return FEDM_ERROR_UNKNOWN_EPC_TYPE;
00591 }
00592
00593 __int64 FEDM_ISOTabItem::GetEpcObjectClass()
00594 {
00595 if(! m_bIsEpc)
00596 return FEDM_ERROR_NOT_AN_EPC;
00597
00598 switch(m_ucEpcType)
00599 {
00600 case FEDM_ISC_EPC_TYPE_1:
00601 return (((m_ucSnr[4]&0x0F)<<20) + (m_ucSnr[5]<<12) + (m_ucSnr[6]<<4) + ((m_ucSnr[7]&0xF0)>>4));
00602 case FEDM_ISC_EPC_TYPE_2:
00603 return (((m_ucSnr[2]&0x01)<<16) + (m_ucSnr[3]<<8) + m_ucSnr[4]);
00604 case FEDM_ISC_EPC_TYPE_3:
00605 return (((m_ucSnr[2]&0x7F)<<6) + ((m_ucSnr[3]&0xFC)>>2));
00606 case FEDM_ISC_EPC_TYPE_4:
00607 return (((m_ucSnr[3]&0x0F)<<9) + (m_ucSnr[4]<<1) + ((m_ucSnr[5]&0x80)>>7));
00608 }
00609
00610 return FEDM_ERROR_UNKNOWN_EPC_TYPE;
00611 }
00612
00613 __int64 FEDM_ISOTabItem::GetEpcSnr()
00614 {
00615 __int64 i64Data = 0;
00616
00617 if(! m_bIsEpc)
00618 return FEDM_ERROR_NOT_AN_EPC;
00619
00620 switch(m_ucEpcType)
00621 {
00622 case FEDM_ISC_EPC_TYPE_1:
00623 i64Data = (((__int64)(m_ucSnr[7]&0x0F))<<32) + (((__int64)(m_ucSnr[8]))<<24) + (m_ucSnr[9]<<16) + (m_ucSnr[10]<<8) + m_ucSnr[11];
00624 break;
00625 case FEDM_ISC_EPC_TYPE_2:
00626 i64Data = (m_ucSnr[5]<<16) + (m_ucSnr[6]<<8) + m_ucSnr[7];
00627 break;
00628 case FEDM_ISC_EPC_TYPE_3:
00629 i64Data = ((__int64)(m_ucSnr[3]&0x03)<<32) + (m_ucSnr[4]<<24) + (m_ucSnr[5]<<16) + (m_ucSnr[6]<<8) + m_ucSnr[7];
00630 break;
00631 case FEDM_ISC_EPC_TYPE_4:
00632 i64Data = ((m_ucSnr[5]&0x7F)<<16) + (m_ucSnr[6]<<8) + m_ucSnr[7];
00633 break;
00634 default:
00635 return FEDM_ERROR_UNKNOWN_EPC_TYPE;
00636 }
00637
00638 return i64Data;
00639 }
00640
00641 int FEDM_ISOTabItem::SetData(unsigned char ucCmd, unsigned char* ucData, int& iByteCnt, unsigned char ucBank, unsigned int uiAdr)
00642 {
00643 bool bAntenna = false;
00644 int iCnt;
00645 int iErr = 0;
00646
00647 switch(ucCmd)
00648 {
00649 case 0x01:
00650 FEDM_CHK1(iErr, SetSnr(ucData, iByteCnt));
00651 m_pReader->GetData(FEDM_ISC_TMP_B0_MODE_ANT, &bAntenna);
00652 if(bAntenna)
00653 {
00654 if(m_ucFlags & 0x01)
00655 m_bIsSnr = true;
00656 }
00657 else
00658 {
00659 m_bIsSnr = true;
00660 }
00661 break;
00662
00663 case 0x23:
00664 if( uiAdr >= m_ucSecStatus.size())
00665 {
00666 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(Cmd=0x23, ..) - uiAdr >= m_ucSecStatus.size()");
00667 return FEDM_ERROR_ARRAY_BOUNDARY;
00668 }
00669
00670 m_ucSecStatus[uiAdr] = ucData[iByteCnt++];
00671
00672 switch(ucBank)
00673 {
00674 case FEDM_ISC_ISO_BANK_RESERVED:
00675 if( ((uiAdr+1)*m_ucBlockSize - 1) >= m_ucRxDB_ResBank.size())
00676 {
00677 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(Cmd=0x23, ..) - (uiAdr+1)*m_ucBlockSize - 1 >= m_ucRxDB_ResBank.size()");
00678 return FEDM_ERROR_ARRAY_BOUNDARY;
00679 }
00680
00681
00682 for(iCnt=0; iCnt<m_ucBlockSize; iCnt++)
00683 m_ucRxDB_ResBank[(uiAdr+1)*m_ucBlockSize - 1 - iCnt] = ucData[iByteCnt++];
00684 break;
00685
00686 case FEDM_ISC_ISO_BANK_EPC_MEMORY:
00687 if( ((uiAdr+1)*m_ucBlockSize - 1) >= m_ucRxDB_EpcBank.size())
00688 {
00689 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(Cmd=0x23, ..) - (uiAdr+1)*m_ucBlockSize - 1 >= m_ucRxDB_EpcBank.size()");
00690 return FEDM_ERROR_ARRAY_BOUNDARY;
00691 }
00692
00693
00694 for(iCnt=0; iCnt<m_ucBlockSize; iCnt++)
00695 m_ucRxDB_EpcBank[(uiAdr+1)*m_ucBlockSize - 1 - iCnt] = ucData[iByteCnt++];
00696 break;
00697
00698 case FEDM_ISC_ISO_BANK_TID_MEMORY:
00699 if( ((uiAdr+1)*m_ucBlockSize - 1) >= m_ucRxDB_TidBank.size())
00700 {
00701 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(Cmd=0x23, ..) - (uiAdr+1)*m_ucBlockSize - 1 >= m_ucRxDB_TidBank.size()");
00702 return FEDM_ERROR_ARRAY_BOUNDARY;
00703 }
00704
00705
00706 for(iCnt=0; iCnt<m_ucBlockSize; iCnt++)
00707 m_ucRxDB_TidBank[(uiAdr+1)*m_ucBlockSize - 1 - iCnt] = ucData[iByteCnt++];
00708 break;
00709
00710 case FEDM_ISC_ISO_BANK_USER_MEMORY:
00711 if( ((uiAdr+1)*m_ucBlockSize - 1) >= m_ucRxDB.size())
00712 {
00713 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(Cmd=0x23, ..) - (uiAdr+1)*m_ucBlockSize - 1 >= m_ucRxDB.size()");
00714 return FEDM_ERROR_ARRAY_BOUNDARY;
00715 }
00716
00717
00718 for(iCnt=0; iCnt<m_ucBlockSize; iCnt++)
00719 m_ucRxDB[(uiAdr+1)*m_ucBlockSize - 1 - iCnt] = ucData[iByteCnt++];
00720 break;
00721
00722 default:
00723 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(Cmd=0x23, ..) - unknown bank");
00724 return FEDM_ERROR_PARAMETER;
00725 }
00726 break;
00727
00728 case 0xA0:
00729 if(uiAdr > 3)
00730 {
00731 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(Cmd=0xA0, ..) - uiAdr > 3");
00732 return FEDM_ERROR_ARRAY_BOUNDARY;
00733 }
00734
00735 for(iCnt=0; iCnt<4; iCnt++)
00736 m_ucRxCB[uiAdr][iCnt] = ucData[iByteCnt++];
00737
00738 break;
00739
00740 default:
00741 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(Cmd=0x" << std::hex << std::uppercase << (int)ucCmd << ", ..) - unknown command");
00742 return FEDM_ERROR_UNKNOWN_COMMAND;
00743 }
00744
00745 return FEDM_OK;
00746 }
00747
00748 int FEDM_ISOTabItem::GetData(unsigned char ucCmd, unsigned char* ucData, int& iByteCnt, unsigned char ucBank, unsigned int uiAdr)
00749 {
00750 int iCnt;
00751
00752 switch(ucCmd)
00753 {
00754 case 0x24:
00755 switch(ucBank)
00756 {
00757 case FEDM_ISC_ISO_BANK_RESERVED:
00758 if( ((uiAdr+1)*m_ucBlockSize - 1) >= m_ucTxDB_ResBank.size())
00759 {
00760 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(Cmd=0x24, ..) - (uiAdr+1)*m_ucBlockSize - 1 >= m_ucTxDB_ResBank.size()");
00761 return FEDM_ERROR_ARRAY_BOUNDARY;
00762 }
00763
00764
00765 for(iCnt=0; iCnt<m_ucBlockSize; iCnt++)
00766 ucData[iByteCnt++] = m_ucTxDB_ResBank[(uiAdr+1)*m_ucBlockSize - 1 - iCnt];
00767 break;
00768
00769 case FEDM_ISC_ISO_BANK_EPC_MEMORY:
00770 if( ((uiAdr+1)*m_ucBlockSize - 1) >= m_ucTxDB_EpcBank.size())
00771 {
00772 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(Cmd=0x24, ..) - (uiAdr+1)*m_ucBlockSize - 1 >= m_ucTxDB_EpcBank.size()");
00773 return FEDM_ERROR_ARRAY_BOUNDARY;
00774 }
00775
00776
00777 for(iCnt=0; iCnt<m_ucBlockSize; iCnt++)
00778 ucData[iByteCnt++] = m_ucTxDB_EpcBank[(uiAdr+1)*m_ucBlockSize - 1 - iCnt];
00779 break;
00780
00781 case FEDM_ISC_ISO_BANK_TID_MEMORY:
00782 if( ((uiAdr+1)*m_ucBlockSize - 1) >= m_ucTxDB_TidBank.size())
00783 {
00784 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(Cmd=0x24, ..) - (uiAdr+1)*m_ucBlockSize - 1 >= m_ucTxDB_TidBank.size()");
00785 return FEDM_ERROR_ARRAY_BOUNDARY;
00786 }
00787
00788
00789 for(iCnt=0; iCnt<m_ucBlockSize; iCnt++)
00790 ucData[iByteCnt++] = m_ucTxDB_TidBank[(uiAdr+1)*m_ucBlockSize - 1 - iCnt];
00791 break;
00792
00793 case FEDM_ISC_ISO_BANK_USER_MEMORY:
00794 if( ((uiAdr+1)*m_ucBlockSize - 1) >= m_ucTxDB.size())
00795 {
00796 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(Cmd=0x24, ..) - (uiAdr+1)*m_ucBlockSize - 1 >= m_ucTxDB.size()");
00797 return FEDM_ERROR_ARRAY_BOUNDARY;
00798 }
00799
00800
00801 for(iCnt=0; iCnt<m_ucBlockSize; iCnt++)
00802 ucData[iByteCnt++] = m_ucTxDB[(uiAdr+1)*m_ucBlockSize - 1 - iCnt];
00803 break;
00804
00805 default:
00806 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(Cmd=0x23, ..) - unknown bank");
00807 return FEDM_ERROR_PARAMETER;
00808 }
00809 break;
00810
00811 case 0xA1:
00812 if(uiAdr > 3)
00813 {
00814 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(Cmd=0xA1, ..) - uiAdr > 3");
00815 return FEDM_ERROR_ARRAY_BOUNDARY;
00816 }
00817
00818 for(iCnt=0; iCnt<4; iCnt++)
00819 ucData[iByteCnt++] = m_ucTxCB[uiAdr][iCnt];
00820
00821 break;
00822
00823 default:
00824 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(Cmd=0x" << std::hex << std::uppercase << (int)ucCmd << ", ..) - unknown command");
00825 return FEDM_ERROR_UNKNOWN_COMMAND;
00826 }
00827
00828 return FEDM_OK;
00829 }
00830
00831 int FEDM_ISOTabItem::SetSnr(unsigned char* ucData, int& iByteCnt)
00832 {
00833 bool bAntenna = false;
00834 int iBack = 0;
00835
00836 m_pReader->GetData(FEDM_ISC_TMP_B0_MODE_ANT, &bAntenna);
00837
00838 m_bIsEpc = false;
00839
00840 if(bAntenna)
00841 {
00842 FEDM_CHK1(iBack, SetSnr_with_Antenna(ucData, iByteCnt));
00843 }
00844 else
00845 {
00846 FEDM_CHK1(iBack, SetSnr_wo_Antenna(ucData, iByteCnt));
00847 }
00848
00849 #ifdef _FEDM_TAG_HANDLER
00850 if( m_pReader != NULL && m_pReader->m_bEnableTagHandler )
00851 {
00852 FEDM_CHK1(iBack, CreateTagHandler());
00853 }
00854 #endif
00855
00856 return FEDM_OK;
00857 }
00858
00859 const char* FEDM_ISOTabItem::GetISO15693Manufacturer()
00860 {
00861 if(m_ucTrType == FEDM_ISC_TR_TYPE_ISO15693)
00862 {
00863 return FEDM_TabItem::GetISO15693Manufacturer(m_ucSnr[1]);
00864 }
00865
00866 return "";
00867 }
00868
00869
00870 const char* FEDM_ISOTabItem::GetISO14443AManufacturer()
00871 {
00872 if(m_ucTrType == FEDM_ISC_TR_TYPE_ISO14443A)
00873 {
00874 if(m_ucTrInfo & 0x04)
00875 {
00876 return FEDM_TabItem::GetISO15693Manufacturer(m_ucSnr[9]);
00877 }
00878 else
00879 {
00880 if( (m_ucOptInfo & 0x03) > 0)
00881 return FEDM_TabItem::GetISO15693Manufacturer(m_ucSnr[7]);
00882 }
00883 }
00884
00885 return "";
00886 }
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915 unsigned int FEDM_ISOTabItem::GetEpcC1G2TagModelNumber()
00916 {
00917 if( m_ucTrType == FEDM_ISC_TR_TYPE_ISO18000_3M3 ||
00918 m_ucTrType == FEDM_ISC_TR_TYPE_EPC_CLASS1_GEN2 )
00919 {
00920 switch(m_ucRxDB_TidBank[1])
00921 {
00922 case 0xE0:
00923 case 0xE3:
00924 break;
00925 case 0xE2:
00926 return (((unsigned int)(m_ucRxDB_TidBank[3] & 0x0F)) << 8) + m_ucRxDB_TidBank[2];
00927 }
00928 }
00929
00930 return 0xFFFFFFFF;
00931 }
00932
00933 unsigned int FEDM_ISOTabItem::GetEpcC1G2MaskDesignerID()
00934 {
00935 if( m_ucTrType == FEDM_ISC_TR_TYPE_ISO18000_3M3 ||
00936 m_ucTrType == FEDM_ISC_TR_TYPE_EPC_CLASS1_GEN2 )
00937 {
00938 switch(m_ucRxDB_TidBank[1])
00939 {
00940 case 0xE0:
00941 case 0xE3:
00942 return (unsigned int)m_ucRxDB_TidBank[0];
00943 case 0xE2:
00944 return (((unsigned int)(m_ucRxDB_TidBank[0] & 0x1F)) << 4) + ((m_ucRxDB_TidBank[3] & 0xF0) >> 4);
00945 }
00946 }
00947
00948 return 0xFFFFFFFF;
00949 }
00950
00951 const char* FEDM_ISOTabItem::GetEpcC1G2MaskDesignerName()
00952 {
00953 unsigned int uiMDID = 0;
00954
00955 if( m_ucTrType == FEDM_ISC_TR_TYPE_ISO18000_3M3 ||
00956 m_ucTrType == FEDM_ISC_TR_TYPE_EPC_CLASS1_GEN2 )
00957 {
00958 switch(m_ucRxDB_TidBank[1])
00959 {
00960 case 0xE0:
00961 case 0xE3:
00962 return FEDM_TabItem::GetISO15693Manufacturer(m_ucRxDB_TidBank[0]);
00963 case 0xE2:
00964 uiMDID = ((m_ucRxDB_TidBank[0] & 0x1F) << 4) + ((m_ucRxDB_TidBank[3] & 0xF0) >> 4);
00965 return FEDM_TabItem::GetEpcC1G2MaskDesignerName(uiMDID);
00966 }
00967 }
00968
00969 return "";
00970 }
00971
00972 #ifdef _FEDM_TAG_HANDLER
00973 const char* FEDM_ISOTabItem::GetTagName()
00974 {
00975 if(m_pTagHandler != NULL)
00976 return m_pTagHandler->GetTagName();
00977
00978 return "";
00979 }
00980 #endif
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004 #ifdef _FEDM_TAG_HANDLER
01005 int FEDM_ISOTabItem::CreateTagHandler()
01006 {
01007 switch(m_ucTrType)
01008 {
01009 case FEDM_ISC_TR_TYPE_ICODE1:
01010 case FEDM_ISC_TR_TYPE_TAGIT:
01011 case FEDM_ISC_TR_TYPE_EPC:
01012 case FEDM_ISC_TR_TYPE_ICODE_UID:
01013 case FEDM_ISC_TR_TYPE_MCRFxxx:
01014 case FEDM_ISC_TR_TYPE_ISO18000_6_A:
01015 case FEDM_ISC_TR_TYPE_ISO18000_6_B:
01016 case FEDM_ISC_TR_TYPE_EPC_CLASS0:
01017 case FEDM_ISC_TR_TYPE_EPC_CLASS1_GEN1:
01018 case FEDM_ISC_TR_TYPE_EM4222:
01019 if(m_pTagHandler != NULL)
01020 {
01021 if(m_pTagHandler->m_uiTagHandlerType != FedmIscTagHandler::TYPE_BASIC)
01022 {
01023 delete m_pTagHandler;
01024 m_pTagHandler = new FedmIscTagHandler(m_pReader, FedmIscTagHandler::TYPE_BASIC, this);
01025 }
01026 else
01027 {
01028 m_pTagHandler->Init();
01029 }
01030 }
01031 else
01032 {
01033 m_pTagHandler = new FedmIscTagHandler(m_pReader, FedmIscTagHandler::TYPE_BASIC, this);
01034 }
01035
01036 break;
01037
01038 #if !defined(_FEDM_NO_TAG_HANDLER_ISO15693)
01039 case FEDM_ISC_TR_TYPE_ISO15693:
01040 CreateTagHandler_ISO15693();
01041 break;
01042
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052
01053
01054
01055
01056
01057
01058
01059
01060
01061
01062 #endif
01063
01064 #if !defined(_FEDM_NO_TAG_HANDLER_ISO14443)
01065 case FEDM_ISC_TR_TYPE_ISO14443A:
01066 case FEDM_ISC_TR_TYPE_ISO14443B:
01067
01068
01069 if(m_pTagHandler != NULL)
01070 {
01071 if(m_pReader->m_bTagHandlerOption_CreateCondition_Smart)
01072 {
01073 if(dynamic_cast<FedmIscTagHandler_ISO14443*>(m_pTagHandler) == NULL)
01074 {
01075 delete m_pTagHandler;
01076 m_pTagHandler = new FedmIscTagHandler_ISO14443(m_pReader, this);
01077 }
01078 else
01079 {
01080 m_pTagHandler->Init();
01081 }
01082 }
01083 else
01084 {
01085 if(m_pTagHandler->m_uiTagHandlerType != FedmIscTagHandler::TYPE_ISO14443)
01086 {
01087 delete m_pTagHandler;
01088 m_pTagHandler = new FedmIscTagHandler_ISO14443(m_pReader, this);
01089 }
01090 else
01091 {
01092 m_pTagHandler->Init();
01093 }
01094 }
01095 }
01096 else
01097 {
01098 m_pTagHandler = new FedmIscTagHandler_ISO14443(m_pReader, this);
01099 }
01100
01101 break;
01102
01103 case FEDM_ISC_TR_TYPE_JEWEL:
01104 if(m_pTagHandler != NULL)
01105 {
01106 if(m_pTagHandler->m_uiTagHandlerType != FedmIscTagHandler::TYPE_ISO14443_2_INNOVISION_JEWEL)
01107 {
01108 delete m_pTagHandler;
01109 m_pTagHandler = new FedmIscTagHandler_ISO14443_2_Innovision_Jewel(m_pReader, this);
01110 }
01111 else
01112 {
01113 m_pTagHandler->Init();
01114 }
01115 }
01116 else
01117 {
01118 m_pTagHandler = new FedmIscTagHandler_ISO14443_2_Innovision_Jewel(m_pReader, this);
01119 }
01120
01121 break;
01122
01123 case FEDM_ISC_TR_TYPE_STM_SR176:
01124 if(m_pTagHandler != NULL)
01125 {
01126 if(m_pTagHandler->m_uiTagHandlerType != FedmIscTagHandler::TYPE_ISO14443_2_STM_SR176)
01127 {
01128 delete m_pTagHandler;
01129 m_pTagHandler = new FedmIscTagHandler_ISO14443_2_STM_SR176(m_pReader, this);
01130 }
01131 else
01132 {
01133 m_pTagHandler->Init();
01134 }
01135 }
01136 else
01137 {
01138 m_pTagHandler = new FedmIscTagHandler_ISO14443_2_STM_SR176(m_pReader, this);
01139 }
01140
01141 break;
01142
01143 case FEDM_ISC_TR_TYPE_STM_SRIxx:
01144 if(m_pTagHandler != NULL)
01145 {
01146 if(m_pTagHandler->m_uiTagHandlerType != FedmIscTagHandler::TYPE_ISO14443_2_STM_SRIxxx)
01147 {
01148 delete m_pTagHandler;
01149 m_pTagHandler = new FedmIscTagHandler_ISO14443_2_STM_SRIxxx(m_pReader, this);
01150 }
01151 else
01152 {
01153 m_pTagHandler->Init();
01154 }
01155 }
01156 else
01157 {
01158 m_pTagHandler = new FedmIscTagHandler_ISO14443_2_STM_SRIxxx(m_pReader, this);
01159 }
01160
01161 break;
01162
01163 case FEDM_ISC_TR_TYPE_INNOVATRON:
01164 if(m_pTagHandler != NULL)
01165 {
01166 if(m_pTagHandler->m_uiTagHandlerType != FedmIscTagHandler::TYPE_ISO14443_INNOVATRON)
01167 {
01168 delete m_pTagHandler;
01169 m_pTagHandler = new FedmIscTagHandler_ISO14443_Innovatron(m_pReader, this);
01170 }
01171 else
01172 {
01173 m_pTagHandler->Init();
01174 }
01175 }
01176 else
01177 {
01178 m_pTagHandler = new FedmIscTagHandler_ISO14443_Innovatron(m_pReader, this);
01179 }
01180
01181 break;
01182
01183 case FEDM_ISC_TR_TYPE_ASK_CTx:
01184 if(m_pTagHandler != NULL)
01185 {
01186 if(m_pTagHandler->m_uiTagHandlerType != FedmIscTagHandler::TYPE_ISO14443_3_ASK_CTX)
01187 {
01188 delete m_pTagHandler;
01189 m_pTagHandler = new FedmIscTagHandler_ISO14443_3_ASK_CTx(m_pReader, this);
01190 }
01191 else
01192 {
01193 m_pTagHandler->Init();
01194 }
01195 }
01196 else
01197 {
01198 m_pTagHandler = new FedmIscTagHandler_ISO14443_3_ASK_CTx(m_pReader, this);
01199 }
01200
01201 break;
01202 #endif
01203
01204 #if !defined(_FEDM_NO_TAG_HANDLER_ISO18000_3M3)
01205 case FEDM_ISC_TR_TYPE_ISO18000_3M3:
01206 if(m_pTagHandler != NULL)
01207 {
01208 if(dynamic_cast<FedmIscTagHandler_ISO18000_3M3*>(m_pTagHandler) == NULL)
01209 {
01210 delete m_pTagHandler;
01211 m_pTagHandler = new FedmIscTagHandler_ISO18000_3M3(m_pReader, this);
01212 }
01213 else
01214 {
01215 m_pTagHandler->Init();
01216 }
01217 }
01218 else
01219 {
01220 m_pTagHandler = new FedmIscTagHandler_ISO18000_3M3(m_pReader, this);
01221 }
01222
01223 break;
01224 #endif
01225
01226 #if !defined(_FEDM_NO_TAG_HANDLER_EPC_C1_G2)
01227 case FEDM_ISC_TR_TYPE_EPC_CLASS1_GEN2:
01228 if(m_pTagHandler != NULL)
01229 {
01230
01231 if(dynamic_cast<FedmIscTagHandler_EPC_Class1_Gen2*>(m_pTagHandler) == NULL)
01232 {
01233 delete m_pTagHandler;
01234 m_pTagHandler = new FedmIscTagHandler_EPC_Class1_Gen2(m_pReader, this);
01235 }
01236 else
01237 {
01238 m_pTagHandler->Init();
01239 }
01240 }
01241 else
01242 {
01243 m_pTagHandler = new FedmIscTagHandler_EPC_Class1_Gen2(m_pReader, this);
01244 }
01245
01246 break;
01247 #endif
01248
01249 case FEDM_ISC_TR_TYPE_KEYBOARD:
01250
01251 break;
01252
01253 default:
01254 if(m_pTagHandler != NULL)
01255 {
01256 if(m_pTagHandler->m_uiTagHandlerType != FedmIscTagHandler::TYPE_BASIC)
01257 {
01258 delete m_pTagHandler;
01259 m_pTagHandler = new FedmIscTagHandler(m_pReader, FedmIscTagHandler::TYPE_BASIC, this);
01260 }
01261 else
01262 {
01263 m_pTagHandler->Init();
01264 }
01265 }
01266 else
01267 {
01268 m_pTagHandler = new FedmIscTagHandler(m_pReader, FedmIscTagHandler::TYPE_BASIC, this);
01269 }
01270
01271 break;
01272 }
01273
01274 return FEDM_OK;
01275 }
01276 #endif
01277
01278
01279
01280
01281
01282
01283
01284
01285
01286
01287
01288
01289
01290
01291
01292
01293
01294
01295
01296 #ifdef _FEDM_TAG_HANDLER
01297 #if !defined(_FEDM_NO_TAG_HANDLER_ISO15693)
01298 int FEDM_ISOTabItem::CreateTagHandler_ISO15693()
01299 {
01300 bool bCreateNew = false;
01301 unsigned int uiTagHandlerType = 0;
01302
01303
01304
01305
01306 switch(m_ucSnr[1])
01307 {
01308 case FEDM_ISC_ISO_MFR_STM:
01309 if( (m_ucSnr[2]&0xFC) == 0x20 )
01310 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_STM_LRI2K;
01311 else if( (m_ucSnr[2]&0xFC) == 0x40 )
01312 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_STM_LRI2K;
01313 else if( (m_ucSnr[2]&0xFC) == 0x28 )
01314 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_STM_LRIS2K;
01315 else if( (m_ucSnr[2]&0xFC) == 0x2C )
01316 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_STM_M24LR64R;
01317 else if( (m_ucSnr[2]&0xFC) == 0x44 )
01318 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_STM_LRIS64K;
01319 else if( (m_ucSnr[2]&0xFC) == 0x5C )
01320 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_STM_M24LRxxER;
01321 else if( (m_ucSnr[2]&0xFC) == 0x4C )
01322 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_STM_M24LRxxER;
01323 else if( (m_ucSnr[2]&0xFC) == 0x58 )
01324 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_STM_M24LRxxER;
01325 else
01326 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_STM;
01327 break;
01328
01329 case FEDM_ISC_ISO_MFR_NXP:
01330 if( m_ucSnr[2] == 0x01 )
01331 {
01332 if( m_ucSnr[3] & 0x10 )
01333 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLIX;
01334 else if( m_ucSnr[3] & 0x08 )
01335 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLIX;
01336 else
01337 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLI;
01338 }
01339 else if( m_ucSnr[2] == 0x02 )
01340 {
01341 if( m_ucSnr[3] & 0x10 )
01342 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLIX_S;
01343 else
01344 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLI_S;
01345 }
01346 else if( m_ucSnr[2] == 0x03 )
01347 {
01348 if( m_ucSnr[3] & 0x10 )
01349 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLIX_L;
01350 else
01351 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLI_L;
01352 }
01353 else
01354 {
01355 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_NXP;
01356 }
01357 break;
01358
01359 case FEDM_ISC_ISO_MFR_INFINEON:
01360 if( (m_ucSnr[2]&0x1E) == 0x00 )
01361 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_Infineon_my_d;
01362 else
01363 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_Infineon;
01364 break;
01365
01366 case FEDM_ISC_ISO_MFR_TI:
01367 if( (m_ucSnr[2]&0xF0) == 0xC0 )
01368 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_TI_Tag_it_HFI_Pro;
01369 else if( (m_ucSnr[2]&0x70) == 0x00 )
01370 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_TI_Tag_it_HFI_Plus;
01371 else
01372 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_TI;
01373 break;
01374
01375 case FEDM_ISC_ISO_MFR_FUJITSU:
01376 if( m_ucSnr[2] == 0x00 )
01377 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_Fujitsu_MB89R1xx;
01378 else if( m_ucSnr[2] == 0x01 )
01379 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_Fujitsu_MB89R1xx;
01380 else if( m_ucSnr[2] == 0x02 )
01381 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_Fujitsu_MB89R1xx;
01382 else
01383 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_Fujitsu;
01384 break;
01385
01386 case FEDM_ISC_ISO_MFR_EM:
01387 if( (m_ucSnr[2]&0x7C) == 0x04 )
01388 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_EM_4034;
01389 else
01390 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_EM;
01391 break;
01392
01393 case FEDM_ISC_ISO_MFR_MAXIM:
01394 if( (m_ucSnr[3]&0xF0) == 0x10 )
01395 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_MAXIM_MAX66100;
01396 else if( (m_ucSnr[3]&0xF0) == 0x20 )
01397 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_MAXIM_MAX66120;
01398 else if( (m_ucSnr[3]&0xF0) == 0x30 )
01399 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_MAXIM_MAX66140;
01400 else
01401 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_MAXIM;
01402 break;
01403
01404 case FEDM_ISC_ISO_MFR_KSW:
01405 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_KSW;
01406 break;
01407
01408 case FEDM_ISC_ISO_MFR_IDS:
01409 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693_IDS_SL13A;
01410 break;
01411
01412 default:
01413 uiTagHandlerType = FedmIscTagHandler::TYPE_ISO15693;
01414 break;
01415 }
01416
01417 if(m_pTagHandler != NULL)
01418 {
01419 if(m_pTagHandler->m_uiTagHandlerType != uiTagHandlerType)
01420 {
01421 delete m_pTagHandler;
01422 bCreateNew = true;
01423 }
01424 else
01425 {
01426 m_pTagHandler->Init();
01427 }
01428 }
01429 else
01430 {
01431 bCreateNew = true;
01432 }
01433
01434 if(bCreateNew)
01435 {
01436 if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_STM)
01437 {
01438 m_pTagHandler = new FedmIscTagHandler_ISO15693_STM(m_pReader, this);
01439 }
01440 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_STM_LRI2K)
01441 {
01442 m_pTagHandler = new FedmIscTagHandler_ISO15693_STM_LRI2K(m_pReader, this);
01443 }
01444 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_STM_LRIS2K)
01445 {
01446 m_pTagHandler = new FedmIscTagHandler_ISO15693_STM_LRIS2K(m_pReader, this);
01447 }
01448 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_STM_LRIS64K)
01449 {
01450 m_pTagHandler = new FedmIscTagHandler_ISO15693_STM_LRIS64K(m_pReader, this);
01451 }
01452 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_STM_M24LR64R)
01453 {
01454 m_pTagHandler = new FedmIscTagHandler_ISO15693_STM_M24LR64R(m_pReader, this);
01455 }
01456 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_STM_M24LRxxER)
01457 {
01458 m_pTagHandler = new FedmIscTagHandler_ISO15693_STM_M24LRxxER(m_pReader, this);
01459 }
01460 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_NXP)
01461 {
01462 m_pTagHandler = new FedmIscTagHandler_ISO15693_NXP(m_pReader, this);
01463 }
01464 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLI)
01465 {
01466 m_pTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLI(m_pReader, this);
01467 }
01468 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLIX)
01469 {
01470 m_pTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX(m_pReader, this);
01471 }
01472 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLI_S)
01473 {
01474 m_pTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLI_S(m_pReader, this);
01475 }
01476 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLIX_S)
01477 {
01478 m_pTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX_S(m_pReader, this);
01479 }
01480 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLI_L)
01481 {
01482 m_pTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLI_L(m_pReader, this);
01483 }
01484 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLIX_L)
01485 {
01486 m_pTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX_L(m_pReader, this);
01487 }
01488 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_Infineon)
01489 {
01490 m_pTagHandler = new FedmIscTagHandler_ISO15693_Infineon(m_pReader, this);
01491 }
01492 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_Infineon_my_d)
01493 {
01494 m_pTagHandler = new FedmIscTagHandler_ISO15693_Infineon_my_d(m_pReader, this);
01495 }
01496 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_TI)
01497 {
01498 m_pTagHandler = new FedmIscTagHandler_ISO15693_TI(m_pReader, this);
01499 }
01500 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_TI_Tag_it_HFI_Pro)
01501 {
01502 m_pTagHandler = new FedmIscTagHandler_ISO15693_TI_Tag_it_HFI_Pro(m_pReader, this);
01503 }
01504 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_TI_Tag_it_HFI_Plus)
01505 {
01506 m_pTagHandler = new FedmIscTagHandler_ISO15693_TI_Tag_it_HFI_Plus(m_pReader, this);
01507 }
01508 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_Fujitsu)
01509 {
01510 m_pTagHandler = new FedmIscTagHandler_ISO15693_Fujitsu(m_pReader, this);
01511 }
01512 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_Fujitsu_MB89R1xx)
01513 {
01514 m_pTagHandler = new FedmIscTagHandler_ISO15693_Fujitsu_MB89R1xx(m_pReader, this);
01515 }
01516 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_EM)
01517 {
01518 m_pTagHandler = new FedmIscTagHandler_ISO15693_EM(m_pReader, this);
01519 }
01520 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_EM_4034)
01521 {
01522 m_pTagHandler = new FedmIscTagHandler_ISO15693_EM_4034(m_pReader, this);
01523 }
01524 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_KSW)
01525 {
01526 m_pTagHandler = new FedmIscTagHandler_ISO15693_KSW(m_pReader, this);
01527 }
01528 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_MAXIM)
01529 {
01530 m_pTagHandler = new FedmIscTagHandler_ISO15693_Maxim(m_pReader, this);
01531 }
01532 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_MAXIM_MAX66100)
01533 {
01534 m_pTagHandler = new FedmIscTagHandler_ISO15693_Maxim_MAX66100(m_pReader, this);
01535 }
01536 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_MAXIM_MAX66120)
01537 {
01538 m_pTagHandler = new FedmIscTagHandler_ISO15693_Maxim_MAX66120(m_pReader, this);
01539 }
01540 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_MAXIM_MAX66140)
01541 {
01542 m_pTagHandler = new FedmIscTagHandler_ISO15693_Maxim_MAX66140(m_pReader, this);
01543 }
01544 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_IDS_SL13A)
01545 {
01546 m_pTagHandler = new FedmIscTagHandler_ISO15693_IDS_SL13A(m_pReader, this);
01547 }
01548 else
01549 {
01550 m_pTagHandler = new FedmIscTagHandler_ISO15693(m_pReader, this);
01551 }
01552 }
01553
01554 return FEDM_OK;
01555 }
01556 #endif
01557 #endif
01558
01559
01560 int FEDM_ISOTabItem::SetSnr_wo_Antenna(unsigned char* ucData, int& iByteCnt)
01561 {
01562 int iCnt;
01563 unsigned char ucHeader = 0;
01564 unsigned char ucEpcLen = 0;
01565
01566 memset(m_ucSnr, 0, FEDM_ISC_MAX_UID_LENGTH);
01567
01568 m_bIsEpc = false;
01569
01570 m_ucTrType = ucData[iByteCnt++];
01571
01572 ClearAntennaValues();
01573
01574 if((m_ucTrType & 0x80) == 0)
01575 {
01576 switch(m_ucTrType)
01577 {
01578 case FEDM_ISC_TR_TYPE_ICODE1:
01579 case FEDM_ISC_TR_TYPE_TAGIT:
01580 m_ucSnrLen = 8;
01581 m_ucDsfID = ucData[iByteCnt++];
01582 for(iCnt=0; iCnt<8; iCnt++)
01583 m_ucSnr[iCnt] = ucData[iByteCnt++];
01584
01585 break;
01586
01587 case FEDM_ISC_TR_TYPE_ISO15693:
01588
01589 m_ucSnrLen = 8;
01590 m_ucDsfID = ucData[iByteCnt++];
01591 for(iCnt=0; iCnt<8; iCnt++)
01592 m_ucSnr[iCnt] = ucData[iByteCnt++];
01593
01594 break;
01595
01596 case FEDM_ISC_TR_TYPE_ISO14443A:
01597 m_ucTrInfo = ucData[iByteCnt++];
01598 m_ucOptInfo = ucData[iByteCnt++];
01599 if(m_ucTrInfo & 0x04)
01600 {
01601 m_ucSnrLen = 10;
01602 for(iCnt=0; iCnt<10; iCnt++)
01603 m_ucSnr[iCnt] = ucData[iByteCnt++];
01604 }
01605 else
01606 {
01607 m_ucSnrLen = 8;
01608 m_ucSnr[0] = 0;
01609 for(iCnt=1; iCnt<8; iCnt++)
01610 m_ucSnr[iCnt] = ucData[iByteCnt++];
01611 }
01612
01613 break;
01614
01615 case FEDM_ISC_TR_TYPE_ISO14443B:
01616 m_ucSnrLen = 8;
01617 m_ucProtoInfo = ucData[iByteCnt++];
01618 for(iCnt=0; iCnt<8; iCnt++)
01619 m_ucSnr[iCnt] = ucData[iByteCnt++];
01620
01621 break;
01622
01623 case FEDM_ISC_TR_TYPE_EPC:
01624 ucHeader = (ucData[iByteCnt] & 0xC0) >> 6;
01625
01626 switch(ucHeader)
01627 {
01628 case FEDM_ISC_EPC_TYPE_1:
01629 m_ucSnrLen = 12;
01630 m_ucEpcType = FEDM_ISC_EPC_TYPE_1;
01631 for(iCnt=0; iCnt<12; iCnt++)
01632 m_ucSnr[iCnt] = ucData[iByteCnt++];
01633 m_bIsEpc = true;
01634 break;
01635
01636 case FEDM_ISC_EPC_TYPE_2:
01637 m_ucSnrLen = 8;
01638 m_ucEpcType = FEDM_ISC_EPC_TYPE_2;
01639 for(iCnt=0; iCnt<8; iCnt++)
01640 m_ucSnr[iCnt] = ucData[iByteCnt++];
01641 m_bIsEpc = true;
01642 break;
01643
01644 case FEDM_ISC_EPC_TYPE_3:
01645 m_ucSnrLen = 8;
01646 m_ucEpcType = FEDM_ISC_EPC_TYPE_3;
01647 for(iCnt=0; iCnt<8; iCnt++)
01648 m_ucSnr[iCnt] = ucData[iByteCnt++];
01649 m_bIsEpc = true;
01650 break;
01651
01652 case FEDM_ISC_EPC_TYPE_4:
01653 m_ucSnrLen = 8;
01654 m_ucEpcType = FEDM_ISC_EPC_TYPE_4;
01655 for(iCnt=0; iCnt<8; iCnt++)
01656 m_ucSnr[iCnt] = ucData[iByteCnt++];
01657 m_bIsEpc = true;
01658 break;
01659 }
01660
01661 break;
01662
01663 case FEDM_ISC_TR_TYPE_ICODE_UID:
01664 m_ucSnrLen = 19;
01665 for(iCnt=0; iCnt<19; iCnt++)
01666 m_ucSnr[iCnt] = ucData[iByteCnt++];
01667
01668 break;
01669
01670 case FEDM_ISC_TR_TYPE_JEWEL:
01671 m_ucSnrLen = 8;
01672
01673
01674 iByteCnt += 2;
01675
01676
01677 memset(m_ucSnr, 0, FEDM_ISC_MAX_UID_LENGTH);
01678 for(iCnt=0; iCnt<6; iCnt++)
01679 m_ucSnr[iCnt+2] = ucData[iByteCnt++];
01680
01681 break;
01682
01683 case FEDM_ISC_TR_TYPE_ISO18000_3M3:
01684 m_ucIDDT = ucData[iByteCnt++];
01685 m_ucSnrLen = ucData[iByteCnt++] - 2;
01686
01687 if(m_ucSnrLen > FEDM_ISC_MAX_UID_LENGTH)
01688 {
01689 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " - EPC Class1 Gen2 HF: UID > " << FEDM_ISC_MAX_UID_LENGTH);
01690 return FEDM_ERROR_ARRAY_BOUNDARY;
01691 }
01692
01693 m_ucClass1Gen2_PC[0] = ucData[iByteCnt++];
01694 m_ucClass1Gen2_PC[1] = ucData[iByteCnt++];
01695
01696
01697 if(m_ucClass1Gen2_PC[0] & 0x02)
01698 {
01699 m_ucClass1Gen2_XPC_W1[0] = ucData[iByteCnt++];
01700 m_ucClass1Gen2_XPC_W1[1] = ucData[iByteCnt++];
01701 m_ucSnrLen -= 2;
01702 }
01703
01704 for(iCnt=0; iCnt<(int)m_ucSnrLen; iCnt++)
01705 m_ucSnr[iCnt] = ucData[iByteCnt++];
01706
01707 if(m_ucIDDT == 0x01)
01708 {
01709 ucHeader = (m_ucSnr[0] & 0xC0) >> 6;
01710 switch(ucHeader)
01711 {
01712 case FEDM_ISC_EPC_TYPE_1:
01713 m_ucEpcType = FEDM_ISC_EPC_TYPE_1;
01714 m_bIsEpc = true;
01715 break;
01716
01717 case FEDM_ISC_EPC_TYPE_2:
01718 m_ucEpcType = FEDM_ISC_EPC_TYPE_2;
01719 m_bIsEpc = true;
01720 break;
01721
01722 case FEDM_ISC_EPC_TYPE_3:
01723 m_ucEpcType = FEDM_ISC_EPC_TYPE_3;
01724 m_bIsEpc = true;
01725 break;
01726
01727 case FEDM_ISC_EPC_TYPE_4:
01728 m_ucEpcType = FEDM_ISC_EPC_TYPE_4;
01729 m_bIsEpc = true;
01730 break;
01731 }
01732 }
01733 else if(m_ucIDDT == 0x02)
01734 {
01735
01736 ucEpcLen = ((m_ucClass1Gen2_PC[0] & 0xF8) >> 3) * 2;
01737 if(m_ucClass1Gen2_PC[0] & 0x02)
01738 ucEpcLen -= 2;
01739
01740 if( ucEpcLen < m_ucSnrLen && (m_ucSnrLen - ucEpcLen) >= 4)
01741 {
01742
01743 m_ucRxDB_TidBank[1] = m_ucSnr[ucEpcLen];
01744 m_ucRxDB_TidBank[0] = m_ucSnr[ucEpcLen+1];
01745 m_ucRxDB_TidBank[3] = m_ucSnr[ucEpcLen+2];
01746 m_ucRxDB_TidBank[2] = m_ucSnr[ucEpcLen+3];
01747 }
01748 }
01749 break;
01750
01751 case FEDM_ISC_TR_TYPE_STM_SR176:
01752 m_ucSnrLen = 8;
01753 m_ucChipID = ucData[iByteCnt++];
01754 for(iCnt=0; iCnt<8; iCnt++)
01755 m_ucSnr[iCnt] = ucData[iByteCnt++];
01756
01757 break;
01758
01759 case FEDM_ISC_TR_TYPE_STM_SRIxx:
01760 m_ucSnrLen = 8;
01761 m_ucChipID = ucData[iByteCnt++];
01762 for(iCnt=0; iCnt<8; iCnt++)
01763 m_ucSnr[iCnt] = ucData[iByteCnt++];
01764
01765 break;
01766
01767 case FEDM_ISC_TR_TYPE_MCRFxxx:
01768 m_ucSnrLen = ucData[iByteCnt++];
01769 for(iCnt=0; iCnt<m_ucSnrLen; iCnt++)
01770 m_ucSnr[iCnt] = ucData[iByteCnt++];
01771
01772 break;
01773
01774 case FEDM_ISC_TR_TYPE_KEYBOARD:
01775 m_ucSnrLen = ucData[iByteCnt++];
01776 for(iCnt=0; iCnt<(int)m_ucSnrLen; iCnt++)
01777 m_ucSnr[iCnt] = ucData[iByteCnt++];
01778
01779 break;
01780
01781 case FEDM_ISC_TR_TYPE_INNOVATRON:
01782 m_ucSnrLen = 8;
01783 for(iCnt=0; iCnt<8; iCnt++)
01784 m_ucSnr[iCnt] = ucData[iByteCnt++];
01785
01786 m_ucVerlog = ucData[iByteCnt++];
01787 m_ucConfig = ucData[iByteCnt++];
01788 m_ucAtrLen = ucData[iByteCnt++];
01789 if(m_ucAtrLen <= 33)
01790 {
01791 for(iCnt=0; iCnt <(int)m_ucAtrLen; iCnt++)
01792 m_ucAtr[iCnt] = ucData[iByteCnt++];
01793 }
01794 break;
01795
01796 case FEDM_ISC_TR_TYPE_ASK_CTx:
01797 m_ucProductCode = ucData[iByteCnt++];
01798 m_ucFabCode = ucData[iByteCnt++];
01799 m_ucAppCode = ucData[iByteCnt++];
01800 m_ucEmbedderCode = ucData[iByteCnt++];
01801 m_ucSnrLen = 8;
01802 for(iCnt=0; iCnt<8; iCnt++)
01803 m_ucSnr[iCnt] = ucData[iByteCnt++];
01804
01805 break;
01806
01807 case 0x7F:
01808 m_ucTrSubType = ucData[iByteCnt++];
01809 m_ucSnrLen = ucData[iByteCnt++];
01810 for(iCnt=0; iCnt<(int)m_ucSnrLen; iCnt++)
01811 m_ucSnr[iCnt] = ucData[iByteCnt++];
01812
01813 break;
01814 }
01815 }
01816 else if((m_ucTrType & 0x80) == 0x80)
01817 {
01818 switch(m_ucTrType)
01819 {
01820 case FEDM_ISC_TR_TYPE_ISO18000_6_A:
01821 case FEDM_ISC_TR_TYPE_ISO18000_6_B:
01822 case FEDM_ISC_TR_TYPE_EM4222:
01823 m_ucIDDT = ucData[iByteCnt++];
01824 m_ucSnrLen = ucData[iByteCnt++];
01825
01826 if(m_ucSnrLen > FEDM_ISC_MAX_UID_LENGTH)
01827 {
01828 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " - ISO 18000-6: UID > " << FEDM_ISC_MAX_UID_LENGTH);
01829 return FEDM_ERROR_ARRAY_BOUNDARY;
01830 }
01831
01832 for(iCnt=0; iCnt<(int)m_ucSnrLen; iCnt++)
01833 m_ucSnr[iCnt] = ucData[iByteCnt++];
01834
01835 break;
01836
01837 case FEDM_ISC_TR_TYPE_EPC_CLASS0:
01838 case FEDM_ISC_TR_TYPE_EPC_CLASS1_GEN1:
01839 m_ucIDDT = ucData[iByteCnt++];
01840 m_ucSnrLen = ucData[iByteCnt++];
01841
01842 if(m_ucSnrLen > FEDM_ISC_MAX_UID_LENGTH)
01843 {
01844 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " - EPC Class0/1: UID > " << FEDM_ISC_MAX_UID_LENGTH);
01845 return FEDM_ERROR_ARRAY_BOUNDARY;
01846 }
01847
01848 for(iCnt=0; iCnt<(int)m_ucSnrLen; iCnt++)
01849 m_ucSnr[iCnt] = ucData[iByteCnt++];
01850
01851 if(m_ucIDDT == 0x01)
01852 {
01853 ucHeader = (m_ucSnr[0] & 0xC0) >> 6;
01854 switch(ucHeader)
01855 {
01856 case FEDM_ISC_EPC_TYPE_1:
01857 m_ucEpcType = FEDM_ISC_EPC_TYPE_1;
01858 m_bIsEpc = true;
01859 break;
01860
01861 case FEDM_ISC_EPC_TYPE_2:
01862 m_ucEpcType = FEDM_ISC_EPC_TYPE_2;
01863 m_bIsEpc = true;
01864 break;
01865
01866 case FEDM_ISC_EPC_TYPE_3:
01867 m_ucEpcType = FEDM_ISC_EPC_TYPE_3;
01868 m_bIsEpc = true;
01869 break;
01870
01871 case FEDM_ISC_EPC_TYPE_4:
01872 m_ucEpcType = FEDM_ISC_EPC_TYPE_4;
01873 m_bIsEpc = true;
01874 break;
01875 }
01876 }
01877 break;
01878
01879 case FEDM_ISC_TR_TYPE_EPC_CLASS1_GEN2:
01880 m_ucIDDT = ucData[iByteCnt++];
01881 m_ucSnrLen = ucData[iByteCnt++] - 2;
01882
01883 if(m_ucSnrLen > FEDM_ISC_MAX_UID_LENGTH)
01884 {
01885 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " - EPC Class1 Gen2 UHF: UID > " << FEDM_ISC_MAX_UID_LENGTH);
01886 return FEDM_ERROR_ARRAY_BOUNDARY;
01887 }
01888
01889 m_ucClass1Gen2_PC[0] = ucData[iByteCnt++];
01890 m_ucClass1Gen2_PC[1] = ucData[iByteCnt++];
01891
01892
01893 if(m_ucClass1Gen2_PC[0] & 0x02)
01894 {
01895 m_ucClass1Gen2_XPC_W1[0] = ucData[iByteCnt++];
01896 m_ucClass1Gen2_XPC_W1[1] = ucData[iByteCnt++];
01897 m_ucSnrLen -= 2;
01898 }
01899
01900 for(iCnt=0; iCnt<(int)m_ucSnrLen; iCnt++)
01901 m_ucSnr[iCnt] = ucData[iByteCnt++];
01902
01903 if(m_ucIDDT == 0x01)
01904 {
01905 ucHeader = (m_ucSnr[0] & 0xC0) >> 6;
01906 switch(ucHeader)
01907 {
01908 case FEDM_ISC_EPC_TYPE_1:
01909 m_ucEpcType = FEDM_ISC_EPC_TYPE_1;
01910 m_bIsEpc = true;
01911 break;
01912
01913 case FEDM_ISC_EPC_TYPE_2:
01914 m_ucEpcType = FEDM_ISC_EPC_TYPE_2;
01915 m_bIsEpc = true;
01916 break;
01917
01918 case FEDM_ISC_EPC_TYPE_3:
01919 m_ucEpcType = FEDM_ISC_EPC_TYPE_3;
01920 m_bIsEpc = true;
01921 break;
01922
01923 case FEDM_ISC_EPC_TYPE_4:
01924 m_ucEpcType = FEDM_ISC_EPC_TYPE_4;
01925 m_bIsEpc = true;
01926 break;
01927 }
01928 }
01929 else if(m_ucIDDT == 0x02)
01930 {
01931
01932 ucEpcLen = ((m_ucClass1Gen2_PC[0] & 0xF8) >> 3) * 2;
01933 if(m_ucClass1Gen2_PC[0] & 0x02)
01934 ucEpcLen -= 2;
01935
01936 if( ucEpcLen < m_ucSnrLen && (m_ucSnrLen - ucEpcLen) >= 4)
01937 {
01938
01939 m_ucRxDB_TidBank[1] = m_ucSnr[ucEpcLen];
01940 m_ucRxDB_TidBank[0] = m_ucSnr[ucEpcLen+1];
01941 m_ucRxDB_TidBank[3] = m_ucSnr[ucEpcLen+2];
01942 m_ucRxDB_TidBank[2] = m_ucSnr[ucEpcLen+3];
01943 }
01944 }
01945 break;
01946
01947 default:
01948 m_ucIDDT = ucData[iByteCnt++];
01949 m_ucSnrLen = ucData[iByteCnt++];
01950
01951 if(m_ucSnrLen > FEDM_ISC_MAX_UID_LENGTH)
01952 {
01953 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " - Tr-Type=0x" << std::hex << std::uppercase << (int)m_ucTrType << ": UID > " << FEDM_ISC_MAX_UID_LENGTH);
01954 return FEDM_ERROR_ARRAY_BOUNDARY;
01955 }
01956
01957 for(iCnt=0; iCnt<(int)m_ucSnrLen; iCnt++)
01958 m_ucSnr[iCnt] = ucData[iByteCnt++];
01959
01960 break;
01961 }
01962 }
01963
01964 return FEDM_OK;
01965 }
01966
01967 int FEDM_ISOTabItem::SetSnr_with_Antenna(unsigned char* ucData, int& iByteCnt)
01968 {
01969 int iCnt;
01970 unsigned char ucHeader = 0;
01971 unsigned char ucEpcLen = 0;
01972
01973 memset(m_ucSnr, 0, FEDM_ISC_MAX_UID_LENGTH);
01974
01975 m_bIsEpc = false;
01976
01977 ClearAntennaValues();
01978
01979 m_ucFlags = ucData[iByteCnt++];
01980
01981 if(m_ucFlags & 0x01)
01982 {
01983
01984 m_ucTrType = ucData[iByteCnt++];
01985
01986 if((m_ucTrType & 0x80) == 0)
01987 {
01988 switch(m_ucTrType)
01989 {
01990 case FEDM_ISC_TR_TYPE_ICODE1:
01991 case FEDM_ISC_TR_TYPE_TAGIT:
01992 m_ucDsfID = ucData[iByteCnt++];
01993 m_ucSnrLen = ucData[iByteCnt++];
01994 for(iCnt=0; iCnt<m_ucSnrLen; iCnt++)
01995 m_ucSnr[iCnt] = ucData[iByteCnt++];
01996
01997 break;
01998
01999 case FEDM_ISC_TR_TYPE_ISO15693:
02000
02001 m_ucDsfID = ucData[iByteCnt++];
02002 m_ucSnrLen = ucData[iByteCnt++];
02003 for(iCnt=0; iCnt<m_ucSnrLen; iCnt++)
02004 m_ucSnr[iCnt] = ucData[iByteCnt++];
02005
02006 break;
02007
02008 case FEDM_ISC_TR_TYPE_EPC:
02009 m_ucDsfID = ucData[iByteCnt++];
02010 m_ucSnrLen = ucData[iByteCnt++];
02011
02012 ucHeader = (ucData[iByteCnt] & 0xC0) >> 6;
02013
02014 switch(ucHeader)
02015 {
02016 case FEDM_ISC_EPC_TYPE_1:
02017 m_ucSnrLen = 12;
02018 m_ucEpcType = FEDM_ISC_EPC_TYPE_1;
02019 for(iCnt=0; iCnt<12; iCnt++)
02020 m_ucSnr[iCnt] = ucData[iByteCnt++];
02021 m_bIsEpc = true;
02022 break;
02023
02024 case FEDM_ISC_EPC_TYPE_2:
02025 m_ucSnrLen = 8;
02026 m_ucEpcType = FEDM_ISC_EPC_TYPE_2;
02027 for(iCnt=0; iCnt<8; iCnt++)
02028 m_ucSnr[iCnt] = ucData[iByteCnt++];
02029 m_bIsEpc = true;
02030 break;
02031
02032 case FEDM_ISC_EPC_TYPE_3:
02033 m_ucSnrLen = 8;
02034 m_ucEpcType = FEDM_ISC_EPC_TYPE_3;
02035 for(iCnt=0; iCnt<8; iCnt++)
02036 m_ucSnr[iCnt] = ucData[iByteCnt++];
02037 m_bIsEpc = true;
02038 break;
02039
02040 case FEDM_ISC_EPC_TYPE_4:
02041 m_ucSnrLen = 8;
02042 m_ucEpcType = FEDM_ISC_EPC_TYPE_4;
02043 for(iCnt=0; iCnt<8; iCnt++)
02044 m_ucSnr[iCnt] = ucData[iByteCnt++];
02045 m_bIsEpc = true;
02046 break;
02047 }
02048
02049 break;
02050
02051 case FEDM_ISC_TR_TYPE_ICODE_UID:
02052 m_ucDsfID = ucData[iByteCnt++];
02053 m_ucSnrLen = ucData[iByteCnt++];
02054 for(iCnt=0; iCnt<m_ucSnrLen; iCnt++)
02055 m_ucSnr[iCnt] = ucData[iByteCnt++];
02056
02057 break;
02058
02059 case FEDM_ISC_TR_TYPE_ISO14443A:
02060 m_ucTrInfo = ucData[iByteCnt++];
02061 m_ucOptInfo = ucData[iByteCnt++];
02062 if(m_ucTrInfo & 0x04)
02063 {
02064 m_ucSnrLen = 10;
02065 for(iCnt=0; iCnt<10; iCnt++)
02066 m_ucSnr[iCnt] = ucData[iByteCnt++];
02067 }
02068 else
02069 {
02070 m_ucSnrLen = 8;
02071 m_ucSnr[0] = 0;
02072 for(iCnt=1; iCnt<8; iCnt++)
02073 m_ucSnr[iCnt] = ucData[iByteCnt++];
02074 }
02075
02076 break;
02077
02078 case FEDM_ISC_TR_TYPE_ISO14443B:
02079 m_ucSnrLen = 8;
02080 m_ucProtoInfo = ucData[iByteCnt++];
02081 for(iCnt=0; iCnt<8; iCnt++)
02082 m_ucSnr[iCnt] = ucData[iByteCnt++];
02083
02084 break;
02085
02086
02087
02088
02089 case FEDM_ISC_TR_TYPE_ISO18000_3M3:
02090 m_ucIDDT = ucData[iByteCnt++];
02091 m_ucSnrLen = ucData[iByteCnt++] - 2;
02092
02093 if(m_ucSnrLen > FEDM_ISC_MAX_UID_LENGTH)
02094 {
02095 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " - EPC Class1 Gen2 HF: UID > " << FEDM_ISC_MAX_UID_LENGTH);
02096 return FEDM_ERROR_ARRAY_BOUNDARY;
02097 }
02098
02099 m_ucClass1Gen2_PC[0] = ucData[iByteCnt++];
02100 m_ucClass1Gen2_PC[1] = ucData[iByteCnt++];
02101
02102
02103 if(m_ucClass1Gen2_PC[0] & 0x02)
02104 {
02105 m_ucClass1Gen2_XPC_W1[0] = ucData[iByteCnt++];
02106 m_ucClass1Gen2_XPC_W1[1] = ucData[iByteCnt++];
02107 m_ucSnrLen -= 2;
02108 }
02109
02110 for(iCnt=0; iCnt<(int)m_ucSnrLen; iCnt++)
02111 m_ucSnr[iCnt] = ucData[iByteCnt++];
02112
02113 if(m_ucIDDT == 0x01)
02114 {
02115 ucHeader = (m_ucSnr[0] & 0xC0) >> 6;
02116 switch(ucHeader)
02117 {
02118 case FEDM_ISC_EPC_TYPE_1:
02119 m_ucEpcType = FEDM_ISC_EPC_TYPE_1;
02120 m_bIsEpc = true;
02121 break;
02122
02123 case FEDM_ISC_EPC_TYPE_2:
02124 m_ucEpcType = FEDM_ISC_EPC_TYPE_2;
02125 m_bIsEpc = true;
02126 break;
02127
02128 case FEDM_ISC_EPC_TYPE_3:
02129 m_ucEpcType = FEDM_ISC_EPC_TYPE_3;
02130 m_bIsEpc = true;
02131 break;
02132
02133 case FEDM_ISC_EPC_TYPE_4:
02134 m_ucEpcType = FEDM_ISC_EPC_TYPE_4;
02135 m_bIsEpc = true;
02136 break;
02137 }
02138 }
02139 else if(m_ucIDDT == 0x02)
02140 {
02141
02142 ucEpcLen = ((m_ucClass1Gen2_PC[0] & 0xF8) >> 3) * 2;
02143 if(m_ucClass1Gen2_PC[0] & 0x02)
02144 ucEpcLen -= 2;
02145
02146 if( ucEpcLen < m_ucSnrLen && (m_ucSnrLen - ucEpcLen) >= 4)
02147 {
02148
02149 m_ucRxDB_TidBank[1] = m_ucSnr[ucEpcLen];
02150 m_ucRxDB_TidBank[0] = m_ucSnr[ucEpcLen+1];
02151 m_ucRxDB_TidBank[3] = m_ucSnr[ucEpcLen+2];
02152 m_ucRxDB_TidBank[2] = m_ucSnr[ucEpcLen+3];
02153 }
02154 }
02155 break;
02156
02157
02158
02159
02160
02161 case FEDM_ISC_TR_TYPE_MCRFxxx:
02162 m_ucIDDT = ucData[iByteCnt++];
02163 m_ucSnrLen = ucData[iByteCnt++];
02164 for(iCnt=0; iCnt<m_ucSnrLen; iCnt++)
02165 m_ucSnr[iCnt] = ucData[iByteCnt++];
02166
02167 break;
02168
02169
02170
02171
02172 case FEDM_ISC_TR_TYPE_INNOVATRON:
02173 m_ucVerlog = ucData[iByteCnt++];
02174 m_ucConfig = ucData[iByteCnt++];
02175 m_ucAtrLen = ucData[iByteCnt++];
02176 for(iCnt=0; iCnt <(int)m_ucAtrLen; iCnt++)
02177 m_ucAtr[iCnt] = ucData[iByteCnt++];
02178
02179 break;
02180
02181 case FEDM_ISC_TR_TYPE_ASK_CTx:
02182 m_ucProductCode = ucData[iByteCnt++];
02183 m_ucFabCode = ucData[iByteCnt++];
02184 m_ucAppCode = ucData[iByteCnt++];
02185 m_ucEmbedderCode = ucData[iByteCnt++];
02186 break;
02187
02188 }
02189 }
02190 else if((m_ucTrType & 0x80) == 0x80)
02191 {
02192 switch(m_ucTrType)
02193 {
02194 case FEDM_ISC_TR_TYPE_ISO18000_6_A:
02195 case FEDM_ISC_TR_TYPE_ISO18000_6_B:
02196 case FEDM_ISC_TR_TYPE_EM4222:
02197 m_ucIDDT = ucData[iByteCnt++];
02198 m_ucSnrLen = ucData[iByteCnt++];
02199
02200 if(m_ucSnrLen > FEDM_ISC_MAX_UID_LENGTH)
02201 {
02202 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " - ISO18000-6: UID > " << FEDM_ISC_MAX_UID_LENGTH);
02203 return FEDM_ERROR_ARRAY_BOUNDARY;
02204 }
02205
02206 for(iCnt=0; iCnt<(int)m_ucSnrLen; iCnt++)
02207 m_ucSnr[iCnt] = ucData[iByteCnt++];
02208
02209 break;
02210
02211 case FEDM_ISC_TR_TYPE_EPC_CLASS0:
02212 case FEDM_ISC_TR_TYPE_EPC_CLASS1_GEN1:
02213 m_ucIDDT = ucData[iByteCnt++];
02214 m_ucSnrLen = ucData[iByteCnt++];
02215
02216 if(m_ucSnrLen > FEDM_ISC_MAX_UID_LENGTH)
02217 {
02218 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " - EPC Class0/1: UID > " << FEDM_ISC_MAX_UID_LENGTH);
02219 return FEDM_ERROR_ARRAY_BOUNDARY;
02220 }
02221
02222 for(iCnt=0; iCnt<(int)m_ucSnrLen; iCnt++)
02223 m_ucSnr[iCnt] = ucData[iByteCnt++];
02224
02225 if(m_ucIDDT == 0x01)
02226 {
02227 ucHeader = (m_ucSnr[0] & 0xC0) >> 6;
02228 switch(ucHeader)
02229 {
02230 case FEDM_ISC_EPC_TYPE_1:
02231 m_ucEpcType = FEDM_ISC_EPC_TYPE_1;
02232 m_bIsEpc = true;
02233 break;
02234
02235 case FEDM_ISC_EPC_TYPE_2:
02236 m_ucEpcType = FEDM_ISC_EPC_TYPE_2;
02237 m_bIsEpc = true;
02238 break;
02239
02240 case FEDM_ISC_EPC_TYPE_3:
02241 m_ucEpcType = FEDM_ISC_EPC_TYPE_3;
02242 m_bIsEpc = true;
02243 break;
02244
02245 case FEDM_ISC_EPC_TYPE_4:
02246 m_ucEpcType = FEDM_ISC_EPC_TYPE_4;
02247 m_bIsEpc = true;
02248 break;
02249 }
02250 }
02251 break;
02252
02253 case FEDM_ISC_TR_TYPE_EPC_CLASS1_GEN2:
02254 m_ucIDDT = ucData[iByteCnt++];
02255 m_ucSnrLen = ucData[iByteCnt++] - 2;
02256
02257 if(m_ucSnrLen > FEDM_ISC_MAX_UID_LENGTH)
02258 {
02259 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " - EPC Class1 Gen2 UHF: UID > " << FEDM_ISC_MAX_UID_LENGTH);
02260 return FEDM_ERROR_ARRAY_BOUNDARY;
02261 }
02262
02263 m_ucClass1Gen2_PC[0] = ucData[iByteCnt++];
02264 m_ucClass1Gen2_PC[1] = ucData[iByteCnt++];
02265
02266
02267 if(m_ucClass1Gen2_PC[0] & 0x02)
02268 {
02269 m_ucClass1Gen2_XPC_W1[0] = ucData[iByteCnt++];
02270 m_ucClass1Gen2_XPC_W1[1] = ucData[iByteCnt++];
02271 m_ucSnrLen -= 2;
02272 }
02273
02274 for(iCnt=0; iCnt<(int)m_ucSnrLen; iCnt++)
02275 m_ucSnr[iCnt] = ucData[iByteCnt++];
02276
02277 if(m_ucIDDT == 0x01)
02278 {
02279 ucHeader = (m_ucSnr[0] & 0xC0) >> 6;
02280 switch(ucHeader)
02281 {
02282 case FEDM_ISC_EPC_TYPE_1:
02283 m_ucEpcType = FEDM_ISC_EPC_TYPE_1;
02284 m_bIsEpc = true;
02285 break;
02286
02287 case FEDM_ISC_EPC_TYPE_2:
02288 m_ucEpcType = FEDM_ISC_EPC_TYPE_2;
02289 m_bIsEpc = true;
02290 break;
02291
02292 case FEDM_ISC_EPC_TYPE_3:
02293 m_ucEpcType = FEDM_ISC_EPC_TYPE_3;
02294 m_bIsEpc = true;
02295 break;
02296
02297 case FEDM_ISC_EPC_TYPE_4:
02298 m_ucEpcType = FEDM_ISC_EPC_TYPE_4;
02299 m_bIsEpc = true;
02300 break;
02301 }
02302 }
02303 else if(m_ucIDDT == 0x02)
02304 {
02305
02306 ucEpcLen = ((m_ucClass1Gen2_PC[0] & 0xF8) >> 3) * 2;
02307 if(m_ucClass1Gen2_PC[0] & 0x02)
02308 ucEpcLen -= 2;
02309
02310 if( ucEpcLen < m_ucSnrLen && (m_ucSnrLen - ucEpcLen) >= 4)
02311 {
02312
02313 m_ucRxDB_TidBank[1] = m_ucSnr[ucEpcLen];
02314 m_ucRxDB_TidBank[0] = m_ucSnr[ucEpcLen+1];
02315 m_ucRxDB_TidBank[3] = m_ucSnr[ucEpcLen+2];
02316 m_ucRxDB_TidBank[2] = m_ucSnr[ucEpcLen+3];
02317 }
02318 }
02319 break;
02320
02321 default:
02322 m_ucIDDT = ucData[iByteCnt++];
02323 m_ucSnrLen = ucData[iByteCnt++];
02324
02325 if(m_ucSnrLen > FEDM_ISC_MAX_UID_LENGTH)
02326 {
02327 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " - Tr-Type=0x" << std::hex << std::uppercase << (int)m_ucTrType << ": UID > " << FEDM_ISC_MAX_UID_LENGTH);
02328 return FEDM_ERROR_ARRAY_BOUNDARY;
02329 }
02330
02331 for(iCnt=0; iCnt<(int)m_ucSnrLen; iCnt++)
02332 m_ucSnr[iCnt] = ucData[iByteCnt++];
02333
02334 break;
02335 }
02336 }
02337
02338 if(m_ucFlags & 0x10)
02339 {
02340 m_ucAntCount = ucData[iByteCnt++];
02341 if(m_ucAntCount > FEDM_ISC_ISO_TABLE_MAX_ANTENNA)
02342 {
02343 FEDM_TRACE(m_pReader->m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " - Ant-Count=" << (int)m_ucAntCount << " > " << FEDM_ISC_ISO_TABLE_MAX_ANTENNA);
02344 return FEDM_ERROR_ARRAY_BOUNDARY;
02345 }
02346
02347 for(iCnt=0; iCnt<m_ucAntCount; iCnt++)
02348 {
02349 m_ucAntNumber[iCnt] = ucData[iByteCnt++];
02350 m_ucAntStatus[iCnt] = ucData[iByteCnt++];
02351 m_ucAntRSSI[iCnt] = ucData[iByteCnt++];
02352 iByteCnt += 4;
02353 }
02354
02355 m_bIsRSSI = true;
02356 }
02357 }
02358 else
02359 {
02360
02361 if(m_ucFlags & 0x10)
02362 {
02363 m_ucAntCount = 1;
02364
02365 m_ucAntNumber[0] = ucData[iByteCnt++];
02366 m_ucAntStatus[0] = ucData[iByteCnt++];
02367 m_ucAntRSSI[0] = ucData[iByteCnt++];
02368 iByteCnt += 4;
02369
02370 m_bIsRSSI = true;
02371 }
02372 }
02373
02374 return FEDM_OK;
02375 }