00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #if !defined(_FEDM_ISCREADER_MODULE_H_INCLUDED_)
00045 #define _FEDM_ISCREADER_MODULE_H_INCLUDED_
00046
00047
00048
00049 #include "FEDM_ISCReader.h"
00050 #include "../FEDM_XmlReaderCfgProfileModul.h"
00051
00052 class FEDM_ISOTabItem;
00053 class FedmIscTagHandler;
00054 class FedmIscMyAxxessReader;
00055
00056
00057
00058
00059
00060
00061
00062
00063 #define FEDM_TASKCB1 1
00064 #define FEDM_TASKCB2 2
00065 #define FEDM_TASKCB3 3
00066 #define FEDM_TASKCB_NET1 101 // not applicable
00067
00068
00069 #define FEDM_TASKID_FIRST_NEW_TAG 1
00070 #define FEDM_TASKID_EVERY_NEW_TAG 2
00071 #define FEDM_TASKID_NOTIFICATION 3
00072 #define FEDM_TASKID_QUEUE_RESPONSE 4 // not applicable
00073 #define FEDM_TASKID_APDU_RESPONSE 5 // not applicable
00074 #define FEDM_TASKID_SAM_RESPONSE 6 // not applicable
00075 #define FEDM_TASKID_MAX_EVENT 7 // not applicable
00076
00077
00078
00079
00080
00081
00082
00083
00084 typedef map<string, FedmIscTagHandler*> FEDM_ISC_TAG_LIST;
00085 typedef map<string, FedmIscTagHandler*>::iterator FEDM_ISC_TAG_LIST_ITOR;
00086
00087
00088
00089 typedef struct _FEDM_TASK_INIT
00090 {
00091 unsigned int uiUse;
00092 unsigned int uiFlag;
00093 void* pAny;
00094
00095 int iConnectByHost;
00096 char cIPAdr[16];
00097 int iPortNr;
00098 unsigned int uiTimeout;
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 bool bCryptoMode;
00110 unsigned int uiAuthentKeyLength;
00111 unsigned char ucAuthentKey[32];
00112
00113
00114 bool bKeepAlive;
00115 unsigned int uiKeepAliveIdleTime;
00116
00117 unsigned int uiKeepAliveProbeCount;
00118
00119
00120 unsigned int uiKeepAliveIntervalTime;
00121
00122
00123 union
00124 {
00125
00126 void (FEDM_CALL* cbFct1)(void* pAny, int iError, unsigned char ucCmd);
00127
00128 void (FEDM_CALL* cbFct2)(void* pAny, int iError, unsigned char ucCmd, char* cIPAdr, int iPortNr);
00129
00130
00131 #ifdef _FEDM_WINDOWS
00132
00133 void (CALLBACK* cbFctNET1)(int iError, unsigned char ucCmd);
00134 #endif
00135 };
00136
00137
00138 union
00139 {
00140 int iNotifyWithAck;
00141
00142 };
00143
00144 } FEDM_TASK_INIT;
00145
00146
00147
00148
00149
00150
00151
00152 class _FEDM_ISC_CORE_EXT_CLASS FEDM_ISCReaderModule : public FEDM_ISCReader
00153 {
00154 public:
00155
00156
00157 friend class FEDM_ISOTabItem;
00158 friend class FedmIscMyAxxessReader;
00159
00160 FEDM_ISCReaderModule();
00161 virtual ~FEDM_ISCReaderModule();
00162
00163
00164
00165 int ConnectCOMM(int iPortNr);
00166
00167
00168 int ConnectTCP(char* cHostAdr, int iPortNr);
00169
00170
00171 int ConnectUSB(unsigned long dwDeviceID);
00172
00173 int DisConnect();
00174 bool IsConnected();
00175 int GetTcpConnectionState();
00176
00177
00178 int ReaderAuthentication(unsigned char ucAuthentType, string sAuthentKey);
00179 int ReaderAuthentication(unsigned char ucAuthentType, unsigned int uiAuthentKeyLength, unsigned char* ucAuthentKey);
00180
00181
00182 #ifdef _FEDM_TAG_HANDLER
00183
00184 FEDM_ISC_TAG_LIST* TagInventory( bool bAll=true,
00185 unsigned char ucMode=0x00,
00186 unsigned char ucAntennas=1 );
00187
00188 FedmIscTagHandler* TagSelect( FedmIscTagHandler* pTagHandler,
00189 unsigned int uiTagDriver=0 );
00190
00191 FEDM_ISC_TAG_LIST* GetTagList();
00192 #ifdef _WIN32_WCE
00193 FedmIscTagHandler* GetTagHandler(char* sSnr);
00194 #else
00195 FedmIscTagHandler* GetTagHandler(string sSnr);
00196 #endif
00197 FedmIscTagHandler* CreateNonAddressedTagHandler(unsigned int uiTagHandlerType);
00198 FedmIscTagHandler* GetSelectedTagHandler();
00199 FedmIscTagHandler* Convert_EPC_C1_G2_TagHandler(FedmIscTagHandler* pTagHandler, unsigned char ucMfrCode, unsigned int uiTagHandlerType);
00200 #endif
00201
00202
00203 int StartAsyncTask(FEDM_TASK_INIT* pInit);
00204 int CancelAsyncTask();
00205 int TriggerAsyncTask();
00206
00207
00208 static void cbsTaskRsp1(void* pAny,
00209 int iReaderHnd,
00210 int iTaskID,
00211 int iError,
00212 unsigned char ucCmd,
00213 unsigned char* ucRspData,
00214 int iRspLen );
00215
00216 static void cbsTaskRsp2(void* pAny,
00217 int iReaderHnd,
00218 int iTaskID,
00219 int iError,
00220 unsigned char ucCmd,
00221 unsigned char* ucRspData,
00222 int iRspLen,
00223 char* cIPAdr,
00224 int iPortNr );
00225
00226
00227 int SetPortPara(char* cPara, char* cValue);
00228 int SetPortPara(char* cPara, int iValue);
00229
00230
00231 int GetPortPara(char* cPara, char* cValue);
00232 int GetPortPara(char* cPara, int* iValue);
00233
00234 int SetPortHnd(int iPortHnd);
00235
00236
00237 int ReadCompleteConfiguration(bool bEEPROM);
00238 int WriteCompleteConfiguration(bool bEEPROM);
00239 int ResetCompleteConfiguration(bool bEEPROM);
00240 int ApplyConfiguration(bool bEEPROM);
00241 unsigned char* GetModifiedCfgPageFlags();
00242
00243
00244 int SerializeProfile(bool bRead, char* sFileName);
00245
00246 int TransferXmlFileToReaderCfg(char* sFileName);
00247 int TransferReaderCfgToXmlFile(char* sFileName);
00248
00249
00250 int ReadSoftVersion(unsigned char* ucSWRev,
00251 unsigned char* ucDevRev,
00252 unsigned char* ucHWType,
00253 unsigned char* ucSWType,
00254 unsigned char* ucTrp);
00255
00256
00257 FEDM_ISC_READER_INFO* ReadReaderInfo(unsigned int uiProtocolFrame = FEDM_PRT_FRAME_STANDARD);
00258
00259
00260 FEDM_ISC_READER_DIAGNOSTIC* ReadReaderDiagnostic();
00261
00262
00263 protected:
00264 #ifdef _FEDM_TAG_HANDLER
00265 FedmIscTagHandler* TagSelect_CreateNewTagHandler(int iIdx, unsigned int uiTagDriver, FedmIscTagHandler* pTagHandler);
00266 #if !defined(_FEDM_NO_TAG_HANDLER_ISO14443)
00267 FedmIscTagHandler* TagSelect_EvaFormat1(int iIdx, FedmIscTagHandler* pTagHandler);
00268 FedmIscTagHandler* TagSelect_EvaFormat2(int iIdx, FedmIscTagHandler* pTagHandler);
00269 FedmIscTagHandler* TagSelect_EvaFormat3(int iIdx, FedmIscTagHandler* pTagHandler);
00270 #endif
00271 #endif
00272
00273
00274 virtual void cbNewTag( int iReaderHnd,
00275 int iTaskID,
00276 int iError,
00277 unsigned char* ucRspData,
00278 int iRspLen );
00279
00280
00281 virtual void cbNewNotify( int iReaderHnd,
00282 int iTaskID,
00283 int iError,
00284 unsigned char* ucRspData,
00285 int iRspLen,
00286 char* cIPAdr,
00287 int iPortNr );
00288
00289
00290 virtual void cbNewReaderDiagnostic( int iReaderHnd,
00291 int iTaskID,
00292 int iError,
00293 unsigned char* ucRspData,
00294 int iRspLen,
00295 char* cIPAdr,
00296 int iPortNr );
00297
00298 virtual void cbNewInputEvent( int iReaderHnd,
00299 int iTaskID,
00300 int iError,
00301 unsigned char* ucRspData,
00302 int iRspLen,
00303 char* cIPAdr,
00304 int iPortNr );
00305
00306
00307 virtual void cbNewNotifyFromPeopleCounter( int iReaderHnd,
00308 int iTaskID,
00309 int iError,
00310 unsigned char* ucRspData,
00311 int iRspLen,
00312 char* cIPAdr,
00313 int iPortNr );
00314
00315
00316 public:
00317 #ifdef _FEDM_XML_SUPPORT
00318 FEDM_XMLReaderCfgProfileModul m_ProfileModule;
00319 #endif
00320
00321 protected:
00322 int m_iCommMode;
00323
00324 bool m_bActiveAsyncTask;
00325
00326 FEDM_TASK_INIT m_TaskInit;
00327
00328 #ifdef _FEDM_TAG_HANDLER
00329 FEDM_ISC_TAG_LIST m_mapTagHandler;
00330 #endif
00331
00332 unsigned char m_ucModifiedCfgPages[16];
00333
00334 };
00335
00336 #endif // !defined(_FEDM_ISCREADER_MODULE_H_INCLUDED_)