FEDM.h
Go to the documentation of this file.
00001 /*-------------------------------------------------------
00002 |                                                       |
00003 |                       FEDM.h                          |
00004 |                                                       |
00005 ---------------------------------------------------------
00006 
00007 Copyright  2000-2014    FEIG ELECTRONIC GmbH, All Rights Reserved.
00008                                                 Lange Strasse 4
00009                                                 D-35781 Weilburg
00010                                                 Federal Republic of Germany
00011                                                 phone    : +49 6471 31090
00012                                                 fax      : +49 6471 310999
00013                                                 e-mail   : obid-support@feig.de
00014                                                 Internet : http://www.feig.de
00015                                         
00016 Author                  :       Markus Hultsch
00017 Begin                   :       16.05.2000
00018 Version                 :       04.06.10 / 09.12.2014 / M. Hultsch
00019 
00020 Operation Systems       :       independent
00021 
00022 
00023 This file contains the defines for the component FEDM
00024 
00025 
00026 Trademarks:
00027 -----------
00028 OBID®, OBID i-scan® and OBID myAXXESS® are registered Trademarks of FEIG ELECTRONIC GmbH
00029 
00030 Linux® is a registered trademark of Linus Torvalds.
00031 Windows is a registered trademark of Microsoft Corporation in the United States and other countries.
00032 Apple, Mac, Mac OS, OS X, Cocoa and Xcode are trademarks of Apple Inc., registered in the U.S. and other countries.
00033 Android is a trademark of Google Inc.
00034 
00035 Electronic Product Code (TM) is a Trademark of EPCglobal Inc.
00036 I-CODE® and Mifare® are registered Trademarks of Philips Electronics N.V.
00037 Tag-it (TM) is a registered Trademark of Texas Instruments Inc.
00038 my-d® is a registered trademark of Infineon Technologies AG
00039 Jewel (TM) is a trademark of Innovision Research & Technology plc.
00040 */
00041 
00042 
00043 #if !defined(_FEDM_H_INCLUDED_)
00044 #define _FEDM_H_INCLUDED_
00045 
00046 
00047 #if defined(_MSC_VER) || defined(__BORLANDC__)
00048 
00049                 #if defined(__BORLANDC__)
00050                                 #define _FEDM_ISC_CORE_CALL_CONV __stdcall
00051                 #else
00052                                 #define _FEDM_ISC_CORE_CALL_CONV
00053                 #endif
00054 
00055                 #define FEDM_CALL __cdecl
00056 
00057         #ifdef _FEDM_ISC_CORE_DLL
00058                 #define _FEDM_ISC_CORE_EXT_CLASS __declspec(dllexport) _FEDM_ISC_CORE_CALL_CONV
00059                 #define _FEDM_ISC_CORE_EXT_FUNCT __declspec(dllexport)
00060         #else
00061                 #if !defined(_FEDM_DLL)
00062                         #define _FEDM_ISC_CORE_EXT_CLASS
00063                         #define _FEDM_ISC_CORE_EXT_FUNCT
00064                 #else
00065                         #define _FEDM_ISC_CORE_EXT_CLASS __declspec(dllimport) _FEDM_ISC_CORE_CALL_CONV
00066                         #define _FEDM_ISC_CORE_EXT_FUNCT
00067                 #endif
00068         #endif
00069 
00070         #ifdef _FEDM_SERVICE_DLL
00071                 #define _FEDM_SERVICE_EXT_CLASS __declspec(dllexport)
00072         #else
00073                 #if !defined(_FEDM_DLL)
00074                         #define _FEDM_SERVICE_EXT_CLASS
00075                 #else
00076                         #define _FEDM_SERVICE_EXT_CLASS __declspec(dllimport)
00077                 #endif
00078         #endif
00079 
00080         #ifdef _FEDM_ISC_TAG_DIALOG_DLL
00081                 #define _FEDM_ISC_TAG_DIALOG_EXT_CLASS __declspec(dllexport)
00082         #else
00083                 #if !defined(_FEDM_DLL)
00084                         #define _FEDM_ISC_TAG_DIALOG_EXT_CLASS
00085                 #else
00086                         #define _FEDM_ISC_TAG_DIALOG_EXT_CLASS __declspec(dllimport)
00087                 #endif
00088         #endif
00089 #else
00090         #define _FEDM_ISC_CORE_EXT_CLASS
00091         #define _FEDM_ISC_CORE_EXT_FUNCT
00092         #define _FEDM_SERVICE_EXT_CLASS
00093         #define FEDM_CALL  
00094 #endif
00095 
00096 
00097 
00098 // for MFC (Microsoft Foundation Class)
00099 #if _MSC_VER
00100         #ifdef _FEDM_MFC_SUPPORT
00101                 #include <afxwin.h>
00102         #else
00103                 #include <windows.h>
00104                 #include <tchar.h>
00105         #endif
00106 //      #define _FEDM_TRACE
00107 #endif
00108 
00109 // for Linux
00110 #ifdef _FEDM_LINUX
00111         #include <stdio.h>
00112         #include <stdlib.h>
00113         #include <string.h>
00114         #include <unistd.h>
00115 #endif
00116 
00117 // for Borland C++ Builder
00118 #ifdef __BORLANDC__
00119         //#include <vcl.h>
00120         #include <windows.h>
00121         #include <sys\types.h>
00122         #include <time.h>
00123         //#define CString               AnsiString
00124 #endif
00125 
00126 #ifdef __GNUC__
00127         #include <ctype.h>
00128         #define _GNU_SOURCE 1
00129         #ifndef __int64
00130                 #define __int64 long long
00131         #endif
00132 #endif
00133 
00134 // VxWorks
00135 #if defined(_FEDM_VXWORKS)
00136         #ifndef __int64
00137                 #define __int64 long long
00138         #endif
00139 #endif
00140 
00141 
00142 // FEDM version string
00143 #define FEDM_VERSION                     "04.06.10"             // in ASCII
00144 #define FEDM_VERSION_UC                 L"04.06.10"             // in UNICODE
00145 #define FEDM_VERSION_RC1                 4,6,10,0               // for VS recource files
00146 #define FEDM_VERSION_RC2                 "4.6.10.0"             // for VS recource files
00147 
00148 
00149 #define FEDM_NEW_LRU3000_ACC_CFG
00150 
00151 // return values
00152 #define FEDM_MODIFIED                                                            1
00153 #define FEDM_OK                                                                          0
00154 #define FEDM_ERROR_BLOCK_SIZE                                           -101
00155 #define FEDM_ERROR_BIT_BOUNDARY                                         -102
00156 #define FEDM_ERROR_BYTE_BOUNDARY                                        -103
00157 #define FEDM_ERROR_ARRAY_BOUNDARY                                       -104
00158 #define FEDM_ERROR_BUFFER_LENGTH                                        -105
00159 #define FEDM_ERROR_PARAMETER                                            -106
00160 #define FEDM_ERROR_STRING_LENGTH                                        -107
00161 #define FEDM_ERROR_ODD_STRING_LENGTH                            -108
00162 #define FEDM_ERROR_NO_DATA                                                      -109
00163 #define FEDM_ERROR_NO_READER_HANDLE                                     -110
00164 #define FEDM_ERROR_NO_PORT_HANDLE                                       -111
00165 #define FEDM_ERROR_UNKNOWN_CONTROL_BYTE                         -112
00166 #define FEDM_ERROR_UNKNOWN_MEM_ID                                       -113
00167 #define FEDM_ERROR_UNKNOWN_POLL_MODE                            -114
00168 #define FEDM_ERROR_NO_TABLE_DATA                                        -115
00169 #define FEDM_ERROR_UNKNOWN_ERROR_CODE                           -116
00170 #define FEDM_ERROR_UNKNOWN_COMMAND                                      -117
00171 #define FEDM_ERROR_UNSUPPORTED                                          -118
00172 #define FEDM_ERROR_NO_MORE_MEM                                          -119
00173 #define FEDM_ERROR_NO_READER_FOUND                                      -120
00174 #define FEDM_ERROR_NULL_POINTER                                         -121
00175 #define FEDM_ERROR_UNKNOWN_READER_TYPE                          -122
00176 #define FEDM_ERROR_UNSUPPORTED_READER_TYPE                      -123
00177 #define FEDM_ERROR_UNKNOWN_TABLE_ID                                     -124
00178 #define FEDM_ERROR_UNKNOWN_LANGUAGE                                     -125
00179 #define FEDM_ERROR_NO_TABLE_SIZE                                        -126
00180 #define FEDM_ERROR_SENDBUFFER_OVERFLOW                          -127
00181 #define FEDM_ERROR_VERIFY                                                       -128
00182 #define FEDM_ERROR_OPEN_FILE                                            -129
00183 #define FEDM_ERROR_SAVE_FILE                                            -130
00184 #define FEDM_ERROR_UNKNOWN_TRANSPONDER_TYPE                     -131
00185 #define FEDM_ERROR_READ_FILE                                            -132
00186 #define FEDM_ERROR_WRITE_FILE                                           -133
00187 #define FEDM_ERROR_UNKNOWN_EPC_TYPE                                     -134
00188 #define FEDM_ERROR_UNSUPPORTED_PORT_DRIVER                      -135
00189 #define FEDM_ERROR_UNKNOWN_ADDRESS_MODE                         -136
00190 #define FEDM_ERROR_ALREADY_CONNECTED                            -137
00191 #define FEDM_ERROR_NOT_CONNECTED                                        -138
00192 #define FEDM_ERROR_NO_MODULE_HANDLE                                     -139
00193 #define FEDM_ERROR_EMPTY_MODULE_LIST                            -140
00194 #define FEDM_ERROR_MODULE_NOT_FOUND                                     -141
00195 #define FEDM_ERROR_DIFFERENT_OBJECTS                            -142
00196 #define FEDM_ERROR_NOT_AN_EPC                                           -143
00197 #define FEDM_ERROR_OLD_LIB_VERSION                                      -144
00198 #define FEDM_ERROR_WRONG_READER_TYPE                            -145
00199 #define FEDM_ERROR_CRC                                                          -146
00200 #define FEDM_ERROR_CFG_BLOCK_PREVIOUSLY_NOT_READ        -147
00201 #define FEDM_ERROR_UNSUPPORTED_CONTROLLER_TYPE          -148
00202 #define FEDM_ERROR_VERSION_CONFLICT                                     -149
00203 #define FEDM_ERROR_UNSUPPORTED_NAMESPACE                        -150
00204 #define FEDM_ERROR_TASK_STILL_RUNNING                           -151
00205 #define FEDM_ERROR_TAG_HANDLER_NOT_IDENTIFIED           -152
00206 #define FEDM_ERROR_UNVALID_IDD_LENGTH                           -153
00207 #define FEDM_ERROR_UNVALID_IDD_FORMAT                           -154
00208 #define FEDM_ERROR_UNKNOWN_TAG_HANDLER_TYPE                     -155
00209 #define FEDM_ERROR_UNSUPPORTED_TRANSPONDER_TYPE         -156
00210 #define FEDM_ERROR_CONNECTED_WITH_OTHER_MODULE          -157
00211 #define FEDM_ERROR_INVENTORY_NO_TID_IN_UID                      -158
00212 
00213 #define FEDM_XML_ERROR_NO_XML_FILE                                      -200
00214 #define FEDM_XML_ERROR_NO_OBID_TAG                                      -201
00215 #define FEDM_XML_ERROR_NO_CHILD_TAG                                     -202
00216 #define FEDM_XML_ERROR_TAG_NOT_FOUND                            -203
00217 #define FEDM_XML_ERROR_DOC_NOT_WELL_FORMED                      -204
00218 #define FEDM_XML_ERROR_NO_TAG_VALUE                                     -205
00219 #define FEDM_XML_ERROR_NO_TAG_ATTRIBUTE                         -206
00220 #define FEDM_XML_ERROR_DOC_FILE_VERSION                         -207
00221 #define FEDM_XML_ERROR_DOC_FILE_FAMILY                          -208
00222 #define FEDM_XML_ERROR_DOC_FILE_TYPE                            -209
00223 #define FEDM_XML_ERROR_WRONG_CONTROLLER_TYPE            -210
00224 #define FEDM_XML_ERROR_WRONG_MEM_BANK_TYPE                      -211
00225 
00226 // Constants for Windows operation system
00227 #define FEDM_OS_W95             1
00228 #define FEDM_OS_W98             2
00229 #define FEDM_OS_WME             3
00230 #define FEDM_OS_WNT4    4
00231 #define FEDM_OS_W2K             5
00232 #define FEDM_OS_WCE             6
00233 
00234 
00235 // defines for language support
00236 #define FEDM_LANG_GERMAN        7
00237 #define FEDM_LANG_ENGLISH       9
00238 
00239 
00240 // defines for communication mode
00241 #define FEDM_COMM_MODE_SERIAL           0x0000
00242 #define FEDM_COMM_MODE_USB                      0x0001
00243 #define FEDM_COMM_MODE_TCP                      0x0002
00244 #define FEDM_COMM_MODE_BLUETOOTH        0x0003
00245 #define FEDM_COMM_MODE_UNDEF            0x00FF
00246 
00247 
00248 // defines for reader families
00249 #define FEDM_RW_FAMILY          1
00250 #define FEDM_RWA_FAMILY         2
00251 #define FEDM_ISC_FAMILY         3
00252 #define FEDM_TRI_FAMILY         4
00253 #define FEDM_RO_FAMILY          5
00254 
00255 #define FEDM_STR_RW_FAMILY                       "RW"
00256 #define FEDM_STR_RWA_FAMILY                      "RWA"
00257 #define FEDM_STR_ISC_FAMILY                      "ISC"
00258 #define FEDM_STR_TRI_FAMILY                      "TRI"
00259 #define FEDM_STR_RO_FAMILY                       "RO"
00260 
00261 #define FEDM_STR_RW_FAMILY_UC           L"RW"
00262 #define FEDM_STR_RWA_FAMILY_UC          L"RWA"
00263 #define FEDM_STR_ISC_FAMILY_UC          L"ISC"
00264 #define FEDM_STR_TRI_FAMILY_UC          L"TRI"
00265 #define FEDM_STR_RO_FAMILY_UC           L"RO"
00266 
00267 
00268 
00269 // defines for protocol frame support
00270 //(SetProtocolFrameSupport)
00271 #define FEDM_PRT_FRAME_STANDARD             1
00272 #define FEDM_PRT_FRAME_ADVANCED             2
00273 
00274 // controller types
00275 #define FEDM_CNTRL_TYPE_FPGA                    1       // RF-Decoder
00276 #define FEDM_CNTRL_TYPE_RFC                             2       // RF-Controller
00277 #define FEDM_CNTRL_TYPE_ACC                             3       // AC-Controller
00278 #define FEDM_CNTRL_TYPE_BL                              4       // Bootloader
00279 #define FEDM_CNTRL_TYPE_KB                              5       // Keyboard
00280 #define FEDM_CNTRL_TYPE_PCC                             6       // People Counter Controller
00281 #define FEDM_CNTRL_TYPE_EXT_SCR                 7       // ext. Smartcard-Reader
00282 #define FEDM_CNTRL_TYPE_EXT_WLAN                8       // ext. WLAN-Modul
00283 #define FEDM_CNTRL_TYPE_MLC_EMPS_LS200                  0x00060011      // megalock C Lock
00284 #define FEDM_CNTRL_TYPE_MLC_EMPS_LS300                  0x00060020      // megalock C Lock
00285 #define FEDM_CNTRL_TYPE_MLC_EMPS_LS400                  0x00060021      // megalock C Lock
00286 #define FEDM_CNTRL_TYPE_MLC_EMPS_DS200_KNOB             0x00060031      // megalock C Lock
00287 #define FEDM_CNTRL_TYPE_MLC_EMPS_DS300_KNOB             0x00060032      // megalock C Lock
00288 #define FEDM_CNTRL_TYPE_MLC_EMPS_DS400_KNOB             0x00060033      // megalock C Lock
00289 #define FEDM_CNTRL_TYPE_MLC_EMPS_DS200_HANDLE   0x00060041      // megalock C Lock
00290 #define FEDM_CNTRL_TYPE_MLC_EMPS_DS300_HANDLE   0x00060042      // megalock C Lock
00291 #define FEDM_CNTRL_TYPE_MLC_EMPS_DS400_HANDLE   0x00060043      // megalock C Lock
00292 #define FEDM_CNTRL_TYPE_CPR_SCRA_A_862                  0x00000001      // ext. Smartcard-Reader ID CPR.SCRA-A-862
00293 
00294 // controller sub types
00295 #define FEDM_CNTRL_TYPE_ACC_CC7U                1
00296 #define FEDM_CNTRL_TYPE_ACC_CC9U                2
00297 #define FEDM_CNTRL_TYPE_ACC_FMB08               3
00298 
00299 // memory bank types
00300 #define FEDM_MEM_BANK_TYPE_UNDEFINED                     0x00
00301 #define FEDM_MEM_BANK_TYPE_MAIN                                  0x01
00302 #define FEDM_MEM_BANK_TYPE_CALIBRATION_DATA              0x20
00303 
00304 
00305 #define FEDM_MAX_PROTOCOL_SIZE                   65536
00306 
00307 
00308 // defines for memory types
00309 #define FEDM_RFC_EEDATA_MEM      3      // memory for parameters in readers EEPROM for RF-Controller
00310 #define FEDM_RFC_RAMDATA_MEM 4  // memory for parameters in readers RAM for RF-Controller
00311 #define FEDM_ACC_EEDATA_MEM      5      // memory for parameters in readers EEPROM for AC-Controller
00312 #define FEDM_ACC_RAMDATA_MEM 6  // memory for parameters in readers RAM for AC-Controller
00313 
00314 #define FEDM_TMPDATA_MEM        10      // memory for temporary data
00315 #define FEDM_MJPDATA_MEM        11      // memory for temporary multijob-poll data
00316 
00317 #define FEDM_SN_MEM                     20      // memory for transponders serial number and transponder type
00318 #define FEDM_ID_MEM                     21      // memory for transponders id number
00319 #define FEDM_AC_MEM                     22      // memory for transponders account data space
00320 #define FEDM_PUB_MEM            23      // memory for transponders public data space
00321 #define FEDM_SEC_MEM            24      // memory for transponders secret data space
00322 #define FEDM_CONF_MEM           25      // memory for transponders configuration data space
00323 #define FEDM_DATE_MEM           26      // memory for megaKey-s transponders date fields
00324 
00325 #define FEDM_RFC_DATA_MASK_MEM  30      // memory for customization masks for readers EEPROM in RF-Controller
00326 #define FEDM_ACC_DATA_MASK_MEM  31      // memory for customization masks for readers EEPROM in AC-Controller
00327 
00328 #ifdef _FEDM_WINDOWS
00329         #if defined(__BORLANDC__)
00330         #undef _FEDM_LINUX
00331         #endif
00332    #define         FEDM_SLEEP           Sleep
00333    // Windows: some time constants for Sleep()
00334    #define    FE_1MS               1
00335    #define   FE_10MS              10
00336    #define  FE_100MS             100
00337    #define  FE_500MS             500
00338    #define FE_1000MS            1000
00339    #define FE_2000MS            2000
00340    #define FE_5000MS            5000
00341 #endif
00342 
00343 #ifdef _FEDM_LINUX
00344    #define         FEDM_SLEEP          usleep
00345    // Linux: some time constants for usleep()
00346    #define    FE_1MS           1000LL
00347    #define   FE_10MS          10000LL
00348    #define  FE_100MS         100000LL
00349    #define  FE_500MS         500000LL
00350    #define FE_1000MS        1000000LL
00351    #define FE_2000MS        2000000LL
00352    #define FE_5000MS        5000000LL
00353 #endif
00354 
00355 // some macros (only for internal use in FEDM)
00356 #define FEDM_CHK1(iErr, fkt)    { if((iErr=fkt)<0) return iErr; }
00357 #define FEDM_CHK2(iErr, fkt)    { if((iErr=fkt)<0) {SetLastError(iErr); return iErr;} }
00358 #define FEDM_CHK3(var)                  { if(var==NULL) return FEDM_ERROR_NULL_POINTER; }
00359 #define FEDM_CHK4(iErr, fkt)    { if((iErr=fkt)!=0) {SetLastError(iErr); return iErr;} }
00360 #define FEDM_CHK5(var)                  { if(var==NULL) {SetLastError(FEDM_ERROR_NULL_POINTER); return FEDM_ERROR_NULL_POINTER;} }
00361 #define FEDM_CHK6(iErr, fkt)    { if((iErr=fkt)<0) return; }
00362 #define FEDM_CHK7(iErr, fkt)    { if((iErr=fkt)<0) {SetLastError(iErr); return NULL;} }
00363 #define FEDM_CHK8(var)                  { if(var<=0) {SetLastError(FEDM_ERROR_STRING_LENGTH); return FEDM_ERROR_STRING_LENGTH;} }
00364 
00365 #define FEDM_RETURN(iErr)               { SetLastError(iErr); return iErr; }
00366 
00367 #define FEDM_IS_COMPORT(iPortHnd)       (((iPortHnd&0xF0000000)==0)&&(iPortHnd>0))
00368 #define FEDM_IS_USBPORT(iPortHnd)       ((iPortHnd&0x10000000)&&(iPortHnd>0))
00369 #define FEDM_IS_TCPPORT(iPortHnd)       ((iPortHnd&0x20000000)&&(iPortHnd>0))
00370 #define FEDM_IS_PIPORT(iPortHnd)        ((iPortHnd&0x70000000)&&(iPortHnd>0))
00371 
00372 #define FEDM_IS_RDR_MODULE(iHnd)        (iHnd&0x10000000)
00373 #define FEDM_IS_FU_MODULE(iHnd)         (iHnd&0x20000000)
00374 
00375 #if defined(_FEDM_SUPPORT_UCLINUX)
00376 #define FEDM_SWSCANF(in, out)   { for (int i = 0; i < sizeof(in); i++) out[i] = (char)(in)[i];}
00377 #else
00378 #define FEDM_SWSCANF(in, out)   { int i; for (i = 0; i < (int)(in.length()); i++) {out[i] = (char)(in.c_str())[i];} out[i] = '\0';}
00379 #endif
00380 
00381 #define FEDM_SWPRINTF(in, out)  { int i; for (i = 0; i < (int)(in.length()); i++) {out[i] = (wchar_t)(in.c_str())[i];} out[i] = '\0';}
00382 
00383 #if defined(_FEDM_LINUX)
00384         //#define FEDM_STRUPR(str, len) {strupr(str);}
00385         #define FEDM_STRUPR(str, len) {char* s = str; for(unsigned int i=0; i<len; ++i, s++) *s = toupper(*s);}
00386 #else
00387         #if _MSC_VER <= 12
00388                 #define FEDM_STRUPR(str, len)   {strupr(str);}
00389         #else
00390                 #define FEDM_STRUPR(str, len)   {_strupr_s(str, len);}
00391         #endif
00392 #endif
00393 
00394 #endif // _FEDM_H_INCLUDED_


rfid_drivers
Author(s): Raul Perula-Martinez
autogenerated on Thu Apr 2 2015 03:06:12