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
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121 #include "FEDM_ISCReaderModule.h"
00122 #include "FEDM_ISOTabItem.h"
00123 #include "FEDM_ISCReaderID.h"
00124
00125 #include "FEDM_ISCReaderConfig.h"
00126 #include "../FEDM_Functions.h"
00127 #include "feisc.h"
00128 #ifdef _FEDM_TAG_HANDLER
00129 #include "./tag_handler/FedmIscTagHandler.h"
00130 #if !defined(_FEDM_NO_TAG_HANDLER_EPC_C1_G2)
00131 #include "./tag_handler/FedmIscTagHandler_EPC_Class1_Gen2.h"
00132 #include "./tag_handler/FedmIscTagHandler_EPC_Class1_Gen2_IDS_SL900A.h"
00133 #endif
00134 #if !defined(_FEDM_NO_TAG_HANDLER_ISO18000_3M3)
00135 #include "./tag_handler/FedmIscTagHandler_ISO18000_3M3.h"
00136 #endif
00137 #if !defined(_FEDM_NO_TAG_HANDLER_ISO14443)
00138 #include "fetcl.h"
00139 #include "./tag_handler/FedmIscTagHandler_ISO14443.h"
00140 #include "./tag_handler/FedmIscTagHandler_ISO14443_2.h"
00141 #include "./tag_handler/FedmIscTagHandler_ISO14443_2_Innovision_Jewel.h"
00142 #include "./tag_handler/FedmIscTagHandler_ISO14443_2_STM_SR176.h"
00143 #include "./tag_handler/FedmIscTagHandler_ISO14443_2_STM_SRIxxx.h"
00144 #include "./tag_handler/FedmIscTagHandler_ISO14443_3.h"
00145 #include "./tag_handler/FedmIscTagHandler_ISO14443_3_Infineon_my_d.h"
00146 #include "./tag_handler/FedmIscTagHandler_ISO14443_3_Infineon_my_d_move.h"
00147 #include "./tag_handler/FedmIscTagHandler_ISO14443_3_MIFARE_Classic.h"
00148 #include "./tag_handler/FedmIscTagHandler_ISO14443_3_MIFARE_Ultralight.h"
00149 #include "./tag_handler/FedmIscTagHandler_ISO14443_3_MIFARE_Plus.h"
00150 #include "./tag_handler/FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1.h"
00151 #include "./tag_handler/FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL2.h"
00152 #include "./tag_handler/FedmIscTagHandler_ISO14443_4.h"
00153 #include "./tag_handler/FedmIscTagHandler_ISO14443_4_Maxim.h"
00154 #include "./tag_handler/FedmIscTagHandler_ISO14443_4_Maxim_MAX66000.h"
00155 #include "./tag_handler/FedmIscTagHandler_ISO14443_4_Maxim_MAX66020.h"
00156 #include "./tag_handler/FedmIscTagHandler_ISO14443_4_Maxim_MAX66040.h"
00157 #include "./tag_handler/FedmIscTagHandler_ISO14443_4_MIFARE_DESFire.h"
00158 #include "./tag_handler/FedmIscTagHandler_ISO14443_4_MIFARE_Plus.h"
00159 #include "./tag_handler/FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL1.h"
00160 #include "./tag_handler/FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL2.h"
00161 #include "./tag_handler/FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL3.h"
00162 #endif
00163 #if !defined(_FEDM_NO_TAG_HANDLER_ISO15693)
00164 #include "./tag_handler/FedmIscTagHandler_ISO15693.h"
00165 #include "./tag_handler/FedmIscTagHandler_ISO15693_STM.h"
00166 #include "./tag_handler/FedmIscTagHandler_ISO15693_STM_LRI2K.h"
00167 #include "./tag_handler/FedmIscTagHandler_ISO15693_STM_LRIS2K.h"
00168 #include "./tag_handler/FedmIscTagHandler_ISO15693_STM_LRIS64K.h"
00169 #include "./tag_handler/FedmIscTagHandler_ISO15693_STM_M24LR64R.h"
00170 #include "./tag_handler/FedmIscTagHandler_ISO15693_STM_M24LRxxER.h"
00171 #include "./tag_handler/FedmIscTagHandler_ISO15693_NXP.h"
00172 #include "./tag_handler/FedmIscTagHandler_ISO15693_NXP_ICODE_SLI.h"
00173 #include "./tag_handler/FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX.h"
00174 #include "./tag_handler/FedmIscTagHandler_ISO15693_NXP_ICODE_SLI_L.h"
00175 #include "./tag_handler/FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX_L.h"
00176 #include "./tag_handler/FedmIscTagHandler_ISO15693_NXP_ICODE_SLI_S.h"
00177 #include "./tag_handler/FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX_S.h"
00178 #include "./tag_handler/FedmIscTagHandler_ISO15693_Infineon.h"
00179 #include "./tag_handler/FedmIscTagHandler_ISO15693_Infineon_my_d.h"
00180 #include "./tag_handler/FedmIscTagHandler_ISO15693_TI.h"
00181 #include "./tag_handler/FedmIscTagHandler_ISO15693_TI_Tag_it_HFI_Pro.h"
00182 #include "./tag_handler/FedmIscTagHandler_ISO15693_TI_Tag_it_HFI_Plus.h"
00183 #include "./tag_handler/FedmIscTagHandler_ISO15693_Fujitsu.h"
00184 #include "./tag_handler/FedmIscTagHandler_ISO15693_Fujitsu_MB89R1xx.h"
00185 #include "./tag_handler/FedmIscTagHandler_ISO15693_EM.h"
00186 #include "./tag_handler/FedmIscTagHandler_ISO15693_EM_4034.h"
00187 #include "./tag_handler/FedmIscTagHandler_ISO15693_KSW.h"
00188 #include "./tag_handler/FedmIscTagHandler_ISO15693_Maxim.h"
00189 #include "./tag_handler/FedmIscTagHandler_ISO15693_Maxim_MAX66100.h"
00190 #include "./tag_handler/FedmIscTagHandler_ISO15693_Maxim_MAX66120.h"
00191 #include "./tag_handler/FedmIscTagHandler_ISO15693_Maxim_MAX66140.h"
00192 #include "./tag_handler/FedmIscTagHandler_ISO15693_IDS_SL13A.h"
00193 #endif
00194 #endif
00195
00196
00197
00198
00199
00201
00203
00204 FEDM_ISCReaderModule::FEDM_ISCReaderModule()
00205 {
00206 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_ADMIN, __FUNCTION__);
00207
00208 m_iCommMode = FEDM_COMM_MODE_UNDEF;
00209 m_bActiveAsyncTask = false;
00210
00211
00212 memset(m_ucModifiedCfgPages, 0, 16);
00213
00214 memset(&m_TaskInit, 0, sizeof(FEDM_TASK_INIT));
00215
00216
00217 int iReaderHnd = FEISC_NewReader(0);
00218 if(iReaderHnd > 0)
00219 {
00220
00221 m_iReaderHnd = iReaderHnd;
00222 FEISC_SetReaderPara(m_iReaderHnd, "LOGPROT", "1");
00223 }
00224 }
00225
00226 FEDM_ISCReaderModule::~FEDM_ISCReaderModule()
00227 {
00228 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_ADMIN, __FUNCTION__);
00229
00230 FEISC_SetReaderPara(m_iReaderHnd, "LOGPROT", "0");
00231 if(m_iReaderHnd > 0)
00232 FEISC_DeleteReader(m_iReaderHnd);
00233 }
00234
00235
00237
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252 int FEDM_ISCReaderModule::ConnectCOMM(int iPortNr)
00253 {
00254 FEDM_SETPROP2(m_pLogger, FELOGMNG_PROP_PORT_NR, (unsigned int)iPortNr);
00255 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_ADMIN, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "Port-Number=" << iPortNr);
00256
00257 #ifdef _FEDM_COM_SUPPORT
00258 if(m_iCommMode != FEDM_COMM_MODE_UNDEF)
00259 {
00260 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_ALREADY_CONNECTED));
00261 FEDM_RETURN(FEDM_ERROR_ALREADY_CONNECTED);
00262 }
00263
00264 if(iPortNr <= 0 || iPortNr > 256)
00265 {
00266 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_PARAMETER));
00267 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00268 }
00269
00270 bool bOpen = false;
00271 char cPortNr[5];
00272 int iErr;
00273 int iPortHnd = 0;
00274 int iReaderHnd = 0;
00275
00276 #if !defined(_FEDM_SUPPORT_SLINK)
00277 LPFN_FECOM_GET_PORT_HND lpfnGetPortHnd = (LPFN_FECOM_GET_PORT_HND)GetFeComFunction(FECOM_GET_PORT_HND);
00278 LPFN_FECOM_OPEN_PORT lpfnOpenPort = (LPFN_FECOM_OPEN_PORT)GetFeComFunction(FECOM_OPEN_PORT);
00279 LPFN_FECOM_CLOSE_PORT lpfnClosePort = (LPFN_FECOM_CLOSE_PORT)GetFeComFunction(FECOM_CLOSE_PORT);
00280 LPFN_FECOM_SET_PORT_PARA lpfnSetPortPara = (LPFN_FECOM_SET_PORT_PARA)GetFeComFunction(FECOM_SET_PORT_PARA);
00281
00282 FEDM_CHK5(lpfnGetPortHnd);
00283 FEDM_CHK5(lpfnOpenPort);
00284 FEDM_CHK5(lpfnClosePort);
00285 FEDM_CHK5(lpfnSetPortPara);
00286 #endif
00287
00288 sprintf(cPortNr, "%d", iPortNr);
00289
00290
00291 #if !defined(_FEDM_SUPPORT_SLINK)
00292 iPortHnd = lpfnGetPortHnd(cPortNr);
00293 #else
00294 iPortHnd = FECOM_GetPortHnd(cPortNr);
00295 #endif
00296 if(iPortHnd <= 0)
00297 {
00298
00299 #if !defined(_FEDM_SUPPORT_SLINK)
00300 iPortHnd = lpfnOpenPort(cPortNr);
00301 #else
00302 iPortHnd = FECOM_OpenPort(cPortNr);
00303 #endif
00304 if(iPortHnd < 0)
00305 {
00306 FEDM_RETURN(iPortHnd);
00307 }
00308 bOpen = true;
00309 }
00310
00311 if(m_iReaderHnd == 0)
00312 {
00313
00314 iReaderHnd = FEISC_NewReader(0);
00315 if(iReaderHnd < 0)
00316 {
00317 if(bOpen)
00318 {
00319 #if !defined(_FEDM_SUPPORT_SLINK)
00320 lpfnClosePort(iPortHnd);
00321 #else
00322 FECOM_ClosePort(iPortHnd);
00323 #endif
00324 }
00325 FEDM_RETURN(iReaderHnd);
00326 }
00327
00328
00329 m_iReaderHnd = iReaderHnd;
00330 FEISC_SetReaderPara(m_iReaderHnd, "LOGPROT", "1");
00331 }
00332
00333
00334 FEDM_CHK2(iErr, FEDM_ISCReaderModule::SetPortHnd(iPortHnd));
00335
00336 m_iCommMode = FEDM_COMM_MODE_SERIAL;
00337
00338
00339 #if !defined(_FEDM_SUPPORT_SLINK)
00340 FEDM_CHK2(iErr, lpfnSetPortPara(iPortHnd, "BAUD", "38400"));
00341 FEDM_CHK2(iErr, lpfnSetPortPara(iPortHnd, "FRAME", "8E1"));
00342 FEDM_CHK2(iErr, lpfnSetPortPara(iPortHnd, "TIMEOUT", "3000"));
00343 #else
00344 FEDM_CHK2(iErr, FECOM_SetPortPara(iPortHnd, "BAUD", "38400"));
00345 FEDM_CHK2(iErr, FECOM_SetPortPara(iPortHnd, "FRAME", "8E1"));
00346 FEDM_CHK2(iErr, FECOM_SetPortPara(iPortHnd, "TIMEOUT", "3000"));
00347 #endif
00348
00349 FEDM_RETURN(FEDM_OK);
00350 #else
00351 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00352 #endif
00353 }
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371 int FEDM_ISCReaderModule::ConnectTCP(char* cHostAdr, int iPortNr)
00372 {
00373 FEDM_SETPROP1(m_pLogger, (unsigned int)iPortNr, cHostAdr);
00374 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_ADMIN, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "IP-Address=" << cHostAdr << ", Port-Number=" << iPortNr);
00375
00376 #ifdef _FEDM_TCP_SUPPORT
00377 FEDM_CHK5(cHostAdr);
00378
00379 if(m_iCommMode != FEDM_COMM_MODE_UNDEF)
00380 {
00381 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_ALREADY_CONNECTED));
00382 FEDM_RETURN(FEDM_ERROR_ALREADY_CONNECTED);
00383 }
00384
00385 if(iPortNr <= 0 || iPortNr > 65535)
00386 {
00387 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_PARAMETER));
00388 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00389 }
00390
00391 bool bOpen = false;
00392 int iPortHnd = 0;
00393 int iReaderHnd = 0;
00394
00395 #if !defined(_FEDM_SUPPORT_SLINK)
00396 LPFN_FETCP_GET_SOCKET_HND lpfnGetSocketHnd = (LPFN_FETCP_GET_SOCKET_HND)GetFeTcpFunction(FETCP_GET_SOCKET_HND);
00397 LPFN_FETCP_CONNECT lpfnConnect = (LPFN_FETCP_CONNECT)GetFeTcpFunction(FETCP_CONNECT);
00398 LPFN_FETCP_DISCONNECT lpfnDisConnect = (LPFN_FETCP_DISCONNECT)GetFeTcpFunction(FETCP_DISCONNECT);
00399
00400 FEDM_CHK5(lpfnGetSocketHnd);
00401 FEDM_CHK5(lpfnConnect);
00402 FEDM_CHK5(lpfnDisConnect);
00403 #endif
00404
00405
00406 #if !defined(_FEDM_SUPPORT_SLINK)
00407 iPortHnd = lpfnGetSocketHnd(cHostAdr, iPortNr);
00408 #else
00409 iPortHnd = FETCP_GetSocketHnd(cHostAdr, iPortNr);
00410 #endif
00411 if(iPortHnd > 0)
00412 {
00413
00414 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_CONNECTED_WITH_OTHER_MODULE));
00415 FEDM_RETURN(FEDM_ERROR_CONNECTED_WITH_OTHER_MODULE);
00416 }
00417
00418
00419 #if !defined(_FEDM_SUPPORT_SLINK)
00420 iPortHnd = lpfnConnect(cHostAdr, iPortNr);
00421 #else
00422 iPortHnd = FETCP_Connect(cHostAdr, iPortNr);
00423 #endif
00424 if(iPortHnd < 0)
00425 {
00426 FEDM_RETURN(iPortHnd);
00427 }
00428 bOpen = true;
00429
00430 if(m_iReaderHnd == 0)
00431 {
00432
00433 iReaderHnd = FEISC_NewReader(0);
00434 if(iReaderHnd < 0)
00435 {
00436 if(bOpen)
00437 {
00438 #if !defined(_FEDM_SUPPORT_SLINK)
00439 lpfnDisConnect(iPortHnd);
00440 #else
00441 FETCP_DisConnect(iPortHnd);
00442 #endif
00443 }
00444 FEDM_RETURN(iReaderHnd);
00445 }
00446
00447
00448 m_iReaderHnd = iReaderHnd;
00449 FEISC_SetReaderPara(m_iReaderHnd, "LOGPROT", "1");
00450 }
00451
00452
00453 FEDM_ISCReaderModule::SetPortHnd(iPortHnd);
00454
00455 m_iCommMode = FEDM_COMM_MODE_TCP;
00456
00457 FEDM_RETURN(FEDM_OK);
00458 #else
00459 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00460 #endif
00461 }
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475 int FEDM_ISCReaderModule::ConnectUSB(unsigned long dwDeviceID)
00476 {
00477 FEDM_SETPROP2(m_pLogger, FELOGMNG_PROP_DEVICED_ID, (unsigned int)dwDeviceID);
00478 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_ADMIN, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "Device-ID=" << dwDeviceID);
00479
00480 #ifdef _FEDM_USB_SUPPORT
00481 if(m_iCommMode != FEDM_COMM_MODE_UNDEF)
00482 {
00483 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_ALREADY_CONNECTED));
00484 FEDM_RETURN(FEDM_ERROR_ALREADY_CONNECTED);
00485 }
00486
00487 bool bOpen = false;
00488 int iBack = 0;
00489 int iPortHnd = 0;
00490 int iReaderHnd = 0;
00491 char cDeviceID[32];
00492
00493 #if !defined(_FEDM_SUPPORT_SLINK)
00494 LPFN_FEUSB_GET_DEVICE_HND lpfnGetDeviceHnd = (LPFN_FEUSB_GET_DEVICE_HND)GetFeUsbFunction(FEUSB_GET_DEVICE_HND);
00495 LPFN_FEUSB_OPEN_DEVICE lpfnOpenDevice = (LPFN_FEUSB_OPEN_DEVICE)GetFeUsbFunction(FEUSB_OPEN_DEVICE);
00496 LPFN_FEUSB_CLOSE_DEVICE lpfnCloseDevice = (LPFN_FEUSB_CLOSE_DEVICE)GetFeUsbFunction(FEUSB_CLOSE_DEVICE);
00497 LPFN_FEUSB_SCAN_AND_OPEN lpfnScanAndOpen = (LPFN_FEUSB_SCAN_AND_OPEN)GetFeUsbFunction(FEUSB_SCAN_AND_OPEN);
00498 LPFN_FEUSB_SCAN lpfnScan = (LPFN_FEUSB_SCAN)GetFeUsbFunction(FEUSB_SCAN);
00499 LPFN_FEUSB_GET_SCAN_LIST_SIZE lpfnGetScanListSize = (LPFN_FEUSB_GET_SCAN_LIST_SIZE)GetFeUsbFunction(FEUSB_GET_SCAN_LIST_SIZE);
00500 LPFN_FEUSB_GET_SCAN_LIST_PARA lpfnGetScanListPara = (LPFN_FEUSB_GET_SCAN_LIST_PARA)GetFeUsbFunction(FEUSB_GET_SCAN_LIST_PARA);
00501 LPFN_FEUSB_CLEAR_SCAN_LIST lpfnClearScanList = (LPFN_FEUSB_CLEAR_SCAN_LIST)GetFeUsbFunction(FEUSB_CLEAR_SCAN_LIST);
00502 LPFN_FEUSB_GET_DEVICE_PARA lpfnGetDevicePara = (LPFN_FEUSB_GET_DEVICE_PARA)GetFeUsbFunction(FEUSB_GET_DEVICE_PARA);
00503
00504 FEDM_CHK5(lpfnGetDeviceHnd);
00505 FEDM_CHK5(lpfnOpenDevice);
00506 FEDM_CHK5(lpfnCloseDevice);
00507 FEDM_CHK5(lpfnScanAndOpen);
00508 FEDM_CHK5(lpfnScan);
00509 FEDM_CHK5(lpfnGetScanListSize);
00510 FEDM_CHK5(lpfnGetScanListPara);
00511 FEDM_CHK5(lpfnClearScanList);
00512 FEDM_CHK5(lpfnGetDevicePara);
00513 #endif
00514
00515 if(dwDeviceID == 0)
00516 {
00517 #if !defined(_FEDM_SUPPORT_SLINK)
00518 lpfnClearScanList();
00519
00520 FEDM_CHK2(iBack, lpfnScan(FEUSB_SCAN_ALL, NULL));
00521 iBack = lpfnGetScanListSize();
00522 if(iBack > 0)
00523 {
00524
00525 lpfnGetScanListPara(0, "Device-ID", cDeviceID);
00526 sscanf((const char*)cDeviceID, "%lx", &dwDeviceID);
00527 iPortHnd = lpfnOpenDevice(dwDeviceID);
00528 }
00529 #else
00530 FEUSB_ClearScanList();
00531
00532 FEDM_CHK2(iBack, FEUSB_Scan(FEUSB_SCAN_ALL, NULL));
00533 iBack = FEUSB_GetScanListSize();
00534 if(iBack > 0)
00535 {
00536
00537 FEUSB_GetScanListPara(0, "Device-ID", cDeviceID);
00538 sscanf((const char*)cDeviceID, "%lx", &dwDeviceID);
00539 iPortHnd = FEUSB_OpenDevice(dwDeviceID);
00540 }
00541 #endif
00542 if(iPortHnd < 0)
00543 {
00544 FEDM_RETURN(iPortHnd);
00545 }
00546 bOpen = true;
00547 }
00548 else
00549 {
00550
00551 #if !defined(_FEDM_SUPPORT_SLINK)
00552 iPortHnd = lpfnGetDeviceHnd(dwDeviceID);
00553 #else
00554 iPortHnd = FEUSB_GetDeviceHnd(dwDeviceID);
00555 #endif
00556 if(iPortHnd <= 0)
00557 {
00558
00559 #if !defined(_FEDM_SUPPORT_SLINK)
00560
00561 iBack = lpfnScan(FEUSB_SCAN_ALL, NULL);
00562 iPortHnd = lpfnOpenDevice(dwDeviceID);
00563 #else
00564
00565 iBack = FEUSB_Scan(FEUSB_SCAN_ALL, NULL);
00566 iPortHnd = FEUSB_OpenDevice(dwDeviceID);
00567 #endif
00568 if(iPortHnd < 0)
00569 {
00570 FEDM_RETURN(iPortHnd);
00571 }
00572 bOpen = true;
00573 }
00574 }
00575
00576 if(m_iReaderHnd == 0)
00577 {
00578
00579 iReaderHnd = FEISC_NewReader(iPortHnd);
00580 if(iReaderHnd < 0)
00581 {
00582 if(bOpen)
00583 {
00584 #if !defined(_FEDM_SUPPORT_SLINK)
00585 lpfnCloseDevice(iPortHnd);
00586 #else
00587 FEUSB_CloseDevice(iPortHnd);
00588 #endif
00589 }
00590 FEDM_RETURN(iReaderHnd);
00591 }
00592
00593
00594 m_iReaderHnd = iReaderHnd;
00595 FEISC_SetReaderPara(m_iReaderHnd, "LOGPROT", "1");
00596 }
00597
00598
00599 SetPortHnd(iPortHnd);
00600
00601 m_iCommMode = FEDM_COMM_MODE_USB;
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642 FEDM_RETURN(FEDM_OK);
00643 #else
00644 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00645 #endif
00646 }
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666 int FEDM_ISCReaderModule::DisConnect()
00667 {
00668 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_ADMIN, __FUNCTION__);
00669
00670 if(m_iCommMode == FEDM_COMM_MODE_UNDEF)
00671 {
00672 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
00673 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
00674 }
00675
00676 bool bCanClose = true;
00677 int iNextHnd = 0;
00678 int iPortHnd = 0;
00679 int iHnd;
00680 int iErr;
00681 char cPortHnd[11];
00682
00683
00684
00685 if(m_iReaderHnd > 0)
00686 {
00687
00688 cPortHnd[0] = '\0';
00689 FEDM_CHK2(iErr, FEISC_GetReaderPara(m_iReaderHnd, "PortHnd", cPortHnd));
00690 sscanf(cPortHnd, "%d", &iPortHnd);
00691
00692 if(iPortHnd <= 0)
00693 {
00694 m_iCommMode = FEDM_COMM_MODE_UNDEF;
00695 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
00696 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
00697 }
00698 }
00699
00700
00701
00702
00703 iNextHnd = FEISC_GetReaderList(0);
00704 while(iNextHnd > 0)
00705 {
00706 cPortHnd[0] = '\0';
00707 iErr = FEISC_GetReaderPara(iNextHnd, "PortHnd", cPortHnd);
00708 if(iErr < 0)
00709 break;
00710
00711 sscanf(cPortHnd, "%d", &iHnd);
00712 if((m_iReaderHnd != iNextHnd) && (iHnd == iPortHnd))
00713 {
00714 bCanClose = false;
00715 break;
00716 }
00717
00718 iNextHnd = FEISC_GetReaderList(iNextHnd);
00719 }
00720
00721
00722
00723 if(bCanClose)
00724 {
00725 if(m_iCommMode == FEDM_COMM_MODE_SERIAL)
00726 {
00727 #ifdef _FEDM_COM_SUPPORT
00728 #if !defined(_FEDM_SUPPORT_SLINK)
00729 LPFN_FECOM_CLOSE_PORT lpfnClosePort = (LPFN_FECOM_CLOSE_PORT)GetFeComFunction(FECOM_CLOSE_PORT);
00730 FEDM_CHK5(lpfnClosePort);
00731 iErr = lpfnClosePort(iPortHnd);
00732 if(iErr < 0)
00733 {
00734 m_iCommMode = FEDM_COMM_MODE_UNDEF;
00735 SetPortHnd(0);
00736 }
00737 #else
00738 iErr = FECOM_ClosePort(iPortHnd);
00739 if(iErr < 0)
00740 {
00741 m_iCommMode = FEDM_COMM_MODE_UNDEF;
00742 SetPortHnd(0);
00743 }
00744 #endif
00745 #endif
00746 }
00747 else if(m_iCommMode == FEDM_COMM_MODE_TCP)
00748 {
00749 #ifdef _FEDM_TCP_SUPPORT
00750 #if !defined(_FEDM_SUPPORT_SLINK)
00751 LPFN_FETCP_DISCONNECT lpfnDisConnect = (LPFN_FETCP_DISCONNECT)GetFeTcpFunction(FETCP_DISCONNECT);
00752 FEDM_CHK5(lpfnDisConnect);
00753 iErr = lpfnDisConnect(iPortHnd);
00754 if(iErr < 0)
00755 {
00756 m_iCommMode = FEDM_COMM_MODE_UNDEF;
00757 SetPortHnd(0);
00758 }
00759 #else
00760 iErr = FETCP_DisConnect(iPortHnd);
00761 if(iErr < 0)
00762 {
00763 m_iCommMode = FEDM_COMM_MODE_UNDEF;
00764 SetPortHnd(0);
00765 }
00766 #endif
00767 if(iErr > 0)
00768 {
00769 m_iCommMode = FEDM_COMM_MODE_UNDEF;
00770 SetPortHnd(0);
00771 SetLastError(0);
00772 return iErr;
00773 }
00774 #endif
00775 }
00776 else if(m_iCommMode == FEDM_COMM_MODE_USB)
00777 {
00778 #ifdef _FEDM_USB_SUPPORT
00779 #if !defined(_FEDM_SUPPORT_SLINK)
00780 LPFN_FEUSB_CLOSE_DEVICE lpfnCloseDevice = (LPFN_FEUSB_CLOSE_DEVICE)GetFeUsbFunction(FEUSB_CLOSE_DEVICE);
00781 LPFN_FEUSB_SCAN lpfnScan = (LPFN_FEUSB_SCAN)GetFeUsbFunction(FEUSB_SCAN);
00782 FEDM_CHK5(lpfnCloseDevice);
00783 FEDM_CHK5(lpfnScan);
00784 iErr = lpfnCloseDevice(iPortHnd);
00785 if(iErr < 0)
00786 {
00787 m_iCommMode = FEDM_COMM_MODE_UNDEF;
00788 SetPortHnd(0);
00789 }
00790 FEDM_CHK2(iErr, lpfnScan(FEUSB_SCAN_PACK, NULL));
00791 #else
00792 iErr = FEUSB_CloseDevice(iPortHnd);
00793 if(iErr < 0)
00794 {
00795 m_iCommMode = FEDM_COMM_MODE_UNDEF;
00796 SetPortHnd(0);
00797 }
00798 FEDM_CHK2(iErr, FEUSB_Scan(FEUSB_SCAN_PACK, NULL));
00799 #endif
00800 #endif
00801 }
00802 }
00803
00804
00805 m_iCommMode = FEDM_COMM_MODE_UNDEF;
00806 SetPortHnd(0);
00807
00808 FEDM_RETURN(FEDM_OK);
00809 }
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822 bool FEDM_ISCReaderModule::IsConnected()
00823 {
00824 if(m_iCommMode == FEDM_COMM_MODE_UNDEF)
00825 {
00826 if(FEDM_IS_PIPORT(GetPortHnd()))
00827 {
00828
00829 return true;
00830 }
00831
00832 return false;
00833 }
00834
00835 return true;
00836 }
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862 int FEDM_ISCReaderModule::GetTcpConnectionState()
00863 {
00864 #ifdef _FEDM_TCP_SUPPORT
00865 if(m_iCommMode != FEDM_COMM_MODE_TCP)
00866 {
00867 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
00868 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00869 }
00870
00871 int iPortNr = 0;
00872 char cHostAdr[32];
00873
00874 GetPortPara("HOSTADR", cHostAdr);
00875 GetPortPara("PORTNR", &iPortNr);
00876
00877 #if !defined(_FEDM_SUPPORT_SLINK)
00878 LPFN_FETCP_GET_SOCKET_STATE lpfnGetSocketState = (LPFN_FETCP_GET_SOCKET_STATE)GetFeTcpFunction(FETCP_GET_SOCKET_STATE);
00879 FEDM_CHK5(lpfnGetSocketState);
00880 SetLastError(0);
00881 return lpfnGetSocketState(cHostAdr, iPortNr);
00882 #else
00883 SetLastError(0);
00884 return FETCP_GetSocketState(cHostAdr, iPortNr);
00885 #endif
00886 #else
00887 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00888 #endif
00889 }
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907 int FEDM_ISCReaderModule::ReaderAuthentication(unsigned char ucAuthentType, string sAuthentKey)
00908 {
00909 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_HIGH_LEVEL, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "AuthentType=" << (int)ucAuthentType);
00910
00911 switch(ucAuthentType)
00912 {
00913 case 0:
00914 if(sAuthentKey.length() != 32)
00915 {
00916 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_STRING_LENGTH));
00917 FEDM_RETURN(FEDM_ERROR_STRING_LENGTH);
00918 }
00919 break;
00920
00921 case 1:
00922 if(sAuthentKey.length() != 48)
00923 {
00924 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_STRING_LENGTH));
00925 FEDM_RETURN(FEDM_ERROR_STRING_LENGTH);
00926 }
00927 break;
00928
00929 case 2:
00930 if(sAuthentKey.length() != 64)
00931 {
00932 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_STRING_LENGTH));
00933 FEDM_RETURN(FEDM_ERROR_STRING_LENGTH);
00934 }
00935 break;
00936
00937 default:
00938 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_PARAMETER));
00939 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00940 }
00941
00942 return FEISC_0xAE_ReaderAuthent(m_iReaderHnd,
00943 m_ucBusAdr,
00944 0,
00945 ucAuthentType,
00946 (unsigned char)sAuthentKey.length(),
00947 (unsigned char*)sAuthentKey.c_str(),
00948 1);
00949 }
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968 int FEDM_ISCReaderModule::ReaderAuthentication(unsigned char ucAuthentType, unsigned int uiAuthentKeyLength, unsigned char* ucAuthentKey)
00969 {
00970 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_HIGH_LEVEL, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "AuthentType=" << (int)ucAuthentType);
00971
00972 FEDM_CHK5(ucAuthentKey);
00973
00974 switch(ucAuthentType)
00975 {
00976 case 0:
00977 if(uiAuthentKeyLength != 16)
00978 {
00979 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_STRING_LENGTH));
00980 FEDM_RETURN(FEDM_ERROR_STRING_LENGTH);
00981 }
00982 break;
00983
00984 case 1:
00985 if(uiAuthentKeyLength != 24)
00986 {
00987 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_STRING_LENGTH));
00988 FEDM_RETURN(FEDM_ERROR_STRING_LENGTH);
00989 }
00990 break;
00991
00992 case 2:
00993 if(uiAuthentKeyLength != 32)
00994 {
00995 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_STRING_LENGTH));
00996 FEDM_RETURN(FEDM_ERROR_STRING_LENGTH);
00997 }
00998 break;
00999
01000 default:
01001 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_PARAMETER));
01002 FEDM_RETURN(FEDM_ERROR_PARAMETER);
01003 }
01004
01005 return FEISC_0xAE_ReaderAuthent(m_iReaderHnd,
01006 m_ucBusAdr,
01007 0,
01008 ucAuthentType,
01009 (unsigned char)uiAuthentKeyLength,
01010 ucAuthentKey,
01011 0);
01012 }
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023
01024
01025
01026
01027 int FEDM_ISCReaderModule::SetPortHnd(int iPortHnd)
01028 {
01029 int iErr = 0;
01030
01031 FEDM_CHK2(iErr, FEDM_ISCReader::SetPortHnd(iPortHnd));
01032
01033 if(iPortHnd > 0)
01034 {
01035 if(FEDM_IS_COMPORT(iPortHnd))
01036 m_iCommMode = FEDM_COMM_MODE_SERIAL;
01037 else if(FEDM_IS_USBPORT(iPortHnd))
01038 m_iCommMode = FEDM_COMM_MODE_USB;
01039 else if(FEDM_IS_TCPPORT(iPortHnd))
01040 m_iCommMode = FEDM_COMM_MODE_TCP;
01041 else
01042 m_iCommMode = FEDM_COMM_MODE_UNDEF;
01043 }
01044 else
01045 {
01046 m_iCommMode = FEDM_COMM_MODE_UNDEF;
01047 }
01048
01049 return FEDM_OK;
01050 }
01051
01052
01054
01056
01057
01058
01059
01060
01061
01062
01063
01064
01065
01066
01067
01068
01069
01070
01071
01072
01073
01074
01075
01076 #ifdef _FEDM_TAG_HANDLER
01077 FEDM_ISC_TAG_LIST* FEDM_ISCReaderModule::TagInventory( bool bAll,
01078 unsigned char ucMode,
01079 unsigned char ucAntennas )
01080 {
01081 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_TAG_HANDLER, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "bAll=" << (int)bAll << ", Mode=0x" << std::hex << std::uppercase << (int)ucMode << ", Antennas=0x" << std::hex << std::uppercase << (int)ucAntennas);
01082
01083 string sSnr;
01084
01085 m_mapTagHandler.clear();
01086 SetLastError(FEDM_OK);
01087
01088
01089 SetData(FEDM_ISC_TMP_B0_CMD, (unsigned char)0x01);
01090
01091 if(bAll)
01092 {
01093 SetData(FEDM_ISC_TMP_B0_MODE, ucMode);
01094 SetData(FEDM_ISC_TMP_B0_MODE_MORE, false);
01095 ResetTable(FEDM_ISC_ISO_TABLE);
01096 }
01097 else
01098 {
01099 SetData(FEDM_ISC_TMP_B0_MODE, ucMode);
01100 }
01101
01102 if(ucMode & FEDM_ISC_ISO_MODE_ANT)
01103 SetData(FEDM_ISC_TMP_B0_REQ_ANT_SEL, ucAntennas);
01104
01105
01106 int iBack = SendProtocol(0xB0);
01107 if( ! ( iBack==0x00 ||
01108 iBack==0x01 ||
01109 iBack==0x02 ||
01110 iBack==0x03 ||
01111 iBack==0x83 ||
01112 iBack==0x84 ||
01113 iBack==0x90 ||
01114 iBack==0x93 ||
01115 iBack==0x94 ||
01116 iBack==0x95 ) )
01117 {
01118 SetLastError(iBack);
01119 return &m_mapTagHandler;
01120 }
01121
01122 if( bAll )
01123 {
01124 while(iBack == 0x94)
01125 {
01126 SetData(FEDM_ISC_TMP_B0_MODE_MORE, true);
01127 iBack = SendProtocol(0xB0);
01128 }
01129 }
01130
01131 if( m_bEnableTagHandler )
01132 {
01133
01134 for(unsigned int uiCnt=0; uiCnt<m_uiISOTableLength; uiCnt++)
01135 {
01136 if(m_ISOTable[uiCnt]->m_pTagHandler != NULL)
01137 {
01138 if(m_ISOTable[uiCnt]->GetSnr(sSnr) != FEDM_OK)
01139 continue;
01140
01141
01142 if( m_mapTagHandler.find(sSnr) != m_mapTagHandler.end())
01143 continue;
01144
01145 m_mapTagHandler.insert(make_pair(sSnr, m_ISOTable[uiCnt]->m_pTagHandler));
01146 }
01147 }
01148 }
01149
01150 return &m_mapTagHandler;
01151 }
01152 #endif
01153
01154
01155
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173
01174
01175
01176
01177 #ifdef _FEDM_TAG_HANDLER
01178 FedmIscTagHandler* FEDM_ISCReaderModule::TagSelect( FedmIscTagHandler* pTagHandler,
01179 unsigned int uiTagDriver )
01180 {
01181 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_TAG_HANDLER, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "TagDriver=" << uiTagDriver);
01182
01183 SetLastError(FEDM_OK);
01184
01185 if( !m_bEnableTagHandler )
01186 {
01187 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " Support for TagHandler disabled");
01188 SetLastError(FEDM_ERROR_UNSUPPORTED);
01189 return NULL;
01190 }
01191
01192 if(pTagHandler == NULL)
01193 {
01194 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " TagHandler is NULL");
01195 SetLastError(FEDM_ERROR_NULL_POINTER);
01196 return NULL;
01197 }
01198
01199 int iBack = 0;
01200 int iErr = 0;
01201
01202
01203 FEDM_CHK7(iErr, SetData(FEDM_ISC_TMP_B0_MODE, (unsigned char)0));
01204 FEDM_CHK7(iErr, SetData(FEDM_ISC_TMP_B0_MODE_ADR, (unsigned char)FEDM_ISC_ISO_MODE_ADR));
01205 if( m_bSelectWithCinf && (!m_bDisableSelectWithCinf) )
01206 {
01207 FEDM_CHK7(iErr, SetData(FEDM_ISC_TMP_B0_MODE_CINF, true));
01208 }
01209
01210
01211 if(uiTagDriver > 0)
01212 {
01213 FEDM_CHK7(iErr, SetData(FEDM_ISC_TMP_B0_MODE_DRV_SEL, true));
01214 FEDM_CHK7(iErr, SetData(FEDM_ISC_TMP_B0_REQ_TR_DRIVER, uiTagDriver));
01215 }
01216 else
01217 {
01218 FEDM_CHK7(iErr, SetData(FEDM_ISC_TMP_B0_MODE_DRV_SEL, false));
01219 }
01220
01221 if(strlen(pTagHandler->GetUID()) != 16)
01222 {
01223 FEDM_CHK7(iErr, SetData(FEDM_ISC_TMP_B0_MODE_UID_LF, true));
01224 FEDM_CHK7(iErr, SetData(FEDM_ISC_TMP_B0_REQ_UID_LEN, (unsigned int)strlen(pTagHandler->GetUID()) >> 1 ));
01225 }
01226 FEDM_CHK7(iErr, SetData(FEDM_ISC_TMP_B0_REQ_UID, (char*)pTagHandler->GetUID(), (int)strlen(pTagHandler->GetUID())));
01227
01228 FEDM_CHK7(iErr, SetData(FEDM_ISC_TMP_B0_CMD, (unsigned char)0x25));
01229
01230
01231 iBack = SendProtocol(0xB0);
01232 if(iBack)
01233 {
01234 SetLastError(iBack);
01235 return NULL;
01236 }
01237
01238 int iIdx = FindTableIndex(0, FEDM_ISC_ISO_TABLE, FEDM_ISC_DATA_IS_SELECTED, true);
01239 if(iIdx < 0)
01240 return NULL;
01241
01242
01243 switch(pTagHandler->m_pTabItem->m_ucTrType)
01244 {
01245
01246 case FEDM_ISC_TR_TYPE_ICODE1:
01247 case FEDM_ISC_TR_TYPE_TAGIT:
01248 case FEDM_ISC_TR_TYPE_ISO15693:
01249 pTagHandler->m_bNonAddressedMode = false;
01250 return pTagHandler;
01251
01252 #if !defined(_FEDM_NO_TAG_HANDLER_ISO14443)
01253 case FEDM_ISC_TR_TYPE_ISO14443A:
01254 case FEDM_ISC_TR_TYPE_ISO14443B:
01255 {
01256 if(uiTagDriver > 0)
01257 {
01258 return TagSelect_CreateNewTagHandler(iIdx, uiTagDriver, pTagHandler);
01259 }
01260 else
01261 {
01262 unsigned char ucFormat = 0;
01263
01264 FEDM_CHK7(iErr, GetData(FEDM_ISC_TMP_B0_RSP_FORMAT, &ucFormat));
01265 switch(ucFormat)
01266 {
01267 case 0:
01268 return pTagHandler;
01269
01270 case 1:
01271 return TagSelect_EvaFormat1(iIdx, pTagHandler);
01272
01273 case 2:
01274 return TagSelect_EvaFormat2(iIdx, pTagHandler);
01275
01276 case 3:
01277 return TagSelect_EvaFormat3(iIdx, pTagHandler);
01278 }
01279 }
01280 }
01281 break;
01282 #endif
01283
01284 case FEDM_ISC_TR_TYPE_EPC:
01285 case FEDM_ISC_TR_TYPE_ICODE_UID:
01286 case FEDM_ISC_TR_TYPE_JEWEL:
01287 case FEDM_ISC_TR_TYPE_ISO18000_3M3:
01288 case FEDM_ISC_TR_TYPE_STM_SR176:
01289 case FEDM_ISC_TR_TYPE_STM_SRIxx:
01290 case FEDM_ISC_TR_TYPE_MCRFxxx:
01291 case FEDM_ISC_TR_TYPE_INNOVATRON:
01292 case FEDM_ISC_TR_TYPE_ASK_CTx:
01293
01294 pTagHandler->m_bNonAddressedMode = false;
01295 return pTagHandler;
01296
01297
01298 case FEDM_ISC_TR_TYPE_ISO18000_6_A:
01299 case FEDM_ISC_TR_TYPE_ISO18000_6_B:
01300 case FEDM_ISC_TR_TYPE_EM4222:
01301 case FEDM_ISC_TR_TYPE_EPC_CLASS1_GEN2:
01302 case FEDM_ISC_TR_TYPE_EPC_CLASS0:
01303 case FEDM_ISC_TR_TYPE_EPC_CLASS1_GEN1:
01304 pTagHandler->m_bNonAddressedMode = false;
01305 return pTagHandler;
01306 }
01307
01308 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " Unknown Transponder-Type 0x" << std::hex << std::uppercase << (int)pTagHandler->m_pTabItem->m_ucTrType);
01309 return NULL;
01310 }
01311 #endif
01312
01313
01314
01315
01317
01319
01320
01321
01322
01323
01324
01325
01326
01327
01328
01329
01330
01331
01332
01333
01334
01335
01336
01337
01338
01339 #ifdef _FEDM_TAG_HANDLER
01340 #if !defined(_FEDM_NO_TAG_HANDLER_ISO14443)
01341 FedmIscTagHandler* FEDM_ISCReaderModule::TagSelect_CreateNewTagHandler(int iIdx, unsigned int uiTagDriver, FedmIscTagHandler* pTagHandler)
01342 {
01343 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_TAG_HANDLER, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "TagDriver=" << uiTagDriver);
01344
01345 if(dynamic_cast<FedmIscTagHandler_ISO14443*>(pTagHandler) == NULL)
01346 {
01347 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " TagHandler is not of type ISO 14443");
01348 return NULL;
01349 }
01350
01351 if(uiTagDriver == 1)
01352 {
01353 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4)
01354 {
01355 FedmIscTagHandler_ISO14443_4* pNewTagHandler = NULL;
01356 pNewTagHandler = new FedmIscTagHandler_ISO14443_4(this, pTagHandler->m_pTabItem);
01357 if(pNewTagHandler != NULL)
01358 {
01359 delete pTagHandler;
01360 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01361 return (FedmIscTagHandler*)pNewTagHandler;
01362 }
01363 }
01364 else
01365 {
01366 pTagHandler->Init();
01367 return pTagHandler;
01368 }
01369 }
01370 else if(uiTagDriver == 2)
01371 {
01372 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_3_MIFARE_CLASSIC)
01373 {
01374 FedmIscTagHandler_ISO14443_3_MIFARE_Classic* pNewTagHandler = NULL;
01375 pNewTagHandler = new FedmIscTagHandler_ISO14443_3_MIFARE_Classic(this, pTagHandler->m_pTabItem);
01376 if(pNewTagHandler != NULL)
01377 {
01378 delete pTagHandler;
01379 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01380 return (FedmIscTagHandler*)pNewTagHandler;
01381 }
01382 }
01383 else
01384 {
01385 pTagHandler->Init();
01386 return pTagHandler;
01387 }
01388 }
01389 else if(uiTagDriver == 3)
01390 {
01391 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_3_MIFARE_ULTRALIGHT)
01392 {
01393 FedmIscTagHandler_ISO14443_3_MIFARE_Ultralight* pNewTagHandler = NULL;
01394 pNewTagHandler = new FedmIscTagHandler_ISO14443_3_MIFARE_Ultralight(this, pTagHandler->m_pTabItem);
01395 if(pNewTagHandler != NULL)
01396 {
01397 delete pTagHandler;
01398 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01399 return (FedmIscTagHandler*)pNewTagHandler;
01400 }
01401 }
01402 else
01403 {
01404 pTagHandler->Init();
01405 return pTagHandler;
01406 }
01407 }
01408 else if(uiTagDriver == 4)
01409 {
01410 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_3_MIFARE_PLUS_SL1)
01411 {
01412 FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1* pNewTagHandler = NULL;
01413 pNewTagHandler = new FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1(this, pTagHandler->m_pTabItem);
01414 if(pNewTagHandler != NULL)
01415 {
01416 delete pTagHandler;
01417 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01418 return (FedmIscTagHandler*)pNewTagHandler;
01419 }
01420 }
01421 else
01422 {
01423 pTagHandler->Init();
01424 return pTagHandler;
01425 }
01426 }
01427 else if(uiTagDriver == 5)
01428 {
01429 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4_MIFARE_PLUS_SL1)
01430 {
01431 FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL1* pNewTagHandler = NULL;
01432 pNewTagHandler = new FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL1(this, pTagHandler->m_pTabItem);
01433 if(pNewTagHandler != NULL)
01434 {
01435 delete pTagHandler;
01436 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01437 return (FedmIscTagHandler*)pNewTagHandler;
01438 }
01439 }
01440 else
01441 {
01442 pTagHandler->Init();
01443 return pTagHandler;
01444 }
01445 }
01446 else if(uiTagDriver == 6)
01447 {
01448 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_3_MIFARE_PLUS_SL2)
01449 {
01450 FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL2* pNewTagHandler = NULL;
01451 pNewTagHandler = new FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL2(this, pTagHandler->m_pTabItem);
01452 if(pNewTagHandler != NULL)
01453 {
01454 delete pTagHandler;
01455 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01456 return (FedmIscTagHandler*)pNewTagHandler;
01457 }
01458 }
01459 else
01460 {
01461 pTagHandler->Init();
01462 return pTagHandler;
01463 }
01464 }
01465 else if(uiTagDriver == 7)
01466 {
01467 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4_MIFARE_PLUS_SL2)
01468 {
01469 FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL2* pNewTagHandler = NULL;
01470 pNewTagHandler = new FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL2(this, pTagHandler->m_pTabItem);
01471 if(pNewTagHandler != NULL)
01472 {
01473 delete pTagHandler;
01474 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01475 return (FedmIscTagHandler*)pNewTagHandler;
01476 }
01477 }
01478 else
01479 {
01480 pTagHandler->Init();
01481 return pTagHandler;
01482 }
01483 }
01484 else if(uiTagDriver == 8)
01485 {
01486 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4_MIFARE_PLUS_SL3)
01487 {
01488 FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL3* pNewTagHandler = NULL;
01489 pNewTagHandler = new FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL3(this, pTagHandler->m_pTabItem);
01490 if(pNewTagHandler != NULL)
01491 {
01492 delete pTagHandler;
01493 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01494 return (FedmIscTagHandler*)pNewTagHandler;
01495 }
01496 }
01497 else
01498 {
01499 pTagHandler->Init();
01500 return pTagHandler;
01501 }
01502 }
01503 else if(uiTagDriver == 9)
01504 {
01505 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4_MIFARE_DESFIRE)
01506 {
01507 FedmIscTagHandler_ISO14443_4_MIFARE_DESFire* pNewTagHandler = NULL;
01508 pNewTagHandler = new FedmIscTagHandler_ISO14443_4_MIFARE_DESFire( this, pTagHandler->m_pTabItem);
01509 if(pNewTagHandler != NULL)
01510 {
01511 pNewTagHandler->Init();
01512 delete pTagHandler;
01513 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01514 return (FedmIscTagHandler*)pNewTagHandler;
01515 }
01516 }
01517 else
01518 {
01519 pTagHandler->Init();
01520 return pTagHandler;
01521 }
01522 }
01523 else if(uiTagDriver == 10)
01524 {
01525 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_3_INFINEON_MY_D)
01526 {
01527 FedmIscTagHandler_ISO14443_3_Infineon_my_d* pNewTagHandler = NULL;
01528 pNewTagHandler = new FedmIscTagHandler_ISO14443_3_Infineon_my_d(this, pTagHandler->m_pTabItem);
01529 if(pNewTagHandler != NULL)
01530 {
01531 delete pTagHandler;
01532 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01533 return (FedmIscTagHandler*)pNewTagHandler;
01534 }
01535 }
01536 else
01537 {
01538 pTagHandler->Init();
01539 return pTagHandler;
01540 }
01541 }
01542 else if(uiTagDriver == 11)
01543 {
01544 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_3_INFINEON_MY_D_MOVE)
01545 {
01546 FedmIscTagHandler_ISO14443_3_Infineon_my_d_move* pNewTagHandler = NULL;
01547 pNewTagHandler = new FedmIscTagHandler_ISO14443_3_Infineon_my_d_move(this, pTagHandler->m_pTabItem);
01548 if(pNewTagHandler != NULL)
01549 {
01550 delete pTagHandler;
01551 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01552 return (FedmIscTagHandler*)pNewTagHandler;
01553 }
01554 }
01555 else
01556 {
01557 pTagHandler->Init();
01558 return pTagHandler;
01559 }
01560 }
01561 else
01562 {
01563 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " Unvalid TagDriver parameter");
01564 }
01565
01566 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " Creation of TagHandler failed - no more mem?");
01567 return NULL;
01568 }
01569 #endif
01570 #endif
01571
01572
01573
01574
01575
01576
01577
01578
01579
01580
01581
01582
01583
01584
01585
01586
01587
01588
01589
01590
01591
01592 #ifdef _FEDM_TAG_HANDLER
01593 #if !defined(_FEDM_NO_TAG_HANDLER_ISO14443)
01594 FedmIscTagHandler* FEDM_ISCReaderModule::TagSelect_EvaFormat1(int iIdx, FedmIscTagHandler* pTagHandler)
01595 {
01596 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_TAG_HANDLER, __FUNCTION__);
01597
01598
01599 unsigned int uiAtqA = ((unsigned int)m_TmpData[2048] << 8) + m_TmpData[2049];
01600
01601
01602 unsigned char ucSAK = m_TmpData[2050];
01603
01604 if( (m_ISOTable[iIdx]->m_ucOptInfo & 0x03) == 0x00 )
01605 {
01606
01607
01608 if(ucSAK & 0x20)
01609 {
01610
01611 if(dynamic_cast<FedmIscTagHandler_ISO14443*>(pTagHandler) == NULL)
01612 return NULL;
01613
01614 switch(ucSAK)
01615 {
01616 case 0x20:
01617 if(uiAtqA == 0x0002 || uiAtqA == 0x0004)
01618 {
01619 unsigned char ucTL = m_TmpData[2051];
01620 unsigned char ucT0 = m_TmpData[2052];
01621 unsigned char* pucAts = &m_TmpData[2052];
01622 unsigned char ucMfPx[] = {0xC1, 0x05, 0x2F, 0x2F, 0x01, 0xBC, 0xD6};
01623 unsigned char ucMfPs[] = {0xC1, 0x05, 0x2F, 0x2F, 0x00, 0x35, 0xC7};
01624
01625 if(ucTL >= 9)
01626 {
01627 if(ucT0 & 0x10)
01628 {
01629 pucAts++;
01630 }
01631 if(ucT0 & 0x20)
01632 {
01633 pucAts++;
01634 }
01635 if(ucT0 & 0x40)
01636 {
01637 pucAts++;
01638 }
01639 pucAts++;
01640
01641 if( memcmp(pucAts, ucMfPx, 7) == 0 || memcmp(pucAts, ucMfPs, 7) == 0)
01642 {
01643
01644
01645 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4_MIFARE_PLUS_SL3)
01646 {
01647 FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL3* pNewTagHandler = NULL;
01648 pNewTagHandler = new FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL3(this, pTagHandler->m_pTabItem);
01649 if(pNewTagHandler != NULL)
01650 {
01651 delete pTagHandler;
01652 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01653 return (FedmIscTagHandler*)pNewTagHandler;
01654 }
01655 }
01656 else
01657 {
01658 pTagHandler->Init();
01659 return pTagHandler;
01660 }
01661 }
01662 else
01663 {
01664 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4)
01665 {
01666 FedmIscTagHandler_ISO14443_4* pNewTagHandler = NULL;
01667 pNewTagHandler = new FedmIscTagHandler_ISO14443_4(this, pTagHandler->m_pTabItem);
01668 if(pNewTagHandler != NULL)
01669 {
01670 delete pTagHandler;
01671 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01672 return (FedmIscTagHandler*)pNewTagHandler;
01673 }
01674 }
01675 else
01676 {
01677 pTagHandler->Init();
01678 return pTagHandler;
01679 }
01680 }
01681 }
01682 else
01683 {
01684 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4)
01685 {
01686 FedmIscTagHandler_ISO14443_4* pNewTagHandler = NULL;
01687 pNewTagHandler = new FedmIscTagHandler_ISO14443_4(this, pTagHandler->m_pTabItem);
01688 if(pNewTagHandler != NULL)
01689 {
01690 delete pTagHandler;
01691 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01692 return (FedmIscTagHandler*)pNewTagHandler;
01693 }
01694 }
01695 else
01696 {
01697 pTagHandler->Init();
01698 return pTagHandler;
01699 }
01700 }
01701 }
01702 else if(uiAtqA == 0x0304 && m_ISOTable[iIdx]->m_ucSnr[7] == 0x80)
01703 {
01704
01705 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4_MIFARE_DESFIRE)
01706 {
01707
01708 FedmIscTagHandler_ISO14443_4_MIFARE_DESFire* pNewTagHandler = NULL;
01709 pNewTagHandler = new FedmIscTagHandler_ISO14443_4_MIFARE_DESFire(this, pTagHandler->m_pTabItem);
01710 if(pNewTagHandler != NULL)
01711 {
01712 delete pTagHandler;
01713 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01714 return (FedmIscTagHandler*)pNewTagHandler;
01715 }
01716 }
01717 else
01718 {
01719 pTagHandler->Init();
01720 return pTagHandler;
01721 }
01722 }
01723 else
01724 {
01725 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4)
01726 {
01727 FedmIscTagHandler_ISO14443_4* pNewTagHandler = NULL;
01728 pNewTagHandler = new FedmIscTagHandler_ISO14443_4(this, pTagHandler->m_pTabItem);
01729 if(pNewTagHandler != NULL)
01730 {
01731 delete pTagHandler;
01732 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01733 return (FedmIscTagHandler*)pNewTagHandler;
01734 }
01735 }
01736 else
01737 {
01738 pTagHandler->Init();
01739 return pTagHandler;
01740 }
01741 }
01742 break;
01743
01744 default:
01745 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4)
01746 {
01747 FedmIscTagHandler_ISO14443_4* pNewTagHandler = NULL;
01748 pNewTagHandler = new FedmIscTagHandler_ISO14443_4(this, pTagHandler->m_pTabItem);
01749 if(pNewTagHandler != NULL)
01750 {
01751 delete pTagHandler;
01752 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01753 return (FedmIscTagHandler*)pNewTagHandler;
01754 }
01755 }
01756 else
01757 {
01758 pTagHandler->Init();
01759 return pTagHandler;
01760 }
01761 break;
01762
01763 }
01764
01765 }
01766 }
01767 else if( (m_ISOTable[iIdx]->m_ucOptInfo & 0x03) == 0x01 )
01768 {
01769
01770
01771 if(m_ISOTable[iIdx]->m_ucSnr[7] == FEDM_ISC_ISO_MFR_NXP)
01772 {
01773 if(ucSAK & 0x20)
01774 {
01775
01776 if(dynamic_cast<FedmIscTagHandler_ISO14443*>(pTagHandler) == NULL)
01777 return NULL;
01778
01779 switch(ucSAK)
01780 {
01781 case 0x20:
01782 if(uiAtqA == 0x0344)
01783 {
01784 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4_MIFARE_DESFIRE)
01785 {
01786
01787 FedmIscTagHandler_ISO14443_4_MIFARE_DESFire* pNewTagHandler = NULL;
01788 pNewTagHandler = new FedmIscTagHandler_ISO14443_4_MIFARE_DESFire(this, pTagHandler->m_pTabItem);
01789 if(pNewTagHandler != NULL)
01790 {
01791 delete pTagHandler;
01792 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01793 return (FedmIscTagHandler*)pNewTagHandler;
01794 }
01795 }
01796 else
01797 {
01798 pTagHandler->Init();
01799 return pTagHandler;
01800 }
01801 }
01802 else if(uiAtqA == 0x0042 || uiAtqA == 0x0044)
01803 {
01804 unsigned char ucTL = m_TmpData[2051];
01805 unsigned char ucT0 = m_TmpData[2052];
01806 unsigned char* pucAts = &m_TmpData[2052];
01807 unsigned char ucMfPx[] = {0xC1, 0x05, 0x2F, 0x2F, 0x01, 0xBC, 0xD6};
01808 unsigned char ucMfPs[] = {0xC1, 0x05, 0x2F, 0x2F, 0x00, 0x35, 0xC7};
01809
01810 if(ucTL >= 9)
01811 {
01812 if(ucT0 & 0x10)
01813 {
01814 pucAts++;
01815 }
01816 if(ucT0 & 0x20)
01817 {
01818 pucAts++;
01819 }
01820 if(ucT0 & 0x40)
01821 {
01822 pucAts++;
01823 }
01824 pucAts++;
01825
01826 if( memcmp(pucAts, ucMfPx, 7) == 0 || memcmp(pucAts, ucMfPs, 7) == 0)
01827 {
01828 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4_MIFARE_PLUS_SL3)
01829 {
01830 FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL3* pNewTagHandler = NULL;
01831 pNewTagHandler = new FedmIscTagHandler_ISO14443_4_MIFARE_Plus_SL3(this, pTagHandler->m_pTabItem);
01832 if(pNewTagHandler != NULL)
01833 {
01834 delete pTagHandler;
01835 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01836 return (FedmIscTagHandler*)pNewTagHandler;
01837 }
01838 }
01839 else
01840 {
01841 pTagHandler->Init();
01842 return pTagHandler;
01843 }
01844 }
01845 else
01846 {
01847 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4)
01848 {
01849 FedmIscTagHandler_ISO14443_4* pNewTagHandler = NULL;
01850 pNewTagHandler = new FedmIscTagHandler_ISO14443_4(this, pTagHandler->m_pTabItem);
01851 if(pNewTagHandler != NULL)
01852 {
01853 delete pTagHandler;
01854 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01855 return (FedmIscTagHandler*)pNewTagHandler;
01856 }
01857 }
01858 else
01859 {
01860 pTagHandler->Init();
01861 return pTagHandler;
01862 }
01863 }
01864 }
01865 else
01866 {
01867 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4)
01868 {
01869 FedmIscTagHandler_ISO14443_4* pNewTagHandler = NULL;
01870 pNewTagHandler = new FedmIscTagHandler_ISO14443_4(this, pTagHandler->m_pTabItem);
01871 if(pNewTagHandler != NULL)
01872 {
01873 delete pTagHandler;
01874 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01875 return (FedmIscTagHandler*)pNewTagHandler;
01876 }
01877 }
01878 else
01879 {
01880 pTagHandler->Init();
01881 return pTagHandler;
01882 }
01883 }
01884 }
01885 else
01886 {
01887 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4)
01888 {
01889 FedmIscTagHandler_ISO14443_4* pNewTagHandler = NULL;
01890 pNewTagHandler = new FedmIscTagHandler_ISO14443_4(this, pTagHandler->m_pTabItem);
01891 if(pNewTagHandler != NULL)
01892 {
01893 delete pTagHandler;
01894 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01895 return (FedmIscTagHandler*)pNewTagHandler;
01896 }
01897 }
01898 else
01899 {
01900 pTagHandler->Init();
01901 return pTagHandler;
01902 }
01903 }
01904 break;
01905
01906 default:
01907 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4)
01908 {
01909 FedmIscTagHandler_ISO14443_4* pNewTagHandler = NULL;
01910 pNewTagHandler = new FedmIscTagHandler_ISO14443_4(this, pTagHandler->m_pTabItem);
01911 if(pNewTagHandler != NULL)
01912 {
01913 delete pTagHandler;
01914 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01915 return (FedmIscTagHandler*)pNewTagHandler;
01916 }
01917 }
01918 else
01919 {
01920 pTagHandler->Init();
01921 return pTagHandler;
01922 }
01923 break;
01924
01925 }
01926
01927 }
01928 }
01929 else
01930 {
01931
01932
01933 if(ucSAK & 0x20)
01934 {
01935
01936 if(dynamic_cast<FedmIscTagHandler_ISO14443*>(pTagHandler) == NULL)
01937 return NULL;
01938
01939 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4)
01940 {
01941 FedmIscTagHandler_ISO14443_4* pNewTagHandler = NULL;
01942 pNewTagHandler = new FedmIscTagHandler_ISO14443_4(this, pTagHandler->m_pTabItem);
01943 if(pNewTagHandler != NULL)
01944 {
01945 delete pTagHandler;
01946 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01947 return (FedmIscTagHandler*)pNewTagHandler;
01948 }
01949 }
01950 else
01951 {
01952 pTagHandler->Init();
01953 return pTagHandler;
01954 }
01955 }
01956 }
01957 }
01958 else
01959 {
01960
01961
01962
01963
01964 if(ucSAK & 0x20)
01965 {
01966
01967 if(dynamic_cast<FedmIscTagHandler_ISO14443*>(pTagHandler) == NULL)
01968 return NULL;
01969
01970 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4)
01971 {
01972 FedmIscTagHandler_ISO14443_4* pNewTagHandler = NULL;
01973 pNewTagHandler = new FedmIscTagHandler_ISO14443_4(this, pTagHandler->m_pTabItem);
01974 if(pNewTagHandler != NULL)
01975 {
01976 delete pTagHandler;
01977 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
01978 return (FedmIscTagHandler*)pNewTagHandler;
01979 }
01980 }
01981 else
01982 {
01983 pTagHandler->Init();
01984 return pTagHandler;
01985 }
01986 }
01987 }
01988
01989 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " Creation of TagHandler failed");
01990 SetLastError(FEDM_ERROR_UNKNOWN_TRANSPONDER_TYPE);
01991 return NULL;
01992 }
01993 #endif
01994 #endif
01995
01996
01997
01998
01999
02000
02001
02002
02003
02004
02005
02006
02007
02008
02009
02010
02011
02012
02013 #ifdef _FEDM_TAG_HANDLER
02014 #if !defined(_FEDM_NO_TAG_HANDLER_ISO14443)
02015 FedmIscTagHandler* FEDM_ISCReaderModule::TagSelect_EvaFormat2(int iIdx, FedmIscTagHandler* pTagHandler)
02016 {
02017 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_TAG_HANDLER, __FUNCTION__);
02018
02019
02020 unsigned char ucProtocolType = m_TmpData[2049] & 0x0F;
02021
02022 switch(ucProtocolType&0x01)
02023 {
02024 case 0:
02025 {
02026 if(dynamic_cast<FedmIscTagHandler_ISO14443*>(pTagHandler) == NULL)
02027 return NULL;
02028
02029 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_3)
02030 {
02031 FedmIscTagHandler_ISO14443_3* pNewTagHandler = NULL;
02032 pNewTagHandler = new FedmIscTagHandler_ISO14443_3(this, pTagHandler->m_pTabItem);
02033 if(pNewTagHandler != NULL)
02034 {
02035 delete pTagHandler;
02036 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
02037 return (FedmIscTagHandler*)pNewTagHandler;
02038 }
02039 }
02040 else
02041 {
02042 pTagHandler->Init();
02043 return pTagHandler;
02044 }
02045 }
02046 break;
02047
02048 case 1:
02049 {
02050 if(dynamic_cast<FedmIscTagHandler_ISO14443*>(pTagHandler) == NULL)
02051 return NULL;
02052
02053 unsigned int uiTmpAppData = 0;
02054 uiTmpAppData = ((pTagHandler->m_pTabItem->m_ucSnr[0] << 24) | (pTagHandler->m_pTabItem->m_ucSnr[1] << 16) | (pTagHandler->m_pTabItem->m_ucSnr[2] << 8) | (pTagHandler->m_pTabItem->m_ucSnr[3]));
02055
02056 if(uiTmpAppData == 0xe02b0010)
02057 {
02058 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4_MAXIM_MAX66000)
02059 {
02060 FedmIscTagHandler_ISO14443_4_Maxim_MAX66000* pNewTagHandler = NULL;
02061 pNewTagHandler = new FedmIscTagHandler_ISO14443_4_Maxim_MAX66000(this, pTagHandler->m_pTabItem);
02062 if(pNewTagHandler != NULL)
02063 {
02064 delete pTagHandler;
02065 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
02066 return (FedmIscTagHandler*)pNewTagHandler;
02067 }
02068 }
02069 else
02070 {
02071 pTagHandler->Init();
02072 return pTagHandler;
02073 }
02074 }
02075 else if(uiTmpAppData == 0xe02b0020)
02076 {
02077 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4_MAXIM_MAX66020)
02078 {
02079 FedmIscTagHandler_ISO14443_4_Maxim_MAX66020* pNewTagHandler = NULL;
02080 pNewTagHandler = new FedmIscTagHandler_ISO14443_4_Maxim_MAX66020(this, pTagHandler->m_pTabItem);
02081 if(pNewTagHandler != NULL)
02082 {
02083 delete pTagHandler;
02084 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
02085 return (FedmIscTagHandler*)pNewTagHandler;
02086 }
02087 }
02088 else
02089 {
02090 pTagHandler->Init();
02091 return pTagHandler;
02092 }
02093 }
02094 else if(uiTmpAppData == 0xe02b0030)
02095 {
02096 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4_MAXIM_MAX66040)
02097 {
02098 FedmIscTagHandler_ISO14443_4_Maxim_MAX66040* pNewTagHandler = NULL;
02099 pNewTagHandler = new FedmIscTagHandler_ISO14443_4_Maxim_MAX66040(this, pTagHandler->m_pTabItem);
02100 if(pNewTagHandler != NULL)
02101 {
02102 delete pTagHandler;
02103 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
02104 return (FedmIscTagHandler*)pNewTagHandler;
02105 }
02106 }
02107 else
02108 {
02109 pTagHandler->Init();
02110 return pTagHandler;
02111 }
02112 }
02113 else
02114 {
02115 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_4)
02116 {
02117 FedmIscTagHandler_ISO14443_4* pNewTagHandler = NULL;
02118 pNewTagHandler = new FedmIscTagHandler_ISO14443_4(this, pTagHandler->m_pTabItem);
02119 if(pNewTagHandler != NULL)
02120 {
02121 delete pTagHandler;
02122 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
02123 return (FedmIscTagHandler*)pNewTagHandler;
02124 }
02125 }
02126 else
02127 {
02128 pTagHandler->Init();
02129 return pTagHandler;
02130 }
02131 }
02132 }
02133 break;
02134 }
02135
02136 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " Creation of TagHandler failed");
02137 SetLastError(FEDM_ERROR_UNKNOWN_TRANSPONDER_TYPE);
02138 return NULL;
02139 }
02140 #endif
02141 #endif
02142
02143
02144
02145
02146
02147
02148
02149
02150
02151
02152
02153
02154
02155
02156
02157
02158
02159
02160 #ifdef _FEDM_TAG_HANDLER
02161 #if !defined(_FEDM_NO_TAG_HANDLER_ISO14443)
02162 FedmIscTagHandler* FEDM_ISCReaderModule::TagSelect_EvaFormat3(int iIdx, FedmIscTagHandler* pTagHandler)
02163 {
02164 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_TAG_HANDLER, __FUNCTION__);
02165
02166
02167 unsigned char ucSAK = m_TmpData[2050];
02168
02169 if( (m_ISOTable[iIdx]->m_ucOptInfo & 0x03) == 0x00 )
02170 {
02171
02172 switch(ucSAK)
02173 {
02174 case 0x00:
02175 {
02176 if(dynamic_cast<FedmIscTagHandler_ISO14443*>(pTagHandler) == NULL)
02177 return NULL;
02178
02179 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_3_INFINEON_MY_D)
02180 {
02181 FedmIscTagHandler_ISO14443_3_Infineon_my_d* pNewTagHandler = NULL;
02182 pNewTagHandler = new FedmIscTagHandler_ISO14443_3_Infineon_my_d(this, pTagHandler->m_pTabItem);
02183 if(pNewTagHandler != NULL)
02184 {
02185 delete pTagHandler;
02186 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
02187 return (FedmIscTagHandler*)pNewTagHandler;
02188 }
02189 }
02190 else
02191 {
02192 pTagHandler->Init();
02193 return pTagHandler;
02194 }
02195 }
02196 break;
02197
02198 case 0x08:
02199
02200 case 0x09:
02201 case 0x18:
02202
02203 case 0x88:
02204 {
02205 if(dynamic_cast<FedmIscTagHandler_ISO14443*>(pTagHandler) == NULL)
02206 return NULL;
02207
02208 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_3_MIFARE_CLASSIC)
02209 {
02210 FedmIscTagHandler_ISO14443_3_MIFARE_Classic* pNewTagHandler = NULL;
02211 pNewTagHandler = new FedmIscTagHandler_ISO14443_3_MIFARE_Classic(this, pTagHandler->m_pTabItem);
02212 if(pNewTagHandler != NULL)
02213 {
02214 delete pTagHandler;
02215 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
02216 return (FedmIscTagHandler*)pNewTagHandler;
02217 }
02218 }
02219 else
02220 {
02221 pTagHandler->Init();
02222 return pTagHandler;
02223 }
02224 }
02225 break;
02226
02227 case 0x10:
02228 case 0x11:
02229 {
02230 if(dynamic_cast<FedmIscTagHandler_ISO14443*>(pTagHandler) == NULL)
02231 return NULL;
02232
02233 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_3_MIFARE_PLUS_SL2)
02234 {
02235 FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL2* pNewTagHandler = NULL;
02236 pNewTagHandler = new FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL2(this, pTagHandler->m_pTabItem);
02237 if(pNewTagHandler != NULL)
02238 {
02239 delete pTagHandler;
02240 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
02241 return (FedmIscTagHandler*)pNewTagHandler;
02242 }
02243 }
02244 else
02245 {
02246 pTagHandler->Init();
02247 return pTagHandler;
02248 }
02249 }
02250 break;
02251 }
02252 }
02253 else if( (m_ISOTable[iIdx]->m_ucOptInfo & 0x03) == 0x01 )
02254 {
02255
02256 if(m_ISOTable[iIdx]->m_ucSnr[7] == FEDM_ISC_ISO_MFR_NXP)
02257 {
02258 switch(ucSAK)
02259 {
02260 case 0x00:
02261 {
02262 if(dynamic_cast<FedmIscTagHandler_ISO14443*>(pTagHandler) == NULL)
02263 return NULL;
02264
02265 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_3_MIFARE_ULTRALIGHT)
02266 {
02267 FedmIscTagHandler_ISO14443_3_MIFARE_Ultralight* pNewTagHandler = NULL;
02268 pNewTagHandler = new FedmIscTagHandler_ISO14443_3_MIFARE_Ultralight(this, pTagHandler->m_pTabItem);
02269 if(pNewTagHandler != NULL)
02270 {
02271 delete pTagHandler;
02272 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
02273 return (FedmIscTagHandler*)pNewTagHandler;
02274 }
02275 }
02276 else
02277 {
02278 pTagHandler->Init();
02279 return pTagHandler;
02280 }
02281 }
02282 break;
02283
02284 case 0x08:
02285 case 0x18:
02286 {
02287 if(dynamic_cast<FedmIscTagHandler_ISO14443*>(pTagHandler) == NULL)
02288 return NULL;
02289
02290 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_3_MIFARE_CLASSIC)
02291 {
02292 FedmIscTagHandler_ISO14443_3_MIFARE_Classic* pNewTagHandler = NULL;
02293 pNewTagHandler = new FedmIscTagHandler_ISO14443_3_MIFARE_Classic(this, pTagHandler->m_pTabItem);
02294 if(pNewTagHandler != NULL)
02295 {
02296 delete pTagHandler;
02297 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
02298 return (FedmIscTagHandler*)pNewTagHandler;
02299 }
02300 }
02301 else
02302 {
02303 pTagHandler->Init();
02304 return pTagHandler;
02305 }
02306 }
02307 break;
02308
02309 case 0x10:
02310 case 0x11:
02311 {
02312 if(dynamic_cast<FedmIscTagHandler_ISO14443*>(pTagHandler) == NULL)
02313 return NULL;
02314
02315 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_3_MIFARE_PLUS_SL2)
02316 {
02317 FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL2* pNewTagHandler = NULL;
02318 pNewTagHandler = new FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL2(this, pTagHandler->m_pTabItem);
02319 if(pNewTagHandler != NULL)
02320 {
02321 delete pTagHandler;
02322 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
02323 return (FedmIscTagHandler*)pNewTagHandler;
02324 }
02325 }
02326 else
02327 {
02328 pTagHandler->Init();
02329 return pTagHandler;
02330 }
02331 }
02332 break;
02333 }
02334 }
02335 else if(m_ISOTable[iIdx]->m_ucSnr[7] == FEDM_ISC_ISO_MFR_INFINEON)
02336 {
02337 if((m_ISOTable[iIdx]->m_ucSnr[6] & 0x30) == 0x30)
02338 {
02339 if(dynamic_cast<FedmIscTagHandler_ISO14443*>(pTagHandler) == NULL)
02340 return NULL;
02341
02342 if(pTagHandler->GetTagHandlerType() != FedmIscTagHandler::TYPE_ISO14443_3_INFINEON_MY_D_MOVE)
02343 {
02344 FedmIscTagHandler_ISO14443_3_Infineon_my_d_move* pNewTagHandler = NULL;
02345 pNewTagHandler = new FedmIscTagHandler_ISO14443_3_Infineon_my_d_move(this, pTagHandler->m_pTabItem);
02346 if(pNewTagHandler != NULL)
02347 {
02348 delete pTagHandler;
02349 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
02350 return (FedmIscTagHandler*)pNewTagHandler;
02351 }
02352 }
02353 else
02354 {
02355 pTagHandler->Init();
02356 return pTagHandler;
02357 }
02358 }
02359 else
02360 {
02361
02362 return pTagHandler;
02363 }
02364 }
02365 else
02366 {
02367
02368 return pTagHandler;
02369 }
02370 }
02371 else if( (m_ISOTable[iIdx]->m_ucOptInfo & 0x03) == 0x02 )
02372 {
02373
02374 }
02375
02376
02377 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " Creation of TagHandler failed");
02378 SetLastError(FEDM_ERROR_UNKNOWN_TRANSPONDER_TYPE);
02379 return NULL;
02380 }
02381 #endif
02382 #endif
02383
02384
02385
02387
02389
02390
02391
02392
02393
02394
02395
02396
02397
02398
02399
02400
02401
02402 #ifdef _FEDM_TAG_HANDLER
02403 FEDM_ISC_TAG_LIST* FEDM_ISCReaderModule::GetTagList()
02404 {
02405 string sSnr;
02406
02407 if( m_bEnableTagHandler )
02408 {
02409 m_mapTagHandler.clear();
02410
02411
02412 for(unsigned int uiCnt=0; uiCnt<m_uiISOTableLength; uiCnt++)
02413 {
02414 if(m_ISOTable[uiCnt]->m_pTagHandler != NULL)
02415 {
02416 if(m_ISOTable[uiCnt]->GetSnr(sSnr) != FEDM_OK)
02417 continue;
02418
02419 m_mapTagHandler.insert(make_pair(sSnr, m_ISOTable[uiCnt]->m_pTagHandler));
02420 }
02421 }
02422 }
02423
02424 return &m_mapTagHandler;
02425 }
02426 #endif
02427
02428
02429
02430
02431
02432
02433
02434
02435
02436
02437
02438
02439 #ifdef _FEDM_TAG_HANDLER
02440 #ifdef _WIN32_WCE
02441 FedmIscTagHandler* FEDM_ISCReaderModule::GetTagHandler(char* sSnr)
02442 {
02443 string stlSnr;
02444
02445
02446 GetTagList();
02447
02448 stlSnr = sSnr;
02449 FEDM_ISC_TAG_LIST_ITOR itor = m_mapTagHandler.find(stlSnr);
02450 if(itor == m_mapTagHandler.end())
02451 return NULL;
02452
02453 return itor->second;
02454 }
02455 #else
02456 FedmIscTagHandler* FEDM_ISCReaderModule::GetTagHandler(string sSnr)
02457 {
02458
02459 GetTagList();
02460
02461 FEDM_ISC_TAG_LIST_ITOR itor = m_mapTagHandler.find(sSnr);
02462 if(itor == m_mapTagHandler.end())
02463 return NULL;
02464
02465 itor->second->m_bNonAddressedMode = false;
02466 return itor->second;
02467 }
02468 #endif
02469 #endif
02470
02471
02472
02473
02474
02475
02476
02477
02478
02479
02480
02481
02482
02483 #ifdef _FEDM_TAG_HANDLER
02484 FedmIscTagHandler* FEDM_ISCReaderModule::GetSelectedTagHandler()
02485 {
02486 FEDM_ISC_TAG_LIST_ITOR itor;
02487
02488
02489 GetTagList();
02490
02491 for(itor = m_mapTagHandler.begin();
02492 itor != m_mapTagHandler.end();
02493 itor++ )
02494 {
02495 if(itor->second->m_pTabItem->m_bIsSelected)
02496 return itor->second;
02497 }
02498
02499 return NULL;
02500 }
02501 #endif
02502
02503
02504
02505
02506
02507
02508
02509
02510
02511
02512
02513
02514
02515
02516
02517
02518
02519
02520
02521
02522
02523
02524
02525
02526 #ifdef _FEDM_TAG_HANDLER
02527 FedmIscTagHandler* FEDM_ISCReaderModule::CreateNonAddressedTagHandler(unsigned int uiTagHandlerType)
02528 {
02529 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_TAG_HANDLER, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "TagHandlerType=0x" << std::hex << std::uppercase << uiTagHandlerType);
02530
02531 FedmIscTagHandler* pNewTagHandler = NULL;
02532 FEDM_ISOTabItem* tabItem = GetISOTableItem(0);
02533
02534 if( !m_bEnableTagHandler )
02535 {
02536 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " Support for TagHandler disabled");
02537 SetLastError(FEDM_ERROR_UNSUPPORTED);
02538 return NULL;
02539 }
02540
02541 if(uiTagHandlerType == FedmIscTagHandler::TYPE_BASIC)
02542 {
02543 if(tabItem->m_pTagHandler != NULL)
02544 {
02545 pNewTagHandler = tabItem->m_pTagHandler;
02546 }
02547 else
02548 {
02549 pNewTagHandler = new FedmIscTagHandler(this, FedmIscTagHandler::TYPE_BASIC, tabItem);
02550 }
02551 }
02552 #if !defined(_FEDM_NO_TAG_HANDLER_EPC_C1_G2)
02553 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_EPC_CLASS1_GEN2)
02554 {
02555 if(tabItem->m_pTagHandler != NULL)
02556 {
02557 if(dynamic_cast<FedmIscTagHandler_EPC_Class1_Gen2*>(tabItem->m_pTagHandler) == NULL)
02558 {
02559 delete tabItem->m_pTagHandler;
02560 tabItem->m_pTagHandler = NULL;
02561 pNewTagHandler = new FedmIscTagHandler_EPC_Class1_Gen2(this, tabItem);
02562 }
02563 else
02564 {
02565 pNewTagHandler = tabItem->m_pTagHandler;
02566 }
02567 }
02568 else
02569 {
02570 pNewTagHandler = new FedmIscTagHandler_EPC_Class1_Gen2(this, tabItem);
02571 }
02572 }
02573 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_EPC_CLASS1_GEN2_IDS_SL900A)
02574 {
02575 if(tabItem->m_pTagHandler != NULL)
02576 {
02577 if(dynamic_cast<FedmIscTagHandler_EPC_Class1_Gen2_IDS_SL900A*>(tabItem->m_pTagHandler) == NULL)
02578 {
02579 delete tabItem->m_pTagHandler;
02580 tabItem->m_pTagHandler = NULL;
02581 pNewTagHandler = new FedmIscTagHandler_EPC_Class1_Gen2_IDS_SL900A(this, tabItem);
02582 }
02583 else
02584 {
02585 pNewTagHandler = tabItem->m_pTagHandler;
02586 }
02587 }
02588 else
02589 {
02590 pNewTagHandler = new FedmIscTagHandler_EPC_Class1_Gen2_IDS_SL900A(this, tabItem);
02591 }
02592 }
02593 #endif
02594 #if !defined(_FEDM_NO_TAG_HANDLER_ISO14443)
02595 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443 ||
02596 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_2 ||
02597 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_2_INNOVISION_JEWEL ||
02598 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_2_STM_SR176 ||
02599 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_2_STM_SRIxxx ||
02600 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_3 ||
02601 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_3_INFINEON_MY_D ||
02602 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_3_INFINEON_MY_D_MOVE ||
02603 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_3_MIFARE_CLASSIC ||
02604 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_3_MIFARE_PLUS_SL1 ||
02605 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_3_MIFARE_PLUS_SL2 ||
02606 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_3_MIFARE_ULTRALIGHT ||
02607 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_4 ||
02608 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_4_MAXIM ||
02609 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_4_MAXIM_MAX66000 ||
02610 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_4_MAXIM_MAX66020 ||
02611 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_4_MAXIM_MAX66040 ||
02612 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_4_MIFARE_DESFIRE ||
02613 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_4_MIFARE_PLUS_SL1 ||
02614 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_4_MIFARE_PLUS_SL2 ||
02615 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO14443_4_MIFARE_PLUS_SL3 )
02616 {
02617 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " Not applicable for ISO 14443 and EPC C1G2 TagHandler ");
02618 SetLastError(FEDM_ERROR_UNSUPPORTED);
02619 return NULL;
02620 }
02621 #endif
02622
02623 #if !defined(_FEDM_NO_TAG_HANDLER_ISO15693)
02624 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693)
02625 {
02626 if(tabItem->m_pTagHandler != NULL)
02627 {
02628 if(dynamic_cast<FedmIscTagHandler_ISO15693*>(tabItem->m_pTagHandler) == NULL)
02629 {
02630 delete tabItem->m_pTagHandler;
02631 tabItem->m_pTagHandler = NULL;
02632 pNewTagHandler = new FedmIscTagHandler_ISO15693(this, tabItem);
02633 }
02634 else
02635 {
02636 pNewTagHandler = tabItem->m_pTagHandler;
02637 }
02638 }
02639 else
02640 {
02641 pNewTagHandler = new FedmIscTagHandler_ISO15693(this, tabItem);
02642 }
02643 }
02644 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_EM ||
02645 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_Fujitsu ||
02646 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_MAXIM ||
02647 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_NXP ||
02648 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_STM ||
02649 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_TI ||
02650 uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_TI_Tag_it_HFI_Pro )
02651 {
02652 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " Not applicable for this ISO 15693 TagHandler: " << std::hex << std::uppercase << uiTagHandlerType);
02653 SetLastError(FEDM_ERROR_UNSUPPORTED);
02654 return NULL;
02655 }
02656
02657
02658 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_EM_4034)
02659 {
02660 if(tabItem->m_pTagHandler != NULL)
02661 {
02662 if(dynamic_cast<FedmIscTagHandler_ISO15693_EM_4034*>(tabItem->m_pTagHandler) == NULL)
02663 {
02664 delete tabItem->m_pTagHandler;
02665 tabItem->m_pTagHandler = NULL;
02666 pNewTagHandler = new FedmIscTagHandler_ISO15693_EM_4034(this, tabItem);
02667 }
02668 else
02669 {
02670 pNewTagHandler = tabItem->m_pTagHandler;
02671 }
02672 }
02673 else
02674 {
02675 pNewTagHandler = new FedmIscTagHandler_ISO15693_EM_4034(this, tabItem);
02676 }
02677 }
02678 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_Fujitsu_MB89R1xx)
02679 {
02680 if(tabItem->m_pTagHandler != NULL)
02681 {
02682 if(dynamic_cast<FedmIscTagHandler_ISO15693_Fujitsu_MB89R1xx*>(tabItem->m_pTagHandler) == NULL)
02683 {
02684 delete tabItem->m_pTagHandler;
02685 tabItem->m_pTagHandler = NULL;
02686 pNewTagHandler = new FedmIscTagHandler_ISO15693_Fujitsu_MB89R1xx(this, tabItem);
02687 }
02688 else
02689 {
02690 pNewTagHandler = tabItem->m_pTagHandler;
02691 }
02692 }
02693 else
02694 {
02695 pNewTagHandler = new FedmIscTagHandler_ISO15693_Fujitsu_MB89R1xx(this, tabItem);
02696 }
02697 }
02698 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_IDS_SL13A)
02699 {
02700 if(tabItem->m_pTagHandler != NULL)
02701 {
02702 if(dynamic_cast<FedmIscTagHandler_ISO15693_IDS_SL13A*>(tabItem->m_pTagHandler) == NULL)
02703 {
02704 delete tabItem->m_pTagHandler;
02705 tabItem->m_pTagHandler = NULL;
02706 pNewTagHandler = new FedmIscTagHandler_ISO15693_IDS_SL13A(this, tabItem);
02707 }
02708 else
02709 {
02710 pNewTagHandler = tabItem->m_pTagHandler;
02711 }
02712 }
02713 else
02714 {
02715 pNewTagHandler = new FedmIscTagHandler_ISO15693_IDS_SL13A(this, tabItem);
02716 }
02717 }
02718 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_Infineon)
02719 {
02720 if(tabItem->m_pTagHandler != NULL)
02721 {
02722 if(dynamic_cast<FedmIscTagHandler_ISO15693_Infineon*>(tabItem->m_pTagHandler) == NULL)
02723 {
02724 delete tabItem->m_pTagHandler;
02725 tabItem->m_pTagHandler = NULL;
02726 pNewTagHandler = new FedmIscTagHandler_ISO15693_Infineon(this, tabItem);
02727 }
02728 else
02729 {
02730 pNewTagHandler = tabItem->m_pTagHandler;
02731 }
02732 }
02733 else
02734 {
02735 pNewTagHandler = new FedmIscTagHandler_ISO15693_Infineon(this, tabItem);
02736 }
02737 }
02738 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_Infineon_my_d)
02739 {
02740 if(tabItem->m_pTagHandler != NULL)
02741 {
02742 if(dynamic_cast<FedmIscTagHandler_ISO15693_Infineon_my_d*>(tabItem->m_pTagHandler) == NULL)
02743 {
02744 delete tabItem->m_pTagHandler;
02745 tabItem->m_pTagHandler = NULL;
02746 pNewTagHandler = new FedmIscTagHandler_ISO15693_Infineon_my_d(this, tabItem);
02747 }
02748 else
02749 {
02750 pNewTagHandler = tabItem->m_pTagHandler;
02751 }
02752 }
02753 else
02754 {
02755 pNewTagHandler = new FedmIscTagHandler_ISO15693_Infineon_my_d(this, tabItem);
02756 }
02757 }
02758 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_KSW)
02759 {
02760 if(tabItem->m_pTagHandler != NULL)
02761 {
02762 if(dynamic_cast<FedmIscTagHandler_ISO15693_KSW*>(tabItem->m_pTagHandler) == NULL)
02763 {
02764 delete tabItem->m_pTagHandler;
02765 tabItem->m_pTagHandler = NULL;
02766 pNewTagHandler = new FedmIscTagHandler_ISO15693_KSW(this, tabItem);
02767 }
02768 else
02769 {
02770 pNewTagHandler = tabItem->m_pTagHandler;
02771 }
02772 }
02773 else
02774 {
02775 pNewTagHandler = new FedmIscTagHandler_ISO15693_KSW(this, tabItem);
02776 }
02777 }
02778 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_MAXIM_MAX66100)
02779 {
02780 if(tabItem->m_pTagHandler != NULL)
02781 {
02782 if(dynamic_cast<FedmIscTagHandler_ISO15693_Maxim_MAX66100*>(tabItem->m_pTagHandler) == NULL)
02783 {
02784 delete tabItem->m_pTagHandler;
02785 tabItem->m_pTagHandler = NULL;
02786 pNewTagHandler = new FedmIscTagHandler_ISO15693_Maxim_MAX66100(this, tabItem);
02787 }
02788 else
02789 {
02790 pNewTagHandler = tabItem->m_pTagHandler;
02791 }
02792 }
02793 else
02794 {
02795 pNewTagHandler = new FedmIscTagHandler_ISO15693_Maxim_MAX66100(this, tabItem);
02796 }
02797 }
02798 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_MAXIM_MAX66120)
02799 {
02800 if(tabItem->m_pTagHandler != NULL)
02801 {
02802 if(dynamic_cast<FedmIscTagHandler_ISO15693_Maxim_MAX66120*>(tabItem->m_pTagHandler) == NULL)
02803 {
02804 delete tabItem->m_pTagHandler;
02805 tabItem->m_pTagHandler = NULL;
02806 pNewTagHandler = new FedmIscTagHandler_ISO15693_Maxim_MAX66120(this, tabItem);
02807 }
02808 else
02809 {
02810 pNewTagHandler = tabItem->m_pTagHandler;
02811 }
02812 }
02813 else
02814 {
02815 pNewTagHandler = new FedmIscTagHandler_ISO15693_Maxim_MAX66120(this, tabItem);
02816 }
02817 }
02818 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_MAXIM_MAX66140)
02819 {
02820 if(tabItem->m_pTagHandler != NULL)
02821 {
02822 if(dynamic_cast<FedmIscTagHandler_ISO15693_Maxim_MAX66140*>(tabItem->m_pTagHandler) == NULL)
02823 {
02824 delete tabItem->m_pTagHandler;
02825 tabItem->m_pTagHandler = NULL;
02826 pNewTagHandler = new FedmIscTagHandler_ISO15693_Maxim_MAX66140(this, tabItem);
02827 }
02828 else
02829 {
02830 pNewTagHandler = tabItem->m_pTagHandler;
02831 }
02832 }
02833 else
02834 {
02835 pNewTagHandler = new FedmIscTagHandler_ISO15693_Maxim_MAX66140(this, tabItem);
02836 }
02837 }
02838 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLI)
02839 {
02840 if(tabItem->m_pTagHandler != NULL)
02841 {
02842 if(dynamic_cast<FedmIscTagHandler_ISO15693_NXP_ICODE_SLI*>(tabItem->m_pTagHandler) == NULL)
02843 {
02844 delete tabItem->m_pTagHandler;
02845 tabItem->m_pTagHandler = NULL;
02846 pNewTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLI(this, tabItem);
02847 }
02848 else
02849 {
02850 pNewTagHandler = tabItem->m_pTagHandler;
02851 }
02852 }
02853 else
02854 {
02855 pNewTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLI(this, tabItem);
02856 }
02857 }
02858 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLI_L)
02859 {
02860 if(tabItem->m_pTagHandler != NULL)
02861 {
02862 if(dynamic_cast<FedmIscTagHandler_ISO15693_NXP_ICODE_SLI_L*>(tabItem->m_pTagHandler) == NULL)
02863 {
02864 delete tabItem->m_pTagHandler;
02865 tabItem->m_pTagHandler = NULL;
02866 pNewTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLI_L(this, tabItem);
02867 }
02868 else
02869 {
02870 pNewTagHandler = tabItem->m_pTagHandler;
02871 }
02872 }
02873 else
02874 {
02875 pNewTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLI_L(this, tabItem);
02876 }
02877 }
02878 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLI_S)
02879 {
02880 if(tabItem->m_pTagHandler != NULL)
02881 {
02882 if(dynamic_cast<FedmIscTagHandler_ISO15693_NXP_ICODE_SLI_S*>(tabItem->m_pTagHandler) == NULL)
02883 {
02884 delete tabItem->m_pTagHandler;
02885 tabItem->m_pTagHandler = NULL;
02886 pNewTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLI_S(this, tabItem);
02887 }
02888 else
02889 {
02890 pNewTagHandler = tabItem->m_pTagHandler;
02891 }
02892 }
02893 else
02894 {
02895 pNewTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLI_S(this, tabItem);
02896 }
02897 }
02898 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLIX)
02899 {
02900 if(tabItem->m_pTagHandler != NULL)
02901 {
02902 if(dynamic_cast<FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX*>(tabItem->m_pTagHandler) == NULL)
02903 {
02904 delete tabItem->m_pTagHandler;
02905 tabItem->m_pTagHandler = NULL;
02906 pNewTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX(this, tabItem);
02907 }
02908 else
02909 {
02910 pNewTagHandler = tabItem->m_pTagHandler;
02911 }
02912 }
02913 else
02914 {
02915 pNewTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX(this, tabItem);
02916 }
02917 }
02918 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLIX_L)
02919 {
02920 if(tabItem->m_pTagHandler != NULL)
02921 {
02922 if(dynamic_cast<FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX_L*>(tabItem->m_pTagHandler) == NULL)
02923 {
02924 delete tabItem->m_pTagHandler;
02925 tabItem->m_pTagHandler = NULL;
02926 pNewTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX_L(this, tabItem);
02927 }
02928 else
02929 {
02930 pNewTagHandler = tabItem->m_pTagHandler;
02931 }
02932 }
02933 else
02934 {
02935 pNewTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX_L(this, tabItem);
02936 }
02937 }
02938 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_NXP_ICODE_SLIX_S)
02939 {
02940 if(tabItem->m_pTagHandler != NULL)
02941 {
02942 if(dynamic_cast<FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX_S*>(tabItem->m_pTagHandler) == NULL)
02943 {
02944 delete tabItem->m_pTagHandler;
02945 tabItem->m_pTagHandler = NULL;
02946 pNewTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX_S(this, tabItem);
02947 }
02948 else
02949 {
02950 pNewTagHandler = tabItem->m_pTagHandler;
02951 }
02952 }
02953 else
02954 {
02955 pNewTagHandler = new FedmIscTagHandler_ISO15693_NXP_ICODE_SLIX_S(this, tabItem);
02956 }
02957 }
02958 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_STM_LRI2K)
02959 {
02960 if(tabItem->m_pTagHandler != NULL)
02961 {
02962 if(dynamic_cast<FedmIscTagHandler_ISO15693_STM_LRI2K*>(tabItem->m_pTagHandler) == NULL)
02963 {
02964 delete tabItem->m_pTagHandler;
02965 tabItem->m_pTagHandler = NULL;
02966 pNewTagHandler = new FedmIscTagHandler_ISO15693_STM_LRI2K(this, tabItem);
02967 }
02968 else
02969 {
02970 pNewTagHandler = tabItem->m_pTagHandler;
02971 }
02972 }
02973 else
02974 {
02975 pNewTagHandler = new FedmIscTagHandler_ISO15693_STM_LRI2K(this, tabItem);
02976 }
02977 }
02978 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_STM_LRIS2K)
02979 {
02980 if(tabItem->m_pTagHandler != NULL)
02981 {
02982 if(dynamic_cast<FedmIscTagHandler_ISO15693_STM_LRIS2K*>(tabItem->m_pTagHandler) == NULL)
02983 {
02984 delete tabItem->m_pTagHandler;
02985 tabItem->m_pTagHandler = NULL;
02986 pNewTagHandler = new FedmIscTagHandler_ISO15693_STM_LRIS2K(this, tabItem);
02987 }
02988 else
02989 {
02990 pNewTagHandler = tabItem->m_pTagHandler;
02991 }
02992 }
02993 else
02994 {
02995 pNewTagHandler = new FedmIscTagHandler_ISO15693_STM_LRIS2K(this, tabItem);
02996 }
02997 }
02998 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_STM_LRIS64K)
02999 {
03000 if(tabItem->m_pTagHandler != NULL)
03001 {
03002 if(dynamic_cast<FedmIscTagHandler_ISO15693_STM_LRIS64K*>(tabItem->m_pTagHandler) == NULL)
03003 {
03004 delete tabItem->m_pTagHandler;
03005 tabItem->m_pTagHandler = NULL;
03006 pNewTagHandler = new FedmIscTagHandler_ISO15693_STM_LRIS64K(this, tabItem);
03007 }
03008 else
03009 {
03010 pNewTagHandler = tabItem->m_pTagHandler;
03011 }
03012 }
03013 else
03014 {
03015 pNewTagHandler = new FedmIscTagHandler_ISO15693_STM_LRIS64K(this, tabItem);
03016 }
03017 }
03018 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_STM_M24LR64R)
03019 {
03020 if(tabItem->m_pTagHandler != NULL)
03021 {
03022 if(dynamic_cast<FedmIscTagHandler_ISO15693_STM_M24LR64R*>(tabItem->m_pTagHandler) == NULL)
03023 {
03024 delete tabItem->m_pTagHandler;
03025 tabItem->m_pTagHandler = NULL;
03026 pNewTagHandler = new FedmIscTagHandler_ISO15693_STM_M24LR64R(this, tabItem);
03027 }
03028 else
03029 {
03030 pNewTagHandler = tabItem->m_pTagHandler;
03031 }
03032 }
03033 else
03034 {
03035 pNewTagHandler = new FedmIscTagHandler_ISO15693_STM_M24LR64R(this, tabItem);
03036 }
03037 }
03038 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_STM_M24LRxxER)
03039 {
03040 if(tabItem->m_pTagHandler != NULL)
03041 {
03042 if(dynamic_cast<FedmIscTagHandler_ISO15693_STM_M24LRxxER*>(tabItem->m_pTagHandler) == NULL)
03043 {
03044 delete tabItem->m_pTagHandler;
03045 tabItem->m_pTagHandler = NULL;
03046 pNewTagHandler = new FedmIscTagHandler_ISO15693_STM_M24LRxxER(this, tabItem);
03047 }
03048 else
03049 {
03050 pNewTagHandler = tabItem->m_pTagHandler;
03051 }
03052 }
03053 else
03054 {
03055 pNewTagHandler = new FedmIscTagHandler_ISO15693_STM_M24LRxxER(this, tabItem);
03056 }
03057 }
03058 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO15693_TI_Tag_it_HFI_Plus)
03059 {
03060 if(tabItem->m_pTagHandler != NULL)
03061 {
03062 if(dynamic_cast<FedmIscTagHandler_ISO15693_TI_Tag_it_HFI_Plus*>(tabItem->m_pTagHandler) == NULL)
03063 {
03064 delete tabItem->m_pTagHandler;
03065 tabItem->m_pTagHandler = NULL;
03066 pNewTagHandler = new FedmIscTagHandler_ISO15693_TI_Tag_it_HFI_Plus(this, tabItem);
03067 }
03068 else
03069 {
03070 pNewTagHandler = tabItem->m_pTagHandler;
03071 }
03072 }
03073 else
03074 {
03075 pNewTagHandler = new FedmIscTagHandler_ISO15693_TI_Tag_it_HFI_Plus(this, tabItem);
03076 }
03077 }
03078 #endif
03079 #if !defined(_FEDM_NO_TAG_HANDLER_ISO18000_3M3)
03080 else if(uiTagHandlerType == FedmIscTagHandler::TYPE_ISO18000_3M3)
03081 {
03082 if(tabItem->m_pTagHandler != NULL)
03083 {
03084 if(dynamic_cast<FedmIscTagHandler_ISO18000_3M3*>(tabItem->m_pTagHandler) == NULL)
03085 {
03086 delete tabItem->m_pTagHandler;
03087 tabItem->m_pTagHandler = NULL;
03088 pNewTagHandler = new FedmIscTagHandler_ISO18000_3M3(this, tabItem);
03089 }
03090 else
03091 {
03092 pNewTagHandler = tabItem->m_pTagHandler;
03093 }
03094 }
03095 else
03096 {
03097 pNewTagHandler = new FedmIscTagHandler_ISO18000_3M3(this, tabItem);
03098 }
03099 }
03100 #endif
03101 else
03102 {
03103 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " Unknown TagHandler-Type " << std::hex << std::uppercase << uiTagHandlerType);
03104 SetLastError(FEDM_ERROR_UNKNOWN_TAG_HANDLER_TYPE);
03105 return NULL;
03106 }
03107
03108 if (pNewTagHandler != NULL)
03109 {
03110
03111 tabItem->m_pTagHandler = pNewTagHandler;
03112 pNewTagHandler->m_bNonAddressedMode = true;
03113 }
03114 else
03115 {
03116 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " Creation of TagHandler failed - no more mem");
03117 SetLastError(FEDM_ERROR_NO_MORE_MEM);
03118 }
03119
03120 return pNewTagHandler;
03121 }
03122 #endif
03123
03124
03125
03126
03127
03128
03129
03130
03131
03132
03133
03134
03135
03136 #ifdef _FEDM_TAG_HANDLER
03137 #if !defined(_FEDM_NO_TAG_HANDLER_EPC_C1_G2)
03138 FedmIscTagHandler* FEDM_ISCReaderModule::Convert_EPC_C1_G2_TagHandler(FedmIscTagHandler* pTagHandler, unsigned char ucMfrCode, unsigned int uiTagHandlerType)
03139 {
03140 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_TAG_HANDLER, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "MfrCode=0x" << std::hex <<::std::uppercase << (int)ucMfrCode << "TagHandlerType=0x" << std::hex <<::std::uppercase << uiTagHandlerType);
03141
03142 if( !m_bEnableTagHandler )
03143 {
03144 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " Support for TagHandler disabled");
03145 SetLastError(FEDM_ERROR_UNSUPPORTED);
03146 return NULL;
03147 }
03148
03149 if(pTagHandler == NULL)
03150 {
03151 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " TagHandler is NULL");
03152 SetLastError(FEDM_ERROR_NULL_POINTER);
03153 return NULL;
03154 }
03155
03156 if(dynamic_cast<FedmIscTagHandler_EPC_Class1_Gen2*>(pTagHandler) == NULL)
03157 {
03158 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " TagHandler is not of type EPC C1G2");
03159 SetLastError(FEDM_ERROR_UNSUPPORTED_TRANSPONDER_TYPE);
03160 return NULL;
03161 }
03162
03163 int iIdx = pTagHandler->m_pTabItem->m_uiTabIndex;
03164
03165 switch(ucMfrCode)
03166 {
03167 case FEDM_ISC_ISO_MFR_IDS:
03168 if(uiTagHandlerType == FedmIscTagHandler::TYPE_EPC_CLASS1_GEN2_IDS_SL900A)
03169 {
03170 FedmIscTagHandler_EPC_Class1_Gen2_IDS_SL900A* pNewTagHandler = NULL;
03171 pNewTagHandler = new FedmIscTagHandler_EPC_Class1_Gen2_IDS_SL900A(this, pTagHandler->m_pTabItem);
03172 if(pNewTagHandler != NULL)
03173 {
03174 delete pTagHandler;
03175 m_ISOTable[iIdx]->m_pTagHandler = (FedmIscTagHandler*)pNewTagHandler;
03176 return (FedmIscTagHandler*)pNewTagHandler;
03177 }
03178 }
03179 break;
03180
03181 default:
03182 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " Unsupported manufacturer code");
03183 break;
03184 }
03185
03186 SetLastError(FEDM_ERROR_PARAMETER);
03187 return NULL;
03188 }
03189 #endif
03190 #endif
03191
03192
03194
03196
03197
03198
03199
03200
03201
03202
03203
03204
03205
03206
03207
03208
03209
03210
03211
03212
03213
03214 int FEDM_ISCReaderModule::StartAsyncTask(FEDM_TASK_INIT* pInit)
03215 {
03216 int iBack = 0;
03217 string sDbgMsg;
03218 FEISC_TASK_INIT TI;
03219
03220 if(pInit == NULL)
03221 {
03222 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " pInit=NULL");
03223 FEDM_RETURN(FEDM_ERROR_NULL_POINTER);
03224 }
03225
03226
03227 switch(pInit->uiFlag)
03228 {
03229 case FEDM_TASKCB1:
03230 sDbgMsg = "Flag=CB1";
03231 if(pInit->cbFct1 == NULL)
03232 iBack = FEDM_ERROR_NULL_POINTER;
03233 break;
03234 case FEDM_TASKCB2:
03235 sDbgMsg = "Flag=CB2";
03236 if(pInit->cbFct2 == NULL)
03237 iBack = FEDM_ERROR_NULL_POINTER;
03238 break;
03239 #ifdef _FEDM_WINDOWS
03240 case FEDM_TASKCB_NET1:
03241 sDbgMsg = "Flag=CBNet1";
03242 if(pInit->cbFctNET1 == NULL)
03243 iBack = FEDM_ERROR_NULL_POINTER;
03244 break;
03245 #endif
03246 default:
03247 iBack = FEDM_ERROR_UNSUPPORTED;
03248 }
03249
03250
03251 switch(pInit->uiUse)
03252 {
03253 case FEDM_TASKID_FIRST_NEW_TAG:
03254 sDbgMsg += ", Use=FirstNewTag";
03255 switch(pInit->uiFlag)
03256 {
03257 case FEDM_TASKCB1:
03258 case FEDM_TASKCB_NET1:
03259 break;
03260 default:
03261 iBack = FEDM_ERROR_UNSUPPORTED;
03262 }
03263 break;
03264
03265 case FEDM_TASKID_EVERY_NEW_TAG:
03266 sDbgMsg += ", Use=EveryNewTag";
03267 switch(pInit->uiFlag)
03268 {
03269 case FEDM_TASKCB1:
03270 case FEDM_TASKCB_NET1:
03271 break;
03272 default:
03273 iBack = FEDM_ERROR_UNSUPPORTED;
03274 }
03275 break;
03276
03277 case FEDM_TASKID_NOTIFICATION:
03278 sDbgMsg += ", Use=Notification";
03279 switch(pInit->uiFlag)
03280 {
03281 case FEDM_TASKCB1:
03282 case FEDM_TASKCB2:
03283 case FEDM_TASKCB_NET1:
03284 break;
03285 default:
03286 iBack = FEDM_ERROR_UNSUPPORTED;
03287 }
03288 break;
03289
03290
03291
03292
03293
03294
03295
03296
03297
03298
03299
03300
03301
03302
03303 default:
03304 iBack = FEDM_ERROR_UNSUPPORTED;
03305 }
03306
03307 if(pInit->bCryptoMode)
03308 sDbgMsg += ", Crypto=On";
03309 else
03310 sDbgMsg += ", Crypto=Off";
03311
03312 if(pInit->bKeepAlive)
03313 sDbgMsg += ", KeepAlive=On";
03314 else
03315 sDbgMsg += ", KeepAlive=Off";
03316
03317 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_EVENTING, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, sDbgMsg);
03318
03319 if(iBack < 0)
03320 {
03321 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(iBack));
03322 FEDM_RETURN(iBack);
03323 }
03324
03325 memset(&m_TaskInit, 0, sizeof(FEDM_TASK_INIT));
03326 m_TaskInit.uiFlag = pInit->uiFlag;
03327 m_TaskInit.uiUse = pInit->uiUse;
03328 m_TaskInit.pAny = pInit->pAny;
03329 m_TaskInit.iConnectByHost = pInit->iConnectByHost;
03330 m_TaskInit.iNotifyWithAck = pInit->iNotifyWithAck;
03331 m_TaskInit.uiTimeout = pInit->uiTimeout;
03332 if(pInit->bCryptoMode)
03333 {
03334 m_TaskInit.bCryptoMode = true;
03335 if( pInit->uiAuthentKeyLength != 16 &&
03336 pInit->uiAuthentKeyLength != 24 &&
03337 pInit->uiAuthentKeyLength != 32)
03338 {
03339 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_PARAMETER));
03340 FEDM_RETURN(FEDM_ERROR_PARAMETER);
03341 }
03342 m_TaskInit.uiAuthentKeyLength = pInit->uiAuthentKeyLength;
03343 memcpy(m_TaskInit.ucAuthentKey, pInit->ucAuthentKey, pInit->uiAuthentKeyLength);
03344 }
03345 if(pInit->bKeepAlive)
03346 {
03347 m_TaskInit.bKeepAlive = true;
03348 m_TaskInit.uiKeepAliveIdleTime = pInit->uiKeepAliveIdleTime;
03349 m_TaskInit.uiKeepAliveProbeCount = pInit->uiKeepAliveProbeCount;
03350 m_TaskInit.uiKeepAliveIntervalTime = pInit->uiKeepAliveIntervalTime;
03351 }
03352
03353
03354 switch(pInit->uiFlag)
03355 {
03356 case FEDM_TASKCB1:
03357 m_TaskInit.cbFct1 = pInit->cbFct1;
03358 break;
03359 case FEDM_TASKCB2:
03360 m_TaskInit.cbFct2 = pInit->cbFct2;
03361 break;
03362 #ifdef _FEDM_WINDOWS
03363 case FEDM_TASKCB_NET1:
03364 m_TaskInit.cbFctNET1 = pInit->cbFctNET1;
03365 break;
03366 #endif
03367 }
03368
03369 memset(&TI, 0, sizeof(FEISC_TASK_INIT));
03370
03371
03372 switch(pInit->uiUse)
03373 {
03374 case FEDM_TASKID_FIRST_NEW_TAG:
03375 TI.uiFlag = FEISC_TASKCB_1;
03376 #if defined(__BORLANDC__)
03377 TI.cbFct1 = (void(*)(void*, int, int, int, unsigned char, unsigned char*, int))cbsTaskRsp1;
03378 #else
03379 TI.cbFct1 = cbsTaskRsp1;
03380 #endif
03381 TI.uiChannelType = FEISC_TASK_CHANNEL_TYPE_AS_OPEN;
03382 TI.ucBusAdr = GetBusAddress();
03383 TI.iConnectByHost = 0;
03384 memset(TI.cIPAdr, 0, 16);
03385 TI.iPortNr = 0;
03386 TI.pAny = (void*)this;
03387 TI.uiTimeout = m_TaskInit.uiTimeout;
03388 if(m_TaskInit.bCryptoMode)
03389 {
03390 TI.bCryptoMode = true;
03391 TI.uiAuthentKeyLength = m_TaskInit.uiAuthentKeyLength;
03392 memcpy(TI.ucAuthentKey, m_TaskInit.ucAuthentKey, m_TaskInit.uiAuthentKeyLength);
03393 }
03394 FEDM_CHK2(iBack, SetData(FEDM_ISC_TMP_B0_CMD, (unsigned char)0x01));
03395
03396 FEDM_CHK2(iBack, FEISC_StartAsyncTask(GetReaderHnd(), FEISC_TASKID_FIRST_NEW_TAG, &TI, NULL));
03397 break;
03398
03399 case FEDM_TASKID_EVERY_NEW_TAG:
03400 TI.uiFlag = FEISC_TASKCB_1;
03401 #if defined(__BORLANDC__)
03402 TI.cbFct1 = (void(*)(void*, int, int, int, unsigned char, unsigned char*, int))cbsTaskRsp1;
03403 #else
03404 TI.cbFct1 = cbsTaskRsp1;
03405 #endif
03406 TI.uiChannelType = FEISC_TASK_CHANNEL_TYPE_AS_OPEN;
03407 TI.ucBusAdr = GetBusAddress();
03408 TI.iConnectByHost = 0;
03409 memset(TI.cIPAdr, 0, 16);
03410 TI.iPortNr = 0;
03411 TI.pAny = (void*)this;
03412 TI.uiTimeout = m_TaskInit.uiTimeout;
03413 if(m_TaskInit.bCryptoMode)
03414 {
03415 TI.bCryptoMode = true;
03416 TI.uiAuthentKeyLength = m_TaskInit.uiAuthentKeyLength;
03417 memcpy(TI.ucAuthentKey, m_TaskInit.ucAuthentKey, m_TaskInit.uiAuthentKeyLength);
03418 }
03419 FEDM_CHK2(iBack, SetData(FEDM_ISC_TMP_B0_CMD, (unsigned char)0x01));
03420
03421 FEDM_CHK2(iBack, FEISC_StartAsyncTask(GetReaderHnd(), FEISC_TASKID_EVERY_NEW_TAG, &TI, NULL));
03422 break;
03423
03424 case FEDM_TASKID_NOTIFICATION:
03425
03426 TI.uiFlag = FEISC_TASKCB_2;
03427 #if defined(__BORLANDC__)
03428 TI.cbFct2 = (void(*)(void*, int, int, int, unsigned char, unsigned char*, int, char*, int))cbsTaskRsp2;
03429 #else
03430 TI.cbFct2 = cbsTaskRsp2;
03431 #endif
03432 TI.uiChannelType = FEISC_TASK_CHANNEL_TYPE_NEW_TCP;
03433 TI.ucBusAdr = GetBusAddress();
03434 TI.iConnectByHost = pInit->iConnectByHost;
03435 strcpy(TI.cIPAdr, pInit->cIPAdr);
03436 TI.iPortNr = pInit->iPortNr;
03437 TI.pAny = (void*)this;
03438 TI.uiTimeout = m_TaskInit.uiTimeout;
03439 TI.iNotifyWithAck = pInit->iNotifyWithAck;
03440 if(m_TaskInit.bCryptoMode)
03441 {
03442 TI.bCryptoMode = true;
03443 TI.uiAuthentKeyLength = m_TaskInit.uiAuthentKeyLength;
03444 memcpy(TI.ucAuthentKey, m_TaskInit.ucAuthentKey, m_TaskInit.uiAuthentKeyLength);
03445 }
03446 if(m_TaskInit.bKeepAlive)
03447 {
03448 TI.bKeepAlive = true;
03449 TI.uiKeepAliveIdleTime = m_TaskInit.uiKeepAliveIdleTime;
03450 TI.uiKeepAliveProbeCount = m_TaskInit.uiKeepAliveProbeCount;
03451 TI.uiKeepAliveIntervalTime = m_TaskInit.uiKeepAliveIntervalTime;
03452 }
03453
03454 if(pInit->uiUse == FEDM_TASKID_NOTIFICATION)
03455 {
03456 FEDM_CHK2(iBack, FEISC_StartAsyncTask(GetReaderHnd(), FEISC_TASKID_NOTIFICATION, &TI, NULL));
03457 }
03458
03459
03460
03461
03462 break;
03463 }
03464
03465 m_bActiveAsyncTask = true;
03466
03467 FEDM_RETURN(FEDM_OK);
03468 }
03469
03470 int FEDM_ISCReaderModule::CancelAsyncTask()
03471 {
03472 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_EVENTING, __FUNCTION__);
03473
03474 int iBack = 0;
03475
03476 if(m_bActiveAsyncTask)
03477 {
03478 FEDM_CHK2(iBack, FEISC_CancelAsyncTask(GetReaderHnd()));
03479 m_bActiveAsyncTask = false;
03480 }
03481
03482 FEDM_RETURN(FEDM_OK);
03483 }
03484
03485 int FEDM_ISCReaderModule::TriggerAsyncTask()
03486 {
03487 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_EVENTING, __FUNCTION__);
03488
03489 int iBack = 0;
03490
03491 if(m_bActiveAsyncTask)
03492 {
03493 FEDM_CHK2(iBack, FEISC_TriggerAsyncTask(GetReaderHnd()));
03494 }
03495
03496 FEDM_RETURN(FEDM_OK);
03497 }
03498
03499
03500
03501
03503
03505
03506
03507
03508
03509
03510
03511
03512
03513
03514
03515
03516
03517
03518
03519
03520
03521
03522
03523
03524
03525
03526
03527
03528
03529
03530
03531 int FEDM_ISCReaderModule::SetPortPara(char* cPara, char* cValue)
03532 {
03533 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_ADMIN_SET_GET, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "Para=" << cPara << ", Value=" << cValue);
03534
03535 int iBack = 0;
03536
03537 #if defined(_FEDM_COM_SUPPORT)
03538
03539 if(strcmp(cPara, "PortPrefix")==0)
03540 {
03541 #if !defined(_FEDM_LINUX)
03542 return 0;
03543 #else
03544 #if !defined(_FEDM_SUPPORT_SLINK)
03545 LPFN_FECOM_SET_PORT_PARA lpfnSetPortPara = (LPFN_FECOM_SET_PORT_PARA)GetFeComFunction(FECOM_SET_PORT_PARA);
03546 FEDM_CHK5(lpfnSetPortPara);
03547 iBack = lpfnSetPortPara(0, cPara, cValue);
03548 FEDM_RETURN(iBack);
03549 #else
03550 iBack = FECOM_SetPortPara(0, cPara, cValue);
03551 FEDM_RETURN(iBack);
03552 #endif
03553 #endif // #if !defined(_FEDM_LINUX)
03554 }
03555 #endif // #if defined(_FEDM_COM_SUPPORT)
03556
03557
03558 #ifdef _FEDM_USB_SUPPORT
03559
03560 if(strcmp(cPara, "ExclusiveAccess")==0)
03561 {
03562 #if !defined(_FEDM_SUPPORT_SLINK)
03563 LPFN_FEUSB_SET_DEVICE_PARA lpfnSetDevicePara = (LPFN_FEUSB_SET_DEVICE_PARA)GetFeUsbFunction(FEUSB_SET_DEVICE_PARA);
03564 FEDM_CHK5(lpfnSetDevicePara);
03565 iBack = lpfnSetDevicePara(0, cPara, cValue);
03566 FEDM_RETURN(iBack);
03567 #else
03568 iBack = FEUSB_SetDevicePara(0, cPara, cValue);
03569 FEDM_RETURN(iBack);
03570 #endif
03571 }
03572 #endif // #ifdef _FEDM_USB_SUPPORT
03573
03574
03575 if(m_iCommMode == FEDM_COMM_MODE_UNDEF)
03576 {
03577 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
03578 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
03579 }
03580
03581 int iPortHnd = GetPortHnd();
03582 if(iPortHnd <= 0)
03583 {
03584 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
03585 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
03586 }
03587
03588
03589 #ifdef _FEDM_COM_SUPPORT
03590 #if !defined(_FEDM_SUPPORT_SLINK)
03591 LPFN_FECOM_SET_PORT_PARA lpfnSetPortPara = (LPFN_FECOM_SET_PORT_PARA)GetFeComFunction(FECOM_SET_PORT_PARA);
03592 LPFN_FECOM_DO_PORT_CMD lpfnDoPortCmd = (LPFN_FECOM_DO_PORT_CMD)GetFeComFunction(FECOM_DO_PORT_CMD);
03593 if(m_iCommMode == FEDM_COMM_MODE_SERIAL)
03594 {
03595 FEDM_CHK5(lpfnSetPortPara);
03596 FEDM_CHK5(lpfnDoPortCmd);
03597 }
03598 #endif
03599 #endif
03600
03601 #ifdef _FEDM_USB_SUPPORT
03602 #if !defined(_FEDM_SUPPORT_SLINK)
03603 LPFN_FEUSB_SET_DEVICE_PARA lpfnSetDevicePara = (LPFN_FEUSB_SET_DEVICE_PARA)GetFeUsbFunction(FEUSB_SET_DEVICE_PARA);
03604 if(m_iCommMode == FEDM_COMM_MODE_USB)
03605 {
03606 FEDM_CHK5(lpfnSetDevicePara);
03607 }
03608 #endif
03609 #endif
03610
03611 #ifdef _FEDM_TCP_SUPPORT
03612 #if !defined(_FEDM_SUPPORT_SLINK)
03613 LPFN_FETCP_SET_SOCKET_PARA lpfnSetSocketPara = (LPFN_FETCP_SET_SOCKET_PARA)GetFeTcpFunction(FETCP_SET_SOCKET_PARA);
03614 if(m_iCommMode == FEDM_COMM_MODE_TCP)
03615 {
03616 FEDM_CHK5(lpfnSetSocketPara);
03617 }
03618 #endif
03619 #endif
03620
03621
03622 if(m_iCommMode == FEDM_COMM_MODE_SERIAL)
03623 {
03624 #ifdef _FEDM_COM_SUPPORT
03625 if(strcmp(cPara, "SetRTS")==0)
03626 {
03627 #if !defined(_FEDM_SUPPORT_SLINK)
03628 iBack = lpfnDoPortCmd(iPortHnd, cPara, cValue);
03629 FEDM_RETURN(iBack);
03630 #else
03631 iBack = FECOM_DoPortCmd(iPortHnd, cPara, cValue);
03632 FEDM_RETURN(iBack);
03633 #endif
03634 }
03635 else if(strcmp(cPara, "SetDTR")==0)
03636 {
03637 #if !defined(_FEDM_SUPPORT_SLINK)
03638 iBack = lpfnDoPortCmd(iPortHnd, cPara, cValue);
03639 FEDM_RETURN(iBack);
03640 #else
03641 iBack = FECOM_DoPortCmd(iPortHnd, cPara, cValue);
03642 FEDM_RETURN(iBack);
03643 #endif
03644 }
03645 else
03646 {
03647 #if !defined(_FEDM_SUPPORT_SLINK)
03648 iBack = lpfnSetPortPara(iPortHnd, cPara, cValue);
03649 FEDM_RETURN(iBack);
03650 #else
03651 iBack = FECOM_SetPortPara(iPortHnd, cPara, cValue);
03652 FEDM_RETURN(iBack);
03653 #endif
03654 }
03655 #else
03656 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
03657 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
03658 #endif
03659 }
03660 else if(m_iCommMode == FEDM_COMM_MODE_TCP)
03661 {
03662 #ifdef _FEDM_TCP_SUPPORT
03663 #if !defined(_FEDM_SUPPORT_SLINK)
03664 iBack = lpfnSetSocketPara(iPortHnd, cPara, cValue);
03665 FEDM_RETURN(iBack);
03666 #else
03667 iBack = FETCP_SetSocketPara(iPortHnd, cPara, cValue);
03668 FEDM_RETURN(iBack);
03669 #endif
03670 #else
03671 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
03672 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
03673 #endif
03674 }
03675 else if(m_iCommMode == FEDM_COMM_MODE_USB)
03676 {
03677 #ifdef _FEDM_USB_SUPPORT
03678 #if !defined(_FEDM_SUPPORT_SLINK)
03679 iBack = lpfnSetDevicePara(iPortHnd, cPara, cValue);
03680 FEDM_RETURN(iBack);
03681 #else
03682 iBack = FEUSB_SetDevicePara(iPortHnd, cPara, cValue);
03683 FEDM_RETURN(iBack);
03684 #endif
03685 #else
03686 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
03687 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
03688 #endif
03689 }
03690
03691 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
03692 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
03693 }
03694
03695
03696
03697
03698
03699
03700
03701
03702
03703
03704
03705
03706
03707
03708
03709
03710
03711
03712
03713
03714
03715
03716 int FEDM_ISCReaderModule::SetPortPara(char* cPara, int iValue)
03717 {
03718 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_ADMIN_SET_GET, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "Para=" << cPara << ", Value=" << iValue);
03719
03720 int iBack = 0;
03721 char cValue[16];
03722
03723 #ifdef _FEDM_USB_SUPPORT
03724
03725 if(strcmp(cPara, "ExclusiveAccess")==0)
03726 {
03727 #if !defined(_FEDM_SUPPORT_SLINK)
03728 LPFN_FEUSB_SET_DEVICE_PARA lpfnSetDevicePara = (LPFN_FEUSB_SET_DEVICE_PARA)GetFeUsbFunction(FEUSB_SET_DEVICE_PARA);
03729 FEDM_CHK5(lpfnSetDevicePara);
03730 sprintf(cValue,"%d", iValue);
03731 iBack = lpfnSetDevicePara(0, cPara, cValue);
03732 FEDM_RETURN(iBack);
03733 #else
03734 iBack = FEUSB_SetDevicePara(0, cPara, cValue);
03735 FEDM_RETURN(iBack);
03736 #endif
03737 }
03738 #endif
03739
03740 if(m_iCommMode == FEDM_COMM_MODE_UNDEF)
03741 {
03742 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
03743 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
03744 }
03745
03746 int iPortHnd = GetPortHnd();
03747 if(iPortHnd < 0)
03748 {
03749 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
03750 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
03751 }
03752
03753
03754 #ifdef _FEDM_COM_SUPPORT
03755 #if !defined(_FEDM_SUPPORT_SLINK)
03756 LPFN_FECOM_SET_PORT_PARA lpfnSetPortPara = (LPFN_FECOM_SET_PORT_PARA)GetFeComFunction(FECOM_SET_PORT_PARA);
03757 if(m_iCommMode == FEDM_COMM_MODE_SERIAL)
03758 {
03759 FEDM_CHK5(lpfnSetPortPara);
03760 }
03761 #endif
03762 #endif
03763
03764 #ifdef _FEDM_USB_SUPPORT
03765 #if !defined(_FEDM_SUPPORT_SLINK)
03766 LPFN_FEUSB_SET_DEVICE_PARA lpfnSetDevicePara = (LPFN_FEUSB_SET_DEVICE_PARA)GetFeUsbFunction(FEUSB_SET_DEVICE_PARA);
03767 if(m_iCommMode == FEDM_COMM_MODE_USB)
03768 {
03769 FEDM_CHK5(lpfnSetDevicePara);
03770 }
03771 #endif
03772 #endif
03773
03774 #ifdef _FEDM_TCP_SUPPORT
03775 #if !defined(_FEDM_SUPPORT_SLINK)
03776 LPFN_FETCP_SET_SOCKET_PARA lpfnSetSocketPara = (LPFN_FETCP_SET_SOCKET_PARA)GetFeTcpFunction(FETCP_SET_SOCKET_PARA);
03777 if(m_iCommMode == FEDM_COMM_MODE_TCP)
03778 {
03779 FEDM_CHK5(lpfnSetSocketPara);
03780 }
03781 #endif
03782 #endif
03783
03784 if(m_iCommMode == FEDM_COMM_MODE_SERIAL)
03785 {
03786 #ifdef _FEDM_COM_SUPPORT
03787 sprintf(cValue,"%d", iValue);
03788 #if !defined(_FEDM_SUPPORT_SLINK)
03789 iBack = lpfnSetPortPara(iPortHnd, cPara, cValue);
03790 FEDM_RETURN(iBack);
03791 #else
03792 iBack = FECOM_SetPortPara(iPortHnd, cPara, cValue);
03793 FEDM_RETURN(iBack);
03794 #endif
03795 #else
03796 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
03797 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
03798 #endif
03799 }
03800 else if(m_iCommMode == FEDM_COMM_MODE_TCP)
03801 {
03802 #ifdef _FEDM_TCP_SUPPORT
03803 sprintf(cValue,"%d", iValue);
03804 #if !defined(_FEDM_SUPPORT_SLINK)
03805 iBack = lpfnSetSocketPara(iPortHnd, cPara, cValue);
03806 FEDM_RETURN(iBack);
03807 #else
03808 iBack = FETCP_SetSocketPara(iPortHnd, cPara, cValue);
03809 FEDM_RETURN(iBack);
03810 #endif
03811 #else
03812 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
03813 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
03814 #endif
03815 }
03816 else if(m_iCommMode == FEDM_COMM_MODE_USB)
03817 {
03818 #ifdef _FEDM_USB_SUPPORT
03819 sprintf(cValue,"%d", iValue);
03820 #if !defined(_FEDM_SUPPORT_SLINK)
03821 iBack = lpfnSetDevicePara(iPortHnd, cPara, cValue);
03822 FEDM_RETURN(iBack);
03823 #else
03824 iBack = FEUSB_SetDevicePara(iPortHnd, cPara, cValue);
03825 FEDM_RETURN(iBack);
03826 #endif
03827 #else
03828 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
03829 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
03830 #endif
03831 }
03832
03833 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
03834 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
03835 }
03836
03837
03838
03839
03840
03841
03842
03843
03844
03845
03846
03847
03848
03849
03850
03851
03852
03853
03854
03855 int FEDM_ISCReaderModule::GetPortPara(char* cPara, char* cValue)
03856 {
03857 if(m_iCommMode == FEDM_COMM_MODE_UNDEF)
03858 {
03859 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
03860 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
03861 }
03862
03863 int iBack = 0;
03864 int iPortHnd = GetPortHnd();
03865 if(iPortHnd < 0)
03866 {
03867 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
03868 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
03869 }
03870
03871
03872 #ifdef _FEDM_COM_SUPPORT
03873 #if !defined(_FEDM_SUPPORT_SLINK)
03874 LPFN_FECOM_GET_PORT_PARA lpfnGetPortPara = (LPFN_FECOM_GET_PORT_PARA)GetFeComFunction(FECOM_GET_PORT_PARA);
03875 FEDM_CHK5(lpfnGetPortPara);
03876 #endif
03877 #endif
03878
03879 #ifdef _FEDM_USB_SUPPORT
03880 #if !defined(_FEDM_SUPPORT_SLINK)
03881 LPFN_FEUSB_GET_DEVICE_PARA lpfnGetDevicePara = (LPFN_FEUSB_GET_DEVICE_PARA)GetFeUsbFunction(FEUSB_GET_DEVICE_PARA);
03882 FEDM_CHK5(lpfnGetDevicePara);
03883 #endif
03884 #endif
03885
03886 #ifdef _FEDM_TCP_SUPPORT
03887 #if !defined(_FEDM_SUPPORT_SLINK)
03888 LPFN_FETCP_GET_SOCKET_PARA lpfnGetSocketPara = (LPFN_FETCP_GET_SOCKET_PARA)GetFeTcpFunction(FETCP_GET_SOCKET_PARA);
03889 FEDM_CHK5(lpfnGetSocketPara);
03890 #endif
03891 #endif
03892
03893 if(m_iCommMode == FEDM_COMM_MODE_SERIAL)
03894 {
03895 #ifdef _FEDM_COM_SUPPORT
03896 #if !defined(_FEDM_SUPPORT_SLINK)
03897 iBack = lpfnGetPortPara(iPortHnd, cPara, cValue);
03898 FEDM_RETURN(iBack);
03899 #else
03900 iBack = FECOM_GetPortPara(iPortHnd, cPara, cValue);
03901 FEDM_RETURN(iBack);
03902 #endif
03903 #else
03904 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
03905 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
03906 #endif
03907 }
03908 else if(m_iCommMode == FEDM_COMM_MODE_USB)
03909 {
03910 #ifdef _FEDM_USB_SUPPORT
03911 if(strcmp(cPara, "ExclusiveAccess")==0)
03912 {
03913 iPortHnd = 0;
03914 }
03915 #if !defined(_FEDM_SUPPORT_SLINK)
03916 iBack = lpfnGetDevicePara(iPortHnd, cPara, cValue);
03917 FEDM_RETURN(iBack);
03918 #else
03919 iBack = FEUSB_GetDevicePara(iPortHnd, cPara, cValue);
03920 FEDM_RETURN(iBack);
03921 #endif
03922 #else
03923 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
03924 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
03925 #endif
03926 }
03927 else if(m_iCommMode == FEDM_COMM_MODE_TCP)
03928 {
03929 #ifdef _FEDM_TCP_SUPPORT
03930 #if !defined(_FEDM_SUPPORT_SLINK)
03931 iBack = lpfnGetSocketPara(iPortHnd, cPara, cValue);
03932 FEDM_RETURN(iBack);
03933 #else
03934 iBack = FETCP_GetSocketPara(iPortHnd, cPara, cValue);
03935 FEDM_RETURN(iBack);
03936 #endif
03937 #else
03938 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
03939 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
03940 #endif
03941 }
03942
03943 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
03944 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
03945 }
03946
03947
03948
03949
03950
03951
03952
03953
03954
03955
03956
03957
03958
03959
03960
03961
03962
03963
03964
03965
03966
03967
03968 int FEDM_ISCReaderModule::GetPortPara(char* cPara, int* iValue)
03969 {
03970 if(m_iCommMode == FEDM_COMM_MODE_UNDEF)
03971 {
03972 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
03973 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
03974 }
03975
03976 int iPortHnd = GetPortHnd();
03977 if(iPortHnd < 0)
03978 {
03979 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
03980 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
03981 }
03982
03983
03984 char cValue[16];
03985 int iErr;
03986
03987 #ifdef _FEDM_COM_SUPPORT
03988 #if !defined(_FEDM_SUPPORT_SLINK)
03989 LPFN_FECOM_GET_PORT_PARA lpfnGetPortPara = (LPFN_FECOM_GET_PORT_PARA)GetFeComFunction(FECOM_GET_PORT_PARA);
03990 FEDM_CHK5(lpfnGetPortPara);
03991 #endif
03992 #endif
03993
03994 #ifdef _FEDM_USB_SUPPORT
03995 #if !defined(_FEDM_SUPPORT_SLINK)
03996 LPFN_FEUSB_GET_DEVICE_PARA lpfnGetDevicePara = (LPFN_FEUSB_GET_DEVICE_PARA)GetFeUsbFunction(FEUSB_GET_DEVICE_PARA);
03997 FEDM_CHK5(lpfnGetDevicePara);
03998 #endif
03999 #endif
04000
04001 #ifdef _FEDM_TCP_SUPPORT
04002 #if !defined(_FEDM_SUPPORT_SLINK)
04003 LPFN_FETCP_GET_SOCKET_PARA lpfnGetSocketPara = (LPFN_FETCP_GET_SOCKET_PARA)GetFeTcpFunction(FETCP_GET_SOCKET_PARA);
04004 FEDM_CHK5(lpfnGetSocketPara);
04005 #endif
04006 #endif
04007
04008 if(m_iCommMode == FEDM_COMM_MODE_SERIAL)
04009 {
04010 #ifdef _FEDM_COM_SUPPORT
04011 #if !defined(_FEDM_SUPPORT_SLINK)
04012 FEDM_CHK2(iErr, lpfnGetPortPara(iPortHnd, cPara, cValue));
04013 #else
04014 FEDM_CHK2(iErr, FECOM_GetPortPara(iPortHnd, cPara, cValue));
04015 #endif
04016 sscanf(cValue,"%d", iValue);
04017 #else
04018 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
04019 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
04020 #endif
04021 }
04022 else if(m_iCommMode == FEDM_COMM_MODE_TCP)
04023 {
04024 #ifdef _FEDM_TCP_SUPPORT
04025 #if !defined(_FEDM_SUPPORT_SLINK)
04026 FEDM_CHK2(iErr, lpfnGetSocketPara(iPortHnd, cPara, cValue));
04027 #else
04028 FEDM_CHK2(iErr, FETCP_GetSocketPara(iPortHnd, cPara, cValue));
04029 #endif
04030 sscanf(cValue,"%d", iValue);
04031 #else
04032 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
04033 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
04034 #endif
04035 }
04036 else if(m_iCommMode == FEDM_COMM_MODE_USB)
04037 {
04038 #ifdef _FEDM_USB_SUPPORT
04039 if(strcmp(cPara, "ExclusiveAccess")==0)
04040 {
04041 iPortHnd = 0;
04042 }
04043 #if !defined(_FEDM_SUPPORT_SLINK)
04044 FEDM_CHK2(iErr, lpfnGetDevicePara(iPortHnd, cPara, cValue));
04045 #else
04046 FEDM_CHK2(iErr, FEUSB_GetDevicePara(iPortHnd, cPara, cValue));
04047 #endif
04048 sscanf(cValue,"%d", iValue);
04049 #else
04050 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
04051 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
04052 #endif
04053 }
04054 else
04055 {
04056 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED_PORT_DRIVER));
04057 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED_PORT_DRIVER);
04058 }
04059
04060 FEDM_RETURN(FEDM_OK);
04061 }
04062
04063
04064
04066
04068
04069
04070
04071
04072
04073
04074
04075
04076
04077
04078
04079
04080
04081
04082
04083
04084
04085
04086
04087
04088
04089
04090
04091
04092
04093
04094
04095
04096
04097
04098
04099
04100
04101 int FEDM_ISCReaderModule::ReadCompleteConfiguration(bool bEEPROM)
04102 {
04103 if(bEEPROM)
04104 {
04105 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_HIGH_LEVEL, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "EEPROM");
04106 }
04107 else
04108 {
04109 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_HIGH_LEVEL, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "RAM");
04110 }
04111
04112 int iErr = 0;
04113 int iBitNr = 0;
04114 int iBitPos = 0;
04115 int iIdx = 0;
04116 unsigned char ucPage = 0;
04117 unsigned int uiMaxPages = 0;
04118 unsigned __int64 ui64CfgReadPermissions = 0;
04119 unsigned __int64 ui64BitNr = 0;
04120
04121 if(! IsConnected())
04122 {
04123 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
04124 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
04125 }
04126
04127 switch(m_uiReaderType)
04128 {
04129 case FEDM_ISC_TYPE_ISCM02:
04130 case FEDM_ISC_TYPE_ISCM02_M8:
04131 case FEDM_ISC_TYPE_ISCPRH100:
04132 case FEDM_ISC_TYPE_ISCPRH100_U:
04133 case FEDM_ISC_TYPE_ISCMR100:
04134 case FEDM_ISC_TYPE_ISCMR100_U:
04135 case FEDM_ISC_TYPE_CPRM02:
04136 case FEDM_ISC_TYPE_CPR02:
04137 case FEDM_ISC_TYPE_CPR04_U:
04138 case FEDM_ISC_TYPE_CPR40_XX_U:
04139 case FEDM_ISC_TYPE_CPR40_XX:
04140 case FEDM_ISC_TYPE_CPR44_XX:
04141 if(m_ReaderInfo.bIsMode0x40Read)
04142 {
04143 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04144 }
04145 else
04146 {
04147 uiMaxPages = 8;
04148 #ifdef __GNUC__
04149 ui64CfgReadPermissions = 0xFF00000000000000LL;
04150 #else
04151 ui64CfgReadPermissions = 0xFF00000000000000;
04152 #endif
04153 }
04154 break;
04155
04156 case FEDM_ISC_TYPE_CPR50_XX:
04157 if(m_ReaderInfo.bIsMode0x40Read)
04158 {
04159 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04160 }
04161 else
04162 {
04163 uiMaxPages = 64;
04164 #ifdef __GNUC__
04165 ui64CfgReadPermissions = 0xFFC0800000C00001LL;
04166 #else
04167 ui64CfgReadPermissions = 0xFFC0800000C00001;
04168 #endif
04169 }
04170 break;
04171
04172 case FEDM_ISC_TYPE_ISCPRH101:
04173 if(m_ReaderInfo.bIsMode0x40Read)
04174 {
04175 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04176 }
04177 else
04178 {
04179 uiMaxPages = 64;
04180 #ifdef __GNUC__
04181 ui64CfgReadPermissions = 0xFFC0800000008001LL;
04182 #else
04183 ui64CfgReadPermissions = 0xFFC0800000008001;
04184 #endif
04185 }
04186 break;
04187
04188 case FEDM_ISC_TYPE_ISCPRH101_U:
04189 if(m_ReaderInfo.bIsMode0x40Read)
04190 {
04191 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04192 }
04193 else
04194 {
04195 uiMaxPages = 64;
04196 #ifdef __GNUC__
04197 ui64CfgReadPermissions = 0xFFC0800000000001LL;
04198 #else
04199 ui64CfgReadPermissions = 0xFFC0800000000001;
04200 #endif
04201 }
04202 break;
04203
04204 case FEDM_ISC_TYPE_ISCMR101:
04205 case FEDM_ISC_TYPE_ISCMR101_U:
04206 if(m_ReaderInfo.bIsMode0x40Read)
04207 {
04208 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04209 }
04210 else
04211 {
04212 uiMaxPages = 64;
04213 #ifdef __GNUC__
04214 ui64CfgReadPermissions = 0xFFE0800000000001LL;
04215 #else
04216 ui64CfgReadPermissions = 0xFFE0800000000001;
04217 #endif
04218 }
04219 break;
04220
04221 case FEDM_ISC_TYPE_ISCLR200:
04222 if(m_ReaderInfo.bIsMode0x40Read)
04223 {
04224 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04225 }
04226 else
04227 {
04228 uiMaxPages = 16;
04229 #ifdef __GNUC__
04230 ui64CfgReadPermissions = 0xFFFF000000000000LL;
04231 #else
04232 ui64CfgReadPermissions = 0xFFFF000000000000;
04233 #endif
04234 }
04235 break;
04236
04237 case FEDM_ISC_TYPE_ISCMU02:
04238 case FEDM_ISC_TYPE_ISCPRH102:
04239 case FEDM_ISC_TYPE_ISCPRHD102:
04240 case FEDM_ISC_TYPE_ISCMR200:
04241 case FEDM_ISC_TYPE_ISCMRU200:
04242 case FEDM_ISC_TYPE_ISCLRU1000:
04243 case FEDM_ISC_TYPE_ISCLRU2000:
04244 case FEDM_ISC_TYPE_ISCLR2000:
04245 case FEDM_ISC_TYPE_MAX50_XX:
04246 if(m_ReaderInfo.bIsMode0x40Read)
04247 {
04248 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04249 }
04250 else
04251 {
04252 uiMaxPages = 64;
04253 #ifdef __GNUC__
04254 ui64CfgReadPermissions = 0xFFFFFFFFFFFFFFFFLL;
04255 #else
04256 ui64CfgReadPermissions = 0xFFFFFFFFFFFFFFFF;
04257 #endif
04258 }
04259 break;
04260
04261 #ifndef FEDM_NEW_LRU3000_ACC_CFG
04262 case FEDM_ISC_TYPE_ISCLRU3000:
04263 if(bEEPROM)
04264 SetData(FEDM_ISC_TMP_0x8A_READ_MODE, (unsigned char)0x41);
04265 else
04266 SetData(FEDM_ISC_TMP_0x8A_READ_MODE, (unsigned char)0x40);
04267
04268 SetData(FEDM_ISC_TMP_0x8A_READ_DEVICE, (unsigned char)FEDM_CNTRL_TYPE_ACC);
04269 SetData(FEDM_ISC_TMP_0x8A_READ_BANK, (unsigned char)FEDM_MEM_BANK_TYPE_MAIN);
04270 SetData(FEDM_ISC_TMP_0x8A_READ_REQ_CFG_ADR, (unsigned int)0);
04271 SetData(FEDM_ISC_TMP_0x8A_READ_REQ_CFG_N, (unsigned char)0);
04272 FEDM_CHK2(iErr, SendProtocol(0x8A));
04273 if( iErr == 0x13 ||
04274 iErr == 0x19 )
04275 {
04276 FEDM_RETURN(iErr);
04277 }
04278 FEDM_RETURN(FEDM_OK);
04279 #endif
04280
04281 case FEDM_ISC_TYPE_ISCLR2500_A:
04282 #ifdef FEDM_NEW_LRU3000_ACC_CFG
04283 case FEDM_ISC_TYPE_ISCLRU3000:
04284 #endif
04285 if(bEEPROM)
04286 SetData(FEDM_ISC_TMP_0x8A_READ_MODE, (unsigned char)0x41);
04287 else
04288 SetData(FEDM_ISC_TMP_0x8A_READ_MODE, (unsigned char)0x40);
04289
04290 SetData(FEDM_ISC_TMP_0x8A_READ_DEVICE, (unsigned char)FEDM_CNTRL_TYPE_RFC);
04291 SetData(FEDM_ISC_TMP_0x8A_READ_BANK, (unsigned char)FEDM_MEM_BANK_TYPE_MAIN);
04292 SetData(FEDM_ISC_TMP_0x8A_READ_REQ_CFG_ADR, (unsigned int)0);
04293 SetData(FEDM_ISC_TMP_0x8A_READ_REQ_CFG_N, (unsigned char)0);
04294 FEDM_CHK2(iErr, SendProtocol(0x8A));
04295 if( iErr == 0x13 ||
04296 iErr == 0x19 )
04297 {
04298 FEDM_RETURN(iErr);
04299 }
04300 FEDM_RETURN(FEDM_OK);
04301
04302 default:
04303 if(m_ReaderInfo.bIsMode0x40Read)
04304 {
04305 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04306 }
04307 else
04308 {
04309 FEDM_RETURN(FEDM_ERROR_UNKNOWN_READER_TYPE);
04310 }
04311 }
04312
04313
04314
04315 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_READ_CFG, (unsigned char)0));
04316 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_READ_CFG_LOC, bEEPROM));
04317
04318 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_MODE, (unsigned char)0));
04319 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_MODE_LOC, bEEPROM));
04320
04321 if(m_ReaderInfo.bIsMode0x40Read)
04322 {
04323
04324 ucPage = 0;
04325 for(iIdx=0; iIdx<16; iIdx++)
04326 {
04327 iBitNr = 0x80;
04328 for(iBitPos=0; iBitPos<8; iBitPos++)
04329 {
04330 if(m_ReaderInfo.ucCfgReadPermissions[iIdx] & iBitNr)
04331 {
04332 switch(m_uiReaderType)
04333 {
04334 case FEDM_ISC_TYPE_ISCLR2500_A:
04335 case FEDM_ISC_TYPE_ISCLR2500_B:
04336 #ifdef FEDM_NEW_LRU3000_ACC_CFG
04337 case FEDM_ISC_TYPE_ISCLRU3000:
04338 #endif
04339 SetData(FEDM_ISC_TMP_0x8A_READ_DEVICE, (unsigned char)FEDM_CNTRL_TYPE_RFC);
04340 SetData(FEDM_ISC_TMP_0x8A_READ_BANK, (unsigned char)FEDM_MEM_BANK_TYPE_MAIN);
04341 SetData(FEDM_ISC_TMP_0x8A_READ_REQ_CFG_ADR, (unsigned int)ucPage);
04342 SetData(FEDM_ISC_TMP_0x8A_READ_REQ_CFG_N, (unsigned char)1);
04343 FEDM_CHK2(iErr, SendProtocol(0x8A));
04344 if( iErr == 0x13 ||
04345 iErr == 0x19 )
04346 {
04347 FEDM_RETURN(iErr);
04348 }
04349 break;
04350
04351 default:
04352 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_READ_CFG_ADR, ucPage));
04353 FEDM_CHK2(iErr, SendProtocol(0x80));
04354 if( iErr == 0x13 ||
04355 iErr == 0x19 )
04356 {
04357 FEDM_RETURN(iErr);
04358 }
04359 }
04360 }
04361
04362 iBitNr >>= 1;
04363 ucPage++;
04364 }
04365 }
04366 }
04367 else
04368 {
04369
04370 ucPage = 0;
04371 #ifdef __GNUC__
04372 ui64BitNr = 0x8000000000000000LL;
04373 #else
04374 ui64BitNr = 0x8000000000000000;
04375 #endif
04376 for(iBitPos=0; iBitPos<64; iBitPos++)
04377 {
04378 if(ui64CfgReadPermissions & ui64BitNr)
04379 {
04380 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_READ_CFG_ADR, ucPage));
04381 FEDM_CHK2(iErr, SendProtocol(0x80));
04382 if( iErr == 0x13 ||
04383 iErr == 0x19 )
04384 {
04385 FEDM_RETURN(iErr);
04386 }
04387 }
04388
04389 ui64BitNr >>= 1;
04390 ucPage++;
04391 }
04392 }
04393
04394 FEDM_RETURN(FEDM_OK);
04395 }
04396
04397
04398
04399
04400
04401
04402
04403
04404
04405
04406
04407
04408
04409
04410
04411
04412
04413
04414
04415
04416
04417
04418
04419
04420
04421
04422
04423
04424
04425
04426
04427
04428
04429 int FEDM_ISCReaderModule::WriteCompleteConfiguration(bool bEEPROM)
04430 {
04431 if(bEEPROM)
04432 {
04433 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_HIGH_LEVEL, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "EEPROM");
04434 }
04435 else
04436 {
04437 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_HIGH_LEVEL, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "RAM");
04438 }
04439
04440 int iErr = 0;
04441 int iBitNr = 0;
04442 int iBitPos = 0;
04443 int iIdx = 0;
04444 int iTmpMemAdr = 0;
04445 unsigned char ucPage = 0;
04446 unsigned int uiMaxPages = 0;
04447 unsigned __int64 ui64CfgWritePermissions = 0;
04448 unsigned __int64 ui64BitNr = 0;
04449
04450 if(! IsConnected())
04451 {
04452 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
04453 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
04454 }
04455
04456
04457 switch(m_uiReaderType)
04458 {
04459 case FEDM_ISC_TYPE_ISCM02:
04460 case FEDM_ISC_TYPE_ISCM02_M8:
04461 case FEDM_ISC_TYPE_ISCPRH100:
04462 case FEDM_ISC_TYPE_ISCPRH100_U:
04463 case FEDM_ISC_TYPE_ISCMR100:
04464 case FEDM_ISC_TYPE_ISCMR100_U:
04465 case FEDM_ISC_TYPE_CPRM02:
04466 case FEDM_ISC_TYPE_CPR02:
04467 case FEDM_ISC_TYPE_CPR04_U:
04468 case FEDM_ISC_TYPE_CPR40_XX_U:
04469 case FEDM_ISC_TYPE_CPR40_XX:
04470 case FEDM_ISC_TYPE_CPR44_XX:
04471 if(m_ReaderInfo.bIsMode0x41Read)
04472 {
04473 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04474 }
04475 else
04476 {
04477 uiMaxPages = 8;
04478 #ifdef __GNUC__
04479 ui64CfgWritePermissions = 0xFF00000000000000LL;
04480 #else
04481 ui64CfgWritePermissions = 0xFF00000000000000;
04482 #endif
04483 }
04484 break;
04485
04486 case FEDM_ISC_TYPE_CPR50_XX:
04487 if(m_ReaderInfo.bIsMode0x41Read)
04488 {
04489 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04490 }
04491 else
04492 {
04493 uiMaxPages = 64;
04494 #ifdef __GNUC__
04495 ui64CfgWritePermissions = 0xFFC0800000C00001LL;
04496 #else
04497 ui64CfgWritePermissions = 0xFFC0800000C00001;
04498 #endif
04499 }
04500 break;
04501
04502 case FEDM_ISC_TYPE_ISCPRH101:
04503 if(m_ReaderInfo.bIsMode0x41Read)
04504 {
04505 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04506 }
04507 else
04508 {
04509 uiMaxPages = 64;
04510 #ifdef __GNUC__
04511 ui64CfgWritePermissions = 0xFFC0800000008001LL;
04512 #else
04513 ui64CfgWritePermissions = 0xFFC0800000008001;
04514 #endif
04515 }
04516 break;
04517
04518 case FEDM_ISC_TYPE_ISCPRH101_U:
04519 if(m_ReaderInfo.bIsMode0x41Read)
04520 {
04521 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04522 }
04523 else
04524 {
04525 uiMaxPages = 64;
04526 #ifdef __GNUC__
04527 ui64CfgWritePermissions = 0xFFC0800000000001LL;
04528 #else
04529 ui64CfgWritePermissions = 0xFFC0800000000001;
04530 #endif
04531 }
04532 break;
04533
04534 case FEDM_ISC_TYPE_ISCMR101:
04535 case FEDM_ISC_TYPE_ISCMR101_U:
04536 if(m_ReaderInfo.bIsMode0x41Read)
04537 {
04538 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04539 }
04540 else
04541 {
04542 uiMaxPages = 64;
04543 #ifdef __GNUC__
04544 ui64CfgWritePermissions = 0xFFE0800000000001LL;
04545 #else
04546 ui64CfgWritePermissions = 0xFFE0800000000001;
04547 #endif
04548 }
04549 break;
04550
04551 case FEDM_ISC_TYPE_ISCLR200:
04552 if(m_ReaderInfo.bIsMode0x41Read)
04553 {
04554 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04555 }
04556 else
04557 {
04558 uiMaxPages = 16;
04559 #ifdef __GNUC__
04560 ui64CfgWritePermissions = 0xFFFF000000000000LL;
04561 #else
04562 ui64CfgWritePermissions = 0xFFFF000000000000;
04563 #endif
04564 }
04565 break;
04566
04567 case FEDM_ISC_TYPE_ISCMU02:
04568 case FEDM_ISC_TYPE_ISCPRHD102:
04569 case FEDM_ISC_TYPE_ISCPRH102:
04570 case FEDM_ISC_TYPE_ISCMR200:
04571 case FEDM_ISC_TYPE_ISCMRU200:
04572 case FEDM_ISC_TYPE_ISCLRU1000:
04573 case FEDM_ISC_TYPE_ISCLRU2000:
04574 case FEDM_ISC_TYPE_ISCLR2000:
04575 case FEDM_ISC_TYPE_MAX50_XX:
04576 if(m_ReaderInfo.bIsMode0x41Read)
04577 {
04578 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04579 }
04580 else
04581 {
04582 uiMaxPages = 64;
04583 #ifdef __GNUC__
04584 ui64CfgWritePermissions = 0xFFFFFFFFFFFFFFFFLL;
04585 #else
04586 ui64CfgWritePermissions = 0xFFFFFFFFFFFFFFFF;
04587 #endif
04588 }
04589 break;
04590
04591 #ifndef FEDM_NEW_LRU3000_ACC_CFG
04592 case FEDM_ISC_TYPE_ISCLRU3000:
04593 if(bEEPROM)
04594 SetData(FEDM_ISC_TMP_0x8B_WRITE_MODE, (unsigned char)0x01);
04595 else
04596 SetData(FEDM_ISC_TMP_0x8B_WRITE_MODE, (unsigned char)0x00);
04597
04598 SetData(FEDM_ISC_TMP_0x8B_WRITE_DEVICE, (unsigned char)FEDM_CNTRL_TYPE_ACC);
04599 SetData(FEDM_ISC_TMP_0x8B_WRITE_BANK, (unsigned char)FEDM_MEM_BANK_TYPE_MAIN);
04600 SetData(FEDM_ISC_TMP_0x8B_WRITE_CFG_SIZE, (unsigned char)30);
04601 iTmpMemAdr = FEDM_GetAdrOfID(FEDM_ISC_TMP_0x8B_WRITE_CFG_ADR, 32);
04602
04603 uiMaxPages = 0;
04604
04605 if(m_ReaderInfo.bIsMode0x41Read)
04606 {
04607
04608 ucPage = 0;
04609 for(iIdx=0; iIdx<16; iIdx++)
04610 {
04611 iBitNr = 0x80;
04612 for(iBitPos=0; iBitPos<8; iBitPos++)
04613 {
04614 if(m_ReaderInfo.ucCfgWritePermissions[iIdx] & iBitNr)
04615 {
04616 m_TmpData[iTmpMemAdr] = 0x00;
04617 m_TmpData[iTmpMemAdr+1] = ucPage;
04618 iTmpMemAdr += 2;
04619
04620 uiMaxPages++;
04621 }
04622
04623 iBitNr >>= 1;
04624 ucPage++;
04625 }
04626 }
04627 }
04628 else
04629 {
04630
04631 for(ucPage=0; ucPage<=85; ucPage++)
04632 {
04633 m_TmpData[iTmpMemAdr] = 0x00;
04634 m_TmpData[iTmpMemAdr+1] = ucPage;
04635 iTmpMemAdr += 2;
04636
04637 uiMaxPages++;
04638 }
04639 }
04640
04641 SetData(FEDM_ISC_TMP_0x8B_WRITE_CFG_N, (unsigned char)ucMaxPages);
04642 FEDM_CHK2(iErr, SendProtocol(0x8B));
04643 if( iErr == 0x13 ||
04644 iErr == 0x19 )
04645 {
04646 FEDM_RETURN(iErr);
04647 }
04648 FEDM_RETURN(FEDM_OK);
04649 break;
04650 #endif
04651
04652 case FEDM_ISC_TYPE_ISCLR2500_A:
04653 #ifdef FEDM_NEW_LRU3000_ACC_CFG
04654 case FEDM_ISC_TYPE_ISCLRU3000:
04655 #endif
04656 if(bEEPROM)
04657 SetData(FEDM_ISC_TMP_0x8B_WRITE_MODE, (unsigned char)0x01);
04658 else
04659 SetData(FEDM_ISC_TMP_0x8B_WRITE_MODE, (unsigned char)0x00);
04660
04661 SetData(FEDM_ISC_TMP_0x8B_WRITE_DEVICE, (unsigned char)FEDM_CNTRL_TYPE_RFC);
04662 SetData(FEDM_ISC_TMP_0x8B_WRITE_BANK, (unsigned char)FEDM_MEM_BANK_TYPE_MAIN);
04663 SetData(FEDM_ISC_TMP_0x8B_WRITE_CFG_SIZE, (unsigned char)30);
04664 iTmpMemAdr = FEDM_GetAdrOfID(FEDM_ISC_TMP_0x8B_WRITE_CFG_ADR, 32);
04665
04666 uiMaxPages = 0;
04667
04668 if(m_ReaderInfo.bIsMode0x41Read)
04669 {
04670
04671 ucPage = 0;
04672 for(iIdx=0; iIdx<16; iIdx++)
04673 {
04674 iBitNr = 0x80;
04675 for(iBitPos=0; iBitPos<8; iBitPos++)
04676 {
04677 if(m_ReaderInfo.ucCfgWritePermissions[iIdx] & iBitNr)
04678 {
04679 m_TmpData[iTmpMemAdr] = 0x00;
04680 m_TmpData[iTmpMemAdr+1] = ucPage;
04681 iTmpMemAdr += 2;
04682
04683 uiMaxPages++;
04684 }
04685
04686 iBitNr >>= 1;
04687 ucPage++;
04688 }
04689 }
04690 }
04691 else
04692 {
04693
04694 for(ucPage=0; ucPage<=85; ucPage++)
04695 {
04696 m_TmpData[iTmpMemAdr] = 0x00;
04697 m_TmpData[iTmpMemAdr+1] = ucPage;
04698 iTmpMemAdr += 2;
04699
04700 uiMaxPages++;
04701 }
04702 }
04703
04704 SetData(FEDM_ISC_TMP_0x8B_WRITE_CFG_N, (unsigned char)uiMaxPages);
04705 FEDM_CHK2(iErr, SendProtocol(0x8B));
04706 if( iErr == 0x13 ||
04707 iErr == 0x19 )
04708 {
04709 FEDM_RETURN(iErr);
04710 }
04711 FEDM_RETURN(FEDM_OK);
04712 break;
04713
04714 default:
04715 if(m_ReaderInfo.bIsMode0x41Read)
04716 {
04717 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04718 }
04719 else
04720 {
04721 FEDM_RETURN(FEDM_ERROR_UNKNOWN_READER_TYPE);
04722 }
04723 }
04724
04725
04726
04727 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_WRITE_CFG, (unsigned char)0));
04728 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_WRITE_CFG_LOC, bEEPROM));
04729
04730 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_MODE, (unsigned char)0));
04731 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_MODE_LOC, bEEPROM));
04732
04733 if(m_ReaderInfo.bIsMode0x41Read)
04734 {
04735
04736 ucPage = 0;
04737 for(iIdx=0; iIdx<16; iIdx++)
04738 {
04739 iBitNr = 0x80;
04740 for(iBitPos=0; iBitPos<8; iBitPos++)
04741 {
04742 if(m_ReaderInfo.ucCfgWritePermissions[iIdx] & iBitNr)
04743 {
04744 switch(m_uiReaderType)
04745 {
04746 case FEDM_ISC_TYPE_ISCLR2500_A:
04747 case FEDM_ISC_TYPE_ISCLR2500_B:
04748 #ifdef FEDM_NEW_LRU3000_ACC_CFG
04749 case FEDM_ISC_TYPE_ISCLRU3000:
04750 #endif
04751 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_DEVICE, (unsigned char)FEDM_CNTRL_TYPE_RFC));
04752 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_BANK, (unsigned char)FEDM_MEM_BANK_TYPE_MAIN));
04753 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_CFG_SIZE, (unsigned char)(m_iRFC_DataBlockSize-2)));
04754 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_CFG_ADR, (unsigned int)ucPage));
04755 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_CFG_N, (unsigned char)0x01));
04756 FEDM_CHK2(iErr, SendProtocol(0x8B));
04757 if( iErr == 0x13 ||
04758 iErr == 0x19 )
04759 {
04760 FEDM_RETURN(iErr);
04761 }
04762 break;
04763
04764 default:
04765 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_WRITE_CFG_ADR, ucPage));
04766 FEDM_CHK2(iErr, SendProtocol(0x81));
04767 if( iErr == 0x13 ||
04768 iErr == 0x19 )
04769 {
04770 FEDM_RETURN(iErr);
04771 }
04772 }
04773 }
04774
04775 iBitNr >>= 1;
04776 ucPage++;
04777 }
04778 }
04779 }
04780 else
04781 {
04782
04783 ucPage = 0;
04784 #ifdef __GNUC__
04785 ui64BitNr = 0x8000000000000000LL;
04786 #else
04787 ui64BitNr = 0x8000000000000000;
04788 #endif
04789 for(iBitPos=0; iBitPos<64; iBitPos++)
04790 {
04791 if(ui64CfgWritePermissions & ui64BitNr)
04792 {
04793 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_WRITE_CFG_ADR, ucPage));
04794 FEDM_CHK2(iErr, SendProtocol(0x81));
04795 if( iErr == 0x13 ||
04796 iErr == 0x19 )
04797 {
04798 FEDM_RETURN(iErr);
04799 }
04800 }
04801
04802 ui64BitNr >>= 1;
04803 ucPage++;
04804 }
04805 }
04806
04807 FEDM_RETURN(FEDM_OK);
04808 }
04809
04810
04811
04812
04813
04814
04815
04816
04817
04818
04819
04820
04821
04822
04823
04824
04825
04826
04827
04828
04829
04830
04831
04832
04833
04834
04835
04836
04837
04838
04839
04840
04841
04842
04843
04844
04845
04846
04847
04848
04849
04850
04851
04852
04853 int FEDM_ISCReaderModule::ApplyConfiguration(bool bEEPROM)
04854 {
04855 if(bEEPROM)
04856 {
04857 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_HIGH_LEVEL, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "EEPROM");
04858 }
04859 else
04860 {
04861 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_HIGH_LEVEL, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "RAM");
04862 }
04863
04864 bool bModified = false;
04865 bool bIsMode0x41Read = false;
04866 int iErr = 0;
04867 int iBitNr = 0;
04868 int iBitPos = 0;
04869 int iIdx = 0;
04870 int iReturnStatus = FEDM_OK;
04871 unsigned int uiPage = 0;
04872 unsigned int uiMaxPages = 0;
04873 unsigned char ucData[32];
04874 unsigned char ucCfgWritePermissions[16];
04875
04876 if(! IsConnected())
04877 {
04878 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
04879 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
04880 }
04881
04882
04883 memset(m_ucModifiedCfgPages, 0, 16);
04884 memset(ucCfgWritePermissions, 0, 16);
04885
04886
04887 if(m_ReaderInfo.bIsMode0x41Read)
04888 {
04889 uiMaxPages = m_ReaderInfo.GetNoOfCfgPages();
04890 memcpy(ucCfgWritePermissions, m_ReaderInfo.ucCfgWritePermissions, 16);
04891 bIsMode0x41Read = true;
04892 }
04893 else
04894 {
04895 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x41));
04896 FEDM_CHK2(iErr, SendProtocol(0x66));
04897 if( iErr == 0x19 )
04898 {
04899 FEDM_RETURN(iErr);
04900 }
04901 else if(iErr == 0)
04902 {
04903 FEDM_CHK2(iErr, GetData(FEDM_GetAdrOfID(FEDM_ISC_TMP_READER_INFO, 32), &ucData[0], 31, FEDM_TMPDATA_MEM));
04904 uiMaxPages = ((unsigned int)ucData[0]<<8) + (unsigned int)ucData[1];
04905 memcpy(ucCfgWritePermissions, &ucData[2], 16);
04906 bIsMode0x41Read = true;
04907 }
04908 }
04909
04910
04911
04912 if(uiMaxPages == 0)
04913 {
04914 switch(m_uiReaderType)
04915 {
04916 case FEDM_ISC_TYPE_ISCM02:
04917 case FEDM_ISC_TYPE_ISCM02_M8:
04918 case FEDM_ISC_TYPE_ISCPRH100:
04919 case FEDM_ISC_TYPE_ISCPRH100_U:
04920 case FEDM_ISC_TYPE_ISCMR100:
04921 case FEDM_ISC_TYPE_ISCMR100_U:
04922 case FEDM_ISC_TYPE_CPRM02:
04923 case FEDM_ISC_TYPE_CPR02:
04924 case FEDM_ISC_TYPE_CPR04_U:
04925 uiMaxPages = 8;
04926 break;
04927 case FEDM_ISC_TYPE_CPR20_XX:
04928 case FEDM_ISC_TYPE_CPR40_XX_U:
04929 case FEDM_ISC_TYPE_CPR40_XX:
04930 case FEDM_ISC_TYPE_CPR44_XX:
04931 uiMaxPages = 16;
04932 break;
04933 case FEDM_ISC_TYPE_ISCLR200:
04934 uiMaxPages = 16;
04935 break;
04936 case FEDM_ISC_TYPE_ISCPRH101:
04937 case FEDM_ISC_TYPE_ISCPRH101_U:
04938 case FEDM_ISC_TYPE_ISCMR101:
04939 case FEDM_ISC_TYPE_ISCMR101_U:
04940 case FEDM_ISC_TYPE_CPR50_XX:
04941 case FEDM_ISC_TYPE_ISCMU02:
04942 case FEDM_ISC_TYPE_ISCMR102:
04943 case FEDM_ISC_TYPE_ISCPRHD102:
04944 case FEDM_ISC_TYPE_ISCPRH102:
04945 case FEDM_ISC_TYPE_ISCMR200:
04946 case FEDM_ISC_TYPE_ISCMRU200:
04947 case FEDM_ISC_TYPE_ISCLRU1000:
04948 case FEDM_ISC_TYPE_ISCLRU2000:
04949 case FEDM_ISC_TYPE_ISCLR2000:
04950 uiMaxPages = 64;
04951 break;
04952 default:
04953 uiMaxPages = 64;
04954 break;
04955 }
04956 }
04957
04958 switch(m_uiReaderType)
04959 {
04960
04961 case FEDM_ISC_TYPE_CPRM02:
04962 case FEDM_ISC_TYPE_CPR02:
04963 case FEDM_ISC_TYPE_CPR04_U:
04964 case FEDM_ISC_TYPE_CPR20_XX:
04965 case FEDM_ISC_TYPE_CPR40_XX_U:
04966 case FEDM_ISC_TYPE_CPR40_XX:
04967 case FEDM_ISC_TYPE_CPR44_XX:
04968 case FEDM_ISC_TYPE_CPR46_XX:
04969 case FEDM_ISC_TYPE_CPR50_XX:
04970
04971
04972 case FEDM_ISC_TYPE_MAX50_XX:
04973
04974
04975 case FEDM_ISC_TYPE_ISCM02:
04976 case FEDM_ISC_TYPE_ISCM02_M8:
04977
04978
04979 case FEDM_ISC_TYPE_ISCPRH100:
04980 case FEDM_ISC_TYPE_ISCPRH100_U:
04981 case FEDM_ISC_TYPE_ISCMR100:
04982 case FEDM_ISC_TYPE_ISCMR100_U:
04983 case FEDM_ISC_TYPE_ISCPRH101:
04984 case FEDM_ISC_TYPE_ISCPRH101_U:
04985 case FEDM_ISC_TYPE_ISCMR101:
04986 case FEDM_ISC_TYPE_ISCMR101_U:
04987 case FEDM_ISC_TYPE_ISCPRH102:
04988 case FEDM_ISC_TYPE_ISCMR200:
04989 case FEDM_ISC_TYPE_ISCMR10X:
04990
04991
04992 case FEDM_ISC_TYPE_ISCLR200:
04993 case FEDM_ISC_TYPE_ISCLR2000:
04994
04995
04996 case FEDM_ISC_TYPE_ISCMU02:
04997
04998
04999 case FEDM_ISC_TYPE_ISCMRU200:
05000
05001
05002 case FEDM_ISC_TYPE_ISCLRU1000:
05003 case FEDM_ISC_TYPE_ISCLRU2000:
05004
05005
05006 case FEDM_ISC_TYPE_ISCPRHD102:
05007 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_WRITE_CFG, (unsigned char)0));
05008 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_WRITE_CFG_LOC, bEEPROM));
05009 if(bIsMode0x41Read)
05010 {
05011
05012 uiPage = 0;
05013 for(iIdx=0; iIdx<16; iIdx++)
05014 {
05015 iBitNr = 0x80;
05016 for(iBitPos=0; iBitPos<8; iBitPos++)
05017 {
05018 if(ucCfgWritePermissions[iIdx] & iBitNr)
05019 {
05020 if(uiPage*16 + 15 >= FEDM_ISC_MAX_RFC_EEDATA_MEM)
05021 continue;
05022
05023 if( ( bEEPROM && (m_RFC_EEData[uiPage*16+15] & 0x02)) ||
05024 ((!bEEPROM) && (m_RFC_RAMData[uiPage*16+15] & 0x02)) )
05025 {
05026 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_WRITE_CFG_ADR, uiPage));
05027 FEDM_CHK2(iErr, SendProtocol(0x81));
05028 if(iErr == 0x11)
05029 {
05030 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_READ_CFG_LOC, bEEPROM));
05031 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_READ_CFG_ADR, uiPage));
05032 FEDM_CHK2(iErr, SendProtocol(0x80));
05033 iReturnStatus = 0x11;
05034 }
05035 else if(iErr == 0x13 ||
05036 iErr == 0x19 )
05037 {
05038 FEDM_RETURN(iErr);
05039 }
05040 else
05041 {
05042 bModified = true;
05043 }
05044
05045
05046 m_ucModifiedCfgPages[iIdx] |= iBitNr;
05047 }
05048 }
05049
05050 iBitNr >>= 1;
05051 uiPage++;
05052 }
05053 }
05054 }
05055 else
05056 {
05057 for(uiPage=0; uiPage<uiMaxPages; ++uiPage)
05058 {
05059 if(uiPage*16 + 15 >= FEDM_ISC_MAX_RFC_EEDATA_MEM)
05060 continue;
05061
05062 if( ( bEEPROM && (m_RFC_EEData[uiPage*16+15] & 0x02)) ||
05063 ((!bEEPROM) && (m_RFC_RAMData[uiPage*16+15] & 0x02)) )
05064 {
05065 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_WRITE_CFG_ADR, uiPage));
05066 FEDM_CHK2(iErr, SendProtocol(0x81));
05067 if(iErr == 0x11)
05068 {
05069 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_READ_CFG_LOC, bEEPROM));
05070 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_READ_CFG_ADR, uiPage));
05071 FEDM_CHK2(iErr, SendProtocol(0x80));
05072 iReturnStatus = 0x11;
05073 }
05074 else if(iErr == 0x13 ||
05075 iErr == 0x19 )
05076 {
05077 FEDM_RETURN(iErr);
05078 }
05079 else
05080 {
05081 bModified = true;
05082 }
05083
05084
05085 iIdx = uiPage/8;
05086 iBitPos = uiPage % 8;
05087 iBitNr = 0x80;
05088 iBitNr >>= iBitPos;
05089 m_ucModifiedCfgPages[iIdx] |= iBitNr;
05090 }
05091 }
05092 }
05093 break;
05094
05095 case FEDM_ISC_TYPE_ISCLR2500_A:
05096 case FEDM_ISC_TYPE_ISCLR2500_B:
05097 #ifdef FEDM_NEW_LRU3000_ACC_CFG
05098 case FEDM_ISC_TYPE_ISCLRU3000:
05099 #endif
05100 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_DEVICE, (unsigned char)FEDM_CNTRL_TYPE_RFC));
05101 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_BANK, (unsigned char)FEDM_MEM_BANK_TYPE_MAIN));
05102 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_MODE, (unsigned char)0));
05103 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_MODE_LOC, bEEPROM));
05104 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_CFG_N, (unsigned char)1));
05105 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_CFG_SIZE, (unsigned char)(m_iRFC_DataBlockSize-2)));
05106
05107 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_DEVICE, (unsigned char)FEDM_CNTRL_TYPE_RFC));
05108 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_BANK, (unsigned char)FEDM_MEM_BANK_TYPE_MAIN));
05109 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_MODE, (unsigned char)0));
05110 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_MODE_LOC, bEEPROM));
05111 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_REQ_CFG_N, (unsigned char)1));
05112
05113 if(bIsMode0x41Read)
05114 {
05115
05116 uiPage = 0;
05117 for(iIdx=0; iIdx<16; iIdx++)
05118 {
05119 iBitNr = 0x80;
05120 for(iBitPos=0; iBitPos<8; iBitPos++)
05121 {
05122 if(ucCfgWritePermissions[iIdx] & iBitNr)
05123 {
05124 if( ( bEEPROM && (m_RFC_EEData[uiPage*m_iRFC_DataBlockSize+m_iRFC_DataBlockSize-1] & 0x02)) ||
05125 ((!bEEPROM) && (m_RFC_RAMData[uiPage*m_iRFC_DataBlockSize+m_iRFC_DataBlockSize-1] & 0x02)) )
05126 {
05127 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_0x8B_WRITE_CFG_ADR, uiPage));
05128 FEDM_CHK2(iErr, SendProtocol(0x8B));
05129 if(iErr == 0x11)
05130 {
05131 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_0x8A_READ_REQ_CFG_ADR, uiPage));
05132 FEDM_CHK2(iErr, SendProtocol(0x8A));
05133 iReturnStatus = 0x11;
05134 }
05135 else if(iErr == 0x13 ||
05136 iErr == 0x19 )
05137 {
05138 FEDM_RETURN(iErr);
05139 }
05140 else
05141 {
05142 bModified = true;
05143 }
05144
05145
05146 m_ucModifiedCfgPages[iIdx] |= iBitNr;
05147 }
05148 }
05149
05150 iBitNr >>= 1;
05151 uiPage++;
05152 }
05153 }
05154 }
05155 else
05156 {
05157 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
05158 }
05159
05160 break;
05161
05162 #ifndef FEDM_NEW_LRU3000_ACC_CFG
05163 case FEDM_ISC_TYPE_ISCLRU3000:
05164 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_DEVICE, (unsigned char)FEDM_CNTRL_TYPE_ACC));
05165 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_BANK, (unsigned char)FEDM_MEM_BANK_TYPE_MAIN));
05166 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_MODE, (unsigned char)0));
05167 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_MODE_LOC, bEEPROM));
05168 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_CFG_N, (unsigned char)1));
05169 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_CFG_SIZE, (unsigned char)30));
05170
05171 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_DEVICE, (unsigned char)FEDM_CNTRL_TYPE_ACC));
05172 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_BANK, (unsigned char)FEDM_MEM_BANK_TYPE_MAIN));
05173 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_MODE, (unsigned char)0));
05174 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_MODE_LOC, bEEPROM));
05175 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_REQ_CFG_N, (unsigned char)1));
05176
05177 if(bIsMode0x41Read)
05178 {
05179
05180 uiPage = 0;
05181 for(iIdx=0; iIdx<16; iIdx++)
05182 {
05183 iBitNr = 0x80;
05184 for(iBitPos=0; iBitPos<8; iBitPos++)
05185 {
05186 if(ucCfgWritePermissions[iIdx] & iBitNr)
05187 {
05188 if( ( bEEPROM && (uiPage < 64 && (m_RFC_EEData[uiPage*16+15] & 0x02))) ||
05189 ( bEEPROM && (uiPage > 63 && (m_ACC_EEData[uiPage*32+31] & 0x02))) ||
05190 ((!bEEPROM) && (uiPage < 64 && (m_RFC_RAMData[uiPage*16+15] & 0x02))) ||
05191 ((!bEEPROM) && (uiPage > 63 && (m_ACC_RAMData[uiPage*32+31] & 0x02))) )
05192 {
05193 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_0x8B_WRITE_CFG_ADR, uiPage));
05194 FEDM_CHK2(iErr, SendProtocol(0x8B));
05195 if(iErr == 0x11)
05196 {
05197 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_0x8A_READ_REQ_CFG_ADR, uiPage));
05198 FEDM_CHK2(iErr, SendProtocol(0x8A));
05199 iReturnStatus = 0x11;
05200 }
05201 else if(iErr == 0x13 ||
05202 iErr == 0x19 )
05203 {
05204 FEDM_RETURN(iErr);
05205 }
05206 else
05207 {
05208 bModified = true;
05209 }
05210
05211
05212 m_ucModifiedCfgPages[iIdx] |= iBitNr;
05213 }
05214 }
05215
05216 iBitNr >>= 1;
05217 uiPage++;
05218 }
05219 }
05220 }
05221 else
05222 {
05223 for(uiPage=0; uiPage<63; ++uiPage)
05224 {
05225 if( ( bEEPROM && (m_RFC_EEData[uiPage*16+15] & 0x02)) ||
05226 ((!bEEPROM) && (m_RFC_RAMData[uiPage*16+15] & 0x02)) )
05227 {
05228 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_CFG_ADR, uiPage));
05229 FEDM_CHK2(iErr, SendProtocol(0x8B));
05230 if(iErr == 0x11)
05231 {
05232 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_0x8A_READ_REQ_CFG_ADR, uiPage));
05233 FEDM_CHK2(iErr, SendProtocol(0x8A));
05234 iReturnStatus = 0x11;
05235 }
05236 else if(iErr == 0x13 ||
05237 iErr == 0x19 )
05238 {
05239 FEDM_RETURN(iErr);
05240 }
05241 else
05242 {
05243 bModified = true;
05244 }
05245
05246
05247 iIdx = uiPage/8;
05248 iBitPos = uiPage % 8;
05249 iBitNr = 0x80;
05250 iBitNr >>= iBitPos;
05251 m_ucModifiedCfgPages[iIdx] |= iBitNr;
05252 }
05253 }
05254
05255 for(uiPage=64; uiPage<84; ++uiPage)
05256 {
05257 if( ( bEEPROM && (m_ACC_EEData[uiPage*32+31] & 0x02)) ||
05258 ((!bEEPROM) && (m_ACC_RAMData[uiPage*32+31] & 0x02)) )
05259 {
05260 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8B_WRITE_CFG_ADR, uiPage));
05261 FEDM_CHK2(iErr, SendProtocol(0x8B));
05262 if(iErr == 0x11)
05263 {
05264 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_0x8A_READ_REQ_CFG_ADR, uiPage));
05265 FEDM_CHK2(iErr, SendProtocol(0x8A));
05266 iReturnStatus = 0x11;
05267 }
05268 else if(iErr == 0x13 ||
05269 iErr == 0x19 )
05270 {
05271 FEDM_RETURN(iErr);
05272 }
05273 else
05274 {
05275 bModified = true;
05276 }
05277
05278
05279 iIdx = uiPage/8;
05280 iBitPos = uiPage % 8;
05281 iBitNr = 0x80;
05282 iBitNr >>= iBitPos;
05283 m_ucModifiedCfgPages[iIdx] |= iBitNr;
05284 }
05285 }
05286 }
05287 break;
05288 #endif
05289 default:
05290 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_WRITE_CFG, (unsigned char)0));
05291 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_WRITE_CFG_LOC, bEEPROM));
05292 if(bIsMode0x41Read)
05293 {
05294
05295 uiPage = 0;
05296 for(iIdx=0; iIdx<16; iIdx++)
05297 {
05298 iBitNr = 0x80;
05299 for(iBitPos=0; iBitPos<8; iBitPos++)
05300 {
05301 if(ucCfgWritePermissions[iIdx] & iBitNr)
05302 {
05303 if(uiPage*16 + 15 >= FEDM_ISC_MAX_RFC_EEDATA_MEM)
05304 continue;
05305
05306 if( ( bEEPROM && (m_RFC_EEData[uiPage*16+15] & 0x02)) ||
05307 ((!bEEPROM) && (m_RFC_RAMData[uiPage*16+15] & 0x02)) )
05308 {
05309 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_WRITE_CFG_ADR, uiPage));
05310 FEDM_CHK2(iErr, SendProtocol(0x81));
05311 if(iErr == 0x11)
05312 {
05313 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_READ_CFG_ADR, uiPage));
05314 FEDM_CHK2(iErr, SendProtocol(0x80));
05315 iReturnStatus = 0x11;
05316 }
05317 else if(iErr == 0x13 ||
05318 iErr == 0x19 )
05319 {
05320 FEDM_RETURN(iErr);
05321 }
05322 else
05323 {
05324 bModified = true;
05325 }
05326
05327
05328 m_ucModifiedCfgPages[iIdx] |= iBitNr;
05329 }
05330 }
05331
05332 iBitNr >>= 1;
05333 uiPage++;
05334 }
05335 }
05336 }
05337 else
05338 {
05339 FEDM_RETURN(FEDM_ERROR_UNKNOWN_READER_TYPE);
05340 }
05341 }
05342
05343 if(bModified)
05344 {
05345 if(iReturnStatus == FEDM_OK)
05346 {
05347 FEDM_RETURN(FEDM_MODIFIED);
05348 }
05349 else
05350 {
05351 FEDM_RETURN(iReturnStatus);
05352 }
05353 }
05354 else
05355 {
05356 FEDM_RETURN(iReturnStatus);
05357 }
05358 }
05359
05360
05361 unsigned char* FEDM_ISCReaderModule::GetModifiedCfgPageFlags()
05362 {
05363 return m_ucModifiedCfgPages;
05364 }
05365
05366
05367
05368
05369
05370
05371
05372
05373
05374
05375
05376
05377
05378
05379
05380
05381
05382
05383
05384
05385
05386
05387
05388
05389
05390 int FEDM_ISCReaderModule::ResetCompleteConfiguration(bool bEEPROM)
05391 {
05392 if(bEEPROM)
05393 {
05394 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_HIGH_LEVEL, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "EEPROM");
05395 }
05396 else
05397 {
05398 FEDM_TRACE_FNC(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_HIGH_LEVEL, __FUNCTION__, FELOGMNG_DBG_FUNCTION_PARAMETER, "RAM");
05399 }
05400
05401 int iErr = 0;
05402 int iBack = 0;
05403 __int64 t1, t2;
05404 bool bDetect = false;
05405 unsigned char ucOldBusAdr = 0;
05406 unsigned char ucOldBaudrate = 0;
05407 unsigned char ucOldParity = 0;
05408 unsigned char ucNewBusAdr = 0;
05409 unsigned char ucNewBaudrate = 0;
05410 unsigned char ucNewParity = 0;
05411
05412 if(! IsConnected())
05413 {
05414 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
05415 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
05416 }
05417
05418 GetConfigPara(CoreImpl::ReaderConfig::HostInterface::Serial::BusAddress, &ucOldBusAdr);
05419 GetConfigPara(CoreImpl::ReaderConfig::HostInterface::Serial::Baudrate, &ucOldBaudrate);
05420 GetConfigPara(CoreImpl::ReaderConfig::HostInterface::Serial::Parity, &ucOldParity);
05421
05422 switch(m_uiReaderType)
05423 {
05424 case FEDM_ISC_TYPE_ISCLR2500_A:
05425 case FEDM_ISC_TYPE_ISCLR2500_B:
05426 #ifdef FEDM_NEW_LRU3000_ACC_CFG
05427 case FEDM_ISC_TYPE_ISCLRU3000:
05428 #endif
05429 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8C_RESET_DEVICE, (unsigned char)FEDM_CNTRL_TYPE_RFC));
05430 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8C_RESET_BANK, (unsigned char)FEDM_MEM_BANK_TYPE_MAIN));
05431 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8C_RESET_MODE, (unsigned char)0x00));
05432 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8C_RESET_MODE_LOC, bEEPROM));
05433 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8C_RESET_MODE_ALL, true));
05434 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8C_RESET_CFG_N, (unsigned char)0));
05435 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8C_RESET_CFG_ADR, (unsigned char)0));
05436 FEDM_CHK2(iErr, SendProtocol(0x8C));
05437 if( iErr == 0x13 ||
05438 iErr == 0x19 )
05439 {
05440 FEDM_RETURN(iErr);
05441 }
05442 break;
05443
05444 #ifndef FEDM_NEW_LRU3000_ACC_CFG
05445 case FEDM_ISC_TYPE_ISCLRU3000:
05446 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8C_RESET_DEVICE, (unsigned char)FEDM_CNTRL_TYPE_ACC));
05447 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8C_RESET_BANK, (unsigned char)FEDM_MEM_BANK_TYPE_MAIN));
05448 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8C_RESET_MODE, (unsigned char)0x00));
05449 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8C_RESET_MODE_LOC, bEEPROM));
05450 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8C_RESET_MODE_ALL, true));
05451 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8C_RESET_CFG_N, (unsigned char)0));
05452 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8C_RESET_CFG_ADR, (unsigned char)0));
05453 FEDM_CHK2(iErr, SendProtocol(0x8C));
05454 if( iErr == 0x13 ||
05455 iErr == 0x19 )
05456 {
05457 FEDM_RETURN(iErr);
05458 }
05459 break;
05460 #endif
05461 default:
05462 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_RESET_CFG, (unsigned char)0));
05463 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_RESET_CFG_LOC, bEEPROM));
05464 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_RESET_CFG_MODE, true));
05465 FEDM_CHK2(iErr, SendProtocol(0x83));
05466 if( iErr == 0x13 ||
05467 iErr == 0x19 )
05468 {
05469 FEDM_RETURN(iErr);
05470 }
05471 break;
05472 }
05473
05474
05475 if(bEEPROM)
05476 {
05477 if(FEDM_IS_COMPORT(GetPortHnd()))
05478 {
05479 switch(m_uiReaderType)
05480 {
05481 case FEDM_ISC_TYPE_ISCLR2500_B:
05482 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_DEVICE, (unsigned char)FEDM_CNTRL_TYPE_RFC));
05483 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_BANK, (unsigned char)FEDM_MEM_BANK_TYPE_MAIN));
05484 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_MODE, (unsigned char)0x00));
05485 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_MODE_LOC, bEEPROM));
05486 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_REQ_CFG_N, (unsigned char)1));
05487 FEDM_CHK2(iErr, SetData(FEDM_ISC_TMP_0x8A_READ_REQ_CFG_ADR, (unsigned char)1));
05488 FEDM_CHK2(iErr, SendProtocol(0x8A));
05489 if( iErr == 0x13 ||
05490 iErr == 0x19 )
05491 {
05492 FEDM_RETURN(iErr);
05493 }
05494 break;
05495
05496 default:
05497 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_READ_CFG, (unsigned char)1));
05498 FEDM_CHK2(iErr, SetData( FEDM_ISC_TMP_READ_CFG_LOC, bEEPROM));
05499 FEDM_CHK2(iErr, SendProtocol(0x80));
05500 if( iErr == 0x13 ||
05501 iErr == 0x19 )
05502 {
05503 FEDM_RETURN(iErr);
05504 }
05505 break;
05506 }
05507
05508
05509 GetConfigPara(CoreImpl::ReaderConfig::HostInterface::Serial::BusAddress, &ucNewBusAdr);
05510 GetConfigPara(CoreImpl::ReaderConfig::HostInterface::Serial::Baudrate, &ucNewBaudrate);
05511 GetConfigPara(CoreImpl::ReaderConfig::HostInterface::Serial::Parity, &ucNewParity);
05512 if(ucOldBusAdr != ucNewBusAdr)
05513 {
05514 SetBusAddress(ucNewBusAdr);
05515 bDetect = true;
05516 }
05517
05518 if(ucOldBaudrate != ucNewBaudrate)
05519 bDetect = true;
05520
05521 if(ucOldParity != ucNewParity)
05522 bDetect = true;
05523 }
05524
05525 FEDM_CHK2(iErr, SendProtocol(0x63));
05526
05527
05528
05529 t1 = FEDM_GetUTCTimestamp() / 1000;
05530 t2 = t1 + (__int64)10000;
05531
05532 if(FEDM_IS_COMPORT(GetPortHnd()))
05533 {
05534 FEDM_SLEEP(FE_1000MS);
05535
05536
05537 if(bDetect)
05538 {
05539 FindBaudRate();
05540 }
05541 else
05542 {
05543 int iTimeout = 0;
05544 GetPortPara("Timeout", &iTimeout);
05545 SetPortPara("Timeout", "200");
05546 while(SendProtocol(0x52))
05547 {
05548 t1 = FEDM_GetUTCTimestamp() / 1000;
05549 if(t1 > t2)
05550 {
05551 break;
05552 }
05553 }
05554 SetPortPara("Timeout", iTimeout);
05555 }
05556 }
05557 else if(FEDM_IS_USBPORT(GetPortHnd()))
05558 {
05559
05560 }
05561 else if(FEDM_IS_TCPPORT(GetPortHnd()))
05562 {
05563 char cConIPAdr[16];
05564 int iConIPPort = 0;
05565
05566 this->GetPortPara("HostAdr", cConIPAdr);
05567 this->GetPortPara("PortNr", &iConIPPort);
05568
05569 DisConnect();
05570 FEDM_SLEEP(FE_1000MS);
05571
05572 while(ConnectTCP(cConIPAdr, iConIPPort))
05573 {
05574 FEDM_SLEEP(FE_500MS);
05575
05576 t1 = FEDM_GetUTCTimestamp() / 1000;
05577 if(t1 > t2)
05578 {
05579
05580 break;
05581 }
05582 }
05583 }
05584 }
05585
05586 FEDM_RETURN(FEDM_OK);
05587 }
05588
05589
05590
05591
05592
05593
05594
05595
05596
05597
05598
05599
05600
05601
05602
05603 int FEDM_ISCReaderModule::SerializeProfile(bool bRead, char* sFileName)
05604 {
05605 #ifdef _FEDM_XML_SUPPORT
05606 int iBack = FEDM_DataBase::SerializeProfile(&m_ProfileModule, bRead, sFileName);
05607
05608 FEDM_RETURN(iBack);
05609 #else
05610 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
05611 #endif
05612 }
05613
05614
05615
05616
05617
05618
05619
05620
05621
05622
05623
05624
05625
05626 int FEDM_ISCReaderModule::TransferXmlFileToReaderCfg(char* sFileName)
05627 {
05628 #ifdef _FEDM_XML_SUPPORT
05629 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_HIGH_LEVEL, __FUNCTION__);
05630
05631 int iBack = 0;
05632
05633 if(! IsConnected())
05634 {
05635 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
05636 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
05637 }
05638
05639
05640 if(NULL == ReadReaderInfo())
05641 return this->GetLastError();
05642
05643
05644 FEDM_CHK2(iBack, Serialize(true, sFileName));
05645
05646
05647 FEDM_CHK4(iBack, WriteCompleteConfiguration(true));
05648
05649
05650 FEDM_CHK2(iBack, SendProtocol(0x63));
05651
05652
05653 m_RFC_RAMData = m_RFC_EEData;
05654
05655 if(m_ACC_EEData.size() > 0)
05656 m_ACC_RAMData = m_ACC_EEData;
05657
05658 FEDM_RETURN(FEDM_OK);
05659 #else
05660 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
05661 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
05662 #endif
05663 }
05664
05665
05666
05667
05668
05669
05670
05671
05672
05673
05674
05675
05676 int FEDM_ISCReaderModule::TransferReaderCfgToXmlFile(char* sFileName)
05677 {
05678 #ifdef _FEDM_XML_SUPPORT
05679 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_HIGH_LEVEL, __FUNCTION__);
05680
05681 int iBack = 0;
05682
05683 if(! IsConnected())
05684 {
05685 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_NOT_CONNECTED));
05686 FEDM_RETURN(FEDM_ERROR_NOT_CONNECTED);
05687 }
05688
05689
05690 if(NULL == ReadReaderInfo())
05691 return this->GetLastError();
05692
05693
05694 FEDM_CHK4(iBack, ReadCompleteConfiguration(true));
05695 FEDM_CHK4(iBack, ReadCompleteConfiguration(false));
05696
05697
05698 FEDM_CHK2(iBack, Serialize(false, sFileName));
05699
05700 FEDM_RETURN(FEDM_OK);
05701 #else
05702 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << " " << GetErrorText(FEDM_ERROR_UNSUPPORTED));
05703 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
05704 #endif
05705 }
05706
05707
05708
05709
05710
05711
05712
05713
05714
05715
05716
05717
05718
05719
05720
05721
05722 int FEDM_ISCReaderModule::ReadSoftVersion( unsigned char* ucSWRev,
05723 unsigned char* ucDevRev,
05724 unsigned char* ucHWType,
05725 unsigned char* ucSWType,
05726 unsigned char* ucTrp )
05727 {
05728 int iErr;
05729 FEDM_CHK3(ucSWRev);
05730 FEDM_CHK3(ucDevRev);
05731 FEDM_CHK3(ucHWType);
05732 FEDM_CHK3(ucSWType);
05733 FEDM_CHK3(ucTrp);
05734
05735 FEDM_CHK4(iErr, SendProtocol(0x65));
05736
05737 FEDM_CHK2(iErr, GetData(FEDM_ISC_TMP_SOFTVER_SW_REV, ucSWRev, 2));
05738 FEDM_CHK2(iErr, GetData(FEDM_ISC_TMP_SOFTVER_D_REV, ucDevRev));
05739 FEDM_CHK2(iErr, GetData(FEDM_ISC_TMP_SOFTVER_HW_TYPE, ucHWType));
05740 FEDM_CHK2(iErr, GetData(FEDM_ISC_TMP_SOFTVER_SW_TYPE, ucSWType));
05741 FEDM_CHK2(iErr, GetData(FEDM_ISC_TMP_SOFTVER_TR_TYPE, ucTrp, 2));
05742
05743 FEDM_RETURN(FEDM_OK);
05744 }
05745
05746
05747
05748
05749
05750
05751
05752
05753
05754
05755
05756
05757
05758
05759
05760
05761
05762
05763
05764
05765
05766
05767
05768
05769
05770 FEDM_ISC_READER_INFO* FEDM_ISCReaderModule::ReadReaderInfo(unsigned int uiProtocolFrame)
05771 {
05772 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_HIGH_LEVEL, __FUNCTION__);
05773
05774 unsigned char ucData[32];
05775 int iBack = 0;
05776 int iMemAdr = 0;
05777 unsigned int uiPageCount = 0;
05778
05779 m_ReaderInfo.Init();
05780
05781
05782 switch(this->m_uiReaderType)
05783 {
05784 case FEDM_ISC_TYPE_ISCLR2500_A:
05785 case FEDM_ISC_TYPE_ISCLRU3000:
05786 SetProtocolFrameSupport(FEDM_PRT_FRAME_ADVANCED);
05787 break;
05788 default:
05789 SetProtocolFrameSupport(uiProtocolFrame);
05790 break;
05791 }
05792
05793
05794
05795
05796
05797 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0xFF));
05798 FEDM_CHK7(iBack, SendProtocol(0x66));
05799 if(iBack==0x19)
05800 {
05801 this->SetLastError(iBack);
05802 return NULL;
05803 }
05804
05805 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
05806 {
05807
05808
05809
05810 switch(m_ReaderInfo.ucReaderType)
05811 {
05812
05813 case FEDM_ISC_TYPE_ANT_DAT:
05814 case FEDM_ISC_TYPE_ANT_UMUX:
05815
05816 case FEDM_ISC_TYPE_CPRM02:
05817 case FEDM_ISC_TYPE_CPR02:
05818 case FEDM_ISC_TYPE_CPR04_U:
05819
05820 case FEDM_ISC_TYPE_ISCLR200:
05821 case FEDM_ISC_TYPE_ISCM02:
05822
05823 break;
05824
05825
05826 case FEDM_ISC_TYPE_ISCLRU1000:
05827 FEDM_CHK7(iBack, FEISC_0x80_ReadConfBlock( GetReaderHnd(),
05828 GetBusAddress(),
05829 0x43,
05830 ucData,
05831 0 ));
05832
05833 if(iBack==0x00 || iBack==0x18 || iBack==0x84)
05834 {
05835 m_ReaderInfo.ucRfcFrequency = ucData[5];
05836 m_ReaderInfo.bIsRfcFrequency = true;
05837 }
05838 SetProtocolFrameSupport(FEDM_PRT_FRAME_ADVANCED);
05839 break;
05840
05841 case FEDM_ISC_TYPE_ISCLRU2000:
05842 if(m_ReaderInfo.ucRfcSwVer[0] >= 2)
05843 {
05844 m_ReaderInfo.bIsRfcFrequency = true;
05845
05846 }
05847 else
05848 {
05849 FEDM_CHK7(iBack, FEISC_0x80_ReadConfBlock( GetReaderHnd(),
05850 GetBusAddress(),
05851 0x43,
05852 ucData,
05853 0 ));
05854
05855 if(iBack==0x00 || iBack==0x18 || iBack==0x84)
05856 {
05857 m_ReaderInfo.ucRfcFrequency = ucData[5];
05858 m_ReaderInfo.bIsRfcFrequency = true;
05859 }
05860 }
05861 SetProtocolFrameSupport(FEDM_PRT_FRAME_ADVANCED);
05862 break;
05863
05864 default:
05865 SetProtocolFrameSupport(FEDM_PRT_FRAME_ADVANCED);
05866 break;
05867 }
05868
05869 SetLastError(FEDM_OK);
05870 return &m_ReaderInfo;
05871 }
05872
05873
05874
05875
05876
05877
05878 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x00));
05879 FEDM_CHK7(iBack, SendProtocol(0x66));
05880 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
05881 {
05882 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_SOFTVER, &m_ReaderInfo.ucRfcSwVer[0], 16));
05883 FEDM_CHK7(iBack, SetReaderType(m_ReaderInfo.ucReaderType));
05884 m_ReaderInfo.bIsMode0x00Read = true;
05885 }
05886 else
05887 {
05888
05889
05890
05891
05892 FEDM_CHK7(iBack, SendProtocol(0x65));
05893 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
05894 {
05895 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_SOFTVER, &m_ReaderInfo.ucRfcSwVer[0], 11));
05896 FEDM_CHK7(iBack, SetReaderType(m_ReaderInfo.ucReaderType));
05897 m_ReaderInfo.bIsMode0x00Read = true;
05898 }
05899 }
05900
05901 switch(m_ReaderInfo.ucReaderType)
05902 {
05903
05904
05905 case FEDM_ISC_TYPE_ANT_DAT:
05906 case FEDM_ISC_TYPE_ANT_UMUX:
05907
05908 case FEDM_ISC_TYPE_CPRM02:
05909 case FEDM_ISC_TYPE_CPR02:
05910 case FEDM_ISC_TYPE_CPR04_U:
05911
05912 case FEDM_ISC_TYPE_ISCLR200:
05913 case FEDM_ISC_TYPE_ISCM02:
05914
05915 break;
05916
05917
05918 default:
05919 SetProtocolFrameSupport(FEDM_PRT_FRAME_ADVANCED);
05920 break;
05921 }
05922
05923
05924 m_ReaderInfo.bIsInfoRead = true;
05925
05926
05927
05928
05929
05930 switch(m_ReaderInfo.ucReaderType)
05931 {
05932
05933 case FEDM_ISC_TYPE_ISCLR2000:
05934 case FEDM_ISC_TYPE_ISCLR2500_A:
05935
05936 case FEDM_ISC_TYPE_ISCLRU1000:
05937 case FEDM_ISC_TYPE_ISCLRU2000:
05938 case FEDM_ISC_TYPE_ISCLRU3000:
05939 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x01));
05940 FEDM_CHK7(iBack, SendProtocol(0x66));
05941 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
05942 {
05943 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucAccSwVer[0], 4));
05944 m_ReaderInfo.bIsMode0x01Read = true;
05945 }
05946 break;
05947 }
05948
05949
05950
05951
05952
05953 switch(m_ReaderInfo.ucReaderType)
05954 {
05955 case FEDM_ISC_TYPE_CPR04_U:
05956 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x02));
05957 FEDM_CHK7(iBack, SendProtocol(0x66));
05958 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
05959 {
05960 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucUsbSwVer[0], 4));
05961 m_ReaderInfo.bIsMode0x02Read = true;
05962 }
05963 break;
05964 }
05965
05966
05967
05968
05969
05970 switch(m_ReaderInfo.ucReaderType)
05971 {
05972
05973 case FEDM_ISC_TYPE_MLC_COM:
05974
05975 case FEDM_ISC_TYPE_CPR20_XX:
05976 case FEDM_ISC_TYPE_CPR40_XX_U:
05977 case FEDM_ISC_TYPE_CPR40_XX:
05978 case FEDM_ISC_TYPE_CPR44_XX:
05979 case FEDM_ISC_TYPE_CPR46_XX:
05980 case FEDM_ISC_TYPE_CPR47_XX:
05981
05982 case FEDM_ISC_TYPE_MAX_ONTOP:
05983 case FEDM_ISC_TYPE_MAXU1002:
05984
05985 case FEDM_ISC_TYPE_ISCLR2000:
05986 case FEDM_ISC_TYPE_ISCLR2500_A:
05987 case FEDM_ISC_TYPE_ISCLR2500_B:
05988
05989 case FEDM_ISC_TYPE_ISCMRU200:
05990 case FEDM_ISC_TYPE_ISCLRU1002:
05991 case FEDM_ISC_TYPE_ISCLRU2000:
05992 case FEDM_ISC_TYPE_ISCLRU3000:
05993 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x03));
05994 FEDM_CHK7(iBack, SendProtocol(0x66));
05995 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
05996 {
05997 switch(m_ReaderInfo.ucReaderType)
05998 {
05999
06000 case FEDM_ISC_TYPE_MLC_COM:
06001
06002 case FEDM_ISC_TYPE_CPR20_XX:
06003 case FEDM_ISC_TYPE_CPR40_XX_U:
06004 case FEDM_ISC_TYPE_CPR40_XX:
06005 case FEDM_ISC_TYPE_CPR44_XX:
06006 case FEDM_ISC_TYPE_CPR46_XX:
06007 case FEDM_ISC_TYPE_CPR47_XX:
06008
06009
06010 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucDecoderType[0], 6));
06011 m_ReaderInfo.bIsMode0x03Read = true;
06012 break;
06013
06014
06015 case FEDM_ISC_TYPE_ISCLR2000:
06016
06017 case FEDM_ISC_TYPE_MAXU1002:
06018
06019 case FEDM_ISC_TYPE_ISCMRU200:
06020 case FEDM_ISC_TYPE_ISCLRU1002:
06021 case FEDM_ISC_TYPE_ISCLRU2000:
06022 case FEDM_ISC_TYPE_ISCLRU3000:
06023 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucFpgaSwVer[0], 4));
06024 m_ReaderInfo.bIsMode0x03Read = true;
06025 break;
06026 }
06027 }
06028 break;
06029 }
06030
06031
06032
06033
06034
06035 switch(m_ReaderInfo.ucReaderType)
06036 {
06037
06038 case 20:
06039
06040 case FEDM_ISC_TYPE_MLC_COM:
06041
06042 case FEDM_ISC_TYPE_CPRM02:
06043 case FEDM_ISC_TYPE_CPR02:
06044 case FEDM_ISC_TYPE_CPR04_U:
06045 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x04));
06046 FEDM_CHK7(iBack, SendProtocol(0x66));
06047 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
06048 {
06049 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucCprFctTemplate, 2));
06050 m_ReaderInfo.bIsMode0x04Read = true;
06051 }
06052 break;
06053
06054 case FEDM_ISC_TYPE_CPR20_XX:
06055 case FEDM_ISC_TYPE_CPR30_XX:
06056 case FEDM_ISC_TYPE_CPR40_XX_U:
06057 case FEDM_ISC_TYPE_CPR40_XX:
06058 case FEDM_ISC_TYPE_CPR44_XX:
06059 case FEDM_ISC_TYPE_CPR46_XX:
06060 case FEDM_ISC_TYPE_CPR47_XX:
06061 case FEDM_ISC_TYPE_CPR50_XX:
06062 case FEDM_ISC_TYPE_CPR52_XX:
06063 case FEDM_ISC_TYPE_CPR60_XX:
06064
06065 case FEDM_ISC_TYPE_MAX50_XX:
06066 case FEDM_ISC_TYPE_MAX_STANDARD:
06067 case FEDM_ISC_TYPE_MAX_COMFORT:
06068 case FEDM_ISC_TYPE_MAX_ONTOP:
06069 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x04));
06070 FEDM_CHK7(iBack, SendProtocol(0x66));
06071 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
06072 {
06073 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucCprFctTemplate, 11));
06074 m_ReaderInfo.bIsMode0x04Read = true;
06075 }
06076 break;
06077
06078
06079 case FEDM_ISC_TYPE_ISCPRH200:
06080 case FEDM_ISC_TYPE_ISCLR2000:
06081 case FEDM_ISC_TYPE_ISCLR2500_A:
06082 case FEDM_ISC_TYPE_ISCLR2500_B:
06083 case FEDM_ISC_TYPE_ISCLR1002:
06084
06085 case FEDM_ISC_TYPE_MAXU1002:
06086
06087 case FEDM_ISC_TYPE_ISCMU02:
06088 case FEDM_ISC_TYPE_ISCLRU1002:
06089 case FEDM_ISC_TYPE_ISCLRU2000:
06090 case FEDM_ISC_TYPE_ISCLRU3000:
06091 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x04));
06092 FEDM_CHK7(iBack, SendProtocol(0x66));
06093 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
06094 {
06095 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucReserved1, 11));
06096 m_ReaderInfo.bIsMode0x04Read = true;
06097 }
06098 break;
06099 }
06100
06101
06102
06103
06104
06105 switch(m_ReaderInfo.ucReaderType)
06106 {
06107
06108 case 20:
06109
06110 case FEDM_ISC_TYPE_MLC_COM:
06111
06112 case FEDM_ISC_TYPE_CPR20_XX:
06113 case FEDM_ISC_TYPE_CPR30_XX:
06114 case FEDM_ISC_TYPE_CPR40_XX_U:
06115 case FEDM_ISC_TYPE_CPR40_XX:
06116 case FEDM_ISC_TYPE_CPR44_XX:
06117 case FEDM_ISC_TYPE_CPR46_XX:
06118 case FEDM_ISC_TYPE_CPR47_XX:
06119 case FEDM_ISC_TYPE_CPR52_XX:
06120 case FEDM_ISC_TYPE_CPR60_XX:
06121
06122 case FEDM_ISC_TYPE_MAX50_XX:
06123 case FEDM_ISC_TYPE_MAX_STANDARD:
06124 case FEDM_ISC_TYPE_MAX_COMFORT:
06125 case FEDM_ISC_TYPE_MAX_ONTOP:
06126 case FEDM_ISC_TYPE_MAXU1002:
06127
06128 case FEDM_ISC_TYPE_ISCPRHD102:
06129
06130 case FEDM_ISC_TYPE_ISCMR102:
06131 case FEDM_ISC_TYPE_ISCMR10X:
06132 case FEDM_ISC_TYPE_ISCPRH102:
06133 case FEDM_ISC_TYPE_ISCPRH200:
06134 case FEDM_ISC_TYPE_ISCLR1002:
06135 case FEDM_ISC_TYPE_ISCLR2000:
06136 case FEDM_ISC_TYPE_ISCLR2500_B:
06137
06138 case FEDM_ISC_TYPE_ISCMRU200:
06139 case FEDM_ISC_TYPE_ISCLRU1002:
06140 case FEDM_ISC_TYPE_ISCLRU1000:
06141 case FEDM_ISC_TYPE_ISCLRU2000:
06142 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x05));
06143 FEDM_CHK7(iBack, SendProtocol(0x66));
06144 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
06145 {
06146 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucBootSwVer[0], 2));
06147 m_ReaderInfo.bIsMode0x05Read = true;
06148 }
06149 break;
06150 }
06151
06152
06153
06154
06155
06156 switch(m_ReaderInfo.ucReaderType)
06157 {
06158
06159 case FEDM_ISC_TYPE_CPR50_XX:
06160
06161 case FEDM_ISC_TYPE_MAX50_XX:
06162 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x06));
06163 FEDM_CHK7(iBack, SendProtocol(0x66));
06164 if(iBack==0x00)
06165 {
06166 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucKeybStatus[0], 8));
06167 m_ReaderInfo.bIsMode0x06Read = true;
06168 }
06169 break;
06170 }
06171
06172
06173
06174
06175
06176 switch(m_ReaderInfo.ucReaderType)
06177 {
06178
06179 case FEDM_ISC_TYPE_CPR50_XX:
06180
06181 case FEDM_ISC_TYPE_MAX50_XX:
06182 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x07));
06183 FEDM_CHK7(iBack, SendProtocol(0x66));
06184 if(iBack==0x00)
06185 {
06186 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucCprioSwVer[0], 7));
06187 m_ReaderInfo.bIsMode0x07Read = true;
06188 }
06189 break;
06190 }
06191
06192
06193
06194
06195
06196 switch(m_ReaderInfo.ucReaderType)
06197 {
06198
06199 case FEDM_ISC_TYPE_CPR46_XX:
06200 case FEDM_ISC_TYPE_CPR47_XX:
06201
06202 case FEDM_ISC_TYPE_MAX_ONTOP:
06203 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x08));
06204 FEDM_CHK7(iBack, SendProtocol(0x66));
06205 if(iBack==0x00)
06206 {
06207 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucRfcSupportedTagDriver[0], 14));
06208 m_ReaderInfo.bIsMode0x08Read = true;
06209 }
06210 break;
06211 }
06212
06213
06214
06215
06216
06217 switch(m_ReaderInfo.ucReaderType)
06218 {
06219
06220 case FEDM_ISC_TYPE_ISCPRH200:
06221 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x09));
06222 FEDM_CHK7(iBack, SendProtocol(0x66));
06223 if(iBack==0x00)
06224 {
06225 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucWlanVer[0], 14));
06226 m_ReaderInfo.bIsMode0x09Read = true;
06227 }
06228 break;
06229 }
06230
06231
06232
06233
06234
06235 switch(m_ReaderInfo.ucReaderType)
06236 {
06237
06238 case FEDM_ISC_TYPE_MLC_COM:
06239
06240 case FEDM_ISC_TYPE_CPR50_XX:
06241 case FEDM_ISC_TYPE_CPR52_XX:
06242 case FEDM_ISC_TYPE_CPR60_XX:
06243
06244 case FEDM_ISC_TYPE_MAX50_XX:
06245 case FEDM_ISC_TYPE_MAX_ONTOP:
06246 case FEDM_ISC_TYPE_MAXU1002:
06247
06248 case FEDM_ISC_TYPE_ISCMU02:
06249 case FEDM_ISC_TYPE_ISCMRU102:
06250 case FEDM_ISC_TYPE_ISCLRU1002:
06251 case FEDM_ISC_TYPE_ISCLRU3000:
06252
06253 case FEDM_ISC_TYPE_ISCPRHD102:
06254 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x10));
06255 FEDM_CHK7(iBack, SendProtocol(0x66));
06256 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
06257 {
06258 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucRfcHwInfo[0], 11));
06259 m_ReaderInfo.bIsMode0x10Read = true;
06260
06261 m_ReaderInfo.bIsRfcFrequency = true;
06262 }
06263 break;
06264
06265
06266 case FEDM_ISC_TYPE_ISCMR102:
06267 case FEDM_ISC_TYPE_ISCPRH102:
06268 case FEDM_ISC_TYPE_ISCPRH200:
06269 case FEDM_ISC_TYPE_ISCMR10X:
06270 case FEDM_ISC_TYPE_ISCLR1002:
06271 case FEDM_ISC_TYPE_ISCLR2000:
06272 case FEDM_ISC_TYPE_ISCLR2500_A:
06273 case FEDM_ISC_TYPE_ISCLR2500_B:
06274 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x10));
06275 FEDM_CHK7(iBack, SendProtocol(0x66));
06276 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
06277 {
06278 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucRfcHwInfo[0], 11));
06279 m_ReaderInfo.bIsMode0x10Read = true;
06280 }
06281 break;
06282
06283
06284 case FEDM_ISC_TYPE_ISCMRU200:
06285 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x10));
06286 FEDM_CHK7(iBack, SendProtocol(0x66));
06287 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
06288 {
06289 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucRfcHwInfo[0], 11));
06290 m_ReaderInfo.bIsMode0x10Read = true;
06291
06292 m_ReaderInfo.ucRfcFrequency = (m_ReaderInfo.ucRfcHwInfo[1] & 0x01) + 1;
06293 m_ReaderInfo.bIsRfcFrequency = true;
06294 }
06295 break;
06296
06297
06298 case FEDM_ISC_TYPE_ISCLRU1000:
06299 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x10));
06300 FEDM_CHK7(iBack, SendProtocol(0x66));
06301 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
06302 {
06303 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucRfcHwInfo[0], 11));
06304 m_ReaderInfo.bIsMode0x10Read = true;
06305 }
06306 break;
06307
06308
06309 case FEDM_ISC_TYPE_ISCLRU2000:
06310 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x10));
06311 FEDM_CHK7(iBack, SendProtocol(0x66));
06312 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
06313 {
06314 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucRfcHwInfo[0], 11));
06315 m_ReaderInfo.bIsMode0x10Read = true;
06316
06317 if(m_ReaderInfo.ucRfcSwVer[0] >= 2)
06318 m_ReaderInfo.bIsRfcFrequency = true;
06319
06320 }
06321 break;
06322
06323 }
06324
06325
06326
06327
06328
06329 switch(m_ReaderInfo.ucReaderType)
06330 {
06331
06332 case FEDM_ISC_TYPE_CPR40_XX_U:
06333 case FEDM_ISC_TYPE_CPR40_XX:
06334 case FEDM_ISC_TYPE_CPR44_XX:
06335 case FEDM_ISC_TYPE_CPR46_XX:
06336 case FEDM_ISC_TYPE_CPR47_XX:
06337 case FEDM_ISC_TYPE_CPR52_XX:
06338 case FEDM_ISC_TYPE_CPR60_XX:
06339
06340 case FEDM_ISC_TYPE_MAX_STANDARD:
06341 case FEDM_ISC_TYPE_MAX_COMFORT:
06342 case FEDM_ISC_TYPE_MAX_ONTOP:
06343 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x11));
06344 FEDM_CHK7(iBack, SendProtocol(0x66));
06345 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
06346 {
06347 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucNoOfSlots, 5));
06348 m_ReaderInfo.bIsMode0x11Read = true;
06349 }
06350 break;
06351 }
06352
06353
06354
06355
06356
06357 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x12));
06358 FEDM_CHK7(iBack, SendProtocol(0x66));
06359 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
06360 {
06361 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucRfcCpuManufacturer, 8));
06362 m_ReaderInfo.bIsMode0x12Read = true;
06363 }
06364
06365
06366
06367
06368
06369 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x40));
06370 FEDM_CHK7(iBack, SendProtocol(0x66));
06371 if(iBack==0x00 || iBack==0xF1)
06372 {
06373 iMemAdr = FEDM_GetAdrOfID(FEDM_ISC_TMP_READER_INFO, 32);
06374 FEDM_CHK7(iBack, GetData(iMemAdr, &m_ReaderInfo.ucNoOfCfgPages[0], 2, FEDM_TMPDATA_MEM));
06375 uiPageCount = ((m_ReaderInfo.ucNoOfCfgPages[0]<<8) + m_ReaderInfo.ucNoOfCfgPages[1]) / 8;
06376 if( ((m_ReaderInfo.ucNoOfCfgPages[0]<<8) + m_ReaderInfo.ucNoOfCfgPages[1]) % 8 )
06377 uiPageCount++;
06378
06379 FEDM_CHK7(iBack, GetData(iMemAdr+2, &m_ReaderInfo.ucCfgReadPermissions[0], uiPageCount, FEDM_TMPDATA_MEM));
06380 m_ReaderInfo.bIsMode0x40Read = true;
06381 }
06382
06383
06384
06385
06386
06387 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x41));
06388 FEDM_CHK7(iBack, SendProtocol(0x66));
06389 if(iBack==0x00 || iBack==0xF1)
06390 {
06391 iMemAdr = FEDM_GetAdrOfID(FEDM_ISC_TMP_READER_INFO, 32);
06392 FEDM_CHK7(iBack, GetData(iMemAdr, &m_ReaderInfo.ucNoOfCfgPages[0], 2, FEDM_TMPDATA_MEM));
06393 uiPageCount = (m_ReaderInfo.ucNoOfCfgPages[0]<<8) + m_ReaderInfo.ucNoOfCfgPages[1];
06394 if( ((m_ReaderInfo.ucNoOfCfgPages[0]<<8) + m_ReaderInfo.ucNoOfCfgPages[1]) % 8 )
06395 uiPageCount++;
06396
06397 FEDM_CHK7(iBack, GetData(iMemAdr+2, &m_ReaderInfo.ucCfgWritePermissions[0], uiPageCount, FEDM_TMPDATA_MEM));
06398 m_ReaderInfo.bIsMode0x41Read = true;
06399 }
06400
06401
06402
06403
06404
06405 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x50));
06406 FEDM_CHK7(iBack, SendProtocol(0x66));
06407 if(iBack==0x00 || iBack==0xF1)
06408 {
06409 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucLanFlags, 7));
06410 m_ReaderInfo.bIsMode0x50Read = true;
06411 }
06412
06413
06414
06415
06416
06417 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x51));
06418 FEDM_CHK7(iBack, SendProtocol(0x66));
06419 if(iBack==0x00 || iBack==0xF1)
06420 {
06421 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, ucData, 30));
06422 m_ReaderInfo.ucLanFlags = ucData[0];
06423 memcpy(&m_ReaderInfo.ucLanIpV4[0], &ucData[1], 20);
06424 m_ReaderInfo.bIsMode0x51Read = true;
06425 }
06426
06427
06428
06429
06430
06431 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x52));
06432 FEDM_CHK7(iBack, SendProtocol(0x66));
06433 if(iBack==0x00 || iBack==0xF1)
06434 {
06435 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, ucData, 30));
06436 m_ReaderInfo.ucLanFlags = ucData[0];
06437 memcpy(&m_ReaderInfo.ucLanNetmaskV4[0], &ucData[1], 20);
06438 m_ReaderInfo.bIsMode0x52Read = true;
06439 }
06440
06441
06442
06443
06444
06445 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x53));
06446 FEDM_CHK7(iBack, SendProtocol(0x66));
06447 if(iBack==0x00 || iBack==0xF1)
06448 {
06449 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, ucData, 30));
06450 m_ReaderInfo.ucLanFlags = ucData[0];
06451 memcpy(&m_ReaderInfo.ucLanGatewayV4[0], &ucData[1], 20);
06452 m_ReaderInfo.bIsMode0x53Read = true;
06453 }
06454
06455
06456
06457
06458
06459 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x54));
06460 FEDM_CHK7(iBack, SendProtocol(0x66));
06461 if(iBack==0x00 || iBack==0xF1)
06462 {
06463 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucWlanFlags, 7));
06464 m_ReaderInfo.bIsMode0x54Read = true;
06465 }
06466
06467
06468
06469
06470
06471 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x55));
06472 FEDM_CHK7(iBack, SendProtocol(0x66));
06473 if(iBack==0x00 || iBack==0xF1)
06474 {
06475 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, ucData, 30));
06476 m_ReaderInfo.ucWlanFlags = ucData[0];
06477 memcpy(&m_ReaderInfo.ucWlanIpV4[0], &ucData[1], 20);
06478 m_ReaderInfo.bIsMode0x55Read = true;
06479 }
06480
06481
06482
06483
06484
06485 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x56));
06486 FEDM_CHK7(iBack, SendProtocol(0x66));
06487 if(iBack==0x00 || iBack==0xF1)
06488 {
06489 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, ucData, 30));
06490 m_ReaderInfo.ucWlanFlags = ucData[0];
06491 memcpy(&m_ReaderInfo.ucWlanNetmaskV4[0], &ucData[1], 20);
06492 m_ReaderInfo.bIsMode0x56Read = true;
06493 }
06494
06495
06496
06497
06498
06499 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x57));
06500 FEDM_CHK7(iBack, SendProtocol(0x66));
06501 if(iBack==0x00 || iBack==0xF1)
06502 {
06503 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, ucData, 30));
06504 m_ReaderInfo.ucWlanFlags = ucData[0];
06505 memcpy(&m_ReaderInfo.ucWlanGatewayV4[0], &ucData[1], 20);
06506 m_ReaderInfo.bIsMode0x57Read = true;
06507 }
06508
06509
06510
06511
06512
06513 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x60));
06514 FEDM_CHK7(iBack, SendProtocol(0x66));
06515 if(iBack==0x00 || iBack==0xF1)
06516 {
06517 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucNoOfInputs, 3));
06518 m_ReaderInfo.bIsMode0x60Read = true;
06519 }
06520
06521
06522
06523
06524
06525 switch(m_ReaderInfo.ucReaderType)
06526 {
06527
06528 case FEDM_ISC_TYPE_ISCLR2000:
06529 case FEDM_ISC_TYPE_ISCLR2500_A:
06530 case FEDM_ISC_TYPE_ISCLR2500_B:
06531 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x61));
06532 FEDM_CHK7(iBack, SendProtocol(0x66));
06533 if(iBack==0x00 || iBack==0xF1)
06534 {
06535 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucNoOfPeripheralDevices, 7));
06536 m_ReaderInfo.bIsMode0x61Read = true;
06537 #if !defined(_FEDM_NO_PD_SUPPORT)
06538 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_INFO, __FUNCTION__ << " - " << m_ReaderInfo.ucNoOfPeripheralDevices << " People-Counter detected");
06539 BuildPDMap();
06540 #endif
06541 }
06542 break;
06543 }
06544
06545
06546
06547
06548
06549 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_READER_INFO_MODE, (unsigned char)0x80));
06550 FEDM_CHK7(iBack, SendProtocol(0x66));
06551 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
06552 {
06553 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_READER_INFO, &m_ReaderInfo.ucRfcDevID[0], 18));
06554 m_ReaderInfo.bIsMode0x80Read = true;
06555 FEDM_SETPROP2(m_pLogger, FELOGMNG_PROP_DEVICED_ID, m_ReaderInfo.GetDeviceID());
06556 }
06557
06558
06559
06560
06561
06562 switch(m_ReaderInfo.ucReaderType)
06563 {
06564
06565 case FEDM_ISC_TYPE_ISCLRU1000:
06566 case FEDM_ISC_TYPE_ISCLRU2000:
06567 FEDM_CHK7(iBack, FEISC_0x80_ReadConfBlock( GetReaderHnd(),
06568 GetBusAddress(),
06569 0x43,
06570 ucData,
06571 0 ));
06572
06573 if(iBack==0x00 || iBack==0x18 || iBack==0x84)
06574 {
06575 m_ReaderInfo.ucRfcFrequency = ucData[5];
06576 m_ReaderInfo.bIsRfcFrequency = true;
06577 }
06578
06579 break;
06580 }
06581
06582 SetLastError(FEDM_OK);
06583 return &m_ReaderInfo;
06584 }
06585
06586
06587
06588
06589
06590
06591
06592
06593
06594
06595
06596
06597
06598
06599
06600
06601
06602
06603
06604
06605
06606 FEDM_ISC_READER_DIAGNOSTIC* FEDM_ISCReaderModule::ReadReaderDiagnostic()
06607 {
06608 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_FUNCTION_CALL | FELOGMNG_DBG_LF_COMM_HIGH_LEVEL, __FUNCTION__);
06609
06610 unsigned char ucTmp = 0;
06611 int iBack = 0;
06612
06613 m_ReaderDiagnostic.Init();
06614
06615 switch(this->m_uiReaderType)
06616 {
06617
06618 case FEDM_ISC_TYPE_ANT_DAT:
06619 case FEDM_ISC_TYPE_ANT_UMUX:
06620 case FEDM_ISC_TYPE_CPRM02:
06621 case FEDM_ISC_TYPE_CPR02:
06622 case FEDM_ISC_TYPE_CPR20_XX:
06623 case FEDM_ISC_TYPE_CPR40_XX_U:
06624 case FEDM_ISC_TYPE_CPR40_XX:
06625 case FEDM_ISC_TYPE_CPR50_XX:
06626 case FEDM_ISC_TYPE_CPR44_XX:
06627 case FEDM_ISC_TYPE_CPR46_XX:
06628 case FEDM_ISC_TYPE_CPR47_XX:
06629 case FEDM_ISC_TYPE_CPR30_XX:
06630 case FEDM_ISC_TYPE_CPR52_XX:
06631 case FEDM_ISC_TYPE_CPR60_XX:
06632 case FEDM_ISC_TYPE_CPR04_U:
06633 case FEDM_ISC_TYPE_MAX_STANDARD:
06634 case FEDM_ISC_TYPE_MAX_COMFORT:
06635 SetLastError(FEDM_ERROR_UNSUPPORTED);
06636 return &m_ReaderDiagnostic;
06637 }
06638
06639
06640
06641
06642
06643
06644 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0xFF));
06645 FEDM_CHK7(iBack, SendProtocol(0x6E));
06646 if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
06647 {
06648 if(m_uiReaderType == FEDM_ISC_TYPE_ISCLR2500_B)
06649 {
06650 if(!m_ReaderDiagnostic.bIsMode0x08Read)
06651 {
06652
06653 SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0x08);
06654 SendProtocol(0x6E);
06655 }
06656 }
06657 SetLastError(FEDM_OK);
06658 return &m_ReaderDiagnostic;
06659 }
06660
06661
06662
06663
06664
06665 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0x01));
06666 FEDM_CHK7(iBack, SendProtocol(0x6E));
06667 if(iBack==0x00 || iBack==0x84)
06668 {
06669 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_DIAG_DATA, &m_ReaderDiagnostic.ucFlagsA, 2));
06670 m_ReaderDiagnostic.bIsMode0x01Read = true;
06671 }
06672
06673
06674
06675
06676
06677 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0x02));
06678 FEDM_CHK7(iBack, SendProtocol(0x6E));
06679 if(iBack==0x00 || iBack==0x84)
06680 {
06681 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_DIAG_DATA, &m_ReaderDiagnostic.ucRfPower, 3));
06682 if(this->m_uiReaderType == FEDM_ISC_TYPE_ISCMR200)
06683 {
06684
06685 ucTmp = m_ReaderDiagnostic.ucRfPower;
06686 m_ReaderDiagnostic.ucRfPower = m_ReaderDiagnostic.ucRfModulation;
06687 m_ReaderDiagnostic.ucRfModulation = ucTmp;
06688 }
06689 m_ReaderDiagnostic.bIsMode0x02Read = true;
06690 }
06691
06692
06693
06694
06695
06696 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0x03));
06697 FEDM_CHK7(iBack, SendProtocol(0x6E));
06698 if(iBack==0x00 || iBack==0x84)
06699 {
06700 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_DIAG_DATA, &m_ReaderDiagnostic.ucMuxStatusCh1, 8));
06701 m_ReaderDiagnostic.bIsMode0x03Read = true;
06702 }
06703
06704
06705
06706
06707
06708 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0x04));
06709 FEDM_CHK7(iBack, SendProtocol(0x6E));
06710 if(iBack==0x00 || iBack==0x84)
06711 {
06712 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_DIAG_DATA, &m_ReaderDiagnostic.ucIntErrorA, 2));
06713 m_ReaderDiagnostic.bIsMode0x04Read = true;
06714 }
06715
06716
06717
06718
06719
06720 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0x05));
06721 FEDM_CHK7(iBack, SendProtocol(0x6E));
06722 if(iBack==0x00 || iBack==0x84)
06723 {
06724 switch(m_uiReaderType)
06725 {
06726 case FEDM_ISC_TYPE_ISCLRU2000:
06727 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_DIAG_DATA, (unsigned char*)&m_ReaderDiagnostic.CNTRL_OUT1.ucMux_PowerAmp, 12));
06728 m_ReaderDiagnostic.bIsMode0x05Read = true;
06729 break;
06730
06731 case FEDM_ISC_TYPE_ISCLRU3000:
06732 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_DIAG_DATA, (unsigned char*)&m_ReaderDiagnostic.CNTRL_OUT1.ucMux_PowerAmp, 12));
06733 m_ReaderDiagnostic.bIsMode0x05Read = true;
06734 break;
06735
06736 default:
06737 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_DIAG_DATA, (unsigned char*)&m_ReaderDiagnostic.CNTRL_OUT1.ucMux_PowerAmp, 3));
06738 m_ReaderDiagnostic.bIsMode0x05Read = true;
06739 break;
06740 }
06741 }
06742
06743
06744
06745
06746
06747 if(this->m_uiReaderType == FEDM_ISC_TYPE_MAX50_XX ||
06748 this->m_uiReaderType == FEDM_ISC_TYPE_MAXU1002)
06749 {
06750 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0x06));
06751 FEDM_CHK7(iBack, SendProtocol(0x6E));
06752 if(iBack==0x00 || iBack==0x84)
06753 {
06754 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_DIAG_DATA, (unsigned char*)&m_ReaderDiagnostic.usErrorFlags, 6));
06755 m_ReaderDiagnostic.bIsMode0x06Read = true;
06756 }
06757 }
06758
06759
06760
06761
06762
06763 if(this->m_uiReaderType == FEDM_ISC_TYPE_ISCPRH200)
06764 {
06765 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0x07));
06766 FEDM_CHK7(iBack, SendProtocol(0x6E));
06767 if(iBack==0x00 || iBack==0x84)
06768 {
06769 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_DIAG_DATA, (unsigned char*)&m_ReaderDiagnostic.ucNoOfLEDs, 30));
06770 m_ReaderDiagnostic.bIsMode0x07Read = true;
06771 }
06772 }
06773
06774
06775
06776
06777
06778 if(this->m_uiReaderType == FEDM_ISC_TYPE_ISCLR2500_B)
06779 {
06780 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0x08));
06781 FEDM_CHK7(iBack, SendProtocol(0x6E));
06782 if(iBack==0x00 || iBack==0x84)
06783 {
06784 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_DIAG_DATA, (unsigned char*)&m_ReaderDiagnostic.usRes1, 15));
06785 m_ReaderDiagnostic.bIsMode0x08Read = true;
06786 }
06787 }
06788
06789
06790
06791
06792
06793 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0x20));
06794 FEDM_CHK7(iBack, SendProtocol(0x6E));
06795 if(iBack==0x00 || iBack==0x84)
06796 {
06797 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_DIAG_DATA, &m_ReaderDiagnostic.ucFirmwareStatus[0], 30));
06798 m_ReaderDiagnostic.bIsMode0x20Read = true;
06799 }
06800
06801
06802
06803
06804 if( this->m_uiReaderType == FEDM_ISC_TYPE_ISCLRU3000 ||
06805 this->m_uiReaderType == FEDM_ISC_TYPE_ISCLR2500_A)
06806 {
06807 FEDM_CHK7(iBack, SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0x21));
06808 FEDM_CHK7(iBack, SendProtocol(0x6E));
06809 if(iBack==0x00 || iBack==0x84)
06810 {
06811 FEDM_CHK7(iBack, GetData(FEDM_ISC_TMP_DIAG_DATA, &m_ReaderDiagnostic.ucConfigParaChange, 1));
06812 m_ReaderDiagnostic.bIsMode0x21Read = true;
06813 }
06814 }
06815
06816 if( !m_ReaderDiagnostic.bIsMode0x01Read &&
06817 !m_ReaderDiagnostic.bIsMode0x02Read &&
06818 !m_ReaderDiagnostic.bIsMode0x03Read &&
06819 !m_ReaderDiagnostic.bIsMode0x04Read &&
06820 !m_ReaderDiagnostic.bIsMode0x05Read &&
06821 !m_ReaderDiagnostic.bIsMode0x06Read &&
06822 !m_ReaderDiagnostic.bIsMode0x20Read &&
06823 !m_ReaderDiagnostic.bIsMode0x21Read )
06824 {
06825 SetLastError(FEDM_ERROR_NO_DATA);
06826 }
06827 else
06828 {
06829 SetLastError(FEDM_OK);
06830 }
06831
06832 return &m_ReaderDiagnostic;
06833 }
06834
06836
06838
06839
06840
06841
06842
06843
06844
06845
06846
06847
06848
06849
06850
06851
06852
06853
06854
06855
06856
06857
06858
06859
06860
06861
06862 void FEDM_ISCReaderModule::cbsTaskRsp1( void* pAny,
06863 int iReaderHnd,
06864 int iTaskID,
06865 int iError,
06866 unsigned char ucCmd,
06867 unsigned char* ucRspData,
06868 int iRspLen )
06869 {
06870 if((FEDM_ISCReaderModule*)pAny == NULL)
06871 return;
06872
06873 switch(iTaskID)
06874 {
06875 case FEISC_TASKID_FIRST_NEW_TAG:
06876 ((FEDM_ISCReaderModule*)pAny)->cbNewTag(iReaderHnd, iTaskID, iError, ucRspData, iRspLen);
06877 ((FEDM_ISCReaderModule*)pAny)->m_bActiveAsyncTask = false;
06878 break;
06879
06880 case FEISC_TASKID_EVERY_NEW_TAG:
06881 ((FEDM_ISCReaderModule*)pAny)->cbNewTag(iReaderHnd, iTaskID, iError, ucRspData, iRspLen);
06882 break;
06883
06884 case FEISC_TASKID_NOTIFICATION:
06885 switch(ucCmd)
06886 {
06887 case 0x22:
06888 ((FEDM_ISCReaderModule*)pAny)->cbNewNotify(iReaderHnd, iTaskID, iError, ucRspData, iRspLen, "", 0);
06889 break;
06890 case 0x6E:
06891 ((FEDM_ISCReaderModule*)pAny)->cbNewReaderDiagnostic(iReaderHnd, iTaskID, iError, ucRspData, iRspLen, "", 0);
06892 break;
06893 case 0x74:
06894 ((FEDM_ISCReaderModule*)pAny)->cbNewInputEvent(iReaderHnd, iTaskID, iError, ucRspData, iRspLen, "", 0);
06895 break;
06896 case 0x77:
06897 ((FEDM_ISCReaderModule*)pAny)->cbNewNotifyFromPeopleCounter(iReaderHnd, iTaskID, iError, ucRspData, iRspLen, "", 0);
06898 break;
06899 }
06900 break;
06901 }
06902 }
06903
06904
06905
06906
06907
06908
06909
06910
06911
06912
06913
06914
06915
06916
06917
06918
06919
06920
06921
06922
06923
06924
06925
06926 void FEDM_ISCReaderModule::cbsTaskRsp2( void* pAny,
06927 int iReaderHnd,
06928 int iTaskID,
06929 int iError,
06930 unsigned char ucCmd,
06931 unsigned char* ucRspData,
06932 int iRspLen,
06933 char* cIPAdr,
06934 int iPortNr )
06935 {
06936 if((FEDM_ISCReaderModule*)pAny == NULL)
06937 return;
06938
06939 switch(iTaskID)
06940 {
06941 case FEISC_TASKID_NOTIFICATION:
06942 switch(ucCmd)
06943 {
06944 case 0x22:
06945 ((FEDM_ISCReaderModule*)pAny)->cbNewNotify(iReaderHnd, iTaskID, iError, ucRspData, iRspLen, cIPAdr, iPortNr);
06946 break;
06947 case 0x6E:
06948 ((FEDM_ISCReaderModule*)pAny)->cbNewReaderDiagnostic(iReaderHnd, iTaskID, iError, ucRspData, iRspLen, cIPAdr, iPortNr);
06949 break;
06950 case 0x74:
06951 ((FEDM_ISCReaderModule*)pAny)->cbNewInputEvent(iReaderHnd, iTaskID, iError, ucRspData, iRspLen, cIPAdr, iPortNr);
06952 break;
06953 case 0x77:
06954 ((FEDM_ISCReaderModule*)pAny)->cbNewNotifyFromPeopleCounter(iReaderHnd, iTaskID, iError, ucRspData, iRspLen, cIPAdr, iPortNr);
06955 break;
06956 }
06957 break;
06958 }
06959 }
06960
06961
06962
06964
06966
06967
06968
06969
06970
06971
06972
06973
06974
06975
06976
06977
06978
06979
06980
06981
06982
06983
06984
06985
06986 void FEDM_ISCReaderModule::cbNewTag( int iReaderHnd,
06987 int iTaskID,
06988 int iError,
06989 unsigned char* ucRspData,
06990 int iRspLen )
06991 {
06992 unsigned char ucIsoMode = 0;
06993 int iIdx = 0;
06994 int iErr = 0;
06995
06996
06997 if(iReaderHnd != GetReaderHnd())
06998 return;
06999
07000 SetLastError(iError);
07001
07002
07003 if( iError==0x00 ||
07004 iError==0x01 ||
07005 iError==0x02 ||
07006 iError==0x03 ||
07007 iError==0x83 ||
07008 iError==0x84 ||
07009 iError==0x90 ||
07010 iError==0x93 ||
07011 iError==0x94 ||
07012 iError==0x95 )
07013 {
07014 if(iRspLen > 0)
07015 {
07016 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_B0_CMD, (unsigned char)0x01));
07017
07018 if(iError == 0x01)
07019 {
07020
07021
07022 FEDM_CHK6(iErr, GetData(FEDM_ISC_TMP_B0_MODE_ADR, &ucIsoMode));
07023
07024 if(ucIsoMode == FEDM_ISC_ISO_MODE_SEL)
07025 {
07026 iIdx = FindTableIndex(0, FEDM_ISC_ISO_TABLE, FEDM_ISC_DATA_IS_SELECTED, true);
07027 if(iIdx >= 0)
07028 m_ISOTable[iIdx]->m_bIsSelected = false;
07029 }
07030 }
07031 else if(iError == 0x02)
07032 {
07033 if(iTaskID == FEDM_TASKID_EVERY_NEW_TAG)
07034 ResetTable(FEDM_ISC_ISO_TABLE);
07035
07036
07037 FEDM_CHK6(iErr, Set_0xB0_IsoTableData(ucRspData, iRspLen, iError));
07038 }
07039 else if(iError == 0x95)
07040 {
07041 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_LAST_STATE, (unsigned char)iError));
07042 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_B0_ISO_ERROR, ucRspData[0]));
07043 }
07044 else
07045 {
07046 if(iTaskID == FEDM_TASKID_EVERY_NEW_TAG)
07047 ResetTable(FEDM_ISC_ISO_TABLE);
07048
07049
07050 FEDM_CHK6(iErr, Set_0xB0_IsoTableData(ucRspData, iRspLen, iError));
07051 }
07052 }
07053 }
07054
07055
07056
07057 switch(m_TaskInit.uiFlag)
07058 {
07059 case FEDM_TASKCB1:
07060 if(m_TaskInit.cbFct1 != NULL)
07061 m_TaskInit.cbFct1(m_TaskInit.pAny, iError, 0xB0);
07062 break;
07063
07064 #ifdef _FEDM_WINDOWS
07065 case FEDM_TASKCB_NET1:
07066 if(m_TaskInit.cbFctNET1 != NULL)
07067 m_TaskInit.cbFctNET1(iError, 0x0B);
07068 break;
07069 #endif
07070 }
07071 }
07072
07073
07074
07075
07076
07077
07078
07079
07080
07081
07082
07083
07084
07085
07086
07087
07088
07089
07090
07091 void FEDM_ISCReaderModule::cbNewNotify( int iReaderHnd,
07092 int iTaskID,
07093 int iError,
07094 unsigned char* ucRspData,
07095 int iRspLen,
07096 char* cIPAdr,
07097 int iPortNr )
07098 {
07099 int iErr = 0;
07100 unsigned int uiRecSets = 0;
07101 int iFirstByte = 0;
07102 unsigned int uiIP[4];
07103 unsigned char ucIP[4];
07104
07105 memset(uiIP, 0, 4*sizeof(unsigned int));
07106 memset (ucIP, 0, 4*sizeof(unsigned char));
07107
07108 if(iReaderHnd != GetReaderHnd())
07109 return;
07110
07111 SetLastError(iError);
07112
07113
07114 if( iError==0x00 ||
07115 iError==0x83 ||
07116 iError==0x84 ||
07117 iError==0x85 ||
07118 iError==0x90 ||
07119 iError==0x93 ||
07120 iError==0x94 )
07121 {
07122
07123 if(iRspLen <= 0)
07124 {
07125
07126 m_uiBRMTableLength = 0;
07127 }
07128 else
07129 {
07130 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_ADV_BRM_TRDATA1, ucRspData[0]));
07131
07132 if(ucRspData[0] & 0x80)
07133 {
07134 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_ADV_BRM_TRDATA2, ucRspData[1]));
07135 uiRecSets = (ucRspData[2] << 8) + ucRspData[3];
07136 iFirstByte = 4;
07137 }
07138 else
07139 {
07140 uiRecSets = (ucRspData[1] << 8) + ucRspData[2];
07141 iFirstByte = 3;
07142 }
07143
07144
07145 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_ADV_BRM_RECSETS, uiRecSets));
07146
07147 if(uiRecSets == 0)
07148 {
07149
07150 m_uiBRMTableLength = 0;
07151
07152 return;
07153 }
07154
07155
07156 FEDM_CHK6(iErr, SetBrmTableData(0x22, &ucRspData[iFirstByte]));
07157 }
07158 }
07159 else
07160 {
07161
07162 m_uiBRMTableLength = 0;
07163
07164
07165 }
07166
07167
07168 switch(m_TaskInit.uiFlag)
07169 {
07170 case FEDM_TASKCB1:
07171 if(m_TaskInit.cbFct1 != NULL)
07172 m_TaskInit.cbFct1(m_TaskInit.pAny, iError, 0x22);
07173 break;
07174
07175 case FEDM_TASKCB2:
07176 if(m_TaskInit.cbFct2 != NULL)
07177 {
07178 sscanf(cIPAdr, "%u.%u.%u.%u", &uiIP[0], &uiIP[1], &uiIP[2], &uiIP[3]);
07179 ucIP[0] = (uiIP[0] & 0x000000FF);
07180 ucIP[1] = (uiIP[1] & 0x000000FF);
07181 ucIP[2] = (uiIP[2] & 0x000000FF);
07182 ucIP[3] = (uiIP[3] & 0x000000FF);
07183 SetData(FEDM_ISC_TMP_NTF_REMOTE_IP_ADR, ucIP, 4);
07184 SetData(FEDM_ISC_TMP_NTF_IP_PORT_NR, (unsigned int)iPortNr);
07185 m_TaskInit.cbFct2(m_TaskInit.pAny, iError, 0x22, cIPAdr, iPortNr);
07186 }
07187 break;
07188
07189 #ifdef _FEDM_WINDOWS
07190 case FEDM_TASKCB_NET1:
07191 if(m_TaskInit.cbFctNET1 != NULL)
07192 {
07193 sscanf(cIPAdr, "%u.%u.%u.%u", &uiIP[0], &uiIP[1], &uiIP[2], &uiIP[3]);
07194 ucIP[0] = (uiIP[0] & 0x000000FF);
07195 ucIP[1] = (uiIP[1] & 0x000000FF);
07196 ucIP[2] = (uiIP[2] & 0x000000FF);
07197 ucIP[3] = (uiIP[3] & 0x000000FF);
07198 SetData(FEDM_ISC_TMP_NTF_REMOTE_IP_ADR, ucIP, 4);
07199 SetData(FEDM_ISC_TMP_NTF_IP_PORT_NR, (unsigned int)iPortNr);
07200 m_TaskInit.cbFctNET1(iError, 0x22);
07201 }
07202 break;
07203 #endif
07204 }
07205 }
07206
07207
07208
07209
07210
07211
07212
07213
07214
07215
07216
07217
07218
07219
07220
07221
07222
07223
07224
07225
07226
07227
07228 void FEDM_ISCReaderModule::cbNewReaderDiagnostic( int iReaderHnd,
07229 int iTaskID,
07230 int iError,
07231 unsigned char* ucRspData,
07232 int iRspLen,
07233 char* cIPAdr,
07234 int iPortNr )
07235 {
07236 unsigned char ucRecCount = 0;
07237 unsigned char ucData[31];
07238 int iErr = 0;
07239 int iAddr = 0;
07240 int iToRead = 0;
07241 unsigned int uiReaderType = 0;
07242 unsigned int uiRecCount = 0;
07243 unsigned int uiIP[4];
07244 unsigned char ucIP[4];
07245
07246 memset(uiIP, 0, 4*sizeof(unsigned int));
07247 memset (ucIP, 0, 4*sizeof(unsigned char));
07248
07249
07250 if(iReaderHnd != GetReaderHnd())
07251 return;
07252
07253 SetLastError(iError);
07254
07255
07256
07257 if( iError==0x00 ||
07258 iError==0x84 )
07259 {
07260 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_0x6E_NTF_RSP_REC_COUNT, (unsigned char)0x00));
07261 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0x00));
07262
07263 if(iRspLen > 0 && iRspLen < 32)
07264 {
07265 memset(ucData, 0, 31);
07266
07267 if(iRspLen == 2)
07268 {
07269
07270 memcpy(ucData, ucRspData, 2);
07271
07272
07273 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0x01));
07274 }
07275 else if(iRspLen == 6)
07276 {
07277
07278 memcpy(ucData, ucRspData, 6);
07279
07280
07281 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0x06));
07282 }
07283 else
07284 {
07285
07286
07287 memcpy(ucData, &ucRspData[1], iRspLen-1);
07288
07289
07290 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_DIAG_MODE, ucRspData[0]));
07291 }
07292
07293
07294 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_DIAG_DATA, ucData, 31));
07295 }
07296 else if(iRspLen >= 36)
07297 {
07298
07299 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_0x6E_NTF_RSP_READER_TYPE, &ucRspData[0], 4));
07300 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_DIAG_MODE, (unsigned char)0xFF));
07301
07302 ucRecCount = ucRspData[4];
07303
07304 iAddr = FEDM_GetAdrOfID(FEDM_ISC_TMP_0x6E_NTF_RSP_DATA, 32);
07305 iToRead = iRspLen;
07306
07307 for(unsigned char ucCnt=0; ucCnt<ucRecCount; ucCnt++)
07308 {
07309 if(iToRead < 31)
07310 break;
07311
07312 memset(ucData, 0, 31);
07313 memcpy(ucData, &ucRspData[5+ucCnt*31], 31);
07314
07315 if(iAddr >= FEDM_ISC_MAX_TMPDATA_MEM-31)
07316 break;
07317
07318 SetData( iAddr, ucData, 31, FEDM_TMPDATA_MEM );
07319
07320 iAddr += 31;
07321 iToRead -= 31;
07322 uiRecCount++;
07323 }
07324 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_0x6E_NTF_RSP_REC_COUNT, uiRecCount));
07325 }
07326 }
07327
07328
07329 switch(m_TaskInit.uiFlag)
07330 {
07331 case FEDM_TASKCB1:
07332 if(m_TaskInit.cbFct1 != NULL)
07333 m_TaskInit.cbFct1(m_TaskInit.pAny, iError, 0x6E);
07334 break;
07335
07336 case FEDM_TASKCB2:
07337 if(m_TaskInit.cbFct2 != NULL)
07338 {
07339 sscanf(cIPAdr, "%u.%u.%u.%u", &uiIP[0], &uiIP[1], &uiIP[2], &uiIP[3]);
07340 ucIP[0] = (uiIP[0] & 0x000000FF);
07341 ucIP[1] = (uiIP[1] & 0x000000FF);
07342 ucIP[2] = (uiIP[2] & 0x000000FF);
07343 ucIP[3] = (uiIP[3] & 0x000000FF);
07344 SetData(FEDM_ISC_TMP_NTF_REMOTE_IP_ADR, ucIP, 4);
07345 SetData(FEDM_ISC_TMP_NTF_IP_PORT_NR, (unsigned int)iPortNr);
07346 m_TaskInit.cbFct2(m_TaskInit.pAny, iError, 0x6E, cIPAdr, iPortNr);
07347 }
07348 break;
07349
07350 #ifdef _FEDM_WINDOWS
07351 case FEDM_TASKCB_NET1:
07352 if(m_TaskInit.cbFctNET1 != NULL)
07353 {
07354 sscanf(cIPAdr, "%u.%u.%u.%u", &uiIP[0], &uiIP[1], &uiIP[2], &uiIP[3]);
07355 ucIP[0] = (uiIP[0] & 0x000000FF);
07356 ucIP[1] = (uiIP[1] & 0x000000FF);
07357 ucIP[2] = (uiIP[2] & 0x000000FF);
07358 ucIP[3] = (uiIP[3] & 0x000000FF);
07359 SetData(FEDM_ISC_TMP_NTF_REMOTE_IP_ADR, ucIP, 4);
07360 SetData(FEDM_ISC_TMP_NTF_IP_PORT_NR, (unsigned int)iPortNr);
07361 m_TaskInit.cbFctNET1(iError, 0x6E);
07362 }
07363 break;
07364 #endif
07365 }
07366 }
07367
07368
07369
07370
07371
07372
07373
07374
07375
07376
07377
07378
07379
07380
07381
07382
07383
07384
07385
07386 void FEDM_ISCReaderModule::cbNewInputEvent( int iReaderHnd,
07387 int iTaskID,
07388 int iError,
07389 unsigned char* ucRspData,
07390 int iRspLen,
07391 char* cIPAdr,
07392 int iPortNr )
07393 {
07394 int iErr = 0;
07395 unsigned int uiIP[4];
07396 unsigned char ucIP[4];
07397
07398 memset(uiIP, 0, 4*sizeof(unsigned int));
07399 memset (ucIP, 0, 4*sizeof(unsigned char));
07400
07401 if(iReaderHnd != GetReaderHnd())
07402 return;
07403
07404 SetLastError(iError);
07405
07406
07407 if( iError==0x00 )
07408 {
07409
07410 if(iRspLen <= 0)
07411 {
07412
07413 m_uiBRMTableLength = 0;
07414 }
07415 else
07416 {
07417 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_ADV_BRM_TRDATA1, (unsigned char)0x80));
07418 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_ADV_BRM_TRDATA2, (unsigned char)0x01));
07419 FEDM_CHK6(iErr, SetData(FEDM_ISC_TMP_ADV_BRM_RECSETS, (unsigned int)1));
07420
07421
07422 FEDM_CHK6(iErr, SetBrmTableData(0x74, ucRspData));
07423 }
07424 }
07425 else
07426 {
07427
07428 m_uiBRMTableLength = 0;
07429
07430
07431 }
07432
07433
07434 switch(m_TaskInit.uiFlag)
07435 {
07436 case FEDM_TASKCB1:
07437 if(m_TaskInit.cbFct1 != NULL)
07438 m_TaskInit.cbFct1(m_TaskInit.pAny, iError, 0x22);
07439 break;
07440
07441 case FEDM_TASKCB2:
07442 if(m_TaskInit.cbFct2 != NULL)
07443 {
07444 sscanf(cIPAdr, "%u.%u.%u.%u", &uiIP[0], &uiIP[1], &uiIP[2], &uiIP[3]);
07445 ucIP[0] = (uiIP[0] & 0x000000FF);
07446 ucIP[1] = (uiIP[1] & 0x000000FF);
07447 ucIP[2] = (uiIP[2] & 0x000000FF);
07448 ucIP[3] = (uiIP[3] & 0x000000FF);
07449 SetData(FEDM_ISC_TMP_NTF_REMOTE_IP_ADR, ucIP, 4);
07450 SetData(FEDM_ISC_TMP_NTF_IP_PORT_NR, (unsigned int)iPortNr);
07451 m_TaskInit.cbFct2(m_TaskInit.pAny, iError, 0x22, cIPAdr, iPortNr);
07452 }
07453 break;
07454
07455 #ifdef _FEDM_WINDOWS
07456 case FEDM_TASKCB_NET1:
07457 if(m_TaskInit.cbFctNET1 != NULL)
07458 {
07459 sscanf(cIPAdr, "%u.%u.%u.%u", &uiIP[0], &uiIP[1], &uiIP[2], &uiIP[3]);
07460 ucIP[0] = (uiIP[0] & 0x000000FF);
07461 ucIP[1] = (uiIP[1] & 0x000000FF);
07462 ucIP[2] = (uiIP[2] & 0x000000FF);
07463 ucIP[3] = (uiIP[3] & 0x000000FF);
07464 SetData(FEDM_ISC_TMP_NTF_REMOTE_IP_ADR, ucIP, 4);
07465 SetData(FEDM_ISC_TMP_NTF_IP_PORT_NR, (unsigned int)iPortNr);
07466 m_TaskInit.cbFctNET1(iError, 0x22);
07467 }
07468 break;
07469 #endif
07470 }
07471 }
07472
07473
07474
07475
07476
07477
07478
07479
07480
07481
07482
07483
07484
07485
07486
07487
07488
07489
07490 void FEDM_ISCReaderModule::cbNewNotifyFromPeopleCounter( int iReaderHnd,
07491 int iTaskID,
07492 int iError,
07493 unsigned char* ucRspData,
07494 int iRspLen,
07495 char* cIPAdr,
07496 int iPortNr )
07497 {
07498
07499
07500 unsigned int uiIP[4];
07501 unsigned char ucIP[4];
07502
07503 memset(uiIP, 0, 4*sizeof(unsigned int));
07504 memset (ucIP, 0, 4*sizeof(unsigned char));
07505
07506
07507 if(iReaderHnd != GetReaderHnd())
07508 return;
07509
07510 SetLastError(iError);
07511
07512 if(iRspLen < 17)
07513 return;
07514
07515
07516
07517 if(iError == 0)
07518 {
07519 unsigned int uiCnt1 = ucRspData[3] | ucRspData [2] << 8 | ucRspData[1] << 16 | ucRspData[0] << 24;
07520 unsigned int uiCnt2 = ucRspData[7] | ucRspData [6] << 8 | ucRspData[5] << 16 | ucRspData[4] << 24;
07521 unsigned int uiCnt3 = ucRspData[11] | ucRspData [10] << 8 | ucRspData[9] << 16 | ucRspData[8] << 24;
07522 unsigned int uiCnt4 = ucRspData[15] | ucRspData [14] << 8 | ucRspData[13] << 16 | ucRspData[12] << 24;
07523
07524 SetData(FEDM_ISC_TMP_77_COUNTER1, uiCnt1);
07525 SetData(FEDM_ISC_TMP_77_COUNTER2, uiCnt2);
07526 SetData(FEDM_ISC_TMP_77_COUNTER3, uiCnt3);
07527 SetData(FEDM_ISC_TMP_77_COUNTER4, uiCnt4);
07528 SetData(FEDM_ISC_TMP_77_BUS_ADDR, ucRspData[16]);
07529 }
07530
07531
07532 switch(m_TaskInit.uiFlag)
07533 {
07534 case FEDM_TASKCB1:
07535 if(m_TaskInit.cbFct1 != NULL)
07536 m_TaskInit.cbFct1(m_TaskInit.pAny, iError, 0x77);
07537 break;
07538
07539 case FEDM_TASKCB2:
07540 if(m_TaskInit.cbFct2 != NULL)
07541 {
07542 sscanf(cIPAdr, "%u.%u.%u.%u", &uiIP[0], &uiIP[1], &uiIP[2], &uiIP[3]);
07543 ucIP[0] = (uiIP[0] & 0x000000FF);
07544 ucIP[1] = (uiIP[1] & 0x000000FF);
07545 ucIP[2] = (uiIP[2] & 0x000000FF);
07546 ucIP[3] = (uiIP[3] & 0x000000FF);
07547 SetData(FEDM_ISC_TMP_NTF_REMOTE_IP_ADR, ucIP, 4);
07548 SetData(FEDM_ISC_TMP_NTF_IP_PORT_NR, (unsigned int)iPortNr);
07549 m_TaskInit.cbFct2(m_TaskInit.pAny, iError, 0x77, cIPAdr, iPortNr);
07550 }
07551 break;
07552
07553 #ifdef _FEDM_WINDOWS
07554 case FEDM_TASKCB_NET1:
07555 if(m_TaskInit.cbFctNET1 != NULL)
07556 {
07557 sscanf(cIPAdr, "%u.%u.%u.%u", &uiIP[0], &uiIP[1], &uiIP[2], &uiIP[3]);
07558 ucIP[0] = (uiIP[0] & 0x000000FF);
07559 ucIP[1] = (uiIP[1] & 0x000000FF);
07560 ucIP[2] = (uiIP[2] & 0x000000FF);
07561 ucIP[3] = (uiIP[3] & 0x000000FF);
07562 SetData(FEDM_ISC_TMP_NTF_REMOTE_IP_ADR, ucIP, 4);
07563 SetData(FEDM_ISC_TMP_NTF_IP_PORT_NR, (unsigned int)iPortNr);
07564 m_TaskInit.cbFctNET1(iError, 0x77);
07565 }
07566 break;
07567 #endif
07568 }
07569 }