fescr.h
Go to the documentation of this file.
00001 /*-------------------------------------------------------
00002 |                                                       |
00003 |                      fescr.h                          |
00004 |                                                       |
00005 ---------------------------------------------------------
00006 
00007 Copyright © 2011                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           :               Manuel Sahm
00017 Version         :               01.02.01 / 31.07.2012 / B. Tschunko
00018                                                 
00019 Projekt         :               API for ISO7816 APDUs
00020                                                 
00021 Betriebssystem  :               Windows XP / Vista / 7 / 8
00022                                                 WindowsCE
00023                                                 Linux
00024 
00025 This file contains the constants, datatypes snd function declartions of FESCR library
00026 */
00027 
00028 
00029 #ifndef _FESCR_INCLUDE_H
00030  #define _FESCR_INCLUDE_H
00031 
00032 
00033 #if defined (_MSC_VER) || defined(__BORLANDC__) || defined(_CVI_)
00034         #ifdef FESCRDLL
00035                 #define DLL_EXT_FUNC __declspec(dllexport) __stdcall
00036         #else
00037                 #define DLL_EXT_FUNC __declspec(dllimport) __stdcall
00038         #endif
00039         #define FESCR_EXT_CALL __stdcall
00040         #define FESCR_CALL __cdecl
00041 #else
00042         #define FESCR_EXT_CALL
00043         #define DLL_EXT_FUNC
00044         #define FESCR_CALL
00045 #endif
00046 
00047 
00048 #ifdef __cplusplus
00049         extern "C" {
00050 #endif
00051 
00052 
00053 #define LANGUAGE                9
00054 
00055 
00056 // error codes
00057 //********************
00058 
00059 // common errors
00060 #define FESCR_ERR_NEW_SMARTCARDSLOT_FAILURE                     -4300
00061 #define FESCR_ERR_EMPTY_LIST                                            -4301
00062 #define FESCR_ERR_POINTER_IS_NULL                                       -4302
00063 #define FESCR_ERR_NO_MORE_MEM                                           -4303
00064 //#define FESCR_ERR_UNKNOWN_COMM_PORT                           -4304
00065 //#define FESCR_ERR_UNSUPPORTED_FUNCTION                        -4305
00066 #define FESCR_ERR_NO_USB_SUPPORT                                        -4306
00067 //#define FESCR_ERR_OLD_FECOM                                           -4307
00068 //#define FESCR_ERR_FILE_COULD_NOT_BE_OPENED            -4308
00069 #define FESCR_ERR_APDU_CURRENTLY_RUNNING                        -4309
00070 
00071 // query errors
00072 //#define FESCR_ERR_NO_VALUE                                            -4310
00073 
00074 // handle errors
00075 #define FESCR_ERR_UNKNOWN_HND                                           -4320
00076 #define FESCR_ERR_HND_IS_NULL                                           -4321
00077 #define FESCR_ERR_HND_IS_NEGATIVE                                       -4322
00078 #define FESCR_ERR_NO_HND_FOUND                                          -4323
00079 //#define FESCR_ERR_SMARTCARDSLOT_HND_IS_NEGATIVE       -4324
00080 //#define FESCR_ERR_HND_UNVALID                                         -4325
00081 #define FESCR_ERR_READER_HND_IS_NEGATIVE                        -4326
00082 #define FESCR_ERR_THREAD_NOT_CREATED                            -4327
00083 
00084 // parameter errors
00085 #define FESCR_ERR_UNKNOWN_PARAMETER                                     -4350
00086 #define FESCR_ERR_PARAMETER_OUT_OF_RANGE                        -4351
00087 //#define FESCR_ERR_ODD_PARAMETERSTRING                         -4352
00088 #define FESCR_ERR_UNKNOWN_ERRORCODE                                     -4353
00089 #define FESCR_ERR_UNDERSIZED_RESPONSE_BUFFER            -4357           // Responsebuffer < 64kB
00090 
00091 // communication data flow errors
00092 //#define FESCR_ERR_BUFFER_OVERFLOW                                     -4370
00093 //#define       FESCR_ERR_OVERSIZED_RESPONSE                    -4371           // Response > 64kB
00094 //#define       FESCR_INVALID_ACKNOWLEDGEMENT                   -4372
00095 #define FESCR_INVALID_ACKNOWLEDGEMENT_LENGTH            -4373
00096 #define FESCR_LIST_COMPLETE_FAILURE                                     -4374           // Liste sollte komplett sein.
00097 #define FESCR_INCOMPLETE_RESPONSE                                       -4375           // Response zurueck, aber nicht komplett.                                                                                               //      gab aber was anderes 
00098 #define FESCR_INVALID_PROTOCOL                                          -4376           
00099 #define FESCR_INVALID_TRANSMISSION                                      -4377           
00100 
00101 
00102 /*
00103 // defines for uiFlag in FESCR_EVENT_INIT
00104 #define FESCR_THREAD_ID                 1
00105 #define FESCR_WND_HWND                  2
00106 #define FESCR_CALLBACK                  3
00107 #define FESCR_CALLBACK2                 4
00108 #define FESCR_TASKCB_NET_1     10
00109 
00110 
00111 // #################
00112 // FESCR structures
00113 // #################
00114 
00115 
00116 typedef struct _FESCR_EVENT_INIT        // Structur for eventhandling; thread-ID, 
00117 {                                                                       //   message-handle or callback
00118 
00119         void*   pAny;           // pointer to anything, which is reflected as the first parameter 
00120                                                 // in the callback function cbFct2 (e.g. can be used to pass the object pointer)
00121         unsigned int    uiUse;          // unused
00122         unsigned int    uiMsg;          // message code used with dwThreadID and hwndWnd (e.g. WM_USER_xyz)
00123         unsigned int    uiFlag;         // specifies the use of the union (e.g. FESCR_WND_HWND)
00124         union
00125         {
00126 #if defined(_MSC_VER) || defined(__BORLANDC__)
00127                 DWORD   dwThreadID;                                     // for thread-ID
00128                 HWND    hwndWnd;                                        // for window-handle
00129 #endif
00130                 void    (*cbFct)(int, int, int);                        // for callback-function
00131                 void    (*cbFct2)(void*, int, int, int);                // for callback-function
00132 
00133 #if defined(_MSC_VER)
00134                 // for .NET delegates; for SAM, Queue and Container commands
00135                 void    (CALLBACK* cbFctNET1)(  int iHandle,    // [out] handle of FESCR transponder object
00136                                                                                 int iError,             // [out] OK (=0), error code (<0) or status byte from reader (>0)
00137                                                                                 int iRspLen );  // [out] length of response data
00138 
00139 #endif
00140 #ifdef __cplusplus
00141         };
00142 #else
00143         }Method;
00144 #endif
00145 
00146 } FESCR_EVENT_INIT;
00147 */
00148 
00149 
00150 
00151 //##########################
00152 // FESCR functions
00153 //##########################
00154         
00155 
00156 // miscellaneous functions
00157 //********************
00158 
00159 void DLL_EXT_FUNC FESCR_GetDLLVersion( char* cVersion );
00160 
00161 int DLL_EXT_FUNC FESCR_GetErrorText( int iErrorCode, char* cErrorText );
00162 
00163 int DLL_EXT_FUNC FESCR_GetLastError( int iSlotHnd, int* iErrorCode, char* cErrorText );
00164 
00165 
00166 
00167 // ddministrative functions
00168 //***************************
00169 
00170 int  DLL_EXT_FUNC FESCR_NewScrSlot(     int iReaderHnd, 
00171                                                                         unsigned char ucBusAdr,
00172                                                                         int iSlotNo,
00173                                                                         unsigned char ucNad, 
00174                                                                         bool bUseNad );
00175 
00176 int  DLL_EXT_FUNC FESCR_DeleteScrSlot( int iSlotHnd );
00177 
00178 int  DLL_EXT_FUNC FESCR_GetScrSlotList( int iNext );
00179 
00180 
00181 // communication functions
00182 //**************************
00183 int DLL_EXT_FUNC FESCR_Activate(        int iSlotHnd,
00184                                                                         unsigned char* ucReqData, 
00185                                                                         int iReqDataLen,
00186                                                                         unsigned char* ucRspData,
00187                                                                         unsigned int uiRspDataBufSize,
00188                                                                         int* iRspDataLen );
00189 
00190 int DLL_EXT_FUNC FESCR_Deactivate( int iSlotHnd );
00191 
00192 int DLL_EXT_FUNC FESCR_Apdu(            int iSlotHnd, 
00193                                                                         unsigned char* ucReqApdu, 
00194                                                                         int iReqApduLen, 
00195                                                                         unsigned char* ucRspApdu,
00196                                                                         unsigned int uiRspApduBufSize,
00197                                                                         int* iRspApduLen );
00198 /*
00199 int DLL_EXT_FUNC FESCR_Apdu_Async(      int iSlotHnd, 
00200                                                                         unsigned char* ucReqApdu, 
00201                                                                         int iReqApduLen, 
00202                                                                         FESCR_EVENT_INIT* pInit );
00203 */
00204 
00205 /*
00206 int DLL_EXT_FUNC FESCR_GetResponseData( int iSlotHnd, 
00207                                                                                 unsigned char* ucRspApdu, 
00208                                                                                 int uiRspApduBufSize );
00209 */
00210 
00211 #undef DLL_EXT_FUNC
00212 
00213 #ifdef __cplusplus
00214         }
00215 #endif
00216 
00217 
00218 #endif  // _FESCR_INCLUDE_H


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