feusb.h
Go to the documentation of this file.
00001 /*-------------------------------------------------------
00002 |                                                       |
00003 |                       feusb.h                         |
00004 |                                                       |
00005 ---------------------------------------------------------
00006 
00007 Copyright (C) 2000-2013 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 
00018 Version                 :       Linux:                  05.00.00 / 01.12.2014 / A. Bierschenk
00019 Version                 :       Windows:                04.02.06 / 23.01.2013 / M. Hultsch
00020 Version                 :       Linux:                  04.02.01 / 12.02.2014 / M. Sahm
00021 Version                 :       Windows CE:             04.02.06 / 23.01.2013 / M. Hultsch
00022 
00023 Operation Systems       :       Windows XP / Vista / 7 / 8 (based on usbio V2.50)
00024                         WindowsCE (based on usbio_ce V1.16)
00025                         Linux (based on libusb V0.1.12)
00026                                                 Mac OS X V10.7.3 or higher
00027                                                 Android
00028 
00029 
00030 This file contains the constants, datatypes and function declartions of FEUSB library
00031 */
00032 
00033 #ifndef _FEUSB_INCLUDE_H
00034 #define _FEUSB_INCLUDE_H
00035 
00036 
00037 
00038 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_CVI_)
00039         #ifdef FEUSBDLL
00040                 #define DLL_EXT_FUNC __declspec(dllexport) __stdcall
00041         #else
00042                 #define DLL_EXT_FUNC __declspec(dllimport) __stdcall
00043         #endif
00044         #define FEUSB_EXT_CALL __stdcall
00045         #define FEUSB_CALL __cdecl
00046 #else
00047         #define DLL_EXT_FUNC
00048         #define CALLBACK
00049         #define FEUSB_EXT_CALL
00050         #define FEUSB_CALL
00051 #endif
00052 
00053 
00054 // type defines
00055 #ifdef __GNUC__
00056         #ifndef __int64
00057                 #define __int64 long long
00058         #endif
00059 #endif
00060 
00061 
00062 
00063 #ifdef __cplusplus
00064 extern "C" {
00065 #endif
00066 
00067 
00068 
00069 
00070 // #####################################################
00071 // FEUSB constants
00072 // #####################################################
00073 
00074         
00075 // FEUSB error codes
00076 
00077 // common errors
00078 #define FEUSB_ERR_EMPTY_DEVICELIST                      -1100
00079 #define FEUSB_ERR_EMPTY_SCANLIST                        -1101
00080 #define FEUSB_ERR_POINTER_IS_NULL                       -1102
00081 #define FEUSB_ERR_NO_MORE_MEM                           -1103
00082 #define FEUSB_ERR_SET_CONFIGURATION                     -1104
00083 #define FEUSB_ERR_KERNEL                                        -1105
00084 #define FEUSB_ERR_UNSUPPORTED_OPTION            -1106
00085 #define FEUSB_ERR_UNSUPPORTED_FUNCTION          -1107
00086 #define FEUSB_ERR_NO_CONFIGURATIONS         -1108       // new since linux-version 05.00.00 (01.12.14)
00087 #define FEUSB_ERR_NOT_HAS_CAPABILITY        -1109       // new since linux-version 05.00.00 (01.12.14)
00088 
00089 // error while scanning
00090 #define FEUSB_ERR_NO_FEIG_DEVICE                        -1110
00091 #define FEUSB_ERR_SEARCH_MISMATCH                       -1111
00092 #define FEUSB_ERR_NO_DEVICE_FOUND                       -1112
00093 #define FEUSB_ERR_DEVICE_IS_SCANNED                     -1113
00094 #define FEUSB_ERR_SCANLIST_OVERFLOW                     -1114
00095 #define FEUSB_ERR_NO_SCAN_FIRST             -1115
00096 
00097 // handle errors
00098 #define FEUSB_ERR_UNKNOWN_HND                           -1120
00099 #define FEUSB_ERR_HND_IS_NULL                           -1121
00100 #define FEUSB_ERR_HND_IS_NEGATIVE                       -1122
00101 #define FEUSB_ERR_NO_HND_FOUND                          -1123   // means: handle not found
00102 
00103 // communication errors (part1))
00104 #define FEUSB_ERR_TIMEOUT                                       -1130
00105 #define FEUSB_ERR_NO_SENDDATA                           -1131
00106 #define FEUSB_ERR_UNKNOWN_INTERFACE                     -1132
00107 #define FEUSB_ERR_UNKNOWN_DIRECTION                     -1133
00108 #define FEUSB_ERR_RECBUF_TOO_SMALL                      -1134
00109 #define FEUSB_ERR_SENDDATA_LEN                          -1135
00110 #define FEUSB_ERR_UNKNOWN_DESCRIPTOR_TYPE       -1136
00111 #define FEUSB_ERR_DEVICE_NOT_PRESENT            -1137
00112 #define FEUSB_ERR_TRANSMIT_PROCESS                      -1138
00113 #define FEUSB_ERR_BULK_TRANSFER                         -1139   // new since linux-version 05.00.00 (01.12.14)
00114 
00115 // open/close device errors
00116 #define FEUSB_ERR_DEVICE_NOT_SCANNED            -1140
00117 #define FEUSB_ERR_DEVHND_NOT_IN_SCANLIST        -1141
00118 #define FEUSB_ERR_DRIVERLIST                            -1142
00119 #define FEUSB_ERR_OPEN_DEVICE               -1143
00120 #define FEUSB_ERR_DEVICE_NOT_OPENED         -1144       // new since linux-version 05.00.00 (01.12.14)
00121 #define FEUSB_ERR_CLAIM_INTERFACE           -1145       // new since linux-version 05.00.00 (01.12.14)
00122 
00123 // parameter errors
00124 #define FEUSB_ERR_UNKNOWN_PARAMETER                     -1150
00125 #define FEUSB_ERR_PARAMETER_OUT_OF_RANGE        -1151
00126 #define FEUSB_ERR_ODD_PARAMETERSTRING           -1152
00127 #define FEUSB_ERR_INDEX_OUT_OF_RANGE            -1153
00128 #define FEUSB_ERR_UNKNOWN_SCANOPTION            -1154
00129 #define FEUSB_ERR_UNKNOWN_ERRORCODE                     -1155
00130 
00131 // identification errors
00132 #define FEUSB_ERR_DEV_DESC_LENGTH                       -1160
00133 #define FEUSB_ERR_CFG_DESC_LENGTH                       -1161
00134 #define FEUSB_ERR_INTF_DESC_LENGTH                      -1162
00135 #define FEUSB_ERR_ENDP_DESC_LENGTH                      -1163
00136 #define FEUSB_ERR_HID_DESC_LENGTH                       -1164
00137 #define FEUSB_ERR_STRG_DESC_LENGTH                      -1165
00138 #define FEUSB_ERR_READ_DEV_DESCRIPTOR           -1166
00139 #define FEUSB_ERR_READ_CFG_DESCRIPTOR           -1167
00140 #define FEUSB_ERR_READ_STRG_DESCRIPTOR          -1168
00141 
00142 #define FEUSB_ERR_MAX_INTERFACES                        -1170
00143 #define FEUSB_ERR_MAX_ENDPOINTS                         -1171
00144 #define FEUSB_ERR_MAX_STRINGS                           -1172
00145 
00146 // communication errors (part2)
00147 #define FEUSB_ERR_CONTROL_TRANSFER                      -1180   // new since linux-version 05.00.00 (01.12.14)
00148         
00149 
00150 
00151 // constants for dynamic load of library
00152 
00153 // miscellaneous functions
00154 #define FEUSB_GET_DLL_VERSION                           1100
00155 #define FEUSB_GET_DRV_VERSION                           1101
00156 #define FEUSB_GET_ERROR_TEXT                            1102
00157 #define FEUSB_GET_LAST_ERROR                            1103
00158                                                                                         
00159 // function for scan-list                                       
00160 #define FEUSB_SCAN                                                      1110
00161 #define FEUSB_SCAN_AND_OPEN                                     1111
00162 #define FEUSB_GET_SCAN_LIST_PARA                        1112
00163 #define FEUSB_GET_SCAN_LIST_SIZE                        1113
00164 #define FEUSB_CLEAR_SCAN_LIST                           1114
00165 #define FEUSB_GET_SCAN_LIST_INDEX           1115
00166                                                                                         
00167 // functions for event notification                     
00168 #define FEUSB_ADD_EVENT_HANDLER                         1120
00169 #define FEUSB_DEL_EVENT_HANDLER                         1121
00170                                                                                         
00171 // device functions                                                     
00172 #define FEUSB_OPEN_DEVICE                                       1130
00173 #define FEUSB_CLOSE_DEVICE                                      1131
00174 #define FEUSB_IS_DEVICE_PRESENT                         1132
00175 #define FEUSB_GET_DEVICE_LIST                           1133
00176 #define FEUSB_GET_DEVICE_PARA                           1134
00177 #define FEUSB_SET_DEVICE_PARA                           1135
00178 #define FEUSB_GET_DEVICE_HND                            1136
00179                                                                                         
00180 // communication function                                       
00181 #define FEUSB_TRANSCEIVE                                        1140
00182 #define FEUSB_TRANSMIT                                          1141
00183 #define FEUSB_RECEIVE                                           1142
00184 
00185 
00186 
00187 // constants for structure _FEUSB_EVENT_INIT
00188 
00189 // defines for uiFlag in FEUSB_EVENT_INIT
00190 #define FEUSB_THREAD_ID                                 1
00191 #define FEUSB_WND_HWND                                  2
00192 #define FEUSB_CALLBACK                                  3
00193 #define FEUSB_CALLBACK_2                                4
00194 
00195 // defines for uiUse in FEUSB_EVENT_INIT
00196 #define FEUSB_DEV_CONNECT_EVENT                 1
00197 #define FEUSB_DEV_DISCONNECT_EVENT              2
00198 
00199 
00200 // constants for function options
00201 
00202 // scan options
00203 #define FEUSB_SCAN_FIRST                                0x00000001
00204 #define FEUSB_SCAN_NEXT                                 0x00000002
00205 #define FEUSB_SCAN_NEW                                  0x00000003
00206 #define FEUSB_SCAN_ALL                                  0x0000000F
00207 #define FEUSB_SCAN_SEARCH                               0x00010000
00208 #define FEUSB_SCAN_PACK                                 0x00020000
00209 
00210 // search options
00211 #define FEUSB_SEARCH_FAMILY                             0x00000001
00212 #define FEUSB_SEARCH_PRODUCT                    0x00000002
00213 #define FEUSB_SEARCH_DEVICEID                   0x00000004
00214 
00215 // communication directions
00216 #define FEUSB_DIR_IN                                    0x00000001
00217 #define FEUSB_DIR_OUT                                   0x00000002
00218 
00219 // Interface names
00220 #define FEUSB_INTERFACE_OBID_RCI                "OBID-RCI"
00221 #define FEUSB_INTERFACE_OBID_RCI_V2             "OBID-RCI2"
00222         
00223 // special handle values for FEUSB_SetDevicePara-function - new since linux-version 05.00.00 (01.12.14)
00224 #define FEUSB_PARAHND_ALL_DEVICES               0
00225 #define FEUSB_PARAHND_DLL                               -1
00226 
00227 
00228 
00229 // #####################################################
00230 // FEUSB structures
00231 // #####################################################
00232 
00233 // structure for message-handling
00234 typedef struct _FEUSB_EVENT_INIT
00235 {
00236         unsigned int uiUse;             // specifies the event (connect or disconnect)
00237         unsigned int uiMsg;             // message code used with dwThreadID and hwndWnd (e.g. WM_USER_xyz)
00238         unsigned int uiFlag;    // specifies the use of the union (e.g. FEUSB_WND_HWND)
00239         void* pAny;                             // pointer to anything, which is reflected as the first parameter of cbFct2
00240                                                         // in the callback function (e.g. can be used to pass the object pointer)
00241 
00242         union
00243         {
00244 #if defined(_MSC_VER) || defined(__BORLANDC__)
00245                 DWORD   dwThreadID;                             // for thread-ID
00246                 HWND    hwndWnd;                                // for window-handle
00247 #endif
00248                 void    (FEUSB_CALL* cbFct)(int, unsigned int);                 // for 1st callback-function
00249                 void    (FEUSB_CALL* cbFct2)(void*, int, unsigned int); // for 2nd callback-function
00250 #ifdef __cplusplus
00251         };
00252 #else
00253         }Method;
00254 #endif
00255 
00256 } FEUSB_EVENT_INIT;
00257 
00258 
00259 // structure for scan with search options
00260 typedef struct _FEUSB_SCANSEARCH
00261 {
00262         int             iMask;
00263         char    cFamilyName[25];
00264         char    cDeviceName[25];
00265         char    cInterface[25];
00266         char    cDeviceID[16];
00267 
00268 } FEUSB_SCANSEARCH;
00269         
00270 
00271 
00272 // #####################################################
00273 // FEUSB functions
00274 // #####################################################
00275 
00276 // miscellaneous functions
00277 void DLL_EXT_FUNC FEUSB_GetDLLVersion(char* cVersion);
00278 int  DLL_EXT_FUNC FEUSB_GetDrvVersion(char* cVersion);
00279 int  DLL_EXT_FUNC FEUSB_GetErrorText(int iError, char* cText);
00280 int      DLL_EXT_FUNC FEUSB_GetLastError(int iDevHnd, int* iErrorCode, char* cErrorText);
00281 
00282 // function for scan-list
00283 int  DLL_EXT_FUNC FEUSB_Scan(int iScanOpt, FEUSB_SCANSEARCH* pSearchOpt);
00284 int  DLL_EXT_FUNC FEUSB_ScanAndOpen(int iScanOpt, FEUSB_SCANSEARCH* pSearchOpt);
00285 int  DLL_EXT_FUNC FEUSB_GetScanListPara(int iIndex, char* cParaID, char* cValue);
00286 int  DLL_EXT_FUNC FEUSB_GetScanListSize();
00287 void DLL_EXT_FUNC FEUSB_ClearScanList();
00288 
00289 // functions for event notification
00290 int  DLL_EXT_FUNC FEUSB_AddEventHandler(int iDevHnd, FEUSB_EVENT_INIT* pInit);
00291 int  DLL_EXT_FUNC FEUSB_DelEventHandler(int iDevHnd, FEUSB_EVENT_INIT* pInit);
00292 
00293 // device functions
00294 int  DLL_EXT_FUNC FEUSB_OpenDevice(long nDeviceID);
00295 int  DLL_EXT_FUNC FEUSB_CloseDevice(int iDevHnd);
00296 int  DLL_EXT_FUNC FEUSB_IsDevicePresent(int iDevHnd);
00297 int  DLL_EXT_FUNC FEUSB_GetDeviceList(int iDevHnd);   // FindFirstOrNextDeviceHandle
00298 int  DLL_EXT_FUNC FEUSB_GetDevicePara(int iDevHnd, char* cPara, char* cValue);
00299 int  DLL_EXT_FUNC FEUSB_SetDevicePara(int iDevHnd, char* cPara, char* cValue);
00300 int  DLL_EXT_FUNC FEUSB_GetDeviceHnd(long nDeviceID);
00301 
00302 // communication function
00303 int  DLL_EXT_FUNC FEUSB_Transceive(int iDevHnd, char* cInterface, int iDir, unsigned char* cSendData, int iSendLen, unsigned char* cRecData, int iRecLen);
00304 int  DLL_EXT_FUNC FEUSB_Transmit(int iDevHnd, char* cInterface, unsigned char* cSendData, int iSendLen);
00305 int  DLL_EXT_FUNC FEUSB_Receive(int iDevHnd, char* cInterface, unsigned char* cRecData, int iRecLen);
00306 
00307 
00308 #undef DLL_EXT_FUNC
00309 
00310 #ifdef __cplusplus
00311 }
00312 #endif
00313 
00314 
00315 // #####################################################
00316 // typedefs of DLL-functions for explicite loading
00317 // #####################################################
00318 
00319 // miscellaneous functions
00320 typedef void (CALLBACK* LPFN_FEUSB_GET_DLL_VERSION)(char*);
00321 typedef int  (CALLBACK* LPFN_FEUSB_GET_DRV_VERSION)(char*);
00322 typedef int  (CALLBACK* LPFN_FEUSB_GET_ERROR_TEXT)(int, char*);
00323 typedef int  (CALLBACK* LPFN_FEUSB_GET_LAST_ERROR)(int, int*, char*);
00324 
00325 // function for scan-list
00326 typedef int  (CALLBACK* LPFN_FEUSB_SCAN)(int, FEUSB_SCANSEARCH*);
00327 typedef int  (CALLBACK* LPFN_FEUSB_SCAN_AND_OPEN)(int, FEUSB_SCANSEARCH*);
00328 typedef int  (CALLBACK* LPFN_FEUSB_GET_SCAN_LIST_PARA)(int, char*, char*);
00329 typedef int  (CALLBACK* LPFN_FEUSB_GET_SCAN_LIST_SIZE)();
00330 typedef void (CALLBACK* LPFN_FEUSB_CLEAR_SCAN_LIST)();
00331 
00332 // functions for event notification
00333 typedef int  (CALLBACK* LPFN_FEUSB_ADD_EVENT_HANDLER)(int, FEUSB_EVENT_INIT*);
00334 typedef int  (CALLBACK* LPFN_FEUSB_DEL_EVENT_HANDLER)(int, FEUSB_EVENT_INIT*);
00335 
00336 // device functions
00337 typedef int  (CALLBACK* LPFN_FEUSB_OPEN_DEVICE)(long);
00338 typedef int  (CALLBACK* LPFN_FEUSB_CLOSE_DEVICE)(int);
00339 typedef int  (CALLBACK* LPFN_FEUSB_IS_DEVICE_PRESENT)(int);
00340 typedef int  (CALLBACK* LPFN_FEUSB_GET_DEVICE_LIST)(int);
00341 typedef int  (CALLBACK* LPFN_FEUSB_GET_DEVICE_PARA)(int, char*, char*);
00342 typedef int  (CALLBACK* LPFN_FEUSB_SET_DEVICE_PARA)(int, char*, char*);
00343 typedef int  (CALLBACK* LPFN_FEUSB_GET_DEVICE_HND)(long);
00344 
00345 // communication function
00346 typedef int (CALLBACK* LPFN_FEUSB_TRANSCEIVE)(int, char*, int, unsigned char*, int, unsigned char*, int);
00347 typedef int (CALLBACK* LPFN_FEUSB_TRANSMIT)(int, char*, unsigned char*, int);
00348 typedef int (CALLBACK* LPFN_FEUSB_RECEIVE)(int, char*, unsigned char*, int);
00349 
00350 #endif // _FEUSB_INCLUDE_H


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