fetcl.h
Go to the documentation of this file.
00001 /*-------------------------------------------------------
00002 |                                                       |
00003 |                      fetcl.h                          |
00004 |                                                       |
00005 ---------------------------------------------------------
00006 
00007 Copyright (C) 2005-2012 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 Autor           :               M. Hultsch
00017 Version         :               02.02.01 / 13.02.2014 / M. Hultsch + A. Rauch
00018                                                 
00019 Projekt         :               API for APDU transfer 
00020                                                 
00021 Betriebssystem  :               Windows XP / Vista / 7 / 8
00022                                                 WindowsCE
00023                                                 Linux
00024                                                 Mac OS X V10.7.3 or higher
00025                                                 Android
00026 
00027 This file contains the constants, datatypes snd function declartions of FETCL library
00028 */
00029 
00030 
00031 #ifndef _FETCL_INCLUDE_H
00032         #define _FETCL_INCLUDE_H
00033 
00034 
00035 #if defined (_MSC_VER) || defined(__BORLANDC__) || defined(_CVI_)
00036         #ifdef FETCLDLL
00037                 #define DLL_EXT_FUNC __declspec(dllexport) __stdcall
00038         #else
00039                 #define DLL_EXT_FUNC __declspec(dllimport) __stdcall
00040         #endif
00041         #define FETCL_EXT_CALL __stdcall
00042         #define FETCL_CALL __cdecl
00043 #else
00044         #define FETCL_EXT_CALL
00045         #define DLL_EXT_FUNC
00046         #define FETCL_CALL
00047 #endif
00048 
00049 
00050 #ifdef __cplusplus
00051         extern "C" {
00052 #endif
00053 
00054 
00055 #define LANGUAGE                9
00056 
00057 
00058 // error codes
00059 //********************
00060 
00061 // common errors
00062 #define FETCL_ERR_NEW_TRANSPONDER_FAILURE       -4200
00063 #define FETCL_ERR_EMPTY_LIST                                    -4201
00064 #define FETCL_ERR_POINTER_IS_NULL                               -4202
00065 #define FETCL_ERR_NO_MORE_MEM                                   -4203
00066 #define FETCL_ERR_UNKNOWN_COMM_PORT                             -4204
00067 #define FETCL_ERR_UNSUPPORTED_FUNCTION                  -4205
00068 #define FETCL_ERR_NO_USB_SUPPORT                                -4206
00069 #define FETCL_ERR_OLD_FECOM                                             -4207
00070 #define FETCL_ERR_FILE_COULD_NOT_BE_OPENED      -4208
00071 #define FETCL_ERR_APDU_CURRENTLY_RUNNING        -4209
00072 
00073 // query errors
00074 #define FETCL_ERR_NO_VALUE                                              -4210
00075 
00076 // handle errors
00077 #define FETCL_ERR_UNKNOWN_HND                                   -4220
00078 #define FETCL_ERR_HND_IS_NULL                                   -4221
00079 #define FETCL_ERR_HND_IS_NEGATIVE                               -4222
00080 #define FETCL_ERR_NO_HND_FOUND                                  -4223
00081 #define FETCL_ERR_TRANSPONDER_HND_IS_NEGATIVE   -4224
00082 #define FETCL_ERR_HND_UNVALID                                   -4225
00083 #define FETCL_ERR_READER_HND_IS_NEGATIVE        -4226
00084 #define FETCL_ERR_THREAD_NOT_CREATED            -4227
00085 
00086 // parameter errors
00087 #define FETCL_ERR_UNKNOWN_PARAMETER                             -4250
00088 #define FETCL_ERR_PARAMETER_OUT_OF_RANGE        -4251
00089 #define FETCL_ERR_ODD_PARAMETERSTRING           -4252
00090 #define FETCL_ERR_UNKNOWN_ERRORCODE                             -4253
00091 #define FETCL_ERR_UNDERSIZED_RESPONSE_BUFFER    -4257           // Responsebuffer < 64kB
00092 
00093 // communication data flow errors
00094 #define FETCL_ERR_BUFFER_OVERFLOW                               -4270
00095 #define FETCL_ERR_OVERSIZED_RESPONSE            -4271           // Response > 64kB
00096 #define FETCL_INVALID_ACKNOWLEDGEMENT           -4272
00097 #define FETCL_INVALID_ACKNOWLEDGEMENT_LENGTH    -4273
00098 #define FETCL_LIST_COMPLETE_FAILURE                             -4274           // Liste sollte komplett sein.
00099 #define FETCL_INCOMPLETE_RESPONSE                               -4275           // Response zurueck, aber nicht komplett.                                                                                               //      gab aber was anderes 
00100 #define FETCL_INVALID_PROTOCOL                                  -4276           
00101 #define FETCL_INVALID_TRANSMISSION                              -4277           
00102 
00103 
00104 
00105 
00106 // defines for uiFlag in FETCL_EVENT_INIT
00107 #define FETCL_THREAD_ID                 1
00108 #define FETCL_WND_HWND                  2
00109 #define FETCL_CALLBACK                  3
00110 #define FETCL_CALLBACK2                 4
00111 #define FETCL_TASKCB_NET_1     10
00112 
00113 
00114 // #################
00115 // FETCL structures
00116 // #################
00117 
00118 
00119 typedef struct _FETCL_EVENT_INIT        // Structur for eventhandling; thread-ID, 
00120 {                                                                       //   message-handle or callback
00121 
00122         void*   pAny;           // pointer to anything, which is reflected as the first parameter 
00123                                                 // in the callback function cbFct2 (e.g. can be used to pass the object pointer)
00124         unsigned int    uiUse;          // unused
00125         unsigned int    uiMsg;          // message code used with dwThreadID and hwndWnd (e.g. WM_USER_xyz)
00126         unsigned int    uiFlag;         // specifies the use of the union (e.g. FETCL_WND_HWND)
00127         union
00128         {
00129 #if defined(_MSC_VER) || defined(__BORLANDC__)
00130                 DWORD   dwThreadID;                                     // for thread-ID
00131                 HWND    hwndWnd;                                        // for window-handle
00132 #endif
00133                 void    (FETCL_CALL* cbFct)(int, int, int);                        // for callback-function
00134                 void    (FETCL_CALL* cbFct2)(void*, int, int, int);                // for callback-function
00135 
00136 #if defined(_MSC_VER)
00137                 // for .NET delegates; for SAM, Queue and Container commands
00138                 void    (CALLBACK* cbFctNET1)(  int iHandle,    // [out] handle of FETCL transponder object
00139                                                                                 int iError,             // [out] OK (=0), error code (<0) or status byte from reader (>0)
00140                                                                                 int iRspLen );  // [out] length of response data
00141 
00142 #endif
00143 #ifdef __cplusplus
00144         };
00145 #else
00146         }Method;
00147 #endif
00148 
00149 } FETCL_EVENT_INIT;
00150 
00151 
00152 
00153 
00154 //##########################
00155 // FETCL functions
00156 //##########################
00157         
00158 
00159 // miscellaneous functions
00160 //********************
00161 
00162 void DLL_EXT_FUNC FETCL_GetDLLVersion( char* cVersion );
00163 
00164 int DLL_EXT_FUNC FETCL_GetErrorText(    int iErrorCode, char* cErrorText );
00165 
00166 int DLL_EXT_FUNC FETCL_GetLastError( int* iErrorCode, char* cErrorText );
00167 
00168 //int DLL_EXT_FUNC FETCL_SetLogPara( int iTransponderHnd, char* cPara, char* cValue );
00169 
00170 
00171 // ddministrative functions
00172 //***************************
00173 
00174 int  DLL_EXT_FUNC FETCL_NewTransponder( int iReaderHnd, 
00175                                                                                 unsigned char ucBusAdr,
00176                                                                                 unsigned char ucCid, 
00177                                                                                 unsigned char ucNad, 
00178                                                                                 bool bUseCid, 
00179                                                                                 bool bUseNad );
00180 
00181 int  DLL_EXT_FUNC FETCL_DeleteTransponder( int iTransponderHnd );
00182 
00183 int  DLL_EXT_FUNC FETCL_GetTransponderList( int iNext );
00184 
00185 
00186 // communication functions
00187 //**************************
00188 
00189 int DLL_EXT_FUNC FETCL_Apdu(    int iTransponderHnd, 
00190                                                                 unsigned char* ucData, 
00191                                                                 int iDataLen, 
00192                                                                 FETCL_EVENT_INIT* pInit );
00193 
00194 int DLL_EXT_FUNC FETCL_Deselect( int iTransponderHnd );
00195 
00196 int DLL_EXT_FUNC FETCL_Ping( int iTransponderHnd );
00197 
00198 int DLL_EXT_FUNC FETCL_GetResponseData( int iTransponderHnd, 
00199                                                                                 unsigned char* ucData, 
00200                                                                                 int iDataBufLen );
00201 
00202 
00203 #undef DLL_EXT_FUNC
00204 
00205 #ifdef __cplusplus
00206         }
00207 #endif
00208 
00209 
00210 #endif  // _FETCL_INCLUDE_H


maggie_rfid_drivers
Author(s): Raul Perula-Martinez
autogenerated on Mon Sep 14 2015 03:05:30