Upload
others
View
8
Download
0
Embed Size (px)
Citation preview
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 1
classic-pro
Getting started
with
ID CPR.SDK.TCL.Win
for
OBID® classic-pro Reader
Dipl.-Ing. Markus HultschSenior Software Engineer OBID®
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 2
classic-pro Contents
• Overview over all Components
• Function Library FECOM (DLL)- Structure / Programming Interface / Code-Example
• Function Library FEISC (DLL)- Structure / Programming Interface / Code-Example
• Function Library FETCL (DLL)- Structure / Programming Interface / Code-Example
• C++ Class Library FEDM- Class-Structure-Diagram- Protocol-communication and Data-Container- Code-Examples
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 3
classic-pro
• Demo Program FETCLDemo
• Contents of the CD-ROM
Contents
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 4
classic-pro
With proven components faster to the destination
based on existing Know-How
Application- instead of hardware-vicinity
Your Profit
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 5
classic-pro
FECOM FEUSB
FEISC
FETCL
Windows-driver
DriverOBID.SYS
RS232 RS485 USB
Kernel-Level
Applications-Level
FEDM_Base
FEDM_ISCReader
FEDM_DataBase
C++ Class library FEDM
Function libraries (DLL)
1. Overview over all Components
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 6
classic-pro
Language-Support and Operating-Systems
Microsoft Visual C++Microsoft Visual BasicBorland C++ BuilderBorland Delphi
National Instruments LabWindows CVI, LabView
Windows 9x/ME/NT4/2000/XPWindows CE
1. Overview over all Components
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 7
classic-pro
Function-Library
FECOM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 8
classic-pro
FECOM = FEIG COMmunicationAdministration of several asynchronous serial portsOpening and closing of portsSetting of the Port-ParameterFunction-Interface to the High-Level-DLLs (e.g. FEISC.DLL)Event-Signalling to the applicationRequest of error messages
2. Function Library FECOM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 9
classic-pro
Structure
Objekt-Manager
FECOM_ClosePort
FECOM_GetPortList
FECOM_Transceive
FECOM_Transmit
FECOM_GetPortPara
FECOM_SetPortPara
FECOM.DLL
FECOM_OpenPort
FECOM_GetDLLVersion
FECOM_Receive
Port Object- PortHandle- Parameter COM 1
- List of PortHandle- Number of version
FECOM_AddEventHandler
FECOM_DelEventHandler
Port Object- PortHandle- Parameter
Port Object- PortHandle- Parameter COM n
COM 2FECOM_GetPortHnd
FECOM_GetErrorText
FECOM_GetLastError
FECOM_DoPortCmd
2. Function Library FECOM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 10
classic-pro
Functions
Functions for opening/closing/administration of the portint FECOM_OpenPort( char* cPortNr )int FECOM_ClosePort( int iPortHnd )int FECOM_GetPortList( int iNext )int FECOM_GetPortHnd( char* cPortNr )int FECOM_GetPortPara( int iPortHnd, char* cPara, char* cValue )Int FECOM_SetPortPara( int iPortHnd, char* cPara, char* cValue )int FECOM_DoPortCmd( int iPortHnd, char* cCmd, char* cValue )
Functions for the Event-Signallingint FECOM_AddEventHandler( int iPortHnd, FECOM_EVENT_INIT* pInit )int FECOM_DelEventHandler( int iPortHnd, FECOM_EVENT_INIT* pInit )
Functions for the communicationint FECOM_Transceive( int iPortHnd, UCHAR* cSendProt, int iSendLen, UCHAR* cRecProt, int iRecLen )int FECOM_Transmit( int iPortHnd, UCHAR* cSendProt, int iSendLen )int FECOM_Receive( int iPortHnd, UCHAR* cRecProt, int iRecLen )
General Query-Functionsvoid FECOM_GetDLLVersion( char* cVersion )int FECOM_GetErrorText( int iErrorCode, char* cErrorText )Int FECOM_GetLastError( int iPortHnd , int* iErrorCode, char* cErrorText )
2. Function Library FECOM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 11
classic-pro
Code-Example
Port openingOption Explicit
Public iPortHnd As Integer
Private Sub BtnOpenPort_Click()Dim cComNr As BytesPortNr = "1"
cComNr = Val(sPortNr) iPortHnd = FECOM_OpenPort(cComNr)
If iPortHnd <= 0 ThenMsgBox "Can't open the serial port“
End IfEnd Sub
Port closingOption Explicit
Public iPortHnd As Integer
Private Sub BtnClosePort_Click()Dim iBack As Integer
If iPortHnd > 0 TheniBack = FECOM_ClosePort(iPortHnd)
End IfEnd Sub
2. Function Library FECOM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 12
classic-pro
Code-Example
Parameterize of a portOption Explicit
Public iPortHnd As IntegerPublic sBaud As StringPublic sFrame As StringPublic sTimeout As String
Private Sub PortSetting()Dim iBack As Integer
sBaud = "38400"sFrame = "8E1"sTimeout = "600"
If iPortHnd > 0 TheniBack = FECOM_SetPortPara(iPortHnd, "Baud", sBaud)iBack = FECOM_SetPortPara(iPortHnd, "Frame", sFrame)iBack = FECOM_SetPortPara(iPortHnd, "Timeout", sTimeout)
End IfEnd Sub
2. Function Library FECOM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 13
classic-pro
Function-Library
FEISC
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 14
classic-pro
FEISC = FEIG i-scanConstruction and testing of the Protocol-FrameSupport of RS232, USB and TCP/IPOptimum adaptation to FECOM and FEUSB and FETCPAdministration of several Reader-ObjectsGenerating and deleting of Reader-ObjectsOne function for each i-scan®-ProtocolSetup of parametersEvent signalling to an applicationRequest of error messages
3. Function Library FEISC
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 15
classic-pro
Structure
Objekt-Manager
FEISC_DeleteReader
FEISC_GetReaderList
FEISC_BuildProtocol
FEISC_SplitProtocol
FEISC_GetReaderPara
FEISC_SetReaderPara
FEISC.DLL
FEISC_NewReader
FEISC_GetDLLVersion
FEISC_SendTransparent
Reader Object- ReaderHandle- PortHandle- Parameter
Port-Object
- List of ReaderHandle- Number of version
FEISC_GetLastSendProt
FEISC_GetLastRecProt
FEISC_0x01_MultiJobPoll
FEISC_0xB0_ISOCmd
FEISC_GetLastState
Reader Object- ReaderHandle- PortHandle- Parameter
Reader Object- ReaderHandle- PortHandle- Parameter
Port-Object
FECOM.DLL
Device-Object
FEUSB.DLL
RS232
RS485
USB
3. Function Library FEISC
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 16
classic-pro
Functions
Functions for opening/closing/administration of a reader objectint FEISC_NewReader( int iPortHnd )int FEISC_DeleteReader( int iReaderHnd )int FEISC_GetReaderList( int iNext )int FEISC_GetReaderPara( int iReaderHnd, char* cPara, char* cValue )int FEISC_SetReaderPara( int iReaderHnd, char* cPara, char* cValue )
Functions for the event-signalling (supports protocol windows)int FEISC_AddEventHandler( int iReaderHnd, FEISC_EVENT_INIT* pInit )int FEISC_DelEventHandler( int iReaderHnd, FEISC_EVENT_INIT* pInit )
General Query-Functionsvoid FEISC_GetDLLVersion( char* cVersion )int FEISC_GetErrorText( int iErrorCode, char* cErrorText )int FEISC_GetLastSendProt( int iReaderHnd, UCHAR* cSendProt, int iDataType )int FEISC_GetLastRecProt( int iReaderHnd, UCHAR* cRecProt, int iDataType )int FEISC_GetLastState( int iReaderHnd, char* cStatusText )int FEISC_GetLastRecProtLen( int iReaderHnd )int FEISC_GetLastError( int iReaderHnd , int* iErrorCode, char* cErrorText )
3. Function Library FEISC
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 17
classic-pro
Functions
Protocol-Functions (normally not used)int FEISC_BuildSendProtocol( int iReaderHnd, UCHAR cBusAdr, UCHAR cCmdByte, UCHAR* cSendData, intiDataLen, UCHAR* cSendProt, int iDataType )int FEISC_SplitRecProtocol( int iReaderHnd, UCHAR* cRecProt, int iRecLen, UCHAR* cBusAdr, UCHAR* cCmdByte,UCHAR* cData, int* iDataLen, int iDataType )
General Communication Functions (normally not used)int FEISC_SendTransparent( int iReaderHnd, UCHAR* cSendProt, int iSendLen, UCHAR* cRecProt, int iRecLen, intiCheckSum, int iDataType )int FEISC_Transmit( int iReaderHnd, UCHAR* cSendProt, int iSendLen, int iCheckSum, int iDataType )int FEISC_Receive( int iReaderHnd, UCHAR* cRecProt, int iRecLen, int iCheckSum, iDataType )
Special Communication Functionsint FEISC_0x21_ReadBuffer( int iReaderHnd, UCHAR cBusAdr, UCHAR cSets, UCHAR* cTrData, UCHAR* cRecSets,UCHAR* cRecDataSets, int iDataType )int FEISC_0x31_ReadDataBufferInfo( int iReaderHnd, UCHAR cBusAdr, UCHAR* cTabSize, UCHAR* cTabStart,UCHAR* cTabLen, int iDataType )int FEISC_0x32_ClearDataBuffer( int iReaderHnd, UCHAR cBusAdr )int FEISC_0x33_InitBuffer( int iReaderHnd, UCHAR cBusAdr )
3. Function Library FEISC
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 18
classic-pro
Functions
Special Communication Functions (continuation)int FEISC_0x52_GetBaud( int iReaderHnd, UCHAR cBusAdr )int FEISC_0x55_StartFlashLoader( int iReaderHnd )int FEISC_0x63_CPUReset( int iReaderHnd, UCHAR cBusAdr )int FEISC_0x65_SoftVersion( int iReaderHnd, UCHAR cBusAdr, UCHAR* cVersion, int iDataType )int FEISC_0x69_RFReset( int iReaderHnd, UCHAR cBusAdr )int FEISC_0x80_ReadConfBlock( int iReaderHnd, UCHAR cBusAdr, UCHAR cConfAdr, UCHAR* cConfBlock, intiDataType )int FEISC_0x81_WriteConfBlock( int iReaderHnd, UCHAR cBusAdr, UCHAR cConfAdr, UCHAR* cConfBlock, intiDataType )int FEISC_0x82_SaveConfBlock( int iReaderHnd, UCHAR cBusAdr, UCHAR cConfAdr )int FEISC_0x83_ResetConfBlock( int iReaderHnd, UCHAR cBusAdr, UCHAR cConfAdr )int FEISC_0xB0_ISOCmd( int iReaderHnd, UCHAR cBusAdr, UCHAR* cReqData, int iReqLen, UCHAR* cRspData, int*iRspLen, int iDataType )int FEISC_0xB2_ISOCmd( int iReaderHnd, UCHAR cBusAdr, UCHAR* cReqData, int iReqLen, UCHAR* cRspData, int*iRspLen, int iDataType )
3. Function Library FEISC
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 19
classic-pro
Code-Example
Construction of a Reader-ObjectOption Explicit
Public iReaderHnd As Integer
If iPortHnd > 0 TheniReaderHnd = FEISC_NewReader(iPortHnd)If iReaderHnd < 0 Then
MsgBox “Can‘t create new reader object“End If
Deletion of a Reader-ObjectOption Explicit
Public iReaderHnd As Integer
Dim iBack As Integer
If iReaderHnd > 0 TheniBack = FEISC_DeleteReader(iReaderHnd)
End If
3. Function Library FEISC
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 20
classic-pro
Code-Example
Read Software VersionOption Explicit
Public iReaderHnd As Integer
Private Sub BtnGetSoftVersion_Click()Dim iBack As IntegerDim sVersion As String * 15
If iReaderHnd > 0 TheniBack = FEISC_0x65_SoftVersion(iReaderHnd, 255, sVersion, 1)
End IfEnd Sub
3. Function Library FEISC
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 21
classic-pro
Parameter transfer
iDataType Parameter transfer interpreted as a pointer to
0 0x23, 0x56, 0xFA, 0xA6
(internally 0x23 corresponds to the character "#"; 0x56 to the character "V"; etc.)
an array of UCHAR
1 "2356FAA6" (each two characters are interpreted as a hex value: Example: "23" -> 0x23)
a null-terminated string
Some functions support parameter transfer both as a null-terminated string and as anarray of hex-numbers. Transfer as data-type UCHAR is possible for both data types.Interpretation of the transfer value is indicated by the function parameter iDataType.
3. Function Library FEISC
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 22
classic-pro
Function-Library
FETCL
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 23
classic-pro
FETCL = FEIG T=CLSynchronous or asynchronous handling of APDUsNeeds FEISC interfaceEvent signalling to an applicationRequest of error messages
4. Function Library FETCL
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 24
classic-pro
Structure
Objekt-Manager
FETCL_DeleteTransponder
FETCL_GetTransponderList
FETCL_Apdu
FETCL_Deselect
FETCL_GetErrorText
FETCL_GetLastError
FETCL.DLL
FETCL_NewTransponder
FETCL_GetDLLVersion
FETCL_GetResponseData
Transponder Object- TransponderHandle - ReaderHandle
Reader-Object
- List of TransponderHandle - Number of version
Transponder Object
Reader Object- TransponderHandle - ReaderHandle
Reader-Object
FEISC.DLL
Device-Object
FEUSB.DLL
RS232
RS485
USB
- TransponderHandle - ReaderHandle
Port-Object
FECOM.DLL
Port-Object
Reader-Object
4. Function Library FETCL
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 25
classic-pro
Functions
Functions for opening/closing/administration of a transponder objectint FETCL_NewTransponder( int iReaderHnd, UCHAR ucBusAdr,
UCHAR ucCid, UCHAR ucNad,bool bUseCid, bool bUseNad )
int FETCL_DeleteTransponder( int iTransponderHnd )int FETCL_GetTransponderList( int iNext )
General Query-Functionsvoid FETCL_GetDLLVersion( char* cVersion )int FETCL_GetErrorText( int iErrorCode, char* cErrorText )int FETCL_GetLastError( int* iErrorCode )
General Communication Functionsint FETCL_Apdu( int iTransponderHnd, UCHAR* ucData, int iDataLen, FETCL_EVENT_INIT* pInit )int FETCL_Deselect( int iTransponderHnd , FETCL_EVENT_INIT* pInit )int FETCL_GetResponseData( int iTransponderHnd, UCHAR* ucData, int iDataBufLen )
4. Function Library FETCL
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 26
classic-pro
Code-Example
Construction of a Transponder-ObjectOption Explicit
Public iTransponderHnd As Integer
If iReaderHnd > 0 TheniTransponderHnd = FETCL_NewTransponder(iReaderHnd, 255, 0, 0, False, False)If iTransponderHnd < 0 Then
MsgBox “Can‘t create new transponder object“End If
Deletion of a Transponder-ObjectOption Explicit
Public iTransponderHnd As Integer
Dim iBack As Integer
If iTransponderHnd > 0 TheniBack = FETCL_DeleteTransponder(iTransponderHnd)
End If
4. Function Library FETCL
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 27
classic-pro
Code-Example
APDU (non-blocking / synchron)Option Explicit
Public iReaderHnd As IntegerPublic iTransponderHnd As Integer
Private Sub BtnApdu_Click()Dim iBack As IntegerDim iApduLen As IntegerDim iApduRspLen As IntegerDim sApdu As String * 255Dim sApduRsp As String * 255
‘ APDU and iApduLen from e.g. input field
If iTransponderHnd > 0 TheniBack = FETCL_Apdu(iTransponderHnd, sApdu, iApduLen, vbNull)if iBack = 0 Then
iApduRspLen = FETCL_GetResponseData(iTransponderHnd, sApduRsp, 255)End If
End IfEnd Sub
4. Function Library FETCL
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 28
classic-pro
C++ Class Library
FEDM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 29
classic-pro
FEDM = FEIG Data ModuleThe Class-Library FEDM gives a solution for the problem:where can we store the protocol data in a structured form
Class-Library designed for every OBID-ReaderControlling of the protocol communicationControlling of the data flowIntegration of the Data-ContainersSeparation of the data flow and protocol controllingSimple function interfaceComplete error handlingRequest of error messagesXML File-I/O for reader configuration
5. C++ Class Library FEDM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 30
classic-pro
Class Structure Diagram
FEDM_Base
FEDM_RWReader FEDM_RWAReader FEDM_TRIReader FEDM_ISCReader
FEDM_DataBase
FEDM.h FEDM_Functions
FEDM_RWReaderID.h FEDM_RWAReaderID.h FEDM_TRIReaderID.h FEDM_ISCReaderID.h
Reader-Class
Parameter-ID
Basic-Class
Abstract Basic-Class
Help-FunktionsLibrary-Constants
FEDM_ISOTabItem
Help-Classes
FEDM_BRMTabItem
5. C++ Class Library FEDM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 31
classic-pro
Data flow in FEDM_ ISCReader
5. C++ Class Library FEDM
Reader Class (e.g. FEDM_ISCReader)
SendProtocol
GetData
Function Library (e.g.FEISC)
Serialize
SetData
EEData
GetTableData SetTableData
TmpData ISOTable
SetBusAddress
SetPortHnd
SetReaderHnd
FindTableIndex
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 32
classic-pro
Data-Container: general
Data-container : 11 specialized Data-Container and three tables (only i-scan®)-Data-Container are public, tables are protectedfor classic-pro: only three data containers and one table are used
Protocol data are exchanging exclusive with the Data-ContainerParameters in the Data-Container are identified by access constants for classic-pro: every access constant is defined in FEDM_ISCReaderID.h
Data transfer from/to the Data-Container with an Index or overloadedfunctionsSetData(), GetData(), SetTableData(), GetTableData()
Overloaded functions uses always access constantsXML File-I/Oone serialize-function for the reader configuration
5. C++ Class Library FEDM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 33
classic-pro
Data-Container: overview
Data-Containerare public Byte-Arrays ( typedef vector<UCHAR> FEDM_BYTE_ARRAY; )organised to blocks of 32, 16 bytes or 4 bytes
Memory used Reader-family Organisation
EEData EEPROM-Configuration of the reader RW - RWA - ISC 16 ByteRAMData RAM-Configuration of the reader ISC 16 ByteSN_Mem Serial-Number of the transponder RW - RWA – ISC.M01 16 ByteID_Mem ID-Number of the transponder RW - RWA – ISC.M01 16 BytePubMem Transponder-Data RW - RWA – ISC.M01 4 ByteConfMem Transponder-config-data RW - RWA – ISC.M01 4 ByteAC_Mem Account of the transponder RWA 16 ByteTmpData temporary data for the protocol comunic. RW - RWA - ISC 32 ByteMjpData temporary data for the multijob-poll RW - RWA - ISC 16 Byte
5. C++ Class Library FEDM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 34
classic-pro
Data-Container: data access
Example
UCHAR ucBusAdr = 0;int iErr = GetData(FEDM_ISC_EE_COM_BUSADR, &ucBusAdr); // ucBusAdr 0x00..0xFF
UCHAR ucBusAdr = 0;int iErr = GetData(FEDM_ISC_EE_COM_BUSADR, &ucBusAdr, 1); // dito
UINT uiBusAdr = 0;int iErr = GetData(FEDM_ISC_EE_COM_BUSADR, &uiBusAdr); // uiBusAdr 0..255
__int64 i64BusAdr = 0;int iErr = GetData(FEDM_ISC_EE_COM_BUSADR, &i64BusAdr); // i64BusAdr 0..255
CString sBusAdr;int iErr = GetData(FEDM_ISC_EE_COM_BUSADR, sBusAdr); // sBusAdr „00“..“FF“
string sBusAdr;int iErr = GetData(FEDM_ISC_EE_COM_BUSADR, sBusAdr); // dito
5. C++ Class Library FEDM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 35
classic-pro
The access constant is a string MM BN BY NB BI Nb
#define FEDM_ISC_EE_COM_BUSADR “03 00 00 01 00 00“
MM memory type (s. FEDM.h) 0..99BL block number 0..99BY 1. byte in a block 0..99NB number of bytes 0..99BI 1. bit in a byte 0..08Nb number of bits 0..99
Data-Container: access constant
component namereader type
memory typeparameter name
5. C++ Class Library FEDM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 36
classic-pro
Data-Container: table
ISOTabItemFEDM_ISOTabItem is a classManages only data of several transponders (no parameters of a reader)Is protected in FEDM_ISCReaderTable is organised as a STL-Vector
Each table element FEDM_ISOTabItem collects data of one transponderOverloaded functions permit the (indirect) access to the table with the member functionsSetTableData() and GetTableData() of FEDM_ISCReader
A table element contains his own container for transponder-dataVariable Data block size consider future developmentsISO: only [0xB0][0x01] Inventory adds new entries with each new serial-numbertherefore: deleting of the table with ResetTable() is explicit necessary (e.g. after [0x69]RFReset)
Support of all address modes
5. C++ Class Library FEDM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 37
classic-pro
Data-Container: table elements
Table elementsMemory Used Organisation
Serial-number ISO15693/14443 1 x 32 ByteTransponder type ISO15693/14443 1 ByteData blocks (send) ISO15693/14443 variable block size (max. 256 x 32 Byte)Data blocks (receive) ISO15693/14443 variable block size (max. 256 x 32 Byte)DSFID ISO15693 1 ByteAFI ISO15693 1 ByteTransponder Info ISO14443A 1 ByteProto Info ISO14443B 1 ByteBlock Security Status ISO15693 1 ByteMemory Size ISO15693 1 x 2 ByteIC Reference ISO15693 1 ByteFSCI, FWI, DSI, DRI, NAD, CID ISO14443 each 1 Byte
5. C++ Class Library FEDM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 38
classic-pro
Protocol traffic
SendProtocol( UCHAR ucCmdByte ) is the only one communication functionentire error handling
Connection to FEISC.DLL with Reader-HandleSetReaderHnd() and GetReaderHnd()
Connection to FECOM.DLL with PortHandle of FEISC.DLLSetPortHnd() and GetPortHnd()
Setting of the bus-addressSetBusAddress() and GetBusAddress()
5. C++ Class Library FEDM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 39
classic-pro
Code example: initialisingchar cErrorText[256];FEDM_ISCReader m_Reader; // Reader-Modul
// get new reader object in FEISC.DLL; set port handle 0int iReaderHnd = FEISC_NewReader(0);if(iReaderHnd < 0){
m_Reader.GetErrorText(cErrorText, iReaderHnd);AfxMessageBox(cErrorText);return;
}
// set reader handle into m_Readerm_Reader.SetReaderHnd(iReaderHnd);
// Open Port in FECOM.DLLInt iPortHnd = FECOM_OpenPort(cPortNr);if(iPortHnd < 0) //Open_Port_Error
return;
// set port handle into m_Readerm_Reader.SetPortHnd(iPortHnd);
// set once the size of the iso table; set to max. tags in fieldint iError = FEDM_SetTableSize(100);
5. C++ Class Library FEDM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 40
classic-pro
Code example: inventory
m_Reader.SetData(FEDM_ISC_TMP_B0_CMD, (UCHAR)0x01); // Cmd Inventorym_Reader.SetData(FEDM_ISC_TMP_B0_MODE, (UCHAR)0x00); // no MORE flag
int iStatus = m_Reader.SendProtocol(0x69); // Execute RF_Resetbool bMore = true;m_Reader.ResetTable(); // delete all entries in iso-tablewhile(bMore){
iStatus = m_Reader.SendProtocol(0xB0); // Execute inventory commandif (iStatus == 0x94) // more data{
m_Reader.SetData(FEDM_ISC_TMP_B0_MODE_MORE, TRUE);bMore = true;
}else{
m_Reader.SetData(FEDM_ISC_TMP_B0_MODE_MORE, FALSE);bMore = false;if( iStatus == 0x00 || iStatus == 0x83 || iStatus == 0x84 || iStatus ==0x90 ||
iStatus == 0x93 || iStatus == 0x94 || iStatus == 0x95 )::PostMessage(hwnd, WM_NEW_DATA, iStatus, (LPARAM)bMore);
else::PostMessage(hwnd, WM_ERROR, iStatus, 0);
}}
5. C++ Class Library FEDM
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 41
classic-pro
APDU-List
Log-Window• send and receive protocols• send and receive APDUs
6. C++ Demoprogram FETCLDemo
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 42
classic-pro
Content of the CD-ROM
Documentation of the readers and antennasNewest Reader-FirmwareDemoprogram ISOStartGolden Reader ToolID ISC.SDK.HF.WinContains libraries FECOM, FETCP, FEUSB, FEISC, FEDMDemo Projects with source-code for- Visual C++ 6, Visual Basic 6, Delphi 5
ID CPR.SDK.TCL.Win Contains libraries FECOM, FETCP, FEUSB, FEISC, FETCL, FEDMFETCLSample Project with source-code for Visual C++ 6
OBID®
RFID by FEIG ELECTRONIC 21.02.2006 43
classic-pro
End