6
Content
1)
2)
II
2) Function Explanation
2.1)
General Function
2.1.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)
2.1.3)
2.1.4)
2.1.5)
2.1.6)
2.1.7)
2.1.8)
2.1.9)
2.1.10)
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)
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)
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)
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)
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
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
11
2.2.3
12
2.2.4
13
2.2.5
14
2.2.6
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
17
2.2.9
18
2.2.10
19
2.2.11
20
2.2.12
21
2.2.13
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
24
2.3.3
25
2.3.4
26
2.3.5
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
29
2.3.8
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
32
33
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
36
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
39
40
41
42
43
44
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)
47
Description
0
(default)
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
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
Reserved
Reserved
32
40
48
5(default)
64
96
128
256
other
Reserved
Bit Rate
0000
(default)
106kbit/s
0001
212kbit/s
0010
424kbit/s
0011
847kbit/s
other
Reserved
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
50
2.4.4)
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
52
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
54
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
55