You are on page 1of 38

Reference Manual

T6 & Falchion Dragon Series

Smart Card Readers


Contents
1.Readers Introduction:
Summarize-----------------------------------------------------------------------------------
Introduction Light---------------------------------------------------------------------------
Technical Data of Reader-------------------------------------------------------------------

2.Driver Installation:
3.Lib Function Introduction:
Driver Contents------------------------------------------------------------------------------
Function Using Formula--------------------------------------------------------------------
Windows 16/32 bit DLL--------------------------------------------------------------------
Card Type Code------------------------------------------------------------------------------
Function Error Code Introduction---------------------------------------------------------

4. Common Using Card Specification:


1.Readers Introduction:
Summarize

T600 serial contact -type smart card readers have T600S , T600 ,
T600W and T600U ; Falchion Dragon series include T2,T4,T6 & T8 T600S
is built-in, bunches of communication, adopt and push and pull out, push two kinds of
card seats, utilize and supply power within the computer; T600 adopts and pushes
the pulling out type card seat for the putting type outside, bunches of communication,
the power adopts the keyboard mouth to fetch the electricity; T600W adopts and
pushes pulling out type , pushing type or the playing type card stand by oneself,
bunches of communication, utilize AC220V to supply power; T600U utilizes
deposition electricity of USB at the same time in order to adopt USB interface to
carry on reading the writing device of communication. It all have a SAM card that
T600 series & Falchion dragon series read the card writing device (except T600U),
can realize the safe hairpin and meet demands of safe field . The T600 series &
Falchion dragon series are read & write device to develop the relevant products of
smart card and indispensable front-end processing equipment of system integration, it
is abundant , perfect interface function, smart cards , such as can apply to the industry
and commerce conveniently, telecommunication , postal service , tax , bank ,
insurance , medical treatment and various kinds of charging , stored value ,
inquiring ,etc. are managed in the application system.

Introduction Light
The red light will be on if plug in
The green light will be on to indicate the insert of card, and blink when communicate.

Please pay attention to the following points while using the example:

1: Passwords of the logic encrypt cards are different because of the difference of card
encapsulation manufacturer, so before using, please consult the card factory or the
Chip manufacturer confirm the information, or consult us in case of the damage of the
card.

2: During operation, Reader may not be connected correctly because of the disaccord
of the interface. So please use the demo provided by our company to check whether
the reader is connected well. Please remember the port you connect if the connection
is correct in case that you have more problems when debuging the procedure .

3: Be clear of the type of your card on hand. If you are unclear, please use the
demonstration or ask the relevant personnel for help.
Declare: The card type that the Demonstration test are just for reference.It can't be
regarded as the last basis of the type of the card that confirmed.Please ask the factory
of card and manufacturer of chip to comfirm the type of the card.
Function operation rules
(1) First transfer the initialize function IC _ InitComm (Port ), Port means the port
that to open, 0 means serial port1, 2 means the serial port 2,the same consequence
as that 20 means serial port 19,if Port is equaled 100, means the USB interface.
(2) Function IC _ Status (HANDLE icdev ) can obtain the current status of the
device (have cards or have no card), it’ s suggested that use this function after the
success of the initialize function IC _ InitComm (Port ),the parameter of icdev is
the value that IC_InitComm returns,namely the identifier of the device of one port.
(3) Under the serial port communication way , while transferring WINDOWS
16/ 32 bit dynamic Lib or Unix / Linux function lib, should carry out
IC_ExitComm() function before the procedure withdraws, then close serial port,
release serial port of the equipments; Otherwise it makes mistakes when initialize
serial port again.
(4) The function transfers the error type, please go to the function error type code
for reference. All error codes of function will return with the negative form; except
the Foxpro for Dos
(5) The position of the Lib state database should be in the declared corresponding
catalogue or the default catalogue, otherwise there will be the mistake that can't
find the dynamic state database.
(6)When using the Function of HEX(namely the transferring of IC_XXXHEX
similarity),the character string that send into or read out are used by the character
string(HEX) ,the transferring way of other parameters are the same ,so we don’ t list
it any more in the detailed function specifation.
Note:The capitalization and the minuscule of the function’ s name must be
distinguished strictly, otherwise, they can’ t be transferred.
Attention: Detailed operation method of function, Please refer to the example of
T600 or T6.

Application card CPU card ( IS07816 ,T=0 or T=1 protocol)


(ATMEL)AT24C01A 24C16 1604 (ISSI/ATMEL)
AT24C64 AT88SC101/2 AT45D041 AT88SC153 AT88SC1608
SSF1101(TAIWAN SyncMos)
(SIEMENS)4442/4432 4428/4418 4404 4406
Card, compatible with the above card, produced by IC card
manufacturer in and outside China
Application function interface:

WINDOWS3X 16bit DLL develop platform, such as Visual Basic 6.0, Delphi 5.0
Power Builder,6.0 Visual FoxPro, Visual C++, C++ Builder.
WINDOWS9X/2K/NT/XP 32bit DLL develop platform, such as VB, PB, Foxpro,
Visual C++, C++ Builder
SCO UNIX & LINUX System
Communication interface: RS232,Baud rate: 9600bit/s, stable and reliable。
Technical data of reader:
Communication interface:RS232 or USB(for low speed 1.1)
Baud rate: 9600-115200BPS
Power supply: Set-in DC5V±10%;Set-out: AC220V±10%

Power consumption :100mw max


Environmental requirement: 0-50℃/

Relative Humidity :30%- 95%


Exterior Dimension:

Floopy reader(T600S) : 125mmx101mmx25mm(LengthWidthHeight);

T600: 115mmx82mmx90mm
T600W: 160mmx120x110
T600P:64mmx75mmx17mm
T2:88mmx30mmx13mm
T4:85mmx75mmx26mm
T6:71mmx88mmx122mm

2.Driver Installation:
Before using the reader needed to install drivers, you could find drivers software in
the additional CD-disc. The detail install step as following:
A. open your operating system
B. insert CD-ROM to CD drive
C. run the installed software(T600.EXE or T6.EXE)
D. insert the reader into USB port of PC, the system will find the U-disc
automatically.
E. For PC/SC driver, you must click SETUP to finish the process. then insert the
reader and open the system again.

3.Lib Function Introduction:

1)Common functions

1 IC_Status Reader current status


2 IC_Down Power off the card
3 IC_InitComn Open interface
4 IC_ExitComn Close interface
5 IC_InitType Set card type
6 IC_Read Read IC card
7 IC_Write Write IC card
8 IC_Erase Erase IC card and write FF
9 IC_Read_Float Read IC card by float
10 IC_Write_Float Write IC card by float
11 IC_Encrypt DES encrypt function
12 IC_Decrypt DES decrypt function
13 IC_Read_Int Read integer function
14 IC_Write_Int Write integer function
15 IC_Checkcard test card type automatically
16 IC_DevBeep beep of the reader
17 IC_ReadVer read hardware version of the device
18 IC_ReadDevice read note information of the reader
19 IC_WriteDevice write information into the note area of the card
20 IC_InitCommAdanced Initialize the port of the device.(high speed)
21 Asc2hex transform function of the character string(short to long)
22 Hex2asc transform function of the character string(long to short)
23 IC_SetCommTimeout set serial port delay of time
24 IC_SetUsbTimeout set usb delay of time

2)4432/4442 card special functions


1 IC_ReadProtection Read 4432/4442 protection bit
2 IC_WriteProtection Write 4432/4442 protection bit
3 IC_ReadCount_SLE4442 Read4442 error counter
4 IC_CheckPass_SLE4442 Check4442 password
5 IC_ChangePass_SLE4442 Change4442 password
6 IC_Check_4442 check whether the 4442 card is insert in the Reader
7 IC_ReadPass_SLE4442 read 4442 card’s password
3)4418/4428 functions
1 IC_ReadWithProtection Read 4418/4428 with protection bit
2 IC_WriteWithProtection Write 4418/4428 with protection bit
3 IC_ReadCount_SLE4428 Read 4428 error counter
4 IC_CheckPass_SLE4428 Check 4428 password
5 IC_ChangePass_SLE4428 Change 4428 password with protection bit
6 IC_Check_4428 check whether the 4428 card is insert in the Reader
4)101/102/103 functions
1 IC_CheckPass_102 Check 101/102/103 system password
2 IC_ChangePass_102 Change 101/102/103 password
3 IC_ReadCount_102 Read 101/102/103 error
4 IC_Erase_102 Erase 101/102/103
5 IC_CheckAZPass_102 Check 102 application code
6 IC_ChangeAZPass_102 Change 102 application code
7 IC_fuse_102 102 fuse broken
8. IC_Check_102 check whether the102 card is insert in the Reader
5)4406 Public telephone IC card functions
1 IC_Rvalue Read 4406 value
2 IC_DEValue Decrease 4406 value
3 IC_CheckPass_4406 Check password
4 IC_Earse_4406 Erase
5 IC_Check_4406 check whether the4406 card is insert in the Reader

6)1604/1604B functions
1 IC_CheckPass_1604 Check1604 system password
2 IC_ChangePass_1604 Change 1604 password
3 IC_ReadCount_1604 Read 1604 error counter
4 IC_Fuse_1604 1604 fuse broken
5 IC_Check_1604 check whether the 1604 card is insert in the Reader

7)24C series non-encrypt card special functions


1 IC_Write24 24C01A/02/04/08/16 write function
2 IC_Check_24C check whether the 24C card is insert in the Reader

8)24C64 Special functions


1 IC_Write64 24C64 write function
2 IC_Check_24C64 check whether the 24C64 card is insert in the Reader

9)45DB041 Special functions


1. IC_DirectRead Direct read
2. IC_DirectWrite Direct write
3. IC_Check_45DB041 check whether the 45D041 card is insert in the Reader

10) CPU card function


1. IC_CpuReset Card reset function
2. IC_CpuApdu (APDU)Message Exchange Function,
this function has sealed T=0&T=1 operation
3. IC_CpuApduSource (APDU)Message Exchange Function,The user
needs to judge the type of the protocol and organized the data transmission voluntarily
4. IC_CpuGetProtocol get card protocol type
5. IC_CpuSetProtocol Set card protocol type, not suggest to use
6. IC_Check_CPU check whether the CPU card is inserted in the reader
7. IC_SetCpuPara Set CPU card Parameter
8. IC_CpuApduExt (APDU) Message Exchange Function,
this function has sealed T=0&T=1 operation
9. IC_CpuApduSourcExt (APDU) Message Exchange Function, The user nee
ds to judge the type of the protocol and organized the data transmission volunt
arily
10. IC_CpuColdReset CPU Card Power on and reset function (cold rese
t)
11. IC_CpuHotReset CPU Card Power on and reset function (hot reset)

11)1608/153 card function


1. IC_SetUserZone Set user zone
2. IC_ReadUserZone Read user zone
3. IC_ReadCinfigZone Read control zone
4. IC_WriteUserZone Write user zone
5. IC_WriteConfigZone Write control zone
6. IC_ReadFuse Read fuse status
7. IC_WriteFuse Write fuse
8. IC_CheckRPassword Check read password
9. IC_CheckWPassword Check write password
10. IC_ChangeRPassword Change read password
11. IC_ChangeWPassword Change write password
12. IC_ReadRPasswordCount Read read password counter
13. IC_ReadWPasswordCount Read write password counter
14. IC_ReadAuthCount Read authentication error counter
15. IC_InitAuth Initial authentication
16. IC_CheckAuth Card authentication
17. SetInit host authentication initialize
18. Authenticate host authentication card
19. IC_Check_1608 check whether the1608 card is inserted in the Reader

<1>Common Function
1.__int16 IC_Status(HANDLE ICDev)
Description : Return to the current connecting status of readers and test if it is
connected or the card is inserted; for the USB readers, this function rises at the same
time when the electricity is up, it is necessary before you operate the card.
Parameter:
HANDLE ICDev –the communication identifier that IC_InitComm returns
Return: <0 reader communication error, please see the error code
=0 communication correct, the card has already inserted
=1 communication correct, no card has inserted
Example :
St=IC_Status(ICDev)

2.__int16 IC_Down(HANDLE ICDev)


Description: Power down the electricity of the card. For the logic encryption card, the
password must be rechecked and then it will be effective .That is, if you want to write
the card ,you must recheck the password
Parameter:
HANDLE ICDev - the communication identifier that IC_InitComm returns
Return:<0 error. Its absolute value is the error code, you can look up the error code in
the Error Code Table.
=0 correct
Example:
St=IC_Down(ICDev)
Attention: For all logic encryption cards, the checking is effective at all times if you
haven't powered down the electricity of the card or you haven't pulled out the card
from the reader after the password is checked correctly.

3.HANDLE IC_InitComm(__int16 Port)


Description: Initialize the port of the device.The computer must has the definite
communication format if it will communicate with the reader.This function initialize
the port of the computer and make the communication between the computer and the
reader conveniently. This function is the first step to operate the reader.
Parameter:
Port -0,1,2 and 3 mean serial port 1,2,3,4
- Be equal to 100 means the port that is connected is an USB port
Return:<0 error the initialization is failed ,so you can't do the operation afterwards.
>=0 the initialization is successful,and returns to the identifier of the port.
Example:
ICDev= the InitComm(0) opens the serial 1

4.__int16 ExitComm(HANDLE ICDev)


Description : Close the serial port. In the system of Windows,there is only one device
can use the same port at the same time.So ,when you exit the system,please close the
port in order that other devices can use it.
Parameter:
HANDLE ICDev - the communication identifier that IC_InitComm returns
Return:<0 the port hasn’ t normally closed, so you may close the system to close the
port
>=0 the port is normally closed
Example:
ExitComm(ICDev) Close the port that ICDev specifies

5.__int16 IC_InitType (HANDLE ICDev,__int16 TypeNo)


Description: Before carrying on the operation to the IC card, please tell the reader
what card you will operate at first.So we use this function to set the type of the card
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
__int16 TypeNo - The card type number, please refer to card type code
Return:<0 error.Its absolute value is the error number
=0 operation correctly
Example:
IC_InitType(HANDLE ICDev,0x20)
Set the card type as ATMEL102 type

6.__int16 IC_Read (HANDLE ICDev,__int16 Offset,__int16 len, unsigned char


* DataBuffer)
Description: This function is used to read data inside the IC card. That is, read data
inside the card according to the parameter of offset and length
Parameters:
HANDLE ICDev- the communication identifier that IC_InitComm returns
__int16 Offset- the start address of the IC card that to read
__int16 Len –the length of the data
unsigned char * Databuffer- stores the data that read from the card
Return:<0 error.Its absolute value is the error code.
=0 correct
Example:
IC_Read(ICDev,16,64,DataBuffer)
Read data from 16 to 64 to DataBuffer.
Related Function:
__int16 __stdcall IC_Read_Hex(HANDLE idComDev,__int16 offset,__int16
len,unsigned char * databuffer)

7.__ the int16 IC_Write( the HANDLE ICDev,__ the int16 Offset,__ int16 len,
unsigned char* DataBuffer)
Description:Write data into the IC card .
Parameters:
HANDLE ICDev –the communication identifier that IC_InitComm returns
__int16 Offset - the start address of the IC card that to write
__int16 length - The length of the data
unsigned char * Databuffer- stores the data that’ s about to write into the card
Return:<0 error.Its absolute value is the error code
=0 correct
Example:
IC_Write(ICDev,32,14,"IcCard Message")
Write "IC Card Message" into data area which begins at address 32
Related Function:
__int16 __stdcall IC_Write_Hex(HANDLE idComDev,__int16 offset,__int16
len,unsigned char * writebuffer)

8.__ the int16 IC_Erase( the HANDLE ICDev,__ the int16 Offset,__ int16 len)
Description: erase data, that’
s write Hex FF , decimalist 255.
Parameters:
HANDLE ICDev- the communication identifier that IC_InitComm returns
__int16 Offset –the start address that erased
__int16 len –erase byte number
Return:<0 error.Its absolute value is the error code
>=0 the length of data that write into
Example:
St=IC_Erase(ICDev,24,32)
Erase 32 bytes from the beginning of absolutely offset address 24

9.__ the int16 IC_Read_Float( the HANDLE ICDev,__ the int16 Offset, float&
fdata)
Description: Read a float data, and return to fdata. Each float data needs 4 bytes in the
card.
Parameters:
HANDLE ICDev- the communication identifier that IC_InitComm returns
__int16 Offset - The start address that to read
float& fdata - Return to address that stores the float data.
Return:<0 error .Its absolute value is the error code.
=0 correct
Example:
St=IC_Read_Float(ICDev,24,&fdata)
Read a float data from the beginning of absolutely offset address 24

10.__ the int16 IC_Write_Float( the HANDLE ICDev,__ int16 Offset,float fdata)
Description: Write a float data into the card. Each float data needs 4 bytes in the card.
Parameters:
HANDLE ICDev- the communication identifier that IC_InitComm returns
__int16 Offset - The start address that to write
float fdata –the float data that to write
Return:<0 error. Its absolute value is error code
=0 correct
Example:
St=IC_Write_Float(ICDev,24,45.67)
Write a float data from the beginning of absolutely offset address 24.

11.__ the int16 IC_Encrypt( char* key, char* ptrsource, unsigned__ the int16
msglen, char* ptrdest)
Description: The encrypt function of DES arithmetic
Parameters:
char *key Password that is encrypted ;Length is 8
Char* ptrsource :original text
Unsigned__ int16 msglen: length of original text multiple of 8
Char* ptrdest : secret content
Return:<0 error. Its absolute value is the error code
=0 correct
Example: IC_Encrypt;("12345678"," abcdefghabcdefgh",16, dest)
Use password "12345678"to encrypt "abcdefghabcdefgh" whose length is 16
Related Function:
__int16 __stdcall IC_Encrypt_Hex( char *key,char *ptrSource, unsigned __int16
msgLen, char *ptrDest)

12.__ the int16 IC_Decrypt( char* key, the char ptrsource, unsigned__ the int16
msglen, char* ptrdest)
Description: The decrypted function of DES arithmetic, the usage is contrary
to IC_Encrypt.
Related Function:
__int16 __stdcall IC_Decrypt_Hex( char *key,char *ptrSource, unsigned __int16
msgLen, char *ptrDest)

13. int16 IC_Read_Int()


Description: Function that is read in int.For details please refer to IC_Read_Float

14. __int16 IC_Write_Int()


Description: Function that is read in int.For details please refer to IC_Write_Float

15. int IC_CheckCard(HANDLE icdev)


Description: test card type automatically, the card type this funtion tested just for
renference.
Parameter:
Icdev: the communication identifier of the device
Return: >0 correct, For details please refer to Card Type Code
Example:
Int st;
St=IC_CheckCard(icdev)

16. int IC_DevBeep(HANDLE icdev, unsigned char time)


Description:beep of the reader
Parameter:
Icdev: the communication identifier of the device
Time: beep time, range from 0~255(15ms)
Return:<0 error
=0 correct
Example:
st=IC_DevBeep(icdev,100);

17. int IC_ReadVer(HANDLE icdev, unsigned char *data_buff)


Description: read hardware version of the device
Parameter:
Icdev: the communication identifier that IC_InitComm returns
Data_buff:stores data that read from reader, length is 10 bytes
Return: <0 error
=0 correct

18. int IC_WriteDevice (int icdev,int offset,int length,unsigned char* buffer)


Description:write information into the note area of the card
Parameter:
Icdev: the communication identifier of the device
Offset:offset address
Length:the length of information
Buffer:the information that’s about to write
Return:=0 correct
Example:
st=IC_WriteDevice(icdev,10,7,"abcdefg")
Related function:
__int16 __stdcall IC_WriteDevice_Hex(HANDLEidComDev,__int16 offset,__int16
len,unsigned char * writebuffer)

19. int IC_ReadDevice (int icdev,int offset,int length,unsigned char *buffer)


Description: read note information of the reader
Parameter:
Icdev: the communication identifier of the device
Offset:offset address
Length:the length of information
Buffer:the information that read from the reader
Return:=0 correct
Example:
Int st;
Unsigned char buffer[100]
st=IC_ReadDevice(icdev,0,100,buffer)
Related function:
__int16 __stdcall IC_ReadDevice_Hex(HANDLEidComDev,__int16 offset,__int16
len,unsigned char * databuffer)

20. HANDLE IC_InitCommAdvanced(__int16 Port)


Description: Initialize the port of the device.(high speed)
Parameter:
-Port -0,1,2 and 3 mean serial port 1,2,3,4
- Be equal to 100 means the port that is connected is an USB port
Return:<0 error the initialization is failed ,so you can't do the operation afterwards.
>=0 the initialization is successful,and returns to the identifier of the port.
Example:
ICDev= the InitCommAdvanced(0) opens the serial 1

21._int16 asc2hex(unsigned char *strasc,unsigned char *strhex,__int16 length)


Description:transform function of the character string,transform normal character into
character in HEX(short to long)
Parameter:
strasc:the character that’s about to transform
strhex:the character that has transformed
length:the length of the character strasc
Return:=0 correct

22 __int16 hex2asc(unsigned char *strhex,unsigned char *strasc,__int16 length)


Description:transform function of the character string,transform character in HEX into
normal character (long to short)
Parameter:
strhex:the character that’ s about to transform
strasc:the character that has transformed
length:the length of the character strasc
Return:=0 correct

23 __int16 __stdcall IC_SetCommTimeout(DWORD lTime_ms,DWORD


sTime_ms)
Description: set serial port timeout of receiving.
Parameters:
DWORD lTime_ms: the maximum timeout of reverse receive, units:ms, default
3000ms.
DWORD sTime_ms): the maximum timeout of continual receive, units:ms,
default 500ms.
Return; =0 set successfully
Example: IC_SetCommTimeout(5000,500)
Set timeout of reverse receive as 5000ms, set timeout of continual receive as
500ms.
Notice:Generally, using the default setting is okay.

24. __int16 __stdcall IC_SetUsbTimeout(unsigned char ntimes)


Description: set usb timeout of receiving
Parameter:
Ntimes: ther eceivetime s,0. 5se acht i
me ,defa ul
t5t
ime
s,t
hat
’s2.
5s
Return:=0 set successfully
Example: IC_SetUsbTimeout(10)
Set the receive time as 10ti
me s,t hat
’s5s .
Notice:Generally, using the default setting is okay.

<2>4432/4442 card appropriation functions:


1. __int16 IC_ReadProtection (HANDLE ICDev,__int16 Offset,__int16
len,unsigned char* ProtBuffer)
Description: Read protection bit of IC card
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
__int16 Offset - start address of I Cc ard’
s protection bit that to read
__int16 Len –length of data
unsigned char * Databuffer - buffer area that stores data
The data value 0 means the protection bit has already placed, 1 means the protection
bit hasn’t placed.
Return:<0 error .Its absolute value is error code
=0 correct
Example:
IC_ReadProtection(ICDev,0,32,ProtBuffer)
Read protection data whose address is 0-31. Bytes whose ProtBuffer is 0 mean that
the corresponding byte protection bits have already placed.
Related Function:
__int16 __stdcall IC_ReadProtection_Hex(HANDLE idComDev,__int16
offset,__int16 len,unsigned char* protbuffer)

2._ the int16 IC_WriteProtection( the HANDLE ICDev,__ int16 Offset, __int16
len,unsigned char *ProtBuffer)
Description: Write protection bit of IC card
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
__int16 Offset –the start address of the I Cc a r
d’s protection bit that to write
__int16 len –length of data
unsigned char *ProtBuffer - buffer area that stores data ,To place the data
contents of the protection bit, its contents must be the same as the existing contents in
card, otherwise the write_ prot ec t
ionbi tc a
n’t be placed.
Return:<0 error.Its absolute value is error code.
=0 correct
Example:
ProtBuffer="DCIC"
IC_WriteProtection(ICDev,16,4,ProtBuffer)
Place the bits 16,17,18,19 protected
Related Function:
__int16 __stdcall IC_WriteProtection_Hex(HANDLE idComDev,__int16
offset,__int16 len,unsigned char *protbuffer)

3. __int16 IC_ReadCount_SLE4442 (HANDLE ICDev)


Description: Read value of the password counter of Siemens 4442 card.
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
Return:<0 error. Its absolute value is error code
>=0 value of password counter.This value means the opportunity of trying the
password.
Example:
IC_ReadCount_SLE4442(ICDev)

4. __int16 IC_CheckPass_SLE4442 (HANDLE ICDev, unsigned char*


Password)
Description: Check the password( used for 4442 card)
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char * Password -3by teoft heca r
d’s password
Return:<0 error.Its absolute value is error code
=0 check the password correct
Example
:pass[3]={0xb6,0x23,0x07};
IC_CheckPass_SLE4442(ICDev,pass);
Check the card password by b62307
Related Function:
__int16 __stdcall IC_CheckPass_4442hex(HANDLE idComDev,unsigned
char*password)

5. __int16 IC_ChangePass_SLE4442 (HANDLE ICDev, unsigned char*


Password)
Description: Change the password.( used for 4442 card)After changing the password,
if the card power down the electricity,you must recheck the password if you need to
write the card or change the password again.
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char * Password -3 byte of new password
Return:<0 error.Its absolute value is error code
=0 change the password correct
Example:
IC_ChangePass_SLE4442(ICDev,"222")
Change password as 222.

6.__int16 IC_Check_4442(HANDLE icdev)


Description:check whether the 4442 card is inserted in the Reader or not
Parameter:
HANDLE icdev - the communication identifier that IC_InitComm returns
Return:<0 error, Its absolute value is the error code
=0 correct

7.__int16 IC_ReadPass_SLE4442(HANDLE icdev,unsigned char * Password)


Description: read card’
s password(used for 4442 card particularly)
Parameters:
HANDLE icdev - the communication identifier that IC_InitComm returns
unsigned char * Password-buffer area that stores the data
Return: <0 error, Its absolute value is the error code
=0 correct
Related Function:
__int16 __stdcall IC_ReadPass_4442hex(HANDLE idComDev,unsigned
char*password)

<3>4418/4428 card appropriation functions:


1.__int16 IC_ReadWithProtection (HANDLE ICDev,__int16 Offset,__int16
len,unsigned char* ProtBuffer)
Description: read the IC card with protection bit
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
__int16 Offset - start address of I Cc ard’s protection bit that to read
__int16 Len –length of data
unsigned char * ProtBuffer –buffer area that stores the data
This buffer area includes two part of contents:
One part is the data in the card, thel eng t
hi sthel eng t
ht ha tthe“ Le n”means;The
other part is the corresponding protection content,"0" means the protection bit that has
been placed,"1" means the protection bit that hasn’ t been placed., the second part is
also Len bytes start from the offset address
Return:<0 error.Its absolute value is error code
>=0 valid data length. It means the valid byte of the data of ProtBuffer.
Example:
IC_ReadWithProtection(ICDev,0,32,ProtBuffer)
Read data that address from 0 to31 and the corresponding protection bit.
ProtBuf fer ’s 0-31 bytes are data in the card. From the 32th byte of ProtBuffer with
each beginning of “ 0”me anthe corresponding protection bit has been placed,be
contrary to” 1” .
Attention:The length of the buffer area that ProtBuffer points must be 2* Len,
otherwise it will cause mistake.
Related Function:
__int16 __stdcall IC_ReadWithProtection_Hex(HANDLE idComDev,__int16
offset,__int16 len,unsigned char* protbuffer)

2. __int16 IC_WriteWithProtection (HANDLE ICDev, __int16 Offset, __int16


len,unsigned char *ProtBuffer)
Description: Write the IC card and place the protection bit simultaneity
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
__int16 Offset - start address of I
Cc ard’s protection bit that to write
__int16 len –length of data
unsigned char *ProtBuffer –data contents that to place the protection bits
Return:<0 error. Its absolute value is error code
=0 correct
Example:
ProtBuffer="DCIC"
IC_WriteWithProtection(ICDev,16,4,ProtBuffer)
Write “ DCIC”into bits16,17,18,19 and placed Write_protection
Related Function:
__int16 __stdcall IC_WriteWithProtection_Hex(HANDLE idComDev,__int16
offset,__int16 len,unsigned char * writebuffer)

3. __int16 IC_ReadCount_SLE4428 (HANDLE ICDev)


Description:: Read value of the password counter of Siemens 4428 card.
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
Return:<0 error. Its absolute value is error code
>=0.value of password counter.This value means the opportunity of trying the
password.
Example:
IC_ReadCount_SLE4428(ICDev)

4. __int16 IC_CheckPass_SLE4428 (HANDLE ICDev, unsigned char*


Password)
Description: Check the password( used for 4428 card)
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char * Password -2 bytes oft hec a
rd’
s password
Return:<0 error.Its absolute value is error code
=0 check the password correct
Example:IC_CheckPass_SLE4428(ICDev,"11")
Check the card password by 11.
Related Function:
__int16 __stdcall IC_CheckPass_4428hex(HANDLE idComDev,unsigned char*
password)

5. __int16 IC_ChangePass_SLE4428 (HANDLE ICDev, unsigned char*


Password)
Description: Change the password( used for 4428 card)
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char * Password -2 bytes of new password
Return:<0 error.Its absolute value is error code
>0 change the password correct
Example:
IC_ChangePass_SLE4428(ICDev,"22")
Change password as 22.
Related Function:
__int16 __stdcall IC_ChangePass_4428hex(HANDLE idComDev,unsigned char*
password)

6. __int16 IC_Check_4428(HANDLE ICDev)


Description:check whether the 4428 card is inserted in the Reader or not
Parameter:
HANDLE icdev - the communication identifier that IC_InitComm returns
Return:<0 error, Its absolute value is the error code
=0 correct

<4>101/102/103 card appropriation functions:


1. __int16 IC_CheckPass_102(HANDLE ICDev,unsigned char* Password)
Description: Check the password( used for 102 type)
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char * Password -2 bytes of the card password
Return:<0 error.Its absolute value is error code
=0 check the password correctr
Example:
IC_CheckPass_102(ICDev,"11")
checks the card password by 11.
Related Function:
__int16 __stdcall IC_CheckPass_102hex(HANDLE idComDev,unsigned
char*password)

2. __int16 IC_ChangePass_102(HANDLE ICDev,unsigned char* Password)


Description: Change the password( used for 102 type)
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char * Password -2 bytes of new password
Return:<0 error.Its absolute value is error code
=0 change the password correct
Example:
IC_ChangePass_102(ICDev,"22")
Change the card password as 22.
Related Function:
__int16 __stdcall IC_ChangePass_102hex(HANDLE idComDev,unsigned
char*password)

3. __int16 IC_ReadCount_102 (HANDLE ICDev)


Description: Read value of the password error counter of 102 card.
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
Return:<0 error.Its absolute value is error code
>=0.value of password counter.This value means the opportunity of trying the
password.
Example:
IC_ReadCount_102(ICDev)

4. __int16 IC_Erase_102(HANDLE ICDev,__int16 Offset,__int16 len)


Description: Erase data(102 type), used for the card that hasn’ t burned the fuse
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
__int16 Offset –the start address that to erase( must be the even number)
__int16 len –the bytes number that to erase( must be the even number)
Return:<0 error. Its absolute value is error code
=0 operation divide correct
Example:
IC_Erase_102(ICDev,24,32)
Erase 32 bytes start from the absolutely offset address 24 .

5. __int16 IC_CheckAZPass_102(HANDLE ICDev,__int16 Zone, unsigned


char* Password)
Description: Che c kthea pplieda rea ’s password(102 cards), used for the card that has
burned the fuse.If the password is right, will erase the data of that area, all place " FF"
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
__int16 Zone - applied area numbers of the 102 card
unsigned char * Password –password of the Applied area
The erase password of the Applied area 1 is 6 bytes ,it starts from the offset
address 86.the default password is FFFFFFFFFFFF(HEX);
The erase password of the Applied area 2 is 4 bytes ,it starts from the offset
address 156.the default password is FFFFFFFF (HEX);
Return:<0 error.Its absolute value is error code.
=0 operation successfully, but this doesn’ t mean the password is correct, it
can judge only by checking whether it’ s erased no not
Example:
IC_CheckAZPass_102(ICDev,1,"111111")
Check the password of applied area 1 by "111111".
Related Function:
__int16 __stdcall IC_CheckAZPass_102hex(HANDLE idComDev,__int16 zone,
unsigned char*password)

6.__ the int16 IC_ChangeAZPass_102( the HANDLE ICDev,__ int16


Zone, unsigned char* Password)
Description: Change the applied area password(102 cards), the password can change
before burning the fuse
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
__int16 Zone - applied area numbers of the 102 card
unsigned char * Password - password of the Applied area
The erase password of the Applied area 1 is 6 bytes ,it starts from the offset
address 86.the default password is FFFFFFFFFFFF(HEX);
The erase password of the Applied area 2 is 4 bytes ,it starts from the offset
address 156.the default password is FFFFFFFF (HEX);
Return:<0 error. Its absolute value is error code
=0 operation success
Example:
IC_ChangeAZPass_102(ICDev,1,"222222")
Change the password of the application area as"222222".
Related Function:
__int16 __stdcall IC_ChangeAZPass_102hex(HANDLE idComDev,__int16
zone,unsigned char*password);
7. __int16 IC_Fuse_102 (HANDLE ICDev)
Description: Burn fuses of the AT102 cards
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
Return:<0 error. Its absolute value is error code
=0 correct
Example:
IC_Fuse_102(ICDev)

8.__int16 IC_Check_102(HANDLE icdev)


Description:check whether the 102 card is inserted in the Reader or not
Parameter:
HANDLE icdev - the communication identifier that IC_InitComm returns
Return:<0 error, Its absolute value is the error code
=0 correct

<4406 cards( the telephone card) appropriation functions of 5>:


1. __int16 IC_RValue(HANDLE ICDev)
Description: Read value of the 4406 card
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
Return:<0 error, please refer to the error code
>=0 correct
Example:
IC_RValue(ICDev)
2. __int16 IC_DEValue(HANDLE ICDev,__int16 num)
Description: Reduce the value of the 4406 card
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
__int16 num - The value that to reduce
Return:<0 error, please refer to the error code
=0 correct
Example:
IC_DEValue(ICDev,1)
Re ducet heva lueoft he4406c ar
dby“
1”

3. __int16 IC_Erase_4406(HANDLE ICDev,unsigned char offset)


Description: lend_bit erase 4406 cards()
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char offset –the bytes that to lend bit
Return:<0 error, please refer to the error code
=0 correct
Example:
IC_Erase_4406(ICDev,9)
Lend bits from byte 9, erase byte10 by FF

4.__int16 IC_CheckPass_4406 (HANDLE ICDev,unsigned char *password)


Description: check password of the 4406 card
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
Unsigned char *password-the password that to check
Return;<0 error, please refer to the error code
=0 correct
Example:
IC_CheckPass_4406(ICDev,"123")
Related Function:
__int16 __stdcall IC_CheckPass_4406hex(HANDLE idComDev,unsigned char
*password)

5.__int16 IC_Check_4406(HANDLE icdev)


Description:check whether the 4406 card is inserted in the Reader or not
Parameter:
HANDLE icdev - the communication identifier that IC_InitComm returns
Return:<0 error, Its absolute value is the error code
=0 correct

<6>1604/1604 B card appropriation function:


1604 Bs and 1604 of function dissimilarity is just a suffix from 1604 change for the
1604 Bs
1. __int16 IC_CheckPass_1604(HANDLE ICDev,__int16 Area,unsigned char*
Password)
Description: Check the password( used for 1604 type)
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
Area: password type that to check,
0: Total password of the card
1: 1604 passwords of the cards area 1s
2: 1604 passwords of the cards area 2s
3: 1604 passwords of the cards area 3s
4: 1604 passwords of the cards area 4s
11: 1604 cards area 1s erase password
12: 1604 cards area 2s erase password
13: 1604 cards area 3s erase password
14: 1604 cards area 4s erase password
unsigned char * Password -2by teoft heca r
d’ s password
Return:<0 error.Its absolute value is error code
=0 check the password correct
Example:
IC_CheckPass_1604(ICDev,0,"11")
check the card password by"11".
Related Function:
__int16 __stdcall IC_CheckPass_1604hex(HANDLE idComDev,__int16
area,unsigned char*password)
2. __int16 IC_ChangePass_1604(HANDLE ICDev,__int16 Area,unsigned
char* Password)
Description: Change the password( used for 1604 type)
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
Area: password type that to change,
0: Total password of the card
1: 1604 passwords of the cards area 1s
2: 1604 passwords of the cards area 2s
3: 1604 passwords of the cards area 3s
4: 1604 passwords of the cards area 4s
11: 1604 cards area 1s erase password
12: 1604 cards area 2s erase the password
13: 1604 cards area 3s erase password
14: 1604 cards area 4s erase password
unsigned char * Password -2 bytes oft hec ard’s password
Return:<0 error. Its absolute value is error code
=0 change password correct
Example:
IC_CheckPass_1604(ICDev,0,"22")
Change the password as"22".
Related Function:
__int16 __stdcall IC_ChangePass_1604hex(HANDLE idComDev,__int16
area,unsigned char*password)

3. __int16 IC_ReadCount_1604 (HANDLE ICDev,__int16 area)


Description: Read value of the password error counter of 1604 card.
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
Area: read the type that error count,
0: The total password error count of the card
1: password error counts of the 1604 c a
rd’sar
ea1
11: password error counts of the 1604 c ard’
sarea1
12: password error counts of the 1604 c ard’
sarea2
13: password error counts of the 1604 c ard’
sarea3
14: password error counts of the 1604 c ard’
sarea4
For the following password error counter ,only the 1604 B card have,1604 card
doesn’ t have
2: password error counts of the 1604B c ar
d’sarea2
3: password error counts of the 1604B c ar
d’sarea3
4: password error counts of the 1604B c ar
d’sarea4
Return:<0 error.Its absolute value is error code
>=0 value of password counter.This value means the opportunity of trying the
password.
Example:
IC_ReadCount_1604(ICDev,0)

4. __int16 IC_Fuse_1604 (HANDLE ICDev)


Description: Burn fuses of the cards
Parameter:
HANDLE ICDev - the communication identifier that IC_InitComm returns
Return:<0 error. Its absolute value is error code
=0 right
Example:IC_Fuse_1604(ICDev)

5. __int16 IC_Check_1604(HANDLE ICDev)


Description: check whether the 1604 card is inserted in the reader or not
Parameter:
HANDLE icdev----the communication identifier that IC_InitComm returns
Return:<0 error, its absolute number is the error code
=0 correct
<24 series card appropriation functions of 7>( that function used for the 24
C01As/02/04/08/16)
1. __int16 IC_Write24 (HANDLE ICDev, __int16 Offset,__int16 length,
unsigned char* DataBuffer)
Description: Write the data into IC card
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
__int16 Offset - Write start address of the IC card
__int16 length –length of data
unsigned char * Databuffer –the data that to write into the IC card
Return:<0 error.Its absolute value is error code
=0 correct
Example:
IC_Write(ICDev,32,14,"IcCard Message")
Write data "IcCard Message" into the data area that start from the address 32
Related Function:
__int16 __stdcall IC_Write24_Hex(HANDLE idComDev,__int16 offset,__int16
len,unsigned char *writebuffer__)

2. __int16 IC_Check_24C01(HANDLE icdev)


Description: check whether the 24C01 card is inserted in the Reader or not
Parameter:
HANDLE icdev - the communication identifier that IC_InitComm returns
Return:<0 error, Its absolute value is the error code
=0 correct
other 24C series function:
int IC_Check_24Cxx(HANDLE icdev); //xx means 02,04,08,16

<8>24 C64 appropriation function:


1. IC_Write64() the same as IC_Write24 card function ,but only used for 24C64
2. __int16 IC_Check_24C64(HANDLE ICDev)
Description: check whether the 24C64 card is inserted in the Reader or not
Parameter:
HANDLE icdev - the communication identifier that IC_InitComm returns
Return:<0 error, Its absolute value is the error code
=0 correct

<9>45 DB041 card appropriation function:


1. __int16 IC_DirectRead(HANDLE idComDev,int page,int offset,int bytes,
unsigned char *buff)
Description: Read the IC card data directly
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
int page - The page that to read
int offset - Read start address of IC card
int bytes –length of data
unsigned char * buff –buffer area that stores the data
Return:<0 error.Its absolute value is error code
=0 correct.
Example:
IC_DirectRead(ICDev,0,16,64,buff)
Re a d0pa g e’s16-79 of data to the buff, the right return 0.

2. __int16 IC_DirectWrite(HANDLE idComDev, int page, int offset ,int bytes ,


unsigned char *buff)
Description: write data into IC card directly
Parameters:
int HANDLE - the communication identifier that IC_InitComm returns
int page - The page that to write
int offset - Write start address of IC card
int bytes –length of data
unsigned char * buff –buffer area that stores data
Return:<0 error.Its absolute value is error code
=0 correct
Example:
IC_DirectWrite(ICDev,0,0,264,DataBuffer)
Wr ite0pa ge
’s 264 byte into the card, successful if returns 0

3. __int16 IC_Check_45DB041(HANDLE icdev)


Description: check whether the 45DB041 card is inserted in the Reader or not
Parameter:
HANDLE icdev - the communication identifier that IC_InitComm returns
Return:<0 error, Its absolute value is the error code
=0 correct

<10> CPU card function


1.__ the int16 IC_CpuReset( the HANDLE ICDev, the unsigned char* rlen, the
unsigned char* rbuff)
Description: power on of the CPU card and reset, then judge the card protocol
automatically after reset
Parameters:
int ICDev - the communication identifier that IC_InitComm returns
unsigned char *rlen –length of the reset information that returns
unsigned char * rbuff –stores the reset information that returns
Return: <0 error.Its absolute value is error code
=0 correctl.
Example:
st=IC_CpuReset(ICDev,rlen,DataBuffer)
Related Function:
__int16 __stdcall IC_CpuReset_Hex(HANDLE idComDev,unsigned char *rlen,
unsigned char *databuffer)

2.__ the int16 IC_CpuApdu( the HANDLE ICDev, the unsigned char slen, the
unsigned char* sbuff, the unsigned char* rlen, the unsigned char* rbuff)
Description: the message exchange function of APDU( the application agreement data
unit) of the CPU card. This function has sealed the T=0 and T= 1 operation
Parameters:
int ICDev - the communication identifier that IC_InitComm returns
unsigned char *slen –length of the sending information
unsigned char * sbuff –databuffer that stores the sending information
unsigned char *rlen –length of the information that returns
unsigned char * rbuff –databuffer that stores the returning information
Return: <0 error.Its absolute value is error code
=0 correct.
Example:
int st;
unsigned char slen,rlen,sneddata[100], recdata[100];
slen=5;
senddata[0]=0x00;senddata[1]=0x84;senddata[2]=0x00;
senddata[3]=0x00;senddata[4]=0x04;
st= IC_CpuApdu ( icdev,slen,senddata,&rlen,recdata)
Related Function:
__int16 __stdcall IC_CpuApdu_Hex(HANDLE idComDev,unsigned char
slen,unsigned char * sendbuffer,unsigned char *rlen,unsigned char * databuffer)

3. __int16 IC_CpuApduSource(HANDLE ICDev,unsigned char slen,unsigned


char * sbuff,unsigned char *rlen,unsigned char * rbuff)
Description: message exchange function of APDU .This f unc t
iondoe sn’tseal, The
user needs to judge the type of the protocol and organized the data transmission
voluntarily
Parameters:
int ICDev - the communication identifier that IC_InitComm returns
unsigned char *slen –length of the sending information
unsigned char * sbuff –databuffer that stores the sending information
unsigned char *rlen –length of the information that returns
unsigned char * rbuff –databuffer that stores the returning information
Return: <0 error. Its absolute value is error code
=0 correct
Example:
T= 1 protocol card operation
int st;
unsigned char slen,rlen,sneddata[100], recdata[100];
slen=5;senddata[0]=nad;senddata[1]=pcb;senddata[2]=5,
senddata[3]=0x00;senddata[4]=0x84;senddata[5]=0x00;
senddata[6]=0x00;senddata[7]=0x08;
for(st=0;st<8;st++)
senddata[8]^=senddata[st]; // Calculation difference or and
st=dc_cpuapdusource( icdev,slen,senddata,&rlen,recdata);
Related Function:
__int16 __stdcall IC_CpuApduSource_Hex(HANDLE idComDev,unsigned char
slen,unsigned char * sendbuffer,unsigned char *rlen,unsigned char * databuffer)

4.__ the int16 IC_CpuGetProtocol( HANDLE ICDev)


Description: Get the protocol of the CPU card
Parameters:
int ICDev - the communication identifier that IC_InitComm returns
Return: <0 error. Its absolute value is error code
=0 T=0 protocol
=1 T= 1 protocol

5.__ the int16 IC_CpuSetProtocol( the HANDLE ICDev, unsigned char prtol)
Description: Establish the protocol of the CPU card
Parameters:
int ICDev - the communication identifier that IC_InitComm returns
unsigned char prtol --- set protocol 0 or 1
Return: <0 error. Its absolute value is error code
=0 correct

6. __int16 IC_Check_CPU(HANDLE ICDev)


Description: check whether the CPU card is inserted in the Reader or not
Parameter:
HANDLE icdev - the communication identifier that IC_InitComm returns
Return:<0 error, Its absolute value is the error code
=0 CPU(T=0);
=1 CPU(T=1)

7. __int16 IC_SetCpuPara(HANDLE idComDev,unsigned char cputype,unsigned


char cpupro,unsigned char cpuetu)
Description: se tCPUc ard’spa rame ter ,t
hede
faultpa rame teri
scpupr
o=0(
T=0
protocol)cpuetu=92(baudrate 9600) after electrifying.
Parameter:
ICDev :the communication identifier that dc_init returns
ccputype: the type of the card seat
12=main card seat
13=SAM1 card seat
14=SAM2 card seat
15=SAM3 card seat(decimalist)
cpupro: the protocol type of the card
=0:T=0 protocol
=1:T=1 protocol
cpuetu : the delay data(decimalist)of the card when operating.With different
cards,
thispa r ame ter’
sva l
ueisdi fferent,Fort hecardwhos eba udr at
eis9600,s
et
cpuetu as 92 . For the card whose baudrate is 38400,set cpuetu as20.
Return: <0 error, its absolute number is the error code
=0 correct

8. __int16 __stdcall IC_CpuApduEXT(HANDLE idComDev,__int16


slen,unsigned char * sbuff, __int16 *rlen,unsigned char * rbuff);
Description: the message exchange function of APDU( the application agreement data
unit) of the CPU card. This function has sealed the T=0 and T= 1 operation
Parameters:
HANDLE idComDev - the communication identifier that IC_InitComm returns
_int16 slen –length of the sending information
unsigned char * sbuff –databuffer that stores the sending information
_int16 *rlen –length of the information that returns
unsigned char * rbuff –databuffer that stores the returning information
Return: <0 error.Its absolute value is error code
=0 correct
Example:
int st;
unsigned char slen,rlen,sneddata[100], recdata[100];
slen=5;
senddata[0]=0x00;senddata[1]=0x84;senddata[2]=0x00;
senddata[3]=0x00;senddata[4]=0x04;
st= IC_CpuApduEXT ( icdev,slen,senddata,&rlen,recdata)
Related Function:
__int16 __stdcall IC_CpuApduEXT_Hex(HANDLE idComDev,__int16
slen,unsigned char * sendbuffer,__int16 *rlen,unsigned char * databuffer)

9. __int16 IC_CpuApduSourceEXT(HANDLE idComDev,__int16 slen,unsigned


char * sbuff, __int16 *rlen,unsigned char * rbuff);
Description: message exchange function of APDU .This function doe sn’tseal, The
user needs to judge the type of the protocol and organized the data transmission
voluntarily
Parameters:
HANDLE idComDev - the communication identifier that IC_InitComm returns
__int16 slen –length of the sending information
unsigned char * sbuff –databuffer that stores the sending information
__int16 *rlen –length of the information that returns
unsigned char * rbuff –databuffer that stores the returning information
Return: <0 error. Its absolute value is error code
=0 correct
Related Function:
__int16 __stdcall IC_CpuApduSourceEXT_Hex(HANDLE idComDev,unsigned
char slen,unsigned char * sendbuffer,unsigned char *rlen,unsigned char * databuffer)

10. __int16 IC_CpuColdReset(HANDLE ICDev,unsigned char *rlen, unsigned


char *rbuff)
Description: power on of the CPU card and reset(cold reset), then judge the card
protocol automatically after reset
Parameters:
int ICDev - the communication identifier that IC_InitComm returns
unsigned char *rlen –length of the reset information that returns
unsigned char * rbuff –stores the reset information that returns
Return: <0 error.Its absolute value is error code
=0 correct
Example:
st=IC_CpuColdReset(ICDev,rlen,DataBuffer)
Related Function:
__int16 __stdcall IC_CpuColdReset_Hex(HANDLE idComDev,unsigned char
*rlen, unsigned char *databuffer)

11. __int16 IC_CpuHotReset(HANDLE ICDev,unsigned char *rlen, unsigned


char *rbuff)
Description: power on of the CPU card and reset(hot reset), then judge the card
protocol automatically after reset
Parameters:
int ICDev - the communication identifier that IC_InitComm returns
unsigned char *rlen –length of the reset information that returns
unsigned char * rbuff –stores the reset information that returns
Return: <0 error.Its absolute value is error code
=0 correct
Example:
st=IC_CpuHotReset(ICDev,rlen,DataBuffer)
Related Function:
__int16 __stdcall IC_CpuHotReset_Hex(HANDLE idComDev,unsigned char
*rlen, unsigned char *databuffer)

<11>1608/153 card functions


1. __int16 IC_SetUserZone(HANDLE ICDev,unsigned char Zone)
Description: set the userzone that wants to operate before operate the userzone
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char Zone –User zone number
1608 card : range 0-7
153 card: range 0-2
Return:<0 error.Its absolute value is error code
=0 correct.
Example:
IC_SetUserZone (ICDev,0)
set the user zone that want to use as 0 zone

2.__ the int16 IC_ReadUserZone( the HANDLE ICDev,__ the int16 Offset,__ the
int16 len, the unsigned char* RDataBuff)
Description: Read data of userzone
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
int offset –the start address of data that to read
int len –length of data
unsigned char * buff –stores data that read from the userzone
Return:<0 error.Its absolute value is error code
=0 correct
Example:
IC_ReadUserZone (ICDev,0,16,buff)
Read 0-15 of data of current user zone to buff, returns 0 if correct.
Related Function:
__int16 __stdcall IC_ReadUserZone_Hex(HANDLE idComDev,__int16
Offset,__int16 len,unsigned char *RDataBuff)

3.__ the int16 IC_ReadConfigZone( the HANDLE ICDev,__ int16 Offset,


__int16 len,unsigned char *RDataBuff)
Description: Read data of control area
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
int offset - start address of data that to read
int len –length of data
unsigned char * buff - stores data that read from the control area
Return:<0 error. Its absolute value is error code
=0 correct.
Example:
IC_ReadConfigZone(ICDev,0,16,buff)
Read 0-15 of data of current control area to buff, returns 0 if correct.
Related Function:
__int16 __stdcall IC_ReadConfigZone_Hex(HANDLE idComDev,__int16
Offset,__int16 len,unsigned char *RDataBuff)

4.__ the int16 IC_WriteUserZone( the HANDLE Dev,__ the int16 Offset,__ the
int16 len, the unsigned char* RDataBuff)
Description: write data of userzone
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
int offset - start address of data that to write
int len –length of data
unsigned char * buff –stores data that to write into the userzone
Return:<0 error.Its absolute value is error code
=0 correct
Example:
IC_WriteUserZone (ICDev,0,16,buff)
Write data of buffer into the current userzone 0-15,returns 0 if correct.
Related Function:
__int16 __stdcall IC_WriteUserZone_Hex(HANDLE idComDev,__int16
Offset,__int16 len,unsigned char *WDataBuff)

5.__ the int16 IC_WriteConfigZone( HANDLE ICDev,__int16 Offset,__int16


len,unsigned char *RDataBuff)
Description: Write to control the area data
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
int offset - Write the data start address
int len - Data length
unsigned char * buff - deposit the data that need to write in
Return:<0 error.Its absolute value is error code
=0 correct.
Example:
IC_WriteConfigZone (ICDev,56,8,buff)
Buff in the data writes to 1608 cards of test area, the correct return 0.

6.__ the int16 IC_ReadFuse( HANDLE ICDev)


Description: Read the fuse
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
Return:<0 error.Its absolute value is error code
>=0 successful, return the current fuse status value, as follows:
BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 BIT0
0 0 0 0 0 PER CMA FAB
FAB: use issued by Atmel company; CMA: fuse issued by The card manufacturer
PER:Personalization issue fuse
Example:
count=IC_ReadFuse (ICDev); If the count returns 6, means that PER hasn’
t fused,
CMA hasn’ t fused, FAB has already fused

7.__ the int16 IC_WriteFuse( the HANDLE ICDev, unsgined char FuseType)
Description: Write the fuse
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char fusetype - The fuse type, for 1608 that parameter of card are
invalid, for 153 that parameter of card mean: 1 fuse FAB,2 fuse CMA,3 fuse PER
Return:<0 error.Its absolute value is error code
=0 correct.
Example:
IC_WriteFuse (ICDev,3) 153 card PER of fuse

8.__ the int16 IC_CheckRPassword( HANDLE ICDev,unsigned char


zone,unsigned char *Pin)
Description: check read password
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char zone - Password area number
1608 Card scope 0-7
153 Card scope 0-1
unsigned char * pin –the password that to compared
Return:<0 error.Its absolute value is error code
=0 correct
Example:
The IC_CheckRPassword( ICDev,0, pinbuff) checks password of area 0
Related Function:
__int16 __stdcall IC_CheckRPassword_Hex(HANDLE idComDev,unsigned char
zone,unsigned char *Pin)

9.__ the int16 IC_CheckWPassword( HANDLE ICDev,unsigned char


zone,unsigned char *Pin)
Description: check write password
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char zone - Password area number
1608 Card scope 0-7, Area7’ s password multi_used as security password before
personalized
153 Card scope 0-1, Area1’ s password multi_used as security password before
personalized
unsigned char * pin - the password that to compared
Return:<0 error.Its absolute value is error code
=0 correct.
Example:
The IC_CheckWPassword( ICDev,0, pinbuff) checks password of area 0
Related Function:
__int16 __stdcall IC_CheckWPassword_Hex(HANDLE idComDev,unsigned
char zone,unsigned char *Pin)

10.__ the int16 IC_ChangeRPassword( HANDLE ICDev,unsigned char


zone,unsigned char *Pin)
Description: modify read password
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char zone - Password area number
1608 Card scope 0-7
153 Card scope 0-1
unsigned char * pin - The password that to modify
Return:<0 error.Its absolute value is error code
=0 correct.
Example:
The IC_ChangeRPassword( ICDev,0, pinbuff) modify password of area 0
Related Function:
__int16 __stdcall IC_ChangeRPassword_Hex(HANDLE idComDev,unsigned
char zone,unsigned char *Pin)

11.__ the int16 IC_ChangeWPassword( HANDLE ICDev,unsigned char


zone,unsigned char *Pin)
Description: modify write password
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char zone - Password area number
1608 card scope 0-7, Area7’ s password multi_used as security password before
personalized
153 card scope 0-1, Area1’ s password multi_used as security password before
personalized
unsigned char * pin - The password that to modify
Return:<0 error.Its absolute value is error code
=0 correct.
Example:
The IC_ChangeWPassword( ICDev,0, pinbuff) modify password of area 0
Related Function:
__int16 __stdcall IC_ChangeWPassword_Hex(HANDLE idComDev,unsigned
char zone,unsigned char *Pin)

12.__ the int16 IC_ReadRPasswordCount( the HANDLE ICDev, unsigned char


zone)
Description: Read read_password error counter
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char zone - Password area number
1608 Card scope 0-7
153 Card scope 0-1
Return:<0 error.Its absolute value is error code.
>=0 correct, return the current value of the error counter
Example:
The IC_ReadRPasswordCount( ICDev,0) read value of the error counter of area 0

13.__ the int16 IC_ReadWPasswordCount( the HANDLE ICDev, unsigned char


zone)
Description: Read write_password error counter
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char zone - Password area number
1608 The card scope 0-7, Area7’ s password multi_used as security password
before personalized
153 The card scope 0-1, Area1’ s password multi_used as security password
before personalized
Return:<0 error. Its absolute value is error code.
>=0 correct, return the current value of the error counter
Example:
The IC_ReadWPasswordCount( ICDev,0) read value of the error counter of area
0

14.__ the int16 IC_ReadAuthCount( HANDLE ICDev)


Description: Read Write Card authentication error counter
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
Return:<0 error.Its absolute value is error code.
>=0 correct, return the current value of the error counter
Example:
The IC_ReadAuthCount( ICDev) reads value of the authentication error counter

15.__ the int16 IC_InitAuth( the HANDLE idComDev, the unsigned char* Q0)
Description: initialize card authentication, send the random number Q0 into the card
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char *Q0 --- Random character string
Return:<0 error .Its absolute value is error code.
=0 correct.
Example:
IC_InitAuth;( ICDev, Q0) initialize card authentication
Related Function:
__int16 __stdcall IC_InitAuth_Hex(HANDLE idComDev,unsigned char *Q0)
16.__ the int16 IC_CheckAuth( the HANDLE idComDev, the unsigned char*
Q1)
Description: The card authenticate host, send the authenticated data Q1 into the card
Parameters:
HANDLE ICDev - the communication identifier that IC_InitComm returns
unsigned char *Q1 --- authentication data character string
Return:<0 error.Its absolute value is error code.
=0 correct
Example:
IC_CheckAuth;( ICDev, Q1) Card authenticate host
Related Function:
__int16 __stdcall IC_CheckAuth_Hex(HANDLE idComDev,unsigned char *Q1)

17.__ the int16 SetInit( the unsigned char* Ci,unsigned char *Gc,unsigned char
*Q0)
Description: The host authentication initialization
Parameters:
unsigned char *Ci --- Encrypted number
unsigned char *Gc --- Key of encryption
unsigned char *Q0 --- Random number, authenticate with card
Return:<0 error.Its absolute value is error code.
=0 correct.
Example:
SetInit;( Ci, Gc, Q0) The host authentication initialization
Related Function:
__int16 SetInit_Hex (unsigned char *Ci, unsigned char *Gc,unsigned char *Q0)

18.__ the int16 Authenticate( the unsigned char* Q1, the unsigned char* Q2)
Description: The host Authentication card, form two authentication data
Parameters:
unsigned char *Q1 --- form card authentication data
unsigned char *Q2 --- form authentication card data
Return:<0 error.Its absolute value is error code.
=0 correct.
Example:
St= Authenticate( Q1, Q2)
st= IC_CheckAuth(Q1); The card authentication host,
st=0 means that the authentication pass, and rewrite the Ci. The host reads Ci and
comapare it with Q2, the host authentication card pass if they’are equal
Related Function:
__int16 __stdcall Authenticate_Hex(unsigned char *Q1,unsigned char *Q2)

19. __int16 IC_Check_1608(HANDLE ICDev)


Description: check whether the 1608 card is inserted in the Reader or not
Parameter:
HANDLE icdev - the communication identifier that IC_InitComm returns
Return:<0 error, Its absolute value is the error code
=0 correct

Card type code:


2(0x02) 4406 series

4(0x04) 4418 4428 series

8(0x08) 4404 series

12(0x0c) CPU card

13(0x0d) SAM card

16(0x10) 4432/4442 series

32(0x20) 101/102/103 series

64(0x40) 24C01A/02/04/08/16 series

65(0x41) 45DB041 card

66(0x42) SSF1101 card

160(0xa0) 01604/1604B

192(0xc0) 24C64 card

208(0xd0) 1608 card

209(0xd1) 153 card


Function error type code:
-0x01 Unknown card type error
-0x02 Nonsupport function
-0x03 Function using error
-0x80 Read error
-0x81 Write error
-0x82 Communication error
-0x83 XOR& parity error
-0x84 Communication overtime
-0x85 Password parity error
-0x86 No card error
-0x87 Function parameter format error

Common Using Card Specification:

Card type Product Describe Working temperature


AT24C01A 1kbit,2 line serials EEPROM 0℃~70℃
AT24C02 2kbit,2 line serials EEPROM 0℃~70℃
AT24C04 4kbit,2 line serials EEPROM 0℃~70℃
AT24C08 8kbit, 2 line serials EEPROM 0℃~70℃
AT24C16 16kbit, 2 line serials EEPROM 0℃~70℃
AT24C32 32kbit, 2 line serials EEPROM 0℃~70℃
AT24C64 64kbit, 2 line serials EEPROM 0℃~70℃
AT45D041 4Mbit,2 data buffers -25℃~70℃
AT88SC102 1kbit,Double encrypt,Two Application Zone-25℃~70℃
AT88SC1604 16kbit,Triple encrypt,Four inequant Aoolication Zone -25℃~70℃
AT88SC1604B 16kbit,Triple encrypt ,Four equant Application Zone -25℃~70℃
SLE 4404 416bit,double encrypt -35℃~80℃
SLE 4406 104bit,Security Code logical counter -35℃~80℃
SLE 4418 1kbyte,Write-protect -35℃~80℃
SLE 4428 1kbyte,Write-protect,Security Code protect -35℃~80℃
SLE 4432 256byte,Write-protect 0℃~70℃
SLE4442 256byte,Write-protect, Security Code protect 0℃~70℃
CPU Card ROM , EEPROM, RAM -25℃~80℃

You might also like