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 #include "FEDM_DataBase.h"
00061 #include "FEDM_Functions.h"
00062 #include "FEDM_XmlReaderCfgDataModul.h"
00063 #include "FEDM_XmlReaderCfgProfileModul.h"
00064 #include "i_scan/FEDM_ISC.h"
00065
00066 #if _MSC_VER >= 1400
00067 #pragma warning(disable : 4996)
00068 #endif
00069
00070
00071 #if defined(_FEDM_ISC_CORE_DLL) || defined(_FEDM_ISC_CORE_LIB) || defined(_OBIDISC4J_DLL) || (defined(_FEDM_NO_DLL) && defined(_FELOGMNG_SUPPORT))
00072
00073 int g_iInstallCounter = 0;
00074 #endif
00075
00076
00077
00078
00079
00080
00081 FEDM_DataBase::FEDM_DataBase()
00082 {
00083 m_iReaderHnd = 0;
00084 m_ucBusAdr = 0xFF;
00085
00086 m_sFamCode[0] = '\0';
00087 m_sReaderName[0] = '\0';
00088
00089 m_uiReaderType = 0;
00090
00091 m_iRFC_DataBlockSize = 16;
00092 m_iACC_DataBlockSize = 32;
00093 m_iPubMemBlockSize = 4;
00094
00095 m_iUsedEEDataBlocks = 0;
00096 m_iUsedRAMDataBlocks = 0;
00097 m_iUsedAccEEDataBlocks = 0;
00098 m_iUsedTmpDataBlocks = 0;
00099 m_iUsedMjpDataBlocks = 0;
00100 m_iUsedSNMemBlocks = 0;
00101 m_iUsedIDMemBlocks = 0;
00102 m_iUsedACMemBlocks = 0;
00103 m_iUsedPubMemBlocks = 0;
00104 m_iUsedSecMemBlocks = 0;
00105 m_iUsedConfMemBlocks = 0;
00106 m_iUsedDateMemBlocks = 0;
00107
00108 #if defined(_FEDM_ISC_CORE_DLL) || defined(_OBIDISC4J_DLL) || (defined(_FEDM_NO_DLL) && defined(_FELOGMNG_SUPPORT))
00109 g_iInstallCounter++;
00110 if(g_iInstallCounter > 0x0FFFFFFF)
00111 g_iInstallCounter = 1;
00112
00113 m_iModuleHnd = g_iInstallCounter;
00114 #else
00115 m_iModuleHnd = 0;
00116 #endif
00117
00118
00119 #ifdef _FELOGMNG_SUPPORT
00120
00121 string sVersion = "FEDM V";
00122 sVersion += FEDM_VERSION;
00123 sVersion += " from ";
00124 sVersion += __DATE__;
00125 sVersion += " loaded";
00126 m_pLogger = new FEDM_Logger(FELOGMNG_SRC_FEDM_CORE, g_iInstallCounter, sVersion);
00127 if(m_pLogger != NULL)
00128 {
00129 if(m_pLogger->m_pLib == NULL)
00130 {
00131 delete m_pLogger;
00132 m_pLogger = NULL;
00133 }
00134 }
00135 #else
00136 m_pLogger = NULL;
00137 #endif
00138 }
00139
00140 FEDM_DataBase::~FEDM_DataBase()
00141 {
00142 #ifdef _FELOGMNG_SUPPORT
00143 if(m_pLogger != NULL)
00144 {
00145 delete m_pLogger;
00146 m_pLogger = NULL;
00147 }
00148 #endif
00149 }
00150
00151
00152
00153
00154
00155
00156 int FEDM_DataBase::GetReaderHnd()
00157 {
00158 return m_iReaderHnd;
00159 }
00160
00161
00162 void FEDM_DataBase::SetReaderHnd(int iReaderHnd)
00163 {
00164 m_iReaderHnd = iReaderHnd;
00165 }
00166
00167
00168 void FEDM_DataBase::SetBusAddress(unsigned char ucBusAdr)
00169 {
00170 m_ucBusAdr = ucBusAdr;
00171 }
00172
00173 void FEDM_DataBase::SetModuleHnd(int iHnd)
00174 {
00175 m_iModuleHnd = iHnd;
00176 }
00177
00178 int FEDM_DataBase::GetModuleHnd()
00179 {
00180 return m_iModuleHnd;
00181 }
00182
00183
00184
00185
00186
00187
00188 unsigned char FEDM_DataBase::GetBusAddress()
00189 {
00190 return m_ucBusAdr;
00191 }
00192
00193 char* FEDM_DataBase::GetFamilyCode()
00194 {
00195 return m_sFamCode;
00196 }
00197
00198 char* FEDM_DataBase::GetReaderName()
00199 {
00200 return m_sReaderName;
00201 }
00202
00203 unsigned int FEDM_DataBase::GetReaderType()
00204 {
00205 return m_uiReaderType;
00206 }
00207
00208
00209 int FEDM_DataBase::GetAccessID(string sParaName, string& sAccessID, bool bEEPROM)
00210 {
00211 FEDM_MAP_ACCESS_ID_ITOR itor;
00212
00213 itor = m_mapAccessID.find(sParaName);
00214 if(itor == m_mapAccessID.end())
00215 {
00216 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ParaName=" << sParaName.c_str() << ", .., ..)" << GetErrorText(FEDM_ERROR_UNSUPPORTED_NAMESPACE));
00217 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED_NAMESPACE);
00218 }
00219
00220 sAccessID = itor->second;
00221
00222 if(! bEEPROM)
00223 sAccessID = FEDM_ToRAM(sAccessID.c_str());
00224
00225 return FEDM_OK;
00226 }
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250 int FEDM_DataBase::Serialize(FEDM_XMLReaderCfgDataModul* xml,
00251 bool bRead,
00252 char* sFileName)
00253 {
00254 #ifdef _FEDM_XML_SUPPORT
00255 if(bRead)
00256 return xml->SerializeIn(this, sFileName);
00257 else
00258 return xml->SerializeOut(this, sFileName);
00259 #else
00260 return FEDM_ERROR_UNSUPPORTED;
00261 #endif
00262 }
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278 int FEDM_DataBase::SerializeIn( int iMemType,
00279 FEDM_XMLBase* xml,
00280 FEDM_XML_TREEITEM* root)
00281 {
00282 #ifdef _FEDM_XML_SUPPORT
00283 FEDM_CHK3(root);
00284
00285 bool bMarkAsRead = false;
00286 int iFirstBlock = 0;
00287 int iMaxBlocks = 0;
00288 int iBlockSize = 0;
00289 size_t iArraySize = 0;
00290 char cAttribute[5];
00291 unsigned char ucValue;
00292 wstring sTag;
00293 string sAttribute1;
00294 string sAttribute2;
00295 string sValue;
00296 wstring wsAttribute;
00297 wstring wsValue;
00298 wchar_t wcValue[5];
00299 FEDM_XML_TREEITEM* child = NULL;
00300 FEDM_XML_TREEITEM* parent = NULL;
00301 FEDM_BYTE_ARRAY_ITOR itor;
00302
00303 switch(iMemType)
00304 {
00305
00306 case FEDM_RFC_EEDATA_MEM:
00307 child = xml->FindTag( FEDM_XML_TAG_DATA_ARRAY_UC,
00308 FEDM_XML_ATTRIB_NAME_UC,
00309 FEDM_XML_STRING_EEPROM_DATA_UC,
00310 false,
00311 true);
00312 if(child == NULL)
00313 return xml->GetLastError();
00314
00315 parent = child;
00316 itor = m_RFC_EEData.begin();
00317 iArraySize = m_RFC_EEData.capacity();
00318 bMarkAsRead = true;
00319 break;
00320
00321
00322 case FEDM_RFC_RAMDATA_MEM:
00323 child = xml->FindTag( FEDM_XML_TAG_DATA_ARRAY_UC,
00324 FEDM_XML_ATTRIB_NAME_UC,
00325 FEDM_XML_STRING_RAM_DATA_UC,
00326 false,
00327 true);
00328 if(child == NULL)
00329 return xml->GetLastError();
00330
00331 parent = child;
00332 itor = m_RFC_RAMData.begin();
00333 iArraySize = m_RFC_RAMData.capacity();
00334 bMarkAsRead = true;
00335 break;
00336
00337 case FEDM_ACC_EEDATA_MEM:
00338 iFirstBlock = 64;
00339 child = xml->FindTag( FEDM_XML_TAG_DATA_ARRAY_UC,
00340 FEDM_XML_ATTRIB_NAME_UC,
00341 FEDM_XML_STRING_ACC_EEPROM_DATA_UC,
00342 false,
00343 true);
00344 if(child == NULL)
00345 return xml->GetLastError();
00346
00347 parent = child;
00348 itor = m_ACC_EEData.begin();
00349 iArraySize = m_ACC_EEData.capacity();
00350 bMarkAsRead = true;
00351 break;
00352
00353 case FEDM_ACC_RAMDATA_MEM:
00354 iFirstBlock = 64;
00355 child = xml->FindTag( FEDM_XML_TAG_DATA_ARRAY_UC,
00356 FEDM_XML_ATTRIB_NAME_UC,
00357 FEDM_XML_STRING_ACC_RAM_DATA_UC,
00358 false,
00359 true);
00360 if(child == NULL)
00361 return xml->GetLastError();
00362
00363 parent = child;
00364 itor = m_ACC_RAMData.begin();
00365 iArraySize = m_ACC_RAMData.capacity();
00366 bMarkAsRead = true;
00367 break;
00368
00369
00370 case FEDM_TMPDATA_MEM:
00371 child = xml->FindTag( FEDM_XML_TAG_DATA_ARRAY_UC,
00372 FEDM_XML_ATTRIB_NAME_UC,
00373 FEDM_XML_STRING_TMP_DATA_UC,
00374 false,
00375 true);
00376 if(child == NULL)
00377 return xml->GetLastError();
00378
00379 parent = child;
00380 itor = m_TmpData.begin();
00381 iArraySize = m_TmpData.capacity();
00382 break;
00383
00384
00385 case FEDM_MJPDATA_MEM:
00386 child = xml->FindTag( FEDM_XML_TAG_DATA_ARRAY_UC,
00387 FEDM_XML_ATTRIB_NAME_UC,
00388 FEDM_XML_STRING_MJP_DATA_UC,
00389 false,
00390 true);
00391 if(child == NULL)
00392 return xml->GetLastError();
00393
00394 parent = child;
00395 itor = m_MjpData.begin();
00396 iArraySize = m_MjpData.capacity();
00397 break;
00398
00399
00400 case FEDM_SN_MEM:
00401 child = xml->FindTag( FEDM_XML_TAG_DATA_ARRAY_UC,
00402 FEDM_XML_ATTRIB_NAME_UC,
00403 FEDM_XML_STRING_SN_DATA_UC,
00404 false,
00405 true);
00406 if(child == NULL)
00407 return xml->GetLastError();
00408
00409 parent = child;
00410 itor = m_SN_Mem.begin();
00411 iArraySize = m_SN_Mem.capacity();
00412 break;
00413
00414
00415 case FEDM_ID_MEM:
00416 child = xml->FindTag( FEDM_XML_TAG_DATA_ARRAY_UC,
00417 FEDM_XML_ATTRIB_NAME_UC,
00418 FEDM_XML_STRING_ID_DATA_UC,
00419 false,
00420 true);
00421 if(child == NULL)
00422 return xml->GetLastError();
00423
00424 parent = child;
00425 itor = m_ID_Mem.begin();
00426 iArraySize = m_ID_Mem.capacity();
00427 break;
00428
00429
00430 case FEDM_AC_MEM:
00431 child = xml->FindTag( FEDM_XML_TAG_DATA_ARRAY_UC,
00432 FEDM_XML_ATTRIB_NAME_UC,
00433 FEDM_XML_STRING_AC_DATA_UC,
00434 false,
00435 true);
00436 if(child == NULL)
00437 return xml->GetLastError();
00438
00439 parent = child;
00440 itor = m_AC_Mem.begin();
00441 iArraySize = m_AC_Mem.capacity();
00442 break;
00443
00444
00445 case FEDM_PUB_MEM:
00446 child = xml->FindTag( FEDM_XML_TAG_DATA_ARRAY_UC,
00447 FEDM_XML_ATTRIB_NAME_UC,
00448 FEDM_XML_STRING_PUB_MEM_UC,
00449 false,
00450 true);
00451 if(child == NULL)
00452 return xml->GetLastError();
00453
00454 parent = child;
00455 itor = m_PubMem.begin();
00456 iArraySize = m_PubMem.capacity();
00457 break;
00458
00459
00460 case FEDM_SEC_MEM:
00461 child = xml->FindTag( FEDM_XML_TAG_DATA_ARRAY_UC,
00462 FEDM_XML_ATTRIB_NAME_UC,
00463 FEDM_XML_STRING_SEC_MEM_UC,
00464 false,
00465 true);
00466 if(child == NULL)
00467 return xml->GetLastError();
00468
00469 parent = child;
00470 itor = m_SecMem.begin();
00471 iArraySize = m_SecMem.capacity();
00472 break;
00473
00474
00475 case FEDM_CONF_MEM:
00476 child = xml->FindTag( FEDM_XML_TAG_DATA_ARRAY_UC,
00477 FEDM_XML_ATTRIB_NAME_UC,
00478 FEDM_XML_STRING_CFG_MEM_UC,
00479 false,
00480 true);
00481 if(child == NULL)
00482 return xml->GetLastError();
00483
00484 parent = child;
00485 itor = m_ConfMem.begin();
00486 iArraySize = m_ConfMem.capacity();
00487 break;
00488
00489
00490 case FEDM_DATE_MEM:
00491 child = xml->FindTag( FEDM_XML_TAG_DATA_ARRAY_UC,
00492 FEDM_XML_ATTRIB_NAME_UC,
00493 FEDM_XML_STRING_DATE_MEM_UC,
00494 false,
00495 true);
00496 if(child == NULL)
00497 return xml->GetLastError();
00498
00499 parent = child;
00500 itor = m_DateMem.begin();
00501 iArraySize = m_DateMem.capacity();
00502 break;
00503
00504 default:
00505 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00506 }
00507
00508
00509 xml->GetTagAttrib(parent, 1, wsAttribute, wsValue);
00510 if(wsAttribute == FEDM_XML_ATTRIB_BLOCKS_UC)
00511 {
00512 #if defined(_FEDM_SUPPORT_UCLINUX)
00513 char buf[10];
00514 FEDM_SWSCANF(wsValue.c_str(), buf);
00515 iMaxBlocks = atoi(buf);
00516 #else
00517 swscanf(wsValue.c_str(), L"%d", &iMaxBlocks);
00518 #endif
00519 if(iMaxBlocks <= 0)
00520 {
00521 delete child;
00522 FEDM_RETURN(FEDM_XML_ERROR_NO_TAG_ATTRIBUTE);
00523 }
00524 }
00525
00526
00527 xml->GetTagAttrib(parent, 2, wsAttribute, wsValue);
00528 if(wsAttribute == FEDM_XML_ATTRIB_SIZE_UC)
00529 {
00530 #if defined(_FEDM_SUPPORT_UCLINUX)
00531 char buf[10];
00532 FEDM_SWSCANF(wsValue.c_str(), buf);
00533 iBlockSize = atoi(buf);
00534 #else
00535 swscanf(wsValue.c_str(), L"%d", &iBlockSize);
00536 #endif
00537 if(iBlockSize != 32 && iBlockSize != 16 && iBlockSize != 4)
00538 {
00539 delete child;
00540 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00541 }
00542 }
00543
00544 if(iMaxBlocks * iBlockSize > (int)iArraySize)
00545 {
00546 delete child;
00547 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00548 }
00549
00550 xml->AddTagItem(root, child);
00551
00552
00553 for(int iBlock=0; iBlock<iMaxBlocks; ++iBlock)
00554 {
00555 #if defined(_MSC_VER) || defined(__BORLANDC__)
00556 swprintf(wcValue, L"%d", iBlock);
00557 #else
00558 swprintf(wcValue, 5, L"%d", iBlock);
00559 #endif
00560 if( iMemType == FEDM_RFC_EEDATA_MEM ||
00561 iMemType == FEDM_RFC_RAMDATA_MEM ||
00562 iMemType == FEDM_ACC_EEDATA_MEM ||
00563 iMemType == FEDM_ACC_RAMDATA_MEM )
00564 {
00565 sTag = FEDM_XML_TAG_CFG_UC;
00566 }
00567 else
00568 {
00569 sTag = FEDM_XML_TAG_DATA_UC;
00570 }
00571 sTag += wcValue;
00572 child = xml->FindTag(sTag, true, false);
00573 if(child == NULL)
00574 {
00575 itor += iBlockSize;
00576 continue;
00577
00578
00579 }
00580
00581 xml->AddTagItem(parent, child);
00582
00583
00584 for(int iByte=0; iByte<iBlockSize; ++iByte)
00585 {
00586 xml->GetTagAttrib(child, iByte, sAttribute1, sValue);
00587
00588 sprintf(cAttribute, "b%d", iByte);
00589 sAttribute2 = cAttribute;
00590 FEDM_ConvHexStrToHexUChar((string)sValue.c_str(), &ucValue, 1);
00591
00592 if(sAttribute1.c_str() == sAttribute2)
00593 {
00594 if(iByte==(iBlockSize-1) && bMarkAsRead)
00595 {
00596 (*itor) = 0x03;
00597
00598 }
00599 else
00600 {
00601 (*itor) = ucValue;
00602 }
00603 }
00604 itor++;
00605 }
00606 }
00607
00608 return FEDM_OK;
00609 #else
00610 return FEDM_ERROR_UNSUPPORTED;
00611 #endif
00612 }
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630 int FEDM_DataBase::SerializeOut( int iMemType,
00631 FEDM_XMLBase* xml,
00632 FEDM_XML_TREEITEM* root )
00633 {
00634 #ifdef _FEDM_XML_SUPPORT
00635 FEDM_CHK3(root);
00636
00637 int iFirstBlock = 0;
00638 int iMaxBlocks = 0;
00639 int iBlockSize = 16;
00640 int iTmpDataBlockSize = 32;
00641
00642 wstring str;
00643 wchar_t wcValue[5];
00644 wchar_t wcAttrib[5];
00645 FEDM_XML_TREEITEM* parent = NULL;
00646 FEDM_XML_TREEITEM* child = NULL;
00647 FEDM_BYTE_ARRAY_ITOR itor;
00648
00649 child = xml->BuildTag(FEDM_XML_TAG_DATA_ARRAY_UC);
00650 if(child == NULL)
00651 {
00652 xml->CloseDoc();
00653 return xml->GetLastError();
00654 }
00655
00656 switch(iMemType)
00657 {
00658
00659 case FEDM_RFC_EEDATA_MEM:
00660 iMaxBlocks = m_iUsedEEDataBlocks;
00661 iBlockSize = m_iRFC_DataBlockSize;
00662 if(iMaxBlocks == 0 || iMaxBlocks*iBlockSize > (int)m_RFC_EEData.capacity())
00663 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00664 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_NAME_UC, FEDM_XML_STRING_EEPROM_DATA_UC);
00665 #if defined(_MSC_VER) || defined(__BORLANDC__)
00666 swprintf(wcValue, L"%d", iMaxBlocks);
00667 #else
00668 swprintf(wcValue, 5, L"%d", iMaxBlocks);
00669 #endif
00670 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_BLOCKS_UC, wcValue);
00671 #if defined(_MSC_VER) || defined(__BORLANDC__)
00672 swprintf(wcValue, L"%d", iBlockSize);
00673 #else
00674 swprintf(wcValue, 5, L"%d", m_iRFC_DataBlockSize);
00675 #endif
00676 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_SIZE_UC, wcValue);
00677 xml->AddTagItem(root, child);
00678 parent = child;
00679 itor = m_RFC_EEData.begin();
00680 break;
00681
00682
00683 case FEDM_RFC_RAMDATA_MEM:
00684 iMaxBlocks = m_iUsedRAMDataBlocks;
00685 iBlockSize = m_iRFC_DataBlockSize;
00686 if(iMaxBlocks == 0 || iMaxBlocks*iBlockSize > (int)m_RFC_RAMData.capacity())
00687 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00688 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_NAME_UC, FEDM_XML_STRING_RAM_DATA_UC);
00689 #if defined(_MSC_VER) || defined(__BORLANDC__)
00690 swprintf(wcValue, L"%d", iMaxBlocks);
00691 #else
00692 swprintf(wcValue, 5, L"%d", iMaxBlocks);
00693 #endif
00694 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_BLOCKS_UC, wcValue);
00695 #if defined(_MSC_VER) || defined(__BORLANDC__)
00696 swprintf(wcValue, L"%d", iBlockSize);
00697 #else
00698 swprintf(wcValue, 5, L"%d", m_iRFC_DataBlockSize);
00699 #endif
00700 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_SIZE_UC, wcValue);
00701 xml->AddTagItem(root, child);
00702 parent = child;
00703 itor = m_RFC_RAMData.begin();
00704 break;
00705
00706
00707 case FEDM_ACC_EEDATA_MEM:
00708 iFirstBlock = 64;
00709 iBlockSize = 32;
00710 iMaxBlocks = m_iUsedAccEEDataBlocks;
00711 if(iMaxBlocks == 0 || iMaxBlocks*iBlockSize > (int)m_ACC_EEData.capacity())
00712 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00713 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_NAME_UC, FEDM_XML_STRING_ACC_EEPROM_DATA_UC);
00714 #if defined(_MSC_VER) || defined(__BORLANDC__)
00715 swprintf(wcValue, L"%d", iMaxBlocks);
00716 #else
00717 swprintf(wcValue, 5, L"%d", iMaxBlocks);
00718 #endif
00719 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_BLOCKS_UC, wcValue);
00720 #if defined(_MSC_VER) || defined(__BORLANDC__)
00721 swprintf(wcValue, L"%d", iBlockSize);
00722 #else
00723 swprintf(wcValue, 5, L"%d", iBlockSize);
00724 #endif
00725 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_SIZE_UC, wcValue);
00726 xml->AddTagItem(root, child);
00727 parent = child;
00728 itor = m_ACC_EEData.begin();
00729 itor += iFirstBlock*iBlockSize;
00730 break;
00731
00732
00733 case FEDM_ACC_RAMDATA_MEM:
00734 iFirstBlock = 64;
00735 iBlockSize = 32;
00736 iMaxBlocks = m_iUsedAccRAMDataBlocks;
00737 if(iMaxBlocks == 0 || iMaxBlocks*iBlockSize > (int)m_ACC_RAMData.capacity())
00738 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00739 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_NAME_UC, FEDM_XML_STRING_ACC_RAM_DATA_UC);
00740 #if defined(_MSC_VER) || defined(__BORLANDC__)
00741 swprintf(wcValue, L"%d", iMaxBlocks);
00742 #else
00743 swprintf(wcValue, 5, L"%d", iMaxBlocks);
00744 #endif
00745 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_BLOCKS_UC, wcValue);
00746 #if defined(_MSC_VER) || defined(__BORLANDC__)
00747 swprintf(wcValue, L"%d", iBlockSize);
00748 #else
00749 swprintf(wcValue, 5, L"%d", iBlockSize);
00750 #endif
00751 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_SIZE_UC, wcValue);
00752 xml->AddTagItem(root, child);
00753 parent = child;
00754 itor = m_ACC_RAMData.begin();
00755 itor += iFirstBlock*iBlockSize;
00756 break;
00757
00758
00759 case FEDM_TMPDATA_MEM:
00760 iMaxBlocks = m_iUsedTmpDataBlocks;
00761 iBlockSize = iTmpDataBlockSize;
00762 if(iMaxBlocks == 0 || iMaxBlocks*iBlockSize > (int)m_TmpData.capacity())
00763 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00764 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_NAME_UC, FEDM_XML_STRING_TMP_DATA_UC);
00765 #if defined(_MSC_VER) || defined(__BORLANDC__)
00766 swprintf(wcValue, L"%d", iMaxBlocks);
00767 #else
00768 swprintf(wcValue, 5, L"%d", iMaxBlocks);
00769 #endif
00770 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_BLOCKS_UC, wcValue);
00771 #if defined(_MSC_VER) || defined(__BORLANDC__)
00772 swprintf(wcValue, L"%d", iBlockSize);
00773 #else
00774 swprintf(wcValue, 5, L"%d", iBlockSize);
00775 #endif
00776 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_SIZE_UC, wcValue);
00777 xml->AddTagItem(root, child);
00778 parent = child;
00779 itor = m_TmpData.begin();
00780 break;
00781
00782
00783 case FEDM_MJPDATA_MEM:
00784 iMaxBlocks = m_iUsedMjpDataBlocks;
00785 if(iMaxBlocks == 0 || iMaxBlocks*iBlockSize > (int)m_MjpData.capacity())
00786 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00787 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_NAME_UC, FEDM_XML_STRING_MJP_DATA_UC);
00788 #if defined(_MSC_VER) || defined(__BORLANDC__)
00789 swprintf(wcValue, L"%d", iMaxBlocks);
00790 #else
00791 swprintf(wcValue, 5, L"%d", iMaxBlocks);
00792 #endif
00793 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_BLOCKS_UC, wcValue);
00794 #if defined(_MSC_VER) || defined(__BORLANDC__)
00795 swprintf(wcValue, L"%d", iBlockSize);
00796 #else
00797 swprintf(wcValue, 5, L"%d", iBlockSize);
00798 #endif
00799 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_SIZE_UC, wcValue);
00800 xml->AddTagItem(root, child);
00801 parent = child;
00802 itor = m_MjpData.begin();
00803 break;
00804
00805
00806 case FEDM_SN_MEM:
00807 iMaxBlocks = m_iUsedSNMemBlocks;
00808 if(iMaxBlocks == 0 || iMaxBlocks*iBlockSize > (int)m_SN_Mem.capacity())
00809 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00810 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_NAME_UC, FEDM_XML_STRING_SN_DATA_UC);
00811 #if defined(_MSC_VER) || defined(__BORLANDC__)
00812 swprintf(wcValue, L"%d", iMaxBlocks);
00813 #else
00814 swprintf(wcValue, 5, L"%d", iMaxBlocks);
00815 #endif
00816 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_BLOCKS_UC, wcValue);
00817 #if defined(_MSC_VER) || defined(__BORLANDC__)
00818 swprintf(wcValue, L"%d", iBlockSize);
00819 #else
00820 swprintf(wcValue, 5, L"%d", iBlockSize);
00821 #endif
00822 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_SIZE_UC, wcValue);
00823 xml->AddTagItem(root, child);
00824 parent = child;
00825 itor = m_SN_Mem.begin();
00826 break;
00827
00828
00829 case FEDM_ID_MEM:
00830 iMaxBlocks = m_iUsedIDMemBlocks;
00831 if(iMaxBlocks == 0 || iMaxBlocks*iBlockSize > (int)m_ID_Mem.capacity())
00832 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00833 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_NAME_UC, FEDM_XML_STRING_ID_DATA_UC);
00834 #if defined(_MSC_VER) || defined(__BORLANDC__)
00835 swprintf(wcValue, L"%d", iMaxBlocks);
00836 #else
00837 swprintf(wcValue, 5, L"%d", iMaxBlocks);
00838 #endif
00839 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_BLOCKS_UC, wcValue);
00840 #if defined(_MSC_VER) || defined(__BORLANDC__)
00841 swprintf(wcValue, L"%d", iBlockSize);
00842 #else
00843 swprintf(wcValue, 5, L"%d", iBlockSize);
00844 #endif
00845 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_SIZE_UC, wcValue);
00846 xml->AddTagItem(root, child);
00847 parent = child;
00848 itor = m_ID_Mem.begin();
00849 break;
00850
00851
00852 case FEDM_AC_MEM:
00853 iMaxBlocks = m_iUsedACMemBlocks;
00854 if(iMaxBlocks == 0 || iMaxBlocks*iBlockSize > (int)m_AC_Mem.capacity())
00855 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00856 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_NAME_UC, FEDM_XML_STRING_AC_DATA_UC);
00857 #if defined(_MSC_VER) || defined(__BORLANDC__)
00858 swprintf(wcValue, L"%d", iMaxBlocks);
00859 #else
00860 swprintf(wcValue, 5, L"%d", iMaxBlocks);
00861 #endif
00862 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_BLOCKS_UC, wcValue);
00863 #if defined(_MSC_VER) || defined(__BORLANDC__)
00864 swprintf(wcValue, L"%d", iBlockSize);
00865 #else
00866 swprintf(wcValue, 5, L"%d", iBlockSize);
00867 #endif
00868 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_SIZE_UC, wcValue);
00869 xml->AddTagItem(root, child);
00870 parent = child;
00871 itor = m_AC_Mem.begin();
00872 break;
00873
00874
00875 case FEDM_PUB_MEM:
00876 iMaxBlocks = m_iUsedPubMemBlocks;
00877 iBlockSize = m_iPubMemBlockSize;
00878 if( iMaxBlocks == 0 || iBlockSize == 0 || iMaxBlocks*iBlockSize > (int)m_PubMem.capacity() )
00879 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00880 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_NAME_UC, FEDM_XML_STRING_PUB_MEM_UC);
00881 #if defined(_MSC_VER) || defined(__BORLANDC__)
00882 swprintf(wcValue, L"%d", iMaxBlocks);
00883 #else
00884 swprintf(wcValue, 5, L"%d", iMaxBlocks);
00885 #endif
00886 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_BLOCKS_UC, wcValue);
00887 #if defined(_MSC_VER) || defined(__BORLANDC__)
00888 swprintf(wcValue, L"%d", iBlockSize);
00889 #else
00890 swprintf(wcValue, 5, L"%d", iBlockSize);
00891 #endif
00892 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_SIZE_UC, wcValue);
00893 xml->AddTagItem(root, child);
00894 parent = child;
00895 itor = m_PubMem.begin();
00896 break;
00897
00898
00899 case FEDM_SEC_MEM:
00900 iMaxBlocks = m_iUsedSecMemBlocks;
00901 if(iMaxBlocks == 0 || iMaxBlocks*iBlockSize > (int)m_SecMem.capacity())
00902 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00903 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_NAME_UC, FEDM_XML_STRING_SEC_MEM_UC);
00904 #if defined(_MSC_VER) || defined(__BORLANDC__)
00905 swprintf(wcValue, L"%d", iMaxBlocks);
00906 #else
00907 swprintf(wcValue, 5, L"%d", iMaxBlocks);
00908 #endif
00909 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_BLOCKS_UC, wcValue);
00910 #if defined(_MSC_VER) || defined(__BORLANDC__)
00911 swprintf(wcValue, L"%d", iBlockSize);
00912 #else
00913 swprintf(wcValue, 5, L"%d", iBlockSize);
00914 #endif
00915 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_SIZE_UC, wcValue);
00916 xml->AddTagItem(root, child);
00917 parent = child;
00918 itor = m_SecMem.begin();
00919 break;
00920
00921
00922 case FEDM_CONF_MEM:
00923 iMaxBlocks = m_iUsedConfMemBlocks;
00924 if(iMaxBlocks == 0 || iMaxBlocks*iBlockSize > (int)m_ConfMem.capacity())
00925 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00926 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_NAME_UC, FEDM_XML_STRING_CFG_MEM_UC);
00927 #if defined(_MSC_VER) || defined(__BORLANDC__)
00928 swprintf(wcValue, L"%d", iMaxBlocks);
00929 #else
00930 swprintf(wcValue, 5, L"%d", iMaxBlocks);
00931 #endif
00932 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_BLOCKS_UC, wcValue);
00933 #if defined(_MSC_VER) || defined(__BORLANDC__)
00934 swprintf(wcValue, L"%d", iBlockSize);
00935 #else
00936 swprintf(wcValue, 5, L"%d", iBlockSize);
00937 #endif
00938 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_SIZE_UC, wcValue);
00939 xml->AddTagItem(root, child);
00940 parent = child;
00941 itor = m_ConfMem.begin();
00942 break;
00943
00944
00945 case FEDM_DATE_MEM:
00946 iMaxBlocks = m_iUsedDateMemBlocks;
00947 if(iMaxBlocks == 0 || iMaxBlocks*iBlockSize > (int)m_DateMem.capacity())
00948 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00949 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_NAME_UC, FEDM_XML_STRING_DATE_MEM_UC);
00950 #if defined(_MSC_VER) || defined(__BORLANDC__)
00951 swprintf(wcValue, L"%d", iMaxBlocks);
00952 #else
00953 swprintf(wcValue, 5, L"%d", iMaxBlocks);
00954 #endif
00955 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_BLOCKS_UC, wcValue);
00956 #if defined(_MSC_VER) || defined(__BORLANDC__)
00957 swprintf(wcValue, L"%d", iBlockSize);
00958 #else
00959 swprintf(wcValue, 5, L"%d", iBlockSize);
00960 #endif
00961 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_SIZE_UC, wcValue);
00962 xml->AddTagItem(root, child);
00963 parent = child;
00964 itor = m_DateMem.begin();
00965 break;
00966
00967 default:
00968 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00969 }
00970
00971
00972 for(int iBlock=iFirstBlock; iBlock<iMaxBlocks; ++iBlock)
00973 {
00974 #if defined(_MSC_VER) || defined(__BORLANDC__)
00975 swprintf(wcValue, L"%d", iBlock);
00976 #else
00977 swprintf(wcValue, 5, L"%d", iBlock);
00978 #endif
00979 if( iMemType == FEDM_RFC_EEDATA_MEM ||
00980 iMemType == FEDM_RFC_RAMDATA_MEM ||
00981 iMemType == FEDM_ACC_EEDATA_MEM ||
00982 iMemType == FEDM_ACC_RAMDATA_MEM )
00983 str = FEDM_XML_TAG_CFG_UC;
00984 else
00985 str = FEDM_XML_TAG_DATA_UC;
00986 str += wcValue;
00987 child = xml->BuildTag(str, false, true);
00988 if(child == NULL)
00989 {
00990 xml->CloseDoc();
00991 return xml->GetLastError();
00992 }
00993
00994
00995 for(int iByte=0; iByte<iBlockSize; ++iByte)
00996 {
00997 #if defined(_MSC_VER) || defined(__BORLANDC__)
00998 swprintf(wcAttrib, L"b%d", iByte);
00999 swprintf(wcValue, L"%02X", *itor);
01000 #else
01001 swprintf(wcAttrib, 5, L"b%d", iByte);
01002 swprintf(wcValue, 5, L"%02X", *itor);
01003 #endif
01004 xml->AddTagAttrib(child, wcAttrib, wcValue);
01005 itor++;
01006 }
01007
01008 xml->AddTagItem(parent, child);
01009 }
01010
01011 return FEDM_OK;
01012 #else
01013 return FEDM_ERROR_UNSUPPORTED;
01014 #endif
01015 }
01016
01017
01018
01019
01020
01021
01022
01023
01024
01025
01026
01027
01028
01029
01030
01031
01032 int FEDM_DataBase::SerializeProfile(FEDM_XMLReaderCfgProfileModul* xml,
01033 bool bRead,
01034 char* sFileName)
01035 {
01036 #ifdef _FEDM_XML_SUPPORT
01037 if(bRead)
01038 return xml->SerializeIn(this, sFileName);
01039 else
01040 return xml->SerializeOut(this, sFileName);
01041 #else
01042 return FEDM_ERROR_UNSUPPORTED;
01043 #endif
01044 }
01045
01046
01047
01048
01049
01050
01051
01052
01053
01054
01055
01056
01057
01058
01059 int FEDM_DataBase::SerializeProfileIn( FEDM_XMLBase* xml,
01060 FEDM_XML_TREEITEM* root)
01061 {
01062 #ifdef _FEDM_XML_SUPPORT
01063 FEDM_CHK3(root);
01064
01065 int iByte=0;
01066 int iMaxBlocks = 0;
01067 int iBlockSize = 0;
01068 size_t iArraySize = 0;
01069 char cAttribute[5];
01070 unsigned char ucValue;
01071 unsigned char ucMask[32];
01072 wstring sTag;
01073 string sAttribute;
01074 string sAttribute1;
01075 string sAttribute2;
01076 string sValue;
01077 wstring wsAttribute;
01078 wstring wsValue;
01079 wchar_t wcValue[5];
01080 FEDM_XML_TREEITEM* child = NULL;
01081 FEDM_XML_TREEITEM* parent = NULL;
01082 FEDM_BYTE_ARRAY_ITOR itor_data;
01083 FEDM_BYTE_ARRAY_ITOR itor_mask;
01084
01085 child = xml->FindTag(FEDM_XML_TAG_DATA_ARRAY_UC,
01086 FEDM_XML_ATTRIB_NAME_UC,
01087 FEDM_XML_STRING_EEPROM_DATA_UC,
01088 false,
01089 true);
01090 if(child == NULL)
01091 return xml->GetLastError();
01092
01093 parent = child;
01094 itor_data = m_RFC_EEData.begin();
01095 iArraySize = m_RFC_EEData.capacity();
01096 itor_mask = m_RFC_CfgProfileMask.begin();
01097
01098
01099 xml->GetTagAttrib(parent, 1, wsAttribute, wsValue);
01100 if(wsAttribute == FEDM_XML_ATTRIB_BLOCKS_UC)
01101 {
01102 #if defined(_FEDM_SUPPORT_UCLINUX)
01103 char buf[10];
01104 FEDM_SWSCANF(wsValue.c_str(), buf);
01105 iMaxBlocks = atoi(buf);
01106 #else
01107 swscanf(wsValue.c_str(), L"%d", &iMaxBlocks);
01108 #endif
01109 if(iMaxBlocks <= 0)
01110 {
01111 delete child;
01112 FEDM_RETURN(FEDM_XML_ERROR_NO_TAG_ATTRIBUTE);
01113 }
01114 }
01115
01116
01117 xml->GetTagAttrib(parent, 2, wsAttribute, wsValue);
01118 if(wsAttribute == FEDM_XML_ATTRIB_SIZE_UC)
01119 {
01120 #if defined(_FEDM_SUPPORT_UCLINUX)
01121 char buf[10];
01122 FEDM_SWSCANF(wsValue.c_str(), buf);
01123 iBlockSize = atoi(buf);
01124 #else
01125 swscanf(wsValue.c_str(), L"%d", &iBlockSize);
01126 #endif
01127 if(iBlockSize != 32 && iBlockSize != 16 && iBlockSize != 4)
01128 {
01129 delete child;
01130 FEDM_RETURN(FEDM_ERROR_PARAMETER);
01131 }
01132 }
01133
01134 if(iMaxBlocks * iBlockSize > (int)iArraySize)
01135 {
01136 delete child;
01137 FEDM_RETURN(FEDM_ERROR_PARAMETER);
01138 }
01139
01140 xml->AddTagItem(root, child);
01141
01142
01143 for(int iBlock=0; iBlock<iMaxBlocks; ++iBlock)
01144 {
01145 #if defined(_MSC_VER) || defined(__BORLANDC__)
01146 swprintf(wcValue, L"%d", iBlock);
01147 #else
01148 swprintf(wcValue, 5, L"%d", iBlock);
01149 #endif
01150 sTag = FEDM_XML_TAG_CFG_UC;
01151 sTag += wcValue;
01152 child = xml->FindTag(sTag, true, false);
01153 if(child == NULL)
01154 {
01155 xml->CloseDoc();
01156 return xml->GetLastError();
01157 }
01158
01159 xml->AddTagItem(parent, child);
01160
01161
01162 xml->GetTagAttrib(child, 0, sAttribute, sValue);
01163 FEDM_ConvHexStrToHexUChar((string)sValue.c_str(), ucMask, iBlockSize);
01164 for(iByte=0; iByte<iBlockSize; ++iByte)
01165 {
01166 (*itor_mask) = ucMask[iByte];
01167 itor_mask++;
01168 }
01169
01170
01171
01172 for(iByte=0; iByte<iBlockSize; ++iByte)
01173 {
01174 xml->GetTagAttrib(child, iByte+1, sAttribute1, sValue);
01175
01176 sprintf(cAttribute, "b%d", iByte);
01177 sAttribute2 = cAttribute;
01178 FEDM_ConvHexStrToHexUChar((string)sValue.c_str(), &ucValue, 1);
01179
01180 if(ucMask[iByte] > 0 && sAttribute1.c_str() == sAttribute2)
01181 {
01182 (*itor_data) = ((*itor_data) & (~ucMask[iByte])) | (ucValue & ucMask[iByte]);
01183 }
01184 itor_data++;
01185 }
01186 }
01187
01188 return FEDM_OK;
01189 #else
01190 return FEDM_ERROR_UNSUPPORTED;
01191 #endif
01192 }
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209 int FEDM_DataBase::SerializeProfileOut( FEDM_XMLBase* xml,
01210 FEDM_XML_TREEITEM* root )
01211 {
01212 #ifdef _FEDM_XML_SUPPORT
01213 FEDM_CHK3(root);
01214
01215 int iByte=0;
01216 int iMaxBlocks = 0;
01217 int iBlockSize = 16;
01218 int iTmpDataBlockSize = 32;
01219
01220 wstring str;
01221 wstring wsValue;
01222 wstring wsAttrib;
01223 wchar_t wcValue[5];
01224 wchar_t wcAttrib[32];
01225 FEDM_XML_TREEITEM* parent = NULL;
01226 FEDM_XML_TREEITEM* child = NULL;
01227 FEDM_BYTE_ARRAY_ITOR itor_data;
01228 FEDM_BYTE_ARRAY_ITOR itor_mask;
01229
01230 child = xml->BuildTag(FEDM_XML_TAG_DATA_ARRAY_UC);
01231 if(child == NULL)
01232 {
01233 xml->CloseDoc();
01234 return xml->GetLastError();
01235 }
01236
01237
01238 iMaxBlocks = m_iUsedEEDataBlocks;
01239 iBlockSize = m_iRFC_DataBlockSize;
01240 if(iMaxBlocks == 0 || iMaxBlocks*iBlockSize > (int)m_RFC_EEData.capacity())
01241 FEDM_RETURN(FEDM_ERROR_PARAMETER);
01242 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_NAME_UC, FEDM_XML_STRING_EEPROM_DATA_UC);
01243 #if defined(_MSC_VER) || defined(__BORLANDC__)
01244 swprintf(wcValue, L"%d", iMaxBlocks);
01245 #else
01246 swprintf(wcValue, 5, L"%d", iMaxBlocks);
01247 #endif
01248 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_BLOCKS_UC, wcValue);
01249 #if defined(_MSC_VER) || defined(__BORLANDC__)
01250 swprintf(wcValue, L"%d", iBlockSize);
01251 #else
01252 swprintf(wcValue, 5, L"%d", iBlockSize);
01253 #endif
01254 xml->AddTagAttrib(child, FEDM_XML_ATTRIB_SIZE_UC, wcValue);
01255 xml->AddTagItem(root, child);
01256 parent = child;
01257 itor_data = m_RFC_EEData.begin();
01258 itor_mask = m_RFC_CfgProfileMask.begin();
01259
01260
01261 for(int iBlock=0; iBlock<iMaxBlocks; ++iBlock)
01262 {
01263 #if defined(_MSC_VER) || defined(__BORLANDC__)
01264 swprintf(wcValue, L"%d", iBlock);
01265 #else
01266 swprintf(wcValue, 5, L"%d", iBlock);
01267 #endif
01268 str = FEDM_XML_TAG_CFG_UC;
01269 str += wcValue;
01270 child = xml->BuildTag(str, false, true);
01271 if(child == NULL)
01272 {
01273 xml->CloseDoc();
01274 return xml->GetLastError();
01275 }
01276
01277
01278 wsAttrib = L"mask";
01279 str.erase(str.begin(), str.end());
01280 for(iByte=0; iByte<iBlockSize; ++iByte)
01281 {
01282 #if defined(_MSC_VER) || defined(__BORLANDC__)
01283 swprintf(wcValue, L"%02X", *itor_mask);
01284 #else
01285 swprintf(wcValue, 5, L"%02X", *itor_mask);
01286 #endif
01287 itor_mask++;
01288 str += wcValue;
01289 }
01290 xml->AddTagAttrib(child, wsAttrib, str);
01291
01292
01293 for(iByte=0; iByte<iBlockSize; ++iByte)
01294 {
01295 #if defined(_MSC_VER) || defined(__BORLANDC__)
01296 swprintf(wcAttrib, L"b%d", iByte);
01297 swprintf(wcValue, L"%02X", *itor_data);
01298 #else
01299 swprintf(wcAttrib, 5, L"b%d", iByte);
01300 swprintf(wcValue, 5, L"%02X", *itor_data);
01301 #endif
01302 xml->AddTagAttrib(child, wcAttrib, wcValue);
01303 itor_data++;
01304 }
01305
01306 xml->AddTagItem(parent, child);
01307 }
01308
01309 return FEDM_OK;
01310 #else
01311 return FEDM_ERROR_UNSUPPORTED;
01312 #endif
01313 }
01314
01315
01316
01317
01318
01319
01320
01321
01322
01323
01324
01325
01326
01327
01328
01329
01330
01331 int FEDM_DataBase::GetData(const char* ID, bool* Data)
01332 {
01333 FEDM_CHK3(ID);
01334 FEDM_CHK3(Data);
01335
01336 int iBack = 0;
01337
01338
01339 int MemID = FEDM_GetMemIDOfID(ID);
01340
01341 switch( MemID )
01342 {
01343 case FEDM_RFC_EEDATA_MEM:
01344 iBack = FEDM_Base::GetData(ID, Data, m_RFC_EEData, m_iRFC_DataBlockSize);
01345 break;
01346 case FEDM_RFC_RAMDATA_MEM:
01347 iBack = FEDM_Base::GetData(ID, Data, m_RFC_RAMData, m_iRFC_DataBlockSize);
01348 break;
01349 case FEDM_ACC_EEDATA_MEM:
01350 iBack = FEDM_Base::GetData(ID, Data, m_ACC_EEData, 32);
01351 break;
01352 case FEDM_ACC_RAMDATA_MEM:
01353 iBack = FEDM_Base::GetData(ID, Data, m_ACC_RAMData, 32);
01354 break;
01355 case FEDM_TMPDATA_MEM:
01356 iBack = FEDM_Base::GetData(ID, Data, m_TmpData, 32);
01357 break;
01358 case FEDM_MJPDATA_MEM:
01359 iBack = FEDM_Base::GetData(ID, Data, m_MjpData, 16);
01360 break;
01361 case FEDM_SN_MEM:
01362 iBack = FEDM_Base::GetData(ID, Data, m_SN_Mem, 16);
01363 break;
01364 case FEDM_ID_MEM:
01365 iBack = FEDM_Base::GetData(ID, Data, m_ID_Mem, 16);
01366 break;
01367 case FEDM_AC_MEM:
01368 iBack = FEDM_Base::GetData(ID, Data, m_AC_Mem, 16);
01369 break;
01370 case FEDM_PUB_MEM:
01371 iBack = FEDM_Base::GetData(ID, Data, m_PubMem, m_iPubMemBlockSize);
01372 break;
01373 case FEDM_SEC_MEM:
01374 iBack = FEDM_Base::GetData(ID, Data, m_SecMem, 4);
01375 break;
01376 case FEDM_CONF_MEM:
01377 iBack = FEDM_Base::GetData(ID, Data, m_ConfMem, 4);
01378 break;
01379 case FEDM_DATE_MEM:
01380 iBack = FEDM_Base::GetData(ID, Data, m_DateMem, 16);
01381 break;
01382 case FEDM_RFC_DATA_MASK_MEM:
01383 iBack = FEDM_Base::GetData(ID, Data, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
01384 break;
01385 default:
01386 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
01387 break;
01388 }
01389
01390 if(iBack < 0)
01391 {
01392 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", bool*) - " << GetErrorText(iBack));
01393 }
01394 return iBack;
01395 }
01396
01397
01398
01399
01400
01401
01402
01403
01404
01405
01406
01407
01408 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
01409 int FEDM_DataBase::GetData(const char* ID, BOOL* Data)
01410 {
01411 FEDM_CHK3(ID);
01412 FEDM_CHK3(Data);
01413
01414 int iBack = 0;
01415
01416
01417 int MemID = FEDM_GetMemIDOfID(ID);
01418
01419 switch( MemID )
01420 {
01421 case FEDM_RFC_EEDATA_MEM:
01422 iBack = FEDM_Base::GetData(ID, Data, m_RFC_EEData, m_iRFC_DataBlockSize);
01423 break;
01424 case FEDM_RFC_RAMDATA_MEM:
01425 iBack = FEDM_Base::GetData(ID, Data, m_RFC_RAMData, m_iRFC_DataBlockSize);
01426 break;
01427 case FEDM_ACC_EEDATA_MEM:
01428 iBack = FEDM_Base::GetData(ID, Data, m_ACC_EEData, 32);
01429 break;
01430 case FEDM_ACC_RAMDATA_MEM:
01431 iBack = FEDM_Base::GetData(ID, Data, m_ACC_RAMData, 32);
01432 break;
01433 case FEDM_TMPDATA_MEM:
01434 iBack = FEDM_Base::GetData(ID, Data, m_TmpData, 32);
01435 break;
01436 case FEDM_MJPDATA_MEM:
01437 iBack = FEDM_Base::GetData(ID, Data, m_MjpData, 16);
01438 break;
01439 case FEDM_SN_MEM:
01440 iBack = FEDM_Base::GetData(ID, Data, m_SN_Mem, 16);
01441 break;
01442 case FEDM_ID_MEM:
01443 iBack = FEDM_Base::GetData(ID, Data, m_ID_Mem, 16);
01444 break;
01445 case FEDM_AC_MEM:
01446 iBack = FEDM_Base::GetData(ID, Data, m_AC_Mem, 16);
01447 break;
01448 case FEDM_PUB_MEM:
01449 iBack = FEDM_Base::GetData(ID, Data, m_PubMem, m_iPubMemBlockSize);
01450 break;
01451 case FEDM_SEC_MEM:
01452 iBack = FEDM_Base::GetData(ID, Data, m_SecMem, 4);
01453 break;
01454 case FEDM_CONF_MEM:
01455 iBack = FEDM_Base::GetData(ID, Data, m_ConfMem, 4);
01456 break;
01457 case FEDM_DATE_MEM:
01458 iBack = FEDM_Base::GetData(ID, Data, m_DateMem, 16);
01459 break;
01460 case FEDM_RFC_DATA_MASK_MEM:
01461 iBack = FEDM_Base::GetData(ID, Data, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
01462 break;
01463 default:
01464 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
01465 break;
01466 }
01467
01468 if(iBack < 0)
01469 {
01470 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ",BOOL*) - " << GetErrorText(iBack));
01471 }
01472 return iBack;
01473 }
01474 #endif
01475
01476
01477
01478
01479
01480
01481
01482
01483
01484
01485
01486
01487 int FEDM_DataBase::GetData(const char* ID, unsigned char* Data)
01488 {
01489 FEDM_CHK3(ID);
01490 FEDM_CHK3(Data);
01491
01492 int iBack = 0;
01493
01494
01495 int MemID = FEDM_GetMemIDOfID(ID);
01496
01497 switch( MemID )
01498 {
01499 case FEDM_RFC_EEDATA_MEM:
01500 iBack = FEDM_Base::GetData(ID, Data, m_RFC_EEData, m_iRFC_DataBlockSize);
01501 break;
01502 case FEDM_RFC_RAMDATA_MEM:
01503 iBack = FEDM_Base::GetData(ID, Data, m_RFC_RAMData, m_iRFC_DataBlockSize);
01504 break;
01505 case FEDM_ACC_EEDATA_MEM:
01506 iBack = FEDM_Base::GetData(ID, Data, m_ACC_EEData, 32);
01507 break;
01508 case FEDM_ACC_RAMDATA_MEM:
01509 iBack = FEDM_Base::GetData(ID, Data, m_ACC_RAMData, 32);
01510 break;
01511 case FEDM_TMPDATA_MEM:
01512 iBack = FEDM_Base::GetData(ID, Data, m_TmpData, 32);
01513 break;
01514 case FEDM_MJPDATA_MEM:
01515 iBack = FEDM_Base::GetData(ID, Data, m_MjpData, 16);
01516 break;
01517 case FEDM_SN_MEM:
01518 iBack = FEDM_Base::GetData(ID, Data, m_SN_Mem, 16);
01519 break;
01520 case FEDM_ID_MEM:
01521 iBack = FEDM_Base::GetData(ID, Data, m_ID_Mem, 16);
01522 break;
01523 case FEDM_AC_MEM:
01524 iBack = FEDM_Base::GetData(ID, Data, m_AC_Mem, 16);
01525 break;
01526 case FEDM_PUB_MEM:
01527 iBack = FEDM_Base::GetData(ID, Data, m_PubMem, m_iPubMemBlockSize);
01528 break;
01529 case FEDM_SEC_MEM:
01530 iBack = FEDM_Base::GetData(ID, Data, m_SecMem, 4);
01531 break;
01532 case FEDM_CONF_MEM:
01533 iBack = FEDM_Base::GetData(ID, Data, m_ConfMem,4 );
01534 break;
01535 case FEDM_DATE_MEM:
01536 iBack = FEDM_Base::GetData(ID, Data, m_DateMem, 16);
01537 break;
01538 case FEDM_RFC_DATA_MASK_MEM:
01539 iBack = FEDM_Base::GetData(ID, Data, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
01540 break;
01541 default:
01542 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
01543 break;
01544 }
01545
01546 if(iBack < 0)
01547 {
01548 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", unsigned char*) - " << GetErrorText(iBack));
01549 }
01550 return iBack;
01551 }
01552
01553
01554
01555
01556
01557
01558
01559
01560
01561
01562
01563
01564
01565 int FEDM_DataBase::GetData(const char* ID, unsigned char* Data, int Cnt)
01566 {
01567 FEDM_CHK3(ID);
01568 FEDM_CHK3(Data);
01569
01570 int iBack = 0;
01571
01572
01573 int MemID = FEDM_GetMemIDOfID(ID);
01574
01575 switch( MemID )
01576 {
01577 case FEDM_RFC_EEDATA_MEM:
01578 iBack = FEDM_Base::GetData(ID, Data, Cnt, m_RFC_EEData, m_iRFC_DataBlockSize);
01579 break;
01580 case FEDM_RFC_RAMDATA_MEM:
01581 iBack = FEDM_Base::GetData(ID, Data, Cnt, m_RFC_RAMData, m_iRFC_DataBlockSize);
01582 break;
01583 case FEDM_ACC_EEDATA_MEM:
01584 iBack = FEDM_Base::GetData(ID, Data, Cnt, m_ACC_EEData, 32);
01585 break;
01586 case FEDM_ACC_RAMDATA_MEM:
01587 iBack = FEDM_Base::GetData(ID, Data, Cnt, m_ACC_RAMData, 32);
01588 break;
01589 case FEDM_TMPDATA_MEM:
01590 iBack = FEDM_Base::GetData(ID, Data, Cnt, m_TmpData, 32);
01591 break;
01592 case FEDM_MJPDATA_MEM:
01593 iBack = FEDM_Base::GetData(ID, Data, Cnt, m_MjpData, 16);
01594 break;
01595 case FEDM_SN_MEM:
01596 iBack = FEDM_Base::GetData(ID, Data, Cnt, m_SN_Mem, 16);
01597 break;
01598 case FEDM_ID_MEM:
01599 iBack = FEDM_Base::GetData(ID, Data, Cnt, m_ID_Mem, 16);
01600 break;
01601 case FEDM_AC_MEM:
01602 iBack = FEDM_Base::GetData(ID, Data, Cnt, m_AC_Mem, 16);
01603 break;
01604 case FEDM_PUB_MEM:
01605 iBack = FEDM_Base::GetData(ID, Data, Cnt, m_PubMem, m_iPubMemBlockSize);
01606 break;
01607 case FEDM_SEC_MEM:
01608 iBack = FEDM_Base::GetData(ID, Data, Cnt, m_SecMem, 4);
01609 break;
01610 case FEDM_CONF_MEM:
01611 iBack = FEDM_Base::GetData(ID, Data, Cnt, m_ConfMem, 4);
01612 break;
01613 case FEDM_DATE_MEM:
01614 iBack = FEDM_Base::GetData(ID, Data, Cnt, m_DateMem, 16);
01615 break;
01616 case FEDM_RFC_DATA_MASK_MEM:
01617 iBack = FEDM_Base::GetData(ID, Data, Cnt, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
01618 break;
01619 default:
01620 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
01621 break;
01622 }
01623
01624 if(iBack < 0)
01625 {
01626 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", unsigned char*, int) - " << GetErrorText(iBack));
01627 }
01628 return iBack;
01629 }
01630
01631
01632
01633
01634
01635
01636
01637
01638
01639
01640
01641
01642 int FEDM_DataBase::GetData(const char* ID, unsigned int* Data)
01643 {
01644 FEDM_CHK3(ID);
01645 FEDM_CHK3(Data);
01646
01647 int iBack = 0;
01648
01649
01650 int MemID = FEDM_GetMemIDOfID(ID);
01651
01652 switch( MemID )
01653 {
01654 case FEDM_RFC_EEDATA_MEM:
01655 iBack = FEDM_Base::GetData(ID, Data, m_RFC_EEData, m_iRFC_DataBlockSize);
01656 break;
01657 case FEDM_RFC_RAMDATA_MEM:
01658 iBack = FEDM_Base::GetData(ID, Data, m_RFC_RAMData, m_iRFC_DataBlockSize);
01659 break;
01660 case FEDM_ACC_EEDATA_MEM:
01661 iBack = FEDM_Base::GetData(ID, Data, m_ACC_EEData, 32);
01662 break;
01663 case FEDM_ACC_RAMDATA_MEM:
01664 iBack = FEDM_Base::GetData(ID, Data, m_ACC_RAMData, 32);
01665 break;
01666 case FEDM_TMPDATA_MEM:
01667 iBack = FEDM_Base::GetData(ID, Data, m_TmpData, 32);
01668 break;
01669 case FEDM_MJPDATA_MEM:
01670 iBack = FEDM_Base::GetData(ID, Data, m_MjpData, 16);
01671 break;
01672 case FEDM_SN_MEM:
01673 iBack = FEDM_Base::GetData(ID, Data, m_SN_Mem, 16);
01674 break;
01675 case FEDM_ID_MEM:
01676 iBack = FEDM_Base::GetData(ID, Data, m_ID_Mem, 16);
01677 break;
01678 case FEDM_AC_MEM:
01679 iBack = FEDM_Base::GetData(ID, Data, m_AC_Mem, 16);
01680 break;
01681 case FEDM_PUB_MEM:
01682 iBack = FEDM_Base::GetData(ID, Data, m_PubMem, m_iPubMemBlockSize);
01683 break;
01684 case FEDM_SEC_MEM:
01685 iBack = FEDM_Base::GetData(ID, Data, m_SecMem, 4);
01686 break;
01687 case FEDM_CONF_MEM:
01688 iBack = FEDM_Base::GetData(ID, Data, m_ConfMem, 4);
01689 break;
01690 case FEDM_DATE_MEM:
01691 iBack = FEDM_Base::GetData(ID, Data, m_DateMem, 16);
01692 break;
01693 case FEDM_RFC_DATA_MASK_MEM:
01694 iBack = FEDM_Base::GetData(ID, Data, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
01695 break;
01696 default:
01697 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
01698 break;
01699 }
01700
01701 if(iBack < 0)
01702 {
01703 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", unsigned int*) - " << GetErrorText(iBack));
01704 }
01705 return iBack;
01706 }
01707
01708
01709
01710
01711
01712
01713
01714
01715
01716
01717
01718
01719 int FEDM_DataBase::GetData(const char* ID, __int64* Data)
01720 {
01721 FEDM_CHK3(ID);
01722 FEDM_CHK3(Data);
01723
01724 int iBack = 0;
01725
01726
01727 int MemID = FEDM_GetMemIDOfID(ID);
01728
01729 switch( MemID )
01730 {
01731 case FEDM_RFC_EEDATA_MEM:
01732 iBack = FEDM_Base::GetData(ID, Data, m_RFC_EEData, m_iRFC_DataBlockSize);
01733 break;
01734 case FEDM_RFC_RAMDATA_MEM:
01735 iBack = FEDM_Base::GetData(ID, Data, m_RFC_RAMData, m_iRFC_DataBlockSize);
01736 break;
01737 case FEDM_ACC_EEDATA_MEM:
01738 iBack = FEDM_Base::GetData(ID, Data, m_ACC_EEData, 32);
01739 break;
01740 case FEDM_ACC_RAMDATA_MEM:
01741 iBack = FEDM_Base::GetData(ID, Data, m_ACC_RAMData, 32);
01742 break;
01743 case FEDM_TMPDATA_MEM:
01744 iBack = FEDM_Base::GetData(ID, Data, m_TmpData, 32);
01745 break;
01746 case FEDM_MJPDATA_MEM:
01747 iBack = FEDM_Base::GetData(ID, Data, m_MjpData, 16);
01748 break;
01749 case FEDM_SN_MEM:
01750 iBack = FEDM_Base::GetData(ID, Data, m_SN_Mem, 16);
01751 break;
01752 case FEDM_ID_MEM:
01753 iBack = FEDM_Base::GetData(ID, Data, m_ID_Mem, 16);
01754 break;
01755 case FEDM_AC_MEM:
01756 iBack = FEDM_Base::GetData(ID, Data, m_AC_Mem, 16);
01757 break;
01758 case FEDM_PUB_MEM:
01759 iBack = FEDM_Base::GetData(ID, Data, m_PubMem, m_iPubMemBlockSize);
01760 break;
01761 case FEDM_SEC_MEM:
01762 iBack = FEDM_Base::GetData(ID, Data, m_SecMem, 4);
01763 break;
01764 case FEDM_CONF_MEM:
01765 iBack = FEDM_Base::GetData(ID, Data, m_ConfMem, 4);
01766 break;
01767 case FEDM_DATE_MEM:
01768 iBack = FEDM_Base::GetData(ID, Data, m_DateMem, 16);
01769 break;
01770 case FEDM_RFC_DATA_MASK_MEM:
01771 iBack = FEDM_Base::GetData(ID, Data, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
01772 break;
01773 default:
01774 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
01775 break;
01776 }
01777
01778 if(iBack < 0)
01779 {
01780 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", __int64*) - " << GetErrorText(iBack));
01781 }
01782 return iBack;
01783 }
01784
01785
01786
01787
01788
01789
01790
01791
01792
01793
01794
01795
01796 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
01797 int FEDM_DataBase::GetData(const char* ID, CString& Data)
01798 {
01799 FEDM_CHK3(ID);
01800 FEDM_CHK3(&Data);
01801
01802 int iBack = 0;
01803
01804
01805 int MemID = FEDM_GetMemIDOfID(ID);
01806
01807 switch( MemID )
01808 {
01809 case FEDM_RFC_EEDATA_MEM:
01810 iBack = FEDM_Base::GetData(ID, Data, m_RFC_EEData, m_iRFC_DataBlockSize);
01811 break;
01812 case FEDM_RFC_RAMDATA_MEM:
01813 iBack = FEDM_Base::GetData(ID, Data, m_RFC_RAMData, m_iRFC_DataBlockSize);
01814 break;
01815 case FEDM_ACC_EEDATA_MEM:
01816 iBack = FEDM_Base::GetData(ID, Data, m_ACC_EEData, 32);
01817 break;
01818 case FEDM_ACC_RAMDATA_MEM:
01819 iBack = FEDM_Base::GetData(ID, Data, m_ACC_RAMData, 32);
01820 break;
01821 case FEDM_TMPDATA_MEM:
01822 iBack = FEDM_Base::GetData(ID, Data, m_TmpData, 32);
01823 break;
01824 case FEDM_MJPDATA_MEM:
01825 iBack = FEDM_Base::GetData(ID, Data, m_MjpData, 16);
01826 break;
01827 case FEDM_SN_MEM:
01828 iBack = FEDM_Base::GetData(ID, Data, m_SN_Mem, 16);
01829 break;
01830 case FEDM_ID_MEM:
01831 iBack = FEDM_Base::GetData(ID, Data, m_ID_Mem, 16);
01832 break;
01833 case FEDM_AC_MEM:
01834 iBack = FEDM_Base::GetData(ID, Data, m_AC_Mem, 16);
01835 break;
01836 case FEDM_PUB_MEM:
01837 iBack = FEDM_Base::GetData(ID, Data, m_PubMem, m_iPubMemBlockSize);
01838 break;
01839 case FEDM_SEC_MEM:
01840 iBack = FEDM_Base::GetData(ID, Data, m_SecMem, 4);
01841 break;
01842 case FEDM_CONF_MEM:
01843 iBack = FEDM_Base::GetData(ID, Data, m_ConfMem, 4);
01844 break;
01845 case FEDM_DATE_MEM:
01846 iBack = FEDM_Base::GetData(ID, Data, m_DateMem, 16);
01847 break;
01848 case FEDM_RFC_DATA_MASK_MEM:
01849 iBack = FEDM_Base::GetData(ID, Data, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
01850 break;
01851 default:
01852 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
01853 break;
01854 }
01855
01856 if(iBack < 0)
01857 {
01858 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", CString&) - " << GetErrorText(iBack));
01859 }
01860 return iBack;
01861 }
01862 #endif
01863
01864
01865
01866
01867
01868
01869
01870
01871
01872
01873
01874
01875 int FEDM_DataBase::GetData(const char* ID, string& Data)
01876 {
01877 FEDM_CHK3(ID);
01878 FEDM_CHK3(&Data);
01879
01880 int iBack = 0;
01881
01882
01883 int MemID = FEDM_GetMemIDOfID(ID);
01884
01885 switch( MemID )
01886 {
01887 case FEDM_RFC_EEDATA_MEM:
01888 iBack = FEDM_Base::GetData(ID, Data, m_RFC_EEData, m_iRFC_DataBlockSize);
01889 break;
01890 case FEDM_RFC_RAMDATA_MEM:
01891 iBack = FEDM_Base::GetData(ID, Data, m_RFC_RAMData, m_iRFC_DataBlockSize);
01892 break;
01893 case FEDM_ACC_EEDATA_MEM:
01894 iBack = FEDM_Base::GetData(ID, Data, m_ACC_EEData, 32);
01895 break;
01896 case FEDM_ACC_RAMDATA_MEM:
01897 iBack = FEDM_Base::GetData(ID, Data, m_ACC_RAMData, 32);
01898 break;
01899 case FEDM_TMPDATA_MEM:
01900 iBack = FEDM_Base::GetData(ID, Data, m_TmpData, 32);
01901 break;
01902 case FEDM_MJPDATA_MEM:
01903 iBack = FEDM_Base::GetData(ID, Data, m_MjpData, 16);
01904 break;
01905 case FEDM_SN_MEM:
01906 iBack = FEDM_Base::GetData(ID, Data, m_SN_Mem, 16);
01907 break;
01908 case FEDM_ID_MEM:
01909 iBack = FEDM_Base::GetData(ID, Data, m_ID_Mem, 16);
01910 break;
01911 case FEDM_AC_MEM:
01912 iBack = FEDM_Base::GetData(ID, Data, m_AC_Mem, 16);
01913 break;
01914 case FEDM_PUB_MEM:
01915 iBack = FEDM_Base::GetData(ID, Data, m_PubMem, m_iPubMemBlockSize);
01916 break;
01917 case FEDM_SEC_MEM:
01918 iBack = FEDM_Base::GetData(ID, Data, m_SecMem, 4);
01919 break;
01920 case FEDM_CONF_MEM:
01921 iBack = FEDM_Base::GetData(ID, Data, m_ConfMem, 4);
01922 break;
01923 case FEDM_DATE_MEM:
01924 iBack = FEDM_Base::GetData(ID, Data, m_DateMem, 16);
01925 break;
01926 case FEDM_RFC_DATA_MASK_MEM:
01927 iBack = FEDM_Base::GetData(ID, Data, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
01928 break;
01929 default:
01930 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
01931 break;
01932 }
01933
01934 if(iBack < 0)
01935 {
01936 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", string&) - " << GetErrorText(iBack));
01937 }
01938 return iBack;
01939 }
01940
01941
01942
01943
01944
01945
01946
01947
01948
01949
01950
01951
01952
01953 int FEDM_DataBase::GetData(const char* ID, char* Data, int DataLen)
01954 {
01955 FEDM_CHK3(ID);
01956 FEDM_CHK3(Data);
01957
01958 int iBack = 0;
01959
01960
01961 int MemID = FEDM_GetMemIDOfID(ID);
01962
01963 switch( MemID )
01964 {
01965 case FEDM_RFC_EEDATA_MEM:
01966 iBack = FEDM_Base::GetData(ID, Data, DataLen, m_RFC_EEData, m_iRFC_DataBlockSize);
01967 break;
01968 case FEDM_RFC_RAMDATA_MEM:
01969 iBack = FEDM_Base::GetData(ID, Data, DataLen, m_RFC_RAMData, m_iRFC_DataBlockSize);
01970 break;
01971 case FEDM_ACC_EEDATA_MEM:
01972 iBack = FEDM_Base::GetData(ID, Data, DataLen, m_ACC_EEData, 32);
01973 break;
01974 case FEDM_ACC_RAMDATA_MEM:
01975 iBack = FEDM_Base::GetData(ID, Data, DataLen, m_ACC_RAMData, 32);
01976 break;
01977 case FEDM_TMPDATA_MEM:
01978 iBack = FEDM_Base::GetData(ID, Data, DataLen, m_TmpData, 32);
01979 break;
01980 case FEDM_MJPDATA_MEM:
01981 iBack = FEDM_Base::GetData(ID, Data, DataLen, m_MjpData, 16);
01982 break;
01983 case FEDM_SN_MEM:
01984 iBack = FEDM_Base::GetData(ID, Data, DataLen, m_SN_Mem, 16);
01985 break;
01986 case FEDM_ID_MEM:
01987 iBack = FEDM_Base::GetData(ID, Data, DataLen, m_ID_Mem, 16);
01988 break;
01989 case FEDM_AC_MEM:
01990 iBack = FEDM_Base::GetData(ID, Data, DataLen, m_AC_Mem, 16);
01991 break;
01992 case FEDM_PUB_MEM:
01993 iBack = FEDM_Base::GetData(ID, Data, DataLen, m_PubMem, m_iPubMemBlockSize);
01994 break;
01995 case FEDM_SEC_MEM:
01996 iBack = FEDM_Base::GetData(ID, Data, DataLen, m_SecMem, 4);
01997 break;
01998 case FEDM_CONF_MEM:
01999 iBack = FEDM_Base::GetData(ID, Data, DataLen, m_ConfMem, 4);
02000 break;
02001 case FEDM_DATE_MEM:
02002 iBack = FEDM_Base::GetData(ID, Data, DataLen, m_DateMem, 16);
02003 break;
02004 case FEDM_RFC_DATA_MASK_MEM:
02005 iBack = FEDM_Base::GetData(ID, Data, DataLen, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
02006 break;
02007 default:
02008 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
02009 break;
02010 }
02011
02012 if(iBack < 0)
02013 {
02014 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", char*, int) - " << GetErrorText(iBack));
02015 }
02016 return iBack;
02017 }
02018
02019
02020
02021
02022
02023
02024
02025
02026
02027
02028
02029
02030 int FEDM_DataBase::SetData( const char* ID, bool Data )
02031 {
02032 FEDM_CHK3(ID);
02033
02034 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
02035 int iBack = 0;
02036
02037
02038 sscanf( ID, "%d %d %d %d %d %d %d",
02039 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
02040
02041
02042 switch( MemID )
02043 {
02044 case FEDM_RFC_EEDATA_MEM:
02045 iBack = FEDM_Base::SetData(ID, Data, m_RFC_EEData, m_iRFC_DataBlockSize);
02046 if(iBack == FEDM_MODIFIED)
02047 {
02048
02049 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02050 }
02051
02052 if(iBack >= 0)
02053 {
02054 OptionalSetDataAction( ID, (__int64)Data );
02055 }
02056 break;
02057
02058 case FEDM_RFC_RAMDATA_MEM:
02059 iBack = FEDM_Base::SetData(ID, Data, m_RFC_RAMData, m_iRFC_DataBlockSize);
02060 if(iBack == FEDM_MODIFIED)
02061 {
02062
02063 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02064 }
02065
02066 if(iBack >= 0)
02067 {
02068 OptionalSetDataAction( ID, (__int64)Data );
02069 }
02070 break;
02071
02072 case FEDM_ACC_EEDATA_MEM:
02073 iBack = FEDM_Base::SetData(ID, Data, m_ACC_EEData, 32);
02074 if(iBack == FEDM_MODIFIED)
02075 {
02076
02077 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
02078 }
02079
02080 if(iBack >= 0)
02081 {
02082 OptionalSetDataAction( ID, (__int64)Data );
02083 }
02084 break;
02085
02086 case FEDM_ACC_RAMDATA_MEM:
02087 iBack = FEDM_Base::SetData(ID, Data, m_ACC_RAMData, 32);
02088 if(iBack == FEDM_MODIFIED)
02089 {
02090
02091 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
02092 }
02093
02094 if(iBack >= 0)
02095 {
02096 OptionalSetDataAction( ID, (__int64)Data );
02097 }
02098 break;
02099
02100 case FEDM_TMPDATA_MEM:
02101 iBack = FEDM_Base::SetData(ID, Data, m_TmpData, 32);
02102 break;
02103 case FEDM_MJPDATA_MEM:
02104 iBack = FEDM_Base::SetData(ID, Data, m_MjpData, 16);
02105 break;
02106 case FEDM_SN_MEM:
02107 iBack = FEDM_Base::SetData(ID, Data, m_SN_Mem, 16);
02108 break;
02109 case FEDM_ID_MEM:
02110 iBack = FEDM_Base::SetData(ID, Data, m_ID_Mem, 16);
02111 break;
02112 case FEDM_AC_MEM:
02113 iBack = FEDM_Base::SetData(ID, Data, m_AC_Mem, 16);
02114 break;
02115 case FEDM_PUB_MEM:
02116 iBack = FEDM_Base::SetData(ID, Data, m_PubMem, m_iPubMemBlockSize);
02117 break;
02118 case FEDM_SEC_MEM:
02119 iBack = FEDM_Base::SetData(ID, Data, m_SecMem, 4);
02120 break;
02121 case FEDM_CONF_MEM:
02122 iBack = FEDM_Base::SetData(ID, Data, m_ConfMem, 4);
02123 break;
02124 case FEDM_DATE_MEM:
02125 iBack = FEDM_Base::SetData(ID, Data, m_DateMem, 16);
02126 break;
02127 case FEDM_RFC_DATA_MASK_MEM:
02128 iBack = FEDM_Base::SetData(ID, Data, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
02129 break;
02130 default:
02131 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
02132 break;
02133 }
02134
02135 if(iBack < 0)
02136 {
02137 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", Data=" << Data << ") - " << GetErrorText(iBack));
02138 }
02139 return iBack;
02140 }
02141
02142
02143
02144
02145
02146
02147
02148
02149
02150
02151
02152
02153 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
02154 int FEDM_DataBase::SetData( const char* ID, BOOL Data )
02155 {
02156 FEDM_CHK3(ID);
02157
02158 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
02159 int iBack = 0;
02160
02161
02162 sscanf( ID, "%d %d %d %d %d %d %d",
02163 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
02164
02165 switch( MemID )
02166 {
02167 case FEDM_RFC_EEDATA_MEM:
02168 iBack = FEDM_Base::SetData(ID, Data ? true : false, m_RFC_EEData, m_iRFC_DataBlockSize);
02169 if(iBack == FEDM_MODIFIED)
02170 {
02171
02172 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02173 }
02174
02175 if(iBack >= 0)
02176 {
02177 OptionalSetDataAction( ID, (__int64)Data );
02178 }
02179 break;
02180
02181 case FEDM_RFC_RAMDATA_MEM:
02182 iBack = FEDM_Base::SetData(ID, Data ? true : false, m_RFC_RAMData, m_iRFC_DataBlockSize);
02183 if(iBack == FEDM_MODIFIED)
02184 {
02185
02186 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02187 }
02188
02189 if(iBack >= 0)
02190 {
02191 OptionalSetDataAction( ID, (__int64)Data );
02192 }
02193 break;
02194
02195 case FEDM_ACC_EEDATA_MEM:
02196 iBack = FEDM_Base::SetData(ID, Data ? true : false, m_ACC_EEData, 32);
02197 if(iBack == FEDM_MODIFIED)
02198 {
02199
02200 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
02201 }
02202
02203 if(iBack >= 0)
02204 {
02205 OptionalSetDataAction( ID, (__int64)Data );
02206 }
02207 break;
02208
02209 case FEDM_ACC_RAMDATA_MEM:
02210 iBack = FEDM_Base::SetData(ID, Data ? true : false, m_ACC_RAMData, 32);
02211 if(iBack == FEDM_MODIFIED)
02212 {
02213
02214 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
02215 }
02216
02217 if(iBack >= 0)
02218 {
02219 OptionalSetDataAction( ID, (__int64)Data );
02220 }
02221 break;
02222
02223 case FEDM_TMPDATA_MEM:
02224 iBack = FEDM_Base::SetData(ID, Data ? true : false, m_TmpData, 32);
02225 break;
02226 case FEDM_MJPDATA_MEM:
02227 iBack = FEDM_Base::SetData(ID, Data ? true : false, m_MjpData, 16);
02228 break;
02229 case FEDM_SN_MEM:
02230 iBack = FEDM_Base::SetData(ID, Data ? true : false, m_SN_Mem, 16);
02231 break;
02232 case FEDM_ID_MEM:
02233 iBack = FEDM_Base::SetData(ID, Data ? true : false, m_ID_Mem, 16);
02234 break;
02235 case FEDM_AC_MEM:
02236 iBack = FEDM_Base::SetData(ID, Data ? true : false, m_AC_Mem, 16);
02237 break;
02238 case FEDM_PUB_MEM:
02239 iBack = FEDM_Base::SetData(ID, Data ? true : false, m_PubMem, m_iPubMemBlockSize);
02240 break;
02241 case FEDM_SEC_MEM:
02242 iBack = FEDM_Base::SetData(ID, Data ? true : false, m_SecMem, 4);
02243 break;
02244 case FEDM_CONF_MEM:
02245 iBack = FEDM_Base::SetData(ID, Data ? true : false, m_ConfMem, 4);
02246 break;
02247 case FEDM_DATE_MEM:
02248 iBack = FEDM_Base::SetData(ID, Data ? true : false, m_DateMem, 16);
02249 break;
02250 case FEDM_RFC_DATA_MASK_MEM:
02251 iBack = FEDM_Base::SetData(ID, Data ? true : false, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
02252 break;
02253 default:
02254 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
02255 break;
02256 }
02257
02258 if(iBack < 0)
02259 {
02260 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", Data=" << Data << ") - " << GetErrorText(iBack));
02261 }
02262 return iBack;
02263 }
02264 #endif
02265
02266
02267
02268
02269
02270
02271
02272
02273
02274
02275
02276
02277 int FEDM_DataBase::SetData( const char* ID, unsigned char Data )
02278 {
02279 FEDM_CHK3(ID);
02280
02281 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
02282 int iBack = 0;
02283
02284
02285 sscanf( ID, "%d %d %d %d %d %d %d",
02286 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
02287
02288 switch( MemID )
02289 {
02290 case FEDM_RFC_EEDATA_MEM:
02291 iBack = FEDM_Base::SetData(ID, Data, m_RFC_EEData, m_iRFC_DataBlockSize);
02292 if(iBack == FEDM_MODIFIED)
02293 {
02294
02295 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02296 }
02297
02298 if(iBack >= 0)
02299 {
02300 OptionalSetDataAction( ID, (__int64)Data );
02301 }
02302 break;
02303
02304 case FEDM_RFC_RAMDATA_MEM:
02305 iBack = FEDM_Base::SetData(ID, Data, m_RFC_RAMData, m_iRFC_DataBlockSize);
02306 if(iBack == FEDM_MODIFIED)
02307 {
02308
02309 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02310 }
02311
02312 if(iBack >= 0)
02313 {
02314 OptionalSetDataAction( ID, (__int64)Data );
02315 }
02316 break;
02317
02318 case FEDM_ACC_EEDATA_MEM:
02319 iBack = FEDM_Base::SetData(ID, Data, m_ACC_EEData, 32);
02320 if(iBack == FEDM_MODIFIED)
02321 {
02322
02323 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
02324 }
02325
02326 if(iBack >= 0)
02327 {
02328 OptionalSetDataAction( ID, (__int64)Data );
02329 }
02330 break;
02331
02332 case FEDM_ACC_RAMDATA_MEM:
02333 iBack = FEDM_Base::SetData(ID, Data, m_ACC_RAMData, 32);
02334 if(iBack == FEDM_MODIFIED)
02335 {
02336
02337 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
02338 }
02339
02340 if(iBack >= 0)
02341 {
02342 OptionalSetDataAction( ID, (__int64)Data );
02343 }
02344 break;
02345
02346 case FEDM_TMPDATA_MEM:
02347 iBack = FEDM_Base::SetData(ID, Data, m_TmpData, 32);
02348 break;
02349 case FEDM_MJPDATA_MEM:
02350 iBack = FEDM_Base::SetData(ID, Data, m_MjpData, 16);
02351 break;
02352 case FEDM_SN_MEM:
02353 iBack = FEDM_Base::SetData(ID, Data, m_SN_Mem, 16);
02354 break;
02355 case FEDM_ID_MEM:
02356 iBack = FEDM_Base::SetData(ID, Data, m_ID_Mem, 16);
02357 break;
02358 case FEDM_AC_MEM:
02359 iBack = FEDM_Base::SetData(ID, Data, m_AC_Mem, 16);
02360 break;
02361 case FEDM_PUB_MEM:
02362 iBack = FEDM_Base::SetData(ID, Data, m_PubMem, m_iPubMemBlockSize);
02363 break;
02364 case FEDM_SEC_MEM:
02365 iBack = FEDM_Base::SetData(ID, Data, m_SecMem, 4);
02366 break;
02367 case FEDM_CONF_MEM:
02368 iBack = FEDM_Base::SetData(ID, Data, m_ConfMem, 4);
02369 break;
02370 case FEDM_DATE_MEM:
02371 iBack = FEDM_Base::SetData(ID, Data, m_DateMem, 16);
02372 break;
02373 case FEDM_RFC_DATA_MASK_MEM:
02374 iBack = FEDM_Base::SetData(ID, Data, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
02375 break;
02376 default:
02377 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
02378 break;
02379 }
02380
02381 if(iBack < 0)
02382 {
02383 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", Data=0x" << std::hex << std::uppercase << (int)Data << ") - " << GetErrorText(iBack));
02384 }
02385 return iBack;
02386 }
02387
02388
02389
02390
02391
02392
02393
02394
02395
02396
02397
02398
02399
02400 int FEDM_DataBase::SetData( const char* ID, unsigned char* Data, int Cnt )
02401 {
02402 FEDM_CHK3(ID);
02403 FEDM_CHK3(Data);
02404
02405 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
02406 int iBack = 0;
02407 int iLastIndex = 0;
02408 int iBlockAdr = 0;
02409
02410
02411 sscanf( ID, "%d %d %d %d %d %d %d",
02412 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
02413
02414 switch( MemID )
02415 {
02416 case FEDM_RFC_EEDATA_MEM:
02417
02418
02419
02420
02421
02422
02423
02424
02425
02426
02427
02428
02429
02430
02431 iBack = FEDM_Base::SetData(ID, Data, Cnt, m_RFC_EEData, m_iRFC_DataBlockSize);
02432 if(iBack == FEDM_MODIFIED)
02433 {
02434
02435 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02436 iBlockAdr = BlockAdr;
02437 iLastIndex = BytePos + ByteCnt;
02438 while(iLastIndex > m_iRFC_DataBlockSize)
02439 {
02440 iBlockAdr++;
02441 m_RFC_EEData[iBlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02442 iLastIndex -= m_iRFC_DataBlockSize;
02443 }
02444 }
02445
02446 break;
02447
02448 case FEDM_RFC_RAMDATA_MEM:
02449 iBack = FEDM_Base::SetData(ID, Data, Cnt, m_RFC_RAMData, m_iRFC_DataBlockSize);
02450 if(iBack == FEDM_MODIFIED)
02451 {
02452
02453 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02454 iLastIndex = BytePos + ByteCnt;
02455 while(iLastIndex > m_iRFC_DataBlockSize)
02456 {
02457 BlockAdr++;
02458 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02459 iLastIndex -= m_iRFC_DataBlockSize;
02460 }
02461 }
02462
02463 break;
02464
02465 case FEDM_ACC_EEDATA_MEM:
02466
02467
02468
02469
02470
02471
02472
02473
02474
02475
02476
02477
02478
02479
02480 iBack = FEDM_Base::SetData(ID, Data, Cnt, m_ACC_EEData, 32);
02481 if(iBack == FEDM_MODIFIED)
02482 {
02483
02484 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
02485 iBlockAdr = BlockAdr;
02486 iLastIndex = BytePos + ByteCnt;
02487 while(iLastIndex > 32)
02488 {
02489 iBlockAdr++;
02490 m_ACC_EEData[iBlockAdr * 32 + 31] |= 0x02;
02491 iLastIndex -= 32;
02492 }
02493 }
02494
02495 break;
02496
02497 case FEDM_ACC_RAMDATA_MEM:
02498 iBack = FEDM_Base::SetData(ID, Data, Cnt, m_ACC_RAMData, 32);
02499 if(iBack == FEDM_MODIFIED)
02500 {
02501
02502 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
02503 iLastIndex = BytePos + ByteCnt;
02504 while(iLastIndex > 32)
02505 {
02506 BlockAdr++;
02507 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
02508 iLastIndex -= 32;
02509 }
02510 }
02511
02512 break;
02513
02514 case FEDM_TMPDATA_MEM:
02515 iBack = FEDM_Base::SetData(ID, Data, Cnt, m_TmpData, 32);
02516 break;
02517 case FEDM_MJPDATA_MEM:
02518 iBack = FEDM_Base::SetData(ID, Data, Cnt, m_MjpData, 16);
02519 break;
02520 case FEDM_SN_MEM:
02521 iBack = FEDM_Base::SetData(ID, Data, Cnt, m_SN_Mem, 16);
02522 break;
02523 case FEDM_ID_MEM:
02524 iBack = FEDM_Base::SetData(ID, Data, Cnt, m_ID_Mem, 16);
02525 break;
02526 case FEDM_AC_MEM:
02527 iBack = FEDM_Base::SetData(ID, Data, Cnt, m_AC_Mem, 16);
02528 break;
02529 case FEDM_PUB_MEM:
02530 iBack = FEDM_Base::SetData(ID, Data, Cnt, m_PubMem, m_iPubMemBlockSize);
02531 break;
02532 case FEDM_SEC_MEM:
02533 iBack = FEDM_Base::SetData(ID, Data, Cnt, m_SecMem, 4);
02534 break;
02535 case FEDM_CONF_MEM:
02536 iBack = FEDM_Base::SetData(ID, Data, Cnt, m_ConfMem, 4);
02537 break;
02538 case FEDM_DATE_MEM:
02539 iBack = FEDM_Base::SetData(ID, Data, Cnt, m_DateMem, 16);
02540 break;
02541 case FEDM_RFC_DATA_MASK_MEM:
02542 iBack = FEDM_Base::SetData(ID, Data, Cnt, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
02543 break;
02544 default:
02545 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
02546 break;
02547 }
02548
02549 if(iBack < 0)
02550 {
02551 string str;
02552 FEDM_ConvHexUCharToHexStr(Data, Cnt, str);
02553 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", Data=" << str << ") - " << GetErrorText(iBack));
02554 }
02555 return iBack;
02556 }
02557
02558
02559
02560
02561
02562
02563
02564
02565
02566
02567
02568
02569 int FEDM_DataBase::SetData( const char* ID, unsigned int Data )
02570 {
02571 FEDM_CHK3(ID);
02572
02573 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
02574 int iBack = 0;
02575 int iLastIndex = 0;
02576 int iBlockAdr = 0;
02577
02578
02579 sscanf( ID, "%d %d %d %d %d %d %d",
02580 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
02581
02582 switch( MemID )
02583 {
02584 case FEDM_RFC_EEDATA_MEM:
02585 iBack = FEDM_Base::SetData(ID, Data, m_RFC_EEData, m_iRFC_DataBlockSize);
02586 if(iBack == FEDM_MODIFIED)
02587 {
02588
02589 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02590 iBlockAdr = BlockAdr;
02591 iLastIndex = BytePos + ByteCnt;
02592 while(iLastIndex > m_iRFC_DataBlockSize)
02593 {
02594 iBlockAdr++;
02595 m_RFC_EEData[iBlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02596 iLastIndex -= m_iRFC_DataBlockSize;
02597 }
02598 }
02599
02600 if(iBack >= 0)
02601 {
02602 OptionalSetDataAction( ID, (__int64)Data );
02603 }
02604 break;
02605
02606 case FEDM_RFC_RAMDATA_MEM:
02607 iBack = FEDM_Base::SetData(ID, Data, m_RFC_RAMData, m_iRFC_DataBlockSize);
02608 if(iBack == FEDM_MODIFIED)
02609 {
02610
02611 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02612 iLastIndex = BytePos + ByteCnt;
02613 while(iLastIndex > m_iRFC_DataBlockSize)
02614 {
02615 BlockAdr++;
02616 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02617 iLastIndex -= m_iRFC_DataBlockSize;
02618 }
02619 }
02620
02621 if(iBack >= 0)
02622 {
02623 OptionalSetDataAction( ID, (__int64)Data );
02624 }
02625 break;
02626
02627 case FEDM_ACC_EEDATA_MEM:
02628 iBack = FEDM_Base::SetData(ID, Data, m_ACC_EEData, 32);
02629 if(iBack == FEDM_MODIFIED)
02630 {
02631
02632 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
02633 iBlockAdr = BlockAdr;
02634 iLastIndex = BytePos + ByteCnt;
02635 while(iLastIndex > 32)
02636 {
02637 iBlockAdr++;
02638 m_ACC_EEData[iBlockAdr * 32 + 31] |= 0x02;
02639 iLastIndex -= 32;
02640 }
02641 }
02642
02643 if(iBack >= 0)
02644 {
02645 OptionalSetDataAction( ID, (__int64)Data );
02646 }
02647 break;
02648
02649 case FEDM_ACC_RAMDATA_MEM:
02650 iBack = FEDM_Base::SetData(ID, Data, m_ACC_RAMData, 32);
02651 if(iBack == FEDM_MODIFIED)
02652 {
02653
02654 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
02655 iLastIndex = BytePos + ByteCnt;
02656 while(iLastIndex > 32)
02657 {
02658 BlockAdr++;
02659 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
02660 iLastIndex -= 32;
02661 }
02662 }
02663
02664 if(iBack >= 0)
02665 {
02666 OptionalSetDataAction( ID, (__int64)Data );
02667 }
02668 break;
02669
02670 case FEDM_TMPDATA_MEM:
02671 iBack = FEDM_Base::SetData(ID, Data, m_TmpData, 32);
02672 break;
02673 case FEDM_MJPDATA_MEM:
02674 iBack = FEDM_Base::SetData(ID, Data, m_MjpData, 16);
02675 break;
02676 case FEDM_SN_MEM:
02677 iBack = FEDM_Base::SetData(ID, Data, m_SN_Mem, 16);
02678 break;
02679 case FEDM_ID_MEM:
02680 iBack = FEDM_Base::SetData(ID, Data, m_ID_Mem, 16);
02681 break;
02682 case FEDM_AC_MEM:
02683 iBack = FEDM_Base::SetData(ID, Data, m_AC_Mem, 16);
02684 break;
02685 case FEDM_PUB_MEM:
02686 iBack = FEDM_Base::SetData(ID, Data, m_PubMem, m_iPubMemBlockSize);
02687 break;
02688 case FEDM_SEC_MEM:
02689 iBack = FEDM_Base::SetData(ID, Data, m_SecMem, 4);
02690 break;
02691 case FEDM_CONF_MEM:
02692 iBack = FEDM_Base::SetData(ID, Data, m_ConfMem, 4);
02693 break;
02694 case FEDM_DATE_MEM:
02695 iBack = FEDM_Base::SetData(ID, Data, m_DateMem, 16);
02696 break;
02697 case FEDM_RFC_DATA_MASK_MEM:
02698 iBack = FEDM_Base::SetData(ID, Data, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
02699 break;
02700 default:
02701 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
02702 break;
02703 }
02704
02705 if(iBack < 0)
02706 {
02707 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", Data=" << Data << ") - " << GetErrorText(iBack));
02708 }
02709 return iBack;
02710 }
02711
02712
02713
02714
02715
02716
02717
02718
02719
02720
02721
02722
02723 int FEDM_DataBase::SetData( const char* ID, __int64 Data )
02724 {
02725 FEDM_CHK3(ID);
02726
02727 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
02728 int iBack = 0;
02729 int iLastIndex = 0;
02730 int iBlockAdr = 0;
02731
02732
02733 sscanf( ID, "%d %d %d %d %d %d %d",
02734 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
02735
02736 switch( MemID )
02737 {
02738 case FEDM_RFC_EEDATA_MEM:
02739 iBack = FEDM_Base::SetData(ID, Data, m_RFC_EEData, m_iRFC_DataBlockSize);
02740 if(iBack == FEDM_MODIFIED)
02741 {
02742
02743 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02744 iBlockAdr = BlockAdr;
02745 iLastIndex = BytePos + ByteCnt;
02746 while(iLastIndex > m_iRFC_DataBlockSize)
02747 {
02748 iBlockAdr++;
02749 m_RFC_EEData[iBlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02750 iLastIndex -= m_iRFC_DataBlockSize;
02751 }
02752 }
02753
02754 if(iBack >= 0)
02755 {
02756 OptionalSetDataAction( ID, (__int64)Data );
02757 }
02758 break;
02759
02760 case FEDM_RFC_RAMDATA_MEM:
02761 iBack = FEDM_Base::SetData(ID, Data, m_RFC_RAMData, m_iRFC_DataBlockSize);
02762 if(iBack == FEDM_MODIFIED)
02763 {
02764
02765 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02766 iLastIndex = BytePos + ByteCnt;
02767 while(iLastIndex > m_iRFC_DataBlockSize)
02768 {
02769 BlockAdr++;
02770 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02771 iLastIndex -= m_iRFC_DataBlockSize;
02772 }
02773 }
02774
02775 if(iBack >= 0)
02776 {
02777 OptionalSetDataAction( ID, (__int64)Data );
02778 }
02779 break;
02780
02781 case FEDM_ACC_EEDATA_MEM:
02782 iBack = FEDM_Base::SetData(ID, Data, m_ACC_EEData, 32);
02783 if(iBack == FEDM_MODIFIED)
02784 {
02785
02786 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
02787 iBlockAdr = BlockAdr;
02788 iLastIndex = BytePos + ByteCnt;
02789 while(iLastIndex > 32)
02790 {
02791 iBlockAdr++;
02792 m_ACC_EEData[iBlockAdr * 32 + 31] |= 0x02;
02793 iLastIndex -= 32;
02794 }
02795 }
02796
02797 if(iBack >= 0)
02798 {
02799 OptionalSetDataAction( ID, (__int64)Data );
02800 }
02801 break;
02802
02803 case FEDM_ACC_RAMDATA_MEM:
02804 iBack = FEDM_Base::SetData(ID, Data, m_ACC_RAMData, 32);
02805 if(iBack == FEDM_MODIFIED)
02806 {
02807
02808 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
02809 iLastIndex = BytePos + ByteCnt;
02810 while(iLastIndex > 32)
02811 {
02812 BlockAdr++;
02813 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
02814 iLastIndex -= 32;
02815 }
02816 }
02817
02818 if(iBack >= 0)
02819 {
02820 OptionalSetDataAction( ID, (__int64)Data );
02821 }
02822 break;
02823
02824 case FEDM_TMPDATA_MEM:
02825 iBack = FEDM_Base::SetData(ID, Data, m_TmpData, 32);
02826 break;
02827 case FEDM_MJPDATA_MEM:
02828 iBack = FEDM_Base::SetData(ID, Data, m_MjpData, 16);
02829 break;
02830 case FEDM_SN_MEM:
02831 iBack = FEDM_Base::SetData(ID, Data, m_SN_Mem, 16);
02832 break;
02833 case FEDM_ID_MEM:
02834 iBack = FEDM_Base::SetData(ID, Data, m_ID_Mem, 16);
02835 break;
02836 case FEDM_AC_MEM:
02837 iBack = FEDM_Base::SetData(ID, Data, m_AC_Mem, 16);
02838 break;
02839 case FEDM_PUB_MEM:
02840 iBack = FEDM_Base::SetData(ID, Data, m_PubMem, m_iPubMemBlockSize);
02841 break;
02842 case FEDM_SEC_MEM:
02843 iBack = FEDM_Base::SetData(ID, Data, m_SecMem, 4);
02844 break;
02845 case FEDM_CONF_MEM:
02846 iBack = FEDM_Base::SetData(ID, Data, m_ConfMem, 4);
02847 break;
02848 case FEDM_DATE_MEM:
02849 iBack = FEDM_Base::SetData(ID, Data, m_DateMem, 16);
02850 break;
02851 case FEDM_RFC_DATA_MASK_MEM:
02852 iBack = FEDM_Base::SetData(ID, Data, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
02853 break;
02854 default:
02855 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
02856 break;
02857 }
02858
02859 if(iBack < 0)
02860 {
02861 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", Data=" << Data << ") - " << GetErrorText(iBack));
02862 }
02863 return iBack;
02864 }
02865
02866
02867
02868
02869
02870
02871
02872
02873
02874
02875
02876
02877 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
02878 int FEDM_DataBase::SetData( const char* ID, CString Data )
02879 {
02880 FEDM_CHK3(ID);
02881
02882 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
02883 int iBack = 0;
02884 int iLastIndex = 0;
02885 int iBlockAdr = 0;
02886
02887
02888 sscanf( ID, "%d %d %d %d %d %d %d",
02889 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
02890
02891 switch( MemID )
02892 {
02893 case FEDM_RFC_EEDATA_MEM:
02894 iBack = FEDM_Base::SetData(ID, Data, m_RFC_EEData, m_iRFC_DataBlockSize);
02895 if(iBack == FEDM_MODIFIED)
02896 {
02897
02898 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02899 iBlockAdr = BlockAdr;
02900 iLastIndex = BytePos + ByteCnt;
02901 while(iLastIndex > m_iRFC_DataBlockSize)
02902 {
02903 iBlockAdr++;
02904 m_RFC_EEData[iBlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02905 iLastIndex -= m_iRFC_DataBlockSize;
02906 }
02907 }
02908
02909 if(iBack >= 0)
02910 {
02911 OptionalSetDataAction( ID, Data );
02912 }
02913 break;
02914
02915 case FEDM_RFC_RAMDATA_MEM:
02916 iBack = FEDM_Base::SetData(ID, Data, m_RFC_RAMData, m_iRFC_DataBlockSize);
02917 if(iBack == FEDM_MODIFIED)
02918 {
02919
02920 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02921 iLastIndex = BytePos + ByteCnt;
02922 while(iLastIndex > m_iRFC_DataBlockSize)
02923 {
02924 BlockAdr++;
02925 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
02926 iLastIndex -= m_iRFC_DataBlockSize;
02927 }
02928 }
02929
02930 if(iBack >= 0)
02931 {
02932 OptionalSetDataAction( ID, Data );
02933 }
02934 break;
02935
02936 case FEDM_ACC_EEDATA_MEM:
02937 iBack = FEDM_Base::SetData(ID, Data, m_ACC_EEData, 32);
02938 if(iBack == FEDM_MODIFIED)
02939 {
02940
02941 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
02942 iBlockAdr = BlockAdr;
02943 iLastIndex = BytePos + ByteCnt;
02944 while(iLastIndex > 32)
02945 {
02946 iBlockAdr++;
02947 m_ACC_EEData[iBlockAdr * 32 + 31] |= 0x02;
02948 iLastIndex -= 32;
02949 }
02950 }
02951
02952 if(iBack >= 0)
02953 {
02954 OptionalSetDataAction( ID, Data );
02955 }
02956 break;
02957
02958 case FEDM_ACC_RAMDATA_MEM:
02959 iBack = FEDM_Base::SetData(ID, Data, m_ACC_RAMData, 32);
02960 if(iBack == FEDM_MODIFIED)
02961 {
02962
02963 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
02964 iLastIndex = BytePos + ByteCnt;
02965 while(iLastIndex > 32)
02966 {
02967 BlockAdr++;
02968 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
02969 iLastIndex -= 32;
02970 }
02971 }
02972
02973 if(iBack >= 0)
02974 {
02975 OptionalSetDataAction( ID, Data );
02976 }
02977 break;
02978
02979 case FEDM_TMPDATA_MEM:
02980 iBack = FEDM_Base::SetData(ID, Data, m_TmpData, 32);
02981 break;
02982 case FEDM_MJPDATA_MEM:
02983 iBack = FEDM_Base::SetData(ID, Data, m_MjpData, 16);
02984 break;
02985 case FEDM_SN_MEM:
02986 iBack = FEDM_Base::SetData(ID, Data, m_SN_Mem, 16);
02987 break;
02988 case FEDM_ID_MEM:
02989 iBack = FEDM_Base::SetData(ID, Data, m_ID_Mem, 16);
02990 break;
02991 case FEDM_AC_MEM:
02992 iBack = FEDM_Base::SetData(ID, Data, m_AC_Mem, 16);
02993 break;
02994 case FEDM_PUB_MEM:
02995 iBack = FEDM_Base::SetData(ID, Data, m_PubMem, m_iPubMemBlockSize);
02996 break;
02997 case FEDM_SEC_MEM:
02998 iBack = FEDM_Base::SetData(ID, Data, m_SecMem, 4);
02999 break;
03000 case FEDM_CONF_MEM:
03001 iBack = FEDM_Base::SetData(ID, Data, m_ConfMem, 4);
03002 break;
03003 case FEDM_DATE_MEM:
03004 iBack = FEDM_Base::SetData(ID, Data, m_DateMem, 16);
03005 break;
03006 case FEDM_RFC_DATA_MASK_MEM:
03007 iBack = FEDM_Base::SetData(ID, Data, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
03008 break;
03009 default:
03010 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
03011 break;
03012 }
03013
03014 if(iBack < 0)
03015 {
03016 #if !defined(_WIN32_WCE)
03017 string str = Data;
03018 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", Data=" << str << ") - " << GetErrorText(iBack));
03019 #endif
03020 }
03021 return iBack;
03022 }
03023 #endif
03024
03025
03026
03027
03028
03029
03030
03031
03032
03033
03034
03035
03036 int FEDM_DataBase::SetData( const char* ID, string Data )
03037 {
03038 FEDM_CHK3(ID);
03039
03040 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
03041 int iBack = 0;
03042 int iLastIndex = 0;
03043 int iBlockAdr = 0;
03044
03045
03046 sscanf( ID, "%d %d %d %d %d %d %d",
03047 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
03048
03049 switch( MemID )
03050 {
03051 case FEDM_RFC_EEDATA_MEM:
03052 iBack = FEDM_Base::SetData(ID, Data, m_RFC_EEData, m_iRFC_DataBlockSize);
03053 if(iBack == FEDM_MODIFIED)
03054 {
03055
03056 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03057 iBlockAdr = BlockAdr;
03058 iLastIndex = BytePos + ByteCnt;
03059 while(iLastIndex > m_iRFC_DataBlockSize)
03060 {
03061 iBlockAdr++;
03062 m_RFC_EEData[iBlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03063 iLastIndex -= m_iRFC_DataBlockSize;
03064 }
03065 }
03066
03067 if(iBack >= 0)
03068 {
03069 OptionalSetDataAction( ID, Data );
03070 }
03071 break;
03072
03073 case FEDM_RFC_RAMDATA_MEM:
03074 iBack = FEDM_Base::SetData(ID, Data, m_RFC_RAMData, m_iRFC_DataBlockSize);
03075 if(iBack == FEDM_MODIFIED)
03076 {
03077
03078 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03079 iLastIndex = BytePos + ByteCnt;
03080 while(iLastIndex > m_iRFC_DataBlockSize)
03081 {
03082 BlockAdr++;
03083 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03084 iLastIndex -= m_iRFC_DataBlockSize;
03085 }
03086 }
03087
03088 if(iBack >= 0)
03089 {
03090 OptionalSetDataAction( ID, Data );
03091 }
03092 break;
03093
03094 case FEDM_ACC_EEDATA_MEM:
03095 iBack = FEDM_Base::SetData(ID, Data, m_ACC_EEData, 32);
03096 if(iBack == FEDM_MODIFIED)
03097 {
03098
03099 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
03100 iBlockAdr = BlockAdr;
03101 iLastIndex = BytePos + ByteCnt;
03102 while(iLastIndex > 32)
03103 {
03104 iBlockAdr++;
03105 m_ACC_EEData[iBlockAdr * 32 + 31] |= 0x02;
03106 iLastIndex -= 32;
03107 }
03108 }
03109
03110 if(iBack >= 0)
03111 {
03112 OptionalSetDataAction( ID, Data );
03113 }
03114 break;
03115
03116 case FEDM_ACC_RAMDATA_MEM:
03117 iBack = FEDM_Base::SetData(ID, Data, m_ACC_RAMData, 32);
03118 if(iBack == FEDM_MODIFIED)
03119 {
03120
03121 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
03122 iLastIndex = BytePos + ByteCnt;
03123 while(iLastIndex > 32)
03124 {
03125 BlockAdr++;
03126 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
03127 iLastIndex -= 32;
03128 }
03129 }
03130
03131 if(iBack >= 0)
03132 {
03133 OptionalSetDataAction( ID, Data );
03134 }
03135 break;
03136
03137 case FEDM_TMPDATA_MEM:
03138 iBack = FEDM_Base::SetData(ID, Data, m_TmpData, 32);
03139 break;
03140 case FEDM_MJPDATA_MEM:
03141 iBack = FEDM_Base::SetData(ID, Data, m_MjpData, 16);
03142 break;
03143 case FEDM_SN_MEM:
03144 iBack = FEDM_Base::SetData(ID, Data, m_SN_Mem, 16);
03145 break;
03146 case FEDM_ID_MEM:
03147 iBack = FEDM_Base::SetData(ID, Data, m_ID_Mem, 16);
03148 break;
03149 case FEDM_AC_MEM:
03150 iBack = FEDM_Base::SetData(ID, Data, m_AC_Mem, 16);
03151 break;
03152 case FEDM_PUB_MEM:
03153 iBack = FEDM_Base::SetData(ID, Data, m_PubMem, m_iPubMemBlockSize);
03154 break;
03155 case FEDM_SEC_MEM:
03156 iBack = FEDM_Base::SetData(ID, Data, m_SecMem, 4);
03157 break;
03158 case FEDM_CONF_MEM:
03159 iBack = FEDM_Base::SetData(ID, Data, m_ConfMem, 4);
03160 break;
03161 case FEDM_DATE_MEM:
03162 iBack = FEDM_Base::SetData(ID, Data, m_DateMem, 16);
03163 break;
03164 case FEDM_RFC_DATA_MASK_MEM:
03165 iBack = FEDM_Base::SetData(ID, Data, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
03166 break;
03167 default:
03168 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
03169 break;
03170 }
03171
03172 if(iBack < 0)
03173 {
03174 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", Data=" << Data << ") - " << GetErrorText(iBack));
03175 }
03176 return iBack;
03177 }
03178
03179
03180
03181
03182
03183
03184
03185
03186
03187
03188
03189
03190
03191 int FEDM_DataBase::SetData( const char* ID, char* Data, int DataLen )
03192 {
03193 FEDM_CHK3(ID);
03194 FEDM_CHK3(Data);
03195
03196 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
03197 int iBack = 0;
03198 int iLastIndex = 0;
03199 int iBlockAdr = 0;
03200
03201
03202 sscanf( ID, "%d %d %d %d %d %d %d",
03203 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
03204
03205 switch( MemID )
03206 {
03207 case FEDM_RFC_EEDATA_MEM:
03208 iBack = FEDM_Base::SetData(ID, Data, DataLen, m_RFC_EEData, m_iRFC_DataBlockSize);
03209 if(iBack == FEDM_MODIFIED)
03210 {
03211
03212 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03213 iBlockAdr = BlockAdr;
03214 iLastIndex = BytePos + ByteCnt;
03215 while(iLastIndex > m_iRFC_DataBlockSize)
03216 {
03217 iBlockAdr++;
03218 m_RFC_EEData[iBlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03219 iLastIndex -= m_iRFC_DataBlockSize;
03220 }
03221 }
03222
03223 break;
03224
03225 case FEDM_RFC_RAMDATA_MEM:
03226 iBack = FEDM_Base::SetData(ID, Data, DataLen, m_RFC_RAMData, m_iRFC_DataBlockSize);
03227 if(iBack == FEDM_MODIFIED)
03228 {
03229
03230 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03231 iLastIndex = BytePos + ByteCnt;
03232 while(iLastIndex > m_iRFC_DataBlockSize)
03233 {
03234 BlockAdr++;
03235 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03236 iLastIndex -= m_iRFC_DataBlockSize;
03237 }
03238 }
03239
03240 break;
03241
03242 case FEDM_ACC_EEDATA_MEM:
03243 iBack = FEDM_Base::SetData(ID, Data, DataLen, m_ACC_EEData, 32);
03244 if(iBack == FEDM_MODIFIED)
03245 {
03246
03247 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
03248 iBlockAdr = BlockAdr;
03249 iLastIndex = BytePos + ByteCnt;
03250 while(iLastIndex > 32)
03251 {
03252 iBlockAdr++;
03253 m_ACC_EEData[iBlockAdr * 32 + 31] |= 0x02;
03254 iLastIndex -= 32;
03255 }
03256 }
03257
03258 break;
03259
03260 case FEDM_ACC_RAMDATA_MEM:
03261 iBack = FEDM_Base::SetData(ID, Data, DataLen, m_ACC_RAMData, 32);
03262 if(iBack == FEDM_MODIFIED)
03263 {
03264
03265 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
03266 iLastIndex = BytePos + ByteCnt;
03267 while(iLastIndex > 32)
03268 {
03269 BlockAdr++;
03270 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
03271 iLastIndex -= 32;
03272 }
03273 }
03274
03275 break;
03276
03277 case FEDM_TMPDATA_MEM:
03278 iBack = FEDM_Base::SetData(ID, Data, DataLen, m_TmpData, 32);
03279 break;
03280 case FEDM_MJPDATA_MEM:
03281 iBack = FEDM_Base::SetData(ID, Data, DataLen, m_MjpData, 16);
03282 break;
03283 case FEDM_SN_MEM:
03284 iBack = FEDM_Base::SetData(ID, Data, DataLen, m_SN_Mem, 16);
03285 break;
03286 case FEDM_ID_MEM:
03287 iBack = FEDM_Base::SetData(ID, Data, DataLen, m_ID_Mem, 16);
03288 break;
03289 case FEDM_AC_MEM:
03290 iBack = FEDM_Base::SetData(ID, Data, DataLen, m_AC_Mem, 16);
03291 break;
03292 case FEDM_PUB_MEM:
03293 iBack = FEDM_Base::SetData(ID, Data, DataLen, m_PubMem, m_iPubMemBlockSize);
03294 break;
03295 case FEDM_SEC_MEM:
03296 iBack = FEDM_Base::SetData(ID, Data, DataLen, m_SecMem, 4);
03297 break;
03298 case FEDM_CONF_MEM:
03299 iBack = FEDM_Base::SetData(ID, Data, DataLen, m_ConfMem, 4);
03300 break;
03301 case FEDM_DATE_MEM:
03302 iBack = FEDM_Base::SetData(ID, Data, DataLen, m_DateMem, 16);
03303 break;
03304 case FEDM_RFC_DATA_MASK_MEM:
03305 iBack = FEDM_Base::SetData(ID, Data, DataLen, m_RFC_CfgProfileMask, m_iRFC_DataBlockSize);
03306 break;
03307 default:
03308 iBack = FEDM_ERROR_UNKNOWN_MEM_ID;
03309 break;
03310 }
03311
03312 if(iBack < 0)
03313 {
03314 Data[DataLen] = 0;
03315 FEDM_TRACE(m_pLogger, FELOGMNG_DBG_ERROR, __FUNCTION__ << "(ID=" << ID << ", Data=" << Data << ") - " << GetErrorText(iBack));
03316 }
03317 return iBack;
03318 }
03319
03320
03321
03322
03323
03324
03325
03326
03327
03328
03329
03330
03331
03332
03333
03334
03335
03336
03337
03338 int FEDM_DataBase::GetData( int Adr, unsigned char* Data, int MemID )
03339 {
03340 FEDM_CHK3(Data);
03341
03342 switch( MemID )
03343 {
03344 case FEDM_RFC_EEDATA_MEM:
03345 return FEDM_Base::GetData(Adr, Data, m_RFC_EEData);
03346 case FEDM_RFC_RAMDATA_MEM:
03347 return FEDM_Base::GetData(Adr, Data, m_RFC_RAMData);
03348 case FEDM_ACC_EEDATA_MEM:
03349 return FEDM_Base::GetData(Adr, Data, m_ACC_EEData);
03350 case FEDM_ACC_RAMDATA_MEM:
03351 return FEDM_Base::GetData(Adr, Data, m_ACC_RAMData);
03352 case FEDM_TMPDATA_MEM:
03353 return FEDM_Base::GetData(Adr, Data, m_TmpData);
03354 case FEDM_MJPDATA_MEM:
03355 return FEDM_Base::GetData(Adr, Data, m_MjpData);
03356 case FEDM_SN_MEM:
03357 return FEDM_Base::GetData(Adr, Data, m_SN_Mem);
03358 case FEDM_ID_MEM:
03359 return FEDM_Base::GetData(Adr, Data, m_ID_Mem);
03360 case FEDM_AC_MEM:
03361 return FEDM_Base::GetData(Adr, Data, m_AC_Mem);
03362 case FEDM_PUB_MEM:
03363 return FEDM_Base::GetData(Adr, Data, m_PubMem);
03364 case FEDM_SEC_MEM:
03365 return FEDM_Base::GetData(Adr, Data, m_SecMem);
03366 case FEDM_CONF_MEM:
03367 return FEDM_Base::GetData(Adr, Data, m_ConfMem);
03368 case FEDM_DATE_MEM:
03369 return FEDM_Base::GetData(Adr, Data, m_DateMem);
03370 case FEDM_RFC_DATA_MASK_MEM:
03371 return FEDM_Base::GetData(Adr, Data, m_RFC_CfgProfileMask);
03372 default:
03373 return FEDM_ERROR_UNKNOWN_MEM_ID;
03374 }
03375
03376 return FEDM_OK;
03377 }
03378
03379
03380
03381
03382
03383
03384
03385
03386
03387
03388
03389
03390
03391
03392 int FEDM_DataBase::GetData( int Adr, unsigned char* Data, int Cnt, int MemID )
03393 {
03394 FEDM_CHK3(Data);
03395
03396 switch( MemID )
03397 {
03398 case FEDM_RFC_EEDATA_MEM:
03399 return FEDM_Base::GetData(Adr, Data, Cnt, m_RFC_EEData);
03400 case FEDM_RFC_RAMDATA_MEM:
03401 return FEDM_Base::GetData(Adr, Data, Cnt, m_RFC_RAMData);
03402 case FEDM_ACC_EEDATA_MEM:
03403 return FEDM_Base::GetData(Adr, Data, Cnt, m_ACC_EEData);
03404 case FEDM_ACC_RAMDATA_MEM:
03405 return FEDM_Base::GetData(Adr, Data, Cnt, m_ACC_RAMData);
03406 case FEDM_TMPDATA_MEM:
03407 return FEDM_Base::GetData(Adr, Data, Cnt, m_TmpData);
03408 case FEDM_MJPDATA_MEM:
03409 return FEDM_Base::GetData(Adr, Data, Cnt, m_MjpData);
03410 case FEDM_SN_MEM:
03411 return FEDM_Base::GetData(Adr, Data, Cnt, m_SN_Mem);
03412 case FEDM_ID_MEM:
03413 return FEDM_Base::GetData(Adr, Data, Cnt, m_ID_Mem);
03414 case FEDM_AC_MEM:
03415 return FEDM_Base::GetData(Adr, Data, Cnt, m_AC_Mem);
03416 case FEDM_PUB_MEM:
03417 return FEDM_Base::GetData(Adr, Data, Cnt, m_PubMem);
03418 case FEDM_SEC_MEM:
03419 return FEDM_Base::GetData(Adr, Data, Cnt, m_SecMem);
03420 case FEDM_CONF_MEM:
03421 return FEDM_Base::GetData(Adr, Data, Cnt, m_ConfMem);
03422 case FEDM_DATE_MEM:
03423 return FEDM_Base::GetData(Adr, Data, Cnt, m_DateMem);
03424 case FEDM_RFC_DATA_MASK_MEM:
03425 return FEDM_Base::GetData(Adr, Data, Cnt, m_RFC_CfgProfileMask);
03426 default:
03427 return FEDM_ERROR_UNKNOWN_MEM_ID;
03428 }
03429
03430 return FEDM_OK;
03431 }
03432
03433
03434
03435
03436
03437
03438
03439
03440
03441
03442
03443
03444
03445
03446 int FEDM_DataBase::GetData( int Adr, unsigned int* Data, int MemID )
03447 {
03448 FEDM_CHK3(Data);
03449
03450 switch( MemID )
03451 {
03452 case FEDM_RFC_EEDATA_MEM:
03453 return FEDM_Base::GetData(Adr, Data, m_RFC_EEData);
03454 case FEDM_RFC_RAMDATA_MEM:
03455 return FEDM_Base::GetData(Adr, Data, m_RFC_RAMData);
03456 case FEDM_ACC_EEDATA_MEM:
03457 return FEDM_Base::GetData(Adr, Data, m_ACC_EEData);
03458 case FEDM_ACC_RAMDATA_MEM:
03459 return FEDM_Base::GetData(Adr, Data, m_ACC_RAMData);
03460 case FEDM_TMPDATA_MEM:
03461 return FEDM_Base::GetData(Adr, Data, m_TmpData);
03462 case FEDM_MJPDATA_MEM:
03463 return FEDM_Base::GetData(Adr, Data, m_MjpData);
03464 case FEDM_SN_MEM:
03465 return FEDM_Base::GetData(Adr, Data, m_SN_Mem);
03466 case FEDM_ID_MEM:
03467 return FEDM_Base::GetData(Adr, Data, m_ID_Mem);
03468 case FEDM_AC_MEM:
03469 return FEDM_Base::GetData(Adr, Data, m_AC_Mem);
03470 case FEDM_PUB_MEM:
03471 return FEDM_Base::GetData(Adr, Data, m_PubMem);
03472 case FEDM_SEC_MEM:
03473 return FEDM_Base::GetData(Adr, Data, m_SecMem);
03474 case FEDM_CONF_MEM:
03475 return FEDM_Base::GetData(Adr, Data, m_ConfMem);
03476 case FEDM_DATE_MEM:
03477 return FEDM_Base::GetData(Adr, Data, m_DateMem);
03478 case FEDM_RFC_DATA_MASK_MEM:
03479 return FEDM_Base::GetData(Adr, Data, m_RFC_CfgProfileMask);
03480 default:
03481 return FEDM_ERROR_UNKNOWN_MEM_ID;
03482 }
03483
03484 return FEDM_OK;
03485 }
03486
03487
03488
03489
03490
03491
03492
03493
03494
03495
03496
03497
03498
03499 int FEDM_DataBase::GetData( int Adr, __int64* Data, int MemID )
03500 {
03501 FEDM_CHK3(Data);
03502
03503 switch( MemID )
03504 {
03505 case FEDM_RFC_EEDATA_MEM:
03506 return FEDM_Base::GetData(Adr, Data, m_RFC_EEData);
03507 case FEDM_RFC_RAMDATA_MEM:
03508 return FEDM_Base::GetData(Adr, Data, m_RFC_RAMData);
03509 case FEDM_ACC_EEDATA_MEM:
03510 return FEDM_Base::GetData(Adr, Data, m_ACC_EEData);
03511 case FEDM_ACC_RAMDATA_MEM:
03512 return FEDM_Base::GetData(Adr, Data, m_ACC_RAMData);
03513 case FEDM_TMPDATA_MEM:
03514 return FEDM_Base::GetData(Adr, Data, m_TmpData);
03515 case FEDM_MJPDATA_MEM:
03516 return FEDM_Base::GetData(Adr, Data, m_MjpData);
03517 case FEDM_SN_MEM:
03518 return FEDM_Base::GetData(Adr, Data, m_SN_Mem);
03519 case FEDM_ID_MEM:
03520 return FEDM_Base::GetData(Adr, Data, m_ID_Mem);
03521 case FEDM_AC_MEM:
03522 return FEDM_Base::GetData(Adr, Data, m_AC_Mem);
03523 case FEDM_PUB_MEM:
03524 return FEDM_Base::GetData(Adr, Data, m_PubMem);
03525 case FEDM_SEC_MEM:
03526 return FEDM_Base::GetData(Adr, Data, m_SecMem);
03527 case FEDM_CONF_MEM:
03528 return FEDM_Base::GetData(Adr, Data, m_ConfMem);
03529 case FEDM_DATE_MEM:
03530 return FEDM_Base::GetData(Adr, Data, m_DateMem);
03531 case FEDM_RFC_DATA_MASK_MEM:
03532 return FEDM_Base::GetData(Adr, Data, m_RFC_CfgProfileMask);
03533 default:
03534 return FEDM_ERROR_UNKNOWN_MEM_ID;
03535 }
03536
03537 return FEDM_OK;
03538 }
03539
03540
03541
03542
03543
03544
03545
03546
03547
03548
03549
03550
03551
03552
03553 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
03554 int FEDM_DataBase::GetData( int Adr, CString& Data, int Cnt, int MemID )
03555 {
03556 FEDM_CHK3(&Data);
03557
03558 switch( MemID )
03559 {
03560 case FEDM_RFC_EEDATA_MEM:
03561 return FEDM_Base::GetData(Adr, Data, Cnt, m_RFC_EEData);
03562 case FEDM_RFC_RAMDATA_MEM:
03563 return FEDM_Base::GetData(Adr, Data, Cnt, m_RFC_RAMData);
03564 case FEDM_ACC_EEDATA_MEM:
03565 return FEDM_Base::GetData(Adr, Data, Cnt, m_ACC_EEData);
03566 case FEDM_ACC_RAMDATA_MEM:
03567 return FEDM_Base::GetData(Adr, Data, Cnt, m_ACC_RAMData);
03568 case FEDM_TMPDATA_MEM:
03569 return FEDM_Base::GetData(Adr, Data, Cnt, m_TmpData);
03570 case FEDM_MJPDATA_MEM:
03571 return FEDM_Base::GetData(Adr, Data, Cnt, m_MjpData);
03572 case FEDM_SN_MEM:
03573 return FEDM_Base::GetData(Adr, Data, Cnt, m_SN_Mem);
03574 case FEDM_ID_MEM:
03575 return FEDM_Base::GetData(Adr, Data, Cnt, m_ID_Mem);
03576 case FEDM_AC_MEM:
03577 return FEDM_Base::GetData(Adr, Data, Cnt, m_AC_Mem);
03578 case FEDM_PUB_MEM:
03579 return FEDM_Base::GetData(Adr, Data, Cnt, m_PubMem);
03580 case FEDM_SEC_MEM:
03581 return FEDM_Base::GetData(Adr, Data, Cnt, m_SecMem);
03582 case FEDM_CONF_MEM:
03583 return FEDM_Base::GetData(Adr, Data, Cnt, m_ConfMem);
03584 case FEDM_DATE_MEM:
03585 return FEDM_Base::GetData(Adr, Data, Cnt, m_DateMem);
03586 case FEDM_RFC_DATA_MASK_MEM:
03587 return FEDM_Base::GetData(Adr, Data, Cnt, m_RFC_CfgProfileMask);
03588 default:
03589 return FEDM_ERROR_UNKNOWN_MEM_ID;
03590 }
03591
03592 return FEDM_OK;
03593 }
03594 #endif
03595
03596
03597
03598
03599
03600
03601
03602
03603
03604
03605
03606
03607
03608 int FEDM_DataBase::SetData( int Adr, unsigned char Data, int MemID )
03609 {
03610 int iBack = 0;
03611 int BlockAdr = 0;
03612
03613 switch( MemID )
03614 {
03615 case FEDM_RFC_EEDATA_MEM:
03616 iBack = FEDM_Base::SetData(Adr, Data, m_RFC_EEData);
03617 if(iBack == FEDM_MODIFIED)
03618 {
03619
03620 BlockAdr = Adr >> 4;
03621 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03622 }
03623 return iBack;
03624
03625 case FEDM_RFC_RAMDATA_MEM:
03626 iBack = FEDM_Base::SetData(Adr, Data, m_RFC_RAMData);
03627 if(iBack == FEDM_MODIFIED)
03628 {
03629
03630 BlockAdr = Adr >> 4;
03631 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03632 }
03633 return iBack;
03634
03635 case FEDM_ACC_EEDATA_MEM:
03636 iBack = FEDM_Base::SetData(Adr, Data, m_ACC_EEData);
03637 if(iBack == FEDM_MODIFIED)
03638 {
03639
03640 BlockAdr = Adr >> 5;
03641 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
03642 }
03643 return iBack;
03644
03645 case FEDM_ACC_RAMDATA_MEM:
03646 iBack = FEDM_Base::SetData(Adr, Data, m_ACC_RAMData);
03647 if(iBack == FEDM_MODIFIED)
03648 {
03649
03650 BlockAdr = Adr >> 5;
03651 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
03652 }
03653 return iBack;
03654
03655 case FEDM_TMPDATA_MEM:
03656 return FEDM_Base::SetData(Adr, Data, m_TmpData);
03657 case FEDM_MJPDATA_MEM:
03658 return FEDM_Base::SetData(Adr, Data, m_MjpData);
03659 case FEDM_SN_MEM:
03660 return FEDM_Base::SetData(Adr, Data, m_SN_Mem);
03661 case FEDM_ID_MEM:
03662 return FEDM_Base::SetData(Adr, Data, m_ID_Mem);
03663 case FEDM_AC_MEM:
03664 return FEDM_Base::SetData(Adr, Data, m_AC_Mem);
03665 case FEDM_PUB_MEM:
03666 return FEDM_Base::SetData(Adr, Data, m_PubMem);
03667 case FEDM_SEC_MEM:
03668 return FEDM_Base::SetData(Adr, Data, m_SecMem);
03669 case FEDM_CONF_MEM:
03670 return FEDM_Base::SetData(Adr, Data, m_ConfMem);
03671 case FEDM_DATE_MEM:
03672 return FEDM_Base::SetData(Adr, Data, m_DateMem);
03673 case FEDM_RFC_DATA_MASK_MEM:
03674 return FEDM_Base::SetData(Adr, Data, m_RFC_CfgProfileMask);
03675 default:
03676 return FEDM_ERROR_UNKNOWN_MEM_ID;
03677 }
03678
03679 return FEDM_OK;
03680 }
03681
03682
03683
03684
03685
03686
03687
03688
03689
03690
03691
03692
03693
03694
03695 int FEDM_DataBase::SetData( int Adr, unsigned char* Data, int Cnt, int MemID )
03696 {
03697 FEDM_CHK3(Data);
03698
03699 int iBack = 0;
03700 int BlockAdr = 0;
03701 int iCnt = Cnt;
03702
03703 switch( MemID )
03704 {
03705 case FEDM_RFC_EEDATA_MEM:
03706 iBack = FEDM_Base::SetData(Adr, Data, Cnt, m_RFC_EEData);
03707 if(iBack == FEDM_MODIFIED)
03708 {
03709
03710 BlockAdr = Adr >> 4;
03711 iCnt = Cnt;
03712 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03713 while(iCnt > m_iRFC_DataBlockSize)
03714 {
03715 BlockAdr++;
03716 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03717 iCnt -= m_iRFC_DataBlockSize;
03718 }
03719 }
03720 return iBack;
03721
03722 case FEDM_RFC_RAMDATA_MEM:
03723 iBack = FEDM_Base::SetData(Adr, Data, Cnt, m_RFC_RAMData);
03724 if(iBack == FEDM_MODIFIED)
03725 {
03726
03727 BlockAdr = Adr >> 4;
03728 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03729 while(Cnt > m_iRFC_DataBlockSize)
03730 {
03731 BlockAdr++;
03732 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03733 Cnt -= m_iRFC_DataBlockSize;
03734 }
03735 }
03736 return iBack;
03737
03738 case FEDM_ACC_EEDATA_MEM:
03739 iBack = FEDM_Base::SetData(Adr, Data, Cnt, m_ACC_EEData);
03740 if(iBack == FEDM_MODIFIED)
03741 {
03742
03743 BlockAdr = Adr >> 5;
03744 iCnt = Cnt;
03745 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
03746 while(Cnt > 32)
03747 {
03748 BlockAdr++;
03749 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
03750 Cnt -= 32;
03751 }
03752 }
03753 return iBack;
03754
03755 case FEDM_ACC_RAMDATA_MEM:
03756 iBack = FEDM_Base::SetData(Adr, Data, Cnt, m_ACC_RAMData);
03757 if(iBack == FEDM_MODIFIED)
03758 {
03759
03760 BlockAdr = Adr >> 5;
03761 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
03762 while(Cnt > 32)
03763 {
03764 BlockAdr++;
03765 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
03766 Cnt -= 32;
03767 }
03768 }
03769 return iBack;
03770
03771 case FEDM_TMPDATA_MEM:
03772 return FEDM_Base::SetData(Adr, Data, Cnt, m_TmpData);
03773 case FEDM_MJPDATA_MEM:
03774 return FEDM_Base::SetData(Adr, Data, Cnt, m_MjpData);
03775 case FEDM_SN_MEM:
03776 return FEDM_Base::SetData(Adr, Data, Cnt, m_SN_Mem);
03777 case FEDM_ID_MEM:
03778 return FEDM_Base::SetData(Adr, Data, Cnt, m_ID_Mem);
03779 case FEDM_AC_MEM:
03780 return FEDM_Base::SetData(Adr, Data, Cnt, m_AC_Mem);
03781 case FEDM_PUB_MEM:
03782 return FEDM_Base::SetData(Adr, Data, Cnt, m_PubMem);
03783 case FEDM_SEC_MEM:
03784 return FEDM_Base::SetData(Adr, Data, Cnt, m_SecMem);
03785 case FEDM_CONF_MEM:
03786 return FEDM_Base::SetData(Adr, Data, Cnt, m_ConfMem);
03787 case FEDM_DATE_MEM:
03788 return FEDM_Base::SetData(Adr, Data, Cnt, m_DateMem);
03789 case FEDM_RFC_DATA_MASK_MEM:
03790 return FEDM_Base::SetData(Adr, Data, Cnt, m_RFC_CfgProfileMask);
03791 default:
03792 return FEDM_ERROR_UNKNOWN_MEM_ID;
03793 }
03794
03795 return FEDM_OK;
03796 }
03797
03798
03799
03800
03801
03802
03803
03804
03805
03806
03807
03808
03809
03810 int FEDM_DataBase::SetData( int Adr, unsigned int Data, int MemID )
03811 {
03812 int iBack = 0;
03813 int BlockAdr = 0;
03814
03815 switch( MemID )
03816 {
03817 case FEDM_RFC_EEDATA_MEM:
03818 iBack = FEDM_Base::SetData(Adr, Data, m_RFC_EEData);
03819 if(iBack == FEDM_MODIFIED)
03820 {
03821
03822 BlockAdr = Adr >> 4;
03823 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03824 if( BlockAdr < ((Adr + 4) >> 4))
03825 {
03826 BlockAdr++;
03827 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03828 }
03829 }
03830 return iBack;
03831
03832 case FEDM_RFC_RAMDATA_MEM:
03833 iBack = FEDM_Base::SetData(Adr, Data, m_RFC_RAMData);
03834 if(iBack == FEDM_MODIFIED)
03835 {
03836
03837 BlockAdr = Adr >> 4;
03838 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03839 if( BlockAdr < ((Adr + 4) >> 4))
03840 {
03841 BlockAdr++;
03842 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03843 }
03844 }
03845 return iBack;
03846
03847 case FEDM_ACC_EEDATA_MEM:
03848 iBack = FEDM_Base::SetData(Adr, Data, m_ACC_EEData);
03849 if(iBack == FEDM_MODIFIED)
03850 {
03851
03852 BlockAdr = Adr >> 5;
03853 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
03854 if( BlockAdr < ((Adr + 4) >> 5))
03855 {
03856 BlockAdr++;
03857 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
03858 }
03859 }
03860 return iBack;
03861
03862 case FEDM_ACC_RAMDATA_MEM:
03863 iBack = FEDM_Base::SetData(Adr, Data, m_ACC_RAMData);
03864 if(iBack == FEDM_MODIFIED)
03865 {
03866
03867 BlockAdr = Adr >> 5;
03868 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
03869 if( BlockAdr < ((Adr + 4) >> 5))
03870 {
03871 BlockAdr++;
03872 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
03873 }
03874 }
03875 return iBack;
03876
03877 case FEDM_TMPDATA_MEM:
03878 return FEDM_Base::SetData(Adr, Data, m_TmpData);
03879 case FEDM_MJPDATA_MEM:
03880 return FEDM_Base::SetData(Adr, Data, m_MjpData);
03881 case FEDM_SN_MEM:
03882 return FEDM_Base::SetData(Adr, Data, m_SN_Mem);
03883 case FEDM_ID_MEM:
03884 return FEDM_Base::SetData(Adr, Data, m_ID_Mem);
03885 case FEDM_AC_MEM:
03886 return FEDM_Base::SetData(Adr, Data, m_AC_Mem);
03887 case FEDM_PUB_MEM:
03888 return FEDM_Base::SetData(Adr, Data, m_PubMem);
03889 case FEDM_SEC_MEM:
03890 return FEDM_Base::SetData(Adr, Data, m_SecMem);
03891 case FEDM_CONF_MEM:
03892 return FEDM_Base::SetData(Adr, Data, m_ConfMem);
03893 case FEDM_DATE_MEM:
03894 return FEDM_Base::SetData(Adr, Data, m_DateMem);
03895 case FEDM_RFC_DATA_MASK_MEM:
03896 return FEDM_Base::SetData(Adr, Data, m_RFC_CfgProfileMask);
03897 default:
03898 return FEDM_ERROR_UNKNOWN_MEM_ID;
03899 }
03900
03901 return FEDM_OK;
03902 }
03903
03904
03905
03906
03907
03908
03909
03910
03911
03912
03913
03914
03915
03916 int FEDM_DataBase::SetData( int Adr, __int64 Data, int MemID )
03917 {
03918 int iBack = 0;
03919 int BlockAdr = 0;
03920
03921 switch( MemID )
03922 {
03923 case FEDM_RFC_EEDATA_MEM:
03924 iBack = FEDM_Base::SetData(Adr, Data, m_RFC_EEData);
03925 if(iBack == FEDM_MODIFIED)
03926 {
03927
03928 BlockAdr = Adr >> 4;
03929 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03930 if( BlockAdr < ((Adr + 8) >> 4))
03931 {
03932 BlockAdr++;
03933 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03934 }
03935 }
03936 return iBack;
03937
03938 case FEDM_RFC_RAMDATA_MEM:
03939 iBack = FEDM_Base::SetData(Adr, Data, m_RFC_RAMData);
03940 if(iBack == FEDM_MODIFIED)
03941 {
03942
03943 BlockAdr = Adr >> 4;
03944 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03945 if( BlockAdr < ((Adr + 8) >> 4))
03946 {
03947 BlockAdr++;
03948 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
03949 }
03950 }
03951 return iBack;
03952
03953 case FEDM_ACC_EEDATA_MEM:
03954 iBack = FEDM_Base::SetData(Adr, Data, m_ACC_EEData);
03955 if(iBack == FEDM_MODIFIED)
03956 {
03957
03958 BlockAdr = Adr >> 5;
03959 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
03960 if( BlockAdr < ((Adr + 8) >> 5))
03961 {
03962 BlockAdr++;
03963 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
03964 }
03965 }
03966 return iBack;
03967
03968 case FEDM_ACC_RAMDATA_MEM:
03969 iBack = FEDM_Base::SetData(Adr, Data, m_ACC_RAMData);
03970 if(iBack == FEDM_MODIFIED)
03971 {
03972
03973 BlockAdr = Adr >> 5;
03974 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
03975 if( BlockAdr < ((Adr + 8) >> 5))
03976 {
03977 BlockAdr++;
03978 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
03979 }
03980 }
03981 return iBack;
03982
03983 case FEDM_TMPDATA_MEM:
03984 return FEDM_Base::SetData(Adr, Data, m_TmpData);
03985 case FEDM_MJPDATA_MEM:
03986 return FEDM_Base::SetData(Adr, Data, m_MjpData);
03987 case FEDM_SN_MEM:
03988 return FEDM_Base::SetData(Adr, Data, m_SN_Mem);
03989 case FEDM_ID_MEM:
03990 return FEDM_Base::SetData(Adr, Data, m_ID_Mem);
03991 case FEDM_AC_MEM:
03992 return FEDM_Base::SetData(Adr, Data, m_AC_Mem);
03993 case FEDM_PUB_MEM:
03994 return FEDM_Base::SetData(Adr, Data, m_PubMem);
03995 case FEDM_SEC_MEM:
03996 return FEDM_Base::SetData(Adr, Data, m_SecMem);
03997 case FEDM_CONF_MEM:
03998 return FEDM_Base::SetData(Adr, Data, m_ConfMem);
03999 case FEDM_DATE_MEM:
04000 return FEDM_Base::SetData(Adr, Data, m_DateMem);
04001 case FEDM_RFC_DATA_MASK_MEM:
04002 return FEDM_Base::SetData(Adr, Data, m_RFC_CfgProfileMask);
04003 default:
04004 return FEDM_ERROR_UNKNOWN_MEM_ID;
04005 }
04006
04007 return FEDM_OK;
04008 }
04009
04010
04011
04012
04013
04014
04015
04016
04017
04018
04019
04020
04021
04022 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
04023 int FEDM_DataBase::SetData( int Adr, CString Data, int MemID )
04024 {
04025 int iBack = 0;
04026 int BlockAdr = 0;
04027 int iLen = 0;
04028
04029 switch( MemID )
04030 {
04031 case FEDM_RFC_EEDATA_MEM:
04032 iBack = FEDM_Base::SetData(Adr, Data, m_RFC_EEData);
04033 if(iBack == FEDM_MODIFIED)
04034 {
04035
04036 BlockAdr = Adr >> 4;
04037 #if defined(_FEDM_MFC_SUPPORT)
04038 iLen = (Data.GetLength() >> 2);
04039 #endif
04040 #if defined(__BORLANDC__)
04041 iLen = (Data.Length() >> 2);
04042 #endif
04043 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04044 while(iLen > m_iRFC_DataBlockSize)
04045 {
04046 BlockAdr++;
04047 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04048 iLen -= m_iRFC_DataBlockSize;
04049 }
04050 }
04051 return iBack;
04052
04053 case FEDM_RFC_RAMDATA_MEM:
04054 iBack = FEDM_Base::SetData(Adr, Data, m_RFC_RAMData);
04055 if(iBack == FEDM_MODIFIED)
04056 {
04057
04058 BlockAdr = Adr >> 4;
04059 #if defined(_FEDM_MFC_SUPPORT)
04060 iLen = (Data.GetLength() >> 2);
04061 #endif
04062 #if defined(__BORLANDC__)
04063 iLen = (Data.Length() >> 2);
04064 #endif
04065 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04066 while(iLen > m_iRFC_DataBlockSize)
04067 {
04068 BlockAdr++;
04069 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04070 iLen -= m_iRFC_DataBlockSize;
04071 }
04072 }
04073 return iBack;
04074
04075 case FEDM_ACC_EEDATA_MEM:
04076 iBack = FEDM_Base::SetData(Adr, Data, m_ACC_EEData);
04077 if(iBack == FEDM_MODIFIED)
04078 {
04079
04080 BlockAdr = Adr >> 5;
04081 #if defined(_FEDM_MFC_SUPPORT)
04082 iLen = (Data.GetLength() >> 2);
04083 #endif
04084 #if defined(__BORLANDC__)
04085 iLen = (Data.Length() >> 2);
04086 #endif
04087 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
04088 while(iLen > 32)
04089 {
04090 BlockAdr++;
04091 m_ACC_EEData[BlockAdr * 32 + 31] |= 0x02;
04092 iLen -= 32;
04093 }
04094 }
04095 return iBack;
04096
04097 case FEDM_ACC_RAMDATA_MEM:
04098 iBack = FEDM_Base::SetData(Adr, Data, m_ACC_RAMData);
04099 if(iBack == FEDM_MODIFIED)
04100 {
04101
04102 BlockAdr = Adr >> 5;
04103 #if defined(_FEDM_MFC_SUPPORT)
04104 iLen = (Data.GetLength() >> 2);
04105 #endif
04106 #if defined(__BORLANDC__)
04107 iLen = (Data.Length() >> 2);
04108 #endif
04109 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
04110 while(iLen > 32)
04111 {
04112 BlockAdr++;
04113 m_ACC_RAMData[BlockAdr * 32 + 31] |= 0x02;
04114 iLen -= 32;
04115 }
04116 }
04117 return iBack;
04118
04119 case FEDM_TMPDATA_MEM:
04120 return FEDM_Base::SetData(Adr, Data, m_TmpData);
04121 case FEDM_MJPDATA_MEM:
04122 return FEDM_Base::SetData(Adr, Data, m_MjpData);
04123 case FEDM_SN_MEM:
04124 return FEDM_Base::SetData(Adr, Data, m_SN_Mem);
04125 case FEDM_ID_MEM:
04126 return FEDM_Base::SetData(Adr, Data, m_ID_Mem);
04127 case FEDM_AC_MEM:
04128 return FEDM_Base::SetData(Adr, Data, m_AC_Mem);
04129 case FEDM_PUB_MEM:
04130 return FEDM_Base::SetData(Adr, Data, m_PubMem);
04131 case FEDM_SEC_MEM:
04132 return FEDM_Base::SetData(Adr, Data, m_SecMem);
04133 case FEDM_CONF_MEM:
04134 return FEDM_Base::SetData(Adr, Data, m_ConfMem);
04135 case FEDM_DATE_MEM:
04136 return FEDM_Base::SetData(Adr, Data, m_DateMem);
04137 case FEDM_RFC_DATA_MASK_MEM:
04138 return FEDM_Base::SetData(Adr, Data, m_RFC_CfgProfileMask);
04139 default:
04140 return FEDM_ERROR_UNKNOWN_MEM_ID;
04141 }
04142
04143 return FEDM_OK;
04144 }
04145 #endif
04146
04147
04148
04149
04150
04151
04152
04153
04154
04155
04156
04157
04158
04159
04160
04161
04162
04163
04164
04165
04166
04167
04168 void FEDM_DataBase::OptionalSetDataAction( const char* ID, __int64 Data )
04169 {
04170 bool bPara1 = false;
04171 bool bPara2 = false;
04172 bool bPara3 = false;
04173 bool bPara4 = false;
04174 bool bPara5 = false;
04175 unsigned char ucPara = 0;
04176 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
04177 int iBack = 0;
04178
04179
04180 sscanf( ID, "%d %d %d %d %d %d %d",
04181 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
04182
04183 switch( MemID )
04184 {
04185 case FEDM_RFC_EEDATA_MEM:
04186 if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==0 && BitCnt==1 &&
04187 (m_uiReaderType==FEDM_ISC_TYPE_ISCPRH200 ||
04188 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
04189 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04190 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04191 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
04192 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
04193 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1000 ||
04194 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
04195 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
04196 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
04197 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04198 {
04199 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
04200 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_EEData, m_iRFC_DataBlockSize);
04201 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_EEData, m_iRFC_DataBlockSize);
04202 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_EEData, m_iRFC_DataBlockSize);
04203 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_EEData, m_iRFC_DataBlockSize);
04204
04205
04206 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_EEData, m_iRFC_DataBlockSize);
04207 if(iBack == FEDM_MODIFIED)
04208 {
04209
04210 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04211 }
04212 }
04213 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==1 && BitCnt==1 &&
04214 (m_uiReaderType==FEDM_ISC_TYPE_CPR50_XX ||
04215 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
04216 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04217 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04218 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
04219 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
04220 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1000 ||
04221 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
04222 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
04223 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
04224 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04225 {
04226 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
04227 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_EEData, m_iRFC_DataBlockSize);
04228 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_EEData, m_iRFC_DataBlockSize);
04229 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_EEData, m_iRFC_DataBlockSize);
04230 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_EEData, m_iRFC_DataBlockSize);
04231
04232
04233 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_EEData, m_iRFC_DataBlockSize);
04234 if(iBack == FEDM_MODIFIED)
04235 {
04236
04237 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04238 }
04239 }
04240 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==2 && BitCnt==1 &&
04241 (m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04242 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04243 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B) )
04244 {
04245 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
04246 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_EEData, m_iRFC_DataBlockSize);
04247 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_EEData, m_iRFC_DataBlockSize);
04248 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_EEData, m_iRFC_DataBlockSize);
04249 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_EEData, m_iRFC_DataBlockSize);
04250
04251
04252 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_EEData, m_iRFC_DataBlockSize);
04253 if(iBack == FEDM_MODIFIED)
04254 {
04255
04256 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04257 }
04258 }
04259 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==4 && BitCnt==1 &&
04260 (m_uiReaderType==FEDM_ISC_TYPE_ISCPRHD102 ||
04261 m_uiReaderType==FEDM_ISC_TYPE_ISCPRH200 ||
04262 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
04263 m_uiReaderType==FEDM_ISC_TYPE_ISCLR1002 ||
04264 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04265 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04266 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
04267 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU102 ||
04268 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
04269 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
04270 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
04271 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
04272 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04273 {
04274 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
04275 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_EEData, m_iRFC_DataBlockSize);
04276 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_EEData, m_iRFC_DataBlockSize);
04277 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_EEData, m_iRFC_DataBlockSize);
04278 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_EEData, m_iRFC_DataBlockSize);
04279
04280
04281 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_EEData, m_iRFC_DataBlockSize);
04282 if(iBack == FEDM_MODIFIED)
04283 {
04284
04285 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04286 }
04287 }
04288 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==5 && BitCnt==1 &&
04289 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B )
04290 {
04291 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
04292 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_EEData, m_iRFC_DataBlockSize);
04293 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_EEData, m_iRFC_DataBlockSize);
04294 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_EEData, m_iRFC_DataBlockSize);
04295 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_EEData, m_iRFC_DataBlockSize);
04296
04297
04298 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_EEData, m_iRFC_DataBlockSize);
04299 if(iBack == FEDM_MODIFIED)
04300 {
04301
04302 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04303 }
04304 }
04305 else if( BlockAdr==11 && BytePos==2 && ByteCnt==1 && BitPos==2 && BitCnt==1 &&
04306 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04307 {
04308 FEDM_Base::GetData("03 03 11 02 01 02 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
04309
04310
04311 iBack = FEDM_Base::SetData("03 03 11 01 01 07 01", bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
04312 if(iBack == FEDM_MODIFIED)
04313 {
04314
04315 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04316 }
04317 }
04318 else if( BlockAdr==15 && BytePos==1 && ByteCnt==1 && BitPos==3 && BitCnt==4 &&
04319 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04320 {
04321 FEDM_Base::GetData("03 03 15 01 01 03 04", &ucPara, m_RFC_EEData, m_iRFC_DataBlockSize);
04322
04323 if(ucPara > 0)
04324 {
04325
04326 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", true, m_RFC_EEData, m_iRFC_DataBlockSize);
04327 if(iBack == FEDM_MODIFIED)
04328 {
04329
04330 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04331 }
04332 }
04333 else
04334 {
04335
04336 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", false, m_RFC_EEData, m_iRFC_DataBlockSize);
04337 if(iBack == FEDM_MODIFIED)
04338 {
04339
04340 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04341 }
04342 }
04343 }
04344 else if( BlockAdr==15 && BytePos==1 && ByteCnt==1 && BitPos==0 && BitCnt==3 &&
04345 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04346 {
04347 FEDM_Base::GetData("03 03 15 01 01 00 03", &ucPara, m_RFC_EEData, m_iRFC_DataBlockSize);
04348
04349 if(ucPara > 0)
04350 {
04351
04352 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", false, m_RFC_EEData, m_iRFC_DataBlockSize);
04353 if(iBack == FEDM_MODIFIED)
04354 {
04355
04356 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04357 }
04358 }
04359 }
04360 break;
04361
04362 case FEDM_RFC_RAMDATA_MEM:
04363 if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==0 && BitCnt==1 &&
04364 (m_uiReaderType==FEDM_ISC_TYPE_ISCPRH200 ||
04365 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
04366 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04367 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04368 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
04369 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
04370 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1000 ||
04371 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
04372 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
04373 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
04374 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04375 {
04376 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
04377 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_RAMData, m_iRFC_DataBlockSize);
04378 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_RAMData, m_iRFC_DataBlockSize);
04379 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_RAMData, m_iRFC_DataBlockSize);
04380 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_RAMData, m_iRFC_DataBlockSize);
04381
04382
04383 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_RAMData, m_iRFC_DataBlockSize);
04384 if(iBack == FEDM_MODIFIED)
04385 {
04386
04387 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04388 }
04389 }
04390 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==1 && BitCnt==1 &&
04391 (m_uiReaderType==FEDM_ISC_TYPE_CPR50_XX ||
04392 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
04393 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04394 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04395 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
04396 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
04397 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1000 ||
04398 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
04399 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
04400 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
04401 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04402 {
04403 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
04404 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_RAMData, m_iRFC_DataBlockSize);
04405 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_RAMData, m_iRFC_DataBlockSize);
04406 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_RAMData, m_iRFC_DataBlockSize);
04407 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_RAMData, m_iRFC_DataBlockSize);
04408
04409
04410 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_RAMData, m_iRFC_DataBlockSize);
04411 if(iBack == FEDM_MODIFIED)
04412 {
04413
04414 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04415 }
04416 }
04417 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==2 && BitCnt==1 &&
04418 (m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04419 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04420 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B) )
04421 {
04422 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
04423 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_RAMData, m_iRFC_DataBlockSize);
04424 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_RAMData, m_iRFC_DataBlockSize);
04425 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_RAMData, m_iRFC_DataBlockSize);
04426 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_RAMData, m_iRFC_DataBlockSize);
04427
04428
04429 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_RAMData, m_iRFC_DataBlockSize);
04430 if(iBack == FEDM_MODIFIED)
04431 {
04432
04433 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04434 }
04435 }
04436 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==4 && BitCnt==1 &&
04437 (m_uiReaderType==FEDM_ISC_TYPE_ISCPRHD102 ||
04438 m_uiReaderType==FEDM_ISC_TYPE_ISCPRH200 ||
04439 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
04440 m_uiReaderType==FEDM_ISC_TYPE_ISCLR1002 ||
04441 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04442 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04443 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
04444 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU102 ||
04445 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
04446 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
04447 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
04448 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04449 {
04450 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
04451 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_RAMData, m_iRFC_DataBlockSize);
04452 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_RAMData, m_iRFC_DataBlockSize);
04453 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_RAMData, m_iRFC_DataBlockSize);
04454 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_RAMData, m_iRFC_DataBlockSize);
04455
04456
04457 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_RAMData, m_iRFC_DataBlockSize);
04458 if(iBack == FEDM_MODIFIED)
04459 {
04460
04461 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04462 }
04463 }
04464 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==5 && BitCnt==1 &&
04465 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B )
04466 {
04467 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
04468 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_RAMData, m_iRFC_DataBlockSize);
04469 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_RAMData, m_iRFC_DataBlockSize);
04470 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_RAMData, m_iRFC_DataBlockSize);
04471 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_RAMData, m_iRFC_DataBlockSize);
04472
04473
04474 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_RAMData, m_iRFC_DataBlockSize);
04475 if(iBack == FEDM_MODIFIED)
04476 {
04477
04478 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04479 }
04480 }
04481 else if( BlockAdr==11 && BytePos==2 && ByteCnt==1 && BitPos==2 && BitCnt==1 &&
04482 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04483 {
04484 FEDM_Base::GetData("03 03 11 02 01 02 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
04485
04486
04487 iBack = FEDM_Base::SetData("03 03 11 01 01 07 01", bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
04488 if(iBack == FEDM_MODIFIED)
04489 {
04490
04491 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04492 }
04493 }
04494 else if( BlockAdr==15 && BytePos==1 && ByteCnt==1 && BitPos==3 && BitCnt==4 &&
04495 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04496 {
04497 FEDM_Base::GetData("03 03 15 01 01 03 04", &ucPara, m_RFC_RAMData, m_iRFC_DataBlockSize);
04498
04499 if(ucPara > 0)
04500 {
04501
04502 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", true, m_RFC_RAMData, m_iRFC_DataBlockSize);
04503 if(iBack == FEDM_MODIFIED)
04504 {
04505
04506 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04507 }
04508 }
04509 else
04510 {
04511
04512 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", false, m_RFC_RAMData, m_iRFC_DataBlockSize);
04513 if(iBack == FEDM_MODIFIED)
04514 {
04515
04516 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04517 }
04518 }
04519 }
04520 else if( BlockAdr==15 && BytePos==1 && ByteCnt==1 && BitPos==0 && BitCnt==3 &&
04521 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04522 {
04523 FEDM_Base::GetData("03 03 15 01 01 00 03", &ucPara, m_RFC_RAMData, m_iRFC_DataBlockSize);
04524
04525 if(ucPara > 0)
04526 {
04527
04528 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", false, m_RFC_RAMData, m_iRFC_DataBlockSize);
04529 if(iBack == FEDM_MODIFIED)
04530 {
04531
04532 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04533 }
04534 }
04535 }
04536 break;
04537 }
04538 }
04539
04540
04541
04542
04543
04544
04545
04546
04547
04548
04549
04550
04551
04552
04553
04554
04555
04556
04557
04558
04559
04560 void FEDM_DataBase::OptionalSetDataAction( const char* ID, string Data )
04561 {
04562 bool bPara1 = false;
04563 bool bPara2 = false;
04564 bool bPara3 = false;
04565 bool bPara4 = false;
04566 bool bPara5 = false;
04567 unsigned char ucPara = 0;
04568 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
04569 int iBack = 0;
04570
04571
04572 sscanf( ID, "%d %d %d %d %d %d %d",
04573 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
04574
04575 switch( MemID )
04576 {
04577 case FEDM_RFC_EEDATA_MEM:
04578 if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==0 && BitCnt==1 &&
04579 (m_uiReaderType==FEDM_ISC_TYPE_ISCPRH200 ||
04580 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
04581 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04582 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04583 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
04584 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
04585 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1000 ||
04586 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
04587 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
04588 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
04589 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04590 {
04591 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
04592 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_EEData, m_iRFC_DataBlockSize);
04593 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_EEData, m_iRFC_DataBlockSize);
04594 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_EEData, m_iRFC_DataBlockSize);
04595 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_EEData, m_iRFC_DataBlockSize);
04596
04597
04598 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_EEData, m_iRFC_DataBlockSize);
04599 if(iBack == FEDM_MODIFIED)
04600 {
04601
04602 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04603 }
04604 }
04605 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==1 && BitCnt==1 &&
04606 (m_uiReaderType==FEDM_ISC_TYPE_CPR50_XX ||
04607 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
04608 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04609 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04610 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
04611 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
04612 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1000 ||
04613 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
04614 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
04615 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
04616 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04617 {
04618 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
04619 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_EEData, m_iRFC_DataBlockSize);
04620 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_EEData, m_iRFC_DataBlockSize);
04621 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_EEData, m_iRFC_DataBlockSize);
04622 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_EEData, m_iRFC_DataBlockSize);
04623
04624
04625 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_EEData, m_iRFC_DataBlockSize);
04626 if(iBack == FEDM_MODIFIED)
04627 {
04628
04629 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04630 }
04631 }
04632 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==2 && BitCnt==1 &&
04633 (m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04634 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04635 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B) )
04636 {
04637 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
04638 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_EEData, m_iRFC_DataBlockSize);
04639 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_EEData, m_iRFC_DataBlockSize);
04640 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_EEData, m_iRFC_DataBlockSize);
04641 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_EEData, m_iRFC_DataBlockSize);
04642
04643
04644 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_EEData, m_iRFC_DataBlockSize);
04645 if(iBack == FEDM_MODIFIED)
04646 {
04647
04648 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04649 }
04650 }
04651 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==4 && BitCnt==1 &&
04652 (m_uiReaderType==FEDM_ISC_TYPE_ISCPRHD102 ||
04653 m_uiReaderType==FEDM_ISC_TYPE_ISCPRH200 ||
04654 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
04655 m_uiReaderType==FEDM_ISC_TYPE_ISCLR1002 ||
04656 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04657 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04658 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
04659 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU102 ||
04660 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
04661 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
04662 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
04663 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
04664 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04665 {
04666 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
04667 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_EEData, m_iRFC_DataBlockSize);
04668 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_EEData, m_iRFC_DataBlockSize);
04669 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_EEData, m_iRFC_DataBlockSize);
04670 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_EEData, m_iRFC_DataBlockSize);
04671
04672
04673 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_EEData, m_iRFC_DataBlockSize);
04674 if(iBack == FEDM_MODIFIED)
04675 {
04676
04677 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04678 }
04679 }
04680 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==5 && BitCnt==1 &&
04681 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B )
04682 {
04683 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
04684 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_EEData, m_iRFC_DataBlockSize);
04685 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_EEData, m_iRFC_DataBlockSize);
04686 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_EEData, m_iRFC_DataBlockSize);
04687 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_EEData, m_iRFC_DataBlockSize);
04688
04689
04690 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_EEData, m_iRFC_DataBlockSize);
04691 if(iBack == FEDM_MODIFIED)
04692 {
04693
04694 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04695 }
04696 }
04697 else if( BlockAdr==11 && BytePos==2 && ByteCnt==1 && BitPos==2 && BitCnt==1 &&
04698 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04699 {
04700 FEDM_Base::GetData("03 03 11 02 01 02 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
04701
04702
04703 iBack = FEDM_Base::SetData("03 03 11 01 01 07 01", (bool)(bPara1), m_RFC_EEData, m_iRFC_DataBlockSize);
04704 if(iBack == FEDM_MODIFIED)
04705 {
04706
04707 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04708 }
04709 }
04710 else if( BlockAdr==15 && BytePos==1 && ByteCnt==1 && BitPos==3 && BitCnt==4 &&
04711 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04712 {
04713 FEDM_Base::GetData("03 03 15 01 01 03 04", &ucPara, m_RFC_EEData, m_iRFC_DataBlockSize);
04714
04715 if(ucPara > 0)
04716 {
04717
04718 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", true, m_RFC_EEData, m_iRFC_DataBlockSize);
04719 if(iBack == FEDM_MODIFIED)
04720 {
04721
04722 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04723 }
04724 }
04725 else
04726 {
04727
04728 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", false, m_RFC_EEData, m_iRFC_DataBlockSize);
04729 if(iBack == FEDM_MODIFIED)
04730 {
04731
04732 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04733 }
04734 }
04735 }
04736 else if( BlockAdr==15 && BytePos==1 && ByteCnt==1 && BitPos==0 && BitCnt==3 &&
04737 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04738 {
04739 FEDM_Base::GetData("03 03 15 01 01 00 03", &ucPara, m_RFC_EEData, m_iRFC_DataBlockSize);
04740
04741 if(ucPara > 0)
04742 {
04743
04744 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", false, m_RFC_EEData, m_iRFC_DataBlockSize);
04745 if(iBack == FEDM_MODIFIED)
04746 {
04747
04748 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04749 }
04750 }
04751 }
04752 break;
04753
04754 case FEDM_RFC_RAMDATA_MEM:
04755 if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==0 && BitCnt==1 &&
04756 (m_uiReaderType==FEDM_ISC_TYPE_ISCPRH200 ||
04757 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
04758 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04759 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04760 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
04761 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
04762 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1000 ||
04763 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
04764 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
04765 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
04766 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04767 {
04768 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
04769 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_RAMData, m_iRFC_DataBlockSize);
04770 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_RAMData, m_iRFC_DataBlockSize);
04771 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_RAMData, m_iRFC_DataBlockSize);
04772 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_RAMData, m_iRFC_DataBlockSize);
04773
04774
04775 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_RAMData, m_iRFC_DataBlockSize);
04776 if(iBack == FEDM_MODIFIED)
04777 {
04778
04779 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04780 }
04781 }
04782 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==1 && BitCnt==1 &&
04783 (m_uiReaderType==FEDM_ISC_TYPE_CPR50_XX ||
04784 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
04785 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04786 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04787 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
04788 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
04789 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1000 ||
04790 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
04791 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
04792 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
04793 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04794 {
04795 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
04796 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_RAMData, m_iRFC_DataBlockSize);
04797 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_RAMData, m_iRFC_DataBlockSize);
04798 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_RAMData, m_iRFC_DataBlockSize);
04799 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_RAMData, m_iRFC_DataBlockSize);
04800
04801
04802 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_RAMData, m_iRFC_DataBlockSize);
04803 if(iBack == FEDM_MODIFIED)
04804 {
04805
04806 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04807 }
04808 }
04809 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==2 && BitCnt==1 &&
04810 (m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04811 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04812 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B) )
04813 {
04814 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
04815 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_RAMData, m_iRFC_DataBlockSize);
04816 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_RAMData, m_iRFC_DataBlockSize);
04817 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_RAMData, m_iRFC_DataBlockSize);
04818 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_RAMData, m_iRFC_DataBlockSize);
04819
04820
04821 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_RAMData, m_iRFC_DataBlockSize);
04822 if(iBack == FEDM_MODIFIED)
04823 {
04824
04825 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04826 }
04827 }
04828 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==4 && BitCnt==1 &&
04829 (m_uiReaderType==FEDM_ISC_TYPE_ISCPRHD102 ||
04830 m_uiReaderType==FEDM_ISC_TYPE_ISCPRH200 ||
04831 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
04832 m_uiReaderType==FEDM_ISC_TYPE_ISCLR1002 ||
04833 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04834 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04835 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
04836 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU102 ||
04837 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
04838 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
04839 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
04840 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
04841 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04842 {
04843 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
04844 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_RAMData, m_iRFC_DataBlockSize);
04845 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_RAMData, m_iRFC_DataBlockSize);
04846 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_RAMData, m_iRFC_DataBlockSize);
04847 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_RAMData, m_iRFC_DataBlockSize);
04848
04849
04850 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_RAMData, m_iRFC_DataBlockSize);
04851 if(iBack == FEDM_MODIFIED)
04852 {
04853
04854 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04855 }
04856 }
04857 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==5 && BitCnt==1 &&
04858 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B )
04859 {
04860 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
04861 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_RAMData, m_iRFC_DataBlockSize);
04862 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_RAMData, m_iRFC_DataBlockSize);
04863 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_RAMData, m_iRFC_DataBlockSize);
04864 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_RAMData, m_iRFC_DataBlockSize);
04865
04866
04867 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_RAMData, m_iRFC_DataBlockSize);
04868 if(iBack == FEDM_MODIFIED)
04869 {
04870
04871 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04872 }
04873 }
04874 else if( BlockAdr==11 && BytePos==2 && ByteCnt==1 && BitPos==2 && BitCnt==1 &&
04875 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04876 {
04877 FEDM_Base::GetData("03 03 11 02 01 02 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
04878
04879
04880 iBack = FEDM_Base::SetData("03 03 11 01 01 07 01", (bool)(bPara1), m_RFC_RAMData, m_iRFC_DataBlockSize);
04881 if(iBack == FEDM_MODIFIED)
04882 {
04883
04884 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04885 }
04886 }
04887 else if( BlockAdr==15 && BytePos==1 && ByteCnt==1 && BitPos==3 && BitCnt==4 &&
04888 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04889 {
04890 FEDM_Base::GetData("03 03 15 01 01 03 04", &ucPara, m_RFC_RAMData, m_iRFC_DataBlockSize);
04891
04892 if(ucPara > 0)
04893 {
04894
04895 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", true, m_RFC_RAMData, m_iRFC_DataBlockSize);
04896 if(iBack == FEDM_MODIFIED)
04897 {
04898
04899 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04900 }
04901 }
04902 else
04903 {
04904
04905 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", false, m_RFC_RAMData, m_iRFC_DataBlockSize);
04906 if(iBack == FEDM_MODIFIED)
04907 {
04908
04909 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04910 }
04911 }
04912 }
04913 else if( BlockAdr==15 && BytePos==1 && ByteCnt==1 && BitPos==0 && BitCnt==3 &&
04914 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04915 {
04916 FEDM_Base::GetData("03 03 15 01 01 00 03", &ucPara, m_RFC_RAMData, m_iRFC_DataBlockSize);
04917
04918 if(ucPara > 0)
04919 {
04920
04921 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", false, m_RFC_RAMData, m_iRFC_DataBlockSize);
04922 if(iBack == FEDM_MODIFIED)
04923 {
04924
04925 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04926 }
04927 }
04928 }
04929 break;
04930 }
04931 }
04932
04933
04934
04935
04936
04937
04938
04939
04940
04941
04942
04943
04944
04945
04946
04947
04948
04949
04950
04951
04952
04953 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
04954 void FEDM_DataBase::OptionalSetDataAction( const char* ID, CString Data )
04955 {
04956 bool bPara1 = false;
04957 bool bPara2 = false;
04958 bool bPara3 = false;
04959 bool bPara4 = false;
04960 bool bPara5 = false;
04961 unsigned char ucPara = 0;
04962 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
04963 int iBack = 0;
04964
04965
04966 sscanf( ID, "%d %d %d %d %d %d %d",
04967 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
04968
04969 switch( MemID )
04970 {
04971 case FEDM_RFC_EEDATA_MEM:
04972 if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==0 && BitCnt==1 &&
04973 (m_uiReaderType==FEDM_ISC_TYPE_ISCPRH200 ||
04974 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
04975 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
04976 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
04977 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
04978 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
04979 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1000 ||
04980 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
04981 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
04982 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
04983 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
04984 {
04985 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
04986 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_EEData, m_iRFC_DataBlockSize);
04987 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_EEData, m_iRFC_DataBlockSize);
04988 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_EEData, m_iRFC_DataBlockSize);
04989 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_EEData, m_iRFC_DataBlockSize);
04990
04991
04992 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_EEData, m_iRFC_DataBlockSize);
04993 if(iBack == FEDM_MODIFIED)
04994 {
04995
04996 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
04997 }
04998 }
04999 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==1 && BitCnt==1 &&
05000 (m_uiReaderType==FEDM_ISC_TYPE_CPR50_XX ||
05001 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
05002 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
05003 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
05004 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
05005 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
05006 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1000 ||
05007 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
05008 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
05009 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
05010 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
05011 {
05012 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
05013 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_EEData, m_iRFC_DataBlockSize);
05014 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_EEData, m_iRFC_DataBlockSize);
05015 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_EEData, m_iRFC_DataBlockSize);
05016 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_EEData, m_iRFC_DataBlockSize);
05017
05018
05019 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_EEData, m_iRFC_DataBlockSize);
05020 if(iBack == FEDM_MODIFIED)
05021 {
05022
05023 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05024 }
05025 }
05026 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==2 && BitCnt==1 &&
05027 (m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
05028 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
05029 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B) )
05030 {
05031 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
05032 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_EEData, m_iRFC_DataBlockSize);
05033 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_EEData, m_iRFC_DataBlockSize);
05034 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_EEData, m_iRFC_DataBlockSize);
05035 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_EEData, m_iRFC_DataBlockSize);
05036
05037
05038 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_EEData, m_iRFC_DataBlockSize);
05039 if(iBack == FEDM_MODIFIED)
05040 {
05041
05042 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05043 }
05044 }
05045 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==4 && BitCnt==1 &&
05046 (m_uiReaderType==FEDM_ISC_TYPE_ISCPRHD102 ||
05047 m_uiReaderType==FEDM_ISC_TYPE_ISCPRH200 ||
05048 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
05049 m_uiReaderType==FEDM_ISC_TYPE_ISCLR1002 ||
05050 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
05051 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
05052 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
05053 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU102 ||
05054 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
05055 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
05056 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
05057 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
05058 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
05059 {
05060 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
05061 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_EEData, m_iRFC_DataBlockSize);
05062 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_EEData, m_iRFC_DataBlockSize);
05063 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_EEData, m_iRFC_DataBlockSize);
05064 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_EEData, m_iRFC_DataBlockSize);
05065
05066
05067 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_EEData, m_iRFC_DataBlockSize);
05068 if(iBack == FEDM_MODIFIED)
05069 {
05070
05071 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05072 }
05073 }
05074 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==5 && BitCnt==1 &&
05075 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B )
05076 {
05077 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
05078 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_EEData, m_iRFC_DataBlockSize);
05079 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_EEData, m_iRFC_DataBlockSize);
05080 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_EEData, m_iRFC_DataBlockSize);
05081 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_EEData, m_iRFC_DataBlockSize);
05082
05083
05084 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_EEData, m_iRFC_DataBlockSize);
05085 if(iBack == FEDM_MODIFIED)
05086 {
05087
05088 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05089 }
05090 }
05091 else if( BlockAdr==11 && BytePos==2 && ByteCnt==1 && BitPos==2 && BitCnt==1 &&
05092 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
05093 {
05094 FEDM_Base::GetData("03 03 11 02 01 02 01", &bPara1, m_RFC_EEData, m_iRFC_DataBlockSize);
05095
05096
05097 iBack = FEDM_Base::SetData("03 03 11 01 01 07 01", (bool)(bPara1), m_RFC_EEData, m_iRFC_DataBlockSize);
05098 if(iBack == FEDM_MODIFIED)
05099 {
05100
05101 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05102 }
05103 }
05104 else if( BlockAdr==15 && BytePos==1 && ByteCnt==1 && BitPos==3 && BitCnt==4 &&
05105 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
05106 {
05107 FEDM_Base::GetData("03 03 15 01 01 03 04", &ucPara, m_RFC_EEData, m_iRFC_DataBlockSize);
05108
05109 if(ucPara > 0)
05110 {
05111
05112 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", true, m_RFC_EEData, m_iRFC_DataBlockSize);
05113 if(iBack == FEDM_MODIFIED)
05114 {
05115
05116 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05117 }
05118 }
05119 else
05120 {
05121
05122 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", false, m_RFC_EEData, m_iRFC_DataBlockSize);
05123 if(iBack == FEDM_MODIFIED)
05124 {
05125
05126 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05127 }
05128 }
05129 }
05130 else if( BlockAdr==15 && BytePos==1 && ByteCnt==1 && BitPos==0 && BitCnt==3 &&
05131 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
05132 {
05133 FEDM_Base::GetData("03 03 15 01 01 00 03", &ucPara, m_RFC_EEData, m_iRFC_DataBlockSize);
05134
05135 if(ucPara > 0)
05136 {
05137
05138 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", false, m_RFC_EEData, m_iRFC_DataBlockSize);
05139 if(iBack == FEDM_MODIFIED)
05140 {
05141
05142 m_RFC_EEData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05143 }
05144 }
05145 }
05146 break;
05147
05148 case FEDM_RFC_RAMDATA_MEM:
05149 if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==0 && BitCnt==1 &&
05150 (m_uiReaderType==FEDM_ISC_TYPE_ISCPRH200 ||
05151 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
05152 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
05153 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
05154 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
05155 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
05156 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1000 ||
05157 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
05158 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
05159 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
05160 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
05161 {
05162 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
05163 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_RAMData, m_iRFC_DataBlockSize);
05164 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_RAMData, m_iRFC_DataBlockSize);
05165 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_RAMData, m_iRFC_DataBlockSize);
05166 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_RAMData, m_iRFC_DataBlockSize);
05167
05168
05169 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_RAMData, m_iRFC_DataBlockSize);
05170 if(iBack == FEDM_MODIFIED)
05171 {
05172
05173 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05174 }
05175 }
05176 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==1 && BitCnt==1 &&
05177 (m_uiReaderType==FEDM_ISC_TYPE_CPR50_XX ||
05178 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
05179 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
05180 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
05181 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
05182 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
05183 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1000 ||
05184 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
05185 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
05186 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
05187 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
05188 {
05189 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
05190 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_RAMData, m_iRFC_DataBlockSize);
05191 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_RAMData, m_iRFC_DataBlockSize);
05192 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_RAMData, m_iRFC_DataBlockSize);
05193 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_RAMData, m_iRFC_DataBlockSize);
05194
05195
05196 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_RAMData, m_iRFC_DataBlockSize);
05197 if(iBack == FEDM_MODIFIED)
05198 {
05199
05200 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05201 }
05202 }
05203 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==2 && BitCnt==1 &&
05204 (m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
05205 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
05206 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B) )
05207 {
05208 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
05209 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_RAMData, m_iRFC_DataBlockSize);
05210 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_RAMData, m_iRFC_DataBlockSize);
05211 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_RAMData, m_iRFC_DataBlockSize);
05212 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_RAMData, m_iRFC_DataBlockSize);
05213
05214
05215 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_RAMData, m_iRFC_DataBlockSize);
05216 if(iBack == FEDM_MODIFIED)
05217 {
05218
05219 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05220 }
05221 }
05222 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==4 && BitCnt==1 &&
05223 (m_uiReaderType==FEDM_ISC_TYPE_ISCPRHD102 ||
05224 m_uiReaderType==FEDM_ISC_TYPE_ISCPRH200 ||
05225 m_uiReaderType==FEDM_ISC_TYPE_ISCMR200 ||
05226 m_uiReaderType==FEDM_ISC_TYPE_ISCLR1002 ||
05227 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2000 ||
05228 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_A ||
05229 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B ||
05230 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU102 ||
05231 m_uiReaderType==FEDM_ISC_TYPE_ISCMRU200 ||
05232 m_uiReaderType==FEDM_ISC_TYPE_MAXU1002 ||
05233 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU1002 ||
05234 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU2000 ||
05235 m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
05236 {
05237 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
05238 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_RAMData, m_iRFC_DataBlockSize);
05239 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_RAMData, m_iRFC_DataBlockSize);
05240 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_RAMData, m_iRFC_DataBlockSize);
05241 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_RAMData, m_iRFC_DataBlockSize);
05242
05243
05244 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_RAMData, m_iRFC_DataBlockSize);
05245 if(iBack == FEDM_MODIFIED)
05246 {
05247
05248 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05249 }
05250 }
05251 else if( BlockAdr==11 && BytePos==1 && ByteCnt==1 && BitPos==5 && BitCnt==1 &&
05252 m_uiReaderType==FEDM_ISC_TYPE_ISCLR2500_B )
05253 {
05254 FEDM_Base::GetData("03 03 11 01 01 00 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
05255 FEDM_Base::GetData("03 03 11 01 01 01 01", &bPara2, m_RFC_RAMData, m_iRFC_DataBlockSize);
05256 FEDM_Base::GetData("03 03 11 01 01 02 01", &bPara3, m_RFC_RAMData, m_iRFC_DataBlockSize);
05257 FEDM_Base::GetData("03 03 11 01 01 04 01", &bPara4, m_RFC_RAMData, m_iRFC_DataBlockSize);
05258 FEDM_Base::GetData("03 03 11 01 01 05 01", &bPara5, m_RFC_RAMData, m_iRFC_DataBlockSize);
05259
05260
05261 iBack = FEDM_Base::SetData("03 03 11 00 01 07 01", (bool)(bPara1 | bPara2 | bPara3 | bPara4 | bPara5), m_RFC_RAMData, m_iRFC_DataBlockSize);
05262 if(iBack == FEDM_MODIFIED)
05263 {
05264
05265 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05266 }
05267 }
05268 else if( BlockAdr==11 && BytePos==2 && ByteCnt==1 && BitPos==2 && BitCnt==1 &&
05269 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
05270 {
05271 FEDM_Base::GetData("03 03 11 02 01 02 01", &bPara1, m_RFC_RAMData, m_iRFC_DataBlockSize);
05272
05273
05274 iBack = FEDM_Base::SetData("03 03 11 01 01 07 01", (bool)(bPara1), m_RFC_RAMData, m_iRFC_DataBlockSize);
05275 if(iBack == FEDM_MODIFIED)
05276 {
05277
05278 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05279 }
05280 }
05281 else if( BlockAdr==15 && BytePos==1 && ByteCnt==1 && BitPos==3 && BitCnt==4 &&
05282 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
05283 {
05284 FEDM_Base::GetData("03 03 15 01 01 03 04", &ucPara, m_RFC_RAMData, m_iRFC_DataBlockSize);
05285
05286 if(ucPara > 0)
05287 {
05288
05289 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", true, m_RFC_RAMData, m_iRFC_DataBlockSize);
05290 if(iBack == FEDM_MODIFIED)
05291 {
05292
05293 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05294 }
05295 }
05296 else
05297 {
05298
05299 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", false, m_RFC_RAMData, m_iRFC_DataBlockSize);
05300 if(iBack == FEDM_MODIFIED)
05301 {
05302
05303 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05304 }
05305 }
05306 }
05307 else if( BlockAdr==15 && BytePos==1 && ByteCnt==1 && BitPos==0 && BitCnt==3 &&
05308 (m_uiReaderType==FEDM_ISC_TYPE_ISCLRU3000) )
05309 {
05310 FEDM_Base::GetData("03 03 15 01 01 00 03", &ucPara, m_RFC_RAMData, m_iRFC_DataBlockSize);
05311
05312 if(ucPara > 0)
05313 {
05314
05315 iBack = FEDM_Base::SetData("03 03 15 01 01 07 01", false, m_RFC_RAMData, m_iRFC_DataBlockSize);
05316 if(iBack == FEDM_MODIFIED)
05317 {
05318
05319 m_RFC_RAMData[BlockAdr * m_iRFC_DataBlockSize + m_iRFC_DataBlockSize-1] |= 0x02;
05320 }
05321 }
05322 }
05323 break;
05324 }
05325 }
05326 #endif