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 #include <stdio.h>
00033 #include <string.h>
00034 #include "FEDM_Base.h"
00035
00036
00037
00038 #ifdef _FEDM_LINUX
00039 #if !defined(_FEDM_SUPPORT_SLINK)
00040 #include <dlfcn.h>
00041 #endif
00042 #endif
00043
00044 #if _MSC_VER >= 1400
00045 #pragma warning(disable : 4996)
00046 #endif
00047
00048
00049 #if defined(_FEDM_WINDOWS) && defined(_MSC_VER)
00050 #if _MSC_VER >= 1600
00051 #if defined(_DEBUG)
00052 #define FECOM_LIB_NAME "fecom.dll"
00053 #define FEUSB_LIB_NAME "feusb.dll"
00054 #define FETCP_LIB_NAME "fetcp.dll"
00055 #else
00056 #define FECOM_LIB_NAME "fecom.dll"
00057 #define FEUSB_LIB_NAME "feusb.dll"
00058 #define FETCP_LIB_NAME "fetcp.dll"
00059 #endif
00060 #else
00061 #define FECOM_LIB_NAME "fecom.dll"
00062 #define FEUSB_LIB_NAME "feusb.dll"
00063 #define FETCP_LIB_NAME "fetcp.dll"
00064 #endif
00065 #endif
00066
00067
00068
00069
00070
00071 int FEDM_Base::m_iLanguage = FEDM_LANG_ENGLISH;
00072
00073
00074 FEDM_Base::FEDM_Base()
00075 {
00076 m_iLastError = 0;
00077 #ifdef _FEDM_WINDOWS
00078 m_iWinVer = 0;
00079 #endif
00080
00081 #ifdef _FEDM_COM_SUPPORT
00082 m_pFeComLib = NULL;
00083 m_pFeComPtrList = NULL;
00084 m_pFecomLibName = NULL;
00085 #endif
00086
00087 #ifdef _FEDM_USB_SUPPORT
00088 m_pFeUsbLib = NULL;
00089 m_pFeUsbPtrList = NULL;
00090 m_pFeusbLibName = NULL;
00091 #endif
00092
00093 #ifdef _FEDM_TCP_SUPPORT
00094 m_pFeTcpLib = NULL;
00095 m_pFeTcpPtrList = NULL;
00096 m_pFetcpLibName = NULL;
00097 #endif
00098
00099 }
00100
00101 FEDM_Base::~FEDM_Base()
00102 {
00103 #if !defined(_FEDM_SUPPORT_SLINK)
00104
00105 #if defined(_FEDM_COM_SUPPORT) && !defined(_FEDM_SUPPORT_SLINK)
00106 if(m_pFeComLib != NULL)
00107 #ifdef _FEDM_WINDOWS
00108 FreeLibrary((HINSTANCE)m_pFeComLib);
00109 #endif // _FEDM_WINDOWS
00110 #ifdef _FEDM_LINUX
00111 dlclose(m_pFeComLib);
00112 #endif // _FEDM_LINUX
00113 #endif // #if defined(_FEDM_COM_SUPPORT) && !defined(_FEDM_SUPPORT_SLINK)
00114
00115
00116 #if defined(_FEDM_USB_SUPPORT) && !defined(_FEDM_SUPPORT_SLINK)
00117 if(m_pFeUsbLib != NULL)
00118 #ifdef _FEDM_WINDOWS
00119 FreeLibrary((HINSTANCE)m_pFeUsbLib);
00120 #endif // _FEDM_WINDOWS
00121 #ifdef _FEDM_LINUX
00122 dlclose(m_pFeUsbLib);
00123 #endif // _FEDM_LINUX
00124 #endif // #if defined(_FEDM_USB_SUPPORT)&& !defined(_FEDM_SUPPORT_SLINK)
00125
00126
00127 #if defined(_FEDM_TCP_SUPPORT) && !defined(_FEDM_SUPPORT_SLINK)
00128 if(m_pFeTcpLib != NULL)
00129 #ifdef _FEDM_WINDOWS
00130 FreeLibrary((HINSTANCE)m_pFeTcpLib);
00131 #endif // _FEDM_TCP_SUPPORT
00132 #ifdef _FEDM_LINUX
00133 dlclose(m_pFeTcpLib);
00134 #endif // _FEDM_LINUX
00135 #endif // #if defined(_FEDM_TCP_SUPPORT)&& !defined(_FEDM_SUPPORT_SLINK)
00136
00137 #endif // #if !defined(_FEDM_SUPPORT_SLINK)
00138
00139 #if defined(_FEDM_COM_SUPPORT) && !defined(_FEDM_SUPPORT_SLINK)
00140 if(m_pFeComPtrList != NULL)
00141 delete (_FEDM_FECOM_PTR*)m_pFeComPtrList;
00142 #endif
00143
00144 #if defined(_FEDM_USB_SUPPORT) && !defined(_FEDM_SUPPORT_SLINK)
00145 if(m_pFeUsbPtrList != NULL)
00146 delete (_FEDM_FEUSB_PTR*)m_pFeUsbPtrList;
00147 #endif
00148
00149 #if defined(_FEDM_TCP_SUPPORT) && !defined(_FEDM_SUPPORT_SLINK)
00150 if(m_pFeTcpPtrList != NULL)
00151 delete (_FEDM_FETCP_PTR*)m_pFeTcpPtrList;
00152 #endif
00153 }
00154
00155
00156
00157
00158
00159 char* FEDM_Base::GetLibVersion()
00160 {
00161 return FEDM_VERSION;
00162 }
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177 int FEDM_Base::SetLanguage(int iLanguage)
00178 {
00179 int iBack = FEDM_OK;
00180
00181 switch(iLanguage)
00182 {
00183 case FEDM_LANG_GERMAN:
00184 m_iLanguage = FEDM_LANG_GERMAN;
00185 break;
00186
00187 case FEDM_LANG_ENGLISH:
00188 m_iLanguage = FEDM_LANG_ENGLISH;
00189 break;
00190
00191 default:
00192 iBack = FEDM_ERROR_UNKNOWN_LANGUAGE;
00193 }
00194
00195 return iBack;
00196 }
00197
00198 int FEDM_Base::GetLanguage()
00199 {
00200 return m_iLanguage;
00201 }
00202
00203 void FEDM_Base::SetLastError(int iErrorCode)
00204 {
00205 m_iLastError = iErrorCode;
00206 }
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221 int FEDM_Base::GetErrorText(char* sText, int iErrCode)
00222 {
00223 int iBack = FEDM_OK;
00224 FEDM_CHK3(sText);
00225
00226 switch(m_iLanguage)
00227 {
00228 case FEDM_LANG_GERMAN:
00229 GetErrorText(FEDM_LANG_GERMAN, sText, iErrCode);
00230 break;
00231
00232 case FEDM_LANG_ENGLISH:
00233 GetErrorText(FEDM_LANG_ENGLISH, sText, iErrCode);
00234 break;
00235
00236 default:
00237 iBack = FEDM_ERROR_UNKNOWN_LANGUAGE;
00238 }
00239
00240 return iBack;
00241 }
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256 int FEDM_Base::GetErrorText(int iLanguage, char* sText, int iErrCode)
00257 {
00258 int iLang = FEDM_LANG_ENGLISH;
00259
00260
00261 if(iLanguage == 0)
00262 iLang = m_iLanguage;
00263 else if(iLanguage == FEDM_LANG_GERMAN)
00264 iLang = FEDM_LANG_GERMAN;
00265 else if(iLanguage == FEDM_LANG_ENGLISH)
00266 iLang = FEDM_LANG_ENGLISH;
00267
00268
00269 if(iLang == FEDM_LANG_GERMAN)
00270 {
00271 switch(iErrCode)
00272 {
00273 case FEDM_OK:
00274 strcpy(sText, "OK");
00275 break;
00276 case FEDM_ERROR_BLOCK_SIZE:
00277 strcpy(sText, "Fehler in Modul FEDM: Blockgröße ist falsch");
00278 break;
00279 case FEDM_ERROR_BIT_BOUNDARY:
00280 strcpy(sText, "Fehler in Modul FEDM: Bitgrenze überschritten");
00281 break;
00282 case FEDM_ERROR_BYTE_BOUNDARY:
00283 strcpy(sText, "Fehler in Modul FEDM: Bytegrenze überschritten");
00284 break;
00285 case FEDM_ERROR_ARRAY_BOUNDARY:
00286 strcpy(sText, "Fehler in Modul FEDM: Arraygrenze überschritten");
00287 break;
00288 case FEDM_ERROR_BUFFER_LENGTH:
00289 strcpy(sText, "Fehler in Modul FEDM: Puffergrenze überschritten");
00290 break;
00291 case FEDM_ERROR_PARAMETER:
00292 strcpy(sText, "Fehler in Modul FEDM: Unbekannter Parameter oder Parameter außerhalb zulässigem Bereich");
00293 break;
00294 case FEDM_ERROR_STRING_LENGTH:
00295 strcpy(sText, "Fehler in Modul FEDM: Zeichenkette ist zu lang");
00296 break;
00297 case FEDM_ERROR_ODD_STRING_LENGTH:
00298 strcpy(sText, "Fehler in Modul FEDM: Eine Zeichenkette mit gerader Anzahl Zeichen wird erwartet");
00299 break;
00300 case FEDM_ERROR_NO_DATA:
00301 strcpy(sText, "Fehler in Modul FEDM: Keine Protokolldaten empfangen");
00302 break;
00303 case FEDM_ERROR_NO_READER_HANDLE:
00304 strcpy(sText, "Fehler in Modul FEDM: Kein Handle eines Leserobjektes gefunden");
00305 break;
00306 case FEDM_ERROR_NO_PORT_HANDLE:
00307 strcpy(sText, "Fehler in Modul FEDM: Kein Handle einer seriellen Schnittstelle gefunden");
00308 break;
00309 case FEDM_ERROR_UNKNOWN_CONTROL_BYTE:
00310 strcpy(sText, "Fehler in Modul FEDM: Unbekanntes Steuerbyte");
00311 break;
00312 case FEDM_ERROR_UNKNOWN_MEM_ID:
00313 strcpy(sText, "Fehler in Modul FEDM: Unbekannte Speicherkonstante");
00314 break;
00315 case FEDM_ERROR_UNKNOWN_POLL_MODE:
00316 strcpy(sText, "Fehler in Modul FEDM: Unbekannter Poll-Modus");
00317 break;
00318 case FEDM_ERROR_NO_TABLE_DATA:
00319 strcpy(sText, "Fehler in Modul FEDM: Keine Tabellendaten vorhanden");
00320 break;
00321 case FEDM_ERROR_UNKNOWN_ERROR_CODE:
00322 strcpy(sText, "Fehler in Modul FEDM: Unbekannter Fehlercode");
00323 break;
00324 case FEDM_ERROR_UNKNOWN_COMMAND:
00325 strcpy(sText, "Fehler in Modul FEDM: Unbekanntes ISO-Host-Kommando");
00326 break;
00327 case FEDM_ERROR_UNSUPPORTED:
00328 strcpy(sText, "Fehler in Modul FEDM: Keine Unterstützung für diesen Parameter oder diese Funktion");
00329 break;
00330 case FEDM_ERROR_NO_MORE_MEM:
00331 strcpy(sText, "Fehler in Modul FEDM: Kein Systemspeicher mehr verfügbar");
00332 break;
00333 case FEDM_ERROR_NO_READER_FOUND:
00334 strcpy(sText, "Fehler in Modul FEDM: Kein Leser gefunden");
00335 break;
00336 case FEDM_ERROR_NULL_POINTER:
00337 strcpy(sText, "Fehler in Modul FEDM: NULL-Zeiger übergeben");
00338 break;
00339 case FEDM_ERROR_UNKNOWN_READER_TYPE:
00340 strcpy(sText, "Fehler in Modul FEDM: Unbekannter Lesertyp");
00341 break;
00342 case FEDM_ERROR_UNSUPPORTED_READER_TYPE:
00343 strcpy(sText, "Fehler in Modul FEDM: Funktion kann für diesen Lesertyp nicht verwendet werden");
00344 break;
00345 case FEDM_ERROR_UNKNOWN_TABLE_ID:
00346 strcpy(sText, "Fehler in Modul FEDM: Unbekannte Tabellenkonstante");
00347 break;
00348 case FEDM_ERROR_UNKNOWN_LANGUAGE:
00349 strcpy(sText, "Fehler in Modul FEDM: Unbekannte Sprachenkonstante");
00350 break;
00351 case FEDM_ERROR_NO_TABLE_SIZE:
00352 strcpy(sText, "Fehler in Modul FEDM: Tabelle hat Größe 0");
00353 break;
00354 case FEDM_ERROR_SENDBUFFER_OVERFLOW:
00355 strcpy(sText, "Fehler in Modul FEDM: Sendepuffer ist voll");
00356 break;
00357 case FEDM_ERROR_VERIFY:
00358 strcpy(sText, "Fehler in Modul FEDM: Daten sind ungleich");
00359 break;
00360 case FEDM_ERROR_OPEN_FILE:
00361 strcpy(sText, "Fehler in Modul FEDM: Fehler beim Öffnen der Datei");
00362 break;
00363 case FEDM_ERROR_SAVE_FILE:
00364 strcpy(sText, "Fehler in Modul FEDM: Fehler beim Speichern der Datei");
00365 break;
00366 case FEDM_ERROR_UNKNOWN_TRANSPONDER_TYPE:
00367 strcpy(sText, "Fehler in Modul FEDM: unbekannter Transpondertyp");
00368 break;
00369 case FEDM_ERROR_READ_FILE:
00370 strcpy(sText, "Fehler in Modul FEDM: Fehler beim Lesen der Datei");
00371 break;
00372 case FEDM_ERROR_WRITE_FILE:
00373 strcpy(sText, "Fehler in Modul FEDM: Fehler beim Schreiben in Datei");
00374 break;
00375 case FEDM_ERROR_UNKNOWN_EPC_TYPE:
00376 strcpy(sText, "Fehler in Modul FEDM: unbekannter EPC-Typ");
00377 break;
00378 case FEDM_ERROR_UNSUPPORTED_PORT_DRIVER:
00379 strcpy(sText, "Fehler in Modul FEDM: Funktion unterstützt nicht den aktiven Kommunikations-Treiber");
00380 break;
00381 case FEDM_ERROR_UNKNOWN_ADDRESS_MODE:
00382 strcpy(sText, "Fehler in Modul FEDM: unbekannter Adressmodus");
00383 break;
00384 case FEDM_ERROR_ALREADY_CONNECTED:
00385 strcpy(sText, "Fehler in Modul FEDM: Leserobjekt ist bereits mit einem Port verbunden");
00386 break;
00387 case FEDM_ERROR_NOT_CONNECTED:
00388 strcpy(sText, "Fehler in Modul FEDM: Leserobjekt ist nicht mit einem Port verbunden");
00389 break;
00390 case FEDM_ERROR_NO_MODULE_HANDLE:
00391 strcpy(sText, "Fehler in Modul FEDM: Kein Handle eines Lesermoduls gefunden");
00392 break;
00393 case FEDM_ERROR_EMPTY_MODULE_LIST:
00394 strcpy(sText, "Fehler in Modul FEDM: Die Modulliste ist leer");
00395 break;
00396 case FEDM_ERROR_MODULE_NOT_FOUND:
00397 strcpy(sText, "Fehler in Modul FEDM: Modul nicht in Modulliste gefunden");
00398 break;
00399 case FEDM_ERROR_DIFFERENT_OBJECTS:
00400 strcpy(sText, "Fehler in Modul FEDM: Laufzeitobjekte sind nicht identisch");
00401 break;
00402 case FEDM_ERROR_NOT_AN_EPC:
00403 strcpy(sText, "Fehler in Modul FEDM: Seriennummer des Transponders ist keine EPC");
00404 break;
00405 case FEDM_ERROR_OLD_LIB_VERSION:
00406 strcpy(sText, "Fehler in Modul FEDM: Alte Bibliotheksversion. Funktionsaufruf nicht möglich.");
00407 break;
00408 case FEDM_ERROR_WRONG_READER_TYPE:
00409 strcpy(sText, "Fehler in Modul FEDM: Ungültiger Lesertyp.");
00410 break;
00411 case FEDM_ERROR_CRC:
00412 strcpy(sText, "Fehler in Modul FEDM: Checksummen-Fehler beim Verifizieren der Datei.");
00413 break;
00414 case FEDM_ERROR_CFG_BLOCK_PREVIOUSLY_NOT_READ:
00415 strcpy(sText, "Fehler in Modul FEDM: Die CFG-Block muss vor dem Schreiben zuerst gelesen werden.");
00416 break;
00417 case FEDM_ERROR_UNSUPPORTED_CONTROLLER_TYPE:
00418 strcpy(sText, "Fehler in Modul FEDM: Controller-Typ wird in Funktion nicht unterstützt");
00419 break;
00420 case FEDM_ERROR_VERSION_CONFLICT:
00421 strcpy(sText, "Fehler in Modul FEDM: Versionskonflikt mit einer oder mehrerer abhängiger Bibliotheken");
00422 break;
00423 case FEDM_ERROR_UNSUPPORTED_NAMESPACE:
00424 strcpy(sText, "Fehler in Modul FEDM: Parameter wird vom angeschlossenen Leser nicht unterstützt");
00425 break;
00426 case FEDM_ERROR_TASK_STILL_RUNNING:
00427 strcpy(sText, "Fehler in Modul FEDM: Asynchroner Task ist noch am laufen");
00428 break;
00429 case FEDM_ERROR_TAG_HANDLER_NOT_IDENTIFIED:
00430 strcpy(sText, "Fehler in Modul FEDM: TagHandler-Typ konnte nicht identifiziert werden");
00431 break;
00432 case FEDM_ERROR_UNVALID_IDD_LENGTH:
00433 strcpy(sText, "Fehler in Modul FEDM: Längenangabe für IDD ist außerhalb des zulässigen Bereichs");
00434 break;
00435 case FEDM_ERROR_UNVALID_IDD_FORMAT:
00436 strcpy(sText, "Fehler in Modul FEDM: Formateinstellung für IDD ist falsch");
00437 break;
00438 case FEDM_ERROR_UNKNOWN_TAG_HANDLER_TYPE:
00439 strcpy(sText, "Fehler in Modul FEDM: Unbekannter TagHandler-Typ");
00440 break;
00441 case FEDM_ERROR_UNSUPPORTED_TRANSPONDER_TYPE:
00442 strcpy(sText, "Fehler in Modul FEDM: Transpondertyp wird für die gewählte Aktion nicht unterstützt");
00443 break;
00444 case FEDM_ERROR_CONNECTED_WITH_OTHER_MODULE:
00445 strcpy(sText, "Fehler in Modul FEDM: Ein anderes Leserobjekt ist bereits mit diesem Port verbunden");
00446 break;
00447 case FEDM_ERROR_INVENTORY_NO_TID_IN_UID:
00448 strcpy(sText, "Fehler in Modul FEDM: Inventory mit Rückgabe von UID = EPC + TID, aber TID fehlt");
00449 break;
00450
00451 case FEDM_XML_ERROR_NO_XML_FILE:
00452 strcpy(sText, "Fehler in Modul FEDM_XML: Datei ist kein XML-Dokument");
00453 break;
00454 case FEDM_XML_ERROR_NO_OBID_TAG:
00455 strcpy(sText, "Fehler in Modul FEDM_XML: Datei enthält kein Element 'OBID'");
00456 break;
00457 case FEDM_XML_ERROR_NO_CHILD_TAG:
00458 strcpy(sText, "Fehler in Modul FEDM_XML: Kein Sub-Element vorhanden");
00459 break;
00460 case FEDM_XML_ERROR_TAG_NOT_FOUND:
00461 strcpy(sText, "Fehler in Modul FEDM_XML: Element nicht in Dokument");
00462 break;
00463 case FEDM_XML_ERROR_DOC_NOT_WELL_FORMED:
00464 strcpy(sText, "Fehler in Modul FEDM_XML: XML-Dokument nicht wohlgeformt");
00465 break;
00466 case FEDM_XML_ERROR_NO_TAG_VALUE:
00467 strcpy(sText, "Fehler in Modul FEDM_XML: Kein Element-Inhalt vorhanden");
00468 break;
00469 case FEDM_XML_ERROR_NO_TAG_ATTRIBUTE:
00470 strcpy(sText, "Fehler in Modul FEDM_XML: Kein Attribute vorhanden");
00471 break;
00472 case FEDM_XML_ERROR_DOC_FILE_VERSION:
00473 strcpy(sText, "Fehler in Modul FEDM_XML: Ungültige Dokument-Version");
00474 break;
00475 case FEDM_XML_ERROR_DOC_FILE_FAMILY:
00476 strcpy(sText, "Fehler in Modul FEDM_XML: Dokument für andere Leserfamilie");
00477 break;
00478 case FEDM_XML_ERROR_WRONG_CONTROLLER_TYPE:
00479 strcpy(sText, "Fehler in Modul FEDM_XML: Ungültiger Controller-Typ");
00480 break;
00481 case FEDM_XML_ERROR_WRONG_MEM_BANK_TYPE:
00482 strcpy(sText, "Fehler in Modul FEDM_XML: Ungültiger Speicherbank-Typ");
00483 break;
00484 default:
00485 sprintf(sText, "Fehler in Modul FEDM: Unbekannter Fehlercode (%d | 0x%08X)", iErrCode, iErrCode);
00486 return FEDM_ERROR_UNKNOWN_ERROR_CODE;
00487 }
00488 }
00489 else if(iLang == FEDM_LANG_ENGLISH)
00490 {
00491 switch(iErrCode)
00492 {
00493 case FEDM_OK:
00494 strcpy(sText, "OK");
00495 break;
00496 case FEDM_ERROR_BLOCK_SIZE:
00497 strcpy(sText, "Error in Module FEDM: Block size in the access constant is incorrect");
00498 break;
00499 case FEDM_ERROR_BIT_BOUNDARY:
00500 strcpy(sText, "Error in Module FEDM: Bit boundary in the access constant is incorrect");
00501 break;
00502 case FEDM_ERROR_BYTE_BOUNDARY:
00503 strcpy(sText, "Error in Module FEDM: Byte boundary in the access constant is incorrect");
00504 break;
00505 case FEDM_ERROR_ARRAY_BOUNDARY:
00506 strcpy(sText, "Error in Module FEDM: Array boundary of a data container was exceeded");
00507 break;
00508 case FEDM_ERROR_BUFFER_LENGTH:
00509 strcpy(sText, "Error in Module FEDM: Length of the data buffer is insufficient");
00510 break;
00511 case FEDM_ERROR_PARAMETER:
00512 strcpy(sText, "Error in Module FEDM: Unknown transfer parameter or parameter value is out of valid range");
00513 break;
00514 case FEDM_ERROR_STRING_LENGTH:
00515 strcpy(sText, "Error in Module FEDM: Transferred string is too long");
00516 break;
00517 case FEDM_ERROR_ODD_STRING_LENGTH:
00518 strcpy(sText, "Error in Module FEDM: Transferred string contains an odd number of characters. Even number of characters expected");
00519 break;
00520 case FEDM_ERROR_NO_DATA:
00521 strcpy(sText, "Error in Module FEDM: No data in the protocol");
00522 break;
00523 case FEDM_ERROR_NO_READER_HANDLE:
00524 strcpy(sText, "Error in Module FEDM: No reader handle set");
00525 break;
00526 case FEDM_ERROR_NO_PORT_HANDLE:
00527 strcpy(sText, "Error in Module FEDM: No port handle set");
00528 break;
00529 case FEDM_ERROR_UNKNOWN_CONTROL_BYTE:
00530 strcpy(sText, "Error in Module FEDM: Unknown control byte");
00531 break;
00532 case FEDM_ERROR_UNKNOWN_MEM_ID:
00533 strcpy(sText, "Error in Module FEDM: Unknown memory ID");
00534 break;
00535 case FEDM_ERROR_UNKNOWN_POLL_MODE:
00536 strcpy(sText, "Error in Module FEDM: Unknown poll mode");
00537 break;
00538 case FEDM_ERROR_NO_TABLE_DATA:
00539 strcpy(sText, "Error in Module FEDM: No data in a table");
00540 break;
00541 case FEDM_ERROR_UNKNOWN_ERROR_CODE:
00542 strcpy(sText, "Error in Module FEDM: Unknown error code");
00543 break;
00544 case FEDM_ERROR_UNKNOWN_COMMAND:
00545 strcpy(sText, "Error in Module FEDM: Unknown ISO-Host command");
00546 break;
00547 case FEDM_ERROR_UNSUPPORTED:
00548 strcpy(sText, "Error in Module FEDM: No support for this parameter or function");
00549 break;
00550 case FEDM_ERROR_NO_MORE_MEM:
00551 strcpy(sText, "Error in Module FEDM: No more program memory available");
00552 break;
00553 case FEDM_ERROR_NO_READER_FOUND:
00554 strcpy(sText, "Error in Module FEDM: No reader found");
00555 break;
00556 case FEDM_ERROR_NULL_POINTER:
00557 strcpy(sText, "Error in Module FEDM: The transferred pointer is NULL");
00558 break;
00559 case FEDM_ERROR_UNKNOWN_READER_TYPE:
00560 strcpy(sText, "Error in Module FEDM: Unknown reader type");
00561 break;
00562 case FEDM_ERROR_UNSUPPORTED_READER_TYPE:
00563 strcpy(sText, "Error in Module FEDM: The Function doesn't support this reader type");
00564 break;
00565 case FEDM_ERROR_UNKNOWN_TABLE_ID:
00566 strcpy(sText, "Error in Module FEDM: Unknown table constant");
00567 break;
00568 case FEDM_ERROR_UNKNOWN_LANGUAGE:
00569 strcpy(sText, "Error in Module FEDM: Unknown language constant");
00570 break;
00571 case FEDM_ERROR_NO_TABLE_SIZE:
00572 strcpy(sText, "Error in Module FEDM: The table has the size 0");
00573 break;
00574 case FEDM_ERROR_SENDBUFFER_OVERFLOW:
00575 strcpy(sText, "Error in Module FEDM: The Sendbuffer is full");
00576 break;
00577 case FEDM_ERROR_VERIFY:
00578 strcpy(sText, "Error in Module FEDM: Data are not equal");
00579 break;
00580 case FEDM_ERROR_OPEN_FILE:
00581 strcpy(sText, "Error in Module FEDM: File open error");
00582 break;
00583 case FEDM_ERROR_SAVE_FILE:
00584 strcpy(sText, "Error in Module FEDM: File save error");
00585 break;
00586 case FEDM_ERROR_UNKNOWN_TRANSPONDER_TYPE:
00587 strcpy(sText, "Error in Module FEDM: Unknown transponder type");
00588 break;
00589 case FEDM_ERROR_READ_FILE:
00590 strcpy(sText, "Error in Module FEDM: File read error");
00591 break;
00592 case FEDM_ERROR_WRITE_FILE:
00593 strcpy(sText, "Error in Module FEDM: File write error");
00594 break;
00595 case FEDM_ERROR_UNKNOWN_EPC_TYPE:
00596 strcpy(sText, "Error in Module FEDM: Unknown EPC type");
00597 break;
00598 case FEDM_ERROR_UNSUPPORTED_PORT_DRIVER:
00599 strcpy(sText, "Error in Module FEDM: Function does not support the active communication driver");
00600 break;
00601 case FEDM_ERROR_UNKNOWN_ADDRESS_MODE:
00602 strcpy(sText, "Error in Module FEDM: Unknown address mode");
00603 break;
00604 case FEDM_ERROR_ALREADY_CONNECTED:
00605 strcpy(sText, "Error in Module FEDM: Reader object is already connected with a communication port");
00606 break;
00607 case FEDM_ERROR_NOT_CONNECTED:
00608 strcpy(sText, "Error in Module FEDM: Reader object is not connected with a communication port");
00609 break;
00610 case FEDM_ERROR_NO_MODULE_HANDLE:
00611 strcpy(sText, "Error in Module FEDM: No module handle found");
00612 break;
00613 case FEDM_ERROR_EMPTY_MODULE_LIST:
00614 strcpy(sText, "Error in Module FEDM: The module list is empty");
00615 break;
00616 case FEDM_ERROR_MODULE_NOT_FOUND:
00617 strcpy(sText, "Error in Module FEDM: Module not found in module list");
00618 break;
00619 case FEDM_ERROR_DIFFERENT_OBJECTS:
00620 strcpy(sText, "Error in Module FEDM: Runtime objects are different");
00621 break;
00622 case FEDM_ERROR_NOT_AN_EPC:
00623 strcpy(sText, "Error in Module FEDM: IDD of transponder is not an EPC");
00624 break;
00625 case FEDM_ERROR_OLD_LIB_VERSION:
00626 strcpy(sText, "Error in Module FEDM: Old library version. Function call not possible.");
00627 break;
00628 case FEDM_ERROR_WRONG_READER_TYPE:
00629 strcpy(sText, "Error in Module FEDM: Wrong reader type");
00630 break;
00631 case FEDM_ERROR_CRC:
00632 strcpy(sText, "Error in Module FEDM: Verification of file content terminates with checksum error");
00633 break;
00634 case FEDM_ERROR_CFG_BLOCK_PREVIOUSLY_NOT_READ:
00635 strcpy(sText, "Error in Module FEDM: The CFG-Block must be first read before write");
00636 break;
00637 case FEDM_ERROR_UNSUPPORTED_CONTROLLER_TYPE:
00638 strcpy(sText, "Error in Module FEDM: Function does not support this controller type");
00639 break;
00640 case FEDM_ERROR_VERSION_CONFLICT:
00641 strcpy(sText, "Error in Module FEDM: Version conflict with one or more dependent libraries");
00642 break;
00643 case FEDM_ERROR_UNSUPPORTED_NAMESPACE:
00644 strcpy(sText, "Error in Module FEDM: Connected reader does not support this parameter");
00645 break;
00646 case FEDM_ERROR_TASK_STILL_RUNNING:
00647 strcpy(sText, "Error in Module FEDM: Asynchronous task is still running");
00648 break;
00649 case FEDM_ERROR_TAG_HANDLER_NOT_IDENTIFIED:
00650 strcpy(sText, "Error in Module FEDM: TagHandler type could not be identified");
00651 break;
00652 case FEDM_ERROR_UNVALID_IDD_LENGTH:
00653 strcpy(sText, "Error in Module FEDM: Value of IDD-Length is out of range");
00654 break;
00655 case FEDM_ERROR_UNVALID_IDD_FORMAT:
00656 strcpy(sText, "Error in Module FEDM: Value of IDD-Format is out of range");
00657 break;
00658 case FEDM_ERROR_UNKNOWN_TAG_HANDLER_TYPE:
00659 strcpy(sText, "Error in Module FEDM: Unknown TagHandler type");
00660 break;
00661 case FEDM_ERROR_UNSUPPORTED_TRANSPONDER_TYPE:
00662 strcpy(sText, "Error in Module FEDM: Transponder type is not supported by the selected task");
00663 break;
00664 case FEDM_ERROR_CONNECTED_WITH_OTHER_MODULE:
00665 strcpy(sText, "Error in Module FEDM: Another Reader object is already connected with this communication port");
00666 break;
00667 case FEDM_ERROR_INVENTORY_NO_TID_IN_UID:
00668 strcpy(sText, "Error in Module FEDM: Inventory with return of UID = EPC + TID, but TID is missing");
00669 break;
00670
00671 case FEDM_XML_ERROR_NO_XML_FILE:
00672 strcpy(sText, "Error in Module FEDM_XML: File is not a XML document");
00673 break;
00674 case FEDM_XML_ERROR_NO_OBID_TAG:
00675 strcpy(sText, "Error in Module FEDM_XML: File contains no element 'OBID'");
00676 break;
00677 case FEDM_XML_ERROR_NO_CHILD_TAG:
00678 strcpy(sText, "Error in Module FEDM_XML: No sub-element found");
00679 break;
00680 case FEDM_XML_ERROR_TAG_NOT_FOUND:
00681 strcpy(sText, "Error in Module FEDM_XML: Element not in the document");
00682 break;
00683 case FEDM_XML_ERROR_DOC_NOT_WELL_FORMED:
00684 strcpy(sText, "Error in Module FEDM_XML: XML document not well-formed");
00685 break;
00686 case FEDM_XML_ERROR_NO_TAG_VALUE:
00687 strcpy(sText, "Error in Module FEDM_XML: No content of element found");
00688 break;
00689 case FEDM_XML_ERROR_NO_TAG_ATTRIBUTE:
00690 strcpy(sText, "Error in Module FEDM_XML: No attribute found");
00691 break;
00692 case FEDM_XML_ERROR_DOC_FILE_VERSION:
00693 strcpy(sText, "Error in Module FEDM_XML: Unvalid document version");
00694 break;
00695 case FEDM_XML_ERROR_DOC_FILE_FAMILY:
00696 strcpy(sText, "Error in Module FEDM_XML: The Document is for another reader family");
00697 break;
00698 case FEDM_XML_ERROR_DOC_FILE_TYPE:
00699 strcpy(sText, "Error in Module FEDM_XML: The document is not a valid OBID file type");
00700 break;
00701 case FEDM_XML_ERROR_WRONG_CONTROLLER_TYPE:
00702 strcpy(sText, "Error in Module FEDM_XML: Wrong controller type");
00703 break;
00704 case FEDM_XML_ERROR_WRONG_MEM_BANK_TYPE:
00705 strcpy(sText, "Error in Module FEDM_XML: Wrong memory bank type");
00706 break;
00707 default:
00708 sprintf(sText, "Error in Module FEDM: unknown error code (%d | 0x%08X)", iErrCode, iErrCode);
00709 return FEDM_ERROR_UNKNOWN_ERROR_CODE;
00710 }
00711 }
00712 else
00713 {
00714 return FEDM_ERROR_UNKNOWN_LANGUAGE;
00715 }
00716
00717 return FEDM_OK;
00718 }
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741 int FEDM_Base::GetData(const char* ID, bool* Data, FEDM_BYTE_ARRAY& Array, int BlockSize)
00742 {
00743 FEDM_CHK3(ID);
00744 FEDM_CHK3(Data);
00745 FEDM_CHK3(&Array);
00746
00747 int i;
00748 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
00749 int Index, BitNr;
00750
00751
00752 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
00753 return FEDM_ERROR_BLOCK_SIZE;
00754
00755
00756
00757 sscanf( ID, "%d %d %d %d %d %d %d",
00758 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
00759
00760 Index = BlockAdr * BlockSize + BytePos;
00761
00762
00763 if( ByteCnt != 1 )
00764 return FEDM_ERROR_BYTE_BOUNDARY;
00765
00766
00767 if( BitCnt != 1 )
00768 return FEDM_ERROR_BIT_BOUNDARY;
00769
00770
00771 if( ByteCnt > (int)(Array.capacity() - Index) )
00772 return FEDM_ERROR_ARRAY_BOUNDARY;
00773
00774 BitNr = 1;
00775 for( i=0; i<BitPos;i++ ) BitNr *= 2;
00776
00777 if( Array[Index] & BitNr ) *Data = true;
00778 else *Data = false;
00779
00780 return FEDM_OK;
00781 }
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
00798 int FEDM_Base::GetData(const char* ID, BOOL* Data, FEDM_BYTE_ARRAY& Array, int BlockSize)
00799 {
00800 FEDM_CHK3(ID);
00801 FEDM_CHK3(Data);
00802 FEDM_CHK3(&Array);
00803
00804 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
00805 int Index, BitNr;
00806
00807
00808 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
00809 return FEDM_ERROR_BLOCK_SIZE;
00810
00811
00812
00813 sscanf( ID, "%d %d %d %d %d %d %d",
00814 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
00815
00816 Index = BlockAdr * BlockSize + BytePos;
00817
00818
00819 if( ByteCnt != 1 )
00820 return FEDM_ERROR_BYTE_BOUNDARY;
00821
00822
00823 if( BitCnt != 1 )
00824 return FEDM_ERROR_BIT_BOUNDARY;
00825
00826
00827 if( ByteCnt > (int)(Array.capacity() - Index) )
00828 return FEDM_ERROR_ARRAY_BOUNDARY;
00829
00830 BitNr = 1;
00831 for( int i=0; i<BitPos;i++ ) BitNr *= 2;
00832
00833 if( Array[Index] & BitNr ) *Data = TRUE;
00834 else *Data = FALSE;
00835
00836 return FEDM_OK;
00837 }
00838 #endif
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855 int FEDM_Base::GetData(const char* ID, unsigned char* Data, FEDM_BYTE_ARRAY& Array, int BlockSize)
00856 {
00857 FEDM_CHK3(ID);
00858 FEDM_CHK3(Data);
00859 FEDM_CHK3(&Array);
00860
00861 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
00862 int Index;
00863
00864
00865 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
00866 return FEDM_ERROR_BLOCK_SIZE;
00867
00868
00869
00870 sscanf( ID, "%d %d %d %d %d %d %d",
00871 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
00872
00873 Index = BlockAdr * BlockSize + BytePos;
00874
00875
00876 if( ByteCnt != 1 )
00877 return FEDM_ERROR_BYTE_BOUNDARY;
00878
00879
00880 if( BitCnt + BitPos > 8 )
00881 return FEDM_ERROR_BIT_BOUNDARY;
00882
00883
00884 if( ByteCnt > (int)(Array.capacity() - Index) )
00885 return FEDM_ERROR_ARRAY_BOUNDARY;
00886
00887 *Data = Array[Index];
00888
00889
00890 if( BitCnt > 0 )
00891 {
00892 *Data <<= (8 - BitPos - BitCnt);
00893 *Data >>= (8 - BitPos - BitCnt);
00894 *Data >>= BitPos;
00895 }
00896
00897 return FEDM_OK;
00898 }
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918 int FEDM_Base::GetData(const char* ID, unsigned char* Data, int Cnt, FEDM_BYTE_ARRAY& Array, int BlockSize)
00919 {
00920 FEDM_CHK3(ID);
00921 FEDM_CHK3(Data);
00922 FEDM_CHK3(&Array);
00923
00924 int i;
00925 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
00926 int Index;
00927 int adr = 0;
00928
00929 if(Cnt == 0)
00930 return FEDM_OK;
00931
00932
00933 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
00934 return FEDM_ERROR_BLOCK_SIZE;
00935
00936
00937
00938 sscanf( ID, "%d %d %d %d %d %d %d",
00939 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
00940
00941
00942 if( (Cnt < 0) || (BitCnt > 0) )
00943 return FEDM_ERROR_PARAMETER;
00944
00945
00946 if( Cnt > ByteCnt )
00947 return FEDM_ERROR_PARAMETER;
00948
00949 Index = BlockAdr * BlockSize + BytePos;
00950
00951
00952 if( Cnt > (int)(Array.capacity() - Index) )
00953 return FEDM_ERROR_ARRAY_BOUNDARY;
00954
00955
00956 adr = Index;
00957 for(i=0; i<Cnt; i++)
00958 {
00959 *(Data+i) = Array[adr];
00960 if( (MemID == FEDM_RFC_EEDATA_MEM ||
00961 MemID == FEDM_RFC_RAMDATA_MEM ||
00962 MemID == FEDM_ACC_EEDATA_MEM ||
00963 MemID == FEDM_ACC_RAMDATA_MEM ) &&
00964 (adr % BlockSize) == BlockSize-3 )
00965 adr += 2;
00966
00967 adr++;
00968 }
00969
00970 return FEDM_OK;
00971 }
00972
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986
00987
00988 int FEDM_Base::GetData(const char* ID, unsigned int* Data, FEDM_BYTE_ARRAY& Array, int BlockSize)
00989 {
00990 FEDM_CHK3(ID);
00991 FEDM_CHK3(Data);
00992 FEDM_CHK3(&Array);
00993
00994 int i;
00995 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
00996 int Index;
00997
00998
00999 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
01000 return FEDM_ERROR_BLOCK_SIZE;
01001
01002
01003
01004 sscanf( ID, "%d %d %d %d %d %d %d",
01005 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
01006
01007 Index = BlockAdr * BlockSize + BytePos;
01008
01009
01010 if( ByteCnt > 4 )
01011 return FEDM_ERROR_BYTE_BOUNDARY;
01012
01013
01014 if( (BitPos + BitCnt)> 32 )
01015 return FEDM_ERROR_BIT_BOUNDARY;
01016
01017
01018 if( ByteCnt > (int)(Array.capacity() - Index) )
01019 return FEDM_ERROR_ARRAY_BOUNDARY;
01020
01021 *Data = 0;
01022
01023 for( i=0; i< ByteCnt; i++ )
01024 {
01025
01026 *Data += ( Array[Index+ByteCnt-1-i] << (8*i) );
01027 }
01028
01029
01030 if( BitCnt > 0 )
01031 {
01032 *Data <<= (32 - BitPos - BitCnt);
01033 *Data >>= (32 - BitPos - BitCnt);
01034 *Data >>= BitPos;
01035 }
01036
01037 return FEDM_OK;
01038 }
01039
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052
01053
01054
01055
01056 int FEDM_Base::GetData(const char* ID, __int64* Data, FEDM_BYTE_ARRAY& Array, int BlockSize)
01057 {
01058 FEDM_CHK3(ID);
01059 FEDM_CHK3(Data);
01060 FEDM_CHK3(&Array);
01061
01062 int i;
01063 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
01064 int Index;
01065 int adr = 0;
01066
01067
01068 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
01069 return FEDM_ERROR_BLOCK_SIZE;
01070
01071
01072
01073 sscanf( ID, "%d %d %d %d %d %d %d",
01074 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
01075
01076 Index = BlockAdr * BlockSize + BytePos;
01077
01078
01079 if( ByteCnt > 8 )
01080 return FEDM_ERROR_BYTE_BOUNDARY;
01081
01082
01083 if( (BitPos + BitCnt) > 64 )
01084 return FEDM_ERROR_BIT_BOUNDARY;
01085
01086
01087 if( ByteCnt > (int)(Array.capacity() - Index) )
01088 return FEDM_ERROR_ARRAY_BOUNDARY;
01089
01090 *Data = 0;
01091
01092 adr = Index+ByteCnt-1;
01093 for( i=0; i< ByteCnt; i++ )
01094 {
01095
01096 *Data += ( (__int64)Array[adr] << (8*i) );
01097 if( (MemID == FEDM_RFC_EEDATA_MEM ||
01098 MemID == FEDM_RFC_RAMDATA_MEM ||
01099 MemID == FEDM_ACC_EEDATA_MEM ||
01100 MemID == FEDM_ACC_RAMDATA_MEM ) &&
01101 (adr % BlockSize) == 0 )
01102 adr -= 2;
01103
01104 adr--;
01105 }
01106
01107
01108 if( BitCnt > 0 )
01109 {
01110
01111
01112
01113
01114
01115 if( (64 - BitPos - BitCnt) > 0 )
01116 {
01117 *Data <<= (64 - BitPos - BitCnt - 1);
01118 #ifdef __GNUC__
01119 *Data &= 0x7FFFFFFFFFFFFFFFLL;
01120 #else
01121 *Data &= 0x7FFFFFFFFFFFFFFF;
01122 #endif
01123 *Data >>= (64 - BitPos - BitCnt - 1);
01124 }
01125 *Data >>= BitPos;
01126 }
01127
01128 return FEDM_OK;
01129 }
01130
01131
01132
01133
01134
01135
01136
01137
01138
01139
01140
01141
01142
01143
01144
01145
01146
01147
01148 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
01149 int FEDM_Base::GetData(const char* ID, CString& Data, FEDM_BYTE_ARRAY& Array, int BlockSize)
01150 {
01151 FEDM_CHK3(ID);
01152 FEDM_CHK3(&Data);
01153 FEDM_CHK3(&Array);
01154
01155 int i;
01156 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
01157 int Index;
01158 int adr = 0;
01159
01160
01161 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
01162 return FEDM_ERROR_BLOCK_SIZE;
01163
01164
01165
01166 sscanf( ID, "%d %d %d %d %d %d %d",
01167 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
01168
01169 Index = BlockAdr * BlockSize + BytePos;
01170
01171
01172
01173
01174
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188
01189
01190
01191
01192
01193 if( (BitPos + BitCnt) > BlockSize*8 )
01194 return FEDM_ERROR_BIT_BOUNDARY;
01195
01196
01197 if( BitPos > 7 )
01198 return FEDM_ERROR_BIT_BOUNDARY;
01199
01200
01201 if( ByteCnt > (int)(Array.capacity() - Index) )
01202 return FEDM_ERROR_ARRAY_BOUNDARY;
01203
01204 char buffer[5];
01205 unsigned char ucTmp;
01206 unsigned char* ucData = new unsigned char[ByteCnt];
01207 memset( &ucData[0], '\0', ByteCnt);
01208
01209 Data = "";
01210
01211 if(BitCnt > 0)
01212 {
01213 for(i=0; i<ByteCnt-1; i++)
01214 {
01215 ucData[i] = (Array[Index+i]>>BitPos) | (Array[Index+i+1]<<(8-BitPos));
01216 }
01217 ucData[ByteCnt-1] = Array[Index+ByteCnt-1]>>BitPos;
01218
01219
01220 ucData[0] <<= (8-(BitCnt%8));
01221 ucData[0] >>= (8-(BitCnt%8));
01222 }
01223 else
01224 {
01225 adr = Index;
01226 for(i=0; i<ByteCnt; i++)
01227 {
01228 ucData[i] = Array[adr];
01229 if( (MemID == FEDM_RFC_EEDATA_MEM ||
01230 MemID == FEDM_RFC_RAMDATA_MEM ||
01231 MemID == FEDM_ACC_EEDATA_MEM ||
01232 MemID == FEDM_ACC_RAMDATA_MEM ) &&
01233 (adr % BlockSize) == BlockSize-3 )
01234 adr += 2;
01235
01236 adr++;
01237 }
01238 }
01239
01240
01241
01242 for( i=0; i< ByteCnt; i++ )
01243 {
01244 ucTmp = ucData[i];
01245
01246 buffer[0] = '\0';
01247 sprintf( buffer, "%02X", ucTmp );
01248 Data += buffer;
01249 }
01250
01251 delete [] ucData;
01252
01253 return FEDM_OK;
01254 }
01255 #endif
01256
01257
01258
01259
01260
01261
01262
01263
01264
01265
01266
01267
01268
01269
01270
01271
01272
01273
01274 int FEDM_Base::GetData(const char* ID, string& Data, FEDM_BYTE_ARRAY& Array, int BlockSize)
01275 {
01276 FEDM_CHK3(ID);
01277 FEDM_CHK3(&Data);
01278 FEDM_CHK3(&Array);
01279
01280 int i;
01281 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
01282 int Index;
01283 int adr = 0;
01284
01285
01286 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
01287 return FEDM_ERROR_BLOCK_SIZE;
01288
01289
01290
01291 sscanf( ID, "%d %d %d %d %d %d %d",
01292 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
01293
01294 Index = BlockAdr * BlockSize + BytePos;
01295
01296
01297
01298
01299
01300
01301
01302
01303
01304
01305
01306
01307
01308
01309
01310
01311
01312
01313
01314
01315
01316 if( (BitPos + BitCnt) > BlockSize*8 )
01317 return FEDM_ERROR_BIT_BOUNDARY;
01318
01319
01320 if( BitPos > 7 )
01321 return FEDM_ERROR_BIT_BOUNDARY;
01322
01323
01324 if( ByteCnt > (int)(Array.capacity() - Index) )
01325 return FEDM_ERROR_ARRAY_BOUNDARY;
01326
01327 char buffer[5];
01328 unsigned char ucTmp;
01329 unsigned char* ucData = new unsigned char[ByteCnt];
01330 memset( &ucData[0], '\0', ByteCnt);
01331
01332 Data = "";
01333
01334 if(BitCnt > 0)
01335 {
01336 for(i=0; i<ByteCnt-1; i++)
01337 {
01338 ucData[i] = (Array[Index+i]>>BitPos) | (Array[Index+i+1]<<(8-BitPos));
01339 }
01340 ucData[ByteCnt-1] = Array[Index+ByteCnt-1]>>BitPos;
01341
01342
01343 ucData[0] <<= (8-(BitCnt%8));
01344 ucData[0] >>= (8-(BitCnt%8));
01345 }
01346 else
01347 {
01348 adr = Index;
01349 for(i=0; i<ByteCnt; i++)
01350 {
01351 ucData[i] = Array[adr];
01352 if( (MemID == FEDM_RFC_EEDATA_MEM ||
01353 MemID == FEDM_RFC_RAMDATA_MEM ||
01354 MemID == FEDM_ACC_EEDATA_MEM ||
01355 MemID == FEDM_ACC_RAMDATA_MEM ) &&
01356 (adr % BlockSize) == BlockSize-3 )
01357 adr += 2;
01358
01359 adr++;
01360 }
01361 }
01362
01363
01364 for( i=0; i< ByteCnt; i++ )
01365 {
01366 ucTmp = ucData[i];
01367
01368 buffer[0] = '\0';
01369 sprintf( buffer, "%02X", ucTmp );
01370 Data += buffer;
01371 }
01372
01373 delete [] ucData;
01374
01375 return FEDM_OK;
01376 }
01377
01378
01379
01380
01381
01382
01383
01384
01385
01386
01387
01388
01389
01390
01391
01392
01393
01394
01395
01396
01397
01398 int FEDM_Base::GetData(const char* ID, char* Data, int DataLen, FEDM_BYTE_ARRAY& Array, int BlockSize)
01399 {
01400 FEDM_CHK3(ID);
01401 FEDM_CHK3(Data);
01402 FEDM_CHK3(&Array);
01403
01404 int i, Len;
01405 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
01406 int Index;
01407 int adr = 0;
01408
01409
01410 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
01411 return FEDM_ERROR_BLOCK_SIZE;
01412
01413
01414
01415 sscanf( ID, "%d %d %d %d %d %d %d",
01416 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
01417
01418 Index = BlockAdr * BlockSize + BytePos;
01419
01420
01421 if( DataLen%2 )
01422 return FEDM_ERROR_ODD_STRING_LENGTH;
01423
01424
01425 if( DataLen > 2*ByteCnt)
01426 return FEDM_ERROR_BUFFER_LENGTH;
01427
01428
01429
01430
01431
01432
01433 if( (BitPos + BitCnt) > BlockSize*8 )
01434 return FEDM_ERROR_BIT_BOUNDARY;
01435
01436
01437 if( BitPos > 7 )
01438 return FEDM_ERROR_BIT_BOUNDARY;
01439
01440 Len = (DataLen>>1);
01441
01442
01443 if( Len > (int)(Array.capacity() - Index) )
01444 return FEDM_ERROR_ARRAY_BOUNDARY;
01445
01446 char buffer[5];
01447 unsigned char ucTmp;
01448 unsigned char* ucData = new unsigned char[ByteCnt];
01449 memset( &ucData[0], '\0', ByteCnt);
01450
01451 memset( &Data[0], '\0', DataLen);
01452
01453 if(BitCnt > 0)
01454 {
01455 for(i=0; i<Len-1; i++)
01456 {
01457 ucData[i] = (Array[Index+i]>>BitPos) | (Array[Index+i+1]<<(8-BitPos));
01458 }
01459 ucData[Len-1] = Array[Index+Len-1]>>BitPos;
01460
01461
01462 ucData[0] <<= (8-(BitCnt%8));
01463 ucData[0] >>= (8-(BitCnt%8));
01464 }
01465 else
01466 {
01467 adr = Index;
01468 for(i=0; i<Len; i++)
01469 {
01470 ucData[i] = Array[adr];
01471 if( (MemID == FEDM_RFC_EEDATA_MEM ||
01472 MemID == FEDM_RFC_RAMDATA_MEM ||
01473 MemID == FEDM_ACC_EEDATA_MEM ||
01474 MemID == FEDM_ACC_RAMDATA_MEM ) &&
01475 (adr % BlockSize) == BlockSize-3 )
01476 adr += 2;
01477
01478 adr++;
01479 }
01480 }
01481
01482
01483 for(i=0; i<Len; i++)
01484 {
01485 ucTmp = ucData[i];
01486
01487 buffer[0] = '\0';
01488 sprintf( buffer, "%02X", ucTmp );
01489 Data[2*i] = buffer[0];
01490 Data[2*i+1] = buffer[1];
01491 }
01492
01493 delete [] ucData;
01494
01495 return FEDM_OK;
01496 }
01497
01498
01499
01500
01501
01502
01503
01504
01505
01506
01507
01508
01509
01510
01511
01512 int FEDM_Base::SetData( const char* ID, bool Data, FEDM_BYTE_ARRAY& Array, int BlockSize )
01513 {
01514 FEDM_CHK3(ID);
01515 FEDM_CHK3(&Array);
01516
01517
01518 int i;
01519 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
01520 int Index, BitNr;
01521 bool OldData = false;
01522
01523
01524 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
01525 return FEDM_ERROR_BLOCK_SIZE;
01526
01527
01528
01529 sscanf( ID, "%d %d %d %d %d %d %d",
01530 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
01531
01532 Index = BlockAdr * BlockSize + BytePos;
01533
01534
01535 if( ByteCnt != 1 )
01536 return FEDM_ERROR_BYTE_BOUNDARY;
01537
01538
01539 if( BitCnt != 1 )
01540 return FEDM_ERROR_BIT_BOUNDARY;
01541
01542
01543 if( ByteCnt > (int)(Array.capacity() - Index) )
01544 return FEDM_ERROR_ARRAY_BOUNDARY;
01545
01546
01547 GetData( ID, &OldData, Array, BlockSize );
01548
01549 BitNr = 1;
01550 for( i=0; i<BitPos;i++ ) BitNr *= 2;
01551
01552 if( Data ) Array[Index] |= BitNr;
01553 else Array[Index] &= ~BitNr;
01554
01555 if( OldData != Data )
01556 return FEDM_MODIFIED;
01557
01558 return FEDM_OK;
01559 }
01560
01561
01562
01563
01564
01565
01566
01567
01568
01569
01570
01571
01572
01573
01574
01575 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
01576 int FEDM_Base::SetData( const char* ID, BOOL Data, FEDM_BYTE_ARRAY& Array, int BlockSize )
01577 {
01578 return SetData( ID, Data ? true : false, Array, BlockSize );
01579 }
01580 #endif
01581
01582
01583
01584
01585
01586
01587
01588
01589
01590
01591
01592
01593
01594
01595
01596
01597 int FEDM_Base::SetData( const char* ID, unsigned char Data, FEDM_BYTE_ARRAY& Array, int BlockSize )
01598 {
01599 FEDM_CHK3(ID);
01600 FEDM_CHK3(&Array);
01601
01602 unsigned char ucMask = 0;
01603 int i, ii;
01604 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
01605 int Index, BitNr;
01606 unsigned char OldData = 0x00;
01607
01608
01609 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
01610 return FEDM_ERROR_BLOCK_SIZE;
01611
01612
01613
01614 sscanf( ID, "%d %d %d %d %d %d %d",
01615 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
01616
01617 Index = BlockAdr * BlockSize + BytePos;
01618
01619
01620 if( BitPos + BitCnt > 8 )
01621 return FEDM_ERROR_BIT_BOUNDARY;
01622
01623
01624 if( ByteCnt > (int)(Array.capacity() - Index) )
01625 return FEDM_ERROR_ARRAY_BOUNDARY;
01626
01627
01628 GetData( ID, &OldData, Array, BlockSize );
01629
01630
01631 if( BitCnt > 0 )
01632 {
01633 BitNr = 1;
01634 for(i=0; i<BitPos;i++) BitNr *= 2;
01635
01636
01637 for (ii = 0; ii < BitCnt; ii++)
01638 {
01639 ucMask |= BitNr;
01640 Array[Index] &= ~BitNr;
01641 BitNr *= 2;
01642 }
01643
01644 Data <<= BitPos;
01645 Array[Index] |= (Data & ucMask);
01646 OldData <<= BitPos;
01647 }
01648
01649 else
01650 {
01651 ucMask = 0xFF;
01652 Array[Index] = Data;
01653 }
01654
01655 if( OldData != (Data & ucMask) )
01656 return FEDM_MODIFIED;
01657
01658 return FEDM_OK;
01659 }
01660
01661
01662
01663
01664
01665
01666
01667
01668
01669
01670
01671
01672
01673
01674
01675
01676
01677
01678
01679 int FEDM_Base::SetData( const char* ID, unsigned char* Data, int Cnt, FEDM_BYTE_ARRAY& Array, int BlockSize )
01680 {
01681 FEDM_CHK3(ID);
01682 FEDM_CHK3(Data);
01683 FEDM_CHK3(&Array);
01684
01685 int i;
01686 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
01687 int Index;
01688 int adr = 0;
01689 unsigned char* OldData;
01690
01691 if( Cnt == 0 )
01692 return FEDM_OK;
01693
01694
01695 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
01696 return FEDM_ERROR_BLOCK_SIZE;
01697
01698
01699 if( Cnt < 0 )
01700 return FEDM_ERROR_PARAMETER;
01701
01702
01703
01704 sscanf( ID, "%d %d %d %d %d %d %d",
01705 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
01706
01707
01708 if( BitCnt > 0 )
01709 return FEDM_ERROR_PARAMETER;
01710
01711
01712 if(Cnt > ByteCnt)
01713 return FEDM_ERROR_PARAMETER;
01714
01715 Index = BlockAdr * BlockSize + BytePos;
01716
01717
01718 if( Cnt > (int)(Array.capacity() - Index) )
01719 return FEDM_ERROR_ARRAY_BOUNDARY;
01720
01721 OldData = new unsigned char[Cnt];
01722 if(OldData == NULL)
01723 return FEDM_ERROR_NO_MORE_MEM;
01724
01725
01726 GetData( ID, OldData, Cnt, Array, BlockSize );
01727
01728
01729 adr = Index;
01730 for( i=0; i<Cnt; i++)
01731 {
01732 Array[adr] = *(Data+i);
01733 if( (MemID == FEDM_RFC_EEDATA_MEM ||
01734 MemID == FEDM_RFC_RAMDATA_MEM ||
01735 MemID == FEDM_ACC_EEDATA_MEM ||
01736 MemID == FEDM_ACC_RAMDATA_MEM ) &&
01737 (adr % BlockSize) == BlockSize-3 )
01738 adr += 2;
01739
01740 adr++;
01741 }
01742
01743 if( memcmp(OldData, Data, Cnt) != 0 )
01744 {
01745 delete[] OldData;
01746 return FEDM_MODIFIED;
01747 }
01748
01749 delete[] OldData;
01750 return FEDM_OK;
01751 }
01752
01753
01754
01755
01756
01757
01758
01759
01760
01761
01762
01763
01764
01765
01766
01767 int FEDM_Base::SetData( const char* ID, unsigned int Data, FEDM_BYTE_ARRAY& Array, int BlockSize )
01768 {
01769 FEDM_CHK3(ID);
01770 FEDM_CHK3(&Array);
01771
01772 unsigned char ucMask[4];
01773 int i;
01774 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
01775 int Index, BitNr;
01776 unsigned int uiMask = 0;
01777 unsigned int OldData = 0;
01778
01779 memset(ucMask, 0, 4);
01780
01781
01782 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
01783 return FEDM_ERROR_BLOCK_SIZE;
01784
01785
01786
01787 sscanf( ID, "%d %d %d %d %d %d %d",
01788 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
01789
01790 Index = BlockAdr * BlockSize + BytePos;
01791
01792
01793 if( ByteCnt > 4 )
01794 return FEDM_ERROR_BYTE_BOUNDARY;
01795
01796
01797 if( BitPos + BitCnt > 32 )
01798 return FEDM_ERROR_BIT_BOUNDARY;
01799
01800
01801 if( BitCnt > ByteCnt*8 )
01802 return FEDM_ERROR_BIT_BOUNDARY;
01803
01804
01805 if( ByteCnt > (int)(Array.capacity() - Index) )
01806 return FEDM_ERROR_ARRAY_BOUNDARY;
01807
01808
01809 GetData( ID, &OldData, Array, BlockSize );
01810
01811
01812 if( BitCnt > 0 )
01813 {
01814 BitNr = 1;
01815 BitNr <<= BitPos;
01816
01817
01818 for ( i = 0; i < BitCnt; i++ )
01819 {
01820 uiMask |= BitNr;
01821 BitNr <<= 1;
01822 }
01823
01824 ucMask[3] = (unsigned char) (uiMask & 0x000000FF);
01825 ucMask[2] = (unsigned char)((uiMask & 0x0000FF00) >> 8);
01826 ucMask[1] = (unsigned char)((uiMask & 0x00FF0000) >> 16);
01827 ucMask[0] = (unsigned char)((uiMask & 0xFF000000) >> 24);
01828
01829
01830 for ( i = 0; i < ByteCnt; i++ )
01831 {
01832 Array[Index+ByteCnt-1-i] &= ~ucMask[3-i];
01833 }
01834
01835 Data <<= BitPos;
01836 uiMask >>= BitPos;
01837 Index = BlockAdr * BlockSize + BytePos;
01838 for( i=0; i< ByteCnt; i++ )
01839 {
01840
01841 Array[Index+ByteCnt-1-i] |= (*( ((unsigned char*)&Data) + i ) & ucMask[3-i]);
01842 }
01843 OldData <<= BitPos;
01844 }
01845
01846 else
01847 {
01848 for( i=0; i< ByteCnt; i++ )
01849 {
01850
01851 Array[Index+ByteCnt-1-i] = *( ((unsigned char*)&Data) + i );
01852 }
01853
01854 uiMask = 0xFFFFFFFF;
01855 }
01856
01857 if( OldData != (Data & uiMask) )
01858 return FEDM_MODIFIED;
01859
01860 return FEDM_OK;
01861 }
01862
01863
01864
01865
01866
01867
01868
01869
01870
01871
01872
01873
01874
01875
01876
01877
01878 int FEDM_Base::SetData( const char* ID, __int64 Data, FEDM_BYTE_ARRAY& Array, int BlockSize )
01879 {
01880 FEDM_CHK3(ID);
01881 FEDM_CHK3(&Array);
01882
01883 unsigned char ucMask[8];
01884 int i;
01885 int idx;
01886 int adr = 0;
01887 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
01888 int Index, BitNr;
01889 __int64 i64Mask = 0;
01890 __int64 OldData = 0;
01891
01892 memset(ucMask, 0, 8);
01893
01894
01895 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
01896 return FEDM_ERROR_BLOCK_SIZE;
01897
01898
01899
01900 sscanf( ID, "%d %d %d %d %d %d %d",
01901 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
01902
01903 Index = BlockAdr * BlockSize + BytePos;
01904
01905
01906 if( ByteCnt > 8 )
01907 return FEDM_ERROR_BYTE_BOUNDARY;
01908
01909
01910 if( BitPos + BitCnt > 64 )
01911 return FEDM_ERROR_BIT_BOUNDARY;
01912
01913
01914 if( BitCnt > ByteCnt*8 )
01915 return FEDM_ERROR_BIT_BOUNDARY;
01916
01917
01918 if( ByteCnt > (int)(Array.capacity() - Index) )
01919 return FEDM_ERROR_ARRAY_BOUNDARY;
01920
01921
01922 GetData( ID, &OldData, Array, BlockSize );
01923
01924
01925 if( BitCnt > 0 )
01926 {
01927 BitNr = 1;
01928 for( i=0; i<BitPos;i++ ) BitNr *= 2;
01929
01930
01931 idx = ByteCnt - 1;
01932 for ( i = 0; i < BitCnt; i++ )
01933 {
01934 ucMask[idx] |= BitNr;
01935 Array[Index+ByteCnt-1] &= ~BitNr;
01936 BitNr *= 2;
01937
01938 if( (i > 0) && (!((i+BitPos+1)%8)) )
01939 {
01940 BitNr = 1;
01941 Index--;
01942 idx--;
01943 }
01944 }
01945
01946 Data <<= BitPos;
01947 Index = BlockAdr * BlockSize + BytePos;
01948 adr = Index+ByteCnt-1;
01949 for( i=0; i< ByteCnt; i++ )
01950 {
01951
01952 Array[adr] |= *( ((unsigned char*)&Data) + i );
01953 if( (MemID == FEDM_RFC_EEDATA_MEM ||
01954 MemID == FEDM_RFC_RAMDATA_MEM ||
01955 MemID == FEDM_ACC_EEDATA_MEM ||
01956 MemID == FEDM_ACC_RAMDATA_MEM ) &&
01957 (adr % BlockSize) == 0 )
01958 adr -= 2;
01959
01960 adr--;
01961 }
01962 OldData <<= BitPos;
01963
01964 i64Mask |= (__int64)ucMask[0];
01965 i64Mask |= ((__int64)ucMask[1] << 8);
01966 i64Mask |= ((__int64)ucMask[2] << 16);
01967 i64Mask |= ((__int64)ucMask[3] << 24);
01968 i64Mask |= ((__int64)ucMask[4] << 32);
01969 i64Mask |= ((__int64)ucMask[5] << 40);
01970 i64Mask |= ((__int64)ucMask[6] << 48);
01971 i64Mask |= ((__int64)ucMask[7] << 56);
01972 }
01973
01974 else
01975 {
01976 adr = Index+ByteCnt-1;
01977 for( i=0; i< ByteCnt; i++ )
01978 {
01979
01980 Array[adr] = *( ((unsigned char*)&Data) + i );
01981 if( (MemID == FEDM_RFC_EEDATA_MEM ||
01982 MemID == FEDM_RFC_RAMDATA_MEM ||
01983 MemID == FEDM_ACC_EEDATA_MEM ||
01984 MemID == FEDM_ACC_RAMDATA_MEM ) &&
01985 (adr % BlockSize) == 0 )
01986 adr -= 2;
01987
01988 adr--;
01989 }
01990
01991 #ifdef _FEDM_WINDOWS
01992 #if _MSC_VER <= 1200
01993 i64Mask = 0xFFFFFFFFFFFFFFFF;
01994 #else
01995 #ifdef _FEDM_EVC4
01996 i64Mask = 0xFFFFFFFFFFFFFFFF;
01997 #else
01998 i64Mask = 0xFFFFFFFFFFFFFFFFLL;
01999 #endif
02000 #endif
02001 #endif
02002 #ifdef _FEDM_LINUX
02003 i64Mask = 0xFFFFFFFFFFFFFFFFLL;
02004 #endif
02005 }
02006
02007 if( OldData != (Data & i64Mask) )
02008 return FEDM_MODIFIED;
02009
02010 return FEDM_OK;
02011 }
02012
02013
02014
02015
02016
02017
02018
02019
02020
02021
02022
02023
02024
02025
02026
02027
02028
02029
02030
02031
02032 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
02033 int FEDM_Base::SetData( const char* ID, CString Data, FEDM_BYTE_ARRAY& Array, int BlockSize )
02034 {
02035 FEDM_CHK3(ID);
02036 FEDM_CHK3(&Array);
02037
02038 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
02039 int Index;
02040 int adr = 0;
02041 int iLen = 0;
02042 CString OldData = "";
02043 char cTmp[5];
02044 unsigned int uiTmp;
02045
02046
02047 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
02048 return FEDM_ERROR_BLOCK_SIZE;
02049
02050
02051
02052 sscanf( ID, "%d %d %d %d %d %d %d",
02053 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
02054
02055 Index = BlockAdr * BlockSize + BytePos;
02056
02057
02058 #ifdef _FEDM_MFC_SUPPORT // Microsoft Compiler
02059 iLen = Data.GetLength();
02060 #endif
02061 #ifdef __BORLANDC__ // Borland C++ Builder
02062 iLen = Data.Length();
02063 #endif
02064
02065 if(iLen==0 || iLen>2*ByteCnt)
02066 return FEDM_ERROR_STRING_LENGTH;
02067
02068
02069 if( iLen%2 )
02070 return FEDM_ERROR_ODD_STRING_LENGTH;
02071
02072
02073 if( BitCnt > 0 )
02074 return FEDM_ERROR_BIT_BOUNDARY;
02075
02076
02077 if( iLen > (int)(Array.capacity() - Index) )
02078 return FEDM_ERROR_ARRAY_BOUNDARY;
02079
02080
02081 GetData( ID, OldData, Array, BlockSize );
02082
02083 int i;
02084 adr = Index;
02085 #ifdef __BORLANDC__ // Borland C++ Builder: AnsiStrings index starts with 1
02086 for( i=1; i<(iLen+1); i+=2 )
02087 #else
02088 for( i=0; i<iLen; i+=2 )
02089 #endif
02090 {
02091 cTmp[0] = Data[i];
02092 cTmp[1] = Data[i+1];
02093 cTmp[2] = '\0';
02094 sscanf( (const char*)cTmp, "%02x", &uiTmp );
02095 Array[adr] = (unsigned char)uiTmp;
02096 if( (MemID == FEDM_RFC_EEDATA_MEM ||
02097 MemID == FEDM_RFC_RAMDATA_MEM ||
02098 MemID == FEDM_ACC_EEDATA_MEM ||
02099 MemID == FEDM_ACC_RAMDATA_MEM ) &&
02100 (adr % BlockSize) == BlockSize-3 )
02101 adr += 2;
02102
02103 adr++;
02104 }
02105
02106 if( OldData != Data )
02107 return FEDM_MODIFIED;
02108
02109 return FEDM_OK;
02110 }
02111 #endif
02112
02113
02114
02115
02116
02117
02118
02119
02120
02121
02122
02123
02124
02125
02126
02127
02128
02129
02130
02131
02132 int FEDM_Base::SetData( const char* ID, string Data, FEDM_BYTE_ARRAY& Array, int BlockSize )
02133 {
02134 FEDM_CHK3(ID);
02135 FEDM_CHK3(&Array);
02136
02137 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
02138 int Index;
02139 int adr = 0;
02140 string OldData = "";
02141 char cTmp[5];
02142 unsigned int uiTmp;
02143
02144
02145 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
02146 return FEDM_ERROR_BLOCK_SIZE;
02147
02148
02149
02150 sscanf( ID, "%d %d %d %d %d %d %d",
02151 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
02152
02153 Index = BlockAdr * BlockSize + BytePos;
02154
02155
02156 if( (int)Data.length()==0 || (int)Data.length()>2*ByteCnt )
02157 return FEDM_ERROR_STRING_LENGTH;
02158
02159
02160
02161 if( Data.length()%2 )
02162 return FEDM_ERROR_ODD_STRING_LENGTH;
02163
02164
02165 if( BitCnt > 0 )
02166 return FEDM_ERROR_BIT_BOUNDARY;
02167
02168
02169 if( (int)Data.length() > ((int)Array.capacity() - Index) )
02170 return FEDM_ERROR_ARRAY_BOUNDARY;
02171
02172
02173 GetData( ID, OldData, Array, BlockSize );
02174
02175 int i;
02176 adr = Index;
02177 for( i=0; i<(int)Data.length(); i+=2 )
02178 {
02179 cTmp[0] = Data[i];
02180 cTmp[1] = Data[i+1];
02181 cTmp[2] = '\0';
02182 sscanf( (const char*)cTmp, "%02x", &uiTmp );
02183 Array[adr] = (unsigned char)uiTmp;
02184 if( (MemID == FEDM_RFC_EEDATA_MEM ||
02185 MemID == FEDM_RFC_RAMDATA_MEM ||
02186 MemID == FEDM_ACC_EEDATA_MEM ||
02187 MemID == FEDM_ACC_RAMDATA_MEM ) &&
02188 (adr % BlockSize) == BlockSize-3 )
02189 adr += 2;
02190
02191 adr++;
02192 }
02193
02194 if( OldData != Data )
02195 return FEDM_MODIFIED;
02196
02197 return FEDM_OK;
02198 }
02199
02200
02201
02202
02203
02204
02205
02206
02207
02208
02209
02210
02211
02212
02213
02214
02215
02216
02217
02218
02219
02220 int FEDM_Base::SetData( const char* ID, char* Data, int DataLen, FEDM_BYTE_ARRAY& Array, int BlockSize )
02221 {
02222 FEDM_CHK3(ID);
02223 FEDM_CHK3(Data);
02224 FEDM_CHK3(&Array);
02225
02226 int FamID=0, MemID=0, BlockAdr=0, BytePos=0, ByteCnt=0, BitPos=0, BitCnt=0;
02227 int Index;
02228 int adr = 0;
02229 char* OldData;
02230 char cTmp[5];
02231 unsigned int uiTmp;
02232
02233
02234 if( (BlockSize!=4) && (BlockSize!=16) && (BlockSize!=32) )
02235 return FEDM_ERROR_BLOCK_SIZE;
02236
02237
02238
02239 sscanf( ID, "%d %d %d %d %d %d %d",
02240 &FamID, &MemID, &BlockAdr, &BytePos, &ByteCnt, &BitPos, &BitCnt );
02241
02242 Index = BlockAdr * BlockSize + BytePos;
02243
02244
02245 if( DataLen > 2*ByteCnt)
02246 return FEDM_ERROR_STRING_LENGTH;
02247
02248
02249 if( DataLen%2 )
02250 return FEDM_ERROR_ODD_STRING_LENGTH;
02251
02252
02253 if( BitCnt > 0 )
02254 return FEDM_ERROR_BIT_BOUNDARY;
02255
02256
02257 if( DataLen > (int)(Array.capacity() - Index) )
02258 return FEDM_ERROR_ARRAY_BOUNDARY;
02259
02260 OldData = new char[DataLen+1];
02261 if(OldData == NULL)
02262 return FEDM_ERROR_NO_MORE_MEM;
02263
02264
02265 GetData( ID, OldData, DataLen, Array, BlockSize );
02266 OldData[DataLen] = '\0';
02267
02268 int i;
02269 adr = Index;
02270 for( i=0; i<DataLen; i+=2 )
02271 {
02272 cTmp[0] = Data[i];
02273 cTmp[1] = Data[i+1];
02274 cTmp[2] = '\0';
02275 sscanf( (const char*)cTmp, "%02x", &uiTmp );
02276 Array[adr] = (unsigned char)uiTmp;
02277 if( (MemID == FEDM_RFC_EEDATA_MEM ||
02278 MemID == FEDM_RFC_RAMDATA_MEM ||
02279 MemID == FEDM_ACC_EEDATA_MEM ||
02280 MemID == FEDM_ACC_RAMDATA_MEM ) &&
02281 (adr % BlockSize) == BlockSize-3 )
02282 adr += 2;
02283
02284 adr++;
02285 }
02286
02287 if( strcmp(OldData, Data) != 0 )
02288 {
02289 delete[] OldData;
02290 return FEDM_MODIFIED;
02291 }
02292
02293 delete[] OldData;
02294 return FEDM_OK;
02295 }
02296
02297
02298
02299
02300
02301
02302
02303
02304
02305
02306
02307
02308
02309
02310
02311
02312
02313
02314
02315
02316
02317
02318
02319
02320
02321 int FEDM_Base::GetData(int Adr, unsigned char* Data, FEDM_BYTE_ARRAY& Array)
02322 {
02323 FEDM_CHK3(Data);
02324 FEDM_CHK3(&Array);
02325
02326
02327 if( Adr<0 || Adr>(int)Array.capacity() )
02328 return FEDM_ERROR_ARRAY_BOUNDARY;
02329
02330 *Data = Array[Adr];
02331
02332 return FEDM_OK;
02333 }
02334
02335
02336
02337
02338
02339
02340
02341
02342
02343
02344
02345
02346
02347
02348
02349
02350
02351 int FEDM_Base::GetData(int Adr, unsigned char* Data, int Cnt, FEDM_BYTE_ARRAY& Array)
02352 {
02353 FEDM_CHK3(Data);
02354 FEDM_CHK3(&Array);
02355
02356 int i;
02357
02358
02359 if( Cnt <= 0 )
02360 return FEDM_ERROR_PARAMETER;
02361
02362
02363 if( Adr<0 || (Adr+Cnt)>(int)Array.capacity() )
02364 return FEDM_ERROR_ARRAY_BOUNDARY;
02365
02366 for( i=0; i<Cnt; i++)
02367 *(Data+i) = Array[Adr+i];
02368
02369
02370 return FEDM_OK;
02371 }
02372
02373
02374
02375
02376
02377
02378
02379
02380
02381
02382
02383
02384
02385
02386
02387
02388 int FEDM_Base::GetData(int Adr, unsigned int* Data, FEDM_BYTE_ARRAY& Array)
02389 {
02390 FEDM_CHK3(Data);
02391 FEDM_CHK3(&Array);
02392
02393 int i;
02394 *Data = 0;
02395
02396
02397 if( Adr<0 || (Adr+4)>(int)Array.capacity() )
02398 return FEDM_ERROR_ARRAY_BOUNDARY;
02399
02400 for( i=0; i<3; i++ )
02401
02402 *Data += ( Array[Adr+3-i] << (8*i) );
02403
02404 return FEDM_OK;
02405 }
02406
02407
02408
02409
02410
02411
02412
02413
02414
02415
02416
02417
02418
02419
02420
02421
02422 int FEDM_Base::GetData(int Adr, __int64* Data, FEDM_BYTE_ARRAY& Array)
02423 {
02424 FEDM_CHK3(Data);
02425 FEDM_CHK3(&Array);
02426
02427 int i;
02428 *Data = 0;
02429
02430
02431 if( Adr<0 || (Adr+8)>(int)Array.capacity() )
02432 return FEDM_ERROR_ARRAY_BOUNDARY;
02433
02434 for( i=0; i<8; i++ )
02435
02436 *Data += ( (__int64)Array[Adr+7-i] << (8*i) );
02437
02438 return FEDM_OK;
02439 }
02440
02441
02442
02443
02444
02445
02446
02447
02448
02449
02450
02451
02452
02453
02454
02455
02456
02457
02458
02459 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
02460 int FEDM_Base::GetData(int Adr, CString& Data, int Cnt, FEDM_BYTE_ARRAY& Array)
02461 {
02462 FEDM_CHK3(&Data);
02463 FEDM_CHK3(&Array);
02464
02465 int i;
02466 char buffer[5];
02467 unsigned char ucTmp;
02468
02469
02470 if( Cnt <= 0 )
02471 return FEDM_ERROR_PARAMETER;
02472
02473
02474 if( Adr<0 || (Adr+Cnt)>(int)Array.capacity() )
02475 return FEDM_ERROR_ARRAY_BOUNDARY;
02476
02477 unsigned char* ucData = new unsigned char[Cnt];
02478 memset( &ucData[0], '\0', Cnt);
02479 Data = "";
02480
02481 for(i=0; i<Cnt; i++)
02482 ucData[i] = Array[Adr+i];
02483
02484
02485 for(i=0; i<Cnt; i++)
02486 {
02487 ucTmp = ucData[i];
02488
02489 buffer[0] = '\0';
02490 sprintf( buffer, "%02X", ucTmp );
02491 Data += buffer;
02492 }
02493
02494 delete [] ucData;
02495
02496 return FEDM_OK;
02497 }
02498 #endif
02499
02500
02501
02502
02503
02504
02505
02506
02507
02508
02509
02510
02511
02512
02513
02514
02515 int FEDM_Base::SetData( int Adr, unsigned char Data, FEDM_BYTE_ARRAY& Array )
02516 {
02517 FEDM_CHK3(&Array);
02518
02519 unsigned char OldData = 0x00;
02520
02521
02522 if( Adr<0 || Adr>(int)Array.capacity() )
02523 return FEDM_ERROR_ARRAY_BOUNDARY;
02524
02525
02526 GetData( Adr, &OldData, Array );
02527
02528 Array[Adr] = Data;
02529
02530 if( OldData != Data )
02531 return FEDM_MODIFIED;
02532
02533 return FEDM_OK;
02534 }
02535
02536
02537
02538
02539
02540
02541
02542
02543
02544
02545
02546
02547
02548
02549
02550
02551
02552 int FEDM_Base::SetData( int Adr, unsigned char* Data, int Cnt, FEDM_BYTE_ARRAY& Array )
02553 {
02554 FEDM_CHK3(Data);
02555 FEDM_CHK3(&Array);
02556
02557 int i;
02558
02559
02560 if( Cnt <= 0 )
02561 return FEDM_ERROR_PARAMETER;
02562
02563
02564 if( Adr<0 || (Adr+Cnt)>(int)Array.capacity() )
02565 return FEDM_ERROR_ARRAY_BOUNDARY;
02566
02567 unsigned char* OldData;
02568
02569 OldData = new unsigned char[Cnt];
02570 if(OldData == NULL)
02571 return FEDM_ERROR_NO_MORE_MEM;
02572
02573
02574
02575 GetData( Adr, OldData, Cnt, Array );
02576
02577 for(i=0; i<Cnt; i++)
02578 Array[Adr+i] = *(Data+i);
02579
02580 if( *OldData != *Data )
02581 {
02582 delete[] OldData;
02583 return FEDM_MODIFIED;
02584 }
02585
02586 delete[] OldData;
02587 return FEDM_OK;
02588 }
02589
02590
02591
02592
02593
02594
02595
02596
02597
02598
02599
02600
02601
02602
02603
02604
02605
02606 int FEDM_Base::SetData( int Adr, unsigned int Data, FEDM_BYTE_ARRAY& Array )
02607 {
02608 FEDM_CHK3(&Array);
02609
02610 int i;
02611 unsigned int OldData = 0;
02612
02613
02614 if( Adr<0 || (Adr+4)>(int)Array.capacity() )
02615 return FEDM_ERROR_ARRAY_BOUNDARY;
02616
02617
02618 GetData( Adr, &OldData, Array );
02619
02620
02621 for( i=0; i<4; i++ )
02622 {
02623
02624 Array[Adr+3-i] = *( ((unsigned char*)&Data) + i );
02625 }
02626
02627 if( OldData != Data )
02628 return FEDM_MODIFIED;
02629
02630 return FEDM_OK;
02631 }
02632
02633
02634
02635
02636
02637
02638
02639
02640
02641
02642
02643
02644
02645
02646
02647
02648 int FEDM_Base::SetData( int Adr, __int64 Data, FEDM_BYTE_ARRAY& Array )
02649 {
02650 FEDM_CHK3(&Array);
02651
02652 int i;
02653 __int64 OldData = 0;
02654
02655
02656 if( Adr<0 || (Adr+8)>(int)Array.capacity() )
02657 return FEDM_ERROR_ARRAY_BOUNDARY;
02658
02659
02660 GetData( Adr, &OldData, Array );
02661
02662 for( i=0; i<8; i++ )
02663 {
02664
02665 Array[Adr+7-i] = *( ((unsigned char*)&Data) + i );
02666 }
02667
02668 if( OldData != Data )
02669 return FEDM_MODIFIED;
02670
02671 return FEDM_OK;
02672 }
02673
02674
02675
02676
02677
02678
02679
02680
02681
02682
02683
02684
02685
02686
02687
02688
02689
02690
02691 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
02692 int FEDM_Base::SetData( int Adr, CString Data, FEDM_BYTE_ARRAY& Array )
02693 {
02694 FEDM_CHK3(&Array);
02695
02696 int i;
02697 CString OldData = "";
02698 char cTmp[5];
02699 unsigned int uiTmp;
02700
02701 #ifdef _FEDM_MFC_SUPPORT // Microsoft Compiler
02702 int iLen = Data.GetLength();
02703 #endif
02704 #ifdef __BORLANDC__ // Borland C++ Builder
02705 int iLen = Data.Length();
02706 #endif
02707 #if (! (defined(_FEDM_MFC_SUPPORT) || defined(__BORLANDC__)) )
02708 int iLen = 0;
02709 #endif
02710
02711
02712 if( iLen%2 )
02713 return FEDM_ERROR_ODD_STRING_LENGTH;
02714
02715
02716 if( iLen == 0 )
02717 return FEDM_ERROR_STRING_LENGTH;
02718
02719
02720 if( Adr<0 || Adr+iLen>(int)Array.capacity() )
02721 return FEDM_ERROR_ARRAY_BOUNDARY;
02722
02723
02724 GetData( Adr, OldData, iLen/2, Array );
02725
02726 int j=0;
02727 #ifdef __BORLANDC__ // Borland C++ Builder: AnsiStrings index starts with 1
02728 for( i=1; i<(iLen+1); i+=2 )
02729 #else
02730 for( i=0; i<iLen; i+=2 )
02731 #endif
02732 {
02733 cTmp[0] = Data[i];
02734 cTmp[1] = Data[i+1];
02735 cTmp[2] = '\0';
02736 sscanf( (const char*)cTmp, "%02x", &uiTmp );
02737 Array[Adr + j++] = (unsigned char)uiTmp;
02738 }
02739
02740 if( OldData != Data)
02741 return FEDM_MODIFIED;
02742
02743 return FEDM_OK;
02744 }
02745 #endif
02746
02747
02748 #ifdef _FEDM_COM_SUPPORT
02749 void FEDM_Base::SetFecomLibName(char* pszLibName)
02750 {
02751 m_pFecomLibName = pszLibName;
02752 }
02753 #endif
02754
02755 #ifdef _FEDM_USB_SUPPORT
02756 void FEDM_Base::SetFeusbLibName(char* pszLibName)
02757 {
02758 m_pFeusbLibName = pszLibName;
02759 }
02760 #endif
02761
02762 #ifdef _FEDM_TCP_SUPPORT
02763 void FEDM_Base::SetFetcpLibName(char* pszLibName)
02764 {
02765 m_pFetcpLibName = pszLibName;
02766 }
02767 #endif
02768
02769
02770
02771
02772
02773
02774
02775
02776
02777
02778
02779
02780
02781
02782
02783
02784
02785
02786
02787
02788
02789
02790
02791
02792
02793
02794
02795
02796
02797
02798
02799
02800
02801
02802
02803
02804
02805
02806
02807
02808
02809
02810
02811 #ifdef _FEDM_COM_SUPPORT
02812 #if !defined(_FEDM_SUPPORT_SLINK)
02813 void* FEDM_Base::LoadFeCom()
02814 {
02815 if(m_pFeComLib != NULL)
02816 return m_pFeComLib;
02817
02818 void* pLib = NULL;
02819
02820 #ifdef _FEDM_WINDOWS
02821 GetOS();
02822
02823 if( m_pFecomLibName != NULL)
02824 {
02825 #ifdef _WIN32_WCE
02826 wchar_t wsName[256];
02827 swprintf(wsName, L"%S", m_pFecomLibName);
02828 pLib = (void*)LoadLibrary(wsName);
02829 #else
02830 pLib = (void*)LoadLibrary(m_pFecomLibName);
02831 #endif
02832 }
02833 else
02834 {
02835 if(m_iWinVer == FEDM_OS_WCE)
02836 pLib = (void*)LoadLibrary(_T("fecomce.dll"));
02837 else
02838 pLib = (void*)LoadLibrary(_T("fecom.dll"));
02839 }
02840 #endif
02841 #ifdef _FEDM_LINUX
02842 #if defined(__APPLE__)
02843 pLib = dlopen("libfecom.dylib", RTLD_NOW | RTLD_GLOBAL);
02844 #else
02845 pLib = dlopen("libfecom.so", RTLD_NOW | RTLD_GLOBAL);
02846 #endif
02847 #endif
02848
02849 if(pLib != NULL)
02850 m_pFeComLib = pLib;
02851
02852 return pLib;
02853 }
02854 #endif // #if !defined(_FEDM_SUPPORT_SLINK)
02855 #endif
02856
02857
02858
02859
02860
02861
02862
02863
02864
02865
02866
02867
02868
02869
02870
02871 #ifdef _FEDM_USB_SUPPORT
02872 #if !defined(_FEDM_SUPPORT_SLINK)
02873 void* FEDM_Base::LoadFeUsb()
02874 {
02875 if(m_pFeUsbLib != NULL)
02876 return m_pFeUsbLib;
02877
02878 void* pLib = NULL;
02879
02880 #ifdef _FEDM_WINDOWS
02881 GetOS();
02882
02883 if( m_pFeusbLibName != NULL)
02884 {
02885 #ifdef _WIN32_WCE
02886 wchar_t wsName[256];
02887 swprintf(wsName, L"%s", m_pFeusbLibName);
02888 pLib = (void*)LoadLibrary(wsName);
02889 #else
02890 pLib = (void*)LoadLibrary(m_pFeusbLibName);
02891 #endif
02892 }
02893 else
02894 {
02895 if(m_iWinVer == FEDM_OS_WCE)
02896 pLib = (void*)LoadLibrary(_T("feusbce.dll"));
02897 else
02898 pLib = (void*)LoadLibrary(_T("feusb.dll"));
02899 }
02900 #endif
02901 #ifdef _FEDM_LINUX
02902 #if defined(__APPLE__)
02903 pLib = dlopen("libfeusb.dylib", RTLD_NOW | RTLD_GLOBAL);
02904 #else
02905 pLib = dlopen("libfeusb.so", RTLD_NOW | RTLD_GLOBAL);
02906 #endif
02907 #endif
02908
02909 if(pLib != NULL)
02910 m_pFeUsbLib = pLib;
02911
02912 return pLib;
02913 }
02914 #endif // #if !defined(_FEDM_SUPPORT_SLINK)
02915 #endif
02916
02917
02918
02919
02920
02921
02922
02923
02924
02925
02926
02927
02928
02929 #ifdef _FEDM_TCP_SUPPORT
02930 #if !defined(_FEDM_SUPPORT_SLINK)
02931 void* FEDM_Base::LoadFeTcp()
02932 {
02933 if(m_pFeTcpLib != NULL)
02934 return m_pFeTcpLib;
02935
02936 void* pLib = NULL;
02937
02938 #ifdef _FEDM_WINDOWS
02939 GetOS();
02940
02941 if( m_pFetcpLibName != NULL)
02942 {
02943 #ifdef _WIN32_WCE
02944 wchar_t wsName[256];
02945 swprintf(wsName, L"%s", m_pFetcpLibName);
02946 pLib = (void*)LoadLibrary(wsName);
02947 #else
02948 pLib = (void*)LoadLibrary(m_pFetcpLibName);
02949 #endif
02950 }
02951 else
02952 {
02953 if(m_iWinVer == FEDM_OS_WCE)
02954 {
02955 pLib = (void*)LoadLibrary(_T("fetcpce.dll"));
02956 }
02957 else
02958 {
02959 pLib = (void*)LoadLibrary(_T("fetcp.dll"));
02960 }
02961 }
02962 #endif
02963 #ifdef _FEDM_LINUX
02964 #if defined(__APPLE__)
02965 pLib = dlopen("libfetcp.dylib", RTLD_NOW | RTLD_GLOBAL);
02966 #else
02967 pLib = dlopen("libfetcp.so", RTLD_NOW | RTLD_GLOBAL);
02968 #endif
02969 #endif
02970
02971 if(pLib != NULL)
02972 m_pFeTcpLib = pLib;
02973
02974 return pLib;
02975 }
02976 #endif // #if !defined(_FEDM_SUPPORT_SLINK)
02977 #endif
02978
02979
02980
02981
02982
02983
02984
02985
02986
02987
02988
02989
02990
02991 #if !defined(_FEDM_SUPPORT_SLINK)
02992 void* FEDM_Base::GetFunctionPtr(void* pLib, const char* szFctName)
02993 {
02994 #ifdef _FEDM_WINDOWS
02995 #ifdef _WIN32_WCE
02996 #ifdef _FEDM_EVC4
02997 FARPROC pAdr = NULL;
02998 wchar_t* pwc = (wchar_t *)malloc( sizeof( wchar_t )*sizeof(szFctName));
02999 mbstowcs( pwc, szFctName, sizeof(szFctName) );
03000 pAdr = GetProcAddress((HINSTANCE)pLib, pwc);
03001 free(pwc);
03002 return pAdr;
03003 #else
03004 return GetProcAddress((HINSTANCE)pLib, CA2W(szFctName));
03005 #endif
03006 #else
03007 return GetProcAddress((HINSTANCE)pLib, szFctName);
03008 #endif
03009 #endif
03010 #ifdef _FEDM_LINUX
03011 return dlsym(pLib, szFctName);
03012 #endif
03013 }
03014 #endif
03015
03016
03017
03018
03019
03020
03021
03022
03023
03024
03025
03026
03027 #ifdef _FEDM_COM_SUPPORT
03028 #if !defined(_FEDM_SUPPORT_SLINK)
03029 void* FEDM_Base::GetFeComFunction(unsigned int uiFct)
03030 {
03031 void* pLib = NULL;
03032
03033 if(uiFct >= 1000 && uiFct < 1100)
03034 {
03035 pLib = LoadFeCom();
03036 if(pLib == NULL)
03037 return NULL;
03038 }
03039 else
03040 {
03041 return NULL;
03042 }
03043
03044 if(m_pFeComPtrList == NULL)
03045 {
03046 m_pFeComPtrList = (void*)new _FEDM_FECOM_PTR;
03047 if(m_pFeComPtrList == NULL)
03048 return NULL;
03049 }
03050
03051
03052 switch(uiFct)
03053 {
03054
03055 case FECOM_GET_DLL_VERSION:
03056 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetDLLVersion != NULL)
03057 {
03058 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetDLLVersion;
03059 }
03060 else
03061 {
03062 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetDLLVersion = (LPFN_FECOM_GET_DLL_VERSION)GetFunctionPtr(pLib, "FECOM_GetDLLVersion");
03063 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetDLLVersion != NULL)
03064 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetDLLVersion;
03065 }
03066 return NULL;
03067
03068 case FECOM_GET_ERROR_TEXT:
03069 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetErrorText != NULL)
03070 {
03071 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetErrorText;
03072 }
03073 else
03074 {
03075 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetErrorText = (LPFN_FECOM_GET_ERROR_TEXT)GetFunctionPtr(pLib, "FECOM_GetErrorText");
03076 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetErrorText != NULL)
03077 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetErrorText;
03078 }
03079 return NULL;
03080
03081 case FECOM_GET_LAST_ERROR:
03082 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetLastError != NULL)
03083 {
03084 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetLastError;
03085 }
03086 else
03087 {
03088 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetLastError = (LPFN_FECOM_GET_LAST_ERROR)GetFunctionPtr(pLib, "FECOM_GetLastError");
03089 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetLastError != NULL)
03090 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetLastError;
03091 }
03092 return NULL;
03093
03094 case FECOM_DETECT_PORT:
03095 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnDetectPort != NULL)
03096 {
03097 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnDetectPort;
03098 }
03099 else
03100 {
03101 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnDetectPort = (LPFN_FECOM_DETECT_PORT)GetFunctionPtr(pLib, "FECOM_DetectPort");
03102 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnDetectPort != NULL)
03103 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnDetectPort;
03104 }
03105 return NULL;
03106
03107 case FECOM_ADD_EVENT_HANDLER:
03108 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnAddEventHandler != NULL)
03109 {
03110 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnAddEventHandler;
03111 }
03112 else
03113 {
03114 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnAddEventHandler = (LPFN_FECOM_ADD_EVENT_HANDLER)GetFunctionPtr(pLib, "FECOM_AddEventHandler");
03115 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnAddEventHandler != NULL)
03116 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnAddEventHandler;
03117 }
03118 return NULL;
03119
03120 case FECOM_DEL_EVENT_HANDLER:
03121 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnDelEventHandler != NULL)
03122 {
03123 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnDelEventHandler;
03124 }
03125 else
03126 {
03127 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnDelEventHandler = (LPFN_FECOM_DEL_EVENT_HANDLER)GetFunctionPtr(pLib, "FECOM_DelEventHandler");
03128 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnDelEventHandler != NULL)
03129 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnDelEventHandler;
03130 }
03131 return NULL;
03132
03133 case FECOM_OPEN_PORT:
03134 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnOpenPort != NULL)
03135 {
03136 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnOpenPort;
03137 }
03138 else
03139 {
03140 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnOpenPort = (LPFN_FECOM_OPEN_PORT)GetFunctionPtr(pLib, "FECOM_OpenPort");
03141 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnOpenPort != NULL)
03142 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnOpenPort;
03143 }
03144 return NULL;
03145
03146 case FECOM_CLOSE_PORT:
03147 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnClosePort != NULL)
03148 {
03149 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnClosePort;
03150 }
03151 else
03152 {
03153 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnClosePort = (LPFN_FECOM_CLOSE_PORT)GetFunctionPtr(pLib, "FECOM_ClosePort");
03154 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnClosePort != NULL)
03155 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnClosePort;
03156 }
03157 return NULL;
03158
03159 case FECOM_GET_PORT_LIST:
03160 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetPortList != NULL)
03161 {
03162 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetPortList;
03163 }
03164 else
03165 {
03166 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetPortList = (LPFN_FECOM_GET_PORT_LIST)GetFunctionPtr(pLib, "FECOM_GetPortList");
03167 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetPortList != NULL)
03168 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetPortList;
03169 }
03170 return NULL;
03171
03172 case FECOM_GET_PORT_PARA:
03173 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetPortPara != NULL)
03174 {
03175 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetPortPara;
03176 }
03177 else
03178 {
03179 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetPortPara = (LPFN_FECOM_GET_PORT_PARA)GetFunctionPtr(pLib, "FECOM_GetPortPara");
03180 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetPortPara != NULL)
03181 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetPortPara;
03182 }
03183 return NULL;
03184
03185 case FECOM_SET_PORT_PARA:
03186 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnSetPortPara != NULL)
03187 {
03188 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnSetPortPara;
03189 }
03190 else
03191 {
03192 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnSetPortPara = (LPFN_FECOM_SET_PORT_PARA)GetFunctionPtr(pLib, "FECOM_SetPortPara");
03193 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnSetPortPara != NULL)
03194 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnSetPortPara;
03195 }
03196 return NULL;
03197
03198 case FECOM_DO_PORT_CMD:
03199 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnDoPortCmd != NULL)
03200 {
03201 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnDoPortCmd;
03202 }
03203 else
03204 {
03205 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnDoPortCmd = (LPFN_FECOM_DO_PORT_CMD)GetFunctionPtr(pLib, "FECOM_DoPortCmd");
03206 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnDoPortCmd != NULL)
03207 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnDoPortCmd;
03208 }
03209 return NULL;
03210
03211 case FECOM_GET_PORT_HND:
03212 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetPortHnd != NULL)
03213 {
03214 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetPortHnd;
03215 }
03216 else
03217 {
03218 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetPortHnd = (LPFN_FECOM_GET_PORT_HND)GetFunctionPtr(pLib, "FECOM_GetPortHnd");
03219 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetPortHnd != NULL)
03220 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnGetPortHnd;
03221 }
03222 return NULL;
03223
03224 case FECOM_TRANSCEIVE:
03225 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnTransceive != NULL)
03226 {
03227 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnTransceive;
03228 }
03229 else
03230 {
03231 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnTransceive = (LPFN_FECOM_TRANSCEIVE)GetFunctionPtr(pLib, "FECOM_Transceive");
03232 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnTransceive != NULL)
03233 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnTransceive;
03234 }
03235 return NULL;
03236
03237 case FECOM_TRANSMIT:
03238 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnTransmit != NULL)
03239 {
03240 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnTransmit;
03241 }
03242 else
03243 {
03244 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnTransmit = (LPFN_FECOM_TRANSMIT)GetFunctionPtr(pLib, "FECOM_Transmit");
03245 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnTransmit != NULL)
03246 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnTransmit;
03247 }
03248 return NULL;
03249
03250 case FECOM_RECEIVE:
03251 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnReceive != NULL)
03252 {
03253 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnReceive;
03254 }
03255 else
03256 {
03257 ((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnReceive = (LPFN_FECOM_RECEIVE)GetFunctionPtr(pLib, "FECOM_Receive");
03258 if(((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnReceive != NULL)
03259 return (void*)((_FEDM_FECOM_PTR*)m_pFeComPtrList)->lpfnReceive;
03260 }
03261 return NULL;
03262 }
03263
03264 return NULL;
03265 }
03266 #endif // #if !defined(_FEDM_SUPPORT_SLINK)
03267 #endif // #ifdef _FEDM_COM_SUPPORT
03268
03269
03270
03271
03272
03273
03274
03275
03276
03277
03278
03279
03280
03281 #ifdef _FEDM_USB_SUPPORT
03282 #if !defined(_FEDM_SUPPORT_SLINK)
03283 void* FEDM_Base::GetFeUsbFunction(unsigned int uiFct)
03284 {
03285 void* pLib = NULL;
03286
03287 if(uiFct >= 1100 && uiFct < 1200)
03288 {
03289 pLib = LoadFeUsb();
03290 if(pLib == NULL)
03291 return NULL;
03292 }
03293 else
03294 {
03295 return NULL;
03296 }
03297
03298 if(m_pFeUsbPtrList == NULL)
03299 {
03300 m_pFeUsbPtrList = (void*)new _FEDM_FEUSB_PTR;
03301 if(m_pFeUsbPtrList == NULL)
03302 return NULL;
03303 }
03304
03305
03306 switch(uiFct)
03307 {
03308
03309 case FEUSB_GET_DLL_VERSION:
03310 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDLLVersion != NULL)
03311 {
03312 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDLLVersion;
03313 }
03314 else
03315 {
03316 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDLLVersion = (LPFN_FEUSB_GET_DLL_VERSION)GetFunctionPtr(pLib, "FEUSB_GetDLLVersion");
03317 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDLLVersion != NULL)
03318 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDLLVersion;
03319 }
03320 return NULL;
03321
03322 case FEUSB_GET_DRV_VERSION:
03323 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDrvVersion != NULL)
03324 {
03325 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDrvVersion;
03326 }
03327 else
03328 {
03329 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDrvVersion = (LPFN_FEUSB_GET_DRV_VERSION)GetFunctionPtr(pLib, "FEUSB_GetDrvVersion");
03330 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDrvVersion != NULL)
03331 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDrvVersion;
03332 }
03333 return NULL;
03334
03335 case FEUSB_GET_ERROR_TEXT:
03336 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetErrorText != NULL)
03337 {
03338 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetErrorText;
03339 }
03340 else
03341 {
03342 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetErrorText = (LPFN_FEUSB_GET_ERROR_TEXT)GetFunctionPtr(pLib, "FEUSB_GetErrorText");
03343 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetErrorText != NULL)
03344 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetErrorText;
03345 }
03346 return NULL;
03347
03348 case FEUSB_GET_LAST_ERROR:
03349 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetLastError != NULL)
03350 {
03351 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetLastError;
03352 }
03353 else
03354 {
03355 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetLastError = (LPFN_FEUSB_GET_LAST_ERROR)GetFunctionPtr(pLib, "FEUSB_GetLastError");
03356 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetLastError != NULL)
03357 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetLastError;
03358 }
03359 return NULL;
03360
03361 case FEUSB_SCAN:
03362 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnScan != NULL)
03363 {
03364 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnScan;
03365 }
03366 else
03367 {
03368 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnScan = (LPFN_FEUSB_SCAN)GetFunctionPtr(pLib, "FEUSB_Scan");
03369 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnScan != NULL)
03370 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnScan;
03371 }
03372 return NULL;
03373
03374 case FEUSB_SCAN_AND_OPEN:
03375 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnScanAndOpen != NULL)
03376 {
03377 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnScanAndOpen;
03378 }
03379 else
03380 {
03381 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnScanAndOpen = (LPFN_FEUSB_SCAN_AND_OPEN)GetFunctionPtr(pLib, "FEUSB_ScanAndOpen");
03382 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnScanAndOpen != NULL)
03383 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnScanAndOpen;
03384 }
03385 return NULL;
03386
03387 case FEUSB_GET_SCAN_LIST_PARA:
03388 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetScanListPara != NULL)
03389 {
03390 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetScanListPara;
03391 }
03392 else
03393 {
03394 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetScanListPara = (LPFN_FEUSB_GET_SCAN_LIST_PARA)GetFunctionPtr(pLib, "FEUSB_GetScanListPara");
03395 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetScanListPara != NULL)
03396 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetScanListPara;
03397 }
03398 return NULL;
03399
03400 case FEUSB_GET_SCAN_LIST_SIZE:
03401 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetScanListSize != NULL)
03402 {
03403 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetScanListSize;
03404 }
03405 else
03406 {
03407 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetScanListSize = (LPFN_FEUSB_GET_SCAN_LIST_SIZE)GetFunctionPtr(pLib, "FEUSB_GetScanListSize");
03408 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetScanListSize != NULL)
03409 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetScanListSize;
03410 }
03411 return NULL;
03412
03413 case FEUSB_CLEAR_SCAN_LIST:
03414 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnClearScanList != NULL)
03415 {
03416 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnClearScanList;
03417 }
03418 else
03419 {
03420 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnClearScanList = (LPFN_FEUSB_CLEAR_SCAN_LIST)GetFunctionPtr(pLib, "FEUSB_ClearScanList");
03421 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnClearScanList != NULL)
03422 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnClearScanList;
03423 }
03424 return NULL;
03425
03426 case FEUSB_ADD_EVENT_HANDLER:
03427 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnAddEventHandler != NULL)
03428 {
03429 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnAddEventHandler;
03430 }
03431 else
03432 {
03433 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnAddEventHandler = (LPFN_FEUSB_ADD_EVENT_HANDLER)GetFunctionPtr(pLib, "FEUSB_AddEventHandler");
03434 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnAddEventHandler != NULL)
03435 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnAddEventHandler;
03436 }
03437 return NULL;
03438
03439 case FEUSB_DEL_EVENT_HANDLER:
03440 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnDelEventHandler != NULL)
03441 {
03442 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnDelEventHandler;
03443 }
03444 else
03445 {
03446 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnDelEventHandler = (LPFN_FEUSB_DEL_EVENT_HANDLER)GetFunctionPtr(pLib, "FEUSB_DelEventHandler");
03447 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnDelEventHandler != NULL)
03448 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnDelEventHandler;
03449 }
03450 return NULL;
03451
03452 case FEUSB_OPEN_DEVICE:
03453 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnOpenDevice != NULL)
03454 {
03455 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnOpenDevice;
03456 }
03457 else
03458 {
03459 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnOpenDevice = (LPFN_FEUSB_OPEN_DEVICE)GetFunctionPtr(pLib, "FEUSB_OpenDevice");
03460 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnOpenDevice != NULL)
03461 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnOpenDevice;
03462 }
03463 return NULL;
03464
03465 case FEUSB_CLOSE_DEVICE:
03466 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnCloseDevice != NULL)
03467 {
03468 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnCloseDevice;
03469 }
03470 else
03471 {
03472 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnCloseDevice = (LPFN_FEUSB_CLOSE_DEVICE)GetFunctionPtr(pLib, "FEUSB_CloseDevice");
03473 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnCloseDevice != NULL)
03474 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnCloseDevice;
03475 }
03476 return NULL;
03477
03478 case FEUSB_IS_DEVICE_PRESENT:
03479 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnIsDevicePresent != NULL)
03480 {
03481 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnIsDevicePresent;
03482 }
03483 else
03484 {
03485 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnIsDevicePresent = (LPFN_FEUSB_IS_DEVICE_PRESENT)GetFunctionPtr(pLib, "FEUSB_IsDevicePresent");
03486 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnIsDevicePresent != NULL)
03487 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnIsDevicePresent;
03488 }
03489 return NULL;
03490
03491 case FEUSB_GET_DEVICE_LIST:
03492 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDeviceList != NULL)
03493 {
03494 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDeviceList;
03495 }
03496 else
03497 {
03498 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDeviceList = (LPFN_FEUSB_GET_DEVICE_LIST)GetFunctionPtr(pLib, "FEUSB_GetDeviceList");
03499 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDeviceList != NULL)
03500 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDeviceList;
03501 }
03502 return NULL;
03503
03504 case FEUSB_GET_DEVICE_PARA:
03505 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDevicePara != NULL)
03506 {
03507 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDevicePara;
03508 }
03509 else
03510 {
03511 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDevicePara = (LPFN_FEUSB_GET_DEVICE_PARA)GetFunctionPtr(pLib, "FEUSB_GetDevicePara");
03512 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDevicePara != NULL)
03513 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDevicePara;
03514 }
03515 return NULL;
03516
03517 case FEUSB_SET_DEVICE_PARA:
03518 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnSetDevicePara != NULL)
03519 {
03520 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnSetDevicePara;
03521 }
03522 else
03523 {
03524 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnSetDevicePara = (LPFN_FEUSB_SET_DEVICE_PARA)GetFunctionPtr(pLib, "FEUSB_SetDevicePara");
03525 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnSetDevicePara != NULL)
03526 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnSetDevicePara;
03527 }
03528 return NULL;
03529
03530 case FEUSB_GET_DEVICE_HND:
03531 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDeviceHnd != NULL)
03532 {
03533 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDeviceHnd;
03534 }
03535 else
03536 {
03537 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDeviceHnd = (LPFN_FEUSB_GET_DEVICE_HND)GetFunctionPtr(pLib, "FEUSB_GetDeviceHnd");
03538 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDeviceHnd != NULL)
03539 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnGetDeviceHnd;
03540 }
03541 return NULL;
03542
03543 case FEUSB_TRANSCEIVE:
03544 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnTransceive != NULL)
03545 {
03546 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnTransceive;
03547 }
03548 else
03549 {
03550 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnTransceive = (LPFN_FEUSB_TRANSCEIVE)GetFunctionPtr(pLib, "FEUSB_Transceive");
03551 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnTransceive != NULL)
03552 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnTransceive;
03553 }
03554 return NULL;
03555
03556 case FEUSB_TRANSMIT:
03557 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnTransmit != NULL)
03558 {
03559 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnTransmit;
03560 }
03561 else
03562 {
03563 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnTransmit = (LPFN_FEUSB_TRANSMIT)GetFunctionPtr(pLib, "FEUSB_Transmit");
03564 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnTransmit != NULL)
03565 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnTransmit;
03566 }
03567 return NULL;
03568
03569 case FEUSB_RECEIVE:
03570 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnReceive != NULL)
03571 {
03572 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnReceive;
03573 }
03574 else
03575 {
03576 ((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnReceive = (LPFN_FEUSB_RECEIVE)GetFunctionPtr(pLib, "FEUSB_Receive");
03577 if(((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnReceive != NULL)
03578 return (void*)((_FEDM_FEUSB_PTR*)m_pFeUsbPtrList)->lpfnReceive;
03579 }
03580 return NULL;
03581 }
03582
03583 return NULL;
03584 }
03585 #endif // #if !defined(_FEDM_SUPPORT_SLINK)
03586 #endif // #ifdef _FEDM_USB_SUPPORT
03587
03588
03589
03590
03591
03592
03593
03594
03595
03596
03597
03598
03599
03600
03601
03602 #ifdef _FEDM_TCP_SUPPORT
03603 #if !defined(_FEDM_SUPPORT_SLINK)
03604 void* FEDM_Base::GetFeTcpFunction(unsigned int uiFct)
03605 {
03606 void* pLib = NULL;
03607
03608 if(uiFct >= 1200 && uiFct < 1300)
03609 {
03610 pLib = LoadFeTcp();
03611 if(pLib == NULL)
03612 return NULL;
03613 }
03614 else
03615 {
03616 return NULL;
03617 }
03618
03619 if(m_pFeTcpPtrList == NULL)
03620 {
03621 m_pFeTcpPtrList = (void*)new _FEDM_FETCP_PTR;
03622 }
03623
03624
03625 switch(uiFct)
03626 {
03627
03628 case FETCP_GET_DLL_VERSION:
03629 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetDLLVersion != NULL)
03630 {
03631 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetDLLVersion;
03632 }
03633 else
03634 {
03635 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetDLLVersion = (LPFN_FETCP_GET_DLL_VERSION)GetFunctionPtr(pLib, "FETCP_GetDLLVersion");
03636 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetDLLVersion != NULL)
03637 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetDLLVersion;
03638 }
03639 return NULL;
03640
03641 case FETCP_GET_ERROR_TEXT:
03642 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetErrorText != NULL)
03643 {
03644 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetErrorText;
03645 }
03646 else
03647 {
03648 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetErrorText = (LPFN_FETCP_GET_ERROR_TEXT)GetFunctionPtr(pLib, "FETCP_GetErrorText");
03649 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetErrorText != NULL)
03650 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetErrorText;
03651 }
03652 return NULL;
03653
03654 case FETCP_GET_LAST_ERROR:
03655 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetLastError != NULL)
03656 {
03657 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetLastError;
03658 }
03659 else
03660 {
03661 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetLastError = (LPFN_FETCP_GET_LAST_ERROR)GetFunctionPtr(pLib, "FETCP_GetLastError");
03662 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetLastError != NULL)
03663 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetLastError;
03664 }
03665 return NULL;
03666
03667 case FETCP_ADD_EVENT_HANDLER:
03668 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnAddEventHandler != NULL)
03669 {
03670 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnAddEventHandler;
03671 }
03672 else
03673 {
03674 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnAddEventHandler = (LPFN_FETCP_ADD_EVENT_HANDLER)GetFunctionPtr(pLib, "FETCP_AddEventHandler");
03675 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnAddEventHandler != NULL)
03676 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnAddEventHandler;
03677 }
03678 return NULL;
03679
03680 case FETCP_DEL_EVENT_HANDLER:
03681 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnDelEventHandler != NULL)
03682 {
03683 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnDelEventHandler;
03684 }
03685 else
03686 {
03687 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnDelEventHandler = (LPFN_FETCP_DEL_EVENT_HANDLER)GetFunctionPtr(pLib, "FETCP_DelEventHandler");
03688 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnDelEventHandler != NULL)
03689 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnDelEventHandler;
03690 }
03691 return NULL;
03692
03693 case FETCP_DETECT:
03694 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnDetect != NULL)
03695 {
03696 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnDetect;
03697 }
03698 else
03699 {
03700 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnDetect = (LPFN_FETCP_CONNECT)GetFunctionPtr(pLib, "FETCP_Detect");
03701 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnDetect != NULL)
03702 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnDetect;
03703 }
03704 return NULL;
03705
03706 case FETCP_CONNECT:
03707 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnConnect != NULL)
03708 {
03709 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnConnect;
03710 }
03711 else
03712 {
03713 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnConnect = (LPFN_FETCP_CONNECT)GetFunctionPtr(pLib, "FETCP_Connect");
03714 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnConnect != NULL)
03715 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnConnect;
03716 }
03717 return NULL;
03718
03719 case FETCP_DISCONNECT:
03720 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnDisConnect != NULL)
03721 {
03722 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnDisConnect;
03723 }
03724 else
03725 {
03726 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnDisConnect = (LPFN_FETCP_DISCONNECT)GetFunctionPtr(pLib, "FETCP_DisConnect");
03727 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnDisConnect != NULL)
03728 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnDisConnect;
03729 }
03730 return NULL;
03731
03732 case FETCP_GET_SOCKET_LIST:
03733 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketList != NULL)
03734 {
03735 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketList;
03736 }
03737 else
03738 {
03739 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketList = (LPFN_FETCP_GET_SOCKET_LIST)GetFunctionPtr(pLib, "FETCP_GetSocketList");
03740 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketList != NULL)
03741 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketList;
03742 }
03743 return NULL;
03744
03745 case FETCP_GET_SOCKET_PARA:
03746 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketPara != NULL)
03747 {
03748 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketPara;
03749 }
03750 else
03751 {
03752 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketPara = (LPFN_FETCP_GET_SOCKET_PARA)GetFunctionPtr(pLib, "FETCP_GetSocketPara");
03753 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketPara != NULL)
03754 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketPara;
03755 }
03756 return NULL;
03757
03758 case FETCP_SET_SOCKET_PARA:
03759 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnSetSocketPara != NULL)
03760 {
03761 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnSetSocketPara;
03762 }
03763 else
03764 {
03765 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnSetSocketPara = (LPFN_FETCP_SET_SOCKET_PARA)GetFunctionPtr(pLib, "FETCP_SetSocketPara");
03766 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnSetSocketPara != NULL)
03767 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnSetSocketPara;
03768 }
03769 return NULL;
03770
03771 case FETCP_GET_SOCKET_HND:
03772 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketHnd != NULL)
03773 {
03774 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketHnd;
03775 }
03776 else
03777 {
03778 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketHnd = (LPFN_FETCP_GET_SOCKET_HND)GetFunctionPtr(pLib, "FETCP_GetSocketHnd");
03779 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketHnd != NULL)
03780 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketHnd;
03781 }
03782 return NULL;
03783
03784 case FETCP_GET_SOCKET_STATE:
03785 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketState != NULL)
03786 {
03787 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketState;
03788 }
03789 else
03790 {
03791 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketState = (LPFN_FETCP_GET_SOCKET_STATE)GetFunctionPtr(pLib, "FETCP_GetSocketState");
03792 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketState != NULL)
03793 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnGetSocketState;
03794 }
03795 return NULL;
03796
03797 case FETCP_TRANSCEIVE:
03798 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnTransceive != NULL)
03799 {
03800 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnTransceive;
03801 }
03802 else
03803 {
03804 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnTransceive = (LPFN_FETCP_TRANSCEIVE)GetFunctionPtr(pLib, "FETCP_Transceive");
03805 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnTransceive != NULL)
03806 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnTransceive;
03807 }
03808 return NULL;
03809
03810 case FETCP_TRANSMIT:
03811 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnTransmit != NULL)
03812 {
03813 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnTransmit;
03814 }
03815 else
03816 {
03817 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnTransmit = (LPFN_FETCP_TRANSMIT)GetFunctionPtr(pLib, "FETCP_Transmit");
03818 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnTransmit != NULL)
03819 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnTransmit;
03820 }
03821 return NULL;
03822
03823 case FETCP_RECEIVE:
03824 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnReceive != NULL)
03825 {
03826 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnReceive;
03827 }
03828 else
03829 {
03830 ((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnReceive = (LPFN_FETCP_RECEIVE)GetFunctionPtr(pLib, "FETCP_Receive");
03831 if(((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnReceive != NULL)
03832 return (void*)((_FEDM_FETCP_PTR*)m_pFeTcpPtrList)->lpfnReceive;
03833 }
03834 return NULL;
03835 }
03836
03837 return NULL;
03838 }
03839 #endif // #if !defined(_FEDM_SUPPORT_SLINK)
03840 #endif // #ifdef _FEDM_TCP_SUPPORT
03841
03842
03843
03844
03845
03846
03847
03848
03849
03850
03851
03852
03853 #ifdef _FEDM_WINDOWS
03854 void FEDM_Base::GetOS()
03855 {
03856 OSVERSIONINFO osInfo;
03857
03858 m_iWinVer = 0;
03859
03860 osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
03861 ::GetVersionEx(&osInfo);
03862
03863 if(osInfo.dwPlatformId == 1)
03864 {
03865 if(osInfo.dwMinorVersion < 10)
03866 m_iWinVer = FEDM_OS_W95;
03867 else
03868 {
03869 if(osInfo.dwMinorVersion < 90)
03870 m_iWinVer = FEDM_OS_W98;
03871 else
03872 m_iWinVer = FEDM_OS_WME;
03873 }
03874 }
03875 else if(osInfo.dwPlatformId == 2)
03876 {
03877 if(osInfo.dwMajorVersion >= 5)
03878 m_iWinVer = FEDM_OS_W2K;
03879 else
03880 m_iWinVer = FEDM_OS_WNT4;
03881 }
03882 else if(osInfo.dwPlatformId == 3)
03883 {
03884 m_iWinVer = FEDM_OS_WCE;
03885 }
03886 }
03887 #endif