FONGWAH E7 User manual

1
E7 Secret Key IC card Reader
User Manual
SHENZHEN FONGWAH TECHNOLOGY CO.,LTD
Address:The 3rd floor , Dakan industrial Road 1 14A# , Xili Town,
Nanshan District , Shenzhen, Guangdong , China .
Zip Code:518000
Tel:(086-755) 26923337
Fax:(086-755) 26922227
E-mail:market@fongwah.com
URL:http://www.fongwah.com

2
Contents
E7 Secret Key IC card Reader............................................................................... 1
User Manual..................................................................................................................1
E7 IC Card Reader Introduction................................................................................4
1.1 Overview........................................................................................................................... 4
1.2 Features.............................................................................................................................4
1.3 Device Interface................................................................................................................4
1.4 Peader Packing List......................................................................................................... 6
1.5 Software............................................................................................................................ 6
1.6 Reader Type Description................................................................................................. 7
1.7 Function Instruction........................................................................................................ 7
1.8 API Function List................................................................................................................8
Common Functions.....................................................................................................8
Device Function.......................................................................................................... 8
Keyboard Specific Functions......................................................................................9
S50 card functions.......................................................................................................9
S70 card specific function.........................................................................................10
Ultralight card specific function............................................................................... 10
Ultralight-C card specific function........................................................................... 10
Mifare pro card specific function..............................................................................11
Mifare PLUS card specific function......................................................................... 11
Contactless CPU card(ISO14443) specific function................................................ 11
Desfire card specific function...................................................................................12
CPU(SAM) card specific functions..........................................................................13
4442 card-specific functions.....................................................................................13
4428 Card-Specific Functions.................................................................................. 13
1.9 Error codes and Meanings............................................................................................ 14
2. API Function........................................................................................................15
2.1 Common Functions......................................................................................................15
2.2 Device Functions............................................................................................................ 17
2.3 Keyboard Special Functions......................................................................................... 20
2.4 S50(M1)Functions.....................................................................................................21
2.5 S70 card specific function..............................................................................................30
2.6 Ultralight card specific function...................................................................................31
2.7 Ultralight-Ccard specific function................................................................................33
2.8 Mifare Pro card specific function.................................................................................34
2.9 Contactless CPU card(ISO1443) specific functions................................................... 35
2.10 Desfirecard specific function..........................................................................................36
2.11 Mifare Plus card specific function..............................................................................50
2.12 CPU(SAM)Functions............................................................................................. 56
2.13 SLE4442 special Functions......................................................................................... 59
2.14 SLE4428 special Functions......................................................................................... 61
3.MIFARE ONE Card Structure...........................................................................64

4
E7 IC Card Reader Introduction
1.1 Overview
E7 password keyboard is the smart IC Card Reader,meet ISO14443A and ISO 7816 standard,
support contactless IC card,such as Mifare s50、s70、Utrlight and CPU card,and contact CPU
card. E7 smart IC Reader contains LCD display(2 rows)and simple keyboard,,that meet the
demand of entering the password or consumption data and displaying the results in the processing
of user’s operation. And E7 smart IC Reader supports USB interface that meets HID protocol.
In order to improve safety factor, users can configurate a standard SAM card that meets ISO
7816-3 and GSM11.11 protocol in the device.
Cards supported:
PHILIPS Company:MF1ICS50、FM1108、MF1ICS70、contactless CPU card\contact CPU card.
E7 IC card reader widely used in financial payment 、E-commere payment system 、One-Card
consume system and supply chain management.
1.2 Features
Support Protocol:ISO14443 A/ ISO7816
Recognition Distance:0-50mm
Physical Interface:USB or Serial port
Communication Rate:9600bps~115200bps
Operating System:Windows 98 、Me 、2K 、XP 、2003、Vista 及Linux
LED Display:128*64 dot matrix display LCD screen (can display two lines in both Chinese and
English)
Working Frequency:13.56MHZ
Working Voltage:DC5V ± 10%
Data Storage Capacity:the standard configuration of storage is 2K bytes in the reader (can expand
according to user’s demand)
Status Display:LED light,indicate power or communication status,user can control buzzer
Dimensions:Length×Width×Hight:155*100*80 mm
Weight:about 322g
1.3 Device Interface
Rs232 or USB E7
Built-in antenna
DC5V Power
RS232 Serial interface or USB used for communication with PC .
RF Card

5

6
1.4 Peader Packing List
Contains:Reader,Communication cable and Warranty Card
1.5 Software
Contains:Demo Program,Lib of Function and Application Examples
a. Demo Program
E7.exe

7
b. Lib of Function
E7umf.dll
c. Application Examples
There are some examples supported for various of development platform(such as VC,Java
etc) under the directory of SDK.
1.6 Reader Type Description
1.7 Function Instruction
Function call should follow the following rules:
(1)Call function fw_init() first to initial Serial Interface or USB interface.
(2)Call function fw_load_key() to load key from card to Reader, a section once.
(3)Call funtion fw_card() (equivalent to continuous calls fw_request (), fw_anticoll (), fw_select ()
3 functions) to get card serial number.
(4)Call function fw_authentication () to verify keys of Device and Card, once a section.
(5)You can read, write, initialize value, add value, and subtract value to the sections ONLY after

8
verifying the password. Each time you do these operations of card, you should repeat the stpes
(3), (4) .
(6)Afer operation with certain card,the function fw_halt() should be called to abort operation.
(7)Before exit program,the function fw_exit had better be called to close communication port.
(8)Please refer to the examples under SDK directory to develop your program.
1.8 API Function List
Common Functions
Function Name
Description
fw_init
Initialize the communication port
fw_exit
Close the port
fw_des
Encrypt/Decrypt
fw_config_card
Set operation-card type
a_hex
Convert hex string to the corresponding characters of ordinary ASC
hex_a
Convert ordinary ASC to the corresponding hex string
Device Function
Function Name
Description
fw_beep
Make beep
fw_getver
Get the version of Reader
fw_GetDevSN
Get serial number of device
fw_GetDeviceMemSize
Get size of device’s eeprom
fw_srd_eeprom
Read EEPROM
fw_swr_eeprom
Write EEPROM
fw_reset
Reset card
fw_lcd_setbright
LCD light on&off
fw_lcd_dispstr
LCD display string

9
fw_lcd_dispstr_ex
LCD display string (extension function)
fw_lcd_dispclear
LCD
Keyboard Specific Functions
Function Name
Description
fw_PassIn
Enter the status of getting keyboard password ,only to receive
fw_PassGet and fw_PassCancel command after that
fw_PassGet
Inquiry and get input passwoard
fw_PassCancel
Cancel the status of getting keyboard password,the device return to
normal state after that
fw_CheckKeyValue
Inquiry the key value
S50 card functions
Function Name
Description
fw_init
Initialize the communication port
fw_exit
Close the port
fw_card
Find card
fw_card_hex
Find card
fw_card_str
Find card
fw_request
Find card request
fw_anticoll
Anti-collision
fw_select
Select a card
fw_load_key
Load password of sectors
fw_authentication
Verify sector’s password
fw_read
Read card(for M1 and S70 card)
fw_write
Write card(for M1 and S70 card)
fw_halt
Stop the operation for card
fw_changeb3
Change sector password(for M1 and S70 card)

10
fw_initval
Initialize the value of block
fw_increment
Do increment
fw_decrement
Do decrement
fw_readval
Read value
fw_restore
Store the data from the EEPROM to card’s internal register
fw_transfer
Transfer the data from card to EEPROM
S70 card specific function
Function Name
Description
fw_read_S70
Read S70 card
fw_write_S70
Write S70 card
Ultralight card specific function
Function Name
Description
fw_request_ultralt
Request of Finding Ultralight card
fw_anticall_ultralt
Anti-collision Ultralight card
fw_select_ultralt
Select Ultralight card
fw_read_ultralt
Read Ultralight card
fw_write_ultralt
Write Ultralight card
fw_halt_ultralt
Abort the operation with Ultralight card
Ultralight-C card specific function
Function Name
Description
fw_ultralt_C_authen
Verify the password of Utralight-C card
fw_ultralt_C_changePwd
Update the password of Utralight-C card
fw_ultralt_C_setSafePage
Set the secure page
fw_ultralt_C_lockPage
Lock page

11
Mifare pro card specific function
Function Name
Description
fw_reset_mifarepro
Reset Mifare Pro card
fw_apdu_mifarepro
Information transfer between Mifare Pro card and APDU
Mifare PLUS card specific function
Function Name
Description
fw_MFPlusL0_WritePerso
Personalized setting
fw_MFPlusL0_CommitPerso
Submit personalized setting,then upgrade to level 1
fw_MFPlusL1_AuthenKeyL1
Verify the secret key of the level 1
fw_MFPlusL1_SwitchToL2
Upgrade to level 2 from level 1
fw_MFPlusL1_SwitchToL3
Upgrade to level 3 from level 1
fw_MFPlusL2_SwitchToL3
Upgrade to level 3 from level 2
fw_MFPlusL3_AuthenL3Key
Verify the secret key of the level 3
fw_MFPlusL3_UpdateKey
Update the secret key of the level 3
fw_MFPlusL3_AuthenSectorKey
Verify the secter’s secret key of the level 3
fw_MFPlusL3_ReadWithPlain
Read in clear text in the third level
fw_MFPlusL3_WriteWithPlain
Write in clear text in the third level
fw_MFPlusL3_ReadWithEncrypt
Read in encryption mode in the third level
fw_MFPlusL3_WriteWithEncrypt
Write in encryption mode in the third level
fw_MFPlusL3_InitVal
Intialize a block to value block in the third level
fw_MFPlusL3_ReadVal
Read the value of a value block in the third level
fw_MFPlusL3_Increment
Increment the value of a value block in the third level
fw_MFPlusL3_Decrement
Decrement the value of a value block in the third level
Contactless CPU card(ISO14443) specific function
Function Name
Description
fw_pro_reset
Power-on reset

12
fw_pro_commandlink
Information exchange function
Desfire card specific function
Function Name
Description
fw_anticoll2
The second anti-collision
fw_select2
The second finding card
fw_reset_desfire
Reset card
fw_authen_desfire
Verify secret key
fw_getver_desfire
Get the related data of the card
fw_getAIDs_desfire
Get application identifier
fw_selectApp_desfire
Select application
fw_getKeySetting_desfire
Get the setting information of the master secret key
fw_getKeyver_desfire
Get the version message of the master secret key
fw_createApp_desfire
Creat application
fw_delAID_desfire
Delete application
fw_changeKeySetting_desfire
Change the setting information of the master secret key
fw_changeKey_desfire
Modify the secret key
fw_getFileIDs_desfire
Get file identifier
fw_getFileProper
Get file properties
fw_changeFileSetting
Change file properties
fw_createDataFile_desfire
Creat a standard data file
fw_createValueFile_desfire
Creat value file
fw_createCsyRecord_desfire
Creat cycle record file
fw_delFile_desfire
Delect file
fw_write_desfire
Write data file
fw_read_desfire
Read record file
fw_getvalue_desfire
Read value file
fw_credit_desfire
Increment

13
fw_debit_desfire
Decrement
fw_writeRecord_desfire
Write record
fw_readRecord_desfire
Read record
fw_clearRecord_desfire
Clear record
fw_commitTransfer_desfire
Commit data transmission
fw_abortTransfer_desfire
Abort data transmission
fw_formatPICC_desfire
Format card
CPU(SAM) card specific functions
Function Name
Description
fw_cpureset
Power-on reset
fw_setcpu
Set SAM card or CPU card slots for operation
fw_cpuapdu
Information transfer between CPU and APDU
4442 card-specific functions
Function name
Description
fw_authentikey_4442
Authenticate key of 4442 card
fw_read_4442
Read data from 4442 card
fw_write_4442
Write data from 4442 card
fw_getProtectData_4442
Get protected data
fw_setProtectData_4442
Set protected data
fw_changkey_4442
Change key of 4442 card
fw_cntReadError_4442
Get the count of read-error
4428 Card-Specific Functions
Function Name
Description
fw_authentikey_4428
Authenticate key of 4428 card
fw_read_4428
Read data from 4428 card
fw_write_4428
Write data from 4428 card

14
fw_getProtectData_4428
Get protected data
fw_setProtectData_4428
Set protected data
fw_changkey_4428
Change key of 4428 card
fw_cntReadError_4428
Read counts of Error-Code
1.9 Error codes and Meanings
Error Return Values
Positive/Negative
Meanings
0x20(032)
+
Communication handler error
0x72(114)
+
Don’t support this function
0x7D(125)
+
Parameter invalid
0x95(149)
+
Port is occupied
0x8F(143)
+
Data length error
0x51(081)
+
CPU data XOR error
0x73(115)
+
Get the virsion number error
0xc2(194)
+
CPU card response error
0xd3(211)
+
CPU card response timeout
0xd6(214)
+
CPU card verification error
0xd7(215)
+
CPU card command returns error
0x01(001)
-
No card or certificate error
0x02(002)
-
Data verification error
0x03(003)
-
Value is null error
0x04(004)
-
Authentication failed
0x05(005)
-
Parity error
0x06(006)
-
Communication between Reader and card error
0x08(008)
-
Read card serial number error
0x09(009)
-
Password type error
0x0a(010)
-
Card has not been certified
0x0b(011)
-
Read operating bits error
0x0c(012)
-
Read operating bytes error
0x0f(015)
-
Write card failed
0x10(016)
-
Increment operation failed
0x11(017)
-
Decrement operation failed
0x12(018)
-
Read card error
0x13(019)
-
Transmission buffer overflow
0x15(021)
-
Transmission frame error
0x17(023)
-
Unknown transmission needs
0x18(024)
-
Anti-collosion error
0x19(025)
-
Sensor module reset error
0x1a(026)
-
Non-certified interface

15
0x1b(027)
-
Module communication timeout
0x3c(060)
-
Non-normal operation
0x64(100)
-
Wrong data
0x7c(124)
-
Parameter error
2. API Function
2.1 Common Functions
int fw_init(int port,long baud);
Description:
Initialize the communication port.
Parameters:
port:COM Type.Serial port 1~100 when set value 0~99. USB port when set value
100(baud rate invalid in this case).
baud:Baud rate(value:9600~115200)
Return:
Return the value of serial port identifier If successful;
Return -1 if unsuccessful
Example:
int icdev,commdev;
icdev=fw_init(100,0);// initialize USB interface
commdev=fw_init(0,9600);// initial serial interface, Baud rate:9600
Remark:
If there are more than one Reader connected to the computer,call this function
can get their handle each.Next is an example:
int icdev1,icdev2,icdev3;/* presume there are three readers connected */
icdev1=fw_init(100,0);/* get the first device handle */
icdev2=fw_init(100,1); /* get the second device handle */
icdev3=fw_init(100,2); /* get the third device handle */
int fw_exit(int icdev);
Description
Close the communication port.
Parameters
icdev:Value of Device Handle.
Return Value
0 if successful; otherwise, Nonzero.
Example
fw_exit(icdev);
Remark
In WIN32 environment, Icdev is the handle of device; It must be released before
next linking.

16
__int16 fw_config_card(HANDLE icdev,unsigned char flags);
Description
Configure the card type.
Parameters
icdev:Value of Device Handle.
flags:Card type for operation(0x41=TYPEA,0x42=TYPEB,0x31=ISO15693)
Return Value
0 if successful; otherwise, Nonzero.
Example
int st;
st=fw_config_card(icdev,1);
__int16 a_hex(unsigned char *a,unsigned char *hex,__int16 len)
Description
String conversion function, hexadecimal characters convert into ordinary
characters (long to short).
Parameters
a : Converted characters
hex: the characters to be converted
len:the length of character a
Return Value
0 if successful; otherwise, Nonzero.
Example
int st;
Unsigned char hexbuf[8]={‘3’,’1’,’6’,’1’,’4’,’d’};
Unsigned char abuf[4];
st=a_hex(abuf,hexbuf,3);/* abuf =”1aM” */
void hex_a(unsigned char *hex,unsigned char *a,__int16 len)
Description
String conversion function, ordinary characters convert into hexadecimal
characters (short to long ).
Parameters
hex : Converted characters
a : the characters to be converted
len:the length of character hex
Return Value
0 if successful; otherwise, Nonzero.
Example
unsigned char hexbuf[8]={0};
unsigned char abuf[4]= {‘1’,’a’,’M’};;
hex_a(hexbuf, abuf ,6);/* abuf =”31614d” */

17
int fw_des(unsigned char *key,unsigned char *sour,unsigned char *dest,__int16 m)
Description
Encrypt or Decrypt with DES algorithm
Parameters
key:secret key
sour:source of data for encrypt/decrypt
dest:out data after encrypt/decrypt
m:model of encrypt/decrypt,encrypt when m=1;decrypt when m=0
Return Value
0 if successful; otherwise, Nonzero.
Example:
unsigned char szKey[17]=”1122334455667788”;
unsigned char szSour[17]=”99AABBCCDDEEFF00”;
unsigned char szDest[17];
st=fw_des(szKey,szSour,szDest,1);// Encrypt
printf(“The result of encrypt:%s”,szDest);
memset(szSour,0,sizeof(szSour));//Clear szSour,and use it to store the
result of decrypt
st = fw_des(szKey,szDest,szSour,0);//Decrypt
printf(“The result of decrypt:%s”,szSour);
Remark
The three parameters ,key,sour,dest,are all a string,the length of which is
16.and the character of the string are hex model.
2.2 Device Functions
int fw_beep(int icdev,unsigned int _Msec);
Description
Make beep
Parameters
icdev:Value of Device Handle.
unsigned int _Msec:Time of beep,(ms)
Return Value
0 if successful; otherwise, Nonzero.
Example
int st;
st=fw_beep(icdev,10); /*beep 100 ms*/
int fw_getver(int icdev,unsinged char *buff);
Description
Get version of device
Parameters
icdev:Value of Device Handle.
buff:[out]buff for version number

18
Return Value
0 if successful; otherwise, Nonzero.
Example
unsigned char buff[512];
fw_getver(icdev,buff);
int fw_GetDevSN(int icdev,unsinged char *bufSN, int* snSize);
Description
Get serial number of device
Parameters
icdev:Value of Device Handle.
buff:[out]string of serial number(end with ’\0’)
snSize:[out] string length
Return Value
0 if successful; otherwise, errorCode.
Example
unsigned char devSN[512];
int snLen;
fw_GetDevSN(icdev,devSN, &snLen);
int fw_GetDeviceMemSize(int icdev,unsinged int* size);
Description
Get size of device’s eeprom
Parameters
icdev:Value of Device Handle.
snSize:[out] size of eeprom (bytes)
Return Value
0 if successful; otherwise, errorCode.
Example
unsigned int memSize;
fw_GetDeviceMemSize(icdev,&memSize);
int fw_srd_eeprom(int icdev,int offset,int length,unsigned char *rec_buffer);
Description
Get remark information of Reader
Parameters
icdev:Value of Device Handle.
offset:Offset address(0~1278)
length:Length of information to read(1~1279)
rec_buffer:[out] gotten Data
Return Value
0 if successful; otherwise, Nonzero.
Example
int st;

19
unsigned char buffer[100];
st=fw_srd_eeprom(icdev,0,100,buffer);
int fw_swr_eeprom(int icdev,int offset,int length,unsigned char* buffer);
Description
Write remark information to Reader
Parameters
icdev:Value of Device Handle.
offset:Offset address(0~1278)
length:Length of information to write(1~1279)
buffer:Information to write
Return Value
0 if successful; otherwise, Nonzero.
__int16 fw_reset(HANDLE icdev,unsigned __int16 _Msec)
Description
Reset the MCM(MIFARE read/write device core module)
Parameters
Icdev :Handle of Device
_Msec : Reset time, unit is Millionseconds (this value is 0 means off
frequency, 1,2 means reset time is ... 1 ms, 2 ms ...
Return Value
<0 error. The absolute value is the error number
=0 sucessful.
Example
st=fw_reset(icdev,2)
int fw_lcd_setbright(int icdev,unsigned char bright)
Description
Set LCD backlight on or off
Parameters
icdev:Value of Device Handle.
bright:sign of LCD light on or off .15—light on,0--off
Return Value
0 if successful; otherwise, Nonzero.
Example
st= fw_lcd_setbright(icdev,15);//light LCD
int fw_lcd_dispstr(int icdev,char *str)
Description
Set LCD display string
Parameters
icdev:Value of Device Handle.
str :the string to display
Return Value
0 if successful; otherwise, Nonzero.

20
Example
char* sendchs=”abcdefgh”;
st=fw_lcd_dispstr(icdev,sendchs); //display abcdefgh
int fw_lcd_dispstr_ex(int icdev,wchar_t *str,int line, int offset, int len, int
flag)
Description
Set LCD display string
Parameters
icdev:Value of Device Handle.
str :The string to display
line: 1 or 2, show at line 1 or 2
offset: Value from 0 to 8
len: Size of string to show(in bytes)
flag: 0, show as bytes; 1, show as wide char
Return Value
0 if successful; otherwise, Nonzero.
Example
wchar_t sendchs[]=L”abcdefgh”;
st=fw_lcd_dispstr_ex(icdev,sendchs,2,2,7,1);
int fw_lcd_dispclear(int icdev)
Description
Clear the display string of LCD
Parameters
icdev:Value of Device Handle.
Return Value
0 if successful; otherwise, Nonzero.
Example
st= fw_lcd_dispclear (icdev);
2.3 Keyboard Special Functions
__int16 fw_PassIn(Int icdev,unsigned char ctime);
Description:
Enter the status of getting keyboard key,only to receive fw_PassGet and
fw_PassCancelcommand after that.
Parameters:
icdev :Value of device handle
ctime :the overtime time of input keys,unit is second;the maximum is 255s,
the minimum is 1s
Return:
0 if successful;otherwise Nonzero
__int16 fw_PassGet(Int icdev,unsigned char *rlen,unsigned char * cpass);
Description:
Table of contents
Popular Card Reader manuals by other brands

Hama
Hama All in One 00091093 Operating instruction

Magtek
Magtek EXPRESSCARD 1000 Maintenance Guide

Code
Code Code Reader CR3500 quick start guide

Atech Flash Technology
Atech Flash Technology XM-35U user manual

tecan
tecan INFINITE M1000 PRO Instructions for use

Scosche
Scosche memoREAD USBCR quick start guide