fecom.h
Go to the documentation of this file.
00001 /*-------------------------------------------------------
00002 |                                                       |
00003 |                       fecom.h                         |
00004 |                                                       |
00005 ---------------------------------------------------------
00006 
00007 Copyright (C) 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 
00018 Version                 :       Windows:                03.02.04 / 28.10.2014 / M. Hultsch
00019 Version                 :       Linux:                  03.01.00 / 27.06.2012 / M. Hultsch
00020 Version                 :       Windows CE:             03.00.00 / 21.07.2011 / M. Hultsch
00021 
00022 Operation Systems       :       Windows XP / Vista / 7 / 8
00023                                                 Windows CE
00024                                                 Linux
00025                                                 Mac OS X V10.7.3 or higher
00026                                                 Android
00027 
00028 
00029 This file contains the constants, datatypes and function declartions of FECOM library
00030 */
00031 
00032 #ifndef _FECOM_INCLUDE_H
00033 #define _FECOM_INCLUDE_H
00034 
00035 
00036 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_CVI_)
00037         #ifdef FECOMDLL
00038                 #define DLL_EXT_FUNC __declspec(dllexport) __stdcall
00039         #else
00040                 #define DLL_EXT_FUNC __declspec(dllimport) __stdcall
00041         #endif
00042 
00043         #ifndef CALLBACK
00044                 #define CALLBACK __stdcall
00045         #endif
00046         #define FECOM_EXT_CALL __stdcall
00047         #define FECOM_CALL __cdecl
00048 #else
00049         #define DLL_EXT_FUNC
00050         #define CALLBACK
00051         #define FECOM_EXT_CALL
00052         #define FECOM_CALL
00053 #endif
00054 
00055 
00056 // type defines
00057 #ifdef __GNUC__
00058         #ifndef __int64
00059                 #define __int64 long long
00060         #endif
00061 #endif
00062 
00063 #ifdef __cplusplus
00064 extern "C" {
00065 #endif
00066 
00067 
00068 
00069 
00070 // #####################################################
00071 // FECOM constants
00072 // #####################################################
00073 
00074 // FECOM error codes
00075 
00076 // common errors
00077 #define FECOM_ERR_NEWPORT_FAILURE                       -1000
00078 #define FECOM_ERR_EMPTY_LIST                            -1001
00079 #define FECOM_ERR_POINTER_IS_NULL                       -1002
00080 #define FECOM_ERR_NO_MEMORY                                     -1003
00081 #define FECOM_ERR_UNSUPPORTED_HARDWARE          -1004
00082 #define FECOM_ERR_PORT_NOT_FOUND                        -1005
00083 #define FECOM_ERR_UNSUPPORTED                           -1006
00084 
00085 // error while open the port
00086 #define FECOM_ERR_NO_PORT                                       -1010
00087 #define FECOM_ERR_NO_CONNECT                            -1011
00088 #define FECOM_ERR_LINK_ID                                       -1012
00089 #define FECOM_ERR_PORT_IS_OPEN                          -1013
00090 
00091 // handle errors
00092 #define FECOM_ERR_UNKNOWN_HND                           -1020
00093 #define FECOM_ERR_HND_IS_NULL                           -1021
00094 #define FECOM_ERR_HND_IS_NEGATIVE                       -1022
00095 #define FECOM_ERR_NO_HND_FOUND                          -1023
00096 
00097 // communication errors
00098 #define FECOM_ERR_TIMEOUT                                       -1030
00099 #define FECOM_ERR_NO_SENDPROTOCOL                       -1031
00100 #define FECOM_ERR_RECEIVE_PROCESS                       -1032
00101 #define FECOM_ERR_INIT_COMM_PROCESS                     -1033
00102 #define FECOM_ERR_FLUSH_INPUT_BUFFER            -1034
00103 #define FECOM_ERR_FLUSH_OUTPUT_BUFFER           -1035
00104 #define FECOM_ERR_CHANGE_PORT_PARA                      -1036
00105 #define FECOM_ERR_TRANSMIT_PROCESS                      -1037
00106 #define FECOM_ERR_RECEIVE_NOISE_DATA            -1038
00107 #define FECOM_ERR_PORT_IS_BUSY                          -1039
00108 #define FECOM_ERR_READ_PORT_PARA            -1040
00109 
00110 // parameter errors
00111 #define FECOM_ERR_UNKNOWN_PARAMETER                     -1050
00112 #define FECOM_ERR_PARAMETER_OUT_OF_RANGE        -1051
00113 #define FECOM_ERR_ODD_PARAMETERSTRING           -1052
00114 #define FECOM_ERR_PORTNR_OUT_OF_RANGE           -1053
00115 #define FECOM_ERR_UNKNOWN_ERRORCODE                     -1054
00116 
00117 // receive buffer overflow
00118 #define FECOM_ERR_OVL_RECBUF                            -1070
00119 
00120 
00121 
00122 // constants for dynamic load of library
00123 
00124 // miscellaneous functions
00125 #define FECOM_GET_DLL_VERSION                   1000
00126 #define FECOM_GET_ERROR_TEXT                    1001
00127 #define FECOM_GET_LAST_ERROR                    1002
00128 #define FECOM_DETECT_PORT                               1003
00129 
00130 // functions for event notification
00131 #define FECOM_ADD_EVENT_HANDLER                 1010
00132 #define FECOM_DEL_EVENT_HANDLER                 1011
00133 
00134 // port functions
00135 #define FECOM_OPEN_PORT                                 1020
00136 #define FECOM_CLOSE_PORT                                1021
00137 #define FECOM_GET_PORT_LIST                             1022
00138 #define FECOM_GET_PORT_PARA                             1023
00139 #define FECOM_SET_PORT_PARA                             1024
00140 #define FECOM_DO_PORT_CMD                               1025
00141 #define FECOM_GET_PORT_HND                              1026
00142 
00143 // communication function
00144 #define FECOM_TRANSCEIVE                                1030
00145 #define FECOM_TRANSMIT                                  1031
00146 #define FECOM_RECEIVE                                   1032
00147 
00148 
00149 
00150 // constants for structure _FECOM_EVENT_INIT
00151 
00152 // defines for uiFlag in FECOM_EVENT_INIT
00153 #define FECOM_THREAD_ID         1
00154 #define FECOM_WND_HWND          2
00155 #define FECOM_CALLBACK          3
00156 #define FECOM_EVENT                     4
00157 
00158 // defines for uiUse in FECOM_EVENT_INIT
00159 #define FECOM_CTS_EVENT                          1
00160 #define FECOM_DCD_EVENT                          2
00161 #define FECOM_DSR_EVENT                          3
00162 #define FECOM_RTS_EVENT                          4
00163 #define FECOM_DTR_EVENT                          5
00164 
00165 #define FECOM_PORT_CLOSED_EVENT         20      // only for Windows CE (customized versions)
00166 #define FECOM_PORT_REOPEN_EVENT         21      // only for Windows CE (customized versions)
00167 
00168 
00169 
00170 // #####################################################
00171 // FECOM structures
00172 // #####################################################
00173 
00174 // structure for transfering thread-IDs, message-handles or callbacks
00175 typedef struct _FECOM_EVENT_INIT
00176 {
00177         unsigned int uiUse;             // defines the event (e.g. FECOM_CTS_EVENT)
00178         unsigned int uiMsg;             // message code used with dwThreadID and hwndWnd (e.g. WM_USER_xyz)
00179         unsigned int uiFlag;    // specifies the use of the union (e.g. FECOM_WND_HWND)
00180         union
00181         {
00182 #if defined(_MSC_VER) || defined(__BORLANDC__)
00183                 DWORD   dwThreadID;                     // for thread-ID
00184                 HWND    hwndWnd;                        // for window-handle
00185                 HANDLE  hEvent;                         // for event-handle
00186 #endif
00187                 void    (FECOM_CALL* cbFct)(int, int);  // for callback-function
00188 #ifdef __cplusplus
00189         };
00190 #else
00191         }Method;
00192 #endif
00193 
00194 } FECOM_EVENT_INIT;
00195 
00196 
00197 
00198 // #####################################################
00199 // FECOM functions
00200 // #####################################################
00201 
00202 // miscellaneous functions
00203 void DLL_EXT_FUNC FECOM_GetDLLVersion( char* cVersion );
00204 int  DLL_EXT_FUNC FECOM_GetErrorText( int iErrorCode, char* cErrorText );
00205 int  DLL_EXT_FUNC FECOM_GetLastError( int iPortHnd, int* iErrorCode, char* cErrorText );
00206 int  DLL_EXT_FUNC FECOM_DetectPort( int iPortNr );
00207 
00208 // functions for event notification
00209 int  DLL_EXT_FUNC FECOM_AddEventHandler(int iPortHnd, FECOM_EVENT_INIT* pInit);
00210 int  DLL_EXT_FUNC FECOM_DelEventHandler(int iPortHnd, FECOM_EVENT_INIT* pInit);
00211 
00212 // port functions
00213 int  DLL_EXT_FUNC FECOM_OpenPort( char* cPortNr );
00214 int  DLL_EXT_FUNC FECOM_ClosePort( int iPortHnd );
00215 int  DLL_EXT_FUNC FECOM_GetPortList( int iNext );
00216 int  DLL_EXT_FUNC FECOM_GetPortPara( int iPortHnd, char* cPara, char* cValue );
00217 int  DLL_EXT_FUNC FECOM_SetPortPara( int iPortHnd, char* cPara, char* cValue );
00218 int  DLL_EXT_FUNC FECOM_DoPortCmd( int iPortHnd, char* cCmd, char* cValue );
00219 int  DLL_EXT_FUNC FECOM_GetPortHnd( char* cPortNr );
00220 
00221 // communication function
00222 int  DLL_EXT_FUNC FECOM_Transceive( int iPortHnd, unsigned char* cSendProt, int iSendLen, unsigned char* cRecProt, int iRecLen );
00223 int  DLL_EXT_FUNC FECOM_Transmit( int iPortHnd, unsigned char* cSendProt, int iSendLen );
00224 int  DLL_EXT_FUNC FECOM_Receive( int iPortHnd, unsigned char* cRecProt, int iRecLen );
00225 
00226 
00227 #undef DLL_EXT_FUNC
00228 
00229 #ifdef __cplusplus
00230 }
00231 #endif
00232 
00233 
00234 // #####################################################
00235 // typedefs of library functions for explicite loading
00236 // #####################################################
00237 
00238 // miscellaneous functions
00239 typedef void (CALLBACK* LPFN_FECOM_GET_DLL_VERSION)(char*);
00240 typedef int  (CALLBACK* LPFN_FECOM_GET_ERROR_TEXT)(int, char*);
00241 typedef int  (CALLBACK* LPFN_FECOM_GET_LAST_ERROR)(int, int*, char*);
00242 typedef int  (CALLBACK* LPFN_FECOM_DETECT_PORT)(int);
00243 
00244 // functions for event notification
00245 typedef int  (CALLBACK* LPFN_FECOM_ADD_EVENT_HANDLER)(int, FECOM_EVENT_INIT*);
00246 typedef int  (CALLBACK* LPFN_FECOM_DEL_EVENT_HANDLER)(int, FECOM_EVENT_INIT*);
00247 
00248 // port functions
00249 typedef int  (CALLBACK* LPFN_FECOM_OPEN_PORT)(char*);
00250 typedef int  (CALLBACK* LPFN_FECOM_CLOSE_PORT)(int);
00251 typedef int  (CALLBACK* LPFN_FECOM_GET_PORT_LIST)(int);
00252 typedef int  (CALLBACK* LPFN_FECOM_GET_PORT_PARA)(int, char*, char*);
00253 typedef int  (CALLBACK* LPFN_FECOM_SET_PORT_PARA)(int, char*, char*);
00254 typedef int  (CALLBACK* LPFN_FECOM_DO_PORT_CMD)(int, char*, char*);
00255 typedef int  (CALLBACK* LPFN_FECOM_GET_PORT_HND)(char*);
00256 
00257 // communication function
00258 typedef int  (CALLBACK* LPFN_FECOM_TRANSCEIVE)(int, unsigned char*, int, unsigned char*, int);
00259 typedef int  (CALLBACK* LPFN_FECOM_TRANSMIT)(int, unsigned char*, int);
00260 typedef int  (CALLBACK* LPFN_FECOM_RECEIVE)(int, unsigned char*, int);
00261 
00262 #endif // _FECOM_INCLUDE_H


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