Anda di halaman 1dari 57

RR3036.DLL User's Manual V2.

6
Content
1)
2)

Operation System Requirement.............................................................................................1


Function Explanation .............................................................................................................1
2.1) General Function............................................................................................................1
2.1.1) Automatically connect reader and serial port: AutoOpenComPort().............1
2.1.2) Connect reader and specified serial port: OpenComPort() .............................3
2.1.3) Disconnect all reader and serial port: CloseComPort() ...................................4
2.1.4) Disconnect reader and specified serial port: CloseSpecComPort().................4
2.1.5) Change reader mode to ISO1444A: ChangeTo14443A()..................................4
2.1.6) Change reader mode to ISO1444B: ChangeTo14443B() ..................................5
2.1.7) Change reader mode to ISO15693: ChangeTo15693() .....................................5
2.1.8) Turn off the RF field: CloseRf()..........................................................................6
2.1.9) Turn on the RF field: OpenRf() ..........................................................................6
2.1.10)Set the action of buzzer: SetBeep().....................................................................7
2.1.11) Set the action of LED: SetLed()..........................................................................7
2.1.12)Get reader-related information: GetReaderInformation() ..............................8
2.1.13)Change InventoryScanTime of the reader: WriteInventoryScanTime() ........9
2.1.14)Change readers address: WriteComAdr() .......................................................9
2.2) ISO15693 Function ......................................................................................................10
2.2.1 Get tags UID: Inventory()................................................................................10
2.2.2 Get designated tags information: GetSystemInformation() .........................11
2.2.3 Change designated tags AFI: WriteAFI().......................................................12
2.2.4 Permanently lock the AFI of designated tag: LockAFI() ...............................13
2.2.5 Read the content of a block and its security status: ReadSingleBlock() .......14
2.2.6 Write data into a block of the designated tag: WriteSingleBlock() ...............15
2.2.7 Read the content of several consecutive blocks and their security status:
ReadMultipleBlock().....................................................................................................16
2.2.8 Permanently write-protected a block of the designated tag: LockBlock() ...17
2.2.9 Change designated tags DSFID: WriteDSFID () ...........................................18
2.2.10 Permanently lock the DSFID of designated tag: LockDSFID().....................19
2.2.11 Set the tag into Ready status: ResetToReady()................................................20
2.2.12 Set the tag into Selected status: Select()...........................................................21
2.2.13 Set the tag into Quiet status: StayQuiet() ........................................................22
2.3) ISO14443A Function....................................................................................................23
2.3.1 Detected that if any ISO14443A tag in the RF field: ISO14443ARequest() .23
2.3.2 ISO14443A Anti-collision procedure: ISO14443AAnticoll ().........................24
2.3.3 ISO14443A Anti-Collision procedure: ISO14443AAnticoll2().......................25
2.3.4 Select a tag in the RF field by its UID: ISO14443ASelect()............................26
2.3.5 Save KEY in the readers EEPROM: ISO14443ALoadKey() ....................27
2.3.6 Authenticate with the KEY stored in readers EEPROM:
ISO14443AAuthentication().........................................................................................28
I

2.3.7 Cross-authenticate with the KEY stored in readers EEPROM:


ISO14443AAuthentication2().......................................................................................29
2.3.8 Directly authenticate with the given KEY: ISO14443AAuthKey() ...............30
2.3.9 Initialize the block to value-block with designated value:
ISO14443AInitValue() ..................................................................................................31
2.3.10 Increase the value of a value-block: ISO14443AIncrement() ........................32
2.3.11 Decrease the value of a value-block: ISO14443ADecrement().......................33
2.3.12 Read the content of a value-block: ISO14443AReadValue() .........................34
2.3.13 valueblock related operation with the result transferred to another block in
the same sector: ISO14443AValue().............................................................................35
2.3.14 Read out one memory block: ISO14443ARead()............................................36
2.3.15 Write data into one memory blcok: ISO14443AWrite().................................37
2.3.16 Read the contents of a value-block into the tags buffer register:
ISO14443ARestore() .....................................................................................................38
2.3.17 Transfer the content of the tags buffer register to a value-block:
ISO14443ATransfer()....................................................................................................39
2.3.18 Compare the data in tag with given data :ISO14443ACheckWrite() ...........40
2.3.19 Ultralight tags Anti-Collision procedure: ISO14443AULAnticoll().............41
2.3.20 Write data into UltraLight tag: ISO14443AULWrite()..................................42
2.3.21 Set active tag into Halt status: ISO14443AHalt() ...........................................43
2.3.22 Read the content of the readers EEPROM: ISO14443AReadE2() ..............44
2.3.23 Write data into the readers EEPROM: ISO14443AWriteE2().....................45
2.4) ISO14443B Function....................................................................................................46
2.4.1) Detected ISO14443B tag in the RF field: ISO14443BRequest() ....................46
2.4.2) ISO14443B Anti-Collision procedure: ISO14443BAnticoll().........................47
2.4.3) Select a specified tag: ISO14443BSelect()........................................................48
2.4.4) ISO14443B transparent command: ISO14443BTransparentCmd ()............51
2.4.5) Set active ISO14443B tag into Halt status: ISO14443BHalt() .......................52
3) Function Return Value Definition........................................................................................53
4) Error Code Definition...........................................................................................................54
4.1) ISO15693 error code definition (when function return 0x0f): .................................54
4.2) ISO14443A error code definition (when function return 0x10) :.............................54
4.3) ISO14443B error code definition (when function return 0x1B) : ............................55
5) Annex 1 ..................................................................................................................................55

II

RR3036.DLL is a dynamic link library designed to facilitate developing


application software for ISO15693 and ISO14443A/B Multi-Protocol HF Tag Reader
RR3036.
RR3036 includes the following models: RR3036SR, RR3036USB, RR3036CF,
RR3036IP, RR3036HM3, RR3036HM5 etc.

1) Operation System Requirement


WINDOWS 2000/XP

2) Function Explanation
2.1)

General Function

2.1.1)

Automatically connect reader and serial port: AutoOpenComPort()


Function description:
This function is used to automatically detect the unoccupied communication
port and attached it with a reader. The function tries to establish the connection
between them.
If the connection is established successfully, the function will open the
communication port and return a valid handle. Otherwise the function will
return an error code with a invalid handle (value as -1).
Usage:
long WINAPI AutoOpenComPort(long *Port, unsigned char *ComAddr, long
*FrmHandle);
Parameter:
Port: Output. Pointed to the communication port number(COM1~COM12) that
the reader is detected and connected.
ComAddr: Output. Pointed to the address of the reader.
When using broadcasting address 0xFF as ComAddr to call the function, the
port number to which the reader is detected connecting and the address of the
reader will be written back to Port and ComAddr.
When using a designated address 0x00~0xFE as ComAddr to call the function,
the port number to which the reader with the specified address is detected
connecting will be written back to parameter Port.
Constants COM1~COM10 are defined as follows:
#define COM1 1
#define COM2 2
#define COM3 3
#define COM4 4
#define COM5 5
#define COM6 6
#define COM7 7
#define COM8 8
1

#define COM9 9
#define COM10 10
#define COM11 11
#define COM12 12
FrmHandle: Output. Pointed to the handle which is binding with the
communication port opened successfully. The application software should use
this handle to talk with the reader.
Returns:
Zero value returned when successful. Please refer to Function Return Value
Definition for other value returned.

2.1.2)

Connect reader and specified serial port: OpenComPort()


Function description:
This function is used to establish the connection between the reader and a
specified communication port.
Usage:
long WINAPI OpenComPort(long Port, unsigned char *ComAddr, long
*FrmHandle);
Parameter:
Port: Input. Communication port number which is a constant from COM1 to
COM12 defined as following:
#define COM1 1
#define COM2 2
#define COM3 3
#define COM4 4
#define COM5 5
#define COM6 6
#define COM7 7
#define COM8 8
#define COM9 9
#define COM10 10
#define COM11 11
#define COM12 12
ComAddr: Input/Output. Pointed to the address of the reader.
When using broadcasting address 0xFF as ComAddr to call the function, the
address of the reader will be written back to parameter ComAddr;
When using a designated address 0x00~0xFE as ComAddr to call the function,
the function will detect whether a specified address reader is connected to the
designated communication port.
FrmHandle: Output. Pointed to the handle which is binding with the
communication port opened successfully. The application software should use
this handle to talk with the reader.
Returns:
Zero value returned when successful. Please refer to Function Return Value
Definition for other value returned.

2.1.3)

Disconnect all reader and serial port: CloseComPort()


Function description:
This function is used to disconnect the reader and release the corresponding
communication port resources. In some development environment, the
communication port resources must be released before exiting. Otherwise the
operation system will become unstable.
Usage:
long WINAPI CloseComPort(void);
Parameter:
None.
Returns:
Zero value returned when successful. Please refer to Function Return Value
Definition for other value returned.

2.1.4)

Disconnect reader and specified serial port: CloseSpecComPort()


Function description:
This function is used to disconnect the reader with the designated
communication port and release the corresponding resources.
Usage:
long WINAPI CloseSpecComPort(long FrmHandle);
Parameter:
FrmHandle: Input. Handle of the communication port the reader is connected
to. The handle value is got when calling function AutoOpenComPort or
OpenComPort.
Returns:
Zero value returned when successful. Please refer to Function Return Value
Definition for other value returned.

2.1.5)

Change reader mode to ISO1444A: ChangeTo14443A()


Function description:
This function is used to change reader mode to ISO14443A. In this mode, only
ISO 14443A tag can be operated.
Usage:
long WINAPI ChangeTo14443A(unsigned char *ComAddr, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
FrmHandle: Input. Handle of the communication port the reader is connected
to. The handle value is got when calling function AutoOpenComPort or
OpenComPort.
Returns:
Zero value returned when successful. Please refer to Function Return Value
Definition for other value returned.

2.1.6)

Change reader mode to ISO1444B: ChangeTo14443B()


Function description:
This function is used to change reader mode to ISO14443B. In this mode, only
ISO 14443B tag can be operated.
Usage:
long WINAPI ChangeTo14443B(unsigned char *ComAddr, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
FrmHandle: Input. Handle of the communication port the reader is connected
to. The handle value is got when calling function AutoOpenComPort or
OpenComPort.
Returns:
Zero value returned when successful. Please refer to Function Return Value
Definition for other value returned.

2.1.7)

Change reader mode to ISO15693: ChangeTo15693()


Function description:
This function is used to change reader mode to ISO15693. In this mode, only
ISO 15693 tag can be operated. Reader enters this mode when powered on.
Usage:
long WINAPI ChangeTo15693(unsigned char *ComAddr, long FrmHandle );
Parameter:
ComAddr: Input. Pointed to the address of the reader.
FrmHandle: Input. Handle of the communication port the reader is connected
to. The handle value is got when calling function AutoOpenComPort or
OpenComPort.
Returns:
Zero value returned when successful. Please refer to Function Return Value
Definition for other value returned.

2.1.8)

Turn off the RF field: CloseRf()


Function description:
This function is used to turn off the RF field.
Usage:
long WINAPI CloseRf(unsigned char *ComAddr, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
FrmHandle: Input. Handle of the communication port the reader is connected
to. The handle value is got when calling function AutoOpenComPort or
OpenComPort.
Returns:
Zero value returned when successful. Please refer to Function Return Value
Definition for other value returned.

2.1.9)

Turn on the RF field: OpenRf()


Function description:
This function is used to turn on the RF field.
Usage:
long WINAPI OpenRf(unsigned char *ComAddr, long FrmHandle);
Parameter: None.
ComAddr: Input. Pointed to the address of the reader.
FrmHandle: Input. Handle of the communication port the reader is connected
to. The handle value is got when calling function AutoOpenComPort or
OpenComPort.
Returns:
Zero value returned when successful. Please refer to Function Return Value
Definition for other value returned.

2.1.10)

Set the action of buzzer: SetBeep()

Function description:
This function is used to set the action of the buzzer .
Usage:
long WINAPI SetBeep(unsigned char *ComAddr, unsigned char OpenTime,
unsigned char CloseTime, unsigned char RepeatCount, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
OpenTime: Input. Buzzer active time duration ranging 0~255(unit:50ms).
CloseTime: Input. Buzzer mute time duration ranging 0~255(unit:50ms).
RepeatCount: Input. Buzzer active/mute repetition times.
FrmHandle: Input. Handle of the communication port the reader is connected
to. The handle value is got when calling function AutoOpenComPort or
OpenComPort.
Returns:
Zero value returned when successful. Please refer to Function Return Value
Definition for other value returned.
2.1.11)

Set the action of LED: SetLed()

Function description:
This function is used to set the action of the LED.
Usage:
long WINAPI SetLed(unsigned char *ComAddr, unsigned char OpenTime,
unsigned char CloseTime, unsigned char RepeatCount, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
OpenTime: Input. LED light on time duration ranging 0~255(unit:50ms).
CloseTime: Input. LED light off time duration ranging 0~255(unit:50ms).
RepeatCount: Input .LED light on/off repetition times.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Zero value returned when successful. Please refer to Function Return Value
Definition for other value returned.

2.1.12)

Get reader-related information: GetReaderInformation()

Function description:
This function is used to get reader-related information such as reader address,
firmware version, available protocol type and inventoryScanTime.
Usage:
long WINAPI GetReaderInformation(unsigned char *ComAddr, unsigned char
*VersionInfo, unsigned char *ReaderType, unsigned char *TrType, unsigned
char *InventoryScanTime, long FrmHandle);
Parameter:
ComAddr: Input/Output. Pointed to the address of the reader.
VersionInfo: Output. Pointed to 2 bytes firmware version information. The first
byte is version number and the second byte is sub-version number.
ReaderType: Output. Pointed to the reader type byte. Please refer to RR3036
Users manual for details.
TrType: Output. Pointed to 2 bytes supported protocol information. Please refer
to RR3036 Users manual for details.
InventoryScanTime: Output. Point to the time limit for ISO15693s inventory
command. Please refer to RR3036 Users manual for details.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Zero value returned when successful. Please refer to Function Return Value
Definition for other value returned.

2.1.13)

Change InventoryScanTime of the reader: WriteInventoryScanTime()

Function description:
This function is used to set a new value to InventoryScanTime of the reader.
The range is 3~255 corresponding to 3*100ms~255*100ms
InventoryScanTime. The default value of InventoryScanTime is 30*100ms.
Usage:
long WINAPI WriteInventoryScanTime(unsigned char *ComAddr, unsigned
char *InventoryScanTime, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
InventoryScanTime:Input. Pointed to the value of InventoryScanTime.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Zero value returned when successful. Please refer to Function Return Value
Definition for other value returned.
2.1.14)

Change readers address: WriteComAdr()

Function description:
This function is used to set a new reader address. The address will store in
readers inner nonvolatile memory. Default address is 0x00. The address range
is 0x00~0xFE. The address 0xFF is reserved as the broadcasting address. If a
user tries to write 0xFF to ComAddr, the reader will set the value to 0x00.
Usage:
long WINAPI WriteComAdr(unsigned char *ComAddr, unsigned char
*NewComAddr, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the original address of the reader.
NewComAddr: Input. Pointed to the new address of the reader.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Zero value returned when successful. Please refer to Function Return Value
Definition for other value returned.

2.2)

ISO15693 Function

2.2.1

Get tags UID: Inventory()

Function description:
This function is used to detect the tags in the RF field and get their UIDs and
DSFID values.
Usage:
long WINAPI Inventory(unsigned char *ComAddr, unsigned char *State,
unsigned char *AFI, unsigned char *DSFIDAndUID, unsigned char *CardNum,
long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
State: Input. Operation mode byte defined as follows:
Inventory without AFI:
0x00
Inventory with AFI:
0x01
InventoryScan without AFI: 0x02(consecutive style)
InventoryScan with AFI:
0x03(consecutive style)
InventoryScan without AFI: 0x06(renewed style)
InventoryScan with AFI:
0x07(renewed style)
The value of State defines various operation style of Inventory command.
Please refer to RR3036 Users Manual for details.
AFI: Input. Application Family Information of the tag.
DSFIDAndUID: Output. Pointed to the array storing the inventory result. The
unit of the array is 9 bytes including 1 byte DSFID and 8 bytes UID. The
volume of the result is cardNum*9 bytes with least significant byte first for
UID.
CardNum: Output. Pointed to the number of tags detected. The maximum
number of the tags collected by one Inventory command is 16.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success. All tags has been collected.
0x0E
No active tag in RF field.
0x0A
No tag UID has been collected when the time defined by
InventoryScanTime overflows. Please refer to the readers
users manual.
0x0B
Parts (not all) of the tags UID have been collected when
the time defined by InventoryScanTime overflows or 16
tags UID have been collected but there are other tags in
the field. Please refer to the readers users manual.
Other
Please refer to Function Return Value Definition.
10

2.2.2

Get designated tags information: GetSystemInformation()


Function description:
This function is used to acquire the detail description information of the
designated tag including its Information Flag, UID, DSFID, AFI, Memory, IC
Reference etc. The contents may be different for tags of various manufacturers.
Please refer to tags datasheet for details.
Usage:
long WINAPI GetSystemInformation(unsigned char *ComAddr, unsigned char
*State, unsigned char *UIDI, unsigned char *InformationFlag, unsigned char
*UIDO, unsigned char *DSFID, unsigned char *AFI, unsigned char
*MemorySize, unsigned char *ICReference, unsigned char *ErrorCode, long
FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
State: Input. Operation mode indicator byte defined as follows:
Addressed mode: 0x00
Selected mode: 0x01
UIDI: Input. Pointed to the 8 bytes of tags UID value with least significant
byte first. When operating in Addressed mode, UIDI value should be given.
When operating in Selected mode, UIDI value will be neglected.
InformationFlag: Output. Pointed to the tags information flag.
UIDO: Output. Pointed to the 8 bytes of tags UID value with least significant
byte first.
DSFID: Output. Pointed to the tags DSFID value.
AFI: Output. Pointed to the tags AFI value.
MemorySize: Output. Point to a 2 bytes array of tags storage size information.
The first byte indicates the total number of data blocks of the tag and the
second byte for the size of the data block.
ICReference: Output. Pointed to a reference byte.
ErrorCode: Output. Pointed to an explanation byte when the function returned
value equals 0x0F.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success.
0x0F
ISO15693 operation error with error explanation code in
ErrorCode. Please refer to ISO15693 error code
definition.
Other
Please refer to Function Return Value Definition.

11

2.2.3

Change designated tags AFI: WriteAFI()


Function description:
This function is used to write the value of the designated tags Application
Family Information.
Usage:
long WINAPI WriteAFI(unsigned char *ComAddr, unsigned char *State,
unsigned char *UID, unsigned char AFI, unsigned char *ErrorCode, long
FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
State: Input. Operation mode indicator byte defined as follows:
Addressed mode: 0x00( Type A tag) 0x08(Type B tag)
Selected mode: 0x01( Type A tag) 0x09(Type B tag)
As to tags type, please refer to Annex 1.
UID: Input. Pointed to the 8 bytes of tags UID value with least significant byte
first. When operating in Addressed mode, UID value should be given. When
operating in Selected mode, UID value will be neglected.
AFI: Input. The value of the tags Application Family Information.
ErrorCode: Output. Pointed to an explanation byte when the function returned
value equals 0x0F.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x0F
ISO15693 operation error with error explanation code in
ErrorCode. Please refer to ISO15693 error code
definition
Other
Please refer to Function Return Value Definition

12

2.2.4

Permanently lock the AFI of designated tag: LockAFI()


Function description:
This function is used to permanently lock the AFI value of the designated tag.
Usage:
long WINAPI LockAFI(unsigned char *ComAddr, unsigned char *State,
unsigned char *UID, unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
State: Input. Operation mode indicator byte defined as follows:
Addressed mode: 0x00( Type A tag) 0x08(Type B tag)
Selected mode: 0x01( Type A tag) 0x09(Type B tag)
As to tags type, please refer to Annex 1.
UID: Input. Pointed to the 8 bytes of tags UID value with least significant byte
first. When operating in Addressed mode, UID value should be given. When
operating in Selected mode, UID value will be neglected.
ErrorCode: Output. Pointed to an explanation byte when the function returned
value equals 0x0F.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x0F
ISO15693 operation error with error explanation code in
ErrorCode. Please refer to ISO15693 error code
definition
Other
Please refer to Function Return Value Definition

13

2.2.5

Read the content of a block and its security status: ReadSingleBlock()


Function description:
This function is used to read out the content of one block and its security status
byte.
Usage:
long WINAPI ReadSingleBlock(unsigned char *ComAddr, unsigned char
*State, unsigned char *UID, unsigned char BlockNum, unsigned char
*BlockSecStatus, unsigned char *Data, unsigned char *ErrorCode, long
FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
State: Input. Operation mode indicator byte defined as follows:
Block size = 4 bytes Addressed mode: 0x00
Selected mode: 0x01
Block size = 8 bytes Addressed mode: 0x04
Selected mode: 0x05
UID: Input. Pointed to the 8 bytes of tags UID value with least significant byte
first. When operating in Addressed mode, UID value should be given. When
operating in Selected mode, UID value will be neglected.
BlockNum: Input. The block number of the block to read.
BlockSecStatus: Output. Pointed to the security status value of the designated
block.
Data: Output. Pointed to the array of the block content with the size of 4 or 8
bytes with least significant byte first.
ErrorCode: Output. Pointed to an explanation byte when the function returned
value equals 0x0F.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x0F
ISO15693 operation error with error explanation code in
ErrorCode. Please refer to ISO15693 error code
definition
Other
Please refer to Function Return Value Definition

14

2.2.6

Write data into a block of the designated tag: WriteSingleBlock()


Function description:
This function is used to write data into a block of the designated tag.
Usage:
long WINAPI WriteSingleBlock(unsigned char *ComAddr, unsigned char
*State, unsigned char *UID, unsigned char BlockNum, unsigned char *Data,
unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
State: Input. Operation mode indicator byte defined as follows:
Block size=4 bytes Addressed mode: 0x00(Type A tag) 0x08(Type B tag)
Selected mode: 0x01(Type A tag) 0x09(Type B tag)
Block size=8 bytes Addressed mode: 0x04(Type A tag) 0x0C(Type B tag)
Selected mode: 0x05(Type A tag) 0x0D(Type B tag)
As to tags type, please refer to Annex 1.
UID: Input. Pointed to the 8 bytes of tags UID value with least significant byte
first. When operating in Addressed mode, UID value should be given. When
operating in Selected mode, UID value will be neglected.
BlockNum: Input. The block number of the block to write data into.
Data: Iutput. Pointed to the data to be written into the block with the size of 4
or 8 bytes with least significant byte first..
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x0F.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x0F
ISO15693 operation error with error explanation code in
ErrorCode. Please refer to ISO15693 error code
definition
Other
Please refer to Function Return Value Definition

15

2.2.7

Read the content of several consecutive blocks and their security status:
ReadMultipleBlock()
Function description:
This function is used to read out the content of several consecutive blocks and
their security status bytes of the designated tag.
Usage:
long WINAPI ReadMultipleBlock(unsigned char *ComAddr, unsigned char
*State, unsigned char *UID, unsigned char BlockNum, unsigned char
BlockCount, unsigned char *BlockSecStatus, unsigned char *Data, unsigned
char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
State: Input. Operation mode indicator byte defined as follows:
Block size = 4 bytes Addressed mode: 0x00
Selected mode: 0x01
Block size = 8 bytes Addressed mode: 0x04
Selected mode: 0x05
UID: Input. Pointed to the 8 bytes of tags UID value with least significant byte
first. When operating in Addressed mode, UID value should be given. When
operating in Selected mode, UID value will be neglected.
BlockNum: Input. The beginning block number of the blocks to read.
BlockCount: Input. The number of the blocks to read. The maximum number is
12 when block size is 4 bytes and the maximum number is 6 when block size is
8 bytes.
BlockSecStatus: Output. Pointed to the security status values of the designated
blocks. The size of BlockSecStatus is BlockCount bytes.
Data: Output. Pointed to the block content data with the size of 4 (or
8)*BlockCount bytes (least significant byte first).
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x0F.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x0F
ISO15693 operation error with error explanation code in
ErrorCode. Please refer to ISO15693 error code
definition
Other
Please refer to Function Return Value Definition

16

2.2.8

Permanently write-protected a block of the designated tag: LockBlock()


Function description:
This function is used to lock a block of the designated tag. When a block is
locked, it will be permanently write-protected and its content could not be
altered.
Usage:
long WINAPI LockBlock(unsigned char *ComAddr, unsigned char *State,
unsigned char *UID, unsigned char BlockNum, unsigned char *ErrorCode,
long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
State: Input. Operation mode indicator byte defined as follows:
Addressed mode: 0x00( Type A tag); 0x08(Type B tag),
Selected mode: 0x01( Type A tag) ;0x09(Type B tag).
about tag type,please refer to Annxe 1.
UID: Input. Pointed to the 8 bytes of tags UID value with least significant byte
first. When operating in Addressed mode, UID value should be given. When
operating in Selected mode, UID value will be neglected.
BlockNum: Input. The block number of the block to lock.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x0F.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x0F
ISO15693 operation error with error explanation code in
ErrorCode. Please refer to ISO15693 error code
definition
Other
Please refer to Function Return Value Definition

17

2.2.9

Change designated tags DSFID: WriteDSFID ()


Function description:
This function is used to write the value of the designated tags Data Storage
Format Identifier.
Usage:
long WINAPI WriteDSFID (unsigned char *ComAddr, unsigned char *State,
unsigned char *UID, unsigned char DSFID, unsigned char *ErrorCode, long
FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
State: Input. Operation mode indicator byte defined as follows:
Addressed mode: 0x00( Type A tag) 0x08(Type B tag)
Selected mode: 0x01( Type A tag) 0x09(Type B tag)
As to tags type, please refer to Annex 1.
UID: Input. Pointed to the 8 bytes of tags UID value with least significant byte
first. When operating in Addressed mode, UID value should be given. When
operating in Selected mode, UID value will be neglected.
DSFID: Input. The value of the tags Data Storage Format Identifier.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x0F.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x0F
ISO15693 operation error with error explanation code in
ErrorCode. Please refer to ISO15693 error code
definition
Other
Please refer to Function Return Value Definition

18

2.2.10

Permanently lock the DSFID of designated tag: LockDSFID()


Function description:
This function is used to permanently lock the DSFID value of the designated
tag.
Usage:
long WINAPI LockDSFID(unsigned char *ComAddr, unsigned char *State,
unsigned char *UID, unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
State: Input. Operation mode indicator byte defined as follows:
Addressed mode: 0x00( Type A tag) 0x08(Type B tag)
Selected mode: 0x01( Type A tag) 0x09(Type B tag)
As to tags type, please refer to Annex 1.
UID: Input. Pointed to the 8 bytes of tags UID value with least significant byte
first. When operating in Addressed mode, UID value should be given. When
operating in Selected mode, UID value will be neglected.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x0F.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x0F
ISO15693 operation error with error explanation code in
ErrorCode. Please refer to ISO15693 error code
definition
Other
Please refer to Function Return Value Definition

19

2.2.11

Set the tag into Ready status: ResetToReady()


Function description:
This function is used to set the tag into ready status.
Usage:
long WINAPI ResetToReady(unsigned char *ComAddr, unsigned char *State,
unsigned char *UID, unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
State: Input. Operation mode indicator byte defined as follows:
Addressed mode: 0x00
Selected mode: 0x01
UID: Input. Pointed to the 8 bytes of tags UID value with least significant byte
first. When operating in Addressed mode, UID value should be given. When
operating in Selected mode, UID value will be neglected.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x0F.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x0F
ISO15693 operation error with error explanation code in
ErrorCode. Please refer to ISO15693 error code
definition
Other
Please refer to Function Return Value Definition

20

2.2.12

Set the tag into Selected status: Select()


Function description:
This function is used to set the tag into selected status.
Usage:
long WINAPI Select(unsigned char *ComAddr, unsigned char *UID, unsigned
char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
UID: Input. Pointed to the 8 bytes of tags UID value with least significant byte
first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x0F.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x0F
ISO15693 operation error with error explanation code in
ErrorCode. Please refer to ISO15693 error code
definition
Other
Please refer to Function Return Value Definition

21

2.2.13

Set the tag into Quiet status: StayQuiet()


Function description:
This function is used to set the designated tag into Quiet status.
Usage:
long WINAPI StayQuiet(unsigned char *ComAddr, unsigned char *UID,
unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
UID: Input. Pointed to the 8 bytes of tags UID value with least significant byte
first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x0F.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x0F
ISO15693 operation error with error explanation code in
ErrorCode. Please refer to ISO15693 error code
definition
Other
Please refer to Function Return Value Definition

22

2.3)
2.3.1

ISO14443A Function
Detected that if any ISO14443A tag in the RF field: ISO14443ARequest()
Function description:
This function is used to detect that if any ISO14443A tag is in the RF field
and return the tag type if a tag responds.
Usage:
long WINAPI ISO14443ARequest (unsigned char *ComAddr, unsigned char
Mode, unsigned char *Tagtype,unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr:Input. Pointed to the address of the reader.
Mode: Input. request mode.
Mode=01: request for all tag.
Mode=00: request for all tag except the tag in HALT State.
Tagtype: Output. Pointed to the 2 bytes array describing the tag type with
least significant byte first.
Tagtype [0] = 0x44: UltraLight;
Tagtype [0] = 0x04: Mifare one S50;
Tagtype [0] = 0x02: Mifare one S70;
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

23

2.3.2

ISO14443A Anti-collision procedure: ISO14443AAnticoll ()


Function description:
This function is used to carry out the anti-collision procedure and return the
unique serial number (UID) of one tag in the RF field, This function allows
only one tag placed in the RF field at the same time.
Usage:
long WINAPI ISO14443AAnticoll(unsigned char *ComAddr, unsigned char
Reserved ,unsigned char *UID,unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
Reserved: Input. Reserved for future use with default value 0.
UID: Output. Pointed to 4 bytes tags UID with least significant byte first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

24

2.3.3

ISO14443A Anti-Collision procedure: ISO14443AAnticoll2()


Function description:
This function is used to carry out the anti-collision procedure and return the
UID of one tag in the RF field.
Usage:
long WINAPI ISO14443AAnticoll2(unsigned char *ComAddr ,unsigned
char Encoll, unsigned char Reserved, unsigned char *UID, unsigned char
*ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
Encoll: Input.
Encoll = 1: Enable multiple tags in the RF field at the same time.
Encoll = 0: Disable multiple tags in the RF field at the same time.
Reserved: Input. Reserved for future use with default value 0.
UID: Output. Pointed to 4 bytes tags UID with least significant byte first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

25

2.3.4

Select a tag in the RF field by its UID: ISO14443ASelect()


Function description:
This function is used to select a specified tag in the RF field by its UID. The
tag will be in selected status if the operation succeeds.
Usage:
long WINAPI ISO14443ASelect(unsigned char *ComAddr, unsigned char
*UID, unsigned char *Size, unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
UID:Input. Pointed to 4 bytes UID with least significant byte first.
Size: Output.Pointed to a coded number stand for the selected tags capacity.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

26

2.3.5

Save KEY in the readers EEPROM: ISO14443ALoadKey()


Function description:
This function is used to save a tags sector key in the readers EEPROM
Usage:
long WINAPI ISO14443ALoadKey(unsigned char *ComAddrunsigned char
Mode, unsigned char
SecNum, unsigned char *Key, unsigned char
*ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
Mode: Input. save the key as KEY A or KEY B
Mode = 0: save the key as KEY A;
Mode = 1: save the key as KEY B.
SecNum:Input. The saving location in the readers EEPROM area.
Key:Input. Pointed to 6 bytes KEY with least significant byte first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

27

2.3.6 Authenticate

with

the

KEY

stored

in

readers

EEPROM:

ISO14443AAuthentication()
Function description:
This function is used to fulfill the mutual authentication procedure between
the tag and the reader using the KEY stored in the readers EEPROM. The
tags sector data can be read or written only after successful authentication.
Usage:
long WINAPI ISO14443AAuthentication (unsigned char *ComAddr,
unsigned char Mode, unsigned char SecNum, unsigned char *ErrorCode,
long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
Mode: Input. Authenticate with KEY A or KEY B
Mode = 0: Authenticate with KEY A;
Mode = 1: Authenticate with KEY B.
SecNum: Input. The sector number of the sector to be authenticated. The
KEY is stored in readers key-storage EEPROM at the location with the same
sector number as SecNum.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

28

2.3.7

Cross-authenticate with the KEY stored in readers EEPROM:


ISO14443AAuthentication2()
Function description:
This function is used to fulfill the mutual authentication procedure between
the tag and the reader using the KEY stored in the readers EEPROM. The
tags sector data can be read or written only after successful authentication.
Usage:
long WINAPI ISO14443AAuthentication2(unsigned char *ComAddr,
unsigned char Mode, unsigned char AccessSector, unsigned char KeySector,
unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
Mode:Input. Authenticate with KEY A or KEY B.
Mode = 0: Authenticate with KEY A;
Mode = 1: Authenticate with KEY B.
AccessSector: Input. The sector number of the sector to be authenticated.
KeySector: Input. The sector number in readers key-storage EEPROM.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

29

2.3.8

Directly authenticate with the given KEY: ISO14443AAuthKey()


Function description:
This function is used to fulfill the mutual authentication procedure between
the tag and the reader using the KEY given directly by the user. The tags
sector data can be read or written only after successful authentication.
Usage:
long WINAPI ISO14443AAuthKey (unsigned char *ComAddr ,unsigned
char Mode, unsigned char AuthSector, unsigned char *Key, unsigned char
*ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
Mode: Input. Authenticate with KEY A or KEY B
Mode = 0: Authenticate with KEY A.
Mode = 1: Authenticate with KEY B.
AuthSector: Input. The sector to be authenticated.
Key:Input. Pointed to a 6 bytes KEY with least significant byte first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

30

2.3.9

Initialize

the

block

to

value-block

with

designated

value:

ISO14443AInitValue()
Function description:
Initialize the block to value-block with designated value.
Usage:
long WINAPI ISO14443AInitValue(unsigned char *ComAddr, unsigned char
BlockNum, unsigned char *InitValueData, unsigned char *ErrorCode, long
FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
BlockNum: Input. The absolute block number which is ranging:
0~63 for Mifare 1 S50
0~255 for Mifare 1 S70
0~15 for Mifare UltraLight (the BlockNum is the page number).
InitValueData:Input. 4 bytes initializing value with least significant byte first.
(For example, to initialize the value-block with 1, InitvalueData[] shoule be
0x01,0x00,0x00,0x00}.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

31

2.3.10 Increase the value of a value-block: ISO14443AIncrement()


Function description:
This function is used to increase the value of a value-block of the tag. This
operation can only be applied to a value-block.
Usage:
long
WINAPI ISO14443AIncrement(unsigned char *ComAddr, unsigned
char BlockNum, unsigned char *IncrementData, unsigned char *ErrorCode,
long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
BlockNum: Input. The absolute block number which is ranging:
0~63 for Mifare 1 S50
0~255 for Mifare 1 S70
IncrementData: Input. 4 bytes increment value with least significant byte
first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

32

2.3.11 Decrease the value of a value-block: ISO14443ADecrement()


Function description:
This function is used to decrease the value of a value-block. This operation
can only be applied to a value-block.
Usage:
long
WINAPI
ISO14443ADecrement(unsigned char *ComAddr,
unsigned char BlockNum, unsigned char * DecrementData, unsigned char
*ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
BlockNum: Input. The absolute block number which is ranging:
0~63 for Mifare 1 S50
0~255 for Mifare 1 S70
DecrementData: Input. 4 bytes decrement value with least significant byte
first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

33

2.3.12 Read the content of a value-block: ISO14443AReadValue()


Function description:
This function is used to read out the content of a value-block.
Usage:
long WINAPI ISO14443AReadValue(unsigned char *ComAddr, unsigned
char BlockNum, unsigned char *Value, unsigned char *ErrorCode, long
FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
BlockNum: Input. The absolute block number which is ranging:
0~63 for Mifare 1 S50
0~255 for Mifare 1 S70
Value: Output. Pointed to 4 bytes value data with least significant byte first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

34

2.3.13 valueblock related operation with the result transferred to another block
in the same sector: ISO14443AValue()
Function description:
This function is used to perform value-block related operation and transfer
the result to another block. The two blocks should both have value-block
format and are in the same sector. The value-block related operation includes
increment, decrement and restore.
Usage:
long WINAPI ISO14443AValue(unsigned char *ComAddr, unsigned char
Mode, unsigned char SourceAddr, unsigned char *ValueData, unsigned char
TargetAddr, unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
Mode:Input.operation to perform.
Mode = 0xC0: decrement
Mode = 0xC1: increment
Mode = 0xC2: restore
SourceAddr: Input. The absolute block number which is ranging:
0~63 for Mifare 1 S50
0~255 for Mifare 1 S70
ValueData: Input. Pointed to 4 bytes increment or decrement value data with
least significant byte first.
TargetAddr: Input. The absolute block number which is ranging:
0~63 for Mifare 1 S50
0~255 for Mifare 1 S70
ErrorCode:Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

35

2.3.14 Read out one memory block: ISO14443ARead()


Function description:
This function is used to read out one block data of the tag. The block size is
16 bytes.
Usage:
long WINAPI ISO14443ARead(unsigned char *ComAddr, unsigned char
BlockNum ,unsigned char *ReadData, unsigned char *ErrorCode, long
FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
BlockNum: Input. The absolute block number which is ranging:
0~63 for Mifare 1 S50
0~255 for Mifare 1 S70
0~15 for Mifare UltraLight (the BlockNum is the page number).
ReadData: Output. Pointed to 16 bytes data having been read out with least
significant byte first.
For Mifare UltraLight, the content of page (BlockNum), page (BlockNum+1),
page (BlockNum+2), page (BlockNum+3) will be read out. Additionally, a
roll back is implemented. For example, as to the Mifare UltraLight, if
BlockNum is 0x0E, the contents of page 0x0E, 0x0F, 0x00 and 0x01 will
be readed out.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

36

2.3.15 Write data into one memory blcok: ISO14443AWrite()


Function description:
This function is used to write data into one block of the tag.
Usage:
long WINAPI ISO14443AWrite(unsigned char *ComAddr, unsigned char
BlockNum, unsigned char *WrittenData, unsigned char *ErrorCode, long
FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
BlockNum: Input. The absolute block number which is ranging:
1~63 for Mifare 1 S50
1~255 for Mifare 1 S70
WrittenData: Input. Pointed to 16 bytes data for writing with least significant
byte first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

37

2.3.16 Read the contents of a value-block into the tags buffer register:
ISO14443ARestore()
Function description:
Read out the content of a value-block and store it in tags internal buffer
register
Usage:
long WINAPI ISO14443ARestore(unsigned char *ComAddr, unsigned char
BlockNum, unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
BlockNum: Input. The absolute block number which is ranging:
0~63 for Mifare 1 S50
0~255 for Mifare 1 S70
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

38

2.3.17 Transfer the content of the tags buffer register to a value-block:


ISO14443ATransfer()
Function description:
This function is used to transfer the content of tags internal buffer register to
a value-block.
Usage:
long WINAPI ISO14443ATransfer(unsigned char *ComAddr, unsigned char
BlockNum, unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
BlockNum: Input. The absolute block number which is ranging:
1~63 for Mifare 1 S50
1~255 for Mifare 1 S70
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

39

2.3.18 Compare the data in tag with given data :ISO14443ACheckWrite()


Function description:
Compare the data written in the tag with given data. In this operation, the
reader uses the KEY in its key-storage EEPROM with the same sector
number as the to-be-checked blocks sector number.
Usage:
long WINAPI ISO14443ACheckWrite(unsigned char *ComAddr, unsigned
char *UID,unsigned char Mode, unsigned char BlockNum, unsigned char
*Data, unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
UID: Input. Pointed to the 4 bytes of tags UID value with least significant
byte first.
Mode: Input. Authentication mode used.
Mode = 0: Authenticate with KEY A.
Mode = 1: Authenticate with KEY B.
BlockNum: Input. The absolute block number of the block to be checked
which is ranging:
0~63 for Mifare 1 S50
0~255 for Mifare 1 S70
Data: Input.16 bytes data for checking with least significant byte first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

40

2.3.19 Ultralight tags Anti-Collision procedure: ISO14443AULAnticoll()


Function description:
This function is used to carry out UltraLight anti-collision procedure.
Usage:
long WINAPI ISO14443AULAnticoll(unsigned char *ComAddr,unsigned
char Reserved ,unsigned char *UID, unsigned char *ErrorCode, long
FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
Reserved:Input. Reserved with default value 0;
UID:Output .Point to the 7 bytes tags UID with least significant byte first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

41

2.3.20 Write data into UltraLight tag: ISO14443AULWrite()


Function description:
This function is used to write data into UltraLight tag including programing
the LOCK bytes in page 2, the OTP bytes in page 3 and the data bytes in
pages 4 to 15.
Usage:
long WINAPI ISO14443AULWrite(unsigned char *ComAddr unsigned char
ULPage,unsigned char *Data, unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
ULPage:Input. UltraLights page number.
Data: Input. 4 bytes data to write with least significant byte first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

42

2.3.21 Set active tag into Halt status: ISO14443AHalt()


Function description:
This function is used to set the current active tag into Halt status
Usage:
long WINAPI ISO14443AHalt(unsigned char *ComAddr,unsigned char
*ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

43

2.3.22 Read the content of the readers EEPROM: ISO14443AReadE2()


Function description:
This function is used to Read out the content of the readers EEPROM.
Usage:
long WINAPI ISO14443AReadE2(unsigned char *ComAddr, unsigned char
StartAddr, unsigned char DataLength, unsigned char *ReadE2Data,
unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
StartAddr: Input. Start address of the EEPROM to be read out (it should less
than 0x80).
DataLength: Input. Byte length of the data to be read out (less than 20 bytes).
ReadE2Data:Output. Pointed to (DataLength) bytes data read out with least
significant byte first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

44

2.3.23 Write data into the readers EEPROM: ISO14443AWriteE2()


Function description:
This function is used to write data into the readers EEPROM.
Usage:
long WINAPI ISO14443AWriteE2(unsigned char *ComAddr, unsigned char
E2Addr, unsigned char DataLength, unsigned char *Data, unsigned char
*ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
E2Addr:Input . Start address of the EEPROM to write (0x30-0x7F).
DataLength:Input. Byte length of the data to write (less than 20 bytes).
Data:Input: Pointed to (DataLength) bytes data to write with least significant
byte first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x10.
FrmHandle: Input. Handle of the corresponding communication port the
reader is connected. The handle value is got when calling function
AutoOpenComPort or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x10
ISO14443A operation error with error explanation code in
ErrorCode. Please refer to ISO14443A error code definition
Other
Please refer to Function Return Value Definition

45

2.4)
2.4.1)

ISO14443B Function
Detected ISO14443B tag in the RF field: ISO14443BRequest()
Function description:
This function is used to detect ISO14443B tag in the RF field and return the
tags PUPI, Application data, Protocol information if a tag responds.
Usage:
long WINAPI ISO14443BRequest(unsigned char *ComAddr, unsigned char
Mode, unsigned char AFI, unsigned char *PUPI, unsigned char
*ApplicationData, unsigned char *ProtocolInfo, unsigned char *ErrorCode,
long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
Mode: Input. request mode.
Mode=01: request for all tags.
Mode=00: request for all tags except the tags in HALT State.
AFI: Input. Application Family Identifier. AFI can be used to select the family
and subfamily of tags which the reader is targeting. If AFI set to 0, all tags in
the RF field will responds.
PUPI: Output. Pointed to 4 bytes tags Pseudo Unique PICC Identifier with
least significant byte first.
ApplicationData: Output. Pointed to 4 bytes tags application data with least
significant byte first.
ProtocolInfo: Output. Pointed to 3 bytes tags protocol information.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x1B.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x1B
ISO14443B operation error with error explanation code in
ErrorCode. Please refer to ISO14443B error code definition
Other
Please refer to Function Return Value Definition

46

2.4.2)

ISO14443B Anti-Collision procedure: ISO14443BAnticoll()


Function description:
This function is used to carry out the anti-collision procedure and return the
Pseudo Unique PICC Identifier (PUPI),
ApplicationData
and
Protocol
information of one tag in the RF field.
Usage:
long WINAPI ISO14443BAnticoll(unsigned char *ComAddr, unsigned char
Mode, unsigned char AFI, unsigned char *PUPI, unsigned char
*ApplicationData, unsigned char *ProtocolInfo, unsigned char *ErrorCode,
long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
Mode: Input. request mode.
Mode=01: request for all tags.
Mode=00: request for all tags except the tag in Halt State.
AFI: Input. Application Family Identifier. AFI can be used to select the family
and subfamily of tags which the reader is targeting. If AFI set to 0, all tags in
the RF field will responds.
PUPI: Output. Pointed to 4 bytes tags Pseudo Unique PICC Identifier.
ApplicationData: Input. Pointed to 4 bytes tags application data.
ProtocolInfo: Output. Pointed to 3 bytes tags protocol information.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x1B.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x1B
ISO14443B operation error with error explanation code in
ErrorCode. Please refer to ISO14443B error code definition
Other
Please refer to Function Return Value Definition

47

2.4.3) Select a specified tag: ISO14443BSelect()


Function description:
This function is used to select a specified tag in the RF field by its PUPI. The
tag will be in selected status if the operation succeeds
Usage:
long WINAPI ISO14443BSelect(unsigned char *ComAddr, unsigned char
PUPI, unsigned char CIDI,unsigned char Param1, unsigned char Param2,
unsigned char Param3, unsigned char Param4, unsigned char *CIDO,
unsigned char MBL , unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
PUPI: Iutput. Pointed to 4 bytes tags Pseudo Unique PICC Identifier with least
significant byte first.
CIDI: Input. Card IDentifier with a value ranging from 0 to 14.
Param1: Input. EOF and SOF break definition.
Value

Description

0
(default)

dont break EOF and SOF

dont break EOF, break SOF

dont break SOF, break EOF

break EOF and SOF

Param2: Input.
Bit3~Bit0: Minimum delay before tags reply after the end of a command
sent by reader (TR0)
Value
Bit3~Bit0

TR0

0000
(default)

64/fs

0001

48/fs

0010

16/fs

other

Reserved

Bit7~Bit4: Minimum delay between subcarrier modulation start and


beginning of tags data transmission (TR1).
Value
Bit7~Bit4

TR1

0000
(default)

80/fs

0001

64/fs

0010

16/fs

other

Reserved

48

Param3: Input. Define maximum frame size that can be received by reader.
Value

Frame Size (byte)

Reserved

Reserved

32

40

48

5(default)

64

96

128

256

other

Reserved

Param4: Input. Bit rate selection.


Bit3~Bit0: define Bit rate from reader to tag
(only 106kbit/s supported in current firmware version)
Value
Bit3~Bit0

Bit Rate

0000
(default)

106kbit/s

0001

212kbit/s

0010

424kbit/s

0011

847kbit/s

other

Reserved

Bit7~Bit4: define Bit rate from tag to reader


(only 106kbit/s supported in current firmware version)
Value
Bit7~Bit4

Bit Rate

0000
(default)

106kbit/s

0001

212kbit/s

0010

424kbit/s

0011

847kbit/s

CIDO: Output. Its value equals CIDI if the function succeeds. Otherwise, its
value should be neglected.
MBLI: Output. Its value indicates the Maximum Buffer Legnth Index if the
function succeeds. Otherwise, its value should be neglected. MBLI is the
maximum frame size that can be received by the tag. If the tag does not support
this function, it will set the MBLI to 0.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x1B.
49

FrmHandle: Input. Handle of the corresponding communication port the reader


is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x1B
ISO14443B operation error with error explanation code in
ErrorCode. Please refer to ISO14443B error code definition
Other
Please refer to Function Return Value Definition

50

2.4.4)

ISO14443B transparent command: ISO14443BTransparentCmd ()


Function description:
This function is used to turn the reader into an RF front-end engine to access
tags. The reader encapsulates the hosts data in ISO14443B protocol format and
sends them to tags. Then, the reader decodes the feedback data from tag and
sends back the results to the host.
Usage:
long WINAPI ISO14443BTransparentCmd(unsigned char *ComAddr,
unsigned char Time_M, unsigned char Time_N, unsigned char CMD_Length,
unsigned char RSP_Length, unsigned char *CMD_Data, unsigned char
*RSP_Data, unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
Time_M,Time_N: Input. Set time parameter for reader to start decoding the
feedback from tag.
Time_M: 0~255;
Time_N: 0~21.
Time = Time _ M *

2Time _ N
us
13.56MHz

CMD_Length: Input. The byte length of the data the reader should send to the
tag with value ranging 1 to 63.
RSP_Length: Input. The response data byte length expected from the tag which
is ranging from 0 to 100.
CMD_Data: Input. Pointed to the data that should be sent to the tag by reader
with least significant byte first.
RSP_Data: Output. Pointed to the tags response data with least significant byte
first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x1B.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
0
0x1B
Other

Comment
Success
ISO14443B operation error with error explanation code in
ErrorCode. Please refer to ISO14443B error code definition
Please refer to Function Return Value Definition

51

2.4.5) Set active ISO14443B tag into Halt status: ISO14443BHalt()


Function description:
This function is used to set the current active ISO14443B tag into HALT status
Usage:
long WINAPI ISO14443BHalt(unsigned char *ComAddr, unsigned char
*PUPI,unsigned char *ErrorCode, long FrmHandle);
Parameter:
ComAddr: Input. Pointed to the address of the reader.
PUPI: Input. Pointed to 4 bytes tags Pseudo Unique PICC Identifier with least
significant byte first.
ErrorCode: Output. Pointed to an explanation byte when the function return
value equals 0x1B.
FrmHandle: Input. Handle of the corresponding communication port the reader
is connected. The handle value is got when calling function AutoOpenComPort
or OpenComPort.
Returns:
Return Value
Comment
0
Success
0x1B
ISO14443B operation error with error explanation code in
ErrorCode. Please refer to ISO14443B error code definition
Other
Please refer to Function Return Value Definition

52

3) Function Return Value Definition


Value
0x00
0x01
0x02
0x03
0x04
0x05
0x06
0x0A
0x0B

0x0E
0x0F
0x10
0x1B
0x1F
0x30
0x31
0x32
0x33
0x35
0x36
0x37
0x38

Comment
OK
Operation number error
Command not support
Operation number rangr number error
Command can not execute at current
RF field inactive
EEPROM error
Have not collected one tags UID before user-defined
Inventory-ScanTime overflows
Have not collected all tags UIDs before user-defined
InventoryScanTime overflows or 16 tags UID has been
collected but there are still other tag in the field to collect their
UIDs.
No active tag in the RF field
ISO156963 operation error.
ISO14443A operation error.
ISO14443B operation error.
Protocol mode error. For example: Running ISO14443A
command under ISO15693 mode.
Communication error
Return datas CRC check error
Length of return data error
Communication busy
Port opened
Port closed
Invalid handle
Invalid port

53

4) Error Code Definition


4.1) ISO15693 error code definition (when function return 0x0f):
ErrorCode Comment
0x01
Commands not support. For example: invalid command code
0x02
Command not recognised. For example: a format error occurred
0x03
Operation not support.
0x0f
Unkown error.
0x10
The specified block is not available(doesnt exist).
0x11
The specified block is already locked and thus can not be locked
again.
0x12
The specified block is locked and its content can not be changed
0x13
The specofied block was not successfully programed.
0x14
The specified block was not successfully locked.
0xA0~0xDF Reserved for future use
4.2) ISO14443A error code definition (when function return 0x10) :
ErrorCode Comment
0x1F
Halt failed
0x20
No active ISO14443A tag in the RF field.
0x21
Select failed
0x22
Authentication failed
0x23
Read failed
0x24
Write failed
0x25
E-wallet initialization failed
0x26
Readvalue failed
0x27
Decrement/Increment failed
0x28
Transfer failed
0x29
Write/Read E2PROM failed
0x2A
Load key failed
0x2B
Checkwrite failed
0x2C
Data for Checkwrite error
0x2D
Value operation failed
0x2E
UltraLight tag write failed
0x30
Anticollision failed
0x31
Forbidding multiple tag in RF field at the same time
0x32
MifareOne and Ultralight collision error
0x33
UltraLight tag collision error

54

4.3) ISO14443B error code definition (when function return 0x1B) :


ErrorCode Comment
0x34
No active ISO14443B tag in the RF field.
0x35
Select failed
0x36
Halt failed
0x37
Excetu trasparent command failed
0x38
Anti-collision failed

5) Annex 1
Some mainstream ISO15693 tags feature
Manufacturer

Manu.
Code

Infineon
(ISO Address mode)

0x05

STMicroelectronics
(LRI512)

Block Information

TYPE

Number

Size

256(user range:0249)

4bytes

64(user range:057)

4bytes

0x02

16(user range:0~15)

4bytes

Fujitsu
(MB89R116)

0x08

256(user range:0249)

8bytes

Philips
(I-Code SLI)

0x04

32(user range:027)

4bytes

Texas Instruments
(Tag-it HF-I)

0x07

64(user range:063)

4bytes

50
(user available range:1348)

8 bytes

14
(user available range:311)

4 bytes

EM Microelectronics

0x16

S
S

As to tags not included in the appendix, please refer to their datasheets.

55

Anda mungkin juga menyukai