ACR1281U-C8 – Application Programming Interface
Version 1.00
www.acs.com.hk
Page 34 of 52
5.4. ACR120_Write
Writes a block.
High Level API
:
DLLAPI INT16 AC_DECL
ACR120_Write( INT16 hReader,
UINT8 Block,
UINT8 pBlockData[16]);
Parameters
Description
hReader
Handle to the reader returned by AC_Open()
Block
Block number
pblockData
Contains the data read. It is
AC_MIFARE_DATA_LEN(16) bytes long.
Return Value
INT16
Result code. 0 means success.
Table 23
: ACR120_Write Command Description
Low Level Frame Structure:
Command: From PC to Reader (22 bytes)
Command Code
(1 byte)
Command Data Length
(1 byte)
Instruction Code
(1 byte)
Data Length
(1 byte)
Data
(1 byte)
(16 bytes)
E0h
13h
0Ah
11h
Block
pBlockData
Response: From Reader to PC (21 bytes) <<Success>>
Respons
e Code
(1 byte)
Response Status
(2 bytes)
Response Data
length
(2 bytes)
Response Data
(16 bytes)
E1h
INT16 (>=0)
0010h
BlockDataStored
Note:
The Response Data (BlockDataStored) is used for comparison only.
Or
Response: From Reader to PC (5 bytes) << Fail>>
Response Code
(1 byte)
Response Status
(2 bytes)
Response Data Length
(2 byes)
E2h
INT16 (<0)
0000h